{"version":3,"file":"application-V_MPygU3.js","sources":["../../../node_modules/object-assign/index.js","../../../node_modules/react/cjs/react.production.min.js","../../../node_modules/react/index.js","../../../__vite-browser-external","../../../node_modules/search-insights/dist/search-insights-browser.cjs.min.js","../../../node_modules/search-insights/index-browser.cjs.js","../../../node_modules/scheduler/cjs/scheduler.production.min.js","../../../node_modules/scheduler/index.js","../../../node_modules/react-dom/cjs/react-dom.production.min.js","../../../node_modules/react-dom/index.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/lib/windowOrGlobal.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/lib/ScriptCache.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/lib/GoogleApi.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/GoogleApiComponent.js","../../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/prop-types/index.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/lib/String.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/components/Marker.js","../../../node_modules/react-dom/cjs/react-dom-server.browser.production.min.js","../../../node_modules/react-dom/server.browser.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/components/InfoWindow.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/components/HeatMap.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/lib/arePathsEqual.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/components/Polygon.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/components/Polyline.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/components/Circle.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/lib/areBoundsEqual.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/components/Rectangle.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/lib/cancelablePromise.js","../../../node_modules/@watermarkchurch/google-maps-react/node_modules/google-maps-react/dist/index.js","../../../node_modules/@watermarkchurch/google-maps-react/index.js","../../../app/frontend/javascripts/lib/connectors/googleMaps.ts","../../../node_modules/react-fast-compare/index.js","../../../node_modules/react-instantsearch-core/dist/es/core/context.js","../../../node_modules/react-instantsearch-core/dist/es/core/utils.js","../../../node_modules/react-instantsearch-core/dist/es/core/createConnector.js","../../../node_modules/react-instantsearch-core/dist/es/core/highlight.js","../../../node_modules/react-instantsearch-core/dist/es/core/version.js","../../../node_modules/react-instantsearch-core/dist/es/core/translatable.js","../../../node_modules/react-instantsearch-core/dist/es/core/indexUtils.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectConfigure.js","../../../node_modules/react-instantsearch-core/dist/es/widgets/Configure.js","../../../node_modules/@algolia/events/events.js","../../../node_modules/algoliasearch-helper/src/functions/inherits.js","../../../node_modules/algoliasearch-helper/src/DerivedHelper/index.js","../../../node_modules/algoliasearch-helper/src/functions/escapeFacetValue.js","../../../node_modules/algoliasearch-helper/src/functions/merge.js","../../../node_modules/algoliasearch-helper/src/functions/objectHasKeys.js","../../../node_modules/algoliasearch-helper/src/functions/omit.js","../../../node_modules/algoliasearch-helper/src/requestBuilder.js","../../../node_modules/algoliasearch-helper/src/functions/defaultsPure.js","../../../node_modules/algoliasearch-helper/src/functions/find.js","../../../node_modules/algoliasearch-helper/src/functions/intersection.js","../../../node_modules/algoliasearch-helper/src/functions/valToNumber.js","../../../node_modules/algoliasearch-helper/src/utils/isValidUserToken.js","../../../node_modules/algoliasearch-helper/src/SearchParameters/RefinementList.js","../../../node_modules/algoliasearch-helper/src/SearchParameters/index.js","../../../node_modules/algoliasearch-helper/src/functions/compact.js","../../../node_modules/algoliasearch-helper/src/functions/findIndex.js","../../../node_modules/algoliasearch-helper/src/functions/formatSort.js","../../../node_modules/algoliasearch-helper/src/functions/orderBy.js","../../../node_modules/algoliasearch-helper/src/SearchResults/generate-hierarchical-tree.js","../../../node_modules/algoliasearch-helper/src/SearchResults/index.js","../../../node_modules/algoliasearch-helper/src/version.js","../../../node_modules/algoliasearch-helper/src/algoliasearch.helper.js","../../../node_modules/algoliasearch-helper/index.js","../../../node_modules/react-instantsearch-core/dist/es/widgets/Index.js","../../../node_modules/react-instantsearch-core/dist/es/core/createStore.js","../../../node_modules/react-instantsearch-core/dist/es/core/createWidgetsManager.js","../../../node_modules/react-instantsearch-core/dist/es/core/createInstantSearchManager.js","../../../node_modules/react-instantsearch-core/dist/es/core/metadata.js","../../../node_modules/react-instantsearch-core/dist/es/widgets/InstantSearch.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectCurrentRefinements.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectHighlight.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectHits.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectInfiniteHits.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectRefinementList.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectSearchBox.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectStateResults.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectStats.js","../../../node_modules/react-instantsearch-core/dist/es/connectors/connectToggleRefinement.js","../../../node_modules/classnames/index.js","../../../node_modules/react-instantsearch-dom/dist/es/core/utils.js","../../../node_modules/react-instantsearch-dom/dist/es/components/Panel.js","../../../node_modules/react-instantsearch-dom/dist/es/components/PanelCallbackHandler.js","../../../node_modules/react-instantsearch-dom/dist/es/components/ClearRefinements.js","../../../node_modules/react-instantsearch-dom/dist/es/widgets/ClearRefinements.js","../../../node_modules/react-instantsearch-dom/dist/es/components/Highlighter.js","../../../node_modules/react-instantsearch-dom/dist/es/components/Highlight.js","../../../node_modules/react-instantsearch-dom/dist/es/widgets/Highlight.js","../../../node_modules/react-instantsearch-dom/dist/es/components/Stats.js","../../../node_modules/react-instantsearch-dom/dist/es/widgets/Stats.js","../../../node_modules/react-instantsearch-dom/dist/es/components/ToggleRefinement.js","../../../node_modules/react-instantsearch-dom/dist/es/widgets/ToggleRefinement.js","../../../node_modules/algoliasearch/dist/algoliasearch.umd.js","../../../node_modules/es-errors/index.js","../../../node_modules/es-errors/eval.js","../../../node_modules/es-errors/range.js","../../../node_modules/es-errors/ref.js","../../../node_modules/es-errors/syntax.js","../../../node_modules/es-errors/type.js","../../../node_modules/es-errors/uri.js","../../../node_modules/has-symbols/shams.js","../../../node_modules/has-symbols/index.js","../../../node_modules/has-proto/index.js","../../../node_modules/get-intrinsic/node_modules/function-bind/implementation.js","../../../node_modules/get-intrinsic/node_modules/function-bind/index.js","../../../node_modules/hasown/node_modules/function-bind/implementation.js","../../../node_modules/hasown/node_modules/function-bind/index.js","../../../node_modules/hasown/index.js","../../../node_modules/get-intrinsic/index.js","../../../node_modules/call-bind/node_modules/function-bind/implementation.js","../../../node_modules/call-bind/node_modules/function-bind/index.js","../../../node_modules/es-define-property/index.js","../../../node_modules/gopd/index.js","../../../node_modules/define-data-property/index.js","../../../node_modules/has-property-descriptors/index.js","../../../node_modules/set-function-length/index.js","../../../node_modules/call-bind/index.js","../../../node_modules/call-bind/callBound.js","../../../node_modules/object-inspect/index.js","../../../node_modules/side-channel/index.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/node_modules/qs/lib/formats.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/node_modules/qs/lib/utils.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/node_modules/qs/lib/stringify.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/node_modules/qs/lib/parse.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/node_modules/qs/lib/index.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/dist/algolia-search/hidden-facets.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/dist/util.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/dist/algolia-search/index.js","../../../node_modules/lodash-es/_freeGlobal.js","../../../node_modules/lodash-es/_root.js","../../../node_modules/lodash-es/_Symbol.js","../../../node_modules/lodash-es/_getRawTag.js","../../../node_modules/lodash-es/_objectToString.js","../../../node_modules/lodash-es/_baseGetTag.js","../../../node_modules/lodash-es/isObject.js","../../../node_modules/lodash-es/isFunction.js","../../../node_modules/lodash-es/_coreJsData.js","../../../node_modules/lodash-es/_isMasked.js","../../../node_modules/lodash-es/_toSource.js","../../../node_modules/lodash-es/_baseIsNative.js","../../../node_modules/lodash-es/_getValue.js","../../../node_modules/lodash-es/_getNative.js","../../../node_modules/lodash-es/_defineProperty.js","../../../node_modules/lodash-es/_baseAssignValue.js","../../../node_modules/lodash-es/eq.js","../../../node_modules/lodash-es/_assignValue.js","../../../node_modules/lodash-es/_copyObject.js","../../../node_modules/lodash-es/identity.js","../../../node_modules/lodash-es/_apply.js","../../../node_modules/lodash-es/_overRest.js","../../../node_modules/lodash-es/constant.js","../../../node_modules/lodash-es/_baseSetToString.js","../../../node_modules/lodash-es/_shortOut.js","../../../node_modules/lodash-es/_setToString.js","../../../node_modules/lodash-es/_baseRest.js","../../../node_modules/lodash-es/isLength.js","../../../node_modules/lodash-es/isArrayLike.js","../../../node_modules/lodash-es/_isIndex.js","../../../node_modules/lodash-es/_isIterateeCall.js","../../../node_modules/lodash-es/_createAssigner.js","../../../node_modules/lodash-es/_baseTimes.js","../../../node_modules/lodash-es/isObjectLike.js","../../../node_modules/lodash-es/_baseIsArguments.js","../../../node_modules/lodash-es/isArguments.js","../../../node_modules/lodash-es/isArray.js","../../../node_modules/lodash-es/stubFalse.js","../../../node_modules/lodash-es/isBuffer.js","../../../node_modules/lodash-es/_baseIsTypedArray.js","../../../node_modules/lodash-es/_baseUnary.js","../../../node_modules/lodash-es/_nodeUtil.js","../../../node_modules/lodash-es/isTypedArray.js","../../../node_modules/lodash-es/_arrayLikeKeys.js","../../../node_modules/lodash-es/_isPrototype.js","../../../node_modules/lodash-es/_nativeKeysIn.js","../../../node_modules/lodash-es/_baseKeysIn.js","../../../node_modules/lodash-es/keysIn.js","../../../node_modules/lodash-es/assignInWith.js","../../../node_modules/lodash-es/_overArg.js","../../../node_modules/lodash-es/_getPrototype.js","../../../node_modules/lodash-es/isPlainObject.js","../../../node_modules/lodash-es/isError.js","../../../node_modules/lodash-es/attempt.js","../../../node_modules/lodash-es/_arrayMap.js","../../../node_modules/lodash-es/_baseValues.js","../../../node_modules/lodash-es/_customDefaultsAssignIn.js","../../../node_modules/lodash-es/_escapeStringChar.js","../../../node_modules/lodash-es/_nativeKeys.js","../../../node_modules/lodash-es/_baseKeys.js","../../../node_modules/lodash-es/keys.js","../../../node_modules/lodash-es/_reInterpolate.js","../../../node_modules/lodash-es/_basePropertyOf.js","../../../node_modules/lodash-es/_escapeHtmlChar.js","../../../node_modules/lodash-es/isSymbol.js","../../../node_modules/lodash-es/_baseToString.js","../../../node_modules/lodash-es/toString.js","../../../node_modules/lodash-es/escape.js","../../../node_modules/lodash-es/_reEscape.js","../../../node_modules/lodash-es/_reEvaluate.js","../../../node_modules/lodash-es/templateSettings.js","../../../node_modules/lodash-es/template.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/dist/media-gallery/view-all-link.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/dist/media-gallery/index.js","../../../node_modules/shallow-equal/arrays/index.js","../../../node_modules/react-autowhatever/node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/react-autowhatever/node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/react-autowhatever/node_modules/prop-types/index.js","../../../node_modules/section-iterator/dist/index.js","../../../node_modules/react-themeable/node_modules/object-assign/index.js","../../../node_modules/react-themeable/dist/index.js","../../../node_modules/react-autowhatever/dist/compareObjects.js","../../../node_modules/react-autowhatever/dist/SectionTitle.js","../../../node_modules/react-autowhatever/dist/Item.js","../../../node_modules/react-autowhatever/dist/ItemsList.js","../../../node_modules/react-autowhatever/dist/Autowhatever.js","../../../node_modules/react-autowhatever/dist/index.js","../../../node_modules/react-autosuggest/dist/theme.js","../../../node_modules/react-autosuggest/dist/Autosuggest.js","../../../node_modules/react-autosuggest/dist/index.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/dist/search-box/autocomplete.js","../../../node_modules/@watermarkchurch/react-instantsearch-components/dist/search-box/index.js","../../../node_modules/@watermarkchurch/location-map/node_modules/qs/lib/formats.js","../../../node_modules/@watermarkchurch/location-map/node_modules/qs/lib/utils.js","../../../node_modules/@watermarkchurch/location-map/node_modules/qs/lib/stringify.js","../../../node_modules/@watermarkchurch/location-map/node_modules/qs/lib/parse.js","../../../node_modules/@watermarkchurch/location-map/node_modules/qs/lib/index.js","../../../node_modules/@watermarkchurch/location-map/dist/utils/pick.js","../../../node_modules/@watermarkchurch/location-map/dist/types.js","../../../node_modules/@watermarkchurch/location-map/dist/filter-pane/wday-refinement.js","../../../node_modules/@watermarkchurch/location-map/dist/filter-pane.js","../../../node_modules/date-fns/_lib/requiredArgs/index.js","../../../node_modules/date-fns/isDate/index.js","../../../node_modules/date-fns/toDate/index.js","../../../node_modules/date-fns/isValid/index.js","../../../node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js","../../../node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js","../../../node_modules/date-fns/locale/en-US/_lib/formatLong/index.js","../../../node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js","../../../node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js","../../../node_modules/date-fns/locale/en-US/_lib/localize/index.js","../../../node_modules/date-fns/locale/_lib/buildMatchFn/index.js","../../../node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js","../../../node_modules/date-fns/locale/en-US/_lib/match/index.js","../../../node_modules/date-fns/locale/en-US/index.js","../../../node_modules/date-fns/_lib/toInteger/index.js","../../../node_modules/date-fns/addMilliseconds/index.js","../../../node_modules/date-fns/subMilliseconds/index.js","../../../node_modules/date-fns/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/_lib/format/lightFormatters/index.js","../../../node_modules/date-fns/_lib/getUTCDayOfYear/index.js","../../../node_modules/date-fns/_lib/startOfUTCISOWeek/index.js","../../../node_modules/date-fns/_lib/getUTCISOWeekYear/index.js","../../../node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js","../../../node_modules/date-fns/_lib/getUTCISOWeek/index.js","../../../node_modules/date-fns/_lib/startOfUTCWeek/index.js","../../../node_modules/date-fns/_lib/getUTCWeekYear/index.js","../../../node_modules/date-fns/_lib/startOfUTCWeekYear/index.js","../../../node_modules/date-fns/_lib/getUTCWeek/index.js","../../../node_modules/date-fns/_lib/format/formatters/index.js","../../../node_modules/date-fns/_lib/format/longFormatters/index.js","../../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js","../../../node_modules/date-fns/_lib/protectedTokens/index.js","../../../node_modules/date-fns/format/index.js","../../../node_modules/date-fns-tz/_lib/tzIntlTimeZoneName/index.js","../../../node_modules/date-fns-tz/_lib/tzTokenizeDate/index.js","../../../node_modules/date-fns-tz/_lib/newDateUTC/index.js","../../../node_modules/date-fns-tz/_lib/tzParseTimezone/index.js","../../../node_modules/date-fns-tz/format/formatters/index.js","../../../node_modules/date-fns-tz/_lib/tzPattern/index.js","../../../node_modules/date-fns-tz/toDate/index.js","../../../node_modules/date-fns-tz/format/index.js","../../../node_modules/@watermarkchurch/location-map/dist/utils.js","../../../node_modules/@watermarkchurch/location-map/dist/connectors/connectCurrentMapBounds.js","../../../node_modules/@watermarkchurch/location-map/dist/map-pane/map-style-config.js","../../../node_modules/@watermarkchurch/location-map/dist/map-pane.js","../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../../node_modules/date-fns/esm/isDate/index.js","../../../node_modules/date-fns/esm/toDate/index.js","../../../node_modules/date-fns/esm/isValid/index.js","../../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../../../node_modules/date-fns/esm/locale/en-US/index.js","../../../node_modules/date-fns/esm/_lib/toInteger/index.js","../../../node_modules/date-fns/esm/addMilliseconds/index.js","../../../node_modules/date-fns/esm/subMilliseconds/index.js","../../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../../../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../../../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../../../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../../../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../../../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../../../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../../../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../../../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../../../node_modules/date-fns/esm/_lib/format/formatters/index.js","../../../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../../../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../../../node_modules/date-fns/esm/format/index.js","../../../node_modules/date-fns/esm/endOfDay/index.js","../../../node_modules/date-fns/_lib/assign/index.js","../../../node_modules/date-fns/_lib/cloneObject/index.js","../../../node_modules/date-fns-tz/utcToZonedTime/index.js","../../../node_modules/date-fns-tz/formatInTimeZone/index.js","../../../node_modules/date-fns-tz/getTimezoneOffset/index.js","../../../node_modules/date-fns-tz/zonedTimeToUtc/index.js","../../../node_modules/date-fns-tz/index.js","../../../node_modules/@watermarkchurch/location-map/dist/utils/parseTzlessDate.js","../../../node_modules/@watermarkchurch/location-map/dist/connectors/connectCurrentSelectedLocation.js","../../../node_modules/@watermarkchurch/location-map/dist/virtual-location-detail-pane.js","../../../node_modules/@watermarkchurch/location-map/dist/location-detail-pane.js","../../../node_modules/@watermarkchurch/location-map/dist/connectors/connectMapRefinement.js","../../../node_modules/@watermarkchurch/location-map/dist/list-pane/expand-search.js","../../../node_modules/@watermarkchurch/location-map/dist/list-pane/list-item.js","../../../node_modules/@watermarkchurch/location-map/dist/utils/shareSearch.js","../../../node_modules/@watermarkchurch/location-map/dist/list-pane/stats.js","../../../node_modules/@watermarkchurch/location-map/dist/list-pane.js","../../../node_modules/@watermarkchurch/location-map/dist/search-controls/place-pill.js","../../../node_modules/@watermarkchurch/location-map/dist/search-controls/autocomplete.js","../../../node_modules/@watermarkchurch/location-map/dist/search-controls/search-box.js","../../../node_modules/@watermarkchurch/location-map/dist/search-controls.js","../../../node_modules/@watermarkchurch/location-map/dist/location-search-results.js","../../../node_modules/@watermarkchurch/location-map/dist/bootstrap/tabs.js","../../../node_modules/@watermarkchurch/location-map/dist/search-config.js","../../../node_modules/@watermarkchurch/location-map/dist/layouts/in-person-layout.js","../../../node_modules/@watermarkchurch/location-map/dist/layouts/virtual-layout.js","../../../node_modules/@watermarkchurch/location-map/dist/layouts/index.js","../../../node_modules/@watermarkchurch/location-map/dist/index.js","../../../app/frontend/javascripts/lib/components/locations/types.tsx","../../../app/frontend/javascripts/lib/components/locations/map-list-item.tsx","../../../app/frontend/javascripts/top-level-components/LocationMap.tsx","../../../app/frontend/javascripts/lib/components/checkbox-refinement-list/index.tsx","../../../app/frontend/javascripts/lib/components/custom-refinement/index.tsx","../../../app/frontend/javascripts/lib/components/no-hits/index.tsx","../../../app/frontend/javascripts/lib/utils/index.tsx","../../../app/frontend/javascripts/lib/components/connectors/connect-topics.tsx","../../../app/frontend/javascripts/lib/components/messages-search/message-icon.tsx","../../../app/frontend/javascripts/lib/components/messages-search/message-hit.tsx","../../../app/frontend/javascripts/lib/components/messages-search/message-hits.tsx","../../../app/frontend/javascripts/lib/components/messages-search/index.tsx","../../../app/frontend/javascripts/lib/components/contenful-view/loader.tsx","../../../app/frontend/javascripts/lib/components/contenful-view/index.tsx","../../../app/frontend/javascripts/lib/components/custom-clear-refinements/index.tsx","../../../app/frontend/javascripts/lib/components/custom-current-refinements/index.tsx","../../../app/frontend/javascripts/lib/components/resources-search/custom-search-box.tsx","../../../app/frontend/javascripts/lib/utils/contentfulImage.ts","../../../app/frontend/javascripts/lib/components/resources-search/resource-hit.tsx","../../../app/frontend/javascripts/lib/components/resources-search/resource-hit-compact.tsx","../../../app/frontend/javascripts/lib/components/resources-search/resource-hits.tsx","../../../app/frontend/javascripts/lib/components/resources-search/index.tsx","../../../app/frontend/javascripts/lib/components/similar-resources/similar-hit.tsx","../../../app/frontend/javascripts/lib/components/similar-resources/similar-hits.tsx","../../../app/frontend/javascripts/lib/components/similar-resources/index.tsx","../../../node_modules/qs/lib/utils.js","../../../node_modules/qs/lib/formats.js","../../../node_modules/qs/lib/stringify.js","../../../node_modules/qs/lib/parse.js","../../../node_modules/qs/lib/index.js","../../../app/frontend/javascripts/lib/components/locations/list-item.tsx","../../../app/frontend/javascripts/lib/components/locations/location-hits.tsx","../../../app/frontend/javascripts/lib/components/site-search/index.tsx","../../../node_modules/popper.js/dist/esm/popper.js","../../../node_modules/bootstrap/dist/js/bootstrap.js","../../../app/frontend/javascripts/global/email-capture.ts","../../../app/frontend/javascripts/global/focus-label.ts","../../../app/frontend/javascripts/global/index.ts","../../../app/frontend/javascripts/lib/components/error-boundary.tsx","../../../app/frontend/javascripts/lib/wrap-top-level-component.tsx","../../../node_modules/react_ujs/react_ujs/src/events/native.js","../../../node_modules/react_ujs/react_ujs/src/events/pjax.js","../../../node_modules/react_ujs/react_ujs/src/events/turbolinks.js","../../../node_modules/react_ujs/react_ujs/src/events/turbolinksClassicDeprecated.js","../../../node_modules/react_ujs/react_ujs/src/events/turbolinksClassic.js","../../../node_modules/react_ujs/react_ujs/src/events/detect.js","../../../node_modules/react_ujs/react_ujs/src/getConstructor/fromGlobal.js","../../../node_modules/react_ujs/react_ujs/src/getConstructor/fromRequireContext.js","../../../node_modules/react_ujs/react_ujs/src/getConstructor/fromRequireContextWithGlobalFallback.js","../../../node_modules/react_ujs/react_ujs/index.js","../../../app/frontend/entrypoints/application.js"],"sourcesContent":["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/** @license React v16.13.0\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var l=require(\"object-assign\"),n=\"function\"===typeof Symbol&&Symbol.for,p=n?Symbol.for(\"react.element\"):60103,q=n?Symbol.for(\"react.portal\"):60106,r=n?Symbol.for(\"react.fragment\"):60107,t=n?Symbol.for(\"react.strict_mode\"):60108,u=n?Symbol.for(\"react.profiler\"):60114,v=n?Symbol.for(\"react.provider\"):60109,w=n?Symbol.for(\"react.context\"):60110,x=n?Symbol.for(\"react.forward_ref\"):60112,y=n?Symbol.for(\"react.suspense\"):60113,z=n?Symbol.for(\"react.memo\"):60115,A=n?Symbol.for(\"react.lazy\"):\n60116,B=\"function\"===typeof Symbol&&Symbol.iterator;function C(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cQ.length&&Q.push(a)}\nfunction T(a,b,c,e){var d=typeof a;if(\"undefined\"===d||\"boolean\"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,\"\"===b?\".\"+U(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var k=0;k0;)n[r]=arguments[r+1];t&&isFunction(e[t])?e[t].apply(e,n):console.warn(\"The method `\"+t+\"` doesn't exist.\")}}function createInsightsClient(e){var t=getFunctionalInterface(new AlgoliaAnalytics({requestFn:e}));if(\"object\"==typeof window&&!window.AlgoliaAnalyticsObject){var n;do{n=createUUID()}while(void 0!==window[n]);window.AlgoliaAnalyticsObject=n,window[window.AlgoliaAnalyticsObject]=t}return t.version=version,t}var requestWithSendBeacon=function(e,t){var n=JSON.stringify(t);navigator.sendBeacon(e,n)},requestWithXMLHttpRequest=function(e,t){var n=JSON.stringify(t),r=new XMLHttpRequest;r.open(\"POST\",e),r.send(n)},requestWithNodeHttpModule=function(e,t){var n=JSON.stringify(t),r=require(\"url\").parse(e),o={protocol:r.protocol,host:r.host,path:r.path,method:\"POST\",headers:{\"Content-Type\":\"application/json\",\"Content-Length\":n.length}},i=(0,(0===e.indexOf(\"https://\")?require(\"https\"):require(\"http\")).request)(o);i.on(\"error\",function(e){console.error(e)}),i.write(n),i.end()};function getRequesterForBrowser(){if(supportsSendBeacon())return requestWithSendBeacon;if(supportsXMLHttpRequest())return requestWithXMLHttpRequest;throw new Error(\"Could not find a supported HTTP request client in this environment.\")}function getRequesterForNode(){if(supportsNodeHttpModule())return requestWithNodeHttpModule;throw new Error(\"Could not find a supported HTTP request client in this environment.\")}var entryBrowserCjs=createInsightsClient(getRequesterForBrowser());exports.default=entryBrowserCjs,exports.getRequesterForBrowser=getRequesterForBrowser,exports.getRequesterForNode=getRequesterForNode;\n","const aa = require(\"./dist/search-insights-browser.cjs.min.js\");\n\nmodule.exports = aa.default;\nObject.keys(aa).forEach(key => {\n if (key !== \"default\") {\n module.exports[key] = aa[key];\n }\n});\n","/** @license React v0.13.6\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';Object.defineProperty(exports,\"__esModule\",{value:!0});var d=null,e=!1,g=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=d.expirationTime;n?q():n=!0;r(t,a)}}\nfunction u(){var a=d,b=d.next;if(d===b)d=null;else{var c=d.previous;d=c.next=b;b.previous=c}a.next=a.previous=null;c=a.callback;b=a.expirationTime;a=a.priorityLevel;var f=g,Q=l;g=a;l=b;try{var h=c()}finally{g=f,l=Q}if(\"function\"===typeof h)if(h={callback:h,priorityLevel:a,expirationTime:b,next:null,previous:null},null===d)d=h.next=h.previous=h;else{c=null;a=d;do{if(a.expirationTime>=b){c=a;break}a=a.next}while(a!==d);null===c?c=d:c===d&&(d=h,p());b=c.previous;b.next=c.previous=h;h.next=c;h.previous=\nb}}function v(){if(-1===k&&null!==d&&1===d.priorityLevel){m=!0;try{do u();while(null!==d&&1===d.priorityLevel)}finally{m=!1,null!==d?p():n=!1}}}function t(a){m=!0;var b=e;e=a;try{if(a)for(;null!==d;){var c=exports.unstable_now();if(d.expirationTime<=c){do u();while(null!==d&&d.expirationTime<=c)}else break}else if(null!==d){do u();while(null!==d&&!w())}}finally{m=!1,e=b,null!==d?p():n=!1,v()}}\nvar x=Date,y=\"function\"===typeof setTimeout?setTimeout:void 0,z=\"function\"===typeof clearTimeout?clearTimeout:void 0,A=\"function\"===typeof requestAnimationFrame?requestAnimationFrame:void 0,B=\"function\"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,C,D;function E(a){C=A(function(b){z(D);a(b)});D=y(function(){B(C);a(exports.unstable_now())},100)}\nif(\"object\"===typeof performance&&\"function\"===typeof performance.now){var F=performance;exports.unstable_now=function(){return F.now()}}else exports.unstable_now=function(){return x.now()};var r,q,w,G=null;\"undefined\"!==typeof window?G=window:\"undefined\"!==typeof global&&(G=global);\nif(G&&G._schedMock){var H=G._schedMock;r=H[0];q=H[1];w=H[2];exports.unstable_now=H[3]}else if(\"undefined\"===typeof window||\"function\"!==typeof MessageChannel){var I=null,J=function(a){if(null!==I)try{I(a)}finally{I=null}};r=function(a){null!==I?setTimeout(r,0,a):(I=a,setTimeout(J,0,!1))};q=function(){I=null};w=function(){return!1}}else{\"undefined\"!==typeof console&&(\"function\"!==typeof A&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\"),\n\"function\"!==typeof B&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\"));var K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T=new MessageChannel,U=T.port2;T.port1.onmessage=function(){L=!1;var a=K,b=M;K=null;M=-1;var c=exports.unstable_now(),f=!1;if(0>=P-c)if(-1!==b&&b<=c)f=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(f)}finally{O=!1}}};\nvar V=function(a){if(null!==K){E(V);var b=a-P+S;bb&&(b=8),S=bb?U.postMessage(void 0):N||(N=!0,E(V))};q=function(){K=null;L=!1;M=-1}}exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;\nexports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=g,f=k;g=a;k=exports.unstable_now();try{return b()}finally{g=c,k=f,v()}};exports.unstable_next=function(a){switch(g){case 1:case 2:case 3:var b=3;break;default:b=g}var c=g,f=k;g=b;k=exports.unstable_now();try{return a()}finally{g=c,k=f,v()}};\nexports.unstable_scheduleCallback=function(a,b){var c=-1!==k?k:exports.unstable_now();if(\"object\"===typeof b&&null!==b&&\"number\"===typeof b.timeout)b=c+b.timeout;else switch(g){case 1:b=c+-1;break;case 2:b=c+250;break;case 5:b=c+1073741823;break;case 4:b=c+1E4;break;default:b=c+5E3}a={callback:a,priorityLevel:g,expirationTime:b,next:null,previous:null};if(null===d)d=a.next=a.previous=a,p();else{c=null;var f=d;do{if(f.expirationTime>b){c=f;break}f=f.next}while(f!==d);null===c?c=d:c===d&&(d=a,p());\nb=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)d=null;else{a===d&&(d=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=g;return function(){var c=g,f=k;g=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{g=c,k=f,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return g};\nexports.unstable_shouldYield=function(){return!e&&(null!==d&&d.expirationTimethis.eventPool.length&&this.eventPool.push(a)}\nfunction hb(a){a.eventPool=[];a.getPooled=ib;a.release=jb}var kb=y.extend({data:null}),lb=y.extend({data:null}),mb=[9,13,27,32],nb=Ra&&\"CompositionEvent\"in window,ob=null;Ra&&\"documentMode\"in document&&(ob=document.documentMode);\nvar pb=Ra&&\"TextEvent\"in window&&!ob,qb=Ra&&(!nb||ob&&8=ob),rb=String.fromCharCode(32),sb={beforeInput:{phasedRegistrationNames:{bubbled:\"onBeforeInput\",captured:\"onBeforeInputCapture\"},dependencies:[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]},compositionEnd:{phasedRegistrationNames:{bubbled:\"onCompositionEnd\",captured:\"onCompositionEndCapture\"},dependencies:\"blur compositionend keydown keypress keyup mousedown\".split(\" \")},compositionStart:{phasedRegistrationNames:{bubbled:\"onCompositionStart\",\ncaptured:\"onCompositionStartCapture\"},dependencies:\"blur compositionstart keydown keypress keyup mousedown\".split(\" \")},compositionUpdate:{phasedRegistrationNames:{bubbled:\"onCompositionUpdate\",captured:\"onCompositionUpdateCapture\"},dependencies:\"blur compositionupdate keydown keypress keyup mousedown\".split(\" \")}},tb=!1;\nfunction ub(a,b){switch(a){case \"keyup\":return-1!==mb.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"blur\":return!0;default:return!1}}function vb(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var wb=!1;function xb(a,b){switch(a){case \"compositionend\":return vb(b);case \"keypress\":if(32!==b.which)return null;tb=!0;return rb;case \"textInput\":return a=b.data,a===rb&&tb?null:a;default:return null}}\nfunction yb(a,b){if(wb)return\"compositionend\"===a||!nb&&ub(a,b)?(a=eb(),db=cb=bb=null,wb=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function C(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}var D={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){D[a]=new C(a,0,!1,a,null)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];D[b]=new C(b,1,!1,a[1],null)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){D[a]=new C(a,2,!1,a.toLowerCase(),null)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){D[a]=new C(a,2,!1,a,null)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){D[a]=new C(a,3,!1,a.toLowerCase(),null)});[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){D[a]=new C(a,3,!0,a,null)});\n[\"capture\",\"download\"].forEach(function(a){D[a]=new C(a,4,!1,a,null)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){D[a]=new C(a,6,!1,a,null)});[\"rowSpan\",\"start\"].forEach(function(a){D[a]=new C(a,5,!1,a.toLowerCase(),null)});var rc=/[\\-:]([a-z])/g;function sc(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(rc,\nsc);D[b]=new C(b,1,!1,a,null)});\"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(rc,sc);D[b]=new C(b,1,!1,a,\"http://www.w3.org/1999/xlink\")});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(rc,sc);D[b]=new C(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\")});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){D[a]=new C(a,1,!1,a.toLowerCase(),null)});\nfunction tc(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2zd.length&&zd.push(a)}}}var Fd={},Gd=0,Hd=\"_reactListenersID\"+(\"\"+Math.random()).slice(2);\nfunction Id(a){Object.prototype.hasOwnProperty.call(a,Hd)||(a[Hd]=Gd++,Fd[a[Hd]]={});return Fd[a[Hd]]}function Jd(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Kd(a){for(;a&&a.firstChild;)a=a.firstChild;return a}\nfunction Ld(a,b){var c=Kd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Kd(c)}}function Md(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Md(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Nd(){for(var a=window,b=Jd();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Jd(a.document)}return b}function Od(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Pd(){var a=Nd();if(Od(a)){if(\"selectionStart\"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(A){b=null;break a}var f=0,g=-1,h=-1,l=0,k=0,m=a,p=null;b:for(;;){for(var t;;){m!==b||0!==d&&3!==m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length);\nif(null===(t=m.firstChild))break;p=m;m=t}for(;;){if(m===a)break b;p===b&&++l===d&&(g=f);p===e&&++k===c&&(h=f);if(null!==(t=m.nextSibling))break;m=p;p=m.parentNode}m=t}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}}\nfunction Qd(a){var b=Nd(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Md(c.ownerDocument.documentElement,c)){if(null!==d&&Od(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ld(c,f);var g=Ld(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Sd={select:{phasedRegistrationNames:{bubbled:\"onSelect\",captured:\"onSelectCapture\"},dependencies:\"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange\".split(\" \")}},Td=null,Ud=null,Vd=null,Wd=!1;\nfunction Xd(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(Wd||null==Td||Td!==Jd(c))return null;c=Td;\"selectionStart\"in c&&Od(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Vd&&dd(Vd,c)?null:(Vd=c,a=y.getPooled(Sd.select,Ud,a,b),a.type=\"select\",a.target=Td,Qa(a),a)}\nvar Yd={eventTypes:Sd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Id(e);f=sa.onSelect;for(var g=0;g=b.length?void 0:x(\"93\"),b=b[0]),c=b),null==c&&(c=\"\"));a._wrapperState={initialValue:uc(c)}}\nfunction de(a,b){var c=uc(b.value),d=uc(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function ee(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var fe={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction ge(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function he(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?ge(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar ie=void 0,je=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==fe.svg||\"innerHTML\"in a)a.innerHTML=b;else{ie=ie||document.createElement(\"div\");ie.innerHTML=\"\"+b+\"\";for(b=ie.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ke(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar le={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},me=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(le).forEach(function(a){me.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);le[b]=le[a]})});function ne(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||le.hasOwnProperty(a)&&le[a]?(\"\"+b).trim():b+\"px\"}\nfunction oe(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=ne(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var pe=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction qe(a,b){b&&(pe[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?x(\"137\",a,\"\"):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?x(\"60\"):void 0,\"object\"===typeof b.dangerouslySetInnerHTML&&\"__html\"in b.dangerouslySetInnerHTML?void 0:x(\"61\")),null!=b.style&&\"object\"!==typeof b.style?x(\"62\",\"\"):void 0)}\nfunction re(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}\nfunction se(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Id(a);b=sa[b];for(var d=0;dGe||(a.current=Fe[Ge],Fe[Ge]=null,Ge--)}function G(a,b){Ge++;Fe[Ge]=a.current;a.current=b}var He={},H={current:He},I={current:!1},Ie=He;\nfunction Je(a,b){var c=a.type.contextTypes;if(!c)return He;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function J(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Ke(a){F(I,a);F(H,a)}function Le(a){F(I,a);F(H,a)}\nfunction Me(a,b,c){H.current!==He?x(\"168\"):void 0;G(H,b,a);G(I,c,a)}function Ne(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:x(\"108\",ic(b)||\"Unknown\",e);return n({},c,d)}function Oe(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||He;Ie=H.current;G(H,b,a);G(I,I.current,a);return!0}\nfunction Pe(a,b,c){var d=a.stateNode;d?void 0:x(\"169\");c?(b=Ne(a,b,Ie),d.__reactInternalMemoizedMergedChildContext=b,F(I,a),F(H,a),G(H,b,a)):F(I,a);G(I,c,a)}var Qe=null,Re=null;function Se(a){return function(b){try{return a(b)}catch(c){}}}\nfunction Te(a){if(\"undefined\"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Qe=Se(function(a){return b.onCommitFiberRoot(c,a)});Re=Se(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}\nfunction Ue(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function K(a,b,c,d){return new Ue(a,b,c,d)}\nfunction Ve(a){a=a.prototype;return!(!a||!a.isReactComponent)}function We(a){if(\"function\"===typeof a)return Ve(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===cc)return 11;if(a===ec)return 14}return 2}\nfunction Xe(a,b){var c=a.alternate;null===c?(c=K(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.contextDependencies=a.contextDependencies;c.sibling=a.sibling;\nc.index=a.index;c.ref=a.ref;return c}\nfunction Ye(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)Ve(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case Xb:return Ze(c.children,e,f,b);case bc:return $e(c,e|3,f,b);case Yb:return $e(c,e|2,f,b);case Zb:return a=K(12,c,b,e|4),a.elementType=Zb,a.type=Zb,a.expirationTime=f,a;case dc:return a=K(13,c,b,e),a.elementType=dc,a.type=dc,a.expirationTime=f,a;default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case $b:g=10;break a;case ac:g=9;break a;case cc:g=11;break a;case ec:g=\n14;break a;case fc:g=16;d=null;break a}x(\"130\",null==a?a:typeof a,\"\")}b=K(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function Ze(a,b,c,d){a=K(7,a,d,b);a.expirationTime=c;return a}function $e(a,b,c,d){a=K(8,a,d,b);b=0===(b&1)?Yb:bc;a.elementType=b;a.type=b;a.expirationTime=c;return a}function af(a,b,c){a=K(6,a,null,b);a.expirationTime=c;return a}\nfunction bf(a,b,c){b=K(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function cf(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);df(b,a)}\nfunction ef(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{bb?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?cf(a,b):bc&&cf(a,b)}df(0,a)}function ff(a,b){a.didError=!1;a.latestPingedTime>=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);df(b,a)}\nfunction gf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function df(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function L(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b}\nfunction hf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}var jf=(new aa.Component).refs;\nfunction kf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)}\nvar tf={isMounted:function(a){return(a=a._reactInternalFiber)?2===ed(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=lf();d=mf(d,a);var e=nf(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);of();pf(a,e);qf(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=lf();d=mf(d,a);var e=nf(d);e.tag=rf;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);of();pf(a,e);qf(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=lf();c=mf(c,a);var d=nf(c);d.tag=\nsf;void 0!==b&&null!==b&&(d.callback=b);of();pf(a,d);qf(a,c)}};function uf(a,b,c,d,e,f,g){a=a.stateNode;return\"function\"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!dd(c,d)||!dd(e,f):!0}\nfunction vf(a,b,c){var d=!1,e=He;var f=b.contextType;\"object\"===typeof f&&null!==f?f=M(f):(e=J(b)?Ie:H.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Je(a,e):He);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=tf;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}\nfunction wf(a,b,c,d){a=b.state;\"function\"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);\"function\"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&tf.enqueueReplaceState(b,b.state,null)}\nfunction xf(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=jf;var f=b.contextType;\"object\"===typeof f&&null!==f?e.context=M(f):(f=J(b)?Ie:H.current,e.context=Je(a,f));f=a.updateQueue;null!==f&&(yf(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;\"function\"===typeof f&&(kf(a,b,f,c),e.state=a.memoizedState);\"function\"===typeof b.getDerivedStateFromProps||\"function\"===typeof e.getSnapshotBeforeUpdate||\"function\"!==typeof e.UNSAFE_componentWillMount&&\"function\"!==\ntypeof e.componentWillMount||(b=e.state,\"function\"===typeof e.componentWillMount&&e.componentWillMount(),\"function\"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&tf.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(yf(a,f,c,e,d),e.state=a.memoizedState));\"function\"===typeof e.componentDidMount&&(a.effectTag|=4)}var zf=Array.isArray;\nfunction Af(a,b,c){a=c.ref;if(null!==a&&\"function\"!==typeof a&&\"object\"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?x(\"309\"):void 0,d=c.stateNode);d?void 0:x(\"147\",a);var e=\"\"+a;if(null!==b&&null!==b.ref&&\"function\"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===jf&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}\"string\"!==typeof a?x(\"284\"):void 0;c._owner?void 0:x(\"290\",a)}return a}\nfunction Bf(a,b){\"textarea\"!==a.type&&x(\"31\",\"[object Object]\"===Object.prototype.toString.call(b)?\"object with keys {\"+Object.keys(b).join(\", \")+\"}\":b,\"\")}\nfunction Cf(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=Xe(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,du?(B=q,q=null):B=q.sibling;var w=t(e,q,h[u],k);if(null===w){null===q&&(q=B);break}a&&\nq&&null===w.alternate&&b(e,q);g=f(w,g,u);null===m?l=w:m.sibling=w;m=w;q=B}if(u===h.length)return c(e,q),l;if(null===q){for(;uu?(B=q,q=null):B=q.sibling;var v=t(e,q,w.value,k);if(null===v){q||(q=B);break}a&&q&&null===v.alternate&&b(e,q);g=f(v,g,u);null===m?l=v:m.sibling=v;m=v;q=B}if(w.done)return c(e,q),l;if(null===q){for(;!w.done;u++,w=h.next())w=p(e,w.value,k),null!==w&&(g=f(w,g,u),null===m?l=w:m.sibling=w,m=w);return l}for(q=d(e,q);!w.done;u++,w=h.next())w=A(q,e,u,w.value,k),null!==w&&(a&&null!==w.alternate&&q.delete(null===w.key?u:\nw.key),g=f(w,g,u),null===m?l=w:m.sibling=w,m=w);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===Xb&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Vb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===Xb:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===Xb?f.props.children:f.props,h);d.ref=Af(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k=\nk.sibling}f.type===Xb?(d=Ze(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ye(f.type,f.key,f.props,null,a.mode,h),h.ref=Af(a,d,f),h.return=a,a=h)}return g(a);case Wb:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=bf(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\n\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=af(f,a.mode,h),d.return=a,a=d),g(a);if(zf(f))return v(a,d,f,h);if(hc(f))return R(a,d,f,h);l&&Bf(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,x(\"152\",h.displayName||h.name||\"Component\")}return c(a,d)}}var Df=Cf(!0),Ef=Cf(!1),Ff={},N={current:Ff},Gf={current:Ff},Hf={current:Ff};function If(a){a===Ff?x(\"174\"):void 0;return a}\nfunction Jf(a,b){G(Hf,b,a);G(Gf,a,a);G(N,Ff,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:he(null,\"\");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=he(b,c)}F(N,a);G(N,b,a)}function Kf(a){F(N,a);F(Gf,a);F(Hf,a)}function Lf(a){If(Hf.current);var b=If(N.current);var c=he(b,a.type);b!==c&&(G(Gf,a,a),G(N,c,a))}function Mf(a){Gf.current===a&&(F(N,a),F(Gf,a))}\nvar Nf=0,Of=2,Pf=4,Qf=8,Rf=16,Sf=32,Tf=64,Uf=128,Vf=Tb.ReactCurrentDispatcher,Wf=0,Xf=null,O=null,P=null,Yf=null,Q=null,Zf=null,$f=0,ag=null,bg=0,cg=!1,dg=null,eg=0;function fg(){x(\"321\")}function gg(a,b){if(null===b)return!1;for(var c=0;c$f&&($f=m)):f=l.eagerReducer===a?l.eagerState:a(f,l.action);g=l;l=l.next}while(null!==l&&l!==d);k||(h=g,e=f);bd(f,b.memoizedState)||(qg=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]}\nfunction rg(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===ag?(ag={lastEffect:null},ag.lastEffect=a.next=a):(b=ag.lastEffect,null===b?ag.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,ag.lastEffect=a));return a}function sg(a,b,c,d){var e=mg();bg|=a;e.memoizedState=rg(b,c,void 0,void 0===d?null:d)}\nfunction tg(a,b,c,d){var e=ng();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&gg(d,g.deps)){rg(Nf,c,f,d);return}}bg|=a;e.memoizedState=rg(b,c,f,d)}function ug(a,b){if(\"function\"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function vg(){}\nfunction wg(a,b,c){25>eg?void 0:x(\"301\");var d=a.alternate;if(a===Xf||null!==d&&d===Xf)if(cg=!0,a={expirationTime:Wf,action:c,eagerReducer:null,eagerState:null,next:null},null===dg&&(dg=new Map),c=dg.get(b),void 0===c)dg.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{of();var e=lf();e=mf(e,a);var f={expirationTime:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null===\nd||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var l=b.lastRenderedState,k=d(l,c);f.eagerReducer=d;f.eagerState=k;if(bd(k,l))return}catch(m){}finally{}qf(a,e)}}\nvar kg={readContext:M,useCallback:fg,useContext:fg,useEffect:fg,useImperativeHandle:fg,useLayoutEffect:fg,useMemo:fg,useReducer:fg,useRef:fg,useState:fg,useDebugValue:fg},ig={readContext:M,useCallback:function(a,b){mg().memoizedState=[a,void 0===b?null:b];return a},useContext:M,useEffect:function(a,b){return sg(516,Uf|Tf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return sg(4,Pf|Sf,ug.bind(null,b,a),c)},useLayoutEffect:function(a,b){return sg(4,Pf|Sf,a,b)},\nuseMemo:function(a,b){var c=mg();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=mg();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=wg.bind(null,Xf,a);return[d.memoizedState,a]},useRef:function(a){var b=mg();a={current:a};return b.memoizedState=a},useState:function(a){var b=mg();\"function\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null,\nlastRenderedReducer:og,lastRenderedState:a};a=a.dispatch=wg.bind(null,Xf,a);return[b.memoizedState,a]},useDebugValue:vg},jg={readContext:M,useCallback:function(a,b){var c=ng();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&gg(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:M,useEffect:function(a,b){return tg(516,Uf|Tf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return tg(4,Pf|Sf,ug.bind(null,b,a),c)},useLayoutEffect:function(a,\nb){return tg(4,Pf|Sf,a,b)},useMemo:function(a,b){var c=ng();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&gg(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:pg,useRef:function(){return ng().memoizedState},useState:function(a){return pg(og,a)},useDebugValue:vg},xg=null,yg=null,zg=!1;\nfunction Ag(a,b){var c=K(5,null,null,0);c.elementType=\"DELETED\";c.type=\"DELETED\";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function Bg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\"\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}\nfunction Cg(a){if(zg){var b=yg;if(b){var c=b;if(!Bg(a,b)){b=De(c);if(!b||!Bg(a,b)){a.effectTag|=2;zg=!1;xg=a;return}Ag(xg,c)}xg=a;yg=Ee(b)}else a.effectTag|=2,zg=!1,xg=a}}function Dg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;xg=a}function Eg(a){if(a!==xg)return!1;if(!zg)return Dg(a),zg=!0,!1;var b=a.type;if(5!==a.tag||\"head\"!==b&&\"body\"!==b&&!xe(b,a.memoizedProps))for(b=yg;b;)Ag(a,b),b=De(b);Dg(a);yg=xg?De(a.stateNode):null;return!0}function Fg(){yg=xg=null;zg=!1}\nvar Gg=Tb.ReactCurrentOwner,qg=!1;function S(a,b,c,d){b.child=null===a?Ef(b,null,c,d):Df(b,a.child,c,d)}function Hg(a,b,c,d,e){c=c.render;var f=b.ref;Ig(b,e);d=hg(a,b,c,d,f,e);if(null!==a&&!qg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Jg(a,b,e);b.effectTag|=1;S(a,b,d,e);return b.child}\nfunction Kg(a,b,c,d,e,f){if(null===a){var g=c.type;if(\"function\"===typeof g&&!Ve(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,Lg(a,b,g,d,e,f);a=Ye(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return Sg(a,b,c);b=Jg(a,b,c);return null!==b?b.sibling:null}}return Jg(a,b,c)}}else qg=!1;b.expirationTime=0;switch(b.tag){case 2:d=\nb.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Je(b,H.current);Ig(b,c);e=hg(null,b,d,a,e,c);b.effectTag|=1;if(\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;lg();if(J(d)){var f=!0;Oe(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;\"function\"===typeof g&&kf(b,d,g,a);e.updater=tf;b.stateNode=e;e._reactInternalFiber=b;xf(b,d,a,c);b=Qg(null,b,d,!0,f,\nc)}else b.tag=0,S(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=hf(e);b.type=a;e=b.tag=We(a);f=L(a,f);g=void 0;switch(e){case 0:g=Mg(null,b,a,f,c);break;case 1:g=Og(null,b,a,f,c);break;case 11:g=Hg(null,b,a,f,c);break;case 14:g=Kg(null,b,a,L(a.type,f),d,c);break;default:x(\"306\",a,\"\")}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:L(d,e),Mg(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,\ne=b.elementType===d?e:L(d,e),Og(a,b,d,e,c);case 3:Rg(b);d=b.updateQueue;null===d?x(\"282\"):void 0;e=b.memoizedState;e=null!==e?e.element:null;yf(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Fg(),b=Jg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)yg=Ee(b.stateNode.containerInfo),xg=b,e=zg=!0;e?(b.effectTag|=2,b.child=Ef(b,null,d,c)):(S(a,b,d,c),Fg());b=b.child}return b;case 5:return Lf(b),null===a&&Cg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,\ng=e.children,xe(d,e)?g=null:null!==f&&xe(d,f)&&(b.effectTag|=16),Ng(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(S(a,b,g,c),b=b.child),b;case 6:return null===a&&Cg(b),null;case 13:return Sg(a,b,c);case 4:return Jf(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Df(b,null,d,c):S(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:L(d,e),Hg(a,b,d,e,c);case 7:return S(a,b,b.pendingProps,c),b.child;case 8:return S(a,b,b.pendingProps.children,\nc),b.child;case 12:return S(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;Ug(b,f);if(null!==g){var h=g.value;f=bd(h,f)?0:(\"function\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!I.current){b=Jg(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var l=h.contextDependencies;if(null!==l){g=h.child;for(var k=l.first;null!==k;){if(k.context===d&&0!==\n(k.observedBits&f)){1===h.tag&&(k=nf(c),k.tag=sf,pf(h,k));h.expirationTime=b&&(qg=!0);a.contextDependencies=null}\nfunction M(a,b){if(Yg!==a&&!1!==b&&0!==b){if(\"number\"!==typeof b||1073741823===b)Yg=a,b=1073741823;b={context:a,observedBits:b,next:null};null===Xg?(null===Wg?x(\"308\"):void 0,Xg=b,Wg.contextDependencies={first:b,expirationTime:0}):Xg=Xg.next=b}return a._currentValue}var $g=0,rf=1,sf=2,ah=3,Pg=!1;function bh(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}\nfunction ch(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function nf(a){return{expirationTime:a,tag:$g,payload:null,callback:null,next:null,nextEffect:null}}function dh(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}\nfunction pf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=bh(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=bh(a.memoizedState),e=c.updateQueue=bh(c.memoizedState)):d=a.updateQueue=ch(e):null===e&&(e=c.updateQueue=ch(d));null===e||d===e?dh(d,b):null===d.lastUpdate||null===e.lastUpdate?(dh(d,b),dh(e,b)):(dh(d,b),e.lastUpdate=b)}\nfunction eh(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=bh(a.memoizedState):fh(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function fh(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=ch(b));return b}\nfunction gh(a,b,c,d,e,f){switch(c.tag){case rf:return a=c.payload,\"function\"===typeof a?a.call(f,d,e):a;case ah:a.effectTag=a.effectTag&-2049|64;case $g:a=c.payload;e=\"function\"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case sf:Pg=!0}return d}\nfunction yf(a,b,c,d,e){Pg=!1;b=fh(a,b);for(var f=b.baseState,g=null,h=0,l=b.firstUpdate,k=f;null!==l;){var m=l.expirationTime;md?e:d);Ih.current=null;d=void 0;1c?b:c;0===b&&(Fh=null);$h(a,b)}\nfunction ai(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){T=a;a:{var e=b;b=a;var f=U;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:J(b.type)&&Ke(b);break;case 3:Kf(b);Le(b);g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)Eg(b),b.effectTag&=-3;mh(b);break;case 5:Mf(b);var h=If(Hf.current);f=b.type;if(null!==e&&null!=b.stateNode)nh(e,b,f,g,h),e.ref!==b.ref&&(b.effectTag|=\n128);else if(g){var l=If(N.current);if(Eg(b)){g=b;e=g.stateNode;var k=g.type,m=g.memoizedProps,p=h;e[Fa]=g;e[Ga]=m;f=void 0;h=k;switch(h){case \"iframe\":case \"object\":E(\"load\",e);break;case \"video\":case \"audio\":for(k=0;k\\x3c/script>\",k=e.removeChild(e.firstChild)):\"string\"===typeof e.is?k=k.createElement(p,{is:e.is}):(k=k.createElement(p),\"select\"===p&&(p=k,e.multiple?p.multiple=!0:e.size&&(p.size=e.size))):k=k.createElementNS(l,p);e=k;e[Fa]=m;e[Ga]=g;lh(e,b,!1,!1);p=e;k=f;m=g;var t=h,A=re(k,m);switch(k){case \"iframe\":case \"object\":E(\"load\",\np);h=m;break;case \"video\":case \"audio\":for(h=0;hg&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==T)return T;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&\n(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1=v)t=0;else if(-1===t||v component higher in the tree to provide a loading indicator or placeholder to display.\"+jc(k))}Nh=!0;m=jh(m,k);h=l;do{switch(h.tag){case 3:h.effectTag|=2048;h.expirationTime=g;g=Ch(h,m,g);eh(h,g);break a;case 1:if(t=m,A=h.type,k=h.stateNode,0===(h.effectTag&64)&&(\"function\"===typeof A.getDerivedStateFromError||null!==k&&\"function\"===typeof k.componentDidCatch&&(null===Fh||!Fh.has(k)))){h.effectTag|=2048;\nh.expirationTime=g;g=Eh(h,t,g);eh(h,g);break a}}h=h.return}while(null!==h)}T=ai(f);continue}}}break}while(1);Kh=!1;Hh.current=c;Yg=Xg=Wg=null;lg();if(e)Lh=null,a.finishedWork=null;else if(null!==T)a.finishedWork=null;else{c=a.current.alternate;null===c?x(\"281\"):void 0;Lh=null;if(Nh){e=a.latestPendingTime;f=a.latestSuspendedTime;g=a.latestPingedTime;if(0!==e&&eb?0:b)):(a.pendingCommitExpirationTime=d,a.finishedWork=c)}}\nfunction sh(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if(\"function\"===typeof c.type.getDerivedStateFromError||\"function\"===typeof d.componentDidCatch&&(null===Fh||!Fh.has(d))){a=jh(b,a);a=Eh(c,a,1073741823);pf(c,a);qf(c,1073741823);return}break;case 3:a=jh(b,a);a=Ch(c,a,1073741823);pf(c,a);qf(c,1073741823);return}c=c.return}3===a.tag&&(c=jh(b,a),c=Ch(a,c,1073741823),pf(a,c),qf(a,1073741823))}\nfunction mf(a,b){var c=r.unstable_getCurrentPriorityLevel(),d=void 0;if(0===(b.mode&1))d=1073741823;else if(Kh&&!Oh)d=U;else{switch(c){case r.unstable_ImmediatePriority:d=1073741823;break;case r.unstable_UserBlockingPriority:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case r.unstable_NormalPriority:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case r.unstable_LowPriority:case r.unstable_IdlePriority:d=1;break;default:x(\"313\")}null!==Lh&&d===U&&--d}c===r.unstable_UserBlockingPriority&&\n(0===gi||d=d){a.didError=!1;b=a.latestPingedTime;if(0===b||b>c)a.latestPingedTime=c;df(c,a);c=a.expirationTime;0!==c&&Xh(a,c)}}function Ah(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=lf();b=mf(b,a);a=hi(a,b);null!==a&&(cf(a,b),b=a.expirationTime,0!==b&&Xh(a,b))}\nfunction hi(a,b){a.expirationTimeU&&Sh(),cf(a,b),Kh&&!Oh&&Lh===a||Xh(a,a.expirationTime),ii>ji&&(ii=0,x(\"185\")))}function ki(a,b,c,d,e){return r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){return a(b,c,d,e)})}var li=null,Y=null,mi=0,ni=void 0,W=!1,oi=null,Z=0,gi=0,pi=!1,qi=null,X=!1,ri=!1,si=null,ti=r.unstable_now(),ui=1073741822-(ti/10|0),vi=ui,ji=50,ii=0,wi=null;function xi(){ui=1073741822-((r.unstable_now()-ti)/10|0)}\nfunction yi(a,b){if(0!==mi){if(ba.expirationTime&&(a.expirationTime=b);W||(X?ri&&(oi=a,Z=1073741823,Di(a,1073741823,!1)):1073741823===b?Yh(1073741823,!1):yi(a,b))}\nfunction Ci(){var a=0,b=null;if(null!==Y)for(var c=Y,d=li;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===Y?x(\"244\"):void 0;if(d===d.nextScheduledRoot){li=Y=d.nextScheduledRoot=null;break}else if(d===li)li=e=d.nextScheduledRoot,Y.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===Y){Y=c;Y.nextScheduledRoot=li;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===Y)break;if(1073741823===\na)break;c=d;d=d.nextScheduledRoot}}oi=b;Z=a}var Ei=!1;function di(){return Ei?!0:r.unstable_shouldYield()?Ei=!0:!1}function zi(){try{if(!di()&&null!==li){xi();var a=li;do{var b=a.expirationTime;0!==b&&ui<=b&&(a.nextExpirationTimeToWorkOn=ui);a=a.nextScheduledRoot}while(a!==li)}Yh(0,!0)}finally{Ei=!1}}\nfunction Yh(a,b){Ci();if(b)for(xi(),vi=ui;null!==oi&&0!==Z&&a<=Z&&!(Ei&&ui>Z);)Di(oi,Z,ui>Z),Ci(),xi(),vi=ui;else for(;null!==oi&&0!==Z&&a<=Z;)Di(oi,Z,!1),Ci();b&&(mi=0,ni=null);0!==Z&&yi(oi,Z);ii=0;wi=null;if(null!==si)for(a=si,si=null,b=0;b=c&&(null===si?si=[d]:si.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===wi?ii++:(wi=a,ii=0);r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){Zh(a,b)})}function Dh(a){null===oi?x(\"246\"):void 0;oi.expirationTime=0;pi||(pi=!0,qi=a)}function Gi(a,b){var c=X;X=!0;try{return a(b)}finally{(X=c)||W||Yh(1073741823,!1)}}\nfunction Hi(a,b){if(X&&!ri){ri=!0;try{return a(b)}finally{ri=!1}}return a(b)}function Ii(a,b,c){X||W||0===gi||(Yh(gi,!1),gi=0);var d=X;X=!0;try{return r.unstable_runWithPriority(r.unstable_UserBlockingPriority,function(){return a(b,c)})}finally{(X=d)||W||Yh(1073741823,!1)}}\nfunction Ji(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===ed(c)&&1===c.tag?void 0:x(\"170\");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(J(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);x(\"171\");g=void 0}if(1===c.tag){var h=c.type;if(J(h)){c=Ne(c,h,g);break a}}c=g}else c=He;null===b.context?b.context=c:b.pendingContext=c;b=e;e=nf(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b);\nof();pf(f,e);qf(f,d);return d}function Ki(a,b,c,d){var e=b.current,f=lf();e=mf(f,e);return Ji(a,b,c,e,d)}function Li(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Mi(a,b,c){var d=3=Jh&&(b=Jh-1);this._expirationTime=Jh=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}Ni.prototype.render=function(a){this._defer?void 0:x(\"250\");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new Oi;Ji(a,b,null,c,d._onCommit);return d};\nNi.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}};\nNi.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;this._defer&&null!==b?void 0:x(\"251\");if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?x(\"251\"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Bi(a,c);b=this._next;this._next=null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next=\nnull,this._defer=!1};Ni.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};function Qi(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||\" react-mount-point-unstable \"!==a.nodeValue))}Gb=Gi;Hb=Ii;Ib=function(){W||0===gi||(Yh(gi,!1),gi=0)};\nfunction Ri(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute(\"data-reactroot\")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new Pi(a,!1,b)}\nfunction Si(a,b,c,d,e){var f=c._reactRootContainer;if(f){if(\"function\"===typeof e){var g=e;e=function(){var a=Li(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=Ri(c,d);if(\"function\"===typeof e){var h=e;e=function(){var a=Li(f._internalRoot);h.call(a)}}Hi(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Li(f._internalRoot)}\nfunction Ti(a,b){var c=2 h.call(null, stored))\n // stored.handlers = []\n } else if (state === 'error') {\n stored.errored = true;\n // stored.handlers.forEach(h => h.call(null, stored))\n // stored.handlers = [];\n reject(evt);\n }\n stored.loaded = true;\n\n cleanup();\n };\n };\n\n var cleanup = function cleanup() {\n if (global[cbName] && typeof global[cbName] === 'function') {\n global[cbName] = null;\n delete global[cbName];\n }\n };\n\n tag.onload = handleResult('loaded');\n tag.onerror = handleResult('error');\n tag.onreadystatechange = function () {\n handleResult(tag.readyState);\n };\n\n // Pick off callback, if there is one\n if (src.match(/callback=CALLBACK_NAME/)) {\n src = src.replace(/(callback=)[^\\&]+/, '$1' + cbName);\n cb = window[cbName] = tag.onload;\n } else {\n tag.addEventListener('load', tag.onload);\n }\n tag.addEventListener('error', tag.onerror);\n\n tag.src = src;\n body.appendChild(tag);\n\n return tag;\n });\n var initialState = {\n loaded: false,\n error: false,\n promise: promise,\n tag: tag\n };\n scriptMap.set(key, initialState);\n }\n return scriptMap.get(key).tag;\n };\n\n // let scriptTags = document.querySelectorAll('script')\n //\n // NodeList.prototype.filter = Array.prototype.filter;\n // NodeList.prototype.map = Array.prototype.map;\n // const initialScripts = scriptTags\n // .filter(s => !!s.src)\n // .map(s => s.src.split('?')[0])\n // .reduce((memo, script) => {\n // memo[script] = script;\n // return memo;\n // }, {});\n\n Object.keys(scripts).forEach(function (key) {\n var script = scripts[key];\n\n var tag = window._scriptMap.has(key) ? window._scriptMap.get(key).tag : Cache._scriptTag(key, script);\n\n Cache[key] = {\n tag: tag,\n onLoad: Cache._onLoad(key)\n };\n });\n\n return Cache;\n };\n }(window);\n\n exports.default = ScriptCache;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.GoogleApi = mod.exports;\n }\n})(this, function (exports) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n var GoogleApi = exports.GoogleApi = function GoogleApi(opts) {\n opts = opts || {};\n\n if (!opts.hasOwnProperty('apiKey')) {\n throw new Error('You must pass an apiKey to use GoogleApi');\n }\n\n var apiKey = opts.apiKey;\n var libraries = opts.libraries || ['places'];\n var client = opts.client;\n var URL = opts.url || 'https://maps.googleapis.com/maps/api/js';\n\n var googleVersion = opts.version || '3.31';\n\n var script = null;\n var google = typeof window !== 'undefined' && window.google || null;\n var loading = false;\n var channel = null;\n var language = opts.language;\n var region = opts.region || null;\n\n var onLoadEvents = [];\n\n var url = function url() {\n var url = URL;\n var params = {\n key: apiKey,\n callback: 'CALLBACK_NAME',\n libraries: libraries.join(','),\n client: client,\n v: googleVersion,\n channel: channel,\n language: language,\n region: region,\n onerror: 'ERROR_FUNCTION'\n };\n\n var paramStr = Object.keys(params).filter(function (k) {\n return !!params[k];\n }).map(function (k) {\n return k + '=' + params[k];\n }).join('&');\n\n return url + '?' + paramStr;\n };\n\n return url();\n };\n\n exports.default = GoogleApi;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'react-dom', './lib/ScriptCache', './lib/GoogleApi'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('react-dom'), require('./lib/ScriptCache'), require('./lib/GoogleApi'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.reactDom, global.ScriptCache, global.GoogleApi);\n global.GoogleApiComponent = mod.exports;\n }\n})(this, function (exports, _react, _reactDom, _ScriptCache, _GoogleApi) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.wrapper = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _reactDom2 = _interopRequireDefault(_reactDom);\n\n var _GoogleApi2 = _interopRequireDefault(_GoogleApi);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var defaultMapConfig = {};\n\n var serialize = function serialize(obj) {\n return JSON.stringify(obj);\n };\n var isSame = function isSame(obj1, obj2) {\n return obj1 === obj2 || serialize(obj1) === serialize(obj2);\n };\n\n var defaultCreateCache = function defaultCreateCache(options) {\n options = options || {};\n var apiKey = options.apiKey;\n var libraries = options.libraries || ['places'];\n var version = options.version || '3';\n var language = options.language || 'en';\n var url = options.url;\n var client = options.client;\n var region = options.region;\n\n return (0, _ScriptCache.ScriptCache)({\n google: (0, _GoogleApi2.default)({\n apiKey: apiKey,\n language: language,\n libraries: libraries,\n version: version,\n url: url,\n client: client,\n region: region\n })\n });\n };\n\n var DefaultLoadingContainer = function DefaultLoadingContainer(props) {\n return _react2.default.createElement(\n 'div',\n null,\n 'Loading...'\n );\n };\n\n var wrapper = exports.wrapper = function wrapper(input) {\n return function (WrappedComponent) {\n var Wrapper = function (_React$Component) {\n _inherits(Wrapper, _React$Component);\n\n function Wrapper(props, context) {\n _classCallCheck(this, Wrapper);\n\n // Build options from input\n var _this = _possibleConstructorReturn(this, (Wrapper.__proto__ || Object.getPrototypeOf(Wrapper)).call(this, props, context));\n\n var options = typeof input === 'function' ? input(props) : input;\n\n // Initialize required Google scripts and other configured options\n _this.initialize(options);\n\n _this.state = {\n loaded: false,\n map: null,\n google: null,\n options: options\n };\n\n _this.mapRef = _react2.default.createRef();\n return _this;\n }\n\n _createClass(Wrapper, [{\n key: 'UNSAFE_componentWillReceiveProps',\n value: function UNSAFE_componentWillReceiveProps(props) {\n // Do not update input if it's not dynamic\n if (typeof input !== 'function') {\n return;\n }\n\n // Get options to compare\n var prevOptions = this.state.options;\n var options = typeof input === 'function' ? input(props) : input;\n\n // Ignore when options are not changed\n if (isSame(options, prevOptions)) {\n return;\n }\n\n // Initialize with new options\n this.initialize(options);\n\n // Save new options in component state,\n // and remove information about previous API handlers\n this.setState({\n options: options,\n loaded: false,\n google: null\n });\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.unregisterLoadHandler) {\n this.unregisterLoadHandler();\n }\n }\n }, {\n key: 'initialize',\n value: function initialize(options) {\n // Avoid race condition: remove previous 'load' listener\n if (this.unregisterLoadHandler) {\n this.unregisterLoadHandler();\n this.unregisterLoadHandler = null;\n }\n\n // Load cache factory\n var createCache = options.createCache || defaultCreateCache;\n\n // Build script\n this.scriptCache = createCache(options);\n this.unregisterLoadHandler = this.scriptCache.google.onLoad(this.onLoad.bind(this));\n\n // Store information about loading container\n this.LoadingContainer = options.LoadingContainer || DefaultLoadingContainer;\n }\n }, {\n key: 'onLoad',\n value: function onLoad(err, tag) {\n this._gapi = window.google;\n\n this.setState({ loaded: true, google: this._gapi });\n }\n }, {\n key: 'render',\n value: function render() {\n var LoadingContainer = this.LoadingContainer;\n\n if (!this.state.loaded) {\n return _react2.default.createElement(LoadingContainer, null);\n }\n\n var props = Object.assign({}, this.props, {\n loaded: this.state.loaded,\n google: window.google\n });\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(WrappedComponent, props),\n _react2.default.createElement('div', { ref: this.mapRef })\n );\n }\n }]);\n\n return Wrapper;\n }(_react2.default.Component);\n\n return Wrapper;\n };\n };\n\n exports.default = wrapper;\n});","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.String = mod.exports;\n }\n})(this, function (exports) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n var camelize = exports.camelize = function camelize(str) {\n return str.split('_').map(function (word) {\n return word.charAt(0).toUpperCase() + word.slice(1);\n }).join('');\n };\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'prop-types', '../lib/String'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('prop-types'), require('../lib/String'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.propTypes, global.String);\n global.Marker = mod.exports;\n }\n})(this, function (exports, _react, _propTypes, _String) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.Marker = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var evtNames = ['click', 'dblclick', 'dragend', 'mousedown', 'mouseout', 'mouseover', 'mouseup', 'recenter'];\n\n var wrappedPromise = function wrappedPromise() {\n var wrappedPromise = {},\n promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n wrappedPromise.then = promise.then.bind(promise);\n wrappedPromise.catch = promise.catch.bind(promise);\n wrappedPromise.promise = promise;\n\n return wrappedPromise;\n };\n\n var Marker = exports.Marker = function (_React$Component) {\n _inherits(Marker, _React$Component);\n\n function Marker() {\n _classCallCheck(this, Marker);\n\n return _possibleConstructorReturn(this, (Marker.__proto__ || Object.getPrototypeOf(Marker)).apply(this, arguments));\n }\n\n _createClass(Marker, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.markerPromise = wrappedPromise();\n this.renderMarker();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (this.props.map !== prevProps.map || this.props.position !== prevProps.position || this.props.icon !== prevProps.icon) {\n if (this.marker) {\n this.marker.setMap(null);\n }\n this.renderMarker();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.marker) {\n this.marker.setMap(null);\n }\n }\n }, {\n key: 'renderMarker',\n value: function renderMarker() {\n var _this2 = this;\n\n var _props = this.props,\n map = _props.map,\n google = _props.google,\n position = _props.position,\n mapCenter = _props.mapCenter,\n icon = _props.icon,\n label = _props.label,\n draggable = _props.draggable,\n title = _props.title,\n props = _objectWithoutProperties(_props, ['map', 'google', 'position', 'mapCenter', 'icon', 'label', 'draggable', 'title']);\n\n if (!google) {\n return null;\n }\n\n var pos = position || mapCenter;\n if (!(pos instanceof google.maps.LatLng)) {\n pos = new google.maps.LatLng(pos.lat, pos.lng);\n }\n\n var pref = _extends({\n map: map,\n position: pos,\n icon: icon,\n label: label,\n title: title,\n draggable: draggable\n }, props);\n this.marker = new google.maps.Marker(pref);\n\n evtNames.forEach(function (e) {\n _this2.marker.addListener(e, _this2.handleEvent(e));\n });\n\n this.markerPromise.resolve(this.marker);\n }\n }, {\n key: 'getMarker',\n value: function getMarker() {\n return this.markerPromise;\n }\n }, {\n key: 'handleEvent',\n value: function handleEvent(evt) {\n var _this3 = this;\n\n return function (e) {\n var evtName = 'on' + (0, _String.camelize)(evt);\n if (_this3.props[evtName]) {\n _this3.props[evtName](_this3.props, _this3.marker, e);\n }\n };\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return Marker;\n }(_react2.default.Component);\n\n Marker.propTypes = {\n position: _propTypes2.default.object,\n map: _propTypes2.default.object\n };\n\n evtNames.forEach(function (e) {\n return Marker.propTypes[e] = _propTypes2.default.func;\n });\n\n Marker.defaultProps = {\n name: 'Marker'\n };\n\n exports.default = Marker;\n});","/** @license React v16.8.6\n * react-dom-server.browser.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var p=require(\"object-assign\"),q=require(\"react\");function aa(a,b,d,c,f,e,h,g){if(!a){a=void 0;if(void 0===b)a=Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else{var D=[d,c,f,e,h,g],B=0;a=Error(b.replace(/%s/g,function(){return D[B++]}));a.name=\"Invariant Violation\"}a.framesToPop=1;throw a;}}\nfunction r(a){for(var b=arguments.length-1,d=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=0;cH;H++)G[H]=H+1;G[15]=0;\nvar ma=/^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,na=Object.prototype.hasOwnProperty,oa={},pa={};\nfunction qa(a){if(na.call(pa,a))return!0;if(na.call(oa,a))return!1;if(ma.test(a))return pa[a]=!0;oa[a]=!0;return!1}function ra(a,b,d,c){if(null!==d&&0===d.type)return!1;switch(typeof b){case \"function\":case \"symbol\":return!0;case \"boolean\":if(c)return!1;if(null!==d)return!d.acceptsBooleans;a=a.toLowerCase().slice(0,5);return\"data-\"!==a&&\"aria-\"!==a;default:return!1}}\nfunction sa(a,b,d,c){if(null===b||\"undefined\"===typeof b||ra(a,b,d,c))return!0;if(c)return!1;if(null!==d)switch(d.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function I(a,b,d,c,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b}var J={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){J[a]=new I(a,0,!1,a,null)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];J[b]=new I(b,1,!1,a[1],null)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){J[a]=new I(a,2,!1,a.toLowerCase(),null)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){J[a]=new I(a,2,!1,a,null)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){J[a]=new I(a,3,!1,a.toLowerCase(),null)});[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){J[a]=new I(a,3,!0,a,null)});\n[\"capture\",\"download\"].forEach(function(a){J[a]=new I(a,4,!1,a,null)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){J[a]=new I(a,6,!1,a,null)});[\"rowSpan\",\"start\"].forEach(function(a){J[a]=new I(a,5,!1,a.toLowerCase(),null)});var K=/[\\-:]([a-z])/g;function L(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(K,\nL);J[b]=new I(b,1,!1,a,null)});\"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(K,L);J[b]=new I(b,1,!1,a,\"http://www.w3.org/1999/xlink\")});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(K,L);J[b]=new I(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\")});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){J[a]=new I(a,1,!1,a.toLowerCase(),null)});var ta=/[\"'&<>]/;\nfunction M(a){if(\"boolean\"===typeof a||\"number\"===typeof a)return\"\"+a;a=\"\"+a;var b=ta.exec(a);if(b){var d=\"\",c,f=0;for(c=b.index;cU?void 0:r(\"301\");if(a===N)if(S=!0,a={action:d,next:null},null===T&&(T=new Map),d=T.get(b),void 0===d)T.set(b,a);else{for(b=d;null!==b.next;)b=b.next;b.next=a}}function za(){}\nvar X=0,Aa={readContext:function(a){var b=X;F(a,b);return a[b]},useContext:function(a){V();var b=X;F(a,b);return a[b]},useMemo:function(a,b){N=V();P=W();b=void 0===b?null:b;if(null!==P){var d=P.memoizedState;if(null!==d&&null!==b){a:{var c=d[1];if(null===c)c=!1;else{for(var f=0;f=e?void 0:r(\"304\");var h=new Uint16Array(e);h.set(f);G=h;G[0]=c+1;for(f=c;f=g.children.length){var D=g.footer;\"\"!==D&&(this.previousWasTextNode=!1);this.stack.pop();if(\"select\"===g.type)this.currentSelectValue=null;else if(null!=g.type&&null!=g.type.type&&g.type.type.$$typeof===z)this.popProvider(g.type);else if(g.type===A){this.suspenseDepth--;var B=f.pop();if(e){e=!1;var n=g.fallbackFrame;n?void 0:r(\"303\");this.stack.push(n);continue}else f[this.suspenseDepth]+=B}f[this.suspenseDepth]+=\nD}else{var l=g.children[g.childIndex++],k=\"\";try{k+=this.render(l,g.context,g.domNamespace)}catch(t){throw t;}finally{}f.length<=this.suspenseDepth&&f.push(\"\");f[this.suspenseDepth]+=k}}return f[0]}finally{Ia.current=c,X=b}};a.prototype.render=function(a,d,c){if(\"string\"===typeof a||\"number\"===typeof a){c=\"\"+a;if(\"\"===c)return\"\";if(this.makeStaticMarkup)return M(c);if(this.previousWasTextNode)return\"\\x3c!-- --\\x3e\"+M(c);this.previousWasTextNode=!0;return M(c)}d=Ra(a,d,this.threadID);a=d.child;d=d.context;\nif(null===a||!1===a)return\"\";if(!q.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof;b===ba?r(\"257\"):void 0;r(\"258\",b.toString())}a=Z(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:\"\"});return\"\"}b=a.type;if(\"string\"===typeof b)return this.renderDOM(a,d,c);switch(b){case ca:case fa:case da:case x:return a=Z(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:\"\"}),\"\";case A:r(\"294\")}if(\"object\"===\ntypeof b&&null!==b)switch(b.$$typeof){case ha:N={};var e=b.render(a.props,a.ref);e=va(b.render,a.props,e,a.ref);e=Z(e);this.stack.push({type:null,domNamespace:c,children:e,childIndex:0,context:d,footer:\"\"});return\"\";case ia:return a=[q.createElement(b.type,p({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:\"\"}),\"\";case z:return b=Z(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:\"\"},this.pushProvider(a),this.stack.push(c),\n\"\";case ea:b=a.type;e=a.props;var h=this.threadID;F(b,h);b=Z(e.children(b[h]));this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:\"\"});return\"\";case ja:r(\"295\")}r(\"130\",null==b?b:typeof b,\"\")};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();c===Ba.html&&Ca(b);La.hasOwnProperty(b)||(Ka.test(b)?void 0:r(\"65\",b),La[b]=!0);var e=a.props;if(\"input\"===b)e=p({type:void 0},e,{defaultChecked:void 0,defaultValue:void 0,value:null!=e.value?e.value:e.defaultValue,\nchecked:null!=e.checked?e.checked:e.defaultChecked});else if(\"textarea\"===b){var h=e.value;if(null==h){h=e.defaultValue;var g=e.children;null!=g&&(null!=h?r(\"92\"):void 0,Array.isArray(g)&&(1>=g.length?void 0:r(\"93\"),g=g[0]),h=\"\"+g);null==h&&(h=\"\")}e=p({},e,{value:void 0,children:\"\"+h})}else if(\"select\"===b)this.currentSelectValue=null!=e.value?e.value:e.defaultValue,e=p({},e,{value:void 0});else if(\"option\"===b){g=this.currentSelectValue;var D=Na(e.children);if(null!=g){var B=null!=e.value?e.value+\n\"\":D;h=!1;if(Array.isArray(g))for(var n=0;n\":(y+=\">\",h=\"\");a:{g=e.dangerouslySetInnerHTML;if(null!=g){if(null!=g.__html){g=g.__html;break a}}else if(g=e.children,\"string\"===typeof g||\"number\"===typeof g){g=M(g);break a}g=null}null!=g?(e=[],Ja[b]&&\"\\n\"===g.charAt(0)&&(y+=\"\\n\"),y+=g):e=Z(e.children);a=a.type;c=null==c||\"http://www.w3.org/1999/xhtml\"===\nc?Ca(a):\"http://www.w3.org/2000/svg\"===c&&\"foreignObject\"===a?\"http://www.w3.org/1999/xhtml\":c;this.stack.push({domNamespace:c,type:b,children:e,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return y};return a}(),Ta={renderToString:function(a){a=new Sa(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Sa(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){r(\"207\")},renderToStaticNodeStream:function(){r(\"208\")},\nversion:\"16.8.6\"},Ua={default:Ta},Va=Ua&&Ta||Ua;module.exports=Va.default||Va;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-dom-server.browser.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom-server.browser.development.js');\n}\n","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'prop-types', 'react-dom', 'react-dom/server'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('prop-types'), require('react-dom'), require('react-dom/server'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.propTypes, global.reactDom, global.server);\n global.InfoWindow = mod.exports;\n }\n})(this, function (exports, _react, _propTypes, _reactDom, _server) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.InfoWindow = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _reactDom2 = _interopRequireDefault(_reactDom);\n\n var _server2 = _interopRequireDefault(_server);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var InfoWindow = exports.InfoWindow = function (_React$Component) {\n _inherits(InfoWindow, _React$Component);\n\n function InfoWindow() {\n _classCallCheck(this, InfoWindow);\n\n return _possibleConstructorReturn(this, (InfoWindow.__proto__ || Object.getPrototypeOf(InfoWindow)).apply(this, arguments));\n }\n\n _createClass(InfoWindow, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.renderInfoWindow();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n var _props = this.props,\n google = _props.google,\n map = _props.map;\n\n\n if (!google || !map) {\n return;\n }\n\n if (map !== prevProps.map) {\n this.renderInfoWindow();\n }\n\n if (this.props.position !== prevProps.position) {\n this.updatePosition();\n }\n\n if (this.props.children !== prevProps.children) {\n this.updateContent();\n }\n\n if (this.props.visible !== prevProps.visible || this.props.marker !== prevProps.marker || this.props.position !== prevProps.position) {\n this.props.visible ? this.openWindow() : this.closeWindow();\n }\n }\n }, {\n key: 'renderInfoWindow',\n value: function renderInfoWindow() {\n var _props2 = this.props,\n map = _props2.map,\n google = _props2.google,\n mapCenter = _props2.mapCenter,\n props = _objectWithoutProperties(_props2, ['map', 'google', 'mapCenter']);\n\n if (!google || !google.maps) {\n return;\n }\n\n var iw = this.infowindow = new google.maps.InfoWindow(_extends({\n content: ''\n }, props));\n\n google.maps.event.addListener(iw, 'closeclick', this.onClose.bind(this));\n google.maps.event.addListener(iw, 'domready', this.onOpen.bind(this));\n }\n }, {\n key: 'onOpen',\n value: function onOpen() {\n if (this.props.onOpen) {\n this.props.onOpen();\n }\n }\n }, {\n key: 'onClose',\n value: function onClose() {\n if (this.props.onClose) {\n this.props.onClose();\n }\n }\n }, {\n key: 'openWindow',\n value: function openWindow() {\n this.infowindow.open(this.props.map, this.props.marker);\n }\n }, {\n key: 'updatePosition',\n value: function updatePosition() {\n var pos = this.props.position;\n if (!(pos instanceof google.maps.LatLng)) {\n pos = pos && new google.maps.LatLng(pos.lat, pos.lng);\n }\n this.infowindow.setPosition(pos);\n }\n }, {\n key: 'updateContent',\n value: function updateContent() {\n var content = this.renderChildren();\n this.infowindow.setContent(content);\n }\n }, {\n key: 'closeWindow',\n value: function closeWindow() {\n this.infowindow.close();\n }\n }, {\n key: 'renderChildren',\n value: function renderChildren() {\n var children = this.props.children;\n\n return _server2.default.renderToString(children);\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return InfoWindow;\n }(_react2.default.Component);\n\n InfoWindow.propTypes = {\n children: _propTypes2.default.element.isRequired,\n map: _propTypes2.default.object,\n marker: _propTypes2.default.object,\n position: _propTypes2.default.object,\n visible: _propTypes2.default.bool,\n\n // callbacks\n onClose: _propTypes2.default.func,\n onOpen: _propTypes2.default.func\n };\n\n InfoWindow.defaultProps = {\n visible: false\n };\n\n exports.default = InfoWindow;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'prop-types', '../lib/String'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('prop-types'), require('../lib/String'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.propTypes, global.String);\n global.HeatMap = mod.exports;\n }\n})(this, function (exports, _react, _propTypes, _String) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.HeatMap = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var evtNames = ['click', 'mouseover', 'recenter'];\n\n var wrappedPromise = function wrappedPromise() {\n var wrappedPromise = {},\n promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n wrappedPromise.then = promise.then.bind(promise);\n wrappedPromise.catch = promise.catch.bind(promise);\n wrappedPromise.promise = promise;\n\n return wrappedPromise;\n };\n\n var HeatMap = exports.HeatMap = function (_React$Component) {\n _inherits(HeatMap, _React$Component);\n\n function HeatMap() {\n _classCallCheck(this, HeatMap);\n\n return _possibleConstructorReturn(this, (HeatMap.__proto__ || Object.getPrototypeOf(HeatMap)).apply(this, arguments));\n }\n\n _createClass(HeatMap, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.heatMapPromise = wrappedPromise();\n this.renderHeatMap();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (this.props.map !== prevProps.map || this.props.position !== prevProps.position) {\n if (this.heatMap) {\n this.heatMap.setMap(null);\n this.renderHeatMap();\n }\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.heatMap) {\n this.heatMap.setMap(null);\n }\n }\n }, {\n key: 'renderHeatMap',\n value: function renderHeatMap() {\n var _this2 = this;\n\n var _props = this.props,\n map = _props.map,\n google = _props.google,\n positions = _props.positions,\n mapCenter = _props.mapCenter,\n icon = _props.icon,\n gradient = _props.gradient,\n _props$radius = _props.radius,\n radius = _props$radius === undefined ? 20 : _props$radius,\n _props$opacity = _props.opacity,\n opacity = _props$opacity === undefined ? 0.2 : _props$opacity,\n props = _objectWithoutProperties(_props, ['map', 'google', 'positions', 'mapCenter', 'icon', 'gradient', 'radius', 'opacity']);\n\n if (!google) {\n return null;\n }\n\n var data = positions.map(function (pos) {\n return { location: new google.maps.LatLng(pos.lat, pos.lng), weight: pos.weight };\n });\n\n var pref = _extends({\n map: map,\n gradient: gradient,\n radius: radius,\n opacity: opacity,\n data: data\n }, props);\n\n this.heatMap = new google.maps.visualization.HeatmapLayer(pref);\n\n this.heatMap.set('radius', radius === undefined ? 20 : radius);\n\n this.heatMap.set('opacity', opacity === undefined ? 0.2 : opacity);\n\n evtNames.forEach(function (e) {\n _this2.heatMap.addListener(e, _this2.handleEvent(e));\n });\n\n this.heatMapPromise.resolve(this.heatMap);\n }\n }, {\n key: 'getHeatMap',\n value: function getHeatMap() {\n return this.heatMapPromise;\n }\n }, {\n key: 'handleEvent',\n value: function handleEvent(evt) {\n var _this3 = this;\n\n return function (e) {\n var evtName = 'on' + (0, _String.camelize)(evt);\n if (_this3.props[evtName]) {\n _this3.props[evtName](_this3.props, _this3.heatMap, e);\n }\n };\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return HeatMap;\n }(_react2.default.Component);\n\n HeatMap.propTypes = {\n position: _propTypes2.default.object,\n map: _propTypes2.default.object,\n icon: _propTypes2.default.string\n };\n\n evtNames.forEach(function (e) {\n return HeatMap.propTypes[e] = _propTypes2.default.func;\n });\n\n HeatMap.defaultProps = {\n name: 'HeatMap'\n };\n\n exports.default = HeatMap;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.arePathsEqual = mod.exports;\n }\n})(this, function (exports) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _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\n /**\n * Compares two path arrays of LatLng objects.\n */\n\n var arePathsEqual = exports.arePathsEqual = function arePathsEqual(pathA, pathB) {\n if (pathA === pathB) {\n return true;\n }\n if (!Array.isArray(pathA) || !Array.isArray(pathB)) {\n return false;\n }\n if (pathA.length !== pathB.length) {\n return false;\n }\n for (var i = 0; i < pathA.length; ++i) {\n if (pathA[i] === pathB[i]) {\n continue;\n }\n if (!isValidLatLng(pathA[i]) || !isValidLatLng(pathB[i])) {\n return false;\n }\n if (pathB[i].lat !== pathA[i].lat || pathB[i].lng !== pathA[i].lng) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Helper that checks whether an array consists of objects\n * with lat and lng properties\n * @param {object} elem the element to check\n * @returns {boolean} whether or not it's valid\n */\n var isValidLatLng = function isValidLatLng(elem) {\n return elem !== null && (typeof elem === 'undefined' ? 'undefined' : _typeof(elem)) === 'object' && elem.hasOwnProperty('lat') && elem.hasOwnProperty('lng');\n };\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'prop-types', '../lib/arePathsEqual', '../lib/String'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('prop-types'), require('../lib/arePathsEqual'), require('../lib/String'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.propTypes, global.arePathsEqual, global.String);\n global.Polygon = mod.exports;\n }\n})(this, function (exports, _react, _propTypes, _arePathsEqual, _String) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.Polygon = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var evtNames = ['click', 'mouseout', 'mouseover'];\n\n var wrappedPromise = function wrappedPromise() {\n var wrappedPromise = {},\n promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n wrappedPromise.then = promise.then.bind(promise);\n wrappedPromise.catch = promise.catch.bind(promise);\n wrappedPromise.promise = promise;\n\n return wrappedPromise;\n };\n\n var Polygon = exports.Polygon = function (_React$Component) {\n _inherits(Polygon, _React$Component);\n\n function Polygon() {\n _classCallCheck(this, Polygon);\n\n return _possibleConstructorReturn(this, (Polygon.__proto__ || Object.getPrototypeOf(Polygon)).apply(this, arguments));\n }\n\n _createClass(Polygon, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.polygonPromise = wrappedPromise();\n this.renderPolygon();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (this.props.map !== prevProps.map || !(0, _arePathsEqual.arePathsEqual)(this.props.paths, prevProps.paths)) {\n if (this.polygon) {\n this.polygon.setMap(null);\n }\n this.renderPolygon();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.polygon) {\n this.polygon.setMap(null);\n }\n }\n }, {\n key: 'renderPolygon',\n value: function renderPolygon() {\n var _this2 = this;\n\n var _props = this.props,\n map = _props.map,\n google = _props.google,\n paths = _props.paths,\n strokeColor = _props.strokeColor,\n strokeOpacity = _props.strokeOpacity,\n strokeWeight = _props.strokeWeight,\n fillColor = _props.fillColor,\n fillOpacity = _props.fillOpacity,\n props = _objectWithoutProperties(_props, ['map', 'google', 'paths', 'strokeColor', 'strokeOpacity', 'strokeWeight', 'fillColor', 'fillOpacity']);\n\n if (!google) {\n return null;\n }\n\n var params = _extends({\n map: map,\n paths: paths,\n strokeColor: strokeColor,\n strokeOpacity: strokeOpacity,\n strokeWeight: strokeWeight,\n fillColor: fillColor,\n fillOpacity: fillOpacity\n }, props);\n\n this.polygon = new google.maps.Polygon(params);\n\n evtNames.forEach(function (e) {\n _this2.polygon.addListener(e, _this2.handleEvent(e));\n });\n\n this.polygonPromise.resolve(this.polygon);\n }\n }, {\n key: 'getPolygon',\n value: function getPolygon() {\n return this.polygonPromise;\n }\n }, {\n key: 'handleEvent',\n value: function handleEvent(evt) {\n var _this3 = this;\n\n return function (e) {\n var evtName = 'on' + (0, _String.camelize)(evt);\n if (_this3.props[evtName]) {\n _this3.props[evtName](_this3.props, _this3.polygon, e);\n }\n };\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return Polygon;\n }(_react2.default.Component);\n\n Polygon.propTypes = {\n paths: _propTypes2.default.array,\n strokeColor: _propTypes2.default.string,\n strokeOpacity: _propTypes2.default.number,\n strokeWeight: _propTypes2.default.number,\n fillColor: _propTypes2.default.string,\n fillOpacity: _propTypes2.default.number\n };\n\n evtNames.forEach(function (e) {\n return Polygon.propTypes[e] = _propTypes2.default.func;\n });\n\n Polygon.defaultProps = {\n name: 'Polygon'\n };\n\n exports.default = Polygon;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'prop-types', '../lib/arePathsEqual', '../lib/String'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('prop-types'), require('../lib/arePathsEqual'), require('../lib/String'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.propTypes, global.arePathsEqual, global.String);\n global.Polyline = mod.exports;\n }\n})(this, function (exports, _react, _propTypes, _arePathsEqual, _String) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.Polyline = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var evtNames = ['click', 'mouseout', 'mouseover'];\n\n var wrappedPromise = function wrappedPromise() {\n var wrappedPromise = {},\n promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n wrappedPromise.then = promise.then.bind(promise);\n wrappedPromise.catch = promise.catch.bind(promise);\n wrappedPromise.promise = promise;\n\n return wrappedPromise;\n };\n\n var Polyline = exports.Polyline = function (_React$Component) {\n _inherits(Polyline, _React$Component);\n\n function Polyline() {\n _classCallCheck(this, Polyline);\n\n return _possibleConstructorReturn(this, (Polyline.__proto__ || Object.getPrototypeOf(Polyline)).apply(this, arguments));\n }\n\n _createClass(Polyline, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.polylinePromise = wrappedPromise();\n this.renderPolyline();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (this.props.map !== prevProps.map || !(0, _arePathsEqual.arePathsEqual)(this.props.path, prevProps.path)) {\n if (this.polyline) {\n this.polyline.setMap(null);\n }\n this.renderPolyline();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.polyline) {\n this.polyline.setMap(null);\n }\n }\n }, {\n key: 'renderPolyline',\n value: function renderPolyline() {\n var _this2 = this;\n\n var _props = this.props,\n map = _props.map,\n google = _props.google,\n path = _props.path,\n strokeColor = _props.strokeColor,\n strokeOpacity = _props.strokeOpacity,\n strokeWeight = _props.strokeWeight,\n props = _objectWithoutProperties(_props, ['map', 'google', 'path', 'strokeColor', 'strokeOpacity', 'strokeWeight']);\n\n if (!google) {\n return null;\n }\n\n var params = _extends({\n map: map,\n path: path,\n strokeColor: strokeColor,\n strokeOpacity: strokeOpacity,\n strokeWeight: strokeWeight\n }, props);\n\n this.polyline = new google.maps.Polyline(params);\n\n evtNames.forEach(function (e) {\n _this2.polyline.addListener(e, _this2.handleEvent(e));\n });\n\n this.polylinePromise.resolve(this.polyline);\n }\n }, {\n key: 'getPolyline',\n value: function getPolyline() {\n return this.polylinePromise;\n }\n }, {\n key: 'handleEvent',\n value: function handleEvent(evt) {\n var _this3 = this;\n\n return function (e) {\n var evtName = 'on' + (0, _String.camelize)(evt);\n if (_this3.props[evtName]) {\n _this3.props[evtName](_this3.props, _this3.polyline, e);\n }\n };\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return Polyline;\n }(_react2.default.Component);\n\n Polyline.propTypes = {\n path: _propTypes2.default.array,\n strokeColor: _propTypes2.default.string,\n strokeOpacity: _propTypes2.default.number,\n strokeWeight: _propTypes2.default.number\n };\n\n evtNames.forEach(function (e) {\n return Polyline.propTypes[e] = _propTypes2.default.func;\n });\n\n Polyline.defaultProps = {\n name: 'Polyline'\n };\n\n exports.default = Polyline;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'prop-types', '../lib/arePathsEqual', '../lib/String'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('prop-types'), require('../lib/arePathsEqual'), require('../lib/String'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.propTypes, global.arePathsEqual, global.String);\n global.Circle = mod.exports;\n }\n})(this, function (exports, _react, _propTypes, _arePathsEqual, _String) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.Circle = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var evtNames = ['click', 'mouseout', 'mouseover'];\n\n var wrappedPromise = function wrappedPromise() {\n var wrappedPromise = {},\n promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n wrappedPromise.then = promise.then.bind(promise);\n wrappedPromise.catch = promise.catch.bind(promise);\n wrappedPromise.promise = promise;\n\n return wrappedPromise;\n };\n\n var Circle = exports.Circle = function (_React$Component) {\n _inherits(Circle, _React$Component);\n\n function Circle() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Circle);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Circle.__proto__ || Object.getPrototypeOf(Circle)).call.apply(_ref, [this].concat(args))), _this), _this.centerChanged = function (newCenter) {\n var _this$props$center = _this.props.center,\n lat = _this$props$center.lat,\n lng = _this$props$center.lng;\n\n return lat !== newCenter.lat || lng !== newCenter.lng;\n }, _this.propsChanged = function (newProps) {\n if (_this.centerChanged(newProps.center)) return true;\n\n return Object.keys(Circle.propTypes).some(function (key) {\n return _this.props[key] !== newProps[key];\n });\n }, _this.destroyCircle = function () {\n if (_this.circle) {\n _this.circle.setMap(null);\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Circle, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.circlePromise = wrappedPromise();\n this.renderCircle();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n var _props = this.props,\n path = _props.path,\n map = _props.map;\n\n\n if (this.propsChanged(prevProps) || map !== prevProps.map || !(0, _arePathsEqual.arePathsEqual)(path, prevProps.path)) {\n this.destroyCircle();\n this.renderCircle();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.destroyCircle();\n }\n }, {\n key: 'renderCircle',\n value: function renderCircle() {\n var _this2 = this;\n\n var _props2 = this.props,\n map = _props2.map,\n google = _props2.google,\n center = _props2.center,\n radius = _props2.radius,\n strokeColor = _props2.strokeColor,\n strokeOpacity = _props2.strokeOpacity,\n strokeWeight = _props2.strokeWeight,\n fillColor = _props2.fillColor,\n fillOpacity = _props2.fillOpacity,\n draggable = _props2.draggable,\n visible = _props2.visible,\n props = _objectWithoutProperties(_props2, ['map', 'google', 'center', 'radius', 'strokeColor', 'strokeOpacity', 'strokeWeight', 'fillColor', 'fillOpacity', 'draggable', 'visible']);\n\n if (!google) {\n return null;\n }\n\n var params = _extends({}, props, {\n map: map,\n center: center,\n radius: radius,\n draggable: draggable,\n visible: visible,\n options: {\n strokeColor: strokeColor,\n strokeOpacity: strokeOpacity,\n strokeWeight: strokeWeight,\n fillColor: fillColor,\n fillOpacity: fillOpacity\n }\n });\n\n this.circle = new google.maps.Circle(params);\n\n evtNames.forEach(function (e) {\n _this2.circle.addListener(e, _this2.handleEvent(e));\n });\n\n this.circlePromise.resolve(this.circle);\n }\n }, {\n key: 'getCircle',\n value: function getCircle() {\n return this.circlePromise;\n }\n }, {\n key: 'handleEvent',\n value: function handleEvent(evt) {\n var _this3 = this;\n\n return function (e) {\n var evtName = 'on' + (0, _String.camelize)(evt);\n if (_this3.props[evtName]) {\n _this3.props[evtName](_this3.props, _this3.circle, e);\n }\n };\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return Circle;\n }(_react2.default.Component);\n\n Circle.propTypes = {\n center: _propTypes2.default.object,\n radius: _propTypes2.default.number,\n strokeColor: _propTypes2.default.string,\n strokeOpacity: _propTypes2.default.number,\n strokeWeight: _propTypes2.default.number,\n fillColor: _propTypes2.default.string,\n fillOpacity: _propTypes2.default.number,\n draggable: _propTypes2.default.bool,\n visible: _propTypes2.default.bool\n };\n\n evtNames.forEach(function (e) {\n return Circle.propTypes[e] = _propTypes2.default.func;\n });\n\n Circle.defaultProps = {\n name: 'Circle'\n };\n\n exports.default = Circle;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.areBoundsEqual = mod.exports;\n }\n})(this, function (exports) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _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\n /**\n * Compares two bound objects.\n */\n\n var areBoundsEqual = exports.areBoundsEqual = function areBoundsEqual(boundA, boundB) {\n if (boundA === boundB) {\n return true;\n }\n if (!(boundA instanceof Object) || !(boundB instanceof Object)) {\n return false;\n }\n if (Object.keys(boundA).length !== Object.keys(boundB).length) {\n return false;\n }\n if (!areValidBounds(boundA) || !areValidBounds(boundB)) {\n return false;\n }\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object.keys(boundA)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n if (boundA[key] !== boundB[key]) {\n return false;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return true;\n };\n\n /**\n * Helper that checks whether an array consists of objects\n * with lat and lng properties\n * @param {object} elem the element to check\n * @returns {boolean} whether or not it's valid\n */\n var areValidBounds = function areValidBounds(elem) {\n return elem !== null && (typeof elem === 'undefined' ? 'undefined' : _typeof(elem)) === 'object' && elem.hasOwnProperty('north') && elem.hasOwnProperty('south') && elem.hasOwnProperty('east') && elem.hasOwnProperty('west');\n };\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', 'react', 'prop-types', '../lib/areBoundsEqual', '../lib/String'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('react'), require('prop-types'), require('../lib/areBoundsEqual'), require('../lib/String'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.react, global.propTypes, global.areBoundsEqual, global.String);\n global.Rectangle = mod.exports;\n }\n})(this, function (exports, _react, _propTypes, _areBoundsEqual, _String) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.Rectangle = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var evtNames = ['click', 'mouseout', 'mouseover'];\n\n var wrappedPromise = function wrappedPromise() {\n var wrappedPromise = {},\n promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n wrappedPromise.then = promise.then.bind(promise);\n wrappedPromise.catch = promise.catch.bind(promise);\n wrappedPromise.promise = promise;\n\n return wrappedPromise;\n };\n\n var Rectangle = exports.Rectangle = function (_React$Component) {\n _inherits(Rectangle, _React$Component);\n\n function Rectangle() {\n _classCallCheck(this, Rectangle);\n\n return _possibleConstructorReturn(this, (Rectangle.__proto__ || Object.getPrototypeOf(Rectangle)).apply(this, arguments));\n }\n\n _createClass(Rectangle, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.rectanglePromise = wrappedPromise();\n this.renderRectangle();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (this.props.map !== prevProps.map || !(0, _areBoundsEqual.areBoundsEqual)(this.props.bounds, prevProps.bounds)) {\n if (this.rectangle) {\n this.rectangle.setMap(null);\n }\n this.renderRectangle();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.rectangle) {\n this.rectangle.setMap(null);\n }\n }\n }, {\n key: 'renderRectangle',\n value: function renderRectangle() {\n var _this2 = this;\n\n var _props = this.props,\n map = _props.map,\n google = _props.google,\n bounds = _props.bounds,\n strokeColor = _props.strokeColor,\n strokeOpacity = _props.strokeOpacity,\n strokeWeight = _props.strokeWeight,\n fillColor = _props.fillColor,\n fillOpacity = _props.fillOpacity,\n props = _objectWithoutProperties(_props, ['map', 'google', 'bounds', 'strokeColor', 'strokeOpacity', 'strokeWeight', 'fillColor', 'fillOpacity']);\n\n if (!google) {\n return null;\n }\n\n var params = _extends({\n map: map,\n bounds: bounds,\n strokeColor: strokeColor,\n strokeOpacity: strokeOpacity,\n strokeWeight: strokeWeight,\n fillColor: fillColor,\n fillOpacity: fillOpacity\n }, props);\n\n this.rectangle = new google.maps.Rectangle(params);\n\n evtNames.forEach(function (e) {\n _this2.rectangle.addListener(e, _this2.handleEvent(e));\n });\n\n this.rectanglePromise.resolve(this.rectangle);\n }\n }, {\n key: 'getRectangle',\n value: function getRectangle() {\n return this.rectanglePromise;\n }\n }, {\n key: 'handleEvent',\n value: function handleEvent(evt) {\n var _this3 = this;\n\n return function (e) {\n var evtName = 'on' + (0, _String.camelize)(evt);\n if (_this3.props[evtName]) {\n _this3.props[evtName](_this3.props, _this3.rectangle, e);\n }\n };\n }\n }, {\n key: 'render',\n value: function render() {\n console.log('hii, ', this.props.bounds);\n return null;\n }\n }]);\n\n return Rectangle;\n }(_react2.default.Component);\n\n Rectangle.propTypes = {\n bounds: _propTypes2.default.object,\n strokeColor: _propTypes2.default.string,\n strokeOpacity: _propTypes2.default.number,\n strokeWeight: _propTypes2.default.number,\n fillColor: _propTypes2.default.string,\n fillOpacity: _propTypes2.default.number\n };\n\n evtNames.forEach(function (e) {\n return Rectangle.propTypes[e] = _propTypes2.default.func;\n });\n\n Rectangle.defaultProps = {\n name: 'Rectangle'\n };\n\n exports.default = Rectangle;\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([\"exports\"], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.cancelablePromise = mod.exports;\n }\n})(this, function (exports) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n // https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html\n\n var makeCancelable = exports.makeCancelable = function makeCancelable(promise) {\n var hasCanceled_ = false;\n\n var wrappedPromise = new Promise(function (resolve, reject) {\n promise.then(function (val) {\n return hasCanceled_ ? reject({ isCanceled: true }) : resolve(val);\n });\n promise.catch(function (error) {\n return hasCanceled_ ? reject({ isCanceled: true }) : reject(error);\n });\n });\n\n return {\n promise: wrappedPromise,\n cancel: function cancel() {\n hasCanceled_ = true;\n }\n };\n };\n});","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports', './GoogleApiComponent', './components/Marker', './components/InfoWindow', './components/HeatMap', './components/Polygon', './components/Polyline', './components/Circle', './components/Rectangle', 'react', 'prop-types', 'react-dom', './lib/String', './lib/cancelablePromise'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require('./GoogleApiComponent'), require('./components/Marker'), require('./components/InfoWindow'), require('./components/HeatMap'), require('./components/Polygon'), require('./components/Polyline'), require('./components/Circle'), require('./components/Rectangle'), require('react'), require('prop-types'), require('react-dom'), require('./lib/String'), require('./lib/cancelablePromise'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.GoogleApiComponent, global.Marker, global.InfoWindow, global.HeatMap, global.Polygon, global.Polyline, global.Circle, global.Rectangle, global.react, global.propTypes, global.reactDom, global.String, global.cancelablePromise);\n global.index = mod.exports;\n }\n})(this, function (exports, _GoogleApiComponent, _Marker, _InfoWindow, _HeatMap, _Polygon, _Polyline, _Circle, _Rectangle, _react, _propTypes, _reactDom, _String, _cancelablePromise) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.Map = exports.Rectangle = exports.Circle = exports.Polyline = exports.Polygon = exports.HeatMap = exports.InfoWindow = exports.Marker = exports.GoogleApiWrapper = undefined;\n Object.defineProperty(exports, 'GoogleApiWrapper', {\n enumerable: true,\n get: function () {\n return _GoogleApiComponent.wrapper;\n }\n });\n Object.defineProperty(exports, 'Marker', {\n enumerable: true,\n get: function () {\n return _Marker.Marker;\n }\n });\n Object.defineProperty(exports, 'InfoWindow', {\n enumerable: true,\n get: function () {\n return _InfoWindow.InfoWindow;\n }\n });\n Object.defineProperty(exports, 'HeatMap', {\n enumerable: true,\n get: function () {\n return _HeatMap.HeatMap;\n }\n });\n Object.defineProperty(exports, 'Polygon', {\n enumerable: true,\n get: function () {\n return _Polygon.Polygon;\n }\n });\n Object.defineProperty(exports, 'Polyline', {\n enumerable: true,\n get: function () {\n return _Polyline.Polyline;\n }\n });\n Object.defineProperty(exports, 'Circle', {\n enumerable: true,\n get: function () {\n return _Circle.Circle;\n }\n });\n Object.defineProperty(exports, 'Rectangle', {\n enumerable: true,\n get: function () {\n return _Rectangle.Rectangle;\n }\n });\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _reactDom2 = _interopRequireDefault(_reactDom);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _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\n 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 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\n var mapStyles = {\n container: {\n position: 'absolute',\n width: '100%',\n height: '100%'\n },\n map: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n top: 0\n }\n };\n\n var evtNames = ['ready', 'click', 'dragend', 'recenter', 'bounds_changed', 'center_changed', 'dblclick', 'dragstart', 'heading_change', 'idle', 'maptypeid_changed', 'mousemove', 'mouseout', 'mouseover', 'projection_changed', 'resize', 'rightclick', 'tilesloaded', 'tilt_changed', 'zoom_changed'];\n\n var Map = exports.Map = function (_React$Component) {\n _inherits(Map, _React$Component);\n\n function Map(props) {\n _classCallCheck(this, Map);\n\n var _this = _possibleConstructorReturn(this, (Map.__proto__ || Object.getPrototypeOf(Map)).call(this, props));\n\n if (!props.hasOwnProperty('google')) {\n throw new Error('You must include a `google` prop');\n }\n\n _this.listeners = {};\n _this.state = {\n currentLocation: {\n lat: _this.props.initialCenter.lat,\n lng: _this.props.initialCenter.lng\n }\n };\n\n _this.mapRef = _react2.default.createRef();\n return _this;\n }\n\n _createClass(Map, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n if (this.props.centerAroundCurrentLocation) {\n if (navigator && navigator.geolocation) {\n this.geoPromise = (0, _cancelablePromise.makeCancelable)(new Promise(function (resolve, reject) {\n navigator.geolocation.getCurrentPosition(resolve, reject);\n }));\n\n this.geoPromise.promise.then(function (pos) {\n var coords = pos.coords;\n _this2.setState({\n currentLocation: {\n lat: coords.latitude,\n lng: coords.longitude\n }\n });\n }).catch(function (e) {\n return e;\n });\n }\n }\n this.loadMap();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n if (prevProps.google !== this.props.google) {\n this.loadMap();\n }\n if (this.props.visible !== prevProps.visible) {\n this.restyleMap();\n }\n if (this.props.zoom !== prevProps.zoom) {\n this.map.setZoom(this.props.zoom);\n }\n if (this.props.center !== prevProps.center) {\n this.setState({\n currentLocation: this.props.center\n });\n }\n if (prevState.currentLocation !== this.state.currentLocation) {\n this.recenterMap();\n }\n if (this.props.bounds && this.props.bounds !== prevProps.bounds) {\n this.map.fitBounds(this.props.bounds);\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n var _this3 = this;\n\n var google = this.props.google;\n\n if (this.geoPromise) {\n this.geoPromise.cancel();\n }\n Object.keys(this.listeners).forEach(function (e) {\n google.maps.event.removeListener(_this3.listeners[e]);\n });\n }\n }, {\n key: 'loadMap',\n value: function loadMap() {\n var _this4 = this;\n\n if (this.props && this.props.google) {\n var google = this.props.google;\n\n var maps = google.maps;\n\n var mapRef = this.mapRef.current;\n var node = _reactDom2.default.findDOMNode(mapRef);\n var curr = this.state.currentLocation;\n var center = new maps.LatLng(curr.lat, curr.lng);\n\n var mapTypeIds = this.props.google.maps.MapTypeId || {};\n var mapTypeFromProps = String(this.props.mapType).toUpperCase();\n\n var mapConfig = Object.assign({}, {\n mapTypeId: mapTypeIds[mapTypeFromProps],\n center: center,\n zoom: this.props.zoom,\n maxZoom: this.props.maxZoom,\n minZoom: this.props.minZoom,\n clickableIcons: !!this.props.clickableIcons,\n disableDefaultUI: this.props.disableDefaultUI,\n zoomControl: this.props.zoomControl,\n zoomControlOptions: this.props.zoomControlOptions,\n mapTypeControl: this.props.mapTypeControl,\n mapTypeControlOptions: this.props.mapTypeControlOptions,\n scaleControl: this.props.scaleControl,\n streetViewControl: this.props.streetViewControl,\n streetViewControlOptions: this.props.streetViewControlOptions,\n panControl: this.props.panControl,\n rotateControl: this.props.rotateControl,\n fullscreenControl: this.props.fullscreenControl,\n scrollwheel: this.props.scrollwheel,\n draggable: this.props.draggable,\n draggableCursor: this.props.draggableCursor,\n keyboardShortcuts: this.props.keyboardShortcuts,\n disableDoubleClickZoom: this.props.disableDoubleClickZoom,\n noClear: this.props.noClear,\n styles: this.props.styles,\n gestureHandling: this.props.gestureHandling\n });\n\n Object.keys(mapConfig).forEach(function (key) {\n // Allow to configure mapConfig with 'false'\n if (mapConfig[key] === null) {\n delete mapConfig[key];\n }\n });\n\n this.map = new maps.Map(node, mapConfig);\n\n evtNames.forEach(function (e) {\n _this4.listeners[e] = _this4.map.addListener(e, _this4.handleEvent(e));\n });\n maps.event.trigger(this.map, 'ready');\n this.forceUpdate();\n }\n }\n }, {\n key: 'handleEvent',\n value: function handleEvent(evtName) {\n var _this5 = this;\n\n var timeout = void 0;\n var handlerName = 'on' + (0, _String.camelize)(evtName);\n\n return function (e) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n timeout = setTimeout(function () {\n if (_this5.props[handlerName]) {\n _this5.props[handlerName](_this5.props, _this5.map, e);\n }\n }, 0);\n };\n }\n }, {\n key: 'recenterMap',\n value: function recenterMap() {\n var map = this.map;\n\n var google = this.props.google;\n\n\n if (!google) return;\n var maps = google.maps;\n\n if (map) {\n var center = this.state.currentLocation;\n if (!(center instanceof google.maps.LatLng)) {\n center = new google.maps.LatLng(center.lat, center.lng);\n }\n // map.panTo(center)\n map.setCenter(center);\n maps.event.trigger(map, 'recenter');\n }\n }\n }, {\n key: 'restyleMap',\n value: function restyleMap() {\n if (this.map) {\n var google = this.props.google;\n\n google.maps.event.trigger(this.map, 'resize');\n }\n }\n }, {\n key: 'renderChildren',\n value: function renderChildren() {\n var _this6 = this;\n\n var children = this.props.children;\n\n\n if (!children) return;\n\n return _react2.default.Children.map(children, function (c) {\n if (!c) return;\n return _react2.default.cloneElement(c, {\n map: _this6.map,\n google: _this6.props.google,\n mapCenter: _this6.state.currentLocation\n });\n });\n }\n }, {\n key: 'render',\n value: function render() {\n var style = Object.assign({}, mapStyles.map, this.props.style, {\n display: this.props.visible ? 'inherit' : 'none'\n });\n\n var containerStyles = Object.assign({}, mapStyles.container, this.props.containerStyle);\n\n return _react2.default.createElement(\n 'div',\n { style: containerStyles, className: this.props.className },\n _react2.default.createElement(\n 'div',\n { style: style, ref: this.mapRef },\n 'Loading map...'\n ),\n this.renderChildren()\n );\n }\n }]);\n\n return Map;\n }(_react2.default.Component);\n\n Map.propTypes = {\n google: _propTypes2.default.object,\n zoom: _propTypes2.default.number,\n centerAroundCurrentLocation: _propTypes2.default.bool,\n center: _propTypes2.default.object,\n initialCenter: _propTypes2.default.object,\n className: _propTypes2.default.string,\n style: _propTypes2.default.object,\n containerStyle: _propTypes2.default.object,\n visible: _propTypes2.default.bool,\n mapType: _propTypes2.default.string,\n maxZoom: _propTypes2.default.number,\n minZoom: _propTypes2.default.number,\n clickableIcons: _propTypes2.default.bool,\n disableDefaultUI: _propTypes2.default.bool,\n zoomControl: _propTypes2.default.bool,\n zoomControlOptions: _propTypes2.default.object,\n mapTypeControl: _propTypes2.default.bool,\n mapTypeControlOptions: _propTypes2.default.bool,\n scaleControl: _propTypes2.default.bool,\n streetViewControl: _propTypes2.default.bool,\n streetViewControlOptions: _propTypes2.default.object,\n panControl: _propTypes2.default.bool,\n rotateControl: _propTypes2.default.bool,\n fullscreenControl: _propTypes2.default.bool,\n scrollwheel: _propTypes2.default.bool,\n draggable: _propTypes2.default.bool,\n draggableCursor: _propTypes2.default.string,\n keyboardShortcuts: _propTypes2.default.bool,\n disableDoubleClickZoom: _propTypes2.default.bool,\n noClear: _propTypes2.default.bool,\n styles: _propTypes2.default.array,\n gestureHandling: _propTypes2.default.string,\n bounds: _propTypes2.default.object\n };\n\n evtNames.forEach(function (e) {\n return Map.propTypes[(0, _String.camelize)(e)] = _propTypes2.default.func;\n });\n\n Map.defaultProps = {\n zoom: 14,\n initialCenter: {\n lat: 37.774929,\n lng: -122.419416\n },\n center: {},\n centerAroundCurrentLocation: false,\n style: {},\n containerStyle: {},\n visible: true\n };\n\n exports.default = Map;\n});","// the google-maps-react type definitions have a syntax error, causing Typescript\n// to fail to compile.\n// We must reexport it here with corrected types until they get around to\n// fixing it.\n\nmodule.exports = require('google-maps-react')\n","import { GoogleApiWrapper } from '@watermarkchurch/google-maps-react'\nimport WCC from 'wcc'\n\nconst connectGoogleMaps = GoogleApiWrapper({\n apiKey: WCC.CONSTANTS?.GOOGLE_MAPS_API_KEY,\n libraries: ['places', 'geometry'],\n})\n\nexport default connectGoogleMaps\n","/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */\n\nvar hasElementType = typeof Element !== 'undefined';\nvar hasMap = typeof Map === 'function';\nvar hasSet = typeof Set === 'function';\nvar hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;\n\n// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js\n\nfunction equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.3\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n // START: Modifications:\n // Apply guards for `Object.create(null)` handling. See:\n // - https://github.com/FormidableLabs/react-fast-compare/issues/64\n // - https://github.com/epoberezkin/fast-deep-equal/issues/49\n if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString();\n // END: Modifications\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function isEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if (((error.message || '').match(/stack|recursion/i))) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('react-fast-compare cannot handle circular refs');\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n","import { createContext } from 'react';\nexport var instantSearchContext = /*#__PURE__*/createContext({\n onInternalStateUpdate: function onInternalStateUpdate() {\n return undefined;\n },\n createHrefForState: function createHrefForState() {\n return '#';\n },\n onSearchForFacetValues: function onSearchForFacetValues() {\n return undefined;\n },\n onSearchStateChange: function onSearchStateChange() {\n return undefined;\n },\n onSearchParameters: function onSearchParameters() {\n return undefined;\n },\n store: {},\n widgetsManager: {},\n mainTargetedIndex: ''\n});\nvar InstantSearchConsumer = instantSearchContext.Consumer,\n InstantSearchProvider = instantSearchContext.Provider;\nexport { InstantSearchConsumer, InstantSearchProvider };\nvar _createContext = /*#__PURE__*/createContext(undefined),\n IndexConsumer = _createContext.Consumer,\n IndexProvider = _createContext.Provider;\nexport { IndexConsumer, IndexProvider };","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n// eslint-disable-next-line @typescript-eslint/unbound-method\nvar hasOwn = Object.prototype.hasOwnProperty;\n\n// From https://github.com/reactjs/react-redux/blob/master/src/utils/shallowEqual.js\nexport var shallowEqual = function shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\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 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};\nvar isPlainObject = function isPlainObject(value) {\n return _typeof(value) === 'object' && value !== null && !Array.isArray(value);\n};\nexport var removeEmptyKey = function removeEmptyKey(obj) {\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n if (!isPlainObject(value)) {\n return;\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 if (Array.isArray(value) && value.length === 0) {\n delete obj[key];\n }\n });\n return obj;\n};\nexport function addAbsolutePositions(hits, hitsPerPage, page) {\n return hits.map(function (hit, index) {\n return _objectSpread(_objectSpread({}, hit), {}, {\n __position: hitsPerPage * page + index + 1\n });\n });\n}\nexport function addQueryID(hits, queryID) {\n if (!queryID) {\n return hits;\n }\n return hits.map(function (hit) {\n return _objectSpread(_objectSpread({}, hit), {}, {\n __queryID: queryID\n });\n });\n}\nexport function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n return undefined;\n}\nexport function objectHasKeys(object) {\n return object && Object.keys(object).length > 0;\n}\n\n// https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\nexport function omit(source, excluded) {\n if (source === null || source === undefined) {\n return {};\n }\n var target = {};\n var sourceKeys = Object.keys(source);\n for (var i = 0; i < sourceKeys.length; i++) {\n var key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) {\n // eslint-disable-next-line no-continue\n continue;\n }\n target[key] = source[key];\n }\n return target;\n}\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 */\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}\nexport function unescapeFacetValue(value) {\n return value.replace(/^\\\\-/, '-');\n}","var _excluded = [\"contextValue\"];\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { Component } from 'react';\nimport isEqual from 'react-fast-compare';\nimport { InstantSearchConsumer, IndexConsumer } from \"./context.js\";\nimport { shallowEqual, getDisplayName, removeEmptyKey } from \"./utils.js\";\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 */\nexport function createConnectorWithoutContext(connectorDesc) {\n if (!connectorDesc.displayName) {\n throw new Error('`createConnector` requires you to provide a `displayName` property.');\n }\n var isWidget = typeof connectorDesc.getSearchParameters === 'function' || typeof connectorDesc.getMetadata === 'function' || typeof connectorDesc.transitionState === 'function';\n return function (Composed) {\n var additionalWidgetProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var Connector = /*#__PURE__*/function (_Component) {\n _inherits(Connector, _Component);\n var _super = _createSuper(Connector);\n function Connector(props) {\n var _this;\n _classCallCheck(this, Connector);\n _this = _super.call(this, props);\n _defineProperty(_assertThisInitialized(_this), \"unsubscribe\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"unregisterWidget\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cleanupTimerRef\", null);\n _defineProperty(_assertThisInitialized(_this), \"isUnmounting\", false);\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n providedProps: _this.getProvidedProps(_this.props)\n });\n _defineProperty(_assertThisInitialized(_this), \"refine\", function () {\n var _ref;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this.props.contextValue.onInternalStateUpdate(\n // 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 _defineProperty(_assertThisInitialized(_this), \"createURL\", function () {\n var _ref2;\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return _this.props.contextValue.createHrefForState(\n // 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 _defineProperty(_assertThisInitialized(_this), \"searchForFacetValues\", function () {\n var _ref3;\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n _this.props.contextValue.onSearchForFacetValues(\n // 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 if (connectorDesc.getSearchParameters) {\n _this.props.contextValue.onSearchParameters(connectorDesc.getSearchParameters.bind(_assertThisInitialized(_this)), {\n ais: _this.props.contextValue,\n multiIndexContext: _this.props.indexContextValue\n }, _this.props, connectorDesc.getMetadata && connectorDesc.getMetadata.bind(_assertThisInitialized(_this)), connectorDesc.displayName);\n }\n return _this;\n }\n _createClass(Connector, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n if (this.cleanupTimerRef) {\n clearTimeout(this.cleanupTimerRef);\n this.cleanupTimerRef = null;\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 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 var propsEqual = shallowEqual(this.props, nextProps);\n if (this.state.providedProps === null || nextState.providedProps === null) {\n if (this.state.providedProps === nextState.providedProps) {\n return !propsEqual;\n }\n return true;\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 if (isWidget) {\n this.props.contextValue.widgetsManager.update();\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 var _this3 = this;\n this.cleanupTimerRef = setTimeout(function () {\n _this3.isUnmounting = true;\n if (_this3.unsubscribe) {\n _this3.unsubscribe();\n }\n if (_this3.unregisterWidget) {\n _this3.unregisterWidget();\n if (typeof connectorDesc.cleanUp === 'function') {\n var nextState = connectorDesc.cleanUp.call(_this3, _this3.props, _this3.props.contextValue.store.getState().widgets);\n _this3.props.contextValue.store.setState(_objectSpread(_objectSpread({}, _this3.props.contextValue.store.getState()), {}, {\n widgets: nextState\n }));\n _this3.props.contextValue.onSearchStateChange(removeEmptyKey(nextState));\n }\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 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,\n // @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 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 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 return nextWidgetsState;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n contextValue = _this$props.contextValue,\n props = _objectWithoutProperties(_this$props, _excluded);\n var providedProps = this.state.providedProps;\n if (providedProps === null) {\n return null;\n }\n var refineProps = typeof connectorDesc.refine === 'function' ? {\n refine: this.refine,\n createURL: this.createURL\n } : {};\n var searchForFacetValuesProps = typeof connectorDesc.searchForFacetValues === 'function' ? {\n searchForItems: this.searchForFacetValues\n } : {};\n return /*#__PURE__*/React.createElement(Composed, _extends({}, props, providedProps, refineProps, searchForFacetValuesProps));\n }\n }]);\n return Connector;\n }(Component);\n _defineProperty(Connector, \"displayName\", \"\".concat(connectorDesc.displayName, \"(\").concat(getDisplayName(Composed), \")\"));\n _defineProperty(Connector, \"$$type\", connectorDesc.$$type);\n _defineProperty(Connector, \"$$widgetType\", additionalWidgetProperties.$$widgetType);\n _defineProperty(Connector, \"propTypes\", connectorDesc.propTypes);\n _defineProperty(Connector, \"defaultProps\", connectorDesc.defaultProps);\n _defineProperty(Connector, \"_connectorDesc\", connectorDesc);\n return Connector;\n };\n}\nvar createConnectorWithContext = function createConnectorWithContext(connectorDesc) {\n return function (Composed, additionalWidgetProperties) {\n var Connector = createConnectorWithoutContext(connectorDesc)(Composed, additionalWidgetProperties);\n var ConnectorWrapper = function ConnectorWrapper(props) {\n return /*#__PURE__*/React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return /*#__PURE__*/React.createElement(IndexConsumer, null, function (indexContextValue) {\n return /*#__PURE__*/React.createElement(Connector, _extends({\n contextValue: contextValue,\n indexContextValue: indexContextValue\n }, props));\n });\n });\n };\n return ConnectorWrapper;\n };\n};\nexport default createConnectorWithContext;","import { getPropertyByPath } from \"./utils.js\";\nexport var HIGHLIGHT_TAGS = {\n highlightPreTag: \"\",\n highlightPostTag: \"\"\n};\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 */\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 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 if (splitByPostTag[1] !== '') {\n elements.push({\n value: splitByPostTag[1],\n isHighlighted: false\n });\n }\n });\n }\n return elements;\n}\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 */\nexport function parseAlgoliaHit(_ref2) {\n var _ref2$preTag = _ref2.preTag,\n preTag = _ref2$preTag === void 0 ? '' : _ref2$preTag,\n _ref2$postTag = _ref2.postTag,\n postTag = _ref2$postTag === void 0 ? '' : _ref2$postTag,\n highlightProperty = _ref2.highlightProperty,\n attribute = _ref2.attribute,\n hit = _ref2.hit;\n if (!hit) throw new Error('`hit`, the matching record, must be provided');\n var highlightObject = getPropertyByPath(hit[highlightProperty], attribute) || {};\n 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 return parseHighlightedAttribute({\n preTag: preTag,\n postTag: postTag,\n highlightedValue: highlightObject.value\n });\n}","export default '6.40.4';","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { Component } from 'react';\nvar withKeysPropType = function withKeysPropType(keys) {\n return function (props, propName, componentName) {\n var prop = props[propName];\n if (prop) {\n // eslint-disable-next-line no-restricted-syntax\n for (var _i = 0, _Object$keys = Object.keys(prop); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n if (keys.indexOf(key) === -1) {\n return new Error(\"Unknown `\".concat(propName, \"` key `\").concat(key, \"`. Check the render method \") + \"of `\".concat(componentName, \"`.\"));\n }\n }\n }\n return undefined;\n };\n};\nexport default function translatable(defaultTranslations) {\n return function (Composed) {\n var Translatable = /*#__PURE__*/function (_Component) {\n _inherits(Translatable, _Component);\n var _super = _createSuper(Translatable);\n function Translatable() {\n var _this;\n _classCallCheck(this, Translatable);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"translate\", function (key) {\n var translations = _this.props.translations;\n var translation = translations && translations.hasOwnProperty(key) ? translations[key] : defaultTranslations[key];\n if (typeof translation === 'function') {\n for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n params[_key2 - 1] = arguments[_key2];\n }\n return translation.apply(void 0, params);\n }\n return translation;\n });\n return _this;\n }\n _createClass(Translatable, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(Composed, _extends({\n translate: this.translate\n }, this.props));\n }\n }]);\n return Translatable;\n }(Component);\n var name = Composed.displayName || Composed.name || 'UnknownComponent';\n Translatable.displayName = \"Translatable(\".concat(name, \")\");\n Translatable.propTypes = {\n translations: withKeysPropType(Object.keys(defaultTranslations))\n };\n return Translatable;\n };\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { omit } from \"./utils.js\";\nexport function getIndexId(context) {\n return hasMultipleIndices(context) ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @returns {import('algoliasearch-helper').SearchResults} results\n */\nexport function getResults(searchResults, context) {\n if (searchResults.results) {\n if (searchResults.results.hits) {\n return searchResults.results;\n }\n var indexId = getIndexId(context);\n if (searchResults.results[indexId]) {\n return searchResults.results[indexId];\n }\n }\n return null;\n}\nexport function hasMultipleIndices(context) {\n return context && context.multiIndexContext;\n}\nexport function refineValue(searchState, nextRefinement, context, resetPage, namespace) {\n if (hasMultipleIndices(context)) {\n var indexId = getIndexId(context);\n return namespace ? refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) : refineMultiIndex(searchState, nextRefinement, indexId, resetPage);\n } else {\n // When we have a multi index page with shared widgets we should also\n // reset their page to 1 if the resetPage is provided. Otherwise the\n // indices will always be reset\n // see: https://github.com/algolia/react-instantsearch/issues/310\n // see: https://github.com/algolia/react-instantsearch/issues/637\n if (searchState.indices && resetPage) {\n Object.keys(searchState.indices).forEach(function (targetedIndex) {\n searchState = refineValue(searchState, {\n page: 1\n }, {\n multiIndexContext: {\n targetedIndex: targetedIndex\n }\n }, true, namespace);\n });\n }\n return namespace ? refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) : refineSingleIndex(searchState, nextRefinement, resetPage);\n }\n}\nfunction refineMultiIndex(searchState, nextRefinement, indexId, resetPage) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n var state = searchState.indices && searchState.indices[indexId] ? _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread(_objectSpread({}, searchState.indices[indexId]), nextRefinement), page))) : _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, nextRefinement), page)));\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: state\n });\n}\nfunction refineSingleIndex(searchState, nextRefinement, resetPage) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n return _objectSpread(_objectSpread(_objectSpread({}, searchState), nextRefinement), page);\n}\nfunction refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) {\n var _objectSpread4;\n var page = resetPage ? {\n page: 1\n } : undefined;\n var state = searchState.indices && searchState.indices[indexId] ? _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, searchState.indices[indexId]), {}, (_objectSpread4 = {}, _defineProperty(_objectSpread4, namespace, _objectSpread(_objectSpread({}, searchState.indices[indexId][namespace]), nextRefinement)), _defineProperty(_objectSpread4, \"page\", 1), _objectSpread4)))) : _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_defineProperty({}, namespace, nextRefinement), page)));\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: state\n });\n}\nfunction refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n return _objectSpread(_objectSpread({}, searchState), {}, _defineProperty({}, namespace, _objectSpread(_objectSpread({}, searchState[namespace]), nextRefinement)), page);\n}\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}\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 if (multiIndex && namespace) {\n return searchState.indices && searchState.indices[indexId] && searchState.indices[indexId][namespace] && Object.hasOwnProperty.call(searchState.indices[indexId][namespace], attributeName);\n }\n if (multiIndex) {\n return searchState.indices && searchState.indices[indexId] && Object.hasOwnProperty.call(searchState.indices[indexId], id);\n }\n if (namespace) {\n return searchState[namespace] && Object.hasOwnProperty.call(searchState[namespace], attributeName);\n }\n return Object.hasOwnProperty.call(searchState, id);\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 if (multiIndex && namespace) {\n return searchState.indices[indexId][namespace][attributeName];\n }\n if (multiIndex) {\n return searchState.indices[indexId][id];\n }\n if (namespace) {\n return searchState[namespace][attributeName];\n }\n return searchState[id];\n}\nexport function getCurrentRefinementValue(props, searchState, context, id, defaultValue) {\n var indexId = getIndexId(context);\n var _getNamespaceAndAttri = getNamespaceAndAttributeName(id),\n namespace = _getNamespaceAndAttri.namespace,\n attributeName = _getNamespaceAndAttri.attributeName;\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 if (hasRefinementsValue) {\n return getRefinements(args);\n }\n if (props.defaultRefinement) {\n return props.defaultRefinement;\n }\n return defaultValue;\n}\nexport function cleanUpValue(searchState, context, id) {\n var indexId = getIndexId(context);\n var _getNamespaceAndAttri2 = getNamespaceAndAttributeName(id),\n namespace = _getNamespaceAndAttri2.namespace,\n attributeName = _getNamespaceAndAttri2.attributeName;\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 return cleanUpValueWithSingleIndex({\n attribute: attributeName,\n searchState: searchState,\n id: id,\n namespace: namespace\n });\n}\nfunction cleanUpValueWithSingleIndex(_ref3) {\n var searchState = _ref3.searchState,\n id = _ref3.id,\n namespace = _ref3.namespace,\n attribute = _ref3.attribute;\n if (namespace) {\n return _objectSpread(_objectSpread({}, searchState), {}, _defineProperty({}, namespace, omit(searchState[namespace], [attribute])));\n }\n return omit(searchState, [id]);\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 if (namespace && indexSearchState) {\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, indexSearchState), {}, _defineProperty({}, namespace, omit(indexSearchState[namespace], [attribute])))))\n });\n }\n if (indexSearchState) {\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, omit(indexSearchState, [id])))\n });\n }\n return searchState;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _excluded = [\"children\", \"contextValue\", \"indexContextValue\"],\n _excluded2 = [\"children\", \"contextValue\", \"indexContextValue\"];\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport createConnector from \"../core/createConnector.js\";\nimport { refineValue, getIndexId, hasMultipleIndices } from \"../core/indexUtils.js\";\nimport { omit } from \"../core/utils.js\";\nfunction getId() {\n return 'configure';\n}\nexport default createConnector({\n displayName: 'AlgoliaConfigure',\n $$type: 'ais.configure',\n getProvidedProps: function getProvidedProps() {\n return {};\n },\n getSearchParameters: function getSearchParameters(searchParameters, props) {\n var children = props.children,\n contextValue = props.contextValue,\n indexContextValue = props.indexContextValue,\n items = _objectWithoutProperties(props, _excluded);\n return searchParameters.setQueryParameters(items);\n },\n transitionState: function transitionState(props, prevSearchState, nextSearchState) {\n var id = getId();\n var children = props.children,\n contextValue = props.contextValue,\n indexContextValue = props.indexContextValue,\n items = _objectWithoutProperties(props, _excluded2);\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 var nextValue = _defineProperty({}, id, _objectSpread(_objectSpread({}, omit(nextSearchState[id], nonPresentKeys)), items));\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 return acc;\n }, {});\n var nextValue = _defineProperty({}, id, configureState);\n return refineValue(searchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n});","import connectConfigure from \"../connectors/connectConfigure.js\";\n\n/**\n * Configure is a widget that lets you provide raw search parameters\n * to the Algolia API.\n *\n * Any of the props added to this widget will be forwarded to Algolia. For more information\n * on the different parameters that can be set, have a look at the\n * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters).\n *\n * This widget can be used either with react-dom and react-native. It will not render anything\n * on screen, only configure some parameters.\n *\n * Read more in the [Search parameters](guide/Search_parameters.html) guide.\n * @name Configure\n * @kind widget\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Configure, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\nexport default connectConfigure(function Configure() {\n return null;\n}, {\n $$widgetType: 'ais.configure'\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\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\n// EventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// 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.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","'use strict';\n\nfunction inherits(ctor, superCtor) {\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n });\n}\n\nmodule.exports = inherits;\n","'use strict';\n\nvar EventEmitter = require('@algolia/events');\n\nvar inherits = require('../functions/inherits');\n\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 * @param {AlgoliaSearchHelper} mainHelper the main helper\n * @param {function} fn the function to create the derived state\n */\nfunction DerivedHelper(mainHelper, fn) {\n this.main = mainHelper;\n this.fn = fn;\n this.lastResults = null;\n}\n\ninherits(DerivedHelper, EventEmitter);\n\n/**\n * Detach this helper from the main helper\n * @return {undefined}\n * @throws Error if the derived helper is already detached\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;\n","'use strict';\n\n/**\n * Replaces a leading - with \\-\n * @private\n * @param {any} value the facet value to replace\n * @returns {any} the escaped facet value or the value if it was not a string\n */\nfunction escapeFacetValue(value) {\n if (typeof value !== 'string') return value;\n\n return String(value).replace(/^-/, '\\\\-');\n}\n\n/**\n * Replaces a leading \\- with -\n * @private\n * @param {any} value the escaped facet value\n * @returns {any} the unescaped facet value or the value if it was not a string\n */\nfunction unescapeFacetValue(value) {\n if (typeof value !== 'string') return value;\n\n return value.replace(/^\\\\-/, '-');\n}\n\nmodule.exports = {\n escapeFacetValue: escapeFacetValue,\n unescapeFacetValue: unescapeFacetValue,\n};\n","'use strict';\n\nfunction clone(value) {\n if (typeof value === 'object' && value !== null) {\n return _merge(Array.isArray(value) ? [] : {}, value);\n }\n return value;\n}\n\nfunction isObjectOrArrayOrFunction(value) {\n return (\n typeof value === 'function' ||\n Array.isArray(value) ||\n Object.prototype.toString.call(value) === '[object Object]'\n );\n}\n\nfunction _merge(target, source) {\n if (target === source) {\n return target;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (var key in source) {\n if (\n !Object.prototype.hasOwnProperty.call(source, key) ||\n key === '__proto__' ||\n key === 'constructor'\n ) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n var sourceVal = source[key];\n var targetVal = target[key];\n\n if (typeof targetVal !== 'undefined' && typeof sourceVal === 'undefined') {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (\n isObjectOrArrayOrFunction(targetVal) &&\n isObjectOrArrayOrFunction(sourceVal)\n ) {\n target[key] = _merge(targetVal, sourceVal);\n } else {\n target[key] = clone(sourceVal);\n }\n }\n return target;\n}\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} target The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\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 return target;\n}\n\nmodule.exports = merge;\n","'use strict';\n\nfunction objectHasKeys(obj) {\n return obj && Object.keys(obj).length > 0;\n}\n\nmodule.exports = objectHasKeys;\n","'use strict';\n\n// https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\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 for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n // eslint-disable-next-line no-continue\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;\n","'use strict';\n\nvar merge = require('./functions/merge');\n\nfunction sortObject(obj) {\n return Object.keys(obj)\n .sort()\n .reduce(function (acc, curr) {\n acc[curr] = obj[curr];\n return acc;\n }, {});\n}\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 * @param {string} index The name of the index\n * @param {SearchParameters} state The state from which to get the queries\n * @return {object[]} The queries\n */\n _getQueries: function getQueries(index, state) {\n var queries = [];\n\n // One query for the hits\n queries.push({\n indexName: index,\n params: requestBuilder._getHitsSearchParams(state),\n });\n\n // One for each disjunctive facets\n state.getRefinedDisjunctiveFacets().forEach(function (refinedFacet) {\n queries.push({\n indexName: index,\n params: requestBuilder._getDisjunctiveFacetSearchParams(\n state,\n refinedFacet\n ),\n });\n });\n\n // More to get the parent levels of the hierarchical facets when refined\n state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n // If we are deeper than level 0 (starting from `beer > IPA`)\n // we want to get all parent values\n if (\n currentRefinement.length > 0 &&\n currentRefinement[0].split(separator).length > 1\n ) {\n // We generate a map of the filters we will use for our facet values queries\n var filtersMap = currentRefinement[0]\n .split(separator)\n .slice(0, -1)\n .reduce(function createFiltersMap(map, segment, level) {\n return map.concat({\n attribute: hierarchicalFacet.attributes[level],\n value:\n level === 0\n ? segment\n : [map[map.length - 1].value, segment].join(separator),\n });\n }, []);\n\n filtersMap.forEach(function (filter, level) {\n var params = requestBuilder._getDisjunctiveFacetSearchParams(\n state,\n filter.attribute,\n level === 0\n );\n\n // Keep facet filters unrelated to current hierarchical attributes\n function hasHierarchicalFacetFilter(value) {\n return hierarchicalFacet.attributes.some(function (attribute) {\n return attribute === value.split(':')[0];\n });\n }\n\n var filteredFacetFilters = (params.facetFilters || []).reduce(\n function (acc, facetFilter) {\n if (Array.isArray(facetFilter)) {\n var filtered = facetFilter.filter(function (filterValue) {\n return !hasHierarchicalFacetFilter(filterValue);\n });\n\n if (filtered.length > 0) {\n acc.push(filtered);\n }\n }\n\n if (\n typeof facetFilter === 'string' &&\n !hasHierarchicalFacetFilter(facetFilter)\n ) {\n acc.push(facetFilter);\n }\n\n return acc;\n },\n []\n );\n\n var parent = filtersMap[level - 1];\n if (level > 0) {\n params.facetFilters = filteredFacetFilters.concat(\n parent.attribute + ':' + parent.value\n );\n } else {\n params.facetFilters =\n filteredFacetFilters.length > 0\n ? filteredFacetFilters\n : undefined;\n }\n\n queries.push({ indexName: index, params: params });\n });\n }\n });\n\n return queries;\n },\n\n /**\n * Build search parameters used to fetch hits\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @return {object.} The search parameters for hits\n */\n _getHitsSearchParams: function (state) {\n var facets = state.facets\n .concat(state.disjunctiveFacets)\n .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state))\n .sort();\n\n var facetFilters = requestBuilder._getFacetFilters(state);\n var numericFilters = requestBuilder._getNumericFilters(state);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {\n facets: facets.indexOf('*') > -1 ? ['*'] : facets,\n tagFilters: tagFilters,\n };\n\n if (facetFilters.length > 0) {\n additionalParams.facetFilters = facetFilters;\n }\n\n if (numericFilters.length > 0) {\n additionalParams.numericFilters = numericFilters;\n }\n\n return sortObject(merge({}, state.getQueryParams(), additionalParams));\n },\n\n /**\n * Build search parameters used to fetch a disjunctive facet\n * @private\n * @param {SearchParameters} state The state from which to get the queries\n * @param {string} facet the associated facet name\n * @param {boolean} hierarchicalRootLevel ?? FIXME\n * @return {object} The search parameters for a disjunctive facet\n */\n _getDisjunctiveFacetSearchParams: function (\n state,\n facet,\n hierarchicalRootLevel\n ) {\n var facetFilters = requestBuilder._getFacetFilters(\n state,\n facet,\n hierarchicalRootLevel\n );\n var numericFilters = requestBuilder._getNumericFilters(state, facet);\n var tagFilters = requestBuilder._getTagFilters(state);\n var additionalParams = {\n hitsPerPage: 0,\n page: 0,\n analytics: false,\n clickAnalytics: false,\n };\n\n if (tagFilters.length > 0) {\n additionalParams.tagFilters = tagFilters;\n }\n\n var hierarchicalFacet = state.getHierarchicalFacetByName(facet);\n\n if (hierarchicalFacet) {\n additionalParams.facets =\n requestBuilder._getDisjunctiveHierarchicalFacetAttribute(\n state,\n hierarchicalFacet,\n hierarchicalRootLevel\n );\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 sortObject(merge({}, state.getQueryParams(), additionalParams));\n },\n\n /**\n * Return the numeric filters in an algolia request fashion\n * @private\n * @param {SearchParameters} state the state from which to get the filters\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 (state, facetName) {\n if (state.numericFilters) {\n return state.numericFilters;\n }\n\n var numericFilters = [];\n\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 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\n return numericFilters;\n },\n\n /**\n * Return the tags filters depending on which format is used, either tagFilters or tagRefinements\n * @private\n * @param {SearchParameters} state the state from which to get the filters\n * @return {string} Tag filters in a single string\n */\n _getTagFilters: function (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 {SearchParameters} state The state from which to get the queries\n * @param {string} [facet] if set, the current disjunctive facet\n * @param {boolean} [hierarchicalRootLevel] ?? FIXME\n * @return {array.} The facet filters in the algolia format\n */\n _getFacetFilters: function (state, facet, hierarchicalRootLevel) {\n var facetFilters = [];\n\n var facetsRefinements = state.facetsRefinements || {};\n Object.keys(facetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = facetsRefinements[facetName] || [];\n facetValues.sort().forEach(function (facetValue) {\n facetFilters.push(facetName + ':' + facetValue);\n });\n });\n\n var facetsExcludes = state.facetsExcludes || {};\n Object.keys(facetsExcludes)\n .sort()\n .forEach(function (facetName) {\n var facetValues = facetsExcludes[facetName] || [];\n facetValues.sort().forEach(function (facetValue) {\n facetFilters.push(facetName + ':-' + facetValue);\n });\n });\n\n var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {};\n Object.keys(disjunctiveFacetsRefinements)\n .sort()\n .forEach(function (facetName) {\n var facetValues = disjunctiveFacetsRefinements[facetName] || [];\n if (facetName === facet || !facetValues || facetValues.length === 0) {\n return;\n }\n var orFilters = [];\n\n facetValues.sort().forEach(function (facetValue) {\n orFilters.push(facetName + ':' + facetValue);\n });\n\n facetFilters.push(orFilters);\n });\n\n var hierarchicalFacetsRefinements =\n state.hierarchicalFacetsRefinements || {};\n Object.keys(hierarchicalFacetsRefinements)\n .sort()\n .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 var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n var attributeToRefine;\n var attributesIndex;\n\n // we ask for parent facet values only when the `facet` is the current hierarchical facet\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 (\n facetValue.indexOf(separator) === -1 ||\n (!rootPath && hierarchicalRootLevel === true) ||\n (rootPath &&\n rootPath.split(separator).length ===\n facetValue.split(separator).length)\n ) {\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\n attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n }\n\n if (attributeToRefine) {\n facetFilters.push([attributeToRefine + ':' + facetValue]);\n }\n });\n\n return facetFilters;\n },\n\n _getHitsHierarchicalFacetsAttributes: function (state) {\n var out = [];\n\n return state.hierarchicalFacets.reduce(\n // ask for as much levels as there's hierarchical refinements\n function getHitsAttributesForHierarchicalFacet(\n allAttributes,\n hierarchicalFacet\n ) {\n var hierarchicalRefinement = state.getHierarchicalRefinement(\n hierarchicalFacet.name\n )[0];\n\n // if no refinement, ask for root level\n if (!hierarchicalRefinement) {\n allAttributes.push(hierarchicalFacet.attributes[0]);\n return allAttributes;\n }\n\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var level = hierarchicalRefinement.split(separator).length;\n var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1);\n\n return allAttributes.concat(newAttributes);\n },\n out\n );\n },\n\n _getDisjunctiveHierarchicalFacetAttribute: function (\n state,\n hierarchicalFacet,\n rootLevel\n ) {\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n if (rootLevel === true) {\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n var attributeIndex = 0;\n\n if (rootPath) {\n attributeIndex = rootPath.split(separator).length;\n }\n return [hierarchicalFacet.attributes[attributeIndex]];\n }\n\n var hierarchicalRefinement =\n state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || '';\n // 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\n getSearchForFacetQuery: function (facetName, query, maxFacetHits, state) {\n var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName)\n ? state.clearRefinements(facetName)\n : state;\n var searchForFacetSearchParameters = {\n facetQuery: query,\n facetName: facetName,\n };\n if (typeof maxFacetHits === 'number') {\n searchForFacetSearchParameters.maxFacetHits = maxFacetHits;\n }\n return sortObject(\n merge(\n {},\n requestBuilder._getHitsSearchParams(stateForSearchForFacetValues),\n searchForFacetSearchParameters\n )\n );\n },\n};\n\nmodule.exports = requestBuilder;\n","'use strict';\n\n// NOTE: this behaves like lodash/defaults, but doesn't mutate the target\n// it also preserve keys order\nmodule.exports = function defaultsPure() {\n var sources = Array.prototype.slice.call(arguments);\n\n return sources.reduceRight(function (acc, source) {\n Object.keys(Object(source)).forEach(function (key) {\n if (source[key] === undefined) {\n return;\n }\n if (acc[key] !== undefined) {\n // remove if already added, so that we can add it in correct order\n delete acc[key];\n }\n acc[key] = source[key];\n });\n return acc;\n }, {});\n};\n","'use strict';\n\n// @MAJOR can be replaced by native Array#find when we change support\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\n return undefined;\n};\n","'use strict';\n\nfunction intersection(arr1, arr2) {\n return arr1.filter(function (value, index) {\n return (\n arr2.indexOf(value) > -1 &&\n arr1.indexOf(value) === index /* skips duplicates */\n );\n });\n}\n\nmodule.exports = intersection;\n","'use strict';\n\nfunction valToNumber(v) {\n if (typeof v === 'number') {\n return v;\n } else if (typeof v === 'string') {\n return parseFloat(v);\n } else if (Array.isArray(v)) {\n return v.map(valToNumber);\n }\n\n throw new Error(\n 'The value should be a number, a parsable string or an array of those.'\n );\n}\n\nmodule.exports = valToNumber;\n","'use strict';\n\nmodule.exports = function isValidUserToken(userToken) {\n if (userToken === null) {\n return false;\n }\n return /^[a-zA-Z0-9_-]{1,64}$/.test(userToken);\n};\n","'use strict';\n\n/**\n * Functions to manipulate refinement lists\n *\n * The RefinementList is not formally defined through a prototype but is based\n * on a specific structure.\n *\n * @module SearchParameters.refinementList\n *\n * @typedef {string[]} SearchParameters.refinementList.Refinements\n * @typedef {Object.} SearchParameters.refinementList.RefinementList\n */\n\nvar defaultsPure = require('../functions/defaultsPure');\nvar objectHasKeys = require('../functions/objectHasKeys');\nvar omit = require('../functions/omit');\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\n var facetRefinement = !refinementList[attribute]\n ? [valueAsString]\n : refinementList[attribute].concat(valueAsString);\n\n var mod = {};\n\n mod[attribute] = facetRefinement;\n\n return defaultsPure({}, mod, refinementList);\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(\n refinementList,\n attribute,\n value\n ) {\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\n return lib.clearRefinement(refinementList, function (v, f) {\n return attribute === f && valueAsString === v;\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(\n refinementList,\n attribute,\n value\n ) {\n if (value === undefined)\n 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 * 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(\n refinementList,\n attribute,\n refinementType\n ) {\n if (attribute === undefined) {\n // return the same object if the list is already empty\n // this is mainly for tests, as it doesn't have much impact on performance\n if (!objectHasKeys(refinementList)) {\n return refinementList;\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\n var newRefinementList = Object.keys(refinementList).reduce(function (\n memo,\n key\n ) {\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\n return memo;\n },\n {});\n\n if (hasChanged) return newRefinementList;\n return refinementList;\n }\n\n // We return nothing if the attribute is not undefined, a string or a function,\n // as it is not a valid value for a refinement\n return undefined;\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} true if the attribute is refined, false otherwise\n */\n isRefined: function isRefined(refinementList, attribute, refinementValue) {\n var containsRefinements =\n Boolean(refinementList[attribute]) &&\n refinementList[attribute].length > 0;\n\n if (refinementValue === undefined || !containsRefinements) {\n return containsRefinements;\n }\n\n var refinementValueAsString = '' + refinementValue;\n\n return refinementList[attribute].indexOf(refinementValueAsString) !== -1;\n },\n};\n\nmodule.exports = lib;\n","'use strict';\n\nvar defaultsPure = require('../functions/defaultsPure');\nvar find = require('../functions/find');\nvar intersection = require('../functions/intersection');\nvar merge = require('../functions/merge');\nvar objectHasKeys = require('../functions/objectHasKeys');\nvar omit = require('../functions/omit');\nvar valToNumber = require('../functions/valToNumber');\nvar isValidUserToken = require('../utils/isValidUserToken');\n\nvar RefinementList = require('./RefinementList');\n\n/**\n * isEqual, but only for numeric refinement values, possible values:\n * - 5\n * - [5]\n * - [[5]]\n * - [[5,5],[4]]\n * @param {any} a numeric refinement value\n * @param {any} b numeric refinement value\n * @return {boolean} true if the values are equal\n */\nfunction isEqualNumericRefinement(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n return (\n a.length === b.length &&\n a.every(function (el, i) {\n return isEqualNumericRefinement(b[i], el);\n })\n );\n }\n return a === b;\n}\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 */\nfunction findArray(array, searchedValue) {\n return find(array, function (currentValue) {\n return isEqualNumericRefinement(currentValue, searchedValue);\n });\n}\n\n/**\n * The facet list is the structure used to store the list of values used to\n * filter a single attribute.\n * @typedef {string[]} SearchParameters.FacetList\n */\n\n/**\n * Structure to store numeric filters with the operator as the key. The supported operators\n * are `=`, `>`, `<`, `>=`, `<=` and `!=`.\n * @typedef {Object.>} SearchParameters.OperatorList\n */\n\n/**\n * SearchParameters is the data structure that contains all the information\n * usable for making a search to Algolia API. It doesn't do the search itself,\n * nor does it contains logic about the parameters.\n * It is an immutable object, therefore it has been created in a way that each\n * changes does not change the object itself but returns a copy with the\n * modification.\n * This object should probably not be instantiated outside of the helper. It will\n * be provided when needed. This object is documented for reference as you'll\n * get it from events generated by the {@link AlgoliaSearchHelper}.\n * If need be, instantiate the Helper from the factory function {@link SearchParameters.make}\n * @constructor\n * @classdesc contains all the parameters of a search\n * @param {object|SearchParameters} newParameters existing parameters or partial object\n * for the properties of a new SearchParameters\n * @see SearchParameters.make\n * @example SearchParameters of the first query in\n * the instant search demo\n{\n \"query\": \"\",\n \"disjunctiveFacets\": [\n \"customerReviewCount\",\n \"category\",\n \"salePrice_range\",\n \"manufacturer\"\n ],\n \"maxValuesPerFacet\": 30,\n \"page\": 0,\n \"hitsPerPage\": 10,\n \"facets\": [\n \"type\",\n \"shipping\"\n ]\n}\n */\nfunction SearchParameters(newParameters) {\n var params = newParameters\n ? SearchParameters._parseNumbers(newParameters)\n : {};\n\n if (params.userToken !== undefined && !isValidUserToken(params.userToken)) {\n // eslint-disable-next-line no-console\n console.warn(\n '[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\\n - Format: [a-zA-Z0-9_-]{1,64}'\n );\n }\n /**\n * This attribute contains the list of all the conjunctive facets\n * used. This list will be added to requested facets in the\n * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n * @member {string[]}\n */\n 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 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 this.hierarchicalFacets = params.hierarchicalFacets || [];\n\n // Refinements\n /**\n * This attribute contains all the filters that need to be\n * applied on the conjunctive facets. Each facet must be properly\n * defined in the `facets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n this.facetsRefinements = params.facetsRefinements || {};\n /**\n * This attribute contains all the filters that need to be\n * excluded from the conjunctive facets. Each facet must be properly\n * defined in the `facets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters excluded for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n this.facetsExcludes = params.facetsExcludes || {};\n /**\n * This attribute contains all the filters that need to be\n * applied on the disjunctive facets. Each facet must be properly\n * defined in the `disjunctiveFacets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {};\n /**\n * This attribute contains all the filters that need to be\n * applied on the numeric attributes.\n *\n * The key is the name of the attribute, and the value is the\n * filters to apply to this attribute.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `numericFilters` attribute.\n * @member {Object.}\n */\n 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 this.tagRefinements = params.tagRefinements || [];\n /**\n * This attribute contains all the filters that need to be\n * applied on the hierarchical facets. Each facet must be properly\n * defined in the `hierarchicalFacets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name. The FacetList values\n * are structured as a string that contain the values for each level\n * separated by the configured separator.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n this.hierarchicalFacetsRefinements =\n params.hierarchicalFacetsRefinements || {};\n\n // eslint-disable-next-line consistent-this\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/**\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 */\nSearchParameters.PARAMETERS = Object.keys(new SearchParameters());\n\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 */\nSearchParameters._parseNumbers = function (partialState) {\n // Do not parse numbers again in SearchParameters, they ought to be parsed already\n if (partialState instanceof SearchParameters) return partialState;\n\n var numbers = {};\n\n var numberKeys = [\n 'aroundPrecision',\n 'aroundRadius',\n 'getRankingInfo',\n 'minWordSizefor2Typos',\n 'minWordSizefor1Typo',\n 'page',\n 'maxValuesPerFacet',\n 'distinct',\n 'minimumAroundRadius',\n 'hitsPerPage',\n 'minProximity',\n ];\n\n numberKeys.forEach(function (k) {\n var value = partialState[k];\n if (typeof value === 'string') {\n var parsedValue = parseFloat(value);\n // global isNaN is ok to use here, value is only number or NaN\n numbers[k] = isNaN(parsedValue) ? value : parsedValue;\n }\n });\n\n // there's two formats of insideBoundingBox, we need to parse\n // the one which is an array of float geo rectangles\n if (Array.isArray(partialState.insideBoundingBox)) {\n numbers.insideBoundingBox = partialState.insideBoundingBox.map(function (\n geoRect\n ) {\n if (Array.isArray(geoRect)) {\n return geoRect.map(function (value) {\n return parseFloat(value);\n });\n }\n return geoRect;\n });\n }\n\n if (partialState.numericRefinements) {\n var numericRefinements = {};\n Object.keys(partialState.numericRefinements).forEach(function (attribute) {\n var operators = partialState.numericRefinements[attribute] || {};\n numericRefinements[attribute] = {};\n Object.keys(operators).forEach(function (operator) {\n var values = operators[operator];\n var parsedValues = values.map(function (v) {\n if (Array.isArray(v)) {\n return v.map(function (vPrime) {\n if (typeof vPrime === 'string') {\n return parseFloat(vPrime);\n }\n return vPrime;\n });\n } else if (typeof v === 'string') {\n return parseFloat(v);\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/**\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 */\nSearchParameters.make = function makeSearchParameters(newParameters) {\n var instance = new SearchParameters(newParameters);\n\n var hierarchicalFacets = newParameters.hierarchicalFacets || [];\n hierarchicalFacets.forEach(function (facet) {\n if (facet.rootPath) {\n var currentRefinement = instance.getHierarchicalRefinement(facet.name);\n\n if (\n currentRefinement.length > 0 &&\n currentRefinement[0].indexOf(facet.rootPath) !== 0\n ) {\n instance = instance.clearRefinements(facet.name);\n }\n\n // get it again in case it has been cleared\n currentRefinement = instance.getHierarchicalRefinement(facet.name);\n if (currentRefinement.length === 0) {\n instance = instance.toggleHierarchicalFacetRefinement(\n facet.name,\n facet.rootPath\n );\n }\n }\n });\n\n return instance;\n};\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 */\nSearchParameters.validate = function (currentState, parameters) {\n var params = parameters || {};\n\n if (\n currentState.tagFilters &&\n params.tagRefinements &&\n params.tagRefinements.length > 0\n ) {\n return new Error(\n '[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' +\n 'an error, if it is really what you want, you should first clear the tags with clearTags method.'\n );\n }\n\n if (currentState.tagRefinements.length > 0 && params.tagFilters) {\n return new Error(\n '[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' +\n 'an error, if it is not, you should first clear the tags with clearTags method.'\n );\n }\n\n if (\n currentState.numericFilters &&\n params.numericRefinements &&\n objectHasKeys(params.numericRefinements)\n ) {\n return new Error(\n \"[Numeric filters] Can't switch from the advanced to the managed API. It\" +\n ' is probably an error, if this is really what you want, you have to first' +\n ' clear the numeric filters.'\n );\n }\n\n if (objectHasKeys(currentState.numericRefinements) && params.numericFilters) {\n return new Error(\n \"[Numeric filters] Can't switch from the managed API to the advanced. It\" +\n ' is probably an error, if this is really what you want, you have to first' +\n ' clear the numeric filters.'\n );\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} new instance with filters cleared\n */\n clearRefinements: function clearRefinements(attribute) {\n var patch = {\n numericRefinements: this._clearNumericRefinements(attribute),\n facetsRefinements: RefinementList.clearRefinement(\n this.facetsRefinements,\n attribute,\n 'conjunctiveFacet'\n ),\n facetsExcludes: RefinementList.clearRefinement(\n this.facetsExcludes,\n attribute,\n 'exclude'\n ),\n disjunctiveFacetsRefinements: RefinementList.clearRefinement(\n this.disjunctiveFacetsRefinements,\n attribute,\n 'disjunctiveFacet'\n ),\n hierarchicalFacetsRefinements: RefinementList.clearRefinement(\n this.hierarchicalFacetsRefinements,\n attribute,\n 'hierarchicalFacet'\n ),\n };\n if (\n patch.numericRefinements === this.numericRefinements &&\n patch.facetsRefinements === this.facetsRefinements &&\n patch.facetsExcludes === this.facetsExcludes &&\n patch.disjunctiveFacetsRefinements ===\n this.disjunctiveFacetsRefinements &&\n patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements\n ) {\n return this;\n }\n return this.setQueryParameters(patch);\n },\n /**\n * Remove all the refined tags from the SearchParameters\n * @method\n * @return {SearchParameters} new instance with tags cleared\n */\n clearTags: function clearTags() {\n if (this.tagFilters === undefined && this.tagRefinements.length === 0)\n return this;\n\n return this.setQueryParameters({\n tagFilters: undefined,\n tagRefinements: [],\n });\n },\n /**\n * Set the index.\n * @method\n * @param {string} index the index name\n * @return {SearchParameters} new instance\n */\n setIndex: function setIndex(index) {\n if (index === this.index) return this;\n\n return this.setQueryParameters({\n index: index,\n });\n },\n /**\n * Query setter\n * @method\n * @param {string} newQuery value for the new query\n * @return {SearchParameters} new instance\n */\n setQuery: function setQuery(newQuery) {\n if (newQuery === this.query) return this;\n\n return this.setQueryParameters({\n query: newQuery,\n });\n },\n /**\n * Page setter\n * @method\n * @param {number} newPage new page number\n * @return {SearchParameters} new instance\n */\n setPage: function setPage(newPage) {\n if (newPage === this.page) return this;\n\n return this.setQueryParameters({\n page: newPage,\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} new instance\n */\n setFacets: function setFacets(facets) {\n return this.setQueryParameters({\n facets: facets,\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} new instance\n */\n setDisjunctiveFacets: function setDisjunctiveFacets(facets) {\n return this.setQueryParameters({\n disjunctiveFacets: facets,\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} new instance\n */\n setHitsPerPage: function setHitsPerPage(n) {\n if (this.hitsPerPage === n) return this;\n\n return this.setQueryParameters({\n hitsPerPage: 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} new instance\n */\n setTypoTolerance: function setTypoTolerance(typoTolerance) {\n if (this.typoTolerance === typoTolerance) return this;\n\n return this.setQueryParameters({\n typoTolerance: typoTolerance,\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} new instance\n * @example\n * // for price = 50 or 40\n * state.addNumericRefinement('price', '=', [50, 40]);\n * @example\n * // for size = 38 and 40\n * state.addNumericRefinement('size', '=', 38);\n * state.addNumericRefinement('size', '=', 40);\n */\n addNumericRefinement: function (attribute, operator, value) {\n var val = valToNumber(value);\n\n if (this.isNumericRefined(attribute, operator, val)) return this;\n\n var mod = merge({}, this.numericRefinements);\n\n mod[attribute] = merge({}, mod[attribute]);\n\n if (mod[attribute][operator]) {\n // Array copy\n mod[attribute][operator] = mod[attribute][operator].slice();\n // Add the element. Concat can't be used here because value can be an array.\n mod[attribute][operator].push(val);\n } else {\n mod[attribute][operator] = [val];\n }\n\n return this.setQueryParameters({\n numericRefinements: mod,\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 (facetName) {\n if (!this.isConjunctiveFacet(facetName)) {\n return [];\n }\n return this.facetsRefinements[facetName] || [];\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 (facetName) {\n if (!this.isDisjunctiveFacet(facetName)) {\n return [];\n }\n return this.disjunctiveFacetsRefinements[facetName] || [];\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 (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 * 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 (facetName) {\n if (!this.isConjunctiveFacet(facetName)) {\n return [];\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} new instance\n */\n removeNumericRefinement: function (attribute, operator, number) {\n var paramValue = number;\n if (paramValue !== undefined) {\n if (!this.isNumericRefined(attribute, operator, paramValue)) {\n return this;\n }\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function (\n value,\n key\n ) {\n return (\n key === attribute &&\n value.op === operator &&\n isEqualNumericRefinement(value.val, valToNumber(paramValue))\n );\n }),\n });\n } else if (operator !== undefined) {\n if (!this.isNumericRefined(attribute, operator)) return this;\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function (\n value,\n key\n ) {\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 * 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 (facetName) {\n return this.numericRefinements[facetName] || {};\n },\n /**\n * Return the current refinement for the (attribute, operator)\n * @param {string} attribute attribute in the record\n * @param {string} operator operator applied on the refined values\n * @return {Array.} refined values\n */\n getNumericRefinement: function (attribute, operator) {\n return (\n this.numericRefinements[attribute] &&\n 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.} new numeric refinements\n */\n _clearNumericRefinements: function _clearNumericRefinements(attribute) {\n if (attribute === undefined) {\n if (!objectHasKeys(this.numericRefinements)) {\n return this.numericRefinements;\n }\n return {};\n } else if (typeof attribute === 'string') {\n return omit(this.numericRefinements, [attribute]);\n } else if (typeof attribute === 'function') {\n var hasChanged = false;\n var numericRefinements = this.numericRefinements;\n var newNumericRefinements = Object.keys(numericRefinements).reduce(\n function (memo, key) {\n var operators = numericRefinements[key];\n var operatorList = {};\n\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, op: operator },\n key,\n 'numeric'\n );\n if (!predicateResult) outValues.push(value);\n });\n if (outValues.length !== values.length) {\n hasChanged = true;\n }\n operatorList[operator] = outValues;\n });\n\n memo[key] = operatorList;\n\n return memo;\n },\n {}\n );\n\n if (hasChanged) return newNumericRefinements;\n return this.numericRefinements;\n }\n\n // We return nothing if the attribute is not undefined, a string or a function,\n // as it is not a valid value for a refinement\n return undefined;\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} new instance\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 * 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} new instance\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 * 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} new instance\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(\n 'Cannot declare two hierarchical facets with the same name: `' +\n hierarchicalFacet.name +\n '`'\n );\n }\n\n return this.setQueryParameters({\n hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet]),\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} new instance\n */\n addFacetRefinement: function addFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the facets attribute of the helper configuration'\n );\n }\n if (RefinementList.isRefined(this.facetsRefinements, facet, value))\n return this;\n\n return this.setQueryParameters({\n facetsRefinements: RefinementList.addRefinement(\n this.facetsRefinements,\n facet,\n 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} new instance\n */\n addExcludeRefinement: function addExcludeRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the facets attribute of the helper configuration'\n );\n }\n if (RefinementList.isRefined(this.facetsExcludes, facet, value))\n return this;\n\n return this.setQueryParameters({\n facetsExcludes: RefinementList.addRefinement(\n this.facetsExcludes,\n facet,\n 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} new instance\n */\n addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(\n facet,\n value\n ) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the disjunctiveFacets attribute of the helper configuration'\n );\n }\n\n if (\n RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)\n )\n return this;\n\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.addRefinement(\n this.disjunctiveFacetsRefinements,\n facet,\n 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} new instance\n */\n addTagRefinement: function addTagRefinement(tag) {\n if (this.isTagRefined(tag)) return this;\n\n var modification = {\n tagRefinements: this.tagRefinements.concat(tag),\n };\n\n return this.setQueryParameters(modification);\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} new instance\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 * 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} new instance\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 * 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} new instance\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 * 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} new instance\n */\n removeFacetRefinement: function removeFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the facets attribute of the helper configuration'\n );\n }\n if (!RefinementList.isRefined(this.facetsRefinements, facet, value))\n return this;\n\n return this.setQueryParameters({\n facetsRefinements: RefinementList.removeRefinement(\n this.facetsRefinements,\n facet,\n 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} new instance\n */\n removeExcludeRefinement: function removeExcludeRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the facets attribute of the helper configuration'\n );\n }\n if (!RefinementList.isRefined(this.facetsExcludes, facet, value))\n return this;\n\n return this.setQueryParameters({\n facetsExcludes: RefinementList.removeRefinement(\n this.facetsExcludes,\n facet,\n 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} new instance\n */\n removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(\n facet,\n value\n ) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the disjunctiveFacets attribute of the helper configuration'\n );\n }\n if (\n !RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)\n )\n return this;\n\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.removeRefinement(\n this.disjunctiveFacetsRefinements,\n facet,\n 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} new instance\n */\n removeTagRefinement: function removeTagRefinement(tag) {\n if (!this.isTagRefined(tag)) return this;\n\n var modification = {\n tagRefinements: this.tagRefinements.filter(function (t) {\n return t !== tag;\n }),\n };\n\n return this.setQueryParameters(modification);\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} new instance\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 * 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} new instance\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(\n 'Cannot refine the undeclared facet ' +\n facet +\n '; 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} new instance\n */\n toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(\n facet,\n value\n ) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the facets attribute of the helper configuration'\n );\n }\n\n return this.setQueryParameters({\n facetsRefinements: RefinementList.toggleRefinement(\n this.facetsRefinements,\n facet,\n 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} new instance\n */\n toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(\n facet,\n value\n ) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the facets attribute of the helper configuration'\n );\n }\n\n return this.setQueryParameters({\n facetsExcludes: RefinementList.toggleRefinement(\n this.facetsExcludes,\n facet,\n 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} new instance\n */\n toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(\n facet,\n value\n ) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the disjunctiveFacets attribute of the helper configuration'\n );\n }\n\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.toggleRefinement(\n this.disjunctiveFacetsRefinements,\n facet,\n 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} new instance\n */\n toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(\n facet,\n value\n ) {\n if (!this.isHierarchicalFacet(facet)) {\n throw new Error(\n facet +\n ' is not defined in the hierarchicalFacets attribute of the helper configuration'\n );\n }\n\n var separator = this._getHierarchicalFacetSeparator(\n this.getHierarchicalFacetByName(facet)\n );\n\n var mod = {};\n\n var upOneOrMultipleLevel =\n this.hierarchicalFacetsRefinements[facet] !== undefined &&\n this.hierarchicalFacetsRefinements[facet].length > 0 &&\n // remove current refinement:\n // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer`\n (this.hierarchicalFacetsRefinements[facet][0] === value ||\n // 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(\n value + separator\n ) === 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(\n {},\n mod,\n this.hierarchicalFacetsRefinements\n ),\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 (facet, path) {\n if (this.isHierarchicalFacetRefined(facet)) {\n throw new Error(facet + ' is already refined.');\n }\n if (!this.isHierarchicalFacet(facet)) {\n throw new Error(\n facet +\n ' 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(\n {},\n mod,\n this.hierarchicalFacetsRefinements\n ),\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 (facet) {\n if (!this.isHierarchicalFacetRefined(facet)) {\n return this;\n }\n var mod = {};\n mod[facet] = [];\n return this.setQueryParameters({\n hierarchicalFacetsRefinements: defaultsPure(\n {},\n mod,\n 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} new instance\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 * 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} true if facet is a disjunctive facet\n */\n isDisjunctiveFacet: function (facet) {\n return this.disjunctiveFacets.indexOf(facet) > -1;\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} true if facetName is a hierarchical facet\n */\n isHierarchicalFacet: function (facetName) {\n return this.getHierarchicalFacetByName(facetName) !== undefined;\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} true if facet is a conjunctive facet\n */\n isConjunctiveFacet: function (facet) {\n return this.facets.indexOf(facet) > -1;\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 return RefinementList.isRefined(this.facetsRefinements, facet, value);\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 return RefinementList.isRefined(this.facetsExcludes, facet, value);\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} true if the facet is refined\n */\n isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n return false;\n }\n return RefinementList.isRefined(\n this.disjunctiveFacetsRefinements,\n facet,\n 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} true if the facet is refined\n */\n isHierarchicalFacetRefined: function isHierarchicalFacetRefined(\n facet,\n value\n ) {\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 * 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 Boolean(this.numericRefinements[attribute]);\n }\n\n var isOperatorDefined =\n this.numericRefinements[attribute] &&\n this.numericRefinements[attribute][operator] !== undefined;\n\n if (value === undefined || !isOperatorDefined) {\n return isOperatorDefined;\n }\n\n var parsedValue = valToNumber(value);\n var isAttributeValueDefined =\n findArray(this.numericRefinements[attribute][operator], parsedValue) !==\n undefined;\n\n return isOperatorDefined && isAttributeValueDefined;\n },\n /**\n * Returns true if the tag refined, false otherwise\n * @method\n * @param {string} tag the tag to check\n * @return {boolean} true if tag is refined\n */\n isTagRefined: function isTagRefined(tag) {\n return this.tagRefinements.indexOf(tag) !== -1;\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[]} returns the list of refinements\n */\n getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() {\n // eslint-disable-next-line consistent-this\n var self = this;\n\n // attributes used for numeric filter can also be disjunctive\n var disjunctiveNumericRefinedFacets = intersection(\n Object.keys(this.numericRefinements).filter(function (facet) {\n return Object.keys(self.numericRefinements[facet]).length > 0;\n }),\n this.disjunctiveFacets\n );\n\n return Object.keys(this.disjunctiveFacetsRefinements)\n .filter(function (facet) {\n return self.disjunctiveFacetsRefinements[facet].length > 0;\n })\n .concat(disjunctiveNumericRefinedFacets)\n .concat(this.getRefinedHierarchicalFacets())\n .sort();\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[]} returns the list of refinements\n */\n getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() {\n // eslint-disable-next-line consistent-this\n var self = this;\n return intersection(\n // 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 }),\n Object.keys(this.hierarchicalFacetsRefinements).filter(function (facet) {\n return self.hierarchicalFacetsRefinements[facet].length > 0;\n })\n ).sort();\n },\n /**\n * Returned the list of all disjunctive facets not refined\n * @method\n * @return {string[]} returns the list of facets that are not refined\n */\n getUnrefinedDisjunctiveFacets: function () {\n var refinedFacets = this.getRefinedDisjunctiveFacets();\n\n return this.disjunctiveFacets.filter(function (f) {\n return refinedFacets.indexOf(f) === -1;\n });\n },\n\n managedParameters: [\n 'index',\n\n 'facets',\n 'disjunctiveFacets',\n 'facetsRefinements',\n 'hierarchicalFacets',\n 'facetsExcludes',\n\n 'disjunctiveFacetsRefinements',\n 'numericRefinements',\n 'tagRefinements',\n 'hierarchicalFacetsRefinements',\n ],\n\n getQueryParams: function getQueryParams() {\n var managedParameters = this.managedParameters;\n\n var queryParams = {};\n\n // eslint-disable-next-line consistent-this\n var self = this;\n Object.keys(this).forEach(function (paramName) {\n var paramValue = self[paramName];\n if (\n managedParameters.indexOf(paramName) === -1 &&\n paramValue !== undefined\n ) {\n queryParams[paramName] = paramValue;\n }\n });\n\n return queryParams;\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\n var modification = {};\n\n modification[parameter] = value;\n\n return this.setQueryParameters(modification);\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\n var error = SearchParameters.validate(this, params);\n\n if (error) {\n throw error;\n }\n\n // eslint-disable-next-line consistent-this\n var self = this;\n var nextWithNumbers = SearchParameters._parseNumbers(params);\n var previousPlainObject = Object.keys(this).reduce(function (acc, key) {\n acc[key] = self[key];\n return acc;\n }, {});\n\n var nextPlainObject = Object.keys(nextWithNumbers).reduce(function (\n previous,\n key\n ) {\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 },\n previousPlainObject);\n\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 () {\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 the hierarchicalFacet object\n * @return {string} returns the hierarchicalFacet.separator or `>` as default\n */\n _getHierarchicalFacetSortBy: function (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 the hierarchicalFacet object\n * @return {string} returns the hierarchicalFacet.separator or `>` as default\n */\n _getHierarchicalFacetSeparator: function (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 the hierarchicalFacet object\n * @return {string} returns the hierarchicalFacet.rootPath or null as default\n */\n _getHierarchicalRootPath: function (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 the hierarchicalFacet object\n * @return {string} returns the hierarchicalFacet.showParentLevel or true as default\n */\n _getHierarchicalShowParentLevel: function (hierarchicalFacet) {\n if (typeof hierarchicalFacet.showParentLevel === 'boolean') {\n return hierarchicalFacet.showParentLevel;\n }\n return true;\n },\n\n /**\n * Helper function to get the hierarchicalFacet by it's name\n * @param {string} hierarchicalFacetName the hierarchicalFacet name\n * @return {object} a hierarchicalFacet\n */\n getHierarchicalFacetByName: function (hierarchicalFacetName) {\n return find(this.hierarchicalFacets, function (f) {\n return f.name === hierarchicalFacetName;\n });\n },\n\n /**\n * Get the current breadcrumb for a hierarchical facet, as an array\n * @param {string} facetName Hierarchical facet name\n * @return {array.} the path as an array of string\n */\n getHierarchicalFacetBreadcrumb: function (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(\n this.getHierarchicalFacetByName(facetName)\n );\n var path = refinement.split(separator);\n return path.map(function (part) {\n return part.trim();\n });\n },\n\n toString: function () {\n return JSON.stringify(this, null, 2);\n },\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 */\nmodule.exports = SearchParameters;\n","'use strict';\n\nmodule.exports = function compact(array) {\n if (!Array.isArray(array)) {\n return [];\n }\n\n return array.filter(Boolean);\n};\n","'use strict';\n\n// @MAJOR can be replaced by native Array#findIndex when we change support\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 return -1;\n};\n","'use strict';\n\nvar find = require('./find');\n\n/**\n * Transform sort format from user friendly notation to lodash format\n * @param {string[]} sortBy array of predicate of the form \"attribute:order\"\n * @param {string[]} [defaults] array of predicate of the form \"attribute:order\"\n * @return {array.} array containing 2 elements : attributes, orders\n */\nmodule.exports = function formatSort(sortBy, defaults) {\n var defaultInstructions = (defaults || []).map(function (sort) {\n return sort.split(':');\n });\n\n return sortBy.reduce(\n function preparePredicate(out, sort) {\n var sortInstruction = sort.split(':');\n\n var matchingDefault = find(\n defaultInstructions,\n function (defaultInstruction) {\n return defaultInstruction[0] === sortInstruction[0];\n }\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 [[], []]\n );\n};\n","'use strict';\n\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined;\n var valIsNull = value === null;\n\n var othIsDefined = other !== undefined;\n var othIsNull = other === null;\n\n if (\n (!othIsNull && value > other) ||\n (valIsNull && othIsDefined) ||\n !valIsDefined\n ) {\n return 1;\n }\n if (\n (!valIsNull && value < other) ||\n (othIsNull && valIsDefined) ||\n !othIsDefined\n ) {\n return -1;\n }\n }\n return 0;\n}\n\n/**\n * @param {Array} collection object with keys in attributes\n * @param {Array} iteratees attributes\n * @param {Array} orders asc | desc\n * @return {Array} sorted collection\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\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 if (res) {\n if (index >= orders.length) {\n return res;\n }\n if (orders[index] === 'desc') {\n return -res;\n }\n return res;\n }\n }\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 return object.index - other.index;\n });\n\n return result.map(function (res) {\n return res.value;\n });\n}\n\nmodule.exports = orderBy;\n","'use strict';\n\nmodule.exports = generateTrees;\n\nvar fv = require('../functions/escapeFacetValue');\nvar find = require('../functions/find');\nvar prepareHierarchicalFacetSortBy = require('../functions/formatSort');\nvar orderBy = require('../functions/orderBy');\nvar escapeFacetValue = fv.escapeFacetValue;\nvar unescapeFacetValue = fv.unescapeFacetValue;\n\nfunction generateTrees(state) {\n return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) {\n var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex];\n var hierarchicalFacetRefinement =\n (state.hierarchicalFacetsRefinements[hierarchicalFacet.name] &&\n state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0]) ||\n '';\n var hierarchicalSeparator =\n state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var hierarchicalRootPath =\n state._getHierarchicalRootPath(hierarchicalFacet);\n var hierarchicalShowParentLevel =\n state._getHierarchicalShowParentLevel(hierarchicalFacet);\n var sortBy = prepareHierarchicalFacetSortBy(\n state._getHierarchicalFacetSortBy(hierarchicalFacet)\n );\n\n var rootExhaustive = hierarchicalFacetResult.every(function (facetResult) {\n return facetResult.exhaustive;\n });\n\n var generateTreeFn = generateHierarchicalTree(\n sortBy,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel,\n hierarchicalFacetRefinement\n );\n\n var results = hierarchicalFacetResult;\n\n if (hierarchicalRootPath) {\n results = hierarchicalFacetResult.slice(\n hierarchicalRootPath.split(hierarchicalSeparator).length\n );\n }\n\n return results.reduce(generateTreeFn, {\n name: state.hierarchicalFacets[hierarchicalFacetIndex].name,\n count: null, // root level, no count\n isRefined: true, // root level, always refined\n path: null, // root level, no path\n escapedValue: null,\n exhaustive: rootExhaustive,\n data: null,\n });\n };\n}\n\nfunction generateHierarchicalTree(\n sortBy,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel,\n currentRefinement\n) {\n return function generateTree(\n hierarchicalTree,\n hierarchicalFacetResult,\n currentHierarchicalLevel\n ) {\n var parent = hierarchicalTree;\n\n if (currentHierarchicalLevel > 0) {\n var level = 0;\n\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 }\n\n // we found a refined parent, let's add current level data under it\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\n var picked = Object.keys(hierarchicalFacetResult.data)\n .map(function (facetValue) {\n return [facetValue, hierarchicalFacetResult.data[facetValue]];\n })\n .filter(function (tuple) {\n var facetValue = tuple[0];\n return onlyMatchingTree(\n facetValue,\n parent.path || hierarchicalRootPath,\n currentRefinement,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel\n );\n });\n\n parent.data = orderBy(\n picked.map(function (tuple) {\n var facetValue = tuple[0];\n var facetCount = tuple[1];\n\n return format(\n facetCount,\n facetValue,\n hierarchicalSeparator,\n unescapeFacetValue(currentRefinement),\n hierarchicalFacetResult.exhaustive\n );\n }),\n sortBy[0],\n sortBy[1]\n );\n }\n\n return hierarchicalTree;\n };\n}\n\n// eslint-disable-next-line max-params\nfunction onlyMatchingTree(\n facetValue,\n parentPath,\n currentRefinement,\n hierarchicalSeparator,\n hierarchicalRootPath,\n hierarchicalShowParentLevel\n) {\n // we want the facetValue is a child of hierarchicalRootPath\n if (\n hierarchicalRootPath &&\n (facetValue.indexOf(hierarchicalRootPath) !== 0 ||\n hierarchicalRootPath === facetValue)\n ) {\n return false;\n }\n\n // we always want root levels (only when there is no prefix path)\n return (\n (!hierarchicalRootPath &&\n facetValue.indexOf(hierarchicalSeparator) === -1) ||\n // if there is a rootPath, being root level mean 1 level under rootPath\n (hierarchicalRootPath &&\n facetValue.split(hierarchicalSeparator).length -\n hierarchicalRootPath.split(hierarchicalSeparator).length ===\n 1) ||\n // if current refinement is a root level and current facetValue is a root level,\n // keep the facetValue\n (facetValue.indexOf(hierarchicalSeparator) === -1 &&\n currentRefinement.indexOf(hierarchicalSeparator) === -1) ||\n // currentRefinement is a child of the facet value\n currentRefinement.indexOf(facetValue) === 0 ||\n // facetValue is a child of the current parent, add it\n (facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 &&\n (hierarchicalShowParentLevel ||\n facetValue.indexOf(currentRefinement) === 0))\n );\n}\n\nfunction format(\n facetCount,\n facetValue,\n hierarchicalSeparator,\n currentRefinement,\n exhaustive\n) {\n var parts = facetValue.split(hierarchicalSeparator);\n return {\n name: parts[parts.length - 1].trim(),\n path: facetValue,\n escapedValue: escapeFacetValue(facetValue),\n count: facetCount,\n isRefined:\n currentRefinement === facetValue ||\n currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0,\n exhaustive: exhaustive,\n data: null,\n };\n}\n","'use strict';\n\nvar compact = require('../functions/compact');\nvar defaultsPure = require('../functions/defaultsPure');\nvar fv = require('../functions/escapeFacetValue');\nvar find = require('../functions/find');\nvar findIndex = require('../functions/findIndex');\nvar formatSort = require('../functions/formatSort');\nvar merge = require('../functions/merge');\nvar orderBy = require('../functions/orderBy');\nvar escapeFacetValue = fv.escapeFacetValue;\nvar unescapeFacetValue = fv.unescapeFacetValue;\n\nvar generateHierarchicalTree = require('./generate-hierarchical-tree');\n\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 * Turn an array of attributes in an object of attributes with their position in the array as value\n * @param {string[]} attributes the list of attributes in the record\n * @return {object} the list of attributes indexed by attribute name\n */\nfunction getIndices(attributes) {\n var indices = {};\n\n attributes.forEach(function (val, idx) {\n indices[val] = idx;\n });\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/**\n * @typedef {Object} HierarchicalFacet\n * @property {string} name\n * @property {string[]} attributes\n */\n\n/**\n * @param {HierarchicalFacet[]} hierarchicalFacets All hierarchical facets\n * @param {string} hierarchicalAttributeName The name of the hierarchical attribute\n * @return {HierarchicalFacet} The hierarchical facet matching the attribute name\n */\nfunction findMatchingHierarchicalFacetFromAttributeName(\n hierarchicalFacets,\n hierarchicalAttributeName\n) {\n return find(\n hierarchicalFacets,\n function facetKeyMatchesAttribute(hierarchicalFacet) {\n var facetNames = hierarchicalFacet.attributes || [];\n return facetNames.indexOf(hierarchicalAttributeName) > -1;\n }\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Constructor for SearchResults\n * @class\n * @classdesc SearchResults contains the results of a query to Algolia using the\n * {@link AlgoliaSearchHelper}.\n * @param {SearchParameters} state state that led to the response\n * @param {array.} results the results from algolia client\n * @example SearchResults of the first query in\n * the instant search demo\n{\n \"hitsPerPage\": 10,\n \"processingTimeMS\": 2,\n \"facets\": [\n {\n \"name\": \"type\",\n \"data\": {\n \"HardGood\": 6627,\n \"BlackTie\": 550,\n \"Music\": 665,\n \"Software\": 131,\n \"Game\": 456,\n \"Movie\": 1571\n },\n \"exhaustive\": false\n },\n {\n \"exhaustive\": false,\n \"data\": {\n \"Free shipping\": 5507\n },\n \"name\": \"shipping\"\n }\n ],\n \"hits\": [\n {\n \"thumbnailImage\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif\",\n \"_highlightResult\": {\n \"shortDescription\": {\n \"matchLevel\": \"none\",\n \"value\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n \"matchedWords\": []\n },\n \"category\": {\n \"matchLevel\": \"none\",\n \"value\": \"Computer Security Software\",\n \"matchedWords\": []\n },\n \"manufacturer\": {\n \"matchedWords\": [],\n \"value\": \"Webroot\",\n \"matchLevel\": \"none\"\n },\n \"name\": {\n \"value\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n \"matchedWords\": [],\n \"matchLevel\": \"none\"\n }\n },\n \"image\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg\",\n \"shipping\": \"Free shipping\",\n \"bestSellingRank\": 4,\n \"shortDescription\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n \"url\": \"http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ\",\n \"name\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n \"category\": \"Computer Security Software\",\n \"salePrice_range\": \"1 - 50\",\n \"objectID\": \"1688832\",\n \"type\": \"Software\",\n \"customerReviewCount\": 5980,\n \"salePrice\": 49.99,\n \"manufacturer\": \"Webroot\"\n },\n ....\n ],\n \"nbHits\": 10000,\n \"disjunctiveFacets\": [\n {\n \"exhaustive\": false,\n \"data\": {\n \"5\": 183,\n \"12\": 112,\n \"7\": 149,\n ...\n },\n \"name\": \"customerReviewCount\",\n \"stats\": {\n \"max\": 7461,\n \"avg\": 157.939,\n \"min\": 1\n }\n },\n {\n \"data\": {\n \"Printer Ink\": 142,\n \"Wireless Speakers\": 60,\n \"Point & Shoot Cameras\": 48,\n ...\n },\n \"name\": \"category\",\n \"exhaustive\": false\n },\n {\n \"exhaustive\": false,\n \"data\": {\n \"> 5000\": 2,\n \"1 - 50\": 6524,\n \"501 - 2000\": 566,\n \"201 - 500\": 1501,\n \"101 - 200\": 1360,\n \"2001 - 5000\": 47\n },\n \"name\": \"salePrice_range\"\n },\n {\n \"data\": {\n \"Dynex™\": 202,\n \"Insignia™\": 230,\n \"PNY\": 72,\n ...\n },\n \"name\": \"manufacturer\",\n \"exhaustive\": false\n }\n ],\n \"query\": \"\",\n \"nbPages\": 100,\n \"page\": 0,\n \"index\": \"bestbuy\"\n}\n **/\nfunction SearchResults(state, results, options) {\n var mainSubResponse = results[0];\n\n this._rawResults = results;\n\n // eslint-disable-next-line consistent-this\n var self = this;\n\n // https://www.algolia.com/doc/api-reference/api-methods/search/#response\n Object.keys(mainSubResponse).forEach(function (key) {\n self[key] = mainSubResponse[key];\n });\n\n // Make every key of the result options reachable from the instance\n Object.keys(options || {}).forEach(function (key) {\n self[key] = options[key];\n });\n\n /**\n * query used to generate the results\n * @name query\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n /**\n * The query as parsed by the engine given all the rules.\n * @name parsedQuery\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n /**\n * all the records that match the search parameters. Each record is\n * augmented with a new attribute `_highlightResult`\n * which is an object keyed by attribute and with the following properties:\n * - `value` : the value of the facet highlighted (html)\n * - `matchLevel`: `full`, `partial` or `none`, depending on how the query terms match\n * @name hits\n * @member {object[]}\n * @memberof SearchResults\n * @instance\n */\n /**\n * index where the results come from\n * @name index\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n /**\n * number of hits per page requested\n * @name hitsPerPage\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n /**\n * total number of hits of this query on the index\n * @name nbHits\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n /**\n * total number of pages with respect to the number of hits per page and the total number of hits\n * @name nbPages\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n /**\n * current page\n * @name page\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n /**\n * The position if the position was guessed by IP.\n * @name aroundLatLng\n * @member {string}\n * @memberof SearchResults\n * @instance\n * @example \"48.8637,2.3615\",\n */\n /**\n * The radius computed by Algolia.\n * @name automaticRadius\n * @member {string}\n * @memberof SearchResults\n * @instance\n * @example \"126792922\",\n */\n /**\n * String identifying the server used to serve this request.\n *\n * getRankingInfo needs to be set to `true` for this to be returned\n *\n * @name serverUsed\n * @member {string}\n * @memberof SearchResults\n * @instance\n * @example \"c7-use-2.algolia.net\",\n */\n /**\n * Boolean that indicates if the computation of the counts did time out.\n * @deprecated\n * @name timeoutCounts\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n /**\n * Boolean that indicates if the computation of the hits did time out.\n * @deprecated\n * @name timeoutHits\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n /**\n * True if the counts of the facets is exhaustive\n * @name exhaustiveFacetsCount\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n /**\n * True if the number of hits is exhaustive\n * @name exhaustiveNbHits\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n /**\n * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/).\n * @name userData\n * @member {object[]}\n * @memberof SearchResults\n * @instance\n */\n /**\n * queryID is the unique identifier of the query used to generate the current search results.\n * This value is only available if the `clickAnalytics` search parameter is set to `true`.\n * @name queryID\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * sum of the processing time of all the queries\n * @name processingTimeMS\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n this.processingTimeMS = results.reduce(function (sum, result) {\n return result.processingTimeMS === undefined\n ? sum\n : sum + result.processingTimeMS;\n }, 0);\n\n /**\n * disjunctive facets results\n * @member {SearchResults.Facet[]}\n */\n this.disjunctiveFacets = [];\n /**\n * disjunctive facets results\n * @member {SearchResults.HierarchicalFacet[]}\n */\n this.hierarchicalFacets = state.hierarchicalFacets.map(\n function initFutureTree() {\n return [];\n }\n );\n /**\n * other facets results\n * @member {SearchResults.Facet[]}\n */\n this.facets = [];\n\n var disjunctiveFacets = state.getRefinedDisjunctiveFacets();\n\n var facetsIndices = getIndices(state.facets);\n var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets);\n var nextDisjunctiveResult = 1;\n\n // 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\n Object.keys(mainFacets).forEach(function (facetKey) {\n var facetValueObject = mainFacets[facetKey];\n\n var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName(\n state.hierarchicalFacets,\n facetKey\n );\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(\n self.disjunctiveFacets[position],\n mainSubResponse.facets_stats,\n 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(\n self.facets[position],\n mainSubResponse.facets_stats,\n facetKey\n );\n }\n }\n });\n\n // Make sure we do not keep holes within the hierarchical facets\n this.hierarchicalFacets = compact(this.hierarchicalFacets);\n\n // aggregate the refined disjunctive facets\n disjunctiveFacets.forEach(function (disjunctiveFacet) {\n var result = results[nextDisjunctiveResult];\n var facets = result && result.facets ? result.facets : {};\n var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet);\n\n // There should be only item in facets.\n Object.keys(facets).forEach(function (dfacet) {\n var facetResults = facets[dfacet];\n\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(\n self.hierarchicalFacets[position],\n function (f) {\n return f.attribute === dfacet;\n }\n );\n\n // previous refinements and no results so not able to find it\n if (attributeIndex === -1) {\n return;\n }\n\n self.hierarchicalFacets[position][attributeIndex].data = merge(\n {},\n self.hierarchicalFacets[position][attributeIndex].data,\n facetResults\n );\n } else {\n position = disjunctiveFacetsIndices[dfacet];\n\n var dataFromMainRequest =\n (mainSubResponse.facets && mainSubResponse.facets[dfacet]) || {};\n\n self.disjunctiveFacets[position] = {\n name: dfacet,\n data: defaultsPure({}, facetResults, dataFromMainRequest),\n exhaustive: result.exhaustiveFacetsCount,\n };\n assignFacetStats(\n self.disjunctiveFacets[position],\n result.facets_stats,\n dfacet\n );\n\n if (state.disjunctiveFacetsRefinements[dfacet]) {\n state.disjunctiveFacetsRefinements[dfacet].forEach(function (\n refinementValue\n ) {\n // add the disjunctive refinements if it is no more retrieved\n if (\n !self.disjunctiveFacets[position].data[refinementValue] &&\n state.disjunctiveFacetsRefinements[dfacet].indexOf(\n unescapeFacetValue(refinementValue)\n ) > -1\n ) {\n self.disjunctiveFacets[position].data[refinementValue] = 0;\n }\n });\n }\n }\n });\n nextDisjunctiveResult++;\n });\n\n // if we have some parent level values for hierarchical facets, merge them\n state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet);\n // if we are already at a root refinement (or no refinement at all), there is no\n // root level values request\n if (\n currentRefinement.length === 0 ||\n currentRefinement[0].split(separator).length < 2\n ) {\n return;\n }\n\n results.slice(nextDisjunctiveResult).forEach(function (result) {\n var facets = result && result.facets ? result.facets : {};\n\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(\n self.hierarchicalFacets[position],\n function (f) {\n return f.attribute === dfacet;\n }\n );\n\n // previous refinements and no results so not able to find it\n if (attributeIndex === -1) {\n return;\n }\n\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 var defaultData = {};\n\n if (currentRefinement.length > 0) {\n var root = currentRefinement[0].split(separator)[0];\n defaultData[root] =\n self.hierarchicalFacets[position][attributeIndex].data[root];\n }\n\n self.hierarchicalFacets[position][attributeIndex].data = defaultsPure(\n defaultData,\n facetResults,\n self.hierarchicalFacets[position][attributeIndex].data\n );\n });\n\n nextDisjunctiveResult++;\n });\n });\n\n // add the excludes\n Object.keys(state.facetsExcludes).forEach(function (facetName) {\n var excludes = state.facetsExcludes[facetName];\n var position = facetsIndices[facetName];\n\n self.facets[position] = {\n name: facetName,\n data: mainFacets[facetName],\n exhaustive: mainSubResponse.exhaustiveFacetsCount,\n };\n excludes.forEach(function (facetValue) {\n self.facets[position] = self.facets[position] || { name: facetName };\n self.facets[position].data = self.facets[position].data || {};\n self.facets[position].data[facetValue] = 0;\n });\n });\n\n /**\n * @type {Array}\n */\n this.hierarchicalFacets = this.hierarchicalFacets.map(\n generateHierarchicalTree(state)\n );\n\n /**\n * @type {Array}\n */\n this.facets = compact(this.facets);\n /**\n * @type {Array}\n */\n this.disjunctiveFacets = compact(this.disjunctiveFacets);\n\n this._state = state;\n}\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 */\nSearchResults.prototype.getFacetByName = function (name) {\n function predicate(facet) {\n return facet.name === name;\n }\n\n return (\n find(this.facets, predicate) ||\n find(this.disjunctiveFacets, predicate) ||\n find(this.hierarchicalFacets, predicate)\n );\n};\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 */\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\n return Object.keys(facet.data).map(function (name) {\n var value = escapeFacetValue(name);\n return {\n name: name,\n escapedValue: value,\n count: facet.data[name],\n isRefined: results._state.isFacetRefined(attribute, value),\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\n return Object.keys(disjunctiveFacet.data).map(function (name) {\n var value = escapeFacetValue(name);\n return {\n name: name,\n escapedValue: value,\n count: disjunctiveFacet.data[name],\n isRefined: results._state.isDisjunctiveFacetRefined(attribute, value),\n };\n });\n } else if (results._state.isHierarchicalFacet(attribute)) {\n var hierarchicalFacetValues = find(results.hierarchicalFacets, predicate);\n if (!hierarchicalFacetValues) return hierarchicalFacetValues;\n\n var hierarchicalFacet =\n results._state.getHierarchicalFacetByName(attribute);\n var separator =\n results._state._getHierarchicalFacetSeparator(hierarchicalFacet);\n var currentRefinement = unescapeFacetValue(\n results._state.getHierarchicalRefinement(attribute)[0] || ''\n );\n\n if (currentRefinement.indexOf(hierarchicalFacet.rootPath) === 0) {\n currentRefinement = currentRefinement.replace(\n hierarchicalFacet.rootPath + separator,\n ''\n );\n }\n\n var currentRefinementSplit = currentRefinement.split(separator);\n currentRefinementSplit.unshift(attribute);\n\n setIsRefined(hierarchicalFacetValues, currentRefinementSplit, 0);\n\n return hierarchicalFacetValues;\n }\n\n return undefined;\n}\n\n/**\n * Set the isRefined of a hierarchical facet result based on the current state.\n * @param {SearchResults.HierarchicalFacet} item Hierarchical facet to fix\n * @param {string[]} currentRefinement array of parts of the current hierarchical refinement\n * @param {number} depth recursion depth in the currentRefinement\n * @return {undefined} function mutates the item\n */\nfunction setIsRefined(item, currentRefinement, depth) {\n item.isRefined = item.name === currentRefinement[depth];\n if (item.data) {\n item.data.forEach(function (child) {\n setIsRefined(child, currentRefinement, depth + 1);\n });\n }\n}\n\n/**\n * Sort nodes of a hierarchical or disjunctive facet results\n * @private\n * @param {function} sortFn sort function to apply\n * @param {HierarchicalFacet|Array} node node upon which we want to apply the sort\n * @param {string[]} names attribute names\n * @param {number} [level=0] current index in the names array\n * @return {HierarchicalFacet|Array} sorted node\n */\nfunction recSort(sortFn, node, names, level) {\n level = level || 0;\n\n if (Array.isArray(node)) {\n return sortFn(node, names[level]);\n }\n\n if (!node.data || node.data.length === 0) {\n return node;\n }\n\n var children = node.data.map(function (childNode) {\n return recSort(sortFn, childNode, names, level + 1);\n });\n var sortedChildren = sortFn(children, names[level]);\n var newNode = defaultsPure({ data: sortedChildren }, node);\n return newNode;\n}\n\nSearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc'];\n\nfunction vanillaSortFn(order, data) {\n return data.sort(order);\n}\n\n/**\n * @typedef FacetOrdering\n * @type {Object}\n * @property {string[]} [order]\n * @property {'count' | 'alpha' | 'hidden'} [sortRemainingBy]\n */\n\n/**\n * Sorts facet arrays via their facet ordering\n * @param {Array} facetValues the values\n * @param {FacetOrdering} facetOrdering the ordering\n * @returns {Array} the sorted facet values\n */\nfunction sortViaFacetOrdering(facetValues, facetOrdering) {\n var orderedFacets = [];\n var remainingFacets = [];\n\n var order = facetOrdering.order || [];\n /**\n * an object with the keys being the values in order, the values their index:\n * ['one', 'two'] -> { one: 0, two: 1 }\n */\n var reverseOrder = order.reduce(function (acc, name, i) {\n acc[name] = i;\n return acc;\n }, {});\n\n facetValues.forEach(function (item) {\n // hierarchical facets get sorted using their raw name\n var name = item.path || item.name;\n if (reverseOrder[name] !== undefined) {\n orderedFacets[reverseOrder[name]] = item;\n } else {\n remainingFacets.push(item);\n }\n });\n\n orderedFacets = orderedFacets.filter(function (facet) {\n return facet;\n });\n\n var sortRemainingBy = facetOrdering.sortRemainingBy;\n var ordering;\n if (sortRemainingBy === 'hidden') {\n return orderedFacets;\n } else if (sortRemainingBy === 'alpha') {\n ordering = [\n ['path', 'name'],\n ['asc', 'asc'],\n ];\n } else {\n ordering = [['count'], ['desc']];\n }\n\n return orderedFacets.concat(\n orderBy(remainingFacets, ordering[0], ordering[1])\n );\n}\n\n/**\n * @param {SearchResults} results the search results class\n * @param {string} attribute the attribute to retrieve ordering of\n * @returns {FacetOrdering | undefined} the facet ordering\n */\nfunction getFacetOrdering(results, attribute) {\n return (\n results.renderingContent &&\n results.renderingContent.facetOrdering &&\n results.renderingContent.facetOrdering.values &&\n results.renderingContent.facetOrdering.values[attribute]\n );\n}\n\n/**\n * Get a the list of values for a given facet attribute. Those values are sorted\n * refinement first, descending count (bigger value on top), and name ascending\n * (alphabetical order). The sort formula can overridden using either string based\n * predicates or a function.\n *\n * This method will return all the values returned by the Algolia engine plus all\n * the values already refined. This means that it can happen that the\n * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet)\n * might not be respected if you have facet values that are already refined.\n * @param {string} attribute attribute name\n * @param {object} opts configuration options.\n * @param {boolean} [opts.facetOrdering]\n * Force the use of facetOrdering from the result if a sortBy is present. If\n * sortBy isn't present, facetOrdering will be used automatically.\n * @param {Array. | function} opts.sortBy\n * When using strings, it consists of\n * the name of the [FacetValue](#SearchResults.FacetValue) or the\n * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the\n * order (`asc` or `desc`). For example to order the value by count, the\n * argument would be `['count:asc']`.\n *\n * If only the attribute name is specified, the ordering defaults to the one\n * specified in the default value for this attribute.\n *\n * When not specified, the order is\n * ascending. This parameter can also be a function which takes two facet\n * values and should return a number, 0 if equal, 1 if the first argument is\n * bigger or -1 otherwise.\n *\n * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']`\n * @return {FacetValue[]|HierarchicalFacet|undefined} depending on the type of facet of\n * the attribute requested (hierarchical, disjunctive or conjunctive)\n * @example\n * helper.on('result', function(event){\n * //get values ordered only by name ascending using the string predicate\n * event.results.getFacetValues('city', {sortBy: ['name:asc']});\n * //get values ordered only by count ascending using a function\n * event.results.getFacetValues('city', {\n * // this is equivalent to ['count:asc']\n * sortBy: function(a, b) {\n * if (a.count === b.count) return 0;\n * if (a.count > b.count) return 1;\n * if (b.count > a.count) return -1;\n * }\n * });\n * });\n */\nSearchResults.prototype.getFacetValues = function (attribute, opts) {\n var facetValues = extractNormalizedFacetValues(this, attribute);\n if (!facetValues) {\n return undefined;\n }\n\n var options = defaultsPure({}, opts, {\n sortBy: SearchResults.DEFAULT_SORT,\n // if no sortBy is given, attempt to sort based on facetOrdering\n // if it is given, we still allow to sort via facet ordering first\n facetOrdering: !(opts && opts.sortBy),\n });\n\n // eslint-disable-next-line consistent-this\n var results = this;\n var attributes;\n if (Array.isArray(facetValues)) {\n attributes = [attribute];\n } else {\n var config = results._state.getHierarchicalFacetByName(facetValues.name);\n attributes = config.attributes;\n }\n\n return recSort(\n function (data, facetName) {\n if (options.facetOrdering) {\n var facetOrdering = getFacetOrdering(results, facetName);\n if (facetOrdering) {\n return sortViaFacetOrdering(data, facetOrdering);\n }\n }\n\n if (Array.isArray(options.sortBy)) {\n var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT);\n return orderBy(data, order[0], order[1]);\n } else if (typeof options.sortBy === 'function') {\n return vanillaSortFn(options.sortBy, data);\n }\n throw new Error(\n 'options.sortBy is optional but if defined it must be ' +\n 'either an array of string (predicates) or a sorting function'\n );\n },\n facetValues,\n attributes\n );\n};\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 */\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/**\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 The attribute to look for\n * @return {object|undefined} The stats of the facet\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/**\n * Returns all refinements for all filters + tags. It also provides\n * additional information: count and exhaustiveness for each filter.\n *\n * See the [refinement type](#Refinement) for an exhaustive view of the available\n * data.\n *\n * Note that for a numeric refinement, results are grouped per operator, this\n * means that it will return responses for operators which are empty.\n *\n * @return {Array.} all the refinements\n */\nSearchResults.prototype.getRefinements = function () {\n var state = this._state;\n // eslint-disable-next-line consistent-this\n var results = this;\n var res = [];\n\n Object.keys(state.facetsRefinements).forEach(function (attributeName) {\n state.facetsRefinements[attributeName].forEach(function (name) {\n res.push(\n getRefinement(state, 'facet', attributeName, name, results.facets)\n );\n });\n });\n\n Object.keys(state.facetsExcludes).forEach(function (attributeName) {\n state.facetsExcludes[attributeName].forEach(function (name) {\n res.push(\n getRefinement(state, 'exclude', attributeName, name, results.facets)\n );\n });\n });\n\n Object.keys(state.disjunctiveFacetsRefinements).forEach(function (\n attributeName\n ) {\n state.disjunctiveFacetsRefinements[attributeName].forEach(function (name) {\n res.push(\n getRefinement(\n state,\n 'disjunctive',\n attributeName,\n name,\n results.disjunctiveFacets\n )\n );\n });\n });\n\n Object.keys(state.hierarchicalFacetsRefinements).forEach(function (\n attributeName\n ) {\n state.hierarchicalFacetsRefinements[attributeName].forEach(function (name) {\n res.push(\n getHierarchicalRefinement(\n state,\n attributeName,\n name,\n results.hierarchicalFacets\n )\n );\n });\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\n state.tagRefinements.forEach(function (name) {\n res.push({ type: 'tag', attributeName: '_tags', name: name });\n });\n\n return res;\n};\n\n/**\n * @typedef {Object} Facet\n * @property {string} name\n * @property {Object} data\n * @property {boolean} exhaustive\n */\n\n/**\n * @param {SearchParameters} state the current state\n * @param {string} type the type of the refinement\n * @param {string} attributeName The attribute of the facet\n * @param {*} name The name of the facet\n * @param {Facet[]} resultsFacets facets from the results\n * @return {Refinement} the refinement\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\n return {\n type: type,\n attributeName: attributeName,\n name: name,\n count: count,\n exhaustive: exhaustive,\n };\n}\n\n/**\n * @param {SearchParameters} state the current state\n * @param {string} attributeName the attribute of the hierarchical facet\n * @param {string} name the name of the facet\n * @param {Facet[]} resultsFacets facets from the results\n * @return {HierarchicalFacet} the hierarchical facet\n */\nfunction getHierarchicalRefinement(state, attributeName, name, resultsFacets) {\n var facetDeclaration = state.getHierarchicalFacetByName(attributeName);\n var separator = state._getHierarchicalFacetSeparator(facetDeclaration);\n var split = name.split(separator);\n var rootFacet = find(resultsFacets, function (facet) {\n return facet.name === attributeName;\n });\n\n var facet = split.reduce(function (intermediateFacet, part) {\n var newFacet =\n intermediateFacet &&\n find(intermediateFacet.data, function (f) {\n return f.name === part;\n });\n return newFacet !== undefined ? newFacet : intermediateFacet;\n }, rootFacet);\n\n var count = (facet && facet.count) || 0;\n var exhaustive = (facet && facet.exhaustive) || false;\n var path = (facet && facet.path) || '';\n\n return {\n type: 'hierarchical',\n attributeName: attributeName,\n name: path,\n count: count,\n exhaustive: exhaustive,\n };\n}\n\nmodule.exports = SearchResults;\n","'use strict';\n\nmodule.exports = '3.14.0';\n","'use strict';\n\nvar EventEmitter = require('@algolia/events');\n\nvar DerivedHelper = require('./DerivedHelper');\nvar escapeFacetValue = require('./functions/escapeFacetValue').escapeFacetValue;\nvar inherits = require('./functions/inherits');\nvar merge = require('./functions/merge');\nvar objectHasKeys = require('./functions/objectHasKeys');\nvar omit = require('./functions/omit');\nvar requestBuilder = require('./requestBuilder');\nvar SearchParameters = require('./SearchParameters');\nvar SearchResults = require('./SearchResults');\nvar version = require('./version');\n\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 */\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, EventEmitter);\n\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} Method is chainable, it returns itself\n * @fires search\n * @fires result\n * @fires error\n * @chainable\n */\nAlgoliaSearchHelper.prototype.search = function () {\n this._search({ onlyWithDerivedHelpers: false });\n return this;\n};\n\nAlgoliaSearchHelper.prototype.searchOnlyWithDerivedHelpers = function () {\n this._search({ onlyWithDerivedHelpers: true });\n return this;\n};\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 */\nAlgoliaSearchHelper.prototype.getQuery = function () {\n var state = this.state;\n return requestBuilder._getHitsSearchParams(state);\n};\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} [cb] 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 */\nAlgoliaSearchHelper.prototype.searchOnce = function (options, cb) {\n var tempState = !options\n ? this.state\n : this.state.setQueryParameters(options);\n var queries = requestBuilder._getQueries(tempState.index, tempState);\n // eslint-disable-next-line consistent-this\n var self = this;\n\n this._currentNbQueries++;\n\n this.emit('searchOnce', {\n state: tempState,\n });\n\n if (cb) {\n this.client\n .search(queries)\n .then(function (content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(null, new SearchResults(tempState, content.results), tempState);\n })\n .catch(function (err) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(err, null, tempState);\n });\n\n return undefined;\n }\n\n return this.client.search(queries).then(\n 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 },\n function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n }\n );\n};\n\n/**\n * Start the search for answers with the parameters set in the state.\n * This method returns a promise.\n * @param {Object} options - the options for answers API call\n * @param {string[]} options.attributesForPrediction - Attributes to use for predictions. If empty, `searchableAttributes` is used instead.\n * @param {string[]} options.queryLanguages - The languages in the query. Currently only supports ['en'].\n * @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.\n *\n * @return {promise} the answer results\n * @deprecated answers is deprecated and will be replaced with new initiatives\n */\nAlgoliaSearchHelper.prototype.findAnswers = function (options) {\n // eslint-disable-next-line no-console\n console.warn('[algoliasearch-helper] answers is no longer supported');\n var state = this.state;\n var derivedHelper = this.derivedHelpers[0];\n if (!derivedHelper) {\n return Promise.resolve([]);\n }\n var derivedState = derivedHelper.getModifiedState(state);\n var data = merge(\n {\n attributesForPrediction: options.attributesForPrediction,\n nbHits: options.nbHits,\n },\n {\n params: omit(requestBuilder._getHitsSearchParams(derivedState), [\n 'attributesToSnippet',\n 'hitsPerPage',\n 'restrictSearchableAttributes',\n 'snippetEllipsisText',\n ]),\n }\n );\n\n var errorMessage =\n 'search for answers was called, but this client does not have a function client.initIndex(index).findAnswers';\n if (typeof this.client.initIndex !== 'function') {\n throw new Error(errorMessage);\n }\n var index = this.client.initIndex(derivedState.index);\n if (typeof index.findAnswers !== 'function') {\n throw new Error(errorMessage);\n }\n return index.findAnswers(derivedState.query, options.queryLanguages, data);\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.} the results of the search\n */\nAlgoliaSearchHelper.prototype.searchForFacetValues = function (\n facet,\n query,\n maxFacetHits,\n userState\n) {\n var clientHasSFFV = typeof this.client.searchForFacetValues === 'function';\n var clientHasInitIndex = typeof this.client.initIndex === 'function';\n if (\n !clientHasSFFV &&\n !clientHasInitIndex &&\n typeof this.client.search !== 'function'\n ) {\n throw new Error(\n '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\n var state = this.state.setQueryParameters(userState || {});\n var isDisjunctive = state.isDisjunctiveFacet(facet);\n var algoliaQuery = requestBuilder.getSearchForFacetQuery(\n facet,\n query,\n maxFacetHits,\n state\n );\n\n this._currentNbQueries++;\n // eslint-disable-next-line consistent-this\n var self = this;\n var searchForFacetValuesPromise;\n // newer algoliasearch ^3.27.1 - ~4.0.0\n if (clientHasSFFV) {\n searchForFacetValuesPromise = this.client.searchForFacetValues([\n { indexName: state.index, params: algoliaQuery },\n ]);\n // algoliasearch < 3.27.1\n } else if (clientHasInitIndex) {\n searchForFacetValuesPromise = this.client\n .initIndex(state.index)\n .searchForFacetValues(algoliaQuery);\n // algoliasearch ~5.0.0\n } else {\n // @MAJOR only use client.search\n delete algoliaQuery.facetName;\n searchForFacetValuesPromise = this.client\n .search([\n {\n type: 'facet',\n facet: facet,\n indexName: state.index,\n params: algoliaQuery,\n },\n ])\n .then(function processResponse(response) {\n return response.results[0];\n });\n }\n\n this.emit('searchForFacetValues', {\n state: state,\n facet: facet,\n query: query,\n });\n\n return searchForFacetValuesPromise.then(\n function addIsRefined(content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n\n content = Array.isArray(content) ? content[0] : content;\n\n content.facetHits.forEach(function (f) {\n f.escapedValue = escapeFacetValue(f.value);\n f.isRefined = isDisjunctive\n ? state.isDisjunctiveFacetRefined(facet, f.escapedValue)\n : state.isFacetRefined(facet, f.escapedValue);\n });\n\n return content;\n },\n function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n }\n );\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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/**\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} Method is chainable, it returns itself\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 */\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/**\n * Remove all the tag filters.\n *\n * This method resets the current page to 0.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\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/**\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function (\n facet,\n value\n) {\n this._change({\n state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.addDisjunctiveRefine = function () {\n return this.addDisjunctiveFacetRefinement.apply(this, arguments);\n};\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} Method is chainable, it returns itself\n * @throws Error if the facet is not defined or if the facet is refined\n * @chainable\n * @fires change\n */\nAlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function (\n facet,\n path\n) {\n this._change({\n state: this.state.resetPage().addHierarchicalFacetRefinement(facet, path),\n isPageReset: true,\n });\n\n return this;\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.addNumericRefinement = function (\n attribute,\n operator,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .addNumericRefinement(attribute, operator, value),\n isPageReset: true,\n });\n\n return this;\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.addRefine = function () {\n return this.addFacetRefinement.apply(this, arguments);\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.addExclude = function () {\n return this.addFacetExclusion.apply(this, arguments);\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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/**\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeNumericRefinement = function (\n attribute,\n operator,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .removeNumericRefinement(attribute, operator, value),\n isPageReset: true,\n });\n\n return this;\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function (\n facet,\n value\n) {\n this._change({\n state: this.state\n .resetPage()\n .removeDisjunctiveFacetRefinement(facet, value),\n isPageReset: true,\n });\n\n return this;\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function () {\n return this.removeDisjunctiveFacetRefinement.apply(this, arguments);\n};\n\n/**\n * Removes the refinement set on a hierarchical facet.\n * @param {string} facet the facet name\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @throws Error if the facet is not defined or if the facet is not refined\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function (\n facet\n) {\n this._change({\n state: this.state.resetPage().removeHierarchicalFacetRefinement(facet),\n isPageReset: true,\n });\n\n return this;\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.removeRefine = function () {\n return this.removeFacetRefinement.apply(this, arguments);\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.removeExclude = function () {\n return this.removeFacetExclusion.apply(this, arguments);\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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/**\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion}\n */\nAlgoliaSearchHelper.prototype.toggleExclude = function () {\n return this.toggleFacetExclusion.apply(this, arguments);\n};\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} Method is chainable, it returns itself\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 */\nAlgoliaSearchHelper.prototype.toggleRefinement = function (facet, value) {\n return this.toggleFacetRefinement(facet, value);\n};\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} Method is chainable, it returns itself\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 */\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// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n */\nAlgoliaSearchHelper.prototype.toggleRefine = function () {\n return this.toggleFacetRefinement.apply(this, arguments);\n};\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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/**\n * Increments the page number by one.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * helper.setPage(0).nextPage().getPage();\n * // returns 1\n */\nAlgoliaSearchHelper.prototype.nextPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page + 1);\n};\n\n/**\n * Decrements the page number by one.\n * @fires change\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @chainable\n * @example\n * helper.setPage(1).previousPage().getPage();\n * // returns 0\n */\nAlgoliaSearchHelper.prototype.previousPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page - 1);\n};\n\n/**\n * @private\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @chainable\n * @fires change\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/**\n * Change the current page\n * @deprecated\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage;\n\n/**\n * Updates the current page.\n * @function\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\n */\nAlgoliaSearchHelper.prototype.setPage = setCurrentPage;\n\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\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/**\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} Method is chainable, it returns itself\n * @fires change\n * @chainable\n * @example\n * helper.setQueryParameter('hitsPerPage', 20).search();\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/**\n * Set the whole state (warning: will erase previous state)\n * @param {SearchParameters} newState the whole new state\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n * @fires change\n * @chainable\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/**\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} Method is chainable, it returns itself\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 */\nAlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent =\n function (newState) {\n this.state = new SearchParameters(newState);\n return this;\n };\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 */\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 }\n\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 return false;\n};\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 */\nAlgoliaSearchHelper.prototype.isExcluded = function (facet, value) {\n return this.state.isExcludeRefined(facet, value);\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements}\n */\nAlgoliaSearchHelper.prototype.isDisjunctiveRefined = function (facet, value) {\n return this.state.isDisjunctiveFacetRefined(facet, value);\n};\n\n/**\n * Check if the string is a currently filtering tag.\n * @param {string} tag tag to check\n * @return {boolean} true if the tag is currently refined\n */\nAlgoliaSearchHelper.prototype.hasTag = function (tag) {\n return this.state.isTagRefined(tag);\n};\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag}\n */\nAlgoliaSearchHelper.prototype.isTagRefined = function () {\n return this.hasTagRefinements.apply(this, arguments);\n};\n\n/**\n * Get the name of the currently used index.\n * @return {string} name of the index\n * @example\n * helper.setIndex('highestPrice_products').getIndex();\n * // returns 'highestPrice_products'\n */\nAlgoliaSearchHelper.prototype.getIndex = function () {\n return this.state.index;\n};\n\nfunction getCurrentPage() {\n return this.state.page;\n}\n\n/**\n * Get the currently selected page\n * @deprecated\n * @return {number} the current page\n */\nAlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage;\n/**\n * Get the currently selected page\n * @function\n * @return {number} the current page\n */\nAlgoliaSearchHelper.prototype.getPage = getCurrentPage;\n\n/**\n * Get all the tags currently set to filters the results.\n *\n * @return {string[]} The list of tags currently set.\n */\nAlgoliaSearchHelper.prototype.getTags = function () {\n return this.state.tagRefinements;\n};\n\n/**\n * Get the list of refinements for a given attribute. This method works with\n * conjunctive, disjunctive, excluding and numerical filters.\n *\n * See also SearchResults#getRefinements\n *\n * @param {string} facetName attribute name used for faceting\n * @return {Array.} All Refinement are objects that contain a value, and\n * a type. Numeric also contains an operator.\n * @example\n * helper.addNumericRefinement('price', '>', 100);\n * helper.getRefinements('price');\n * // [\n * // {\n * // \"value\": [\n * // 100\n * // ],\n * // \"operator\": \">\",\n * // \"type\": \"numeric\"\n * // }\n * // ]\n * @example\n * helper.addFacetRefinement('color', 'blue');\n * helper.addFacetExclusion('color', 'red');\n * helper.getRefinements('color');\n * // [\n * // {\n * // \"value\": \"blue\",\n * // \"type\": \"conjunctive\"\n * // },\n * // {\n * // \"value\": \"red\",\n * // \"type\": \"exclude\"\n * // }\n * // ]\n * @example\n * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n * // [\n * // {\n * // \"value\": \"plastic\",\n * // \"type\": \"disjunctive\"\n * // }\n * // ]\n */\nAlgoliaSearchHelper.prototype.getRefinements = function (facetName) {\n var refinements = [];\n\n if (this.state.isConjunctiveFacet(facetName)) {\n var conjRefinements = this.state.getConjunctiveRefinements(facetName);\n\n conjRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'conjunctive',\n });\n });\n\n var excludeRefinements = this.state.getExcludeRefinements(facetName);\n\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 disjunctiveRefinements =\n this.state.getDisjunctiveRefinements(facetName);\n\n disjunctiveRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'disjunctive',\n });\n });\n }\n\n var numericRefinements = this.state.getNumericRefinements(facetName);\n\n Object.keys(numericRefinements).forEach(function (operator) {\n var value = numericRefinements[operator];\n\n refinements.push({\n value: value,\n operator: operator,\n type: 'numeric',\n });\n });\n\n return refinements;\n};\n\n/**\n * Return the current refinement for the (attribute, operator)\n * @param {string} attribute attribute in the record\n * @param {string} operator operator applied on the refined values\n * @return {Array.} refined values\n */\nAlgoliaSearchHelper.prototype.getNumericRefinement = function (\n attribute,\n operator\n) {\n return this.state.getNumericRefinement(attribute, operator);\n};\n\n/**\n * Get the current breadcrumb for a hierarchical facet, as an array\n * @param {string} facetName Hierarchical facet name\n * @return {array.} the path as an array of string\n */\nAlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function (\n facetName\n) {\n return this.state.getHierarchicalFacetBreadcrumb(facetName);\n};\n\n// /////////// PRIVATE\n\n/**\n * Perform the underlying queries\n * @private\n * @param {object} options options for the query\n * @param {boolean} [options.onlyWithDerivedHelpers=false] if true, only the derived helpers will be queried\n * @return {undefined} does not return anything\n * @fires search\n * @fires result\n * @fires error\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\n states.push({\n state: state,\n queriesCount: mainQueries.length,\n helper: this,\n });\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 var derivedStateQueries = derivedState.index\n ? requestBuilder._getQueries(derivedState.index, derivedState)\n : [];\n\n states.push({\n state: derivedState,\n queriesCount: derivedStateQueries.length,\n helper: derivedHelper,\n });\n\n derivedHelper.emit('search', {\n state: derivedState,\n results: derivedHelper.lastResults,\n });\n\n return derivedStateQueries;\n });\n\n var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);\n\n var queryId = this._queryId++;\n this._currentNbQueries++;\n\n if (!queries.length) {\n return Promise.resolve({ results: [] }).then(\n this._dispatchAlgoliaResponse.bind(this, states, queryId)\n );\n }\n\n try {\n this.client\n .search(queries)\n .then(this._dispatchAlgoliaResponse.bind(this, states, queryId))\n .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 return undefined;\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}>} states state used 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 */\nAlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function (\n states,\n queryId,\n content\n) {\n // @TODO remove the number of outdated queries discarded instead of just one\n\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n\n var results = content.results.slice();\n\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\n if (!state.index) {\n helper.emit('result', {\n results: null,\n state: state,\n });\n return;\n }\n\n helper.lastResults = new SearchResults(state, specificResults);\n\n helper.emit('result', {\n results: helper.lastResults,\n state: state,\n });\n });\n};\n\nAlgoliaSearchHelper.prototype._dispatchAlgoliaError = function (\n queryId,\n error\n) {\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n\n this.emit('error', {\n error: error,\n });\n\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n};\n\nAlgoliaSearchHelper.prototype.containsRefinement = function (\n query,\n facetFilters,\n numericFilters,\n tagFilters\n) {\n return (\n query ||\n facetFilters.length !== 0 ||\n numericFilters.length !== 0 ||\n tagFilters.length !== 0\n );\n};\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} true if there are refinements on this attribute\n */\nAlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function (facet) {\n return (\n this.state.disjunctiveRefinements[facet] &&\n this.state.disjunctiveRefinements[facet].length > 0\n );\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\n this.emit('change', {\n state: this.state,\n results: this.lastResults,\n isPageReset: isPageReset,\n });\n }\n};\n\n/**\n * Clears the cache of the underlying Algolia client.\n * @return {AlgoliaSearchHelper} Method is chainable, it returns itself\n */\nAlgoliaSearchHelper.prototype.clearCache = function () {\n if (this.client.clearCache) this.client.clearCache();\n return this;\n};\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} Method is chainable, it returns itself\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 this.client = newClient;\n\n return this;\n};\n\n/**\n * Gets the instance of the currently used client.\n * @return {AlgoliaSearch} the currently used client\n */\nAlgoliaSearchHelper.prototype.getClient = function () {\n return this.client;\n};\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} a new DerivedHelper\n */\nAlgoliaSearchHelper.prototype.derive = function (fn) {\n var derivedHelper = new DerivedHelper(this, fn);\n this.derivedHelpers.push(derivedHelper);\n return derivedHelper;\n};\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 * @param {DerivedHelper} derivedHelper the derived helper to detach\n * @return {undefined} nothing is returned\n * @throws Error\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/**\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 */\nAlgoliaSearchHelper.prototype.hasPendingRequests = function () {\n return this._currentNbQueries > 0;\n};\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\nmodule.exports = AlgoliaSearchHelper;\n","'use strict';\n\nvar AlgoliaSearchHelper = require('./src/algoliasearch.helper');\nvar SearchParameters = require('./src/SearchParameters');\nvar SearchResults = require('./src/SearchResults');\n\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} The helper instance\n */\nfunction algoliasearchHelper(client, index, opts) {\n return new AlgoliaSearchHelper(client, index, opts);\n}\n\n/**\n * The version currently used\n * @member module:algoliasearchHelper.version\n * @type {number}\n */\nalgoliasearchHelper.version = require('./src/version');\n\n/**\n * Constructor for the Helper.\n * @member module:algoliasearchHelper.AlgoliaSearchHelper\n * @type {AlgoliaSearchHelper}\n */\nalgoliasearchHelper.AlgoliaSearchHelper = AlgoliaSearchHelper;\n\n/**\n * Constructor for the object containing all the parameters of the search.\n * @member module:algoliasearchHelper.SearchParameters\n * @type {SearchParameters}\n */\nalgoliasearchHelper.SearchParameters = SearchParameters;\n\n/**\n * Constructor for the object containing the results of the search.\n * @member module:algoliasearchHelper.SearchResults\n * @type {SearchResults}\n */\nalgoliasearchHelper.SearchResults = SearchResults;\n\nmodule.exports = algoliasearchHelper;\n","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport PropTypes from 'prop-types';\nimport React, { Component, Children } from 'react';\nimport { InstantSearchConsumer, IndexProvider } from \"../core/context.js\";\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 * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * );\n */\nvar Index = /*#__PURE__*/function (_Component) {\n _inherits(Index, _Component);\n var _super = _createSuper(Index);\n function Index(props) {\n var _this;\n _classCallCheck(this, Index);\n _this = _super.call(this, props);\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n indexContext: getIndexContext(_this.props)\n });\n _defineProperty(_assertThisInitialized(_this), \"unregisterWidget\", void 0);\n _this.props.contextValue.onSearchParameters(_this.getSearchParameters.bind(_assertThisInitialized(_this)), {\n ais: _this.props.contextValue,\n multiIndexContext: _this.state.indexContext\n }, _this.props, undefined, Index.displayName);\n return _this;\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 if (childrenCount === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(IndexProvider, {\n value: this.state.indexContext\n }, this.props.children);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props) {\n return {\n indexContext: getIndexContext(props)\n };\n }\n }]);\n return Index;\n}(Component);\n_defineProperty(Index, \"propTypes\", {\n indexName: PropTypes.string.isRequired,\n indexId: PropTypes.string.isRequired,\n children: PropTypes.node\n});\n_defineProperty(Index, \"displayName\", 'AlgoliaIndex');\n_defineProperty(Index, \"$$type\", 'ais.index');\n_defineProperty(Index, \"$$widgetType\", 'ais.index');\nvar IndexWrapper = function IndexWrapper(props) {\n var inferredIndexId = props.indexName;\n return /*#__PURE__*/React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return /*#__PURE__*/React.createElement(Index, _extends({\n contextValue: contextValue,\n indexId: inferredIndexId\n }, props));\n });\n};\nIndexWrapper.propTypes = {\n indexName: PropTypes.string.isRequired,\n indexId: PropTypes.string\n};\nexport var IndexComponentWithoutContext = Index;\nexport default IndexWrapper;","export default function createStore(initialState) {\n var state = initialState;\n var listeners = [];\n return {\n getState: function getState() {\n return state;\n },\n setState: function setState(nextState) {\n state = nextState;\n listeners.forEach(function (listener) {\n return listener();\n });\n },\n subscribe: function subscribe(listener) {\n listeners.push(listener);\n return function unsubscribe() {\n listeners.splice(listeners.indexOf(listener), 1);\n };\n }\n };\n}","import { defer } from \"./utils.js\";\nexport default function createWidgetsManager(onWidgetsUpdate) {\n var widgets = [];\n // Is an update scheduled?\n var scheduled = false;\n\n // 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 function scheduleUpdate() {\n if (scheduled) {\n return;\n }\n scheduled = true;\n defer(function () {\n scheduled = false;\n onWidgetsUpdate();\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}","var _excluded = [\"resultsFacetValues\"],\n _excluded2 = [\"resultsFacetValues\"],\n _excluded3 = [\"resultsFacetValues\"];\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport { version as ReactVersion } from 'react';\nimport createStore from \"./createStore.js\";\nimport createWidgetsManager from \"./createWidgetsManager.js\";\nimport { HIGHLIGHT_TAGS } from \"./highlight.js\";\nimport { hasMultipleIndices } from \"./indexUtils.js\";\nimport version from \"./version.js\";\nfunction addAlgoliaAgents(searchClient) {\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(\"react (\".concat(ReactVersion, \")\"));\n searchClient.addAlgoliaAgent(\"react-instantsearch (\".concat(version, \")\"));\n }\n}\nvar isMultiIndexContext = function isMultiIndexContext(widget) {\n return hasMultipleIndices({\n ais: widget.props.contextValue,\n multiIndexContext: widget.props.indexContextValue\n });\n};\nvar isTargetedIndexEqualIndex = function isTargetedIndexEqualIndex(widget, indexId) {\n return widget.props.indexContextValue.targetedIndex === indexId;\n};\n\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.\nvar isIndexWidget = function isIndexWidget(widget) {\n return Boolean(widget.props.indexId);\n};\nvar isIndexWidgetEqualIndex = function isIndexWidgetEqualIndex(widget, indexId) {\n return widget.props.indexId === indexId;\n};\nvar sortIndexWidgetsFirst = function sortIndexWidgetsFirst(firstWidget, secondWidget) {\n var isFirstWidgetIndex = isIndexWidget(firstWidget);\n var isSecondWidgetIndex = isIndexWidget(secondWidget);\n if (isFirstWidgetIndex && !isSecondWidgetIndex) {\n return -1;\n }\n if (!isFirstWidgetIndex && isSecondWidgetIndex) {\n return 1;\n }\n return 0;\n};\n\n// This function is copied from the algoliasearch v4 API Client. If modified,\n// consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.\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 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 var i = 0;\n return format.replace(/%s/g, function () {\n return encodeURIComponent(args[i++]);\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/**\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 */\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 searchCounter;\n var widgetsManager = createWidgetsManager(onWidgetsUpdate);\n hydrateSearchClient(searchClient, resultsState);\n var store = createStore({\n widgets: initialState,\n metadata: hydrateMetadata(resultsState),\n results: hydrateResultsState(resultsState),\n error: null,\n searching: false,\n isSearchStalled: true,\n searchingForFacetValues: false\n });\n function skipSearch() {\n skip = true;\n }\n function updateClient(client) {\n addAlgoliaAgents(client);\n helper.setClient(client);\n search();\n }\n function clearCache() {\n helper.clearCache();\n search();\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 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 })\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 })\n // We have to sort the `Index` widgets first so the `index` parameter\n // is correctly set in the `reduce` function for the following widgets\n .sort(sortIndexWidgetsFirst).reduce(function (indices, widget) {\n var indexId = isMultiIndexContext(widget) ? widget.props.indexContextValue.targetedIndex : widget.props.indexId;\n var widgets = indices[indexId] || [];\n return _objectSpread(_objectSpread({}, indices), {}, _defineProperty({}, indexId, widgets.concat(widget)));\n }, {});\n var derivedParameters = Object.keys(derivedIndices).map(function (indexId) {\n return {\n parameters: derivedIndices[indexId].reduce(function (res, widget) {\n return widget.getSearchParameters(res);\n }, sharedParameters),\n indexId: indexId\n };\n });\n return {\n mainParameters: mainParameters,\n derivedParameters: derivedParameters\n };\n }\n function search() {\n if (!skip) {\n var _getSearchParameters = getSearchParameters(helper.state),\n mainParameters = _getSearchParameters.mainParameters,\n derivedParameters = _getSearchParameters.derivedParameters;\n searchCounter = derivedParameters.length + 1;\n\n // 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 helper.derivedHelpers.slice().forEach(function (derivedHelper) {\n // Since we detach the derived helpers on **every** new search they\n // won't receive intermediate results in case of a stalled search.\n // Only the last result is dispatched by the derived helper because\n // they are not detached yet:\n //\n // - a -> main helper receives results\n // - ap -> main helper receives results\n // - app -> main helper + derived helpers receive results\n //\n // The quick fix is to avoid to detach them on search but only once they\n // received the results. But it means that in case of a stalled search\n // all the derived helpers not detached yet register a new search inside\n // the helper. The number grows fast in case of a bad network and it's\n // not deterministic.\n derivedHelper.detach();\n });\n derivedParameters.forEach(function (_ref2) {\n var indexId = _ref2.indexId,\n parameters = _ref2.parameters;\n var derivedHelper = helper.derive(function () {\n return parameters;\n });\n derivedHelper.on('result', handleSearchSuccess({\n indexId: indexId\n })).on('error', handleSearchError);\n });\n helper.setState(mainParameters);\n helper.search();\n }\n }\n function handleSearchSuccess(_ref3) {\n var indexId = _ref3.indexId;\n return function (event) {\n searchCounter--;\n var state = store.getState();\n var isDerivedHelpersEmpty = !helper.derivedHelpers.length;\n var results = state.results ? state.results : {};\n\n // 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 results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results;\n if (!isDerivedHelpersEmpty) {\n results = _objectSpread(_objectSpread({}, results), {}, _defineProperty({}, indexId, event.results));\n } else {\n results = event.results;\n }\n var currentState = store.getState();\n var nextIsSearchStalled = currentState.isSearchStalled;\n if (!helper.hasPendingRequests()) {\n clearTimeout(stalledSearchTimer);\n stalledSearchTimer = null;\n nextIsSearchStalled = false;\n }\n var resultsFacetValues = currentState.resultsFacetValues,\n partialState = _objectWithoutProperties(currentState, _excluded);\n store.setState(_objectSpread(_objectSpread({}, partialState), {}, {\n results: results,\n isSearchStalled: nextIsSearchStalled,\n searching: searchCounter > 0,\n error: null\n }));\n };\n }\n function handleSearchError(_ref4) {\n var error = _ref4.error;\n var currentState = store.getState();\n var nextIsSearchStalled = currentState.isSearchStalled;\n if (!helper.hasPendingRequests()) {\n clearTimeout(stalledSearchTimer);\n nextIsSearchStalled = false;\n }\n var resultsFacetValues = currentState.resultsFacetValues,\n partialState = _objectWithoutProperties(currentState, _excluded2);\n store.setState(_objectSpread(_objectSpread({}, partialState), {}, {\n isSearchStalled: nextIsSearchStalled,\n error: error,\n searching: false\n }));\n }\n function handleNewSearch() {\n if (!stalledSearchTimer) {\n stalledSearchTimer = setTimeout(function () {\n var _store$getState = store.getState(),\n resultsFacetValues = _store$getState.resultsFacetValues,\n partialState = _objectWithoutProperties(_store$getState, _excluded3);\n store.setState(_objectSpread(_objectSpread({}, partialState), {}, {\n isSearchStalled: true\n }));\n }, stalledSearchDelay);\n }\n }\n function hydrateSearchClient(client, results) {\n if (!results) {\n return;\n }\n\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 if ((!client.transporter || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {\n return;\n }\n\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 if (client.transporter && !client._cacheHydrated) {\n client._cacheHydrated = true;\n var baseMethod = client.search;\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 var requestsWithSerializedParams = requests.map(function (request) {\n return _objectSpread(_objectSpread({}, request), {}, {\n params: serializeQueryParameters(request.params)\n });\n });\n return client.transporter.responsesCache.get({\n method: 'search',\n args: [requestsWithSerializedParams].concat(methodArgs)\n }, function () {\n return baseMethod.apply(void 0, [requests].concat(methodArgs));\n });\n };\n }\n if (Array.isArray(results.results)) {\n hydrateSearchClientWithMultiIndexRequest(client, results.results);\n return;\n }\n hydrateSearchClientWithSingleIndexRequest(client, results);\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 }\n\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 var key = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: results.reduce(function (acc, result) {\n return acc.concat(result.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n }));\n }, [])\n }));\n client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, key, JSON.stringify({\n results: results.reduce(function (acc, result) {\n return acc.concat(result.rawResults);\n }, [])\n })));\n }\n 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 }\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 var key = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: results.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n })\n }));\n client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, key, JSON.stringify({\n results: results.rawResults\n })));\n }\n function hydrateResultsState(results) {\n if (!results) {\n return null;\n }\n if (Array.isArray(results.results)) {\n return results.results.reduce(function (acc, result) {\n return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, result._internalIndexId, new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults)));\n }, {});\n }\n return new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results.state), results.rawResults);\n }\n\n // Called whenever a widget has been rendered with new props.\n function onWidgetsUpdate() {\n var metadata = getMetadata(store.getState().widgets);\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n metadata: metadata,\n searching: true\n }));\n\n // Since the `getSearchParameters` method of widgets also depends on props,\n // the result search parameters might have changed.\n search();\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 function onExternalStateUpdate(nextSearchState) {\n var metadata = getMetadata(nextSearchState);\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n widgets: nextSearchState,\n metadata: metadata,\n searching: true\n }));\n search();\n }\n 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;\n // 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 var maxFacetHitsWithinRange = Math.max(1, Math.min(maxFacetHits, 100));\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n searchingForFacetValues: true\n }));\n helper.searchForFacetValues(facetName, query, maxFacetHitsWithinRange).then(function (content) {\n var _objectSpread7;\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n error: null,\n searchingForFacetValues: false,\n resultsFacetValues: _objectSpread(_objectSpread({}, store.getState().resultsFacetValues), {}, (_objectSpread7 = {}, _defineProperty(_objectSpread7, facetName, content.facetHits), _defineProperty(_objectSpread7, \"query\", query), _objectSpread7))\n }));\n }, function (error) {\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n searchingForFacetValues: false,\n error: error\n }));\n }).catch(function (error) {\n // Since setState is synchronous, any error that occurs in the render of a\n // component will be swallowed by this promise.\n // This is a trick to make the error show up correctly in the console.\n // See http://stackoverflow.com/a/30741722/969302\n setTimeout(function () {\n throw error;\n });\n });\n }\n function updateIndex(newIndex) {\n initialSearchParameters = initialSearchParameters.setIndex(newIndex);\n // 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 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}\nfunction hydrateMetadata(resultsState) {\n if (!resultsState) {\n return [];\n }\n\n // add a value noop, which gets replaced once the widgets are mounted\n return resultsState.metadata.map(function (datum) {\n return _objectSpread(_objectSpread({\n value: function value() {\n return {};\n }\n }, datum), {}, {\n items: datum.items && datum.items.map(function (item) {\n return _objectSpread(_objectSpread({\n value: function value() {\n return {};\n }\n }, item), {}, {\n items: item.items && item.items.map(function (nestedItem) {\n return _objectSpread({\n value: function value() {\n return {};\n }\n }, nestedItem);\n })\n });\n })\n });\n });\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nexport function isMetadataEnabled() {\n return (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === 'object' && _typeof(window.navigator) === 'object' && typeof window.navigator.userAgent === 'string' && window.navigator.userAgent.includes('Algolia Crawler') && _typeof(window.document) === 'object';\n}\nexport function getMetadataPayload(widgets, searchClient) {\n var internalProps = ['contextValue', 'indexContextValue'];\n var widgetsPayload = widgets.map(function (_ref) {\n var props = _ref.props,\n constructor = _ref.constructor;\n var _ref2 = constructor._connectorDesc || {},\n _ref2$defaultProps = _ref2.defaultProps,\n defaultProps = _ref2$defaultProps === void 0 ? {} : _ref2$defaultProps,\n _ref2$displayName = _ref2.displayName,\n displayName = _ref2$displayName === void 0 ? constructor.displayName : _ref2$displayName;\n return {\n displayName: displayName,\n $$type: constructor.$$type,\n $$widgetType: constructor.$$widgetType,\n params: Object.keys(props).filter(function (prop) {\n return !internalProps.includes(prop) && defaultProps[prop] !== props[prop] && props[prop] !== undefined;\n })\n };\n });\n var client = searchClient;\n var ua = client.transporter && client.transporter.userAgent ? client.transporter.userAgent.value : client._ua;\n return {\n ua: ua,\n widgets: widgetsPayload\n };\n}\nexport function injectMetadata(widgets, searchClient) {\n var payloadContainer = document.createElement('meta');\n var refNode = document.querySelector('head');\n payloadContainer.name = 'algolia:metadata';\n var payload = getMetadataPayload(widgets, searchClient);\n payloadContainer.content = JSON.stringify(payload);\n refNode.appendChild(payloadContainer);\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport PropTypes from 'prop-types';\nimport React, { Component, Children } from 'react';\nimport isEqual from 'react-fast-compare';\nimport { InstantSearchProvider } from \"../core/context.js\";\nimport createInstantSearchManager from \"../core/createInstantSearchManager.js\";\nimport { isMetadataEnabled, injectMetadata } from \"../core/metadata.js\";\nfunction isControlled(props) {\n return Boolean(props.searchState);\n}\n\n/**\n * @description\n * `` is the root component of all React InstantSearch implementations.\n * It provides all the connected components (aka widgets) a means to interact\n * with the searchState.\n * @kind widget\n * @name \n * @requirements You will need to have an Algolia account to be able to use this widget.\n * [Create one now](https://www.algolia.com/users/sign_up).\n * @propType {string} indexName - Main index in which to search.\n * @propType {boolean} [refresh=false] - Flag to activate when the cache needs to be cleared so that the front-end is updated when a change occurs in the index.\n * @propType {object} [searchClient] - Provide a custom search client.\n * @propType {func} [onSearchStateChange] - Function to be called everytime a new search is done. Useful for [URL Routing](guide/Routing.html).\n * @propType {object} [searchState] - Object to inject some search state. Switches the InstantSearch component in controlled mode. Useful for [URL Routing](guide/Routing.html).\n * @propType {func} [createURL] - Function to call when creating links, useful for [URL Routing](guide/Routing.html).\n * @propType {SearchResults|SearchResults[]} [resultsState] - Use this to inject the results that will be used at first rendering. Those results are found by using the `findResultsState` function. Useful for [Server Side Rendering](guide/Server-side_rendering.html).\n * @propType {number} [stalledSearchDelay=200] - The amount of time before considering that the search takes too much time. The time is expressed in milliseconds.\n * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }`\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\nvar InstantSearch = /*#__PURE__*/function (_Component) {\n _inherits(InstantSearch, _Component);\n var _super = _createSuper(InstantSearch);\n function InstantSearch(props) {\n var _this;\n _classCallCheck(this, InstantSearch);\n _this = _super.call(this, props);\n _defineProperty(_assertThisInitialized(_this), \"cleanupTimerRef\", null);\n _defineProperty(_assertThisInitialized(_this), \"isUnmounting\", false);\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 _createClass(InstantSearch, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var prevIsControlled = isControlled(prevProps);\n if (prevIsControlled && !this.state.isControlled) {\n throw new Error(\"You can't switch from being controlled to uncontrolled\");\n }\n if (!prevIsControlled && this.state.isControlled) {\n throw new Error(\"You can't switch from being uncontrolled to controlled\");\n }\n if (this.props.refresh !== prevProps.refresh && this.props.refresh) {\n this.state.instantSearchManager.clearCache();\n }\n if (prevProps.indexName !== this.props.indexName) {\n this.state.instantSearchManager.updateIndex(this.props.indexName);\n }\n if (prevProps.searchClient !== this.props.searchClient) {\n this.state.instantSearchManager.updateClient(this.props.searchClient);\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.cleanupTimerRef) {\n clearTimeout(this.cleanupTimerRef);\n this.cleanupTimerRef = null;\n }\n if (isMetadataEnabled()) {\n injectMetadata(this.state.instantSearchManager.widgetsManager.getWidgets(), this.props.searchClient);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var _this2 = this;\n this.cleanupTimerRef = setTimeout(function () {\n _this2.isUnmounting = true;\n _this2.state.instantSearchManager.skipSearch();\n });\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 if (!this.state.isControlled) {\n this.state.instantSearchManager.onExternalStateUpdate(searchState);\n }\n }\n }, {\n key: \"onSearchStateChange\",\n value: function onSearchStateChange(searchState) {\n if (this.props.onSearchStateChange && !this.isUnmounting) {\n this.props.onSearchStateChange(searchState);\n }\n }\n }, {\n key: \"onSearchParameters\",\n value: function onSearchParameters(getSearchParameters, context, props, getMetadata, displayName) {\n if (this.props.onSearchParameters) {\n var _searchState = this.props.searchState ? this.props.searchState : {};\n this.props.onSearchParameters(getSearchParameters, context, props, _searchState);\n }\n if (this.props.widgetsCollector) {\n var _searchState2 = this.props.searchState ? this.props.searchState : {};\n this.props.widgetsCollector({\n getSearchParameters: getSearchParameters,\n getMetadata: getMetadata,\n context: context,\n props: props,\n searchState: _searchState2,\n displayName: displayName\n });\n }\n }\n }, {\n key: \"onSearchForFacetValues\",\n value: function onSearchForFacetValues(searchState) {\n this.state.instantSearchManager.onSearchForFacetValues(searchState);\n }\n }, {\n key: \"getKnownKeys\",\n value: function getKnownKeys() {\n return this.state.instantSearchManager.getWidgetsIds();\n }\n }, {\n key: \"render\",\n value: function render() {\n if (Children.count(this.props.children) === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(InstantSearchProvider, {\n value: this.state.contextValue\n }, this.props.children);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var nextIsControlled = isControlled(nextProps);\n var previousSearchState = prevState.instantSearchManager.store.getState().widgets;\n var nextSearchState = nextProps.searchState;\n if (nextIsControlled && !isEqual(previousSearchState, nextSearchState)) {\n prevState.instantSearchManager.onExternalStateUpdate(nextProps.searchState);\n }\n return {\n isControlled: nextIsControlled,\n contextValue: _objectSpread(_objectSpread({}, prevState.contextValue), {}, {\n mainTargetedIndex: nextProps.indexName\n })\n };\n }\n }]);\n return InstantSearch;\n}(Component);\n_defineProperty(InstantSearch, \"defaultProps\", {\n stalledSearchDelay: 200,\n refresh: false\n});\n_defineProperty(InstantSearch, \"propTypes\", {\n // @TODO: These props are currently constant.\n indexName: PropTypes.string.isRequired,\n searchClient: PropTypes.shape({\n search: PropTypes.func.isRequired,\n searchForFacetValues: PropTypes.func,\n addAlgoliaAgent: PropTypes.func,\n clearCache: PropTypes.func\n }).isRequired,\n createURL: PropTypes.func,\n refresh: PropTypes.bool,\n searchState: PropTypes.object,\n onSearchStateChange: PropTypes.func,\n onSearchParameters: PropTypes.func,\n widgetsCollector: PropTypes.func,\n resultsState: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n children: PropTypes.node,\n stalledSearchDelay: PropTypes.number\n});\nexport default InstantSearch;","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport PropTypes from 'prop-types';\nimport createConnector from \"../core/createConnector.js\";\n\n/**\n * connectCurrentRefinements connector provides the logic to build a widget that will\n * give the user the ability to remove all or some of the filters that were\n * set.\n * @name connectCurrentRefinements\n * @kind connector\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @propType {function} [clearsQuery=false] - Pass true to also clear the search query\n * @providedPropType {function} refine - a function to remove a single filter\n * @providedPropType {array.<{label: string, attribute: string, currentRefinement: string || object, items: array, value: function}>} items - all the filters, the `value` is to pass to the `refine` function for removing all currentrefinements, `label` is for the display. When existing several refinements for the same atribute name, then you get a nested `items` object that contains a `label` and a `value` function to use to remove a single filter. `attribute` and `currentRefinement` are metadata containing row values.\n * @providedPropType {string} query - the search query\n */\nexport default createConnector({\n displayName: 'AlgoliaCurrentRefinements',\n $$type: 'ais.currentRefinements',\n propTypes: {\n transformItems: PropTypes.func\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata) {\n var items = metadata.reduce(function (res, meta) {\n if (typeof meta.items !== 'undefined') {\n if (!props.clearsQuery && meta.id === 'query') {\n return res;\n } else {\n if (props.clearsQuery && meta.id === 'query' && meta.items[0].currentRefinement === '') {\n return res;\n }\n return res.concat(meta.items.map(function (item) {\n return _objectSpread(_objectSpread({}, item), {}, {\n id: meta.id,\n index: meta.index\n });\n }));\n }\n }\n return res;\n }, []);\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n items: transformedItems,\n canRefine: transformedItems.length > 0\n };\n },\n refine: function refine(props, searchState, items) {\n // `value` corresponds to our internal clear function computed in each connector metadata.\n var refinementsToClear = items instanceof Array ? items.map(function (item) {\n return item.value;\n }) : [items];\n return refinementsToClear.reduce(function (res, clear) {\n return clear(res);\n }, searchState);\n }\n});","import createConnector from \"../core/createConnector.js\";\nimport { HIGHLIGHT_TAGS, parseAlgoliaHit } from \"../core/highlight.js\";\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/**\n * connectHighlight connector provides the logic to create an highlighter\n * component that will retrieve, parse and render an highlighted attribute\n * from an Algolia hit.\n * @name connectHighlight\n * @kind connector\n * @category connector\n * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects.\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const CustomHighlight = connectHighlight(\n * ({ highlight, attribute, hit, highlightProperty }) => {\n * const highlights = highlight({\n * highlightProperty: '_highlightResult',\n * attribute,\n * hit\n * });\n *\n * return highlights.map(part => part.isHighlighted ? (\n * {part.value}\n * ) : (\n * {part.value}\n * ));\n * }\n * );\n *\n * const Hit = ({ hit }) => (\n *

\n * \n *

\n * );\n *\n * const App = () => (\n * \n * \n * \n *
\n * );\n */\nexport default createConnector({\n displayName: 'AlgoliaHighlighter',\n $$type: 'ais.highlighter',\n propTypes: {},\n getProvidedProps: function getProvidedProps() {\n return {\n highlight: highlight\n };\n }\n});","import createConnector from \"../core/createConnector.js\";\nimport { getResults } from \"../core/indexUtils.js\";\nimport { addAbsolutePositions, addQueryID } from \"../core/utils.js\";\n\n/**\n * connectHits connector provides the logic to create connected\n * components that will render the results retrieved from\n * Algolia.\n *\n * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage\n * prop to a [Configure](guide/Search_parameters.html) widget.\n *\n * **Warning:** you will need to use the **objectID** property available on every hit as a key\n * when iterating over them. This will ensure you have the best possible UI experience\n * especially on slow networks.\n * @name connectHits\n * @kind connector\n * @providedPropType {array.} hits - the records that matched the search state\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const CustomHits = connectHits(({ hits }) => (\n *
\n * {hits.map(hit =>\n *

\n * \n *

\n * )}\n *
\n * ));\n *\n * const App = () => (\n * \n * \n * \n * );\n */\nexport default createConnector({\n displayName: 'AlgoliaHits',\n $$type: 'ais.hits',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n if (!results) {\n return {\n hits: []\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 * 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});","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _excluded = [\"page\"];\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport isEqual from 'react-fast-compare';\nimport createConnector from \"../core/createConnector.js\";\nimport { getCurrentRefinementValue, refineValue, getResults } from \"../core/indexUtils.js\";\nimport { addAbsolutePositions, addQueryID } from \"../core/utils.js\";\nfunction getId() {\n return 'page';\n}\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId();\n var page = 1;\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, page);\n if (typeof currentRefinement === 'string') {\n return parseInt(currentRefinement, 10);\n }\n return currentRefinement;\n}\nfunction getStateWithoutPage(state) {\n var _ref = state || {},\n page = _ref.page,\n rest = _objectWithoutProperties(_ref, _excluded);\n return rest;\n}\nfunction getInMemoryCache() {\n var cachedHits = undefined;\n var cachedState = undefined;\n return {\n read: function read(_ref2) {\n var state = _ref2.state;\n return isEqual(cachedState, getStateWithoutPage(state)) ? cachedHits : null;\n },\n write: function write(_ref3) {\n var state = _ref3.state,\n hits = _ref3.hits;\n cachedState = getStateWithoutPage(state);\n cachedHits = hits;\n }\n };\n}\nfunction extractHitsFromCachedHits(cachedHits) {\n return Object.keys(cachedHits).map(Number).sort(function (a, b) {\n return a - b;\n }).reduce(function (acc, page) {\n return acc.concat(cachedHits[page]);\n }, []);\n}\n\n/**\n * InfiniteHits connector provides the logic to create connected\n * components that will render an continuous list of results retrieved from\n * Algolia. This connector provides a function to load more results.\n * @name connectInfiniteHits\n * @kind connector\n * @providedPropType {array.} hits - the records that matched the search state\n * @providedPropType {boolean} hasMore - indicates if there are more pages to load\n * @providedPropType {function} refine - call to load more results\n */\nexport default createConnector({\n displayName: 'AlgoliaInfiniteHits',\n $$type: 'ais.infiniteHits',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var _this = this;\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n if (!results) {\n return {\n hits: [],\n hasPrevious: false,\n hasMore: false,\n refine: function refine() {},\n refinePrevious: function refinePrevious() {},\n refineNext: function refineNext() {}\n };\n }\n var page = results.page,\n hits = results.hits,\n hitsPerPage = results.hitsPerPage,\n nbPages = results.nbPages,\n state = results._state;\n this._cache = props.cache ? props.cache : this._cache || getInMemoryCache();\n var cachedHits = this._cache.read({\n state: state\n }) || {};\n var hitsWithPositions = addAbsolutePositions(hits, hitsPerPage, page);\n var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID);\n cachedHits[page] = hitsWithPositionsAndQueryID;\n this._cache.write({\n state: state,\n hits: cachedHits\n });\n\n /*\n Math.min() and Math.max() returns Infinity or -Infinity when no argument is given.\n But there is always something in this point because of `cachedHits[page]`.\n */\n var firstReceivedPage = Math.min.apply(Math, _toConsumableArray(Object.keys(cachedHits).map(Number)));\n var lastReceivedPage = Math.max.apply(Math, _toConsumableArray(Object.keys(cachedHits).map(Number)));\n var hasPrevious = firstReceivedPage > 0;\n var lastPageIndex = nbPages - 1;\n var hasMore = lastReceivedPage < lastPageIndex;\n var refinePrevious = function refinePrevious(event) {\n return _this.refine(event, firstReceivedPage - 1);\n };\n var refineNext = function refineNext(event) {\n return _this.refine(event, lastReceivedPage + 1);\n };\n return {\n hits: extractHitsFromCachedHits(cachedHits),\n hasPrevious: hasPrevious,\n hasMore: hasMore,\n refinePrevious: refinePrevious,\n refineNext: refineNext\n };\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setQueryParameters({\n page: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }) - 1\n });\n },\n refine: function refine(props, searchState, event, index) {\n var id = getId();\n var nextValue = _defineProperty({}, id, index + 1);\n var resetPage = false;\n return refineValue(searchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }, resetPage);\n }\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport PropTypes from 'prop-types';\nimport createConnector from \"../core/createConnector.js\";\nimport { cleanUpValue, getIndexId, refineValue, getCurrentRefinementValue, getResults } from \"../core/indexUtils.js\";\nimport { unescapeFacetValue } from \"../core/utils.js\";\nvar namespace = 'refinementList';\nfunction getId(props) {\n return props.attribute;\n}\nfunction getCurrentRefinement(props, searchState, context) {\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), []);\n if (typeof currentRefinement !== 'string') {\n return currentRefinement;\n }\n if (currentRefinement) {\n return [currentRefinement];\n }\n return [];\n}\nfunction getValue(value, props, searchState, context) {\n var currentRefinement = getCurrentRefinement(props, searchState, context);\n var isAnewValue = currentRefinement.indexOf(value) === -1;\n var nextRefinement = isAnewValue ? currentRefinement.concat([value]) // cannot use .push(), it mutates\n : currentRefinement.filter(function (selectedValue) {\n return selectedValue !== value;\n }); // cannot use .splice(), it mutates\n return nextRefinement;\n}\nfunction getLimit(_ref) {\n var showMore = _ref.showMore,\n limit = _ref.limit,\n showMoreLimit = _ref.showMoreLimit;\n return showMore ? showMoreLimit : limit;\n}\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId(props);\n // Setting the value to an empty string ensures that it is persisted in\n // the URL as an empty value.\n // This is necessary in the case where `defaultRefinement` contains one\n // item and we try to deselect it. `nextSelected` would be an empty array,\n // which would not be persisted to the URL.\n // {foo: ['bar']} => \"foo[0]=bar\"\n // {foo: []} => \"\"\n var nextValue = _defineProperty({}, id, nextRefinement.length > 0 ? nextRefinement : '');\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n/**\n * connectRefinementList connector provides the logic to build a widget that will\n * give the user the ability to choose multiple values for a specific facet.\n * @name connectRefinementList\n * @kind connector\n * @requirements The attribute passed to the `attribute` prop must be present in \"attributes for faceting\"\n * on the Algolia dashboard or configured as `attributesForFaceting` via a set settings call to the Algolia API.\n * @propType {string} attribute - the name of the attribute in the record\n * @propType {boolean} [searchable=false] - allow search inside values\n * @propType {string} [operator=or] - How to apply the refinements. Possible values: 'or' or 'and'.\n * @propType {boolean} [showMore=false] - true if the component should display a button that will expand the number of items\n * @propType {number} [limit=10] - the minimum number of displayed items\n * @propType {number} [showMoreLimit=20] - the maximun number of displayed items. Only used when showMore is set to `true`\n * @propType {string[]} defaultRefinement - the values of the items selected by default. The searchState of this widget takes the form of a list of `string`s, which correspond to the values of all selected refinements. However, when there are no refinements selected, the value of the searchState is an empty string.\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @providedPropType {function} refine - a function to toggle a refinement\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n * @providedPropType {string[]} currentRefinement - the refinement currently applied\n * @providedPropType {array.<{count: number, isRefined: boolean, label: string, value: string}>} items - the list of items the RefinementList can display.\n * @providedPropType {function} searchForItems - a function to toggle a search inside items values\n * @providedPropType {boolean} isFromSearch - a boolean that says if the `items` props contains facet values from the global search or from the search inside items.\n * @providedPropType {boolean} canRefine - a boolean that says whether you can refine\n */\n\nvar sortBy = ['isRefined', 'count:desc', 'name:asc'];\nexport default createConnector({\n displayName: 'AlgoliaRefinementList',\n $$type: 'ais.refinementList',\n propTypes: {\n id: PropTypes.string,\n attribute: PropTypes.string.isRequired,\n operator: PropTypes.oneOf(['and', 'or']),\n showMore: PropTypes.bool,\n limit: PropTypes.number,\n showMoreLimit: PropTypes.number,\n defaultRefinement: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n searchable: PropTypes.bool,\n transformItems: PropTypes.func,\n facetOrdering: PropTypes.bool\n },\n defaultProps: {\n operator: 'or',\n showMore: false,\n limit: 10,\n showMoreLimit: 20,\n facetOrdering: true\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults, metadata, searchForFacetValuesResults) {\n var attribute = props.attribute,\n searchable = props.searchable,\n indexContextValue = props.indexContextValue,\n facetOrdering = props.facetOrdering;\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var canRefine = Boolean(results) && Boolean(results.getFacetByName(attribute));\n var isFromSearch = Boolean(searchForFacetValuesResults && searchForFacetValuesResults[attribute] && searchForFacetValuesResults.query !== '');\n\n // Search For Facet Values is not available with derived helper (used for multi index search)\n if (searchable && indexContextValue) {\n throw new Error('react-instantsearch: searching in *List is not available when used inside a' + ' multi index context');\n }\n if (!canRefine) {\n return {\n items: [],\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n canRefine: canRefine,\n isFromSearch: isFromSearch,\n searchable: searchable\n };\n }\n var items = isFromSearch ? searchForFacetValuesResults[attribute].map(function (v) {\n return {\n label: v.value,\n value: getValue(v.escapedValue, props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n _highlightResult: {\n label: {\n value: v.highlighted\n }\n },\n count: v.count,\n isRefined: v.isRefined\n };\n }) : results.getFacetValues(attribute, {\n sortBy: sortBy,\n facetOrdering: facetOrdering\n }).map(function (v) {\n return {\n label: v.name,\n value: getValue(v.escapedValue, props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n count: v.count,\n isRefined: v.isRefined\n };\n });\n var transformedItems = props.transformItems ? props.transformItems(items) : items;\n return {\n items: transformedItems.slice(0, getLimit(props)),\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n isFromSearch: isFromSearch,\n searchable: searchable,\n canRefine: transformedItems.length > 0\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 searchForFacetValues: function searchForFacetValues(props, searchState, nextRefinement) {\n return {\n facetName: props.attribute,\n query: nextRefinement,\n maxFacetHits: getLimit(props)\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 var attribute = props.attribute,\n operator = props.operator;\n var addKey = operator === 'and' ? 'addFacet' : 'addDisjunctiveFacet';\n var addRefinementKey = \"\".concat(addKey, \"Refinement\");\n searchParameters = searchParameters.setQueryParameters({\n maxValuesPerFacet: Math.max(searchParameters.maxValuesPerFacet || 0, getLimit(props))\n });\n searchParameters = searchParameters[addKey](attribute);\n return getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }).reduce(function (res, val) {\n return res[addRefinementKey](attribute, val);\n }, searchParameters);\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var context = {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n };\n return {\n id: id,\n index: getIndexId(context),\n items: getCurrentRefinement(props, searchState, context).length > 0 ? [{\n attribute: props.attribute,\n label: \"\".concat(props.attribute, \": \"),\n currentRefinement: getCurrentRefinement(props, searchState, context),\n value: function value(nextState) {\n return _refine(props, nextState, [], context);\n },\n items: getCurrentRefinement(props, searchState, context).map(function (item) {\n return {\n label: unescapeFacetValue(\"\".concat(item)),\n value: function value(nextState) {\n var nextSelectedItems = getCurrentRefinement(props, nextState, context).filter(function (other) {\n return other !== item;\n });\n return _refine(props, searchState, nextSelectedItems, context);\n }\n };\n })\n }] : []\n };\n }\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport PropTypes from 'prop-types';\nimport createConnector from \"../core/createConnector.js\";\nimport { cleanUpValue, refineValue, getCurrentRefinementValue, getIndexId } from \"../core/indexUtils.js\";\nfunction getId() {\n return 'query';\n}\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, '');\n if (currentRefinement) {\n return currentRefinement;\n }\n return '';\n}\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId();\n var nextValue = _defineProperty({}, id, nextRefinement);\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage);\n}\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, getId());\n}\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 */\nexport default createConnector({\n displayName: 'AlgoliaSearchBox',\n $$type: 'ais.searchBox',\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 createConnector from \"../core/createConnector.js\";\nimport { getResults } from \"../core/indexUtils.js\";\n\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.

See: [Search state structure](https://community.algolia.com/react-instantsearch/guide/Search_state.html)\n * @providedPropType {object} searchResults - The search results.

In case of multiple indices: if used under ``, 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 *
\n * \n * \n *
\n * );\n * });\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\nexport default createConnector({\n displayName: 'AlgoliaStateResults',\n $$type: 'ais.stateResults',\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 createConnector from \"../core/createConnector.js\";\n// @ts-ignore\nimport { getResults } from \"../core/indexUtils.js\";\n\n/**\n * connectStats connector provides the logic to build a widget that will\n * displays algolia search statistics (hits number and processing time).\n * @name connectStats\n * @kind connector\n * @providedPropType {number} nbHits - number of hits returned by Algolia.\n * @providedPropType {number} nbSortedHits - number of sorted hits returned by Algolia.\n * @providedPropType {number} processingTimeMS - the time in ms took by Algolia to search for results.\n */\nexport default createConnector({\n displayName: 'AlgoliaStats',\n $$type: 'ais.stats',\n getProvidedProps: function getProvidedProps(props, _searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n if (!results) {\n return null;\n }\n return {\n areHitsSorted: results.appliedRelevancyStrictness !== undefined && results.appliedRelevancyStrictness > 0 && results.nbHits !== results.nbSortedHits,\n nbHits: results.nbHits,\n nbSortedHits: results.nbSortedHits,\n processingTimeMS: results.processingTimeMS\n };\n }\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport PropTypes from 'prop-types';\nimport createConnector from \"../core/createConnector.js\";\nimport { cleanUpValue, getIndexId, getResults, refineValue, getCurrentRefinementValue } from \"../core/indexUtils.js\";\nimport { find } from \"../core/utils.js\";\nfunction getId(props) {\n return props.attribute;\n}\nvar namespace = 'toggle';\nvar falsyStrings = ['0', 'false', 'null', 'undefined'];\nfunction getCurrentRefinement(props, searchState, context) {\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, \"\".concat(namespace, \".\").concat(getId(props)), false);\n if (falsyStrings.indexOf(currentRefinement) !== -1) {\n return false;\n }\n return Boolean(currentRefinement);\n}\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId(props);\n var nextValue = _defineProperty({}, id, nextRefinement ? nextRefinement : false);\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage, namespace);\n}\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, \"\".concat(namespace, \".\").concat(getId(props)));\n}\n\n/**\n * connectToggleRefinement connector provides the logic to build a widget that will\n * provides an on/off filtering feature based on an attribute value.\n * @name connectToggleRefinement\n * @kind connector\n * @requirements To use this widget, you'll need an attribute to toggle on.\n *\n * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an\n * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details.\n *\n * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present.\n * @propType {string} label - Label for the toggle.\n * @propType {string} value - Value of the refinement to apply on `attribute`.\n * @propType {boolean} [defaultRefinement=false] - Default searchState of the widget. Should the toggle be checked by default?\n * @providedPropType {boolean} currentRefinement - `true` when the refinement is applied, `false` otherwise\n * @providedPropType {object} count - an object that contains the count for `checked` and `unchecked` state\n * @providedPropType {function} refine - a function to toggle a refinement\n * @providedPropType {function} createURL - a function to generate a URL for the corresponding search state\n */\nexport default createConnector({\n displayName: 'AlgoliaToggle',\n $$type: 'ais.toggle',\n propTypes: {\n label: PropTypes.string.isRequired,\n attribute: PropTypes.string.isRequired,\n value: PropTypes.any.isRequired,\n filter: PropTypes.func,\n defaultRefinement: PropTypes.bool\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var attribute = props.attribute,\n value = props.value;\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var allFacetValues = results && results.getFacetByName(attribute) ? results.getFacetValues(attribute) : null;\n var facetValue =\n // Use null to always be consistent with type of the value\n // count: number | null\n allFacetValues && allFacetValues.length ? find(allFacetValues, function (item) {\n return item.name === value.toString();\n }) : null;\n var facetValueCount = facetValue && facetValue.count;\n var allFacetValuesCount =\n // Use null to always be consistent with type of the value\n // count: number | null\n allFacetValues && allFacetValues.length ? allFacetValues.reduce(function (acc, item) {\n return acc + item.count;\n }, 0) : null;\n var canRefine = currentRefinement ? allFacetValuesCount !== null && allFacetValuesCount > 0 : facetValueCount !== null && facetValueCount > 0;\n var count = {\n checked: allFacetValuesCount,\n unchecked: facetValueCount\n };\n return {\n currentRefinement: currentRefinement,\n canRefine: canRefine,\n count: count\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 var attribute = props.attribute,\n value = props.value,\n filter = props.filter;\n var checked = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var nextSearchParameters = searchParameters.addDisjunctiveFacet(attribute);\n if (checked) {\n nextSearchParameters = nextSearchParameters.addDisjunctiveFacetRefinement(attribute, value);\n if (filter) {\n nextSearchParameters = filter(nextSearchParameters);\n }\n }\n return nextSearchParameters;\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var checked = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var items = [];\n var index = getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n if (checked) {\n items.push({\n label: props.label,\n currentRefinement: checked,\n attribute: props.attribute,\n value: function value(nextState) {\n return _refine(props, nextState, false, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n });\n }\n return {\n id: id,\n index: index,\n items: items\n };\n }\n});","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\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 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};\n// taken from InstantSearch.js/utils\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;\n // We can't divide by 0 so we re-assign the step to 1 if it happens.\n var limitStep = step === 0 ? 1 : step;\n\n // 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 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 for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n return undefined;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component, createContext } from 'react';\nimport { createClassNames } from \"../core/utils.js\";\nvar cx = createClassNames('Panel');\nvar _createContext = /*#__PURE__*/createContext(function setCanRefine() {}),\n PanelConsumer = _createContext.Consumer,\n PanelProvider = _createContext.Provider;\nexport { PanelConsumer, PanelProvider };\nvar Panel = /*#__PURE__*/function (_Component) {\n _inherits(Panel, _Component);\n var _super = _createSuper(Panel);\n function Panel() {\n var _this;\n _classCallCheck(this, Panel);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n canRefine: true\n });\n _defineProperty(_assertThisInitialized(_this), \"setCanRefine\", function (nextCanRefine) {\n _this.setState({\n canRefine: nextCanRefine\n });\n });\n return _this;\n }\n _createClass(Panel, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n className = _this$props.className,\n header = _this$props.header,\n footer = _this$props.footer;\n var canRefine = this.state.canRefine;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, header && /*#__PURE__*/React.createElement(\"div\", {\n className: cx('header')\n }, header), /*#__PURE__*/React.createElement(\"div\", {\n className: cx('body')\n }, /*#__PURE__*/React.createElement(PanelProvider, {\n value: this.setCanRefine\n }, children)), footer && /*#__PURE__*/React.createElement(\"div\", {\n className: cx('footer')\n }, footer));\n }\n }]);\n return Panel;\n}(Component);\n_defineProperty(Panel, \"propTypes\", {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n header: PropTypes.node,\n footer: PropTypes.node\n});\n_defineProperty(Panel, \"defaultProps\", {\n className: '',\n header: null,\n footer: null\n});\nexport default Panel;","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { PanelConsumer } from \"./Panel.js\";\nvar PanelCallbackHandler = /*#__PURE__*/function (_Component) {\n _inherits(PanelCallbackHandler, _Component);\n var _super = _createSuper(PanelCallbackHandler);\n function PanelCallbackHandler() {\n _classCallCheck(this, PanelCallbackHandler);\n return _super.apply(this, arguments);\n }\n _createClass(PanelCallbackHandler, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.setCanRefine(this.props.canRefine);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (prevProps.canRefine !== this.props.canRefine) {\n this.props.setCanRefine(this.props.canRefine);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return this.props.children;\n }\n }]);\n return PanelCallbackHandler;\n}(Component);\n_defineProperty(PanelCallbackHandler, \"propTypes\", {\n children: PropTypes.node.isRequired,\n canRefine: PropTypes.bool.isRequired,\n setCanRefine: PropTypes.func.isRequired\n});\nvar PanelWrapper = function PanelWrapper(_ref) {\n var canRefine = _ref.canRefine,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(PanelConsumer, null, function (setCanRefine) {\n return /*#__PURE__*/React.createElement(PanelCallbackHandler, {\n setCanRefine: setCanRefine,\n canRefine: canRefine\n }, children);\n });\n};\nPanelWrapper.propTypes = {\n canRefine: PropTypes.bool.isRequired,\n children: PropTypes.node.isRequired\n};\nexport default PanelWrapper;","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from \"../core/utils.js\";\nvar cx = createClassNames('ClearRefinements');\nvar ClearRefinements = /*#__PURE__*/function (_Component) {\n _inherits(ClearRefinements, _Component);\n var _super = _createSuper(ClearRefinements);\n function ClearRefinements() {\n _classCallCheck(this, ClearRefinements);\n return _super.apply(this, arguments);\n }\n _createClass(ClearRefinements, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n items = _this$props.items,\n canRefine = _this$props.canRefine,\n refine = _this$props.refine,\n translate = _this$props.translate,\n className = _this$props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: cx('button', !canRefine && 'button--disabled'),\n onClick: function onClick() {\n return refine(items);\n },\n disabled: !canRefine\n }, translate('reset')));\n }\n }]);\n return ClearRefinements;\n}(Component);\n_defineProperty(ClearRefinements, \"propTypes\", {\n items: PropTypes.arrayOf(PropTypes.object).isRequired,\n canRefine: PropTypes.bool.isRequired,\n refine: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n className: PropTypes.string\n});\n_defineProperty(ClearRefinements, \"defaultProps\", {\n className: ''\n});\nexport default translatable({\n reset: 'Clear all filters'\n})(ClearRefinements);","import React from 'react';\nimport { connectCurrentRefinements } from 'react-instantsearch-core';\nimport ClearRefinements from \"../components/ClearRefinements.js\";\nimport PanelCallbackHandler from \"../components/PanelCallbackHandler.js\";\n\n/**\n * The ClearRefinements widget displays a button that lets the user clean every refinement applied\n * to the search.\n * @name ClearRefinements\n * @kind widget\n * @propType {function} [transformItems] - Function to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return.\n * @propType {boolean} [clearsQuery=false] - Pass true to also clear the search query\n * @themeKey ais-ClearRefinements - the root div of the widget\n * @themeKey ais-ClearRefinements-button - the clickable button\n * @themeKey ais-ClearRefinements-button--disabled - the disabled clickable button\n * @translationKey reset - the clear all button value\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, ClearRefinements, RefinementList } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\nvar ClearRefinementsWidget = function ClearRefinementsWidget(props) {\n return /*#__PURE__*/React.createElement(PanelCallbackHandler, props, /*#__PURE__*/React.createElement(ClearRefinements, props));\n};\nexport default connectCurrentRefinements(ClearRefinementsWidget, {\n $$widgetType: 'ais.clearRefinements'\n});","import classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nexport var Highlight = function Highlight(_ref) {\n var cx = _ref.cx,\n value = _ref.value,\n highlightedTagName = _ref.highlightedTagName,\n isHighlighted = _ref.isHighlighted,\n nonHighlightedTagName = _ref.nonHighlightedTagName;\n var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;\n var className = isHighlighted ? 'highlighted' : 'nonHighlighted';\n return /*#__PURE__*/React.createElement(TagName, {\n className: cx(className)\n }, value);\n};\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};\nvar Highlighter = function Highlighter(_ref2) {\n var cx = _ref2.cx,\n hit = _ref2.hit,\n attribute = _ref2.attribute,\n highlight = _ref2.highlight,\n highlightProperty = _ref2.highlightProperty,\n tagName = _ref2.tagName,\n nonHighlightedTagName = _ref2.nonHighlightedTagName,\n separator = _ref2.separator,\n className = _ref2.className;\n var parsedHighlightedValue = highlight({\n hit: hit,\n attribute: attribute,\n highlightProperty: highlightProperty\n });\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(cx(''), className)\n }, parsedHighlightedValue.map(function (item, i) {\n if (Array.isArray(item)) {\n var isLast = i === parsedHighlightedValue.length - 1;\n return /*#__PURE__*/React.createElement(\"span\", {\n key: i\n }, item.map(function (element, index) {\n return /*#__PURE__*/React.createElement(Highlight, {\n cx: cx,\n key: index,\n value: element.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: element.isHighlighted\n });\n }), !isLast && /*#__PURE__*/React.createElement(\"span\", {\n className: cx('separator')\n }, separator));\n }\n return /*#__PURE__*/React.createElement(Highlight, {\n cx: cx,\n key: i,\n value: item.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: item.isHighlighted\n });\n }));\n};\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;","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport React from 'react';\nimport { createClassNames } from \"../core/utils.js\";\nimport Highlighter from \"./Highlighter.js\";\nvar cx = createClassNames('Highlight');\nvar Highlight = function Highlight(props) {\n return /*#__PURE__*/React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_highlightResult\",\n cx: cx\n }));\n};\nexport default Highlight;","import { connectHighlight } from 'react-instantsearch-core';\nimport Highlight from \"../components/Highlight.js\";\n\n/**\n * Renders any attribute from a hit into its highlighted form when relevant.\n *\n * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide.\n * @name Highlight\n * @kind widget\n * @propType {string} attribute - location of the highlighted attribute in the hit (the corresponding element can be either a string or an array of strings)\n * @propType {object} hit - hit object containing the highlighted attribute\n * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the hit\n * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted\n * @propType {node} [separator=','] - symbol used to separate the elements of the array in case the attribute points to an array of strings.\n * @themeKey ais-Highlight - root of the component\n * @themeKey ais-Highlight-highlighted - part of the text which is highlighted\n * @themeKey ais-Highlight-nonHighlighted - part of the text that is not highlighted\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, Highlight } from 'react-instantsearch-dom';\n *\n * const Hit = ({ hit }) => (\n *
\n * \n *
\n * );\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\nexport default connectHighlight(Highlight, {\n $$widgetType: 'ais.highlight'\n});","import classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from \"../core/utils.js\";\nvar cx = createClassNames('Stats');\nvar Stats = function Stats(_ref) {\n var _ref$className = _ref.className,\n className = _ref$className === void 0 ? '' : _ref$className,\n areHitsSorted = _ref.areHitsSorted,\n nbHits = _ref.nbHits,\n nbSortedHits = _ref.nbSortedHits,\n processingTimeMS = _ref.processingTimeMS,\n translate = _ref.translate;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: cx('text')\n }, translate('stats', nbHits, processingTimeMS, nbSortedHits, areHitsSorted)));\n};\nStats.propTypes = {\n className: PropTypes.string,\n areHitsSorted: PropTypes.bool.isRequired,\n nbHits: PropTypes.number.isRequired,\n nbSortedHits: PropTypes.number,\n processingTimeMS: PropTypes.number.isRequired,\n translate: PropTypes.func.isRequired\n};\nexport default translatable({\n stats: function stats(n, ms, nSorted, areHitsSorted) {\n return areHitsSorted && n !== nSorted ? \"\".concat(nSorted.toLocaleString(), \" relevant results sorted out of \").concat(n.toLocaleString(), \" found in \").concat(ms.toLocaleString(), \"ms\") : \"\".concat(n.toLocaleString(), \" results found in \").concat(ms.toLocaleString(), \"ms\");\n }\n})(Stats);","import { connectStats } from 'react-instantsearch-core';\nimport Stats from \"../components/Stats.js\";\n\n/**\n * The Stats component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server) if `relevancyStrictness` is `undefined`. Displays the total number of matching sorted hits out of the matching hits and the time it took to get them (time spent in the Algolia server) otherwise.\n * @name Stats\n * @kind widget\n * @themeKey ais-Stats - the root div of the widget\n * @themeKey ais-Stats-text - the text of the widget - the count of items for each item\n * @translationkey stats - The string displayed by the stats widget. You get function(n, ms, nSorted, areHitsSorted) and you need to return a string. `n` is a number of hits retrieved, `ms` is a processed time, `nSorted` is a number of sorted hits retrieved, `areHitsSorted` is a boolean translating a `relevancyStrictness` set between 0 and 100.\n * @example\n * import React from 'react';\n * import { InstantSearch, Stats, Hits } from 'react-instantsearch-dom';\n * import algoliasearch from 'algoliasearch/lite';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\nexport default connectStats(Stats, {\n $$widgetType: 'ais.stats'\n});","import classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { createClassNames } from \"../core/utils.js\";\nvar cx = createClassNames('ToggleRefinement');\nvar ToggleRefinement = function ToggleRefinement(_ref) {\n var currentRefinement = _ref.currentRefinement,\n label = _ref.label,\n canRefine = _ref.canRefine,\n refine = _ref.refine,\n className = _ref.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(cx('', !canRefine && '-noRefinement'), className)\n }, /*#__PURE__*/React.createElement(\"label\", {\n className: cx('label')\n }, /*#__PURE__*/React.createElement(\"input\", {\n className: cx('checkbox'),\n type: \"checkbox\",\n checked: currentRefinement,\n onChange: function onChange(event) {\n return refine(event.target.checked);\n }\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: cx('labelText')\n }, label)));\n};\nToggleRefinement.propTypes = {\n currentRefinement: PropTypes.bool.isRequired,\n label: PropTypes.string.isRequired,\n canRefine: PropTypes.bool.isRequired,\n refine: PropTypes.func.isRequired,\n className: PropTypes.string\n};\nToggleRefinement.defaultProps = {\n className: ''\n};\nexport default ToggleRefinement;","import { connectToggleRefinement } from 'react-instantsearch-core';\nimport ToggleRefinement from \"../components/ToggleRefinement.js\";\n\n/**\n * The ToggleRefinement provides an on/off filtering feature based on an attribute value.\n * @name ToggleRefinement\n * @kind widget\n * @requirements To use this widget, you'll need an attribute to toggle on.\n *\n * You can't toggle on null or not-null values. If you want to address this particular use-case you'll need to compute an\n * extra boolean attribute saying if the value exists or not. See this [thread](https://discourse.algolia.com/t/how-to-create-a-toggle-for-the-absence-of-a-string-attribute/2460) for more details.\n *\n * @propType {string} attribute - Name of the attribute on which to apply the `value` refinement. Required when `value` is present.\n * @propType {string} label - Label for the toggle.\n * @propType {any} value - Value of the refinement to apply on `attribute` when checked.\n * @propType {boolean} [defaultRefinement=false] - Default state of the widget. Should the toggle be checked by default?\n * @themeKey ais-ToggleRefinement - the root div of the widget\n * @themeKey ais-ToggleRefinement-list - the list of toggles\n * @themeKey ais-ToggleRefinement-item - the toggle list item\n * @themeKey ais-ToggleRefinement-label - the label of each toggle item\n * @themeKey ais-ToggleRefinement-checkbox - the checkbox input of each toggle item\n * @themeKey ais-ToggleRefinement-labelText - the label text of each toggle item\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, ToggleRefinement } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * );\n */\n\nexport default connectToggleRefinement(ToggleRefinement, {\n $$widgetType: 'ais.toggleRefinement'\n});","/*! algoliasearch.umd.js | 4.24.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */\n!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=t||self).algoliasearch=e()}(this,(function(){\"use strict\";function t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){u();var e=JSON.stringify(t);return o()[e]})).then((function(t){return Promise.all([t?t.value:e(),void 0!==t])})).then((function(t){var e=a(t,2),n=e[0],o=e[1];return Promise.all([n,o||r.miss(n)])})).then((function(t){return a(t,1)[0]}))},set:function(t,e){return Promise.resolve().then((function(){var a=o();return a[JSON.stringify(t)]={timestamp:(new Date).getTime(),value:e},n().setItem(r,JSON.stringify(a)),e}))},delete:function(t){return Promise.resolve().then((function(){var e=o();delete e[JSON.stringify(t)],n().setItem(r,JSON.stringify(e))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function u(t){var e=o(t.caches),r=e.shift();return void 0===r?{get:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},n=e();return n.then((function(t){return Promise.all([t,r.miss(t)])})).then((function(t){return a(t,1)[0]}))},set:function(t,e){return Promise.resolve(e)},delete:function(t){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(t,n,a).catch((function(){return u({caches:e}).get(t,n,a)}))},set:function(t,n){return r.set(t,n).catch((function(){return u({caches:e}).set(t,n)}))},delete:function(t){return r.delete(t).catch((function(){return u({caches:e}).delete(t)}))},clear:function(){return r.clear().catch((function(){return u({caches:e}).clear()}))}}}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},e={};return{get:function(r,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},o=JSON.stringify(r);if(o in e)return Promise.resolve(t.serializable?JSON.parse(e[o]):e[o]);var i=n(),u=a&&a.miss||function(){return Promise.resolve()};return i.then((function(t){return u(t)})).then((function(){return i}))},set:function(r,n){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(t){return delete e[JSON.stringify(t)],Promise.resolve()},clear:function(){return e={},Promise.resolve()}}}function c(t,e,r){var n={\"x-algolia-api-key\":r,\"x-algolia-application-id\":e};return{headers:function(){return t===m.WithinHeaders?n:{}},queryParameters:function(){return t===m.WithinQueryParameters?n:{}}}}function f(t){var e=0;return t((function r(){return e++,new Promise((function(n){setTimeout((function(){n(t(r))}),Math.min(100*e,1e3))}))}))}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){return Promise.resolve()};return Object.assign(t,{wait:function(r){return d(t.then((function(t){return Promise.all([e(t,r),t])})).then((function(t){return t[1]})))}})}function l(t){for(var e=t.length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function h(t,e){return e?(Object.keys(e).forEach((function(r){t[r]=e[r](t)})),t):t}function p(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n0?n:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var g={Read:1,Write:2,Any:3},v=1,b=2,P=3;function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return r(r({},t),{},{status:e,lastUpdate:Date.now()})}function w(t){return\"string\"==typeof t?{protocol:\"https\",url:t,accept:g.Any}:{protocol:t.protocol||\"https\",url:t.url,accept:t.accept||g.Any}}var I=\"DELETE\",x=\"GET\",j=\"POST\",D=\"PUT\";function q(t,e){return Promise.all(e.map((function(e){return t.get(e,(function(){return Promise.resolve(O(e))}))}))).then((function(t){var r=t.filter((function(t){return function(t){return t.status===v||Date.now()-t.lastUpdate>12e4}(t)})),n=t.filter((function(t){return function(t){return t.status===P&&Date.now()-t.lastUpdate<=12e4}(t)})),a=[].concat(o(r),o(n));return{getTimeout:function(t,e){return(0===n.length&&0===t?1:n.length+3+t)*e},statelessHosts:a.length>0?a.map((function(t){return w(t)})):e}}))}function S(t,e,n,a){var i=[],u=function(t,e){if(t.method===x||void 0===t.data&&void 0===e.data)return;var n=Array.isArray(t.data)?t.data:r(r({},t.data),e.data);return JSON.stringify(n)}(n,a),s=function(t,e){var n=r(r({},t.headers),e.headers),a={};return Object.keys(n).forEach((function(t){var e=n[t];a[t.toLowerCase()]=e})),a}(t,a),c=n.method,f=n.method!==x?{}:r(r({},n.data),a.data),d=r(r(r({\"x-algolia-agent\":t.userAgent.value},t.queryParameters),f),a.queryParameters),l=0,h=function e(r,o){var f=r.pop();if(void 0===f)throw{name:\"RetryError\",message:\"Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support .\",transporterStackTrace:E(i)};var h={data:u,headers:s,method:c,url:N(f,n.path,d),connectTimeout:o(l,t.timeouts.connect),responseTimeout:o(l,a.timeout)},p=function(t){var e={request:h,response:t,host:f,triesLeft:r.length};return i.push(e),e},m={onSuccess:function(t){return function(t){try{return JSON.parse(t.content)}catch(e){throw function(t,e){return{name:\"DeserializationError\",message:t,response:e}}(e.message,t)}}(t)},onRetry:function(n){var a=p(n);return n.isTimedOut&&l++,Promise.all([t.logger.info(\"Retryable failure\",A(a)),t.hostsCache.set(f,O(f,n.isTimedOut?P:b))]).then((function(){return e(r,o)}))},onFail:function(t){throw p(t),function(t,e){var r=t.content,n=t.status,a=r;try{a=JSON.parse(r).message}catch(t){}return function(t,e,r){return{name:\"ApiError\",message:t,status:e,transporterStackTrace:r}}(a,n,e)}(t,E(i))}};return t.requester.send(h).then((function(t){return function(t,e){return function(t){var e=t.status;return t.isTimedOut||function(t){var e=t.isTimedOut,r=t.status;return!e&&0==~~r}(t)||2!=~~(e/100)&&4!=~~(e/100)}(t)?e.onRetry(t):2==~~(t.status/100)?e.onSuccess(t):e.onFail(t)}(t,m)}))};return q(t.hostsCache,e).then((function(t){return h(o(t.statelessHosts).reverse(),t.getTimeout)}))}function k(t){var e=t.hostsCache,r=t.logger,n=t.requester,o=t.requestsCache,i=t.responsesCache,u=t.timeouts,s=t.userAgent,c=t.hosts,f=t.queryParameters,d={hostsCache:e,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:u,userAgent:s,headers:t.headers,queryParameters:f,hosts:c.map((function(t){return w(t)})),read:function(t,e){var r=y(e,d.timeouts.read),n=function(){return S(d,d.hosts.filter((function(t){return 0!=(t.accept&g.Read)})),t,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:t.cacheable))return n();var o={request:t,mappedRequestOptions:r,transporter:{queryParameters:d.queryParameters,headers:d.headers}};return d.responsesCache.get(o,(function(){return d.requestsCache.get(o,(function(){return d.requestsCache.set(o,n()).then((function(t){return Promise.all([d.requestsCache.delete(o),t])}),(function(t){return Promise.all([d.requestsCache.delete(o),Promise.reject(t)])})).then((function(t){var e=a(t,2);e[0];return e[1]}))}))}),{miss:function(t){return d.responsesCache.set(o,t)}})},write:function(t,e){return S(d,d.hosts.filter((function(t){return 0!=(t.accept&g.Write)})),t,y(e,d.timeouts.write))}};return d}function T(t){var e={value:\"Algolia for JavaScript (\".concat(t,\")\"),add:function(t){var r=\"; \".concat(t.segment).concat(void 0!==t.version?\" (\".concat(t.version,\")\"):\"\");return-1===e.value.indexOf(r)&&(e.value=\"\".concat(e.value).concat(r)),e}};return e}function N(t,e,r){var n=R(r),a=\"\".concat(t.protocol,\"://\").concat(t.url,\"/\").concat(\"/\"===e.charAt(0)?e.substr(1):e);return n.length&&(a+=\"?\".concat(n)),a}function R(t){return Object.keys(t).map((function(e){return p(\"%s=%s\",e,(r=t[e],\"[object Object]\"===Object.prototype.toString.call(r)||\"[object Array]\"===Object.prototype.toString.call(r)?JSON.stringify(t[e]):t[e]));var r})).join(\"&\")}function E(t){return t.map((function(t){return A(t)}))}function A(t){var e=t.request.headers[\"x-algolia-api-key\"]?{\"x-algolia-api-key\":\"*****\"}:{};return r(r({},t),{},{request:r(r({},t.request),{},{headers:r(r({},t.request.headers),e)})})}var C=function(t){return function(e,r){return t.transporter.write({method:j,path:\"2/abtests\",data:e},r)}},U=function(t){return function(e,r){return t.transporter.write({method:I,path:p(\"2/abtests/%s\",e)},r)}},z=function(t){return function(e,r){return t.transporter.read({method:x,path:p(\"2/abtests/%s\",e)},r)}},J=function(t){return function(e){return t.transporter.read({method:x,path:\"2/abtests\"},e)}},F=function(t){return function(e,r){return t.transporter.write({method:j,path:p(\"2/abtests/%s/stop\",e)},r)}},H=function(t){return function(e){return t.transporter.read({method:x,path:\"1/strategies/personalization\"},e)}},M=function(t){return function(e,r){return t.transporter.write({method:j,path:\"1/strategies/personalization\",data:e},r)}};function B(t){return function e(r){return t.request(r).then((function(n){if(void 0!==t.batch&&t.batch(n.hits),!t.shouldStop(n))return n.cursor?e({cursor:n.cursor}):e({page:(r.page||0)+1})}))}({})}var K=function(t){return function(e,a){var o=a||{},i=o.queryParameters,u=n(o,[\"queryParameters\"]),s=r({acl:e},void 0!==i?{queryParameters:i}:{});return d(t.transporter.write({method:j,path:\"1/keys\",data:s},u),(function(e,r){return f((function(n){return tt(t)(e.key,r).catch((function(t){if(404!==t.status)throw t;return n()}))}))}))}},W=function(t){return function(e,r,n){var a=y(n);return a.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:j,path:\"1/clusters/mapping\",data:{cluster:r}},a)}},L=function(t){return function(e,r,n){return t.transporter.write({method:j,path:\"1/clusters/mapping/batch\",data:{users:e,cluster:r}},n)}},Q=function(t){return function(e,r){return d(t.transporter.write({method:j,path:p(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:{action:\"addEntry\",body:[]}}},r),(function(e,r){return jt(t)(e.taskID,r)}))}},G=function(t){return function(e,r,n){return d(t.transporter.write({method:j,path:p(\"1/indexes/%s/operation\",e),data:{operation:\"copy\",destination:r}},n),(function(r,n){return ut(t)(e,{methods:{waitTask:de}}).waitTask(r.taskID,n)}))}},V=function(t){return function(e,n,a){return G(t)(e,n,r(r({},a),{},{scope:[he.Rules]}))}},_=function(t){return function(e,n,a){return G(t)(e,n,r(r({},a),{},{scope:[he.Settings]}))}},X=function(t){return function(e,n,a){return G(t)(e,n,r(r({},a),{},{scope:[he.Synonyms]}))}},Y=function(t){return function(e,r){return e.method===x?t.transporter.read(e,r):t.transporter.write(e,r)}},Z=function(t){return function(e,r){return d(t.transporter.write({method:I,path:p(\"1/keys/%s\",e)},r),(function(r,n){return f((function(r){return tt(t)(e,n).then(r).catch((function(t){if(404!==t.status)throw t}))}))}))}},$=function(t){return function(e,r,n){var a=r.map((function(t){return{action:\"deleteEntry\",body:{objectID:t}}}));return d(t.transporter.write({method:j,path:p(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},n),(function(e,r){return jt(t)(e.taskID,r)}))}},tt=function(t){return function(e,r){return t.transporter.read({method:x,path:p(\"1/keys/%s\",e)},r)}},et=function(t){return function(e,r){return t.transporter.read({method:x,path:p(\"1/task/%s\",e.toString())},r)}},rt=function(t){return function(e){return t.transporter.read({method:x,path:\"/1/dictionaries/*/settings\"},e)}},nt=function(t){return function(e){return t.transporter.read({method:x,path:\"1/logs\"},e)}},at=function(t){return function(e){return t.transporter.read({method:x,path:\"1/clusters/mapping/top\"},e)}},ot=function(t){return function(e,r){return t.transporter.read({method:x,path:p(\"1/clusters/mapping/%s\",e)},r)}},it=function(t){return function(e){var r=e||{},a=r.retrieveMappings,o=n(r,[\"retrieveMappings\"]);return!0===a&&(o.getClusters=!0),t.transporter.read({method:x,path:\"1/clusters/mapping/pending\"},o)}},ut=function(t){return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={transporter:t.transporter,appId:t.appId,indexName:e};return h(n,r.methods)}},st=function(t){return function(e){return t.transporter.read({method:x,path:\"1/keys\"},e)}},ct=function(t){return function(e){return t.transporter.read({method:x,path:\"1/clusters\"},e)}},ft=function(t){return function(e){return t.transporter.read({method:x,path:\"1/indexes\"},e)}},dt=function(t){return function(e){return t.transporter.read({method:x,path:\"1/clusters/mapping\"},e)}},lt=function(t){return function(e,r,n){return d(t.transporter.write({method:j,path:p(\"1/indexes/%s/operation\",e),data:{operation:\"move\",destination:r}},n),(function(r,n){return ut(t)(e,{methods:{waitTask:de}}).waitTask(r.taskID,n)}))}},ht=function(t){return function(e,r){return d(t.transporter.write({method:j,path:\"1/indexes/*/batch\",data:{requests:e}},r),(function(e,r){return Promise.all(Object.keys(e.taskID).map((function(n){return ut(t)(n,{methods:{waitTask:de}}).waitTask(e.taskID[n],r)})))}))}},pt=function(t){return function(e,r){return t.transporter.read({method:j,path:\"1/indexes/*/objects\",data:{requests:e}},r)}},mt=function(t){return function(e,n){var a=e.map((function(t){return r(r({},t),{},{params:R(t.params||{})})}));return t.transporter.read({method:j,path:\"1/indexes/*/queries\",data:{requests:a},cacheable:!0},n)}},yt=function(t){return function(e,a){return Promise.all(e.map((function(e){var o=e.params,i=o.facetName,u=o.facetQuery,s=n(o,[\"facetName\",\"facetQuery\"]);return ut(t)(e.indexName,{methods:{searchForFacetValues:ue}}).searchForFacetValues(i,u,r(r({},a),s))})))}},gt=function(t){return function(e,r){var n=y(r);return n.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:I,path:\"1/clusters/mapping\"},n)}},vt=function(t){return function(e,r,n){var a=r.map((function(t){return{action:\"addEntry\",body:t}}));return d(t.transporter.write({method:j,path:p(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:a}},n),(function(e,r){return jt(t)(e.taskID,r)}))}},bt=function(t){return function(e,r){return d(t.transporter.write({method:j,path:p(\"1/keys/%s/restore\",e)},r),(function(r,n){return f((function(r){return tt(t)(e,n).catch((function(t){if(404!==t.status)throw t;return r()}))}))}))}},Pt=function(t){return function(e,r,n){var a=r.map((function(t){return{action:\"addEntry\",body:t}}));return d(t.transporter.write({method:j,path:p(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},n),(function(e,r){return jt(t)(e.taskID,r)}))}},Ot=function(t){return function(e,r,n){return t.transporter.read({method:j,path:p(\"/1/dictionaries/%s/search\",e),data:{query:r},cacheable:!0},n)}},wt=function(t){return function(e,r){return t.transporter.read({method:j,path:\"1/clusters/mapping/search\",data:{query:e}},r)}},It=function(t){return function(e,r){return d(t.transporter.write({method:D,path:\"/1/dictionaries/*/settings\",data:e},r),(function(e,r){return jt(t)(e.taskID,r)}))}},xt=function(t){return function(e,r){var a=Object.assign({},r),o=r||{},i=o.queryParameters,u=n(o,[\"queryParameters\"]),s=i?{queryParameters:i}:{},c=[\"acl\",\"indexes\",\"referers\",\"restrictSources\",\"queryParameters\",\"description\",\"maxQueriesPerIPPerHour\",\"maxHitsPerQuery\"];return d(t.transporter.write({method:D,path:p(\"1/keys/%s\",e),data:s},u),(function(r,n){return f((function(r){return tt(t)(e,n).then((function(t){return function(t){return Object.keys(a).filter((function(t){return-1!==c.indexOf(t)})).every((function(e){if(Array.isArray(t[e])&&Array.isArray(a[e])){var r=t[e];return r.length===a[e].length&&r.every((function(t,r){return t===a[e][r]}))}return t[e]===a[e]}))}(t)?Promise.resolve():r()}))}))}))}},jt=function(t){return function(e,r){return f((function(n){return et(t)(e,r).then((function(t){return\"published\"!==t.status?n():void 0}))}))}},Dt=function(t){return function(e,r){return d(t.transporter.write({method:j,path:p(\"1/indexes/%s/batch\",t.indexName),data:{requests:e}},r),(function(e,r){return de(t)(e.taskID,r)}))}},qt=function(t){return function(e){return B(r(r({shouldStop:function(t){return void 0===t.cursor}},e),{},{request:function(r){return t.transporter.read({method:j,path:p(\"1/indexes/%s/browse\",t.indexName),data:r},e)}}))}},St=function(t){return function(e){var n=r({hitsPerPage:1e3},e);return B(r(r({shouldStop:function(t){return t.hits.length0&&void 0!==arguments[0]?arguments[0]:0,c=[];for(a=o;a=t.nbPages)throw{name:\"ObjectNotFoundError\",message:\"Object not found.\"};return n()}))}()}},Kt=function(t){return function(e,r){return t.transporter.read({method:x,path:p(\"1/indexes/%s/%s\",t.indexName,e)},r)}},Wt=function(){return function(t,e){for(var r=0,n=Object.entries(t.hits);rr.OPENED&&void 0===n&&(clearTimeout(o),n=a(t.responseTimeout,\"Socket timeout\"))},r.onerror=function(){0===r.status&&(clearTimeout(o),clearTimeout(n),e({content:r.responseText||\"Network request failed\",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(o),clearTimeout(n),e({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(t.data)}))}},logger:(a=ye,{debug:function(t,e){return pe>=a&&console.debug(t,e),Promise.resolve()},info:function(t,e){return me>=a&&console.info(t,e),Promise.resolve()},error:function(t,e){return console.error(t,e),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:u({caches:[i({key:\"\".concat(\"4.24.0\",\"-\").concat(t)}),s()]}),userAgent:T(\"4.24.0\").add({segment:\"Browser\"})},f=r(r({},o),n),d=function(){return function(t){return function(t){var e=t.region||\"us\",n=c(m.WithinHeaders,t.appId,t.apiKey),a=k(r(r({hosts:[{url:\"personalization.\".concat(e,\".algolia.com\")}]},t),{},{headers:r(r(r({},n.headers()),{\"content-type\":\"application/json\"}),t.headers),queryParameters:r(r({},n.queryParameters()),t.queryParameters)}));return h({appId:t.appId,transporter:a},t.methods)}(r(r(r({},o),t),{},{methods:{getPersonalizationStrategy:H,setPersonalizationStrategy:M}}))}};return function(t){var e=t.appId,n=c(void 0!==t.authMode?t.authMode:m.WithinHeaders,e,t.apiKey),a=k(r(r({hosts:[{url:\"\".concat(e,\"-dsn.algolia.net\"),accept:g.Read},{url:\"\".concat(e,\".algolia.net\"),accept:g.Write}].concat(l([{url:\"\".concat(e,\"-1.algolianet.com\")},{url:\"\".concat(e,\"-2.algolianet.com\")},{url:\"\".concat(e,\"-3.algolianet.com\")}]))},t),{},{headers:r(r(r({},n.headers()),{\"content-type\":\"application/x-www-form-urlencoded\"}),t.headers),queryParameters:r(r({},n.queryParameters()),t.queryParameters)}));return h({transporter:a,appId:e,addAlgoliaAgent:function(t,e){a.userAgent.add({segment:t,version:e})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},t.methods)}(r(r({},f),{},{methods:{search:mt,searchForFacetValues:yt,multipleBatch:ht,multipleGetObjects:pt,multipleQueries:mt,copyIndex:G,copySettings:_,copySynonyms:X,copyRules:V,moveIndex:lt,listIndices:ft,getLogs:nt,listClusters:ct,multipleSearchForFacetValues:yt,getApiKey:tt,addApiKey:K,listApiKeys:st,updateApiKey:xt,deleteApiKey:Z,restoreApiKey:bt,assignUserID:W,assignUserIDs:L,getUserID:ot,searchUserIDs:wt,listUserIDs:dt,getTopUserIDs:at,removeUserID:gt,hasPendingMappings:it,clearDictionaryEntries:Q,deleteDictionaryEntries:$,getDictionarySettings:rt,getAppTask:et,replaceDictionaryEntries:vt,saveDictionaryEntries:Pt,searchDictionaryEntries:Ot,setDictionarySettings:It,waitAppTask:jt,customRequest:Y,initIndex:function(t){return function(e){return ut(t)(e,{methods:{batch:Dt,delete:Ct,findAnswers:Mt,getObject:Kt,getObjects:Lt,saveObject:te,saveObjects:ee,search:ie,searchForFacetValues:ue,waitTask:de,setSettings:fe,getSettings:Gt,partialUpdateObject:_t,partialUpdateObjects:Xt,deleteObject:Ut,deleteObjects:zt,deleteBy:At,clearObjects:Nt,browseObjects:qt,getObjectPosition:Wt,findObject:Bt,exists:Ht,saveSynonym:ae,saveSynonyms:oe,getSynonym:Vt,searchSynonyms:ce,browseSynonyms:kt,deleteSynonym:Ft,clearSynonyms:Et,replaceAllObjects:Yt,replaceAllSynonyms:$t,searchRules:se,getRule:Qt,deleteRule:Jt,saveRule:re,saveRules:ne,replaceAllRules:Zt,browseRules:St,clearRules:Rt}})}},initAnalytics:function(){return function(t){return function(t){var e=t.region||\"us\",n=c(m.WithinHeaders,t.appId,t.apiKey),a=k(r(r({hosts:[{url:\"analytics.\".concat(e,\".algolia.com\")}]},t),{},{headers:r(r(r({},n.headers()),{\"content-type\":\"application/json\"}),t.headers),queryParameters:r(r({},n.queryParameters()),t.queryParameters)}));return h({appId:t.appId,transporter:a},t.methods)}(r(r(r({},o),t),{},{methods:{addABTest:C,getABTest:z,getABTests:J,stopABTest:F,deleteABTest:U}}))}},initPersonalization:d,initRecommendation:function(){return function(t){return f.logger.info(\"The `initRecommendation` method is deprecated. Use `initPersonalization` instead.\"),d()(t)}},getRecommendations:ge,getFrequentlyBoughtTogether:ve,getLookingSimilar:we,getRecommendedForYou:Ie,getRelatedProducts:be,getTrendingFacets:Pe,getTrendingItems:Oe}}))}return xe.version=\"4.24.0\",xe}));\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Error;\n","'use strict';\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n","'use strict';\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n","'use strict';\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n","'use strict';\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\nvar test = {\n\t__proto__: null,\n\tfoo: {}\n};\n\nvar $Object = Object;\n\n/** @type {import('.')} */\nmodule.exports = function hasProto() {\n\t// @ts-expect-error: TS errors on an inherited property for some reason\n\treturn { __proto__: test }.foo === test.foo\n\t\t&& !(test instanceof $Object);\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar undefined;\n\nvar $Error = require('es-errors');\nvar $EvalError = require('es-errors/eval');\nvar $RangeError = require('es-errors/range');\nvar $ReferenceError = require('es-errors/ref');\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\nvar $URIError = require('es-errors/uri');\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\n/** @type {import('.')} */\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\n\nvar gopd = require('gopd');\n\n/** @type {import('.')} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\treturn !!$defineProperty;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!$defineProperty) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = require('es-errors/type');\nvar $floor = GetIntrinsic('%Math.floor%');\n\n/** @type {import('.')} */\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(/** @type {Parameters[0]} */ (fn), 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(/** @type {Parameters[0]} */ (fn), 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\nvar setFunctionLength = require('set-function-length');\n\nvar $TypeError = require('es-errors/type');\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = require('es-define-property');\nvar $max = GetIntrinsic('%Math.max%');\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (\n (typeof globalThis !== 'undefined' && obj === globalThis)\n || (typeof global !== 'undefined' && obj === global)\n ) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('.').listGetNode} */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\tfor (; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tcurr.next = /** @type {NonNullable} */ (list.next);\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('.').listGet} */\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('.').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('.').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('.').listHas} */\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @type {WeakMap} */ var $wm;\n\t/** @type {Map} */ var $m;\n\t/** @type {import('.').RootNode} */ var $o;\n\n\t/** @type {import('.').Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? prefix.replace(/\\./g, '%2E') : prefix;\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\\./g, '%2E') : key;\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n var existing = has.call(obj, key);\n if (existing && options.duplicates === 'combine') {\n obj[key] = utils.combine(obj[key], val);\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, check strictDepth option for throw, else just add whatever is left\n\n if (segment) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","import { createConnector } from 'react-instantsearch-core';\n// Do this as a connector so as to avoid these showing up in all the refinement\n// list components\nconst connectHiddenRefinements = createConnector({\n displayName: 'TabHiddenRefinements',\n getProvidedProps() {\n return {};\n },\n getSearchParameters(searchParameters, props, _state) {\n const { hiddenFacets, operator } = props;\n if (!hiddenFacets) {\n return searchParameters;\n }\n // If the operator is 'and', then we need to use 'addFacet' & 'addFacetRefinement'\n // else, the operator is 'or' which means a disjunctive facet search.\n const addKey = operator === 'and' ? 'addFacet' : 'addDisjunctiveFacet';\n const addRefinementKey = operator === 'and' ? 'addFacetRefinement' : 'addDisjunctiveFacetRefinement';\n for (const attribute of Object.keys(hiddenFacets)) {\n const value = hiddenFacets[attribute];\n searchParameters = searchParameters[addKey](attribute);\n if (Array.isArray(value)) {\n value.forEach((v) => searchParameters = searchParameters[addRefinementKey](attribute, v.toString()));\n }\n else {\n searchParameters = searchParameters[addRefinementKey](attribute, value.toString());\n }\n }\n return searchParameters;\n },\n});\nconst HiddenFacets = connectHiddenRefinements(() => null);\nexport default HiddenFacets;\nexport { HiddenFacets, };\n","/*\n * Parse a date string into a Date assuming that it is in local time (not UTC)\n * https://stackoverflow.com/a/42626876/2192243\n */\nexport function parseDateISOString(str) {\n const ds = str.split(/\\D/).map((s) => parseInt(s, 10));\n ds[1] = ds[1] - 1; // adjust month\n // Date constructor checks the actual number of params so we can't just pass\n // undefined in indexes 2-6\n if (ds.length > 6) {\n return new Date(ds[0], ds[1], ds[2], ds[3], ds[4], ds[5], ds[6]);\n }\n if (ds.length > 5) {\n return new Date(ds[0], ds[1], ds[2], ds[3], ds[4], ds[5]);\n }\n if (ds.length > 4) {\n return new Date(ds[0], ds[1], ds[2], ds[3], ds[4]);\n }\n if (ds.length > 3) {\n return new Date(ds[0], ds[1], ds[2], ds[3]);\n }\n if (ds.length > 2) {\n return new Date(ds[0], ds[1], ds[2]);\n }\n return new Date(ds[0], ds[1]);\n}\nexport async function wait(ms = 0) {\n return new Promise((resolve) => setTimeout(() => resolve(), ms));\n}\nexport async function waitUntil(fn, timeout, step) {\n const start = Date.now();\n while (!(fn())) {\n await wait(step || 10);\n if (Date.now() - start > (timeout || 1000)) {\n throw new Error(`Timeout while waiting! waited ${Date.now() - start}ms`);\n }\n }\n}\nexport function isEmpty(obj) {\n if (!obj) {\n return true;\n }\n for (const key of Object.keys(obj)) {\n const val = obj[key];\n if (val) {\n if (typeof (val) == 'string') {\n if (val.length > 0) {\n return false;\n }\n }\n else {\n return false;\n }\n }\n }\n return true;\n}\nexport function present(value) {\n if (typeof value == 'string') {\n return value.length > 0;\n }\n return !!value;\n}\nexport function assert(value, key, msg) {\n if (!present(value)) {\n throw new Error(msg || 'assert failed! Value was not present');\n }\n}\n","import algoliasearch from 'algoliasearch';\nimport qs from 'qs';\nimport React from 'react';\nimport { InstantSearch } from 'react-instantsearch-dom';\nimport { HiddenFacets } from './hidden-facets';\nimport { assert, isEmpty } from '../util';\nconst DEBOUNCE_TIME = 100;\nconst defaults = {};\nif (typeof window != 'undefined' && window.WCC && window.WCC.CONSTANTS) {\n const wcc = window.WCC;\n const constants = wcc.CONSTANTS;\n defaults.apiKey = constants.ALGOLIA_SEARCH_API_KEY;\n defaults.appId = constants.ALGOLIA_APP_ID;\n if (wcc.algoliaProxy) {\n defaults.hosts = [wcc.algoliaProxy];\n }\n}\nelse {\n defaults.apiKey = 'server-rendering';\n defaults.appId = 'server-rendering';\n}\nexport default class AlgoliaSearch extends React.Component {\n static defaultProps = {\n ...defaults,\n searchStateToUrl: searchStateToUrl,\n urlToSearchState: urlToSearchState,\n };\n /**\n * On initial load, parse out the searchState from the URL.\n */\n static getDerivedStateFromProps(props, state) {\n if (!props.storeStateInQuery) {\n return state;\n }\n if (typeof window == 'undefined' ||\n window.location.href === state.lastLocation) {\n return state;\n }\n return {\n searchState: props.urlToSearchState?.(window.location),\n lastLocation: window.location.href,\n };\n }\n client;\n debouncedSetState;\n constructor(props) {\n super(props);\n const opts = {\n logger: console\n };\n if (props.hosts) {\n Object.assign(opts, {\n hosts: props.hosts\n });\n }\n assert(props.appId, 'props.appId is missing');\n assert(props.apiKey, 'props.apiKey is missing');\n this.client = algoliasearch(props.appId, props.apiKey, opts);\n if (typeof window == 'undefined') {\n this.state = {\n searchState: {},\n };\n return;\n }\n this.state = {\n searchState: props.storeStateInQuery ? props.urlToSearchState?.(window.location) : undefined,\n lastLocation: window.location.href,\n };\n }\n render() {\n const { \n /* eslint-disable @typescript-eslint/no-unused-vars */\n apiKey, appId, \n /* eslint-enable @typescript-eslint/no-unused-vars */\n widgetName, storeStateInQuery, initialState, initialResults, ...props } = this.props;\n let resultsState = undefined;\n if (initialResults) {\n resultsState = {\n state: {\n index: props.indexName,\n ...initialState\n },\n rawResults: [initialResults],\n // Metadata is set by individual widgets. To capture this, we'd have to approach the problem in a different way.\n // This does not affect hidden widgets, only things like displayed CurrentRefinements badges & RefinementLists.\n metadata: []\n };\n }\n return (React.createElement(\"div\", { className: widgetName },\n React.createElement(InstantSearch, { searchState: storeStateInQuery ? this.state.searchState : undefined, onSearchStateChange: this.onSearchStateChange, createURL: storeStateInQuery && typeof ('window') != 'undefined' ? createURL : undefined, ...props, searchClient: this.client, resultsState: resultsState }, this.props.children)));\n }\n componentDidMount = () => {\n const { searchState } = this.state;\n if (this.props.storeStateInQuery) {\n window.addEventListener('popstate', this.onPopStateHandler);\n }\n if (this.props.onSearchStatechange && searchState && !isEmpty(searchState)) {\n this.props.onSearchStatechange(searchState);\n }\n };\n componentWillUnmount = () => {\n window.removeEventListener('popstate', this.onPopStateHandler);\n };\n /*\n * The magic happens here -\n * look at this tutorial: https://www.algolia.com/doc/guides/building-search-ui/going-further/routing-urls/react/\n */\n /**\n * Update the current URL whenever the search state changes\n */\n onSearchStateChange = (searchState) => {\n clearTimeout(this.debouncedSetState);\n if (this.props.storeStateInQuery) {\n // If storeStateInQuery, we control the searchState in the wrapper\n // so have to keep it updated every time (i.e. outside debounce)\n this.setState({ searchState: searchState });\n if (typeof window != 'undefined' && this.props.searchStateToUrl) {\n this.debouncedSetState = setTimeout(() => {\n const url = this.props.searchStateToUrl?.(window.location, searchState);\n window.history.replaceState(searchState, document.title, url);\n this.setState({\n searchState,\n lastLocation: url,\n });\n }, DEBOUNCE_TIME);\n }\n }\n if (this.props.onSearchStatechange) {\n this.props.onSearchStatechange(searchState);\n }\n };\n /**\n * Called when the URL was changed outside of the control of AlgoliaSearch,\n * without a page refresh.\n * ex. hitting \"back\" from bootstrap tabs\n */\n onPopStateHandler = (evt) => {\n const state = evt.state;\n if (!state || !isSearchState(state)) {\n return;\n }\n clearTimeout(this.debouncedSetState);\n this.debouncedSetState = setTimeout(() => {\n this.setState({\n searchState: state,\n lastLocation: this.props.searchStateToUrl?.(location, state),\n });\n }, DEBOUNCE_TIME);\n };\n}\n/**\n * Turn an Algolia search state into a relative URL for a hyperlink\n */\nconst createURL = (state) => `?${qs.stringify(state)}${window.location.hash}`;\n/*\n * Create an absolute URL suitable for the history from the current location and search state.\n */\nfunction searchStateToUrl(location, searchState) {\n if (!searchState) {\n return '';\n }\n searchState = {\n ...searchState,\n };\n // \"configure\" is not something that the user can toggle but is rather set by\n // search tabs.\n delete (searchState.configure);\n // since we use InfiniteSearchResults everywhere, having page doesn't help\n delete (searchState.page);\n return new URL(createURL(searchState), location.toString()).toString();\n}\n/**\n * Parse the current search state out of a URL.\n */\nfunction urlToSearchState(location) { return qs.parse(location.search.slice(1)); }\nfunction isSearchState(state) {\n return 'page' in state;\n}\nexport { AlgoliaSearch, HiddenFacets, };\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport keysIn from './keysIn.js';\n\n/**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n});\n\nexport default assignInWith;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\nimport isPlainObject from './isPlainObject.js';\n\n/** `Object#toString` result references. */\nvar domExcTag = '[object DOMException]',\n errorTag = '[object Error]';\n\n/**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\nfunction isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n}\n\nexport default isError;\n","import apply from './_apply.js';\nimport baseRest from './_baseRest.js';\nimport isError from './isError.js';\n\n/**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\nvar attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n});\n\nexport default attempt;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nexport default baseValues;\n","import eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n}\n\nexport default customDefaultsAssignIn;\n","/** Used to escape characters for inclusion in compiled string literals. */\nvar stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\n/**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nfunction escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n}\n\nexport default escapeStringChar;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","/** Used to match template delimiters. */\nvar reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\nexport default reInterpolate;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default basePropertyOf;\n","import basePropertyOf from './_basePropertyOf.js';\n\n/** Used to map characters to HTML entities. */\nvar htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n\n/**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nvar escapeHtmlChar = basePropertyOf(htmlEscapes);\n\nexport default escapeHtmlChar;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import escapeHtmlChar from './_escapeHtmlChar.js';\nimport toString from './toString.js';\n\n/** Used to match HTML entities and HTML characters. */\nvar reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\nfunction escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n}\n\nexport default escape;\n","/** Used to match template delimiters. */\nvar reEscape = /<%-([\\s\\S]+?)%>/g;\n\nexport default reEscape;\n","/** Used to match template delimiters. */\nvar reEvaluate = /<%([\\s\\S]+?)%>/g;\n\nexport default reEvaluate;\n","import escape from './escape.js';\nimport reEscape from './_reEscape.js';\nimport reEvaluate from './_reEvaluate.js';\nimport reInterpolate from './_reInterpolate.js';\n\n/**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\nvar templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': { 'escape': escape }\n }\n};\n\nexport default templateSettings;\n","import assignInWith from './assignInWith.js';\nimport attempt from './attempt.js';\nimport baseValues from './_baseValues.js';\nimport customDefaultsAssignIn from './_customDefaultsAssignIn.js';\nimport escapeStringChar from './_escapeStringChar.js';\nimport isError from './isError.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport keys from './keys.js';\nimport reInterpolate from './_reInterpolate.js';\nimport templateSettings from './templateSettings.js';\nimport toString from './toString.js';\n\n/** Error message constants. */\nvar INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n/** Used to match empty string literals in compiled template source. */\nvar reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n/**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\nvar reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n/**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\nvar reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n/** Used to ensure capturing order of template delimiters. */\nvar reNoMatch = /($^)/;\n\n/** Used to match unescaped characters in compiled string literals. */\nvar reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '