react-instantsearch-core 6.38.3 → 6.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! React InstantSearchCore UNRELEASED | © Algolia, inc. | https://github.com/algolia/instantsearch.js */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactInstantSearchCore={},e.React)}(this,function(e,a){"use strict";var o="default"in a?a.default:a;function H(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?H(Object(n),!0).forEach(function(e){_(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J(r.key),r)}}function $(e,t,n){t&&M(e.prototype,t),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1})}function _(e,t,n){return(t=J(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Q(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function O(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};for(var n,r={},i=Object.keys(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=B(n),t=(e=r?(e=B(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}}function U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}(e,t)||W(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){return function(e){if(Array.isArray(e))return z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||W(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){var n;if(e)return"string"==typeof e?z(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e){e=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=typeof(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof e?e:String(e)}var Y="undefined"!=typeof Element,G="function"==typeof Map,K="function"==typeof Set,X="function"==typeof ArrayBuffer;function Z(e){re.then(e)}var ee=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,a,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1}else if(G&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1;for(s=t.entries();!(i=s.next()).done;)if(!e(i.value[1],n.get(i.value[0])))return!1}else if(K&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1}else if(X&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(t[i]!==n[i])return!1}else{if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;if(Y&&t instanceof Element)return!1;for(i=r;0!=i--;)if(!("_owner"===a[i]&&t.$$typeof||e(t[a[i]],n[a[i]])))return!1}return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}},te=function(e,t){if(e!==t){var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,a=0;a<n.length;a++)if(!i.call(t,n[a])||e[n[a]]!==t[n[a]])return!1}return!0},ne=function(e){return e.displayName||e.name||"UnknownComponent"},re=Promise.resolve(),ie=function r(i){return Object.keys(i).forEach(function(e){var t,n=i[e];"object"!==s(t=n)||null===t||Array.isArray(t)||(ce(n)?r(n):delete i[e])}),i};function ae(e,n,r){return e.map(function(e,t){return I(I({},e),{},{__position:n*r+t+1})})}function se(e,t){return t?e.map(function(e){return I(I({},e),{},{__queryID:t})}):e}function oe(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function ce(e){return e&&0<Object.keys(e).length}function l(e,t){if(null==e)return{};for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];0<=t.indexOf(a)||(n[a]=e[a])}return n}var ue=function(e,t){return(Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".")).reduce(function(e,t){return e?e[t]:void 0},e)};function le(e){return e.replace(/^\\-/,"-")}var fe=a.createContext({onInternalStateUpdate:function(){},createHrefForState:function(){return"#"},onSearchForFacetValues:function(){},onSearchStateChange:function(){},onSearchParameters:function(){},store:{},widgetsManager:{},mainTargetedIndex:""}),he=fe.Consumer,de=fe.Provider,me=a.createContext(void 0),pe=me.Consumer,ge=me.Provider,xe=["contextValue"];function t(n){return function(e,t){var r=function(u){var r;if(u.displayName)return r="function"==typeof u.getSearchParameters||"function"==typeof u.getMetadata||"function"==typeof u.transitionState,function(i){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=function(){Q(n,a.Component);var t=q(n);function n(e){var i;return k(this,n),_(c(i=t.call(this,e)),"unsubscribe",void 0),_(c(i),"unregisterWidget",void 0),_(c(i),"cleanupTimerRef",null),_(c(i),"isUnmounting",!1),_(c(i),"state",{providedProps:i.getProvidedProps(i.props)}),_(c(i),"refine",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onInternalStateUpdate((e=u.refine).call.apply(e,[c(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),_(c(i),"createURL",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return i.props.contextValue.createHrefForState((e=u.refine).call.apply(e,[c(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),_(c(i),"searchForFacetValues",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onSearchForFacetValues((e=u.searchForFacetValues).call.apply(e,[c(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),u.getSearchParameters&&i.props.contextValue.onSearchParameters(u.getSearchParameters.bind(c(i)),{ais:i.props.contextValue,multiIndexContext:i.props.indexContextValue},i.props,u.getMetadata&&u.getMetadata.bind(c(i)),u.displayName),i}return $(n,[{key:"componentDidMount",value:function(){var e=this;this.cleanupTimerRef&&(clearTimeout(this.cleanupTimerRef),this.cleanupTimerRef=null),this.unsubscribe=this.props.contextValue.store.subscribe(function(){e.isUnmounting||e.setState({providedProps:e.getProvidedProps(e.props)})}),r&&(this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this))}},{key:"shouldComponentUpdate",value:function(e,t){return"function"==typeof u.shouldComponentUpdate?u.shouldComponentUpdate.call(this,this.props,e,this.state,t):(e=te(this.props,e),null===this.state.providedProps||null===t.providedProps?this.state.providedProps!==t.providedProps||!e:!e||!te(this.state.providedProps,t.providedProps))}},{key:"componentDidUpdate",value:function(e){ee(e,this.props)||(this.setState({providedProps:this.getProvidedProps(this.props)}),r&&(this.props.contextValue.widgetsManager.update(),"function"==typeof u.transitionState)&&this.props.contextValue.onSearchStateChange(u.transitionState.call(this,this.props,this.props.contextValue.store.getState().widgets,this.props.contextValue.store.getState().widgets)))}},{key:"componentWillUnmount",value:function(){var t=this;this.cleanupTimerRef=setTimeout(function(){var e;t.isUnmounting=!0,t.unsubscribe&&t.unsubscribe(),t.unregisterWidget&&(t.unregisterWidget(),"function"==typeof u.cleanUp)&&(e=u.cleanUp.call(t,t.props,t.props.contextValue.store.getState().widgets),t.props.contextValue.store.setState(I(I({},t.props.contextValue.store.getState()),{},{widgets:e})),t.props.contextValue.onSearchStateChange(ie(e)))})}},{key:"getProvidedProps",value:function(e){var t=this.props.contextValue.store.getState(),n=t.widgets,r=t.results,i=t.resultsFacetValues,a=t.searching,s=t.searchingForFacetValues,o=t.isSearchStalled,c=t.metadata,t=t.error;return u.getProvidedProps.call(this,e,n,{results:r,searching:a,searchingForFacetValues:s,isSearchStalled:o,error:t},c,i)}},{key:"getSearchParameters",value:function(e){return"function"==typeof u.getSearchParameters?u.getSearchParameters.call(this,e,this.props,this.props.contextValue.store.getState().widgets):null}},{key:"getMetadata",value:function(e){return"function"==typeof u.getMetadata?u.getMetadata.call(this,this.props,e):{}}},{key:"transitionState",value:function(e,t){return"function"==typeof u.transitionState?u.transitionState.call(this,this.props,e,t):t}},{key:"render",value:function(){var e,t,n=this.props,n=(n.contextValue,O(n,xe)),r=this.state.providedProps;return null===r?null:(e="function"==typeof u.refine?{refine:this.refine,createURL:this.createURL}:{},t="function"==typeof u.searchForFacetValues?{searchForItems:this.searchForFacetValues}:{},o.createElement(i,D({},n,r,e,t)))}}]),n}();return _(t,"displayName","".concat(u.displayName,"(").concat(ne(i),")")),_(t,"$$type",u.$$type),_(t,"$$widgetType",e.$$widgetType),_(t,"defaultProps",u.defaultProps),_(t,"_connectorDesc",u),t};throw new Error("`createConnector` requires you to provide a `displayName` property.")}(n)(e,t);return function(n){return o.createElement(he,null,function(t){return o.createElement(pe,null,function(e){return o.createElement(r,D({contextValue:t,indexContextValue:e},n))})})}}}var ve={highlightPreTag:"<ais-highlight-0000000000>",highlightPostTag:"</ais-highlight-0000000000>"};function ye(e){var t,n=e.preTag,r=e.postTag,e=e.highlightedValue,e=(void 0===e?"":e).split(n),i=e.shift(),a=""===i?[]:[{value:i,isHighlighted:!1}];return r===n?(t=!0,e.forEach(function(e){a.push({value:e,isHighlighted:t}),t=!t})):e.forEach(function(e){e=e.split(r);a.push({value:e[0],isHighlighted:!0}),""!==e[1]&&a.push({value:e[1],isHighlighted:!1})}),a}var Re="6.38.3";function h(e){return d(e)?e.multiIndexContext.targetedIndex:e.ais.mainTargetedIndex}function p(e,t){if(e.results){if(e.results.hits)return e.results;t=h(t);if(e.results[t])return e.results[t]}return null}function d(e){return e&&e.multiIndexContext}function g(t,e,n,r,i){var a,s,o,c,u,l,f;return d(n)?(n=h(n),i?(o=e,c=n,l=i,u=(u=r)?{page:1}:void 0,f=(s=t).indices&&s.indices[c]?I(I({},s.indices),{},_({},c,I(I({},s.indices[c]),{},(_(f={},l,I(I({},s.indices[c][l]),o)),_(f,"page",1),f)))):I(I({},s.indices),{},_({},c,I(_({},l,o),u))),I(I({},s),{},{indices:f})):(c=e,l=n,o=(o=r)?{page:1}:void 0,l=(u=t).indices&&u.indices[l]?I(I({},u.indices),{},_({},l,I(I(I({},u.indices[l]),c),o))):I(I({},u.indices),{},_({},l,I(I({},c),o))),I(I({},u),{},{indices:l}))):(t.indices&&r&&Object.keys(t.indices).forEach(function(e){t=g(t,{page:1},{multiIndexContext:{targetedIndex:e}},!0,i)}),i?(s=e,f=i,n=(n=r)?{page:1}:void 0,I(I({},a=t),{},_({},f,I(I({},a[f]),s)),n)):(a=e,n=(n=r)?{page:1}:void 0,I(I(I({},t),a),n)))}function be(e){e=e.match(/^([^.]*)\.(.*)/);return{namespace:e&&e[1],attributeName:e&&e[2]}}function u(e,t,n,r,i){var a,s=h(n),o=be(r),c=o.namespace,o=o.attributeName,n={multiIndex:d(n),indexId:s,namespace:c,attributeName:o,id:r,searchState:t};return c=(s=n).multiIndex,o=s.indexId,r=s.namespace,t=s.attributeName,a=s.id,s=s.searchState,(c&&r?s.indices&&s.indices[o]&&s.indices[o][r]&&Object.hasOwnProperty.call(s.indices[o][r],t):c?s.indices&&s.indices[o]&&Object.hasOwnProperty.call(s.indices[o],a):r?s[r]&&Object.hasOwnProperty.call(s[r],t):Object.hasOwnProperty.call(s,a))?(o=(c=n).multiIndex,r=c.indexId,t=c.namespace,s=c.attributeName,a=c.id,c=c.searchState,o&&t?c.indices[r][t][s]:o?c.indices[r][a]:t?c[t][s]:c[a]):e.defaultRefinement||i}function r(e,t,n){var r,i,a,s,o=h(t),c=be(n),u=c.namespace,c=c.attributeName;return d(t)&&Boolean(e.indices)?(o=(t={attribute:c,searchState:e,indexId:o,id:n,namespace:u}).searchState,i=t.indexId,r=t.id,s=t.namespace,t=t.attribute,a=o.indices[i],s&&a?I(I({},o),{},{indices:I(I({},o.indices),{},_({},i,I(I({},a),{},_({},s,l(a[s],[t])))))}):a?I(I({},o),{},{indices:I(I({},o.indices),{},_({},i,l(a,[r])))}):o):(t=(s={attribute:c,searchState:e,id:n,namespace:u}).searchState,i=s.id,a=s.namespace,s=s.attribute,a?I(I({},t),{},_({},a,l(t[a],[s]))):l(t,[i]))}var Fe=["children","contextValue","indexContextValue"],Pe=["children","contextValue","indexContextValue"];function Ce(){return"configure"}var me=t({displayName:"AlgoliaConfigure",$$type:"ais.configure",getProvidedProps:function(){return{}},getSearchParameters:function(e,t){t.children,t.contextValue,t.indexContextValue;t=O(t,Fe);return e.setQueryParameters(t)},transitionState:function(e,t,n){var r=Ce(),i=(e.children,e.contextValue,e.indexContextValue,O(e,Pe)),a=Object.keys(e),s=this._props?Object.keys(this._props).filter(function(e){return-1===a.indexOf(e)}):[];return this._props=e,g(n,_({},r,I(I({},l(n[r],s)),i)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(n,e){var r=Ce(),t=h({ais:n.contextValue,multiIndexContext:n.indexContextValue}),i=d({ais:n.contextValue,multiIndexContext:n.indexContextValue})&&e.indices?e.indices[t]:e,t=(i&&i[r]?Object.keys(i[r]):[]).reduce(function(e,t){return n[t]||(e[t]=i[r][t]),e},{});return g(e,_({},r,t),{ais:n.contextValue,multiIndexContext:n.indexContextValue})}}),Se=me(function(){return null},{$$widgetType:"ais.configure"});function Ve(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function we(e,t){var n,r;if(e!==t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"__proto__"!==i&&"constructor"!==i&&(n=t[i],void 0!==(r=e[i])&&void 0===n||(Ve(r)&&Ve(n)?e[i]=we(r,n):e[i]="object"==typeof(r=n)&&null!==r?we(Array.isArray(r)?[]:{},r):r));return e}function x(){return Array.prototype.slice.call(arguments).reduceRight(function(t,n){return Object.keys(Object(n)).forEach(function(e){void 0!==n[e]&&(void 0!==t[e]&&delete t[e],t[e]=n[e])}),t},{})}var v=function(e){Ve(e)||(e={});for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];Ve(r)&&we(e,r)}return e};var je=function(n,r){return n.filter(function(e,t){return-1<r.indexOf(e)&&n.indexOf(e)===t})},y=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]};var Ie=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")};var _e=function(e,t){if(null===e)return{};for(var n,r={},i=Object.keys(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||(r[n]=e[n]);return r};var Oe=function(e){return e&&0<Object.keys(e).length},i={addRefinement:function(e,t,n){var r;return i.isRefined(e,t,n)?e:(n=""+n,n=e[t]?e[t].concat(n):[n],(r={})[t]=n,x({},r,e))},removeRefinement:function(e,n,t){var r;return void 0===t?i.clearRefinement(e,function(e,t){return n===t}):(r=""+t,i.clearRefinement(e,function(e,t){return n===t&&r===e}))},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return i.isRefined(e,t,n)?i.removeRefinement(e,t,n):i.addRefinement(e,t,n)},clearRefinement:function(i,a,s){var o,e;return void 0===a?Oe(i)?{}:i:"string"==typeof a?_e(i,[a]):"function"==typeof a?(o=!1,e=Object.keys(i).reduce(function(e,t){var n=i[t]||[],r=n.filter(function(e){return!a(e,t,s)});return r.length!==n.length&&(o=!0),e[t]=r,e},{}),o?e:i):void 0},isRefined:function(e,t,n){var r=!!e[t]&&0<e[t].length;return void 0!==n&&r?-1!==e[t].indexOf(""+n):r}},n=i;function Ee(e,n){return Array.isArray(e)&&Array.isArray(n)?e.length===n.length&&e.every(function(e,t){return Ee(n[t],e)}):e===n}function f(e){var r=e?f._parseNumbers(e):{},i=(void 0===r.userToken||null!==(e=r.userToken)&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=r.facets||[],this.disjunctiveFacets=r.disjunctiveFacets||[],this.hierarchicalFacets=r.hierarchicalFacets||[],this.facetsRefinements=r.facetsRefinements||{},this.facetsExcludes=r.facetsExcludes||{},this.disjunctiveFacetsRefinements=r.disjunctiveFacetsRefinements||{},this.numericRefinements=r.numericRefinements||{},this.tagRefinements=r.tagRefinements||[],this.hierarchicalFacetsRefinements=r.hierarchicalFacetsRefinements||{},this);Object.keys(r).forEach(function(e){var t=-1!==f.PARAMETERS.indexOf(e),n=void 0!==r[e];!t&&n&&(i[e]=r[e])})}f.PARAMETERS=Object.keys(new f),f._parseNumbers=function(i){var r,a;return i instanceof f?i:(r={},["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(e){var t,n=i[e];"string"==typeof n&&(t=parseFloat(n),r[e]=isNaN(t)?n:t)}),Array.isArray(i.insideBoundingBox)&&(r.insideBoundingBox=i.insideBoundingBox.map(function(e){return Array.isArray(e)?e.map(function(e){return parseFloat(e)}):e})),i.numericRefinements&&(a={},Object.keys(i.numericRefinements).forEach(function(n){var r=i.numericRefinements[n]||{};a[n]={},Object.keys(r).forEach(function(e){var t=r[e].map(function(e){return Array.isArray(e)?e.map(function(e){return"string"==typeof e?parseFloat(e):e}):"string"==typeof e?parseFloat(e):e});a[n][e]=t})}),r.numericRefinements=a),v({},i,r))},f.make=function(e){var n=new f(e);return(e.hierarchicalFacets||[]).forEach(function(e){var t;e.rootPath&&0===(t=(n=0<(t=n.getHierarchicalRefinement(e.name)).length&&0!==t[0].indexOf(e.rootPath)?n.clearRefinements(e.name):n).getHierarchicalRefinement(e.name)).length&&(n=n.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}),n},f.validate=function(e,t){t=t||{};return e.tagFilters&&t.tagRefinements&&0<t.tagRefinements.length?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):0<e.tagRefinements.length&&t.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&t.numericRefinements&&Oe(t.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):Oe(e.numericRefinements)&&t.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},f.prototype={constructor:f,clearRefinements:function(e){e={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:n.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:n.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:n.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:n.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return e.numericRefinements===this.numericRefinements&&e.facetsRefinements===this.facetsRefinements&&e.facetsExcludes===this.facetsExcludes&&e.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&e.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(e)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r,n=Ie(n);return this.isNumericRefined(e,t,n)?this:((r=v({},this.numericRefinements))[e]=v({},r[e]),r[e][t]?(r[e][t]=r[e][t].slice(),r[e][t].push(n)):r[e][t]=[n],this.setQueryParameters({numericRefinements:r}))},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(n,r,i){return void 0!==i?this.isNumericRefined(n,r,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r&&Ee(e.val,Ie(i))})}):this:void 0!==r?this.isNumericRefined(n,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r})}):this:this.isNumericRefined(n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(s){var o,t,e;return void 0===s?Oe(this.numericRefinements)?{}:this.numericRefinements:"string"==typeof s?_e(this.numericRefinements,[s]):"function"==typeof s?(o=!1,t=this.numericRefinements,e=Object.keys(t).reduce(function(e,r){var i=t[r],a={},i=i||{};return Object.keys(i).forEach(function(t){var e=i[t]||[],n=[];e.forEach(function(e){s({val:e,op:t},r,"numeric")||n.push(e)}),n.length!==e.length&&(o=!0),a[t]=n}),e[r]=a,e},{}),o?e:this.numericRefinements):void 0},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:n.addRefinement(this.facetsRefinements,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},addExcludeRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:n.addRefinement(this.facetsExcludes,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},addDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return n.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:n.addRefinement(this.disjunctiveFacetsRefinements,e,t)});throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},addTagRefinement:function(e){return this.isTagRefined(e)?this:(e={tagRefinements:this.tagRefinements.concat(e)},this.setQueryParameters(e))},removeFacet:function(t){return this.isConjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({facets:this.facets.filter(function(e){return e!==t})}):this},removeDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(e){return e!==t})}):this},removeHierarchicalFacet:function(t){return this.isHierarchicalFacet(t)?this.clearRefinements(t).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(e){return e.name!==t})}):this},removeFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:n.removeRefinement(this.facetsRefinements,e,t)}):this;throw new Error(e+" is not defined in the facets attribute of the helper configuration")},removeExcludeRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:n.removeRefinement(this.facetsExcludes,e,t)}):this;throw new Error(e+" is not defined in the facets attribute of the helper configuration")},removeDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return n.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:n.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this;throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},removeTagRefinement:function(t){var e;return this.isTagRefined(t)?(e={tagRefinements:this.tagRefinements.filter(function(e){return e!==t})},this.setQueryParameters(e)):this},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return this.setQueryParameters({facetsRefinements:n.toggleRefinement(this.facetsRefinements,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},toggleExcludeFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return this.setQueryParameters({facetsExcludes:n.toggleRefinement(this.facetsExcludes,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},toggleDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return this.setQueryParameters({disjunctiveFacetsRefinements:n.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)});throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},toggleHierarchicalFacetRefinement:function(e,t){var n,r;if(this.isHierarchicalFacet(e))return n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r={},void 0!==this.hierarchicalFacetsRefinements[e]&&0<this.hierarchicalFacetsRefinements[e].length&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n))?-1===t.indexOf(n)?r[e]=[]:r[e]=[t.slice(0,t.lastIndexOf(n))]:r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:x({},r,this.hierarchicalFacetsRefinements)});throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration")},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");var n;if(this.isHierarchicalFacet(e))return(n={})[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:x({},n,this.hierarchicalFacetsRefinements)});throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.")},removeHierarchicalFacetRefinement:function(e){var t;return this.isHierarchicalFacetRefined(e)?((t={})[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:x({},t,this.hierarchicalFacetsRefinements)})):this},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return-1<this.disjunctiveFacets.indexOf(e)},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return-1<this.facets.indexOf(e)},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&n.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&n.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&n.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){return!!this.isHierarchicalFacet(e)&&(e=this.getHierarchicalRefinement(e),t?-1!==e.indexOf(t):0<e.length)},isNumericRefined:function(e,t,n){var r,i;return void 0===n&&void 0===t?!!this.numericRefinements[e]:(r=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t],void 0!==n&&r?(n=Ie(n),t=void 0!==(e=this.numericRefinements[e][t],i=n,y(e,function(e){return Ee(e,i)})),r&&t):r)},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var t=this,e=je(Object.keys(this.numericRefinements).filter(function(e){return 0<Object.keys(t.numericRefinements[e]).length}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(e){return 0<t.disjunctiveFacetsRefinements[e].length}).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var t=this;return je(this.hierarchicalFacets.map(function(e){return e.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(e){return 0<t.hierarchicalFacetsRefinements[e].length}))},getUnrefinedDisjunctiveFacets:function(){var t=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(e){return-1===t.indexOf(e)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var n=this.managedParameters,r={},i=this;return Object.keys(this).forEach(function(e){var t=i[e];-1===n.indexOf(e)&&void 0!==t&&(r[e]=t)}),r},setQueryParameter:function(e,t){var n;return this[e]===t?this:((n={})[e]=t,this.setQueryParameters(n))},setQueryParameters:function(e){if(!e)return this;var t=f.validate(this,e);if(t)throw t;var n=this,i=f._parseNumbers(e),t=Object.keys(this).reduce(function(e,t){return e[t]=n[t],e},{}),e=Object.keys(i).reduce(function(e,t){var n=void 0!==e[t],r=void 0!==i[t];return n&&!r?_e(e,[t]):(r&&(e[t]=i[t]),e)},t);return new this.constructor(e)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(t){return y(this.hierarchicalFacets,function(e){return e.name===t})},getHierarchicalFacetBreadcrumb:function(e){var t;return this.isHierarchicalFacet(e)&&(t=this.getHierarchicalRefinement(e)[0])?(e=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),t.split(e).map(function(e){return e.trim()})):[]},toString:function(){return JSON.stringify(this,null,2)}};var Ae=f;function Ne(e){return Array.isArray(e)?e.filter(Boolean):[]}function Te(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function He(e,t){var r=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var n=t.split(":"),t=y(r,function(e){return e[0]===n[0]});return 1<n.length||!t?(e[0].push(n[0]),e[1].push(n[1])):(e[0].push(t[0]),e[1].push(t[1])),e},[[],[]])}var ke=function(e,n,i){return Array.isArray(e)?(Array.isArray(i)||(i=[]),(e=e.map(function(t,e){return{criteria:n.map(function(e){return t[e]}),index:e,value:t}})).sort(function(e,t){for(var n=-1;++n<e.criteria.length;){var r=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=void 0!==t,a=null===t;if(!a&&t<e||r&&i||!n)return 1;if(!r&&e<t||a&&n||!i)return-1}return 0}(e.criteria[n],t.criteria[n]);if(r)return!(n>=i.length)&&"desc"===i[n]?-r:r}return e.index-t.index}),e.map(function(e){return e.value})):[]};var R=function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},b=function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")},Me=function(m){return function(e,t){function n(e,s,t){var n,o=e;if(0<t){var r=0;for(o=e;r<t;){var i=o&&Array.isArray(o.data)?o.data:[],o=y(i,function(e){return e.isRefined});r++}}return o&&(n=Object.keys(s.data).map(function(e){return[e,s.data[e]]}).filter(function(e){var t,n,r,i,a,e=e[0];return e=e,t=o.path||u,n=f,r=c,a=l,(!(i=u)||0===e.indexOf(i)&&i!==e)&&(!i&&-1===e.indexOf(r)||i&&e.split(r).length-i.split(r).length==1||-1===e.indexOf(r)&&-1===n.indexOf(r)||0===n.indexOf(e)||0===e.indexOf(t+r)&&(a||0===e.indexOf(n)))}),o.data=ke(n.map(function(e){var t,n,r,i,a=e[0],e=e[1];return e=e,a=a,t=c,n=De(f),r=s.exhaustive,{name:(i=a.split(t))[i.length-1].trim(),path:a,escapedValue:$e(a),count:e,isRefined:n===a||0===n.indexOf(a+t),exhaustive:r,data:null}}),a[0],a[1])),e}var a,c,u,l,f,r=m.hierarchicalFacets[t],i=m.hierarchicalFacetsRefinements[r.name]&&m.hierarchicalFacetsRefinements[r.name][0]||"",s=m._getHierarchicalFacetSeparator(r),o=m._getHierarchicalRootPath(r),h=m._getHierarchicalShowParentLevel(r),r=He(m._getHierarchicalFacetSortBy(r)),d=e.every(function(e){return e.exhaustive}),r=(a=r,c=s,l=h,f=i,e);return(r=(u=o)?e.slice(o.split(s).length):r).reduce(n,{name:m.hierarchicalFacets[t].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:d,data:null})}},$e=R,De=b;var Qe=R,Be=b;function Le(e){var n={};return e.forEach(function(e,t){n[e]=t}),n}function qe(e,t,n){t&&t[n]&&(e.stats=t[n])}function F(l,t,n){var o=t[0],f=(this._rawResults=t,this),e=(Object.keys(o).forEach(function(e){f[e]=o[e]}),Object.keys(n||{}).forEach(function(e){f[e]=n[e]}),this.processingTimeMS=t.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=l.hierarchicalFacets.map(function(){return[]}),this.facets=[],l.getRefinedDisjunctiveFacets()),c=Le(l.facets),u=Le(l.disjunctiveFacets),r=1,h=o.facets||{};Object.keys(h).forEach(function(e){var t,n,r,i,a=h[e],s=(r=l.hierarchicalFacets,t=e,y(r,function(e){return-1<(e.attributes||[]).indexOf(t)}));s?(r=s.attributes.indexOf(e),n=Te(l.hierarchicalFacets,function(e){return e.name===s.name}),f.hierarchicalFacets[n][r]={attribute:e,data:a,exhaustive:o.exhaustiveFacetsCount}):(n=-1!==l.disjunctiveFacets.indexOf(e),r=-1!==l.facets.indexOf(e),n&&(i=u[e],f.disjunctiveFacets[i]={name:e,data:a,exhaustive:o.exhaustiveFacetsCount},qe(f.disjunctiveFacets[i],o.facets_stats,e)),r&&(i=c[e],f.facets[i]={name:e,data:a,exhaustive:o.exhaustiveFacetsCount},qe(f.facets[i],o.facets_stats,e)))}),this.hierarchicalFacets=Ne(this.hierarchicalFacets),e.forEach(function(e){var i=t[r],a=i&&i.facets?i.facets:{},s=l.getHierarchicalFacetByName(e);Object.keys(a).forEach(function(t){var n,e,r=a[t];s?(n=Te(l.hierarchicalFacets,function(e){return e.name===s.name}),-1!==(e=Te(f.hierarchicalFacets[n],function(e){return e.attribute===t}))&&(f.hierarchicalFacets[n][e].data=v({},f.hierarchicalFacets[n][e].data,r))):(n=u[t],e=o.facets&&o.facets[t]||{},f.disjunctiveFacets[n]={name:t,data:x({},r,e),exhaustive:i.exhaustiveFacetsCount},qe(f.disjunctiveFacets[n],i.facets_stats,t),l.disjunctiveFacetsRefinements[t]&&l.disjunctiveFacetsRefinements[t].forEach(function(e){!f.disjunctiveFacets[n].data[e]&&-1<l.disjunctiveFacetsRefinements[t].indexOf(Be(e))&&(f.disjunctiveFacets[n].data[e]=0)}))}),r++}),l.getRefinedHierarchicalFacets().forEach(function(e){var o=l.getHierarchicalFacetByName(e),c=l._getHierarchicalFacetSeparator(o),u=l.getHierarchicalRefinement(e);0===u.length||u[0].split(c).length<2||t.slice(r).forEach(function(e){var s=e&&e.facets?e.facets:{};Object.keys(s).forEach(function(t){var e,n,r=s[t],i=Te(l.hierarchicalFacets,function(e){return e.name===o.name}),a=Te(f.hierarchicalFacets[i],function(e){return e.attribute===t});-1!==a&&(e={},0<u.length&&(e[n=u[0].split(c)[0]]=f.hierarchicalFacets[i][a].data[n]),f.hierarchicalFacets[i][a].data=x(e,r,f.hierarchicalFacets[i][a].data))}),r++})}),Object.keys(l.facetsExcludes).forEach(function(t){var e=l.facetsExcludes[t],n=c[t];f.facets[n]={name:t,data:o.facets[t],exhaustive:o.exhaustiveFacetsCount},e.forEach(function(e){f.facets[n]=f.facets[n]||{name:t},f.facets[n].data=f.facets[n].data||{},f.facets[n].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(Me(l)),this.facets=Ne(this.facets),this.disjunctiveFacets=Ne(this.disjunctiveFacets),this._state=l}function Ue(e,t){e=y(e,function(e){return e.name===t});return e&&e.stats}function We(e,t,n,r,i){var i=y(i,function(e){return e.name===n}),a=i&&i.data&&i.data[r]?i.data[r]:0,i=i&&i.exhaustive||!1;return{type:t,attributeName:n,name:r,count:a,exhaustive:i}}F.prototype.getFacetByName=function(t){function e(e){return e.name===t}return y(this.facets,e)||y(this.disjunctiveFacets,e)||y(this.hierarchicalFacets,e)},F.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],F.prototype.getFacetValues=function(e,t){r=e;var n,r,i,a,s,o,c=(n=this)._state.isConjunctiveFacet(r)?(i=y(n.facets,u))?Object.keys(i.data).map(function(e){var t=Qe(e);return{name:e,escapedValue:t,count:i.data[e],isRefined:n._state.isFacetRefined(r,t),isExcluded:n._state.isExcludeRefined(r,e)}}):[]:n._state.isDisjunctiveFacet(r)?(a=y(n.disjunctiveFacets,u))?Object.keys(a.data).map(function(e){var t=Qe(e);return{name:e,escapedValue:t,count:a.data[e],isRefined:n._state.isDisjunctiveFacetRefined(r,t)}}):[]:n._state.isHierarchicalFacet(r)?y(n.hierarchicalFacets,u):void 0;function u(e){return e.name===r}if(c)return s=x({},t,{sortBy:F.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),o=this,function t(n,e,r,i){var a;return i=i||0,Array.isArray(e)?n(e,r[i]):e.data&&0!==e.data.length?(a=e.data.map(function(e){return t(n,e,r,i+1)}),a=n(a,r[i]),x({data:a},e)):e}(function(e,t){if(s.facetOrdering){t=t;a=(a=o).renderingContent&&a.renderingContent.facetOrdering&&a.renderingContent.facetOrdering.values&&a.renderingContent.facetOrdering.values[t];if(Boolean(a))return t=e,n=[],r=[],i=((a=a).order||[]).reduce(function(e,t,n){return e[t]=n,e},{}),t.forEach(function(e){var t=e.path||e.name;void 0!==i[t]?n[i[t]]=e:r.push(e)}),n=n.filter(function(e){return e}),"hidden"===(t=a.sortRemainingBy)?n:n.concat(ke(r,(a="alpha"===t?[["path","name"],["asc","asc"]]:[["count"],["desc"]])[0],a[1]))}var n,r,i,a;if(Array.isArray(s.sortBy))return t=He(s.sortBy,F.DEFAULT_SORT),ke(e,t[0],t[1]);if("function"==typeof s.sortBy)return a=s.sortBy,e.sort(a);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},c,Array.isArray(c)?[e]:o._state.getHierarchicalFacetByName(c.name).attributes)},F.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?Ue(this.facets,e):this._state.isDisjunctiveFacet(e)?Ue(this.disjunctiveFacets,e):void 0},F.prototype.getRefinements=function(){var s=this._state,o=this,c=[];return Object.keys(s.facetsRefinements).forEach(function(t){s.facetsRefinements[t].forEach(function(e){c.push(We(0,"facet",t,e,o.facets))})}),Object.keys(s.facetsExcludes).forEach(function(t){s.facetsExcludes[t].forEach(function(e){c.push(We(0,"exclude",t,e,o.facets))})}),Object.keys(s.disjunctiveFacetsRefinements).forEach(function(t){s.disjunctiveFacetsRefinements[t].forEach(function(e){c.push(We(0,"disjunctive",t,e,o.disjunctiveFacets))})}),Object.keys(s.hierarchicalFacetsRefinements).forEach(function(a){s.hierarchicalFacetsRefinements[a].forEach(function(e){var t,n,r,i;c.push((t=s,n=a,e=e,r=o.hierarchicalFacets,i=t.getHierarchicalFacetByName(n),t=t._getHierarchicalFacetSeparator(i),i=e.split(t),e=y(r,function(e){return e.name===n}),t=i.reduce(function(e,t){var n=e&&y(e.data,function(e){return e.name===t});return void 0!==n?n:e},e),r=t&&t.count||0,i=t&&t.exhaustive||!1,e=t&&t.path||"",{type:"hierarchical",attributeName:n,name:e,count:r,exhaustive:i}))})}),Object.keys(s.numericRefinements).forEach(function(n){var e=s.numericRefinements[n];Object.keys(e).forEach(function(t){e[t].forEach(function(e){c.push({type:"numeric",attributeName:n,name:e,numericValue:e,operator:t})})})}),s.tagRefinements.forEach(function(e){c.push({type:"tag",attributeName:"_tags",name:e})}),c};var ze=F;function P(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}b=P;function C(e){return"function"==typeof e}function Je(e){return"object"==typeof e&&null!==e}function Ye(e){return void 0===e}P.prototype._events=void 0,P.prototype._maxListeners=void 0,P.defaultMaxListeners=10,P.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},P.prototype.emit=function(e){var t,n,r,i,a,s,o;if((this._events||(this._events={}),"error"===e)&&(!this._events.error||Je(this._events.error)&&!this._events.error.length))throw(o=arguments[1])instanceof Error?o:((s=new Error('Uncaught, unspecified "error" event. ('+o+")")).context=o,s);if(Ye(t=this._events[e]))return!1;if(C(t))switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:r=Array.prototype.slice.call(arguments,1),t.apply(this,r)}else if(Je(t))for(r=Array.prototype.slice.call(arguments,1),n=(a=t.slice()).length,i=0;i<n;i++)a[i].apply(this,r);return!0},P.prototype.on=P.prototype.addListener=function(e,t){if(C(t))return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,C(t.listener)?t.listener:t),this._events[e]?Je(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Je(this._events[e])&&!this._events[e].warned&&(t=Ye(this._maxListeners)?P.defaultMaxListeners:this._maxListeners)&&0<t&&this._events[e].length>t&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace)&&console.trace(),this;throw TypeError("listener must be a function")},P.prototype.once=function(e,t){var n;if(C(t))return n=!1,r.listener=t,this.on(e,r),this;throw TypeError("listener must be a function");function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}},P.prototype.removeListener=function(e,t){var n,r,i,a;if(!C(t))throw TypeError("listener must be a function");if(this._events&&this._events[e])if(i=(n=this._events[e]).length,r=-1,n===t||C(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Je(n)){for(a=i;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},P.prototype.removeAllListeners=function(e){var t,n;if(this._events)if(this._events.removeListener)if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);this.removeAllListeners("removeListener"),this._events={}}else{if(C(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);delete this._events[e]}else 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e];return this},P.prototype.listeners=function(e){e=this._events&&this._events[e]?C(this._events[e])?[this._events[e]]:this._events[e].slice():[];return e},P.prototype.listenerCount=function(e){if(this._events){e=this._events[e];if(C(e))return 1;if(e)return e.length}return 0},P.listenerCount=function(e,t){return e.listenerCount(t)};var S=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};function Ge(e,t){this.main=e,this.fn=t,this.lastResults=null}S(Ge,b),Ge.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},Ge.prototype.getModifiedState=function(e){return this.fn(e)};var Ke=Ge;function Xe(n){return Object.keys(n).sort(function(e,t){return e.localeCompare(t)}).reduce(function(e,t){return e[t]=n[t],e},{})}var V={_getQueries:function(o,c){var u=[];return u.push({indexName:o,params:V._getHitsSearchParams(c)}),c.getRefinedDisjunctiveFacets().forEach(function(e){u.push({indexName:o,params:V._getDisjunctiveFacetSearchParams(c,e)})}),c.getRefinedHierarchicalFacets().forEach(function(e){var a,s=c.getHierarchicalFacetByName(e),e=c.getHierarchicalRefinement(e),r=c._getHierarchicalFacetSeparator(s);0<e.length&&1<e[0].split(r).length&&(a=e[0].split(r).slice(0,-1).reduce(function(e,t,n){return e.concat({attribute:s.attributes[n],value:0===n?t:[e[e.length-1].value,t].join(r)})},[])).forEach(function(e,t){e=V._getDisjunctiveFacetSearchParams(c,e.attribute,0===t);function r(t){return s.attributes.some(function(e){return e===t.split(":")[0]})}var n=(e.facetFilters||[]).reduce(function(e,t){var n;return Array.isArray(t)&&0<(n=t.filter(function(e){return!r(e)})).length&&e.push(n),"string"!=typeof t||r(t)||e.push(t),e},[]),i=a[t-1];e.facetFilters=0<t?n.concat(i.attribute+":"+i.value):0<n.length?n:void 0,u.push({indexName:o,params:e})})}),u},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(V._getHitsHierarchicalFacetsAttributes(e)),n=V._getFacetFilters(e),r=V._getNumericFilters(e),i=V._getTagFilters(e),t={facets:-1<t.indexOf("*")?["*"]:t,tagFilters:i};return 0<n.length&&(t.facetFilters=n),0<r.length&&(t.numericFilters=r),Xe(v({},e.getQueryParams(),t))},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=V._getFacetFilters(e,t,n),i=V._getNumericFilters(e,t),a=V._getTagFilters(e),s={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1},a=(0<a.length&&(s.tagFilters=a),e.getHierarchicalFacetByName(t));return s.facets=a?V._getDisjunctiveHierarchicalFacetAttribute(e,a,n):t,0<i.length&&(s.numericFilters=i),0<r.length&&(s.facetFilters=r),Xe(v({},e.getQueryParams(),s))},_getNumericFilters:function(e,i){var a;return e.numericFilters||(a=[],Object.keys(e.numericRefinements).forEach(function(r){var t=e.numericRefinements[r]||{};Object.keys(t).forEach(function(n){var e=t[n]||[];i!==r&&e.forEach(function(e){var t;Array.isArray(e)?(t=e.map(function(e){return r+n+e}),a.push(t)):a.push(r+n+e)})})}),a)},_getTagFilters:function(e){return e.tagFilters||e.tagRefinements.join(",")},_getFacetFilters:function(s,o,c){var u=[],e=s.facetsRefinements||{},n=(Object.keys(e).forEach(function(t){(e[t]||[]).forEach(function(e){u.push(t+":"+e)})}),s.facetsExcludes||{}),r=(Object.keys(n).forEach(function(t){(n[t]||[]).forEach(function(e){u.push(t+":-"+e)})}),s.disjunctiveFacetsRefinements||{}),l=(Object.keys(r).forEach(function(t){var n,e=r[t]||[];t!==o&&e&&0!==e.length&&(n=[],e.forEach(function(e){n.push(t+":"+e)}),u.push(n))}),s.hierarchicalFacetsRefinements||{});return Object.keys(l).forEach(function(e){var t=(l[e]||[])[0];if(void 0!==t){var n,r=s.getHierarchicalFacetByName(e),i=s._getHierarchicalFacetSeparator(r),a=s._getHierarchicalRootPath(r);if(o===e){if(-1===t.indexOf(i)||!a&&!0===c||a&&a.split(i).length===t.split(i).length)return;t=a?(n=a.split(i).length-1,a):(n=t.split(i).length-2,t.slice(0,t.lastIndexOf(i)))}else n=t.split(i).length-1;(e=r.attributes[n])&&u.push([e+":"+t])}}),u},_getHitsHierarchicalFacetsAttributes:function(i){return i.hierarchicalFacets.reduce(function(e,t){var n,r=i.getHierarchicalRefinement(t.name)[0];return r?(n=i._getHierarchicalFacetSeparator(t),r=r.split(n).length,n=t.attributes.slice(0,r+1),e.concat(n)):(e.push(t.attributes[0]),e)},[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r,i=e._getHierarchicalFacetSeparator(t);return!0===n?(n=0,(r=e._getHierarchicalRootPath(t))&&(n=r.split(i).length),[t.attributes[n]]):(r=(e.getHierarchicalRefinement(t.name)[0]||"").split(i).length-1,t.attributes.slice(0,1+r))},getSearchForFacetQuery:function(e,t,n,r){r=r.isDisjunctiveFacet(e)?r.clearRefinements(e):r,t={facetQuery:t,facetName:e};return"number"==typeof n&&(t.maxFacetHits=n),Xe(v({},V._getHitsSearchParams(r),t))}},w=V,j="3.11.2",Ze=R;function E(e,t,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.2)"),this.setClient(e);e=n||{};e.index=t,this.state=Ae.make(e),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function et(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function tt(){return this.state.page}S(E,b),E.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},E.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},E.prototype.getQuery=function(){var e=this.state;return w._getHitsSearchParams(e)},E.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,e=w._getQueries(n.index,n),r=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(e).then(function(e){return r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),{content:new ze(n,e.results),state:n,_originalResponse:e}},function(e){throw r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),e});this.client.search(e).then(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(null,new ze(n,e.results),n)}).catch(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(e,null,n)})},E.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,n=this.derivedHelpers[0];if(!n)return Promise.resolve([]);var n=n.getModifiedState(t),t=v({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:_e(w._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),r="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(r);var i=this.client.initIndex(n.index);if("function"!=typeof i.findAnswers)throw new Error(r);return i.findAnswers(n.query,e.queryLanguages,t)},E.prototype.searchForFacetValues=function(t,e,n,r){var i,a,s,o="function"==typeof this.client.searchForFacetValues,c="function"==typeof this.client.initIndex;if(o||c||"function"==typeof this.client.search)return i=this.state.setQueryParameters(r||{}),a=i.isDisjunctiveFacet(t),r=w.getSearchForFacetQuery(t,e,n,i),this._currentNbQueries++,s=this,n=o?this.client.searchForFacetValues([{indexName:i.index,params:r}]):c?this.client.initIndex(i.index).searchForFacetValues(r):(delete r.facetName,this.client.search([{type:"facet",facet:t,indexName:i.index,params:r}]).then(function(e){return e.results[0]})),this.emit("searchForFacetValues",{state:i,facet:t,query:e}),n.then(function(e){return s._currentNbQueries--,0===s._currentNbQueries&&s.emit("searchQueueEmpty"),(e=Array.isArray(e)?e[0]:e).facetHits.forEach(function(e){e.escapedValue=Ze(e.value),e.isRefined=a?i.isDisjunctiveFacetRefined(t,e.escapedValue):i.isFacetRefined(t,e.escapedValue)}),e},function(e){throw s._currentNbQueries--,0===s._currentNbQueries&&s.emit("searchQueueEmpty"),e});throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues")},E.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},E.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},E.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},E.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},E.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},E.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},E.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},E.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},E.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},E.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},E.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},E.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},E.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},E.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},E.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},E.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},E.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},E.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},E.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},E.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},E.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},E.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},E.prototype.setCurrentPage=et,E.prototype.setPage=et,E.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},E.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},E.prototype.setState=function(e){return this._change({state:Ae.make(e),isPageReset:!1}),this},E.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new Ae(e),this},E.prototype.hasRefinements=function(e){return!!Oe(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},E.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},E.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},E.prototype.hasTag=function(e){return this.state.isTagRefined(e)},E.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},E.prototype.getIndex=function(){return this.state.index},E.prototype.getCurrentPage=tt,E.prototype.getPage=tt,E.prototype.getTags=function(){return this.state.tagRefinements},E.prototype.getRefinements=function(e){var n=[],r=(this.state.isConjunctiveFacet(e)?(this.state.getConjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"conjunctive"})}),this.state.getExcludeRefinements(e).forEach(function(e){n.push({value:e,type:"exclude"})})):this.state.isDisjunctiveFacet(e)&&this.state.getDisjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"disjunctive"})}),this.state.getNumericRefinements(e));return Object.keys(r).forEach(function(e){var t=r[e];n.push({value:t,operator:e,type:"numeric"})}),n},E.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},E.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},E.prototype._search=function(e){var r=this.state,i=[],t=[],e=(e.onlyWithDerivedHelpers||(t=w._getQueries(r.index,r),i.push({state:r,queriesCount:t.length,helper:this}),this.emit("search",{state:r,results:this.lastResults})),this.derivedHelpers.map(function(e){var t=e.getModifiedState(r),n=w._getQueries(t.index,t);return i.push({state:t,queriesCount:n.length,helper:e}),e.emit("search",{state:t,results:e.lastResults}),n})),t=Array.prototype.concat.apply(t,e),e=this._queryId++;this._currentNbQueries++;try{this.client.search(t).then(this._dispatchAlgoliaResponse.bind(this,i,e)).catch(this._dispatchAlgoliaError.bind(this,e))}catch(e){this.emit("error",{error:e})}},E.prototype._dispatchAlgoliaResponse=function(e,t,n){var r;t<this._lastQueryIdReceived||(this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty"),r=n.results.slice(),e.forEach(function(e){var t=e.state,n=e.queriesCount,e=e.helper,n=r.splice(0,n),n=e.lastResults=new ze(t,n);e.emit("result",{results:n,state:t})}))},E.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},E.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},E.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&0<this.state.disjunctiveRefinements[e].length},E.prototype._change=function(e){var t=e.state,e=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:e}))},E.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},E.prototype.setClient=function(e){return this.client!==e&&("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.2)"),this.client=e),this},E.prototype.getClient=function(){return this.client},E.prototype.derive=function(e){e=new Ke(this,e);return this.derivedHelpers.push(e),e},E.prototype.detachDerivedHelper=function(e){e=this.derivedHelpers.indexOf(e);if(-1===e)throw new Error("Derived helper already detached");this.derivedHelpers.splice(e,1)},E.prototype.hasPendingRequests=function(){return 0<this._currentNbQueries};var nt=E;function rt(e,t,n){return new nt(e,t,n)}rt.version=j,rt.AlgoliaSearchHelper=nt,rt.SearchParameters=Ae,rt.SearchResults=ze;var A=rt;function it(e){var t=e.attributeName,n=e.attributeValue,e=e.attributeScore;return"".concat(t,":").concat(n,"<score=").concat(e||1,">")}function at(){return"configure"}function st(a){var e=Object.keys(a.matchingPatterns).reduce(function(e,t){var n=a.matchingPatterns[t],r=ue(a.hit,t),i=n.score;return Array.isArray(r)?[].concat(m(e),[r.map(function(e){return it({attributeName:t,attributeValue:e,attributeScore:i})})]):"string"==typeof r?[].concat(m(e),[it({attributeName:t,attributeValue:r,attributeScore:i})]):e},[]);return a.transformSearchParameters(new A.SearchParameters({sumOrFiltersScores:!0,facetFilters:["objectID:-".concat(a.hit.objectID)],optionalFilters:e}))}R=t({displayName:"AlgoliaConfigureRelatedItems",$$type:"ais.configureRelatedItems",defaultProps:{transformSearchParameters:function(e){return I({},e)}},getProvidedProps:function(){return{}},getSearchParameters:function(e,t){return e.setQueryParameters(st(t))},transitionState:function(e,t,n){var r,i=at(),a=(r=ie(st(e)),Object.keys(r).forEach(function(e){var t=r[e];Array.isArray(t)&&0===t.length&&delete r[e]}),r),s=Object.keys(a),o=this._searchParameters?Object.keys(this._searchParameters).filter(function(e){return-1===s.indexOf(e)}):[];return this._searchParameters=a,g(n,_({},i,I(I({},l(n[i],o)),a)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){var n=this,r=at(),i=h({ais:e.contextValue,multiIndexContext:e.indexContextValue}),a=d({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&t.indices?t.indices[i]:t,i=(a&&a[r]?Object.keys(a[r]):[]).reduce(function(e,t){return n._searchParameters[t]||(e[t]=a[r][t]),e},{});return g(t,_({},r,i),{ais:e.contextValue,multiIndexContext:e.indexContextValue})}}),S=("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).performance||{};S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow;function ot(e,t){return e(t={exports:{}},t.exports),t.exports}var b="function"==typeof Symbol&&Symbol.for,ct=b?Symbol.for("react.element"):60103,ut=b?Symbol.for("react.portal"):60106,lt=b?Symbol.for("react.fragment"):60107,ft=b?Symbol.for("react.strict_mode"):60108,ht=b?Symbol.for("react.profiler"):60114,dt=b?Symbol.for("react.provider"):60109,mt=b?Symbol.for("react.context"):60110,pt=b?Symbol.for("react.async_mode"):60111,gt=b?Symbol.for("react.concurrent_mode"):60111,xt=b?Symbol.for("react.forward_ref"):60112,vt=b?Symbol.for("react.suspense"):60113,yt=b?Symbol.for("react.suspense_list"):60120,Rt=b?Symbol.for("react.memo"):60115,bt=b?Symbol.for("react.lazy"):60116,Ft=b?Symbol.for("react.block"):60121,Pt=b?Symbol.for("react.fundamental"):60117,Ct=b?Symbol.for("react.responder"):60118,St=b?Symbol.for("react.scope"):60119;function N(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ct:switch(e=e.type){case pt:case gt:case lt:case ht:case ft:case vt:return e;default:switch(e=e&&e.$$typeof){case mt:case xt:case bt:case Rt:case dt:return e;default:return t}}case ut:return t}}}function Vt(e){return N(e)===gt}var wt={AsyncMode:pt,ConcurrentMode:gt,ContextConsumer:mt,ContextProvider:dt,Element:ct,ForwardRef:xt,Fragment:lt,Lazy:bt,Memo:Rt,Portal:ut,Profiler:ht,StrictMode:ft,Suspense:vt,isAsyncMode:function(e){return Vt(e)||N(e)===pt},isConcurrentMode:Vt,isContextConsumer:function(e){return N(e)===mt},isContextProvider:function(e){return N(e)===dt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ct},isForwardRef:function(e){return N(e)===xt},isFragment:function(e){return N(e)===lt},isLazy:function(e){return N(e)===bt},isMemo:function(e){return N(e)===Rt},isPortal:function(e){return N(e)===ut},isProfiler:function(e){return N(e)===ht},isStrictMode:function(e){return N(e)===ft},isSuspense:function(e){return N(e)===vt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===lt||e===gt||e===ht||e===ft||e===vt||e===yt||"object"==typeof e&&null!==e&&(e.$$typeof===bt||e.$$typeof===Rt||e.$$typeof===dt||e.$$typeof===mt||e.$$typeof===xt||e.$$typeof===Pt||e.$$typeof===Ct||e.$$typeof===St||e.$$typeof===Ft)},typeOf:N},j=ot(function(e,t){});j.AsyncMode,j.ConcurrentMode,j.ContextConsumer,j.ContextProvider,j.Element,j.ForwardRef,j.Fragment,j.Lazy,j.Memo,j.Portal,j.Profiler,j.StrictMode,j.Suspense,j.isAsyncMode,j.isConcurrentMode,j.isContextConsumer,j.isContextProvider,j.isElement,j.isForwardRef,j.isFragment,j.isLazy,j.isMemo,j.isPortal,j.isProfiler,j.isStrictMode,j.isSuspense,j.isValidElementType,j.typeOf,ot(function(e){e.exports=wt});function jt(){}function It(){}It.resetWarningCache=jt;S=ot(function(e){function t(e,t,n,r,i,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a)throw(a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")).name="Invariant Violation",a}function n(){return t}e.exports=(e={array:t.isRequired=t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:It,resetWarningCache:jt}).PropTypes=e});function _t(){return null}_t.propTypes={hit:S.object.isRequired,matchingPatterns:S.object.isRequired,transformSearchParameters:S.func};b=R(_t,{$$widgetType:"ais.configureRelatedItems"}),j=t({displayName:"AlgoliaDynamicWidgets",$$type:"ais.dynamicWidgets",defaultProps:{transformItems:function(e){return e},maxValuesPerFacet:20},propTypes:{transformItems:S.func,facets:S.arrayOf(S.string),maxValuesPerFacet:S.number},getProvidedProps:function(e,t,n){var r,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!e.facets||Array.isArray(e.facets)&&e.facets.length<=1&&("*"===e.facets[0]||void 0===e.facets[0]))return n?(r=n.renderingContent&&n.renderingContent.facetOrdering&&n.renderingContent.facetOrdering.facets&&n.renderingContent.facetOrdering.facets.order||[],20<(r=e.transformItems(r,{results:n})).length&&!e.facets&&console.warn("More than ".concat(20," facets are requested to be displayed without explicitly setting which facets to retrieve. This could have a performance impact. Set \"facets\" to [] to do two smaller network requests, or explicitly to ['*'] to avoid this warning.")),e.maxValuesPerFacet<n._state.maxValuesPerFacet&&console.warn("The maxValuesPerFacet set by dynamic widgets (".concat(e.maxValuesPerFacet,") is smaller than one of the limits set by a widget (").concat(n._state.maxValuesPerFacet,"). This causes a mismatch in query parameters and thus an extra network request when that widget is mounted.")),{attributesToRender:r}):{attributesToRender:[]};throw new Error('The `facets` prop only accepts [] or ["*"], you passed '.concat(JSON.stringify(e.facets)))},getSearchParameters:function(e,t){return(t.facets||["*"]).reduce(function(e,t){return e.addFacet(t)},e.setQueryParameters({maxValuesPerFacet:Math.max(t.maxValuesPerFacet||0,e.maxValuesPerFacet||0)}))}});function Ot(e){var t;if("object"===s(t=e)&&t.props)return e.props.attribute||(Array.isArray(e.props.attributes)?e.props.attributes[0]:e.props.children?Ot(o.Children.only(e.props.children)):void 0)}var Et=j(function(e){var t=e.children,n=e.attributesToRender,r=void 0===(e=e.fallbackComponent)?function(){return null}:e,i=new Map;return o.Children.forEach(t,function(e){var t=Ot(e);if(!t)throw new Error('Could not find "attribute" prop for '.concat(ne(e),"."));i.set(t,e)}),o.createElement(o.Fragment,null,n.map(function(e){return o.createElement(a.Fragment,{key:e},i.get(e)||o.createElement(r,{attribute:e}))}))},{$$widgetType:"ais.dynamicWidgets"});function At(r,e){var i=1<arguments.length&&void 0!==e?e:{};return Object.keys(i).filter(function(e){return void 0!==i[e]&&void 0!==i[e][r]}).map(function(e){var t=r,n=i[e];switch(e){case"range":return Object.keys(n[t]).map(function(e){return n[t][e]});case"refinementList":return n[t];case"hierarchicalMenu":case"menu":return[n[t]];case"multiRange":return n[t].split(":");case"toggle":return[n[t]];default:return[]}}).reduce(function(e,t){return e.concat(t)},[])}var Nt=t({displayName:"AlgoliaQueryRules",$$type:"ais.queryRules",defaultProps:{transformItems:function(e){return e},transformRuleContexts:function(e){return e},trackedFilters:{}},getProvidedProps:function(e,t,n){var n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return null===n?{items:[],canRefine:!1}:(n=n.userData,{items:e=(0,e.transformItems)(void 0===n?[]:n),canRefine:0<e.length})},getSearchParameters:function(e,t,n){var i,a,r;return 0===Object.keys(t.trackedFilters).length?e:(n=d({ais:t.contextValue,multiIndexContext:t.indexContextValue})&&n.indices?n.indices[h({ais:t.contextValue,multiIndexContext:t.indexContextValue})]:n,n={searchState:n,trackedFilters:t.trackedFilters},i=n.searchState,a=n.trackedFilters,n=Object.keys(a).reduce(function(e,t){var n=At(t,i),r=(0,a[t])(n);return[].concat(m(e),m(n.filter(function(e){return r.includes(e)}).map(function(e){return"ais-".concat(t,"-").concat(e).replace(/[^a-z0-9-_]+/gi,"_")})))},[]),r=e.ruleContexts||[],r=[].concat(m(r),m(n)),n=t.transformRuleContexts(r).slice(0,10),e.setQueryParameter("ruleContexts",n))}}),Tt=Nt(function(){return null},{$$widgetType:"ais.queryRuleContext"});function Ht(e){return{targetedIndex:e.indexId}}var kt=function(){Q(n,a.Component);var t=q(n);function n(e){return k(this,n),_(c(e=t.call(this,e)),"state",{indexContext:Ht(e.props)}),_(c(e),"unregisterWidget",void 0),e.props.contextValue.onSearchParameters(e.getSearchParameters.bind(c(e)),{ais:e.props.contextValue,multiIndexContext:e.state.indexContext},e.props,void 0,n.displayName),e}return $(n,[{key:"componentDidMount",value:function(){this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this)}},{key:"componentDidUpdate",value:function(e){this.props.indexName!==e.indexName&&this.props.contextValue.widgetsManager.update()}},{key:"componentWillUnmount",value:function(){"function"==typeof this.unregisterWidget&&this.unregisterWidget()}},{key:"getSearchParameters",value:function(e,t){return e.setIndex((this.props||t).indexName)}},{key:"render",value:function(){return 0===a.Children.count(this.props.children)?null:o.createElement(ge,{value:this.state.indexContext},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e){return{indexContext:Ht(e)}}}]),n}();_(kt,"displayName","AlgoliaIndex"),_(kt,"$$type","ais.index"),_(kt,"$$widgetType","ais.index");var Mt=["resultsFacetValues"],$t=["resultsFacetValues"],Dt=["resultsFacetValues"];function Qt(e){"function"==typeof e.addAlgoliaAgent&&(e.addAlgoliaAgent("react (".concat(a.version,")")),e.addAlgoliaAgent("react-instantsearch (".concat(Re,")")))}var Bt=function(e){return d({ais:e.props.contextValue,multiIndexContext:e.props.indexContextValue})},Lt=function(e,t){return e.props.indexContextValue.targetedIndex===t},qt=function(e){return Boolean(e.props.indexId)},Ut=function(e,t){return e.props.indexId===t},Wt=function(e,t){e=qt(e),t=qt(t);return e&&!t?-1:!e&&t?1:0};function zt(n){return Object.keys(n).map(function(e){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0;return e.replace(/%s/g,function(){return encodeURIComponent(n[i++])})}("%s=%s",e,(t=n[e],"[object Object]"===Object.prototype.toString.call(t)||"[object Array]"===Object.prototype.toString.call(t)?JSON.stringify(n[e]):n[e]));var t}).join("&")}function Jt(e){var i,t,n,r,a,s,o,c,u,l=e.indexName,f=e.initialState,f=void 0===f?{}:f,h=e.searchClient,d=e.resultsState,m=e.stalledSearchDelay,p=A(h,l,I({},ve)),g=(Qt(h),p.on("search",function(){x=x||setTimeout(function(){var e=P.getState(),e=(e.resultsFacetValues,O(e,Dt));P.setState(I(I({},e),{},{isSearchStalled:!0}))},m)}).on("result",w({indexId:l})).on("error",j),!1),x=null,v=p.state,y=(t=function(){var e=C(P.getState().widgets);P.setState(I(I({},P.getState()),{},{metadata:e,searching:!0})),V()},r=!(n=[]),{registerWidget:function(e){return n.push(e),R(),function(){n.splice(n.indexOf(e),1),R()}},update:R,getWidgets:function(){return n}});function R(){r||(r=!0,Z(function(){r=!1,t()}))}a=h,(e=d)&&(a.transporter&&!a._cacheHydrated||a._useCache&&"function"==typeof a.addAlgoliaAgent)&&(a.transporter&&!a._cacheHydrated&&(a._cacheHydrated=!0,s=a.search,a.search=function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=e.map(function(e){return I(I({},e),{},{params:zt(e.params)})});return a.transporter.responsesCache.get({method:"search",args:[i].concat(n)},function(){return s.apply(void 0,[e].concat(n))})}),Array.isArray(e.results)?(u=a,o=e.results,u.transporter?u.transporter.responsesCache.set({method:"search",args:[o.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])]},{results:o.reduce(function(e,t){return e.concat(t.rawResults)},[])}):(c="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:o.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])})),u.cache=I(I({},u.cache),{},_({},c,JSON.stringify({results:o.reduce(function(e,t){return e.concat(t.rawResults)},[])}))))):(u=e,(c=a).transporter?c.transporter.responsesCache.set({method:"search",args:[u.rawResults.map(function(e){return{indexName:e.index,params:e.params}})]},{results:u.rawResults}):(o="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:u.rawResults.map(function(e){return{indexName:e.index,params:e.params}})})),c.cache=I(I({},c.cache),{},_({},o,JSON.stringify({results:u.rawResults}))))));e={widgets:f,metadata:(h=d)?h.metadata.map(function(e){return I(I({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return I(I({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return I({value:function(){return{}}},e)})})})})}):[],results:function(e){if(!e)return null;if(Array.isArray(e.results))return e.results.reduce(function(e,t){return I(I({},e),{},_({},t._internalIndexId,new A.SearchResults(new A.SearchParameters(t.state),t.rawResults)))},{});return new A.SearchResults(new A.SearchParameters(e.state),e.rawResults)}(d),error:null,searching:!1,isSearchStalled:!0,searchingForFacetValues:!1},b=e,F=[];var b,F,P={getState:function(){return b},setState:function(e){b=e,F.forEach(function(e){return e()})},subscribe:function(e){return F.push(e),function(){F.splice(F.indexOf(e),1)}}};function C(t){return y.getWidgets().filter(function(e){return Boolean(e.getMetadata)}).map(function(e){return e.getMetadata(t)})}function S(){var t=y.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){return!Bt(e)&&!qt(e)}).reduce(function(e,t){return t.getSearchParameters(e)},v),e=y.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=Bt(e)&&Lt(e,l),e=qt(e)&&Ut(e,l);return t||e}).sort(Wt).reduce(function(e,t){return t.getSearchParameters(e)},t),n=y.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=Bt(e)&&!Lt(e,l),e=qt(e)&&!Ut(e,l);return t||e}).sort(Wt).reduce(function(e,t){var n=Bt(t)?t.props.indexContextValue.targetedIndex:t.props.indexId,r=e[n]||[];return I(I({},e),{},_({},n,r.concat(t)))},{});return{mainParameters:e,derivedParameters:Object.keys(n).map(function(e){return{parameters:n[e].reduce(function(e,t){return t.getSearchParameters(e)},t),indexId:e}})}}function V(){var e,t;g||(e=(t=S()).mainParameters,t=t.derivedParameters,i=t.length+1,p.derivedHelpers.slice().forEach(function(e){e.detach()}),t.forEach(function(e){var t=e.indexId,n=e.parameters;p.derive(function(){return n}).on("result",w({indexId:t})).on("error",j)}),p.setState(e),p.search())}function w(e){var r=e.indexId;return function(e){i--;var t=P.getState(),n=!p.derivedHelpers.length,t=t.results||{},t=!n&&t.getFacetByName?{}:t,n=(t=n?e.results:I(I({},t),{},_({},r,e.results)),P.getState()),e=n.isSearchStalled,n=(p.hasPendingRequests()||(clearTimeout(x),x=null,e=!1),n.resultsFacetValues,O(n,Mt));P.setState(I(I({},n),{},{results:t,isSearchStalled:e,searching:0<i,error:null}))}}function j(e){var e=e.error,t=P.getState(),n=t.isSearchStalled,t=(p.hasPendingRequests()||(clearTimeout(x),n=!1),t.resultsFacetValues,O(t,$t));P.setState(I(I({},t),{},{isSearchStalled:n,error:e,searching:!1}))}return{store:P,widgetsManager:y,getWidgetsIds:function(){return P.getState().metadata.reduce(function(e,t){return void 0!==t.id?e.concat(t.id):e},[])},getSearchParameters:S,onSearchForFacetValues:function(e){var n=e.facetName,r=e.query,e=e.maxFacetHits,e=Math.max(1,Math.min(void 0===e?10:e,100));P.setState(I(I({},P.getState()),{},{searchingForFacetValues:!0})),p.searchForFacetValues(n,r,e).then(function(e){var t;P.setState(I(I({},P.getState()),{},{error:null,searchingForFacetValues:!1,resultsFacetValues:I(I({},P.getState().resultsFacetValues),{},(_(t={},n,e.facetHits),_(t,"query",r),t))}))},function(e){P.setState(I(I({},P.getState()),{},{searchingForFacetValues:!1,error:e}))}).catch(function(e){setTimeout(function(){throw e})})},onExternalStateUpdate:function(e){var t=C(e);P.setState(I(I({},P.getState()),{},{widgets:e,metadata:t,searching:!0})),V()},transitionState:function(e){var n=P.getState().widgets;return y.getWidgets().filter(function(e){return Boolean(e.transitionState)}).reduce(function(e,t){return t.transitionState(n,e)},e)},updateClient:function(e){Qt(e),p.setClient(e),V()},updateIndex:function(e){v=v.setIndex(e)},clearCache:function(){p.clearCache(),V()},skipSearch:function(){g=!0}}}function Yt(e,t){var a,n=document.createElement("meta"),r=document.querySelector("head"),t=(n.name="algolia:metadata",t=t,a=["contextValue","indexContextValue"],e=(e=e).map(function(e){var t=e.props,e=e.constructor,n=e._connectorDesc||{},r=n.defaultProps,i=void 0===r?{}:r,r=n.displayName;return{displayName:void 0===r?e.displayName:r,$$type:e.$$type,$$widgetType:e.$$widgetType,params:Object.keys(t).filter(function(e){return!a.includes(e)&&i[e]!==t[e]&&void 0!==t[e]})}}),{ua:t.transporter&&t.transporter.userAgent?t.transporter.userAgent.value:t._ua,widgets:e});n.content=JSON.stringify(t),r.appendChild(n)}function Gt(e){return Boolean(e.searchState)}function Kt(){return"query"}var Xt=function(){Q(i,a.Component);var r=q(i);function i(e){k(this,i),_(c(e=r.call(this,e)),"cleanupTimerRef",null),_(c(e),"isUnmounting",!1);var t=Jt({indexName:e.props.indexName,searchClient:e.props.searchClient,initialState:e.props.searchState||{},resultsState:e.props.resultsState,stalledSearchDelay:e.props.stalledSearchDelay}),n={store:t.store,widgetsManager:t.widgetsManager,mainTargetedIndex:e.props.indexName,onInternalStateUpdate:e.onWidgetsInternalStateUpdate.bind(c(e)),createHrefForState:e.createHrefForState.bind(c(e)),onSearchForFacetValues:e.onSearchForFacetValues.bind(c(e)),onSearchStateChange:e.onSearchStateChange.bind(c(e)),onSearchParameters:e.onSearchParameters.bind(c(e))};return e.state={isControlled:Gt(e.props),instantSearchManager:t,contextValue:n},e}return $(i,[{key:"componentDidUpdate",value:function(e){var t=Gt(e);if(t&&!this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled");if(!t&&this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled");this.props.refresh!==e.refresh&&this.props.refresh&&this.state.instantSearchManager.clearCache(),e.indexName!==this.props.indexName&&this.state.instantSearchManager.updateIndex(this.props.indexName),e.searchClient!==this.props.searchClient&&this.state.instantSearchManager.updateClient(this.props.searchClient)}},{key:"componentDidMount",value:function(){this.cleanupTimerRef&&(clearTimeout(this.cleanupTimerRef),this.cleanupTimerRef=null),"object"===("undefined"==typeof window?"undefined":s(window))&&"object"===s(window.navigator)&&"string"==typeof window.navigator.userAgent&&window.navigator.userAgent.includes("Algolia Crawler")&&"object"===s(window.document)&&Yt(this.state.instantSearchManager.widgetsManager.getWidgets(),this.props.searchClient)}},{key:"componentWillUnmount",value:function(){var e=this;this.cleanupTimerRef=setTimeout(function(){e.isUnmounting=!0,e.state.instantSearchManager.skipSearch()})}},{key:"createHrefForState",value:function(e){return e=this.state.instantSearchManager.transitionState(e),this.state.isControlled&&this.props.createURL?this.props.createURL(e,this.getKnownKeys()):"#"}},{key:"onWidgetsInternalStateUpdate",value:function(e){e=this.state.instantSearchManager.transitionState(e),this.onSearchStateChange(e),this.state.isControlled||this.state.instantSearchManager.onExternalStateUpdate(e)}},{key:"onSearchStateChange",value:function(e){this.props.onSearchStateChange&&!this.isUnmounting&&this.props.onSearchStateChange(e)}},{key:"onSearchParameters",value:function(e,t,n,r,i){var a;this.props.onSearchParameters&&(a=this.props.searchState||{},this.props.onSearchParameters(e,t,n,a)),this.props.widgetsCollector&&(a=this.props.searchState||{},this.props.widgetsCollector({getSearchParameters:e,getMetadata:r,context:t,props:n,searchState:a,displayName:i}))}},{key:"onSearchForFacetValues",value:function(e){this.state.instantSearchManager.onSearchForFacetValues(e)}},{key:"getKnownKeys",value:function(){return this.state.instantSearchManager.getWidgetsIds()}},{key:"render",value:function(){return 0===a.Children.count(this.props.children)?null:o.createElement(de,{value:this.state.contextValue},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=Gt(e),r=t.instantSearchManager.store.getState().widgets,i=e.searchState;return n&&!ee(r,i)&&t.instantSearchManager.onExternalStateUpdate(e.searchState),{isControlled:n,contextValue:I(I({},t.contextValue),{},{mainTargetedIndex:e.indexName})}}}]),i}();_(Xt,"defaultProps",{stalledSearchDelay:200,refresh:!1});function Zt(e,t,n){Kt();e=u(e,t,n,"query","");return e||""}function en(e){return e.attributes[0]}var tn=t({displayName:"AlgoliaAutoComplete",$$type:"ais.autoComplete",getProvidedProps:function(e,t,n){return{hits:(r=n).results?r.results.hits&&Array.isArray(r.results.hits)?ae(se(r.results.hits,r.results.queryID),r.results.hitsPerPage,r.results.page):Object.keys(r.results).reduce(function(e,t){return[].concat(m(e),[{index:t,hits:ae(se(r.results[t].hits,r.results[t].queryID),r.results[t].hitsPerPage,r.results[t].page)}])},[]):[],currentRefinement:Zt(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue})};var r},refine:function(e,t,n){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},Kt(),g(t,_({},"query",n),e,!0)},cleanUp:function(e,t){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},r(t,e,Kt())},getSearchParameters:function(e,t,n){return e.setQuery(Zt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))}});function nn(){return"boundingBox"}function rn(e){return[e.northEast.lat,e.northEast.lng,e.southWest.lat,e.southWest.lng].join()}function an(e){return e=e.match(hn),{lat:parseFloat(e[1]),lng:parseFloat(e[2])}}function sn(e,t,n){if(ce(e=u(e,t,n,nn(),{})))return{northEast:{lat:parseFloat(e.northEast.lat),lng:parseFloat(e.northEast.lng)},southWest:{lat:parseFloat(e.southWest.lat),lng:parseFloat(e.southWest.lng)}}}function on(e,t,n){return g(e,_({},nn(),t),n,!0)}function cn(e){return e.attributes[0]}var un=t({displayName:"AlgoliaBreadcrumb",$$type:"ais.breadcrumb",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},transformItems:S.func},getProvidedProps:function(e,t,n){var r=en(e),n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return Boolean(n)&&Boolean(n.getFacetByName(r))?(r=(n=n.getFacetValues(r)).data?function n(e){return e.reduce(function(e,t){return e=t.isRefined&&(e.push({label:t.name,value:t.escapedValue}),t.data)?e.concat(n(t.data)):e},[])}(n.data):[],{canRefine:0<(n=e.transformItems?e.transformItems(r):r).length,items:n}):{items:[],canRefine:!1}},refine:function(e,t,n){return r={ais:e.contextValue,multiIndexContext:e.indexContextValue},g(t,_({},en(e),n||""),r,!0,"hierarchicalMenu");var r}}),ln=t({displayName:"AlgoliaCurrentRefinements",$$type:"ais.currentRefinements",propTypes:{transformItems:S.func},getProvidedProps:function(n,e,t,r){r=r.reduce(function(e,t){return void 0===t.items||!n.clearsQuery&&"query"===t.id||n.clearsQuery&&"query"===t.id&&""===t.items[0].currentRefinement?e:e.concat(t.items.map(function(e){return I(I({},e),{},{id:t.id,index:t.index})}))},[]),r=n.transformItems?n.transformItems(r):r;return{items:r,canRefine:0<r.length}},refine:function(e,t,n){return(n instanceof Array?n.map(function(e){return e.value}):[n]).reduce(function(e,t){return t(e)},t)}}),fn=["defaultRefinement"],hn=/^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/,dn=t({displayName:"AlgoliaGeoSearch",$$type:"ais.geoSearch",getProvidedProps:function(e,t,n){var r={ais:e.contextValue,multiIndexContext:e.indexContextValue},n=p(n,r),i=sn(e,t,r),a=n&&n._state.insideBoundingBox&&function(e){e=e.split(",");return{northEast:{lat:parseFloat(e[0]),lng:parseFloat(e[1])},southWest:{lat:parseFloat(e[2]),lng:parseFloat(e[3])}}}(n._state.insideBoundingBox)||void 0,e=(t=t,r=r,(e=e).defaultRefinement,e=O(e,fn),(s=u(e,t,r,"aroundLatLng"))||(s=u(e,t,r,"configure.aroundLatLng"))&&an(s)),t=n&&n._state.aroundLatLng&&an(n._state.aroundLatLng)||void 0,r=i||a,s=e||t;return{hits:n?n.hits.filter(function(e){return Boolean(e._geoloc)}):[],isRefinedWithMap:Boolean(r),currentRefinement:r,position:s}},refine:function(e,t,n){return on(t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},getSearchParameters:function(e,t,n){n=sn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return n?e.setQueryParameter("insideBoundingBox",rn(n)):e},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},nn())},getMetadata:function(e,t){var n=[],r=nn(),i={ais:e.contextValue,multiIndexContext:e.indexContextValue},a=h(i),s={},e=sn(e,t,i);return e&&n.push({label:"".concat(r,": ").concat(rn(e)),value:function(e){return on(e,s,i)},currentRefinement:e}),{id:r,index:a,items:n}},shouldComponentUpdate:function(){return!0}}),mn="hierarchicalMenu";function pn(e,t,n){t=u(e,t,n,"".concat(mn,".").concat(cn(e)),null);return""===t?null:t}function gn(e,c,u,l){return e.map(function(e){return{label:e.name,value:(t=e.escapedValue,r=(n=c).id,i=c.attributes,a=c.separator,s=c.rootPath,o=c.showParentLevel,null===(n=pn(c,u,l))?t:new A.SearchParameters({hierarchicalFacets:[{name:r,attributes:i,separator:a,rootPath:s,showParentLevel:o}]}).toggleHierarchicalFacetRefinement(r,n).toggleHierarchicalFacetRefinement(r,t).getHierarchicalRefinement(r)[0]),count:e.count,isRefined:e.isRefined,items:e.data&&gn(e.data,c,u,l)};var t,n,r,i,a,s,o})}function xn(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e.slice(0,t).map(function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(e.items)?I(I({},e),{},{items:xn(e.items,t)}):e})}function vn(e,t,n,r){return g(t,_({},cn(e),n||""),r,!0,mn)}function yn(e){var t=e.attribute,n=e.hit,r=e.highlightProperty,i=void 0===(i=e.preTag)?ve.highlightPreTag:i,e=e.postTag,t={attribute:t,highlightProperty:r,hit:n,preTag:i,postTag:void 0===e?ve.highlightPostTag:e},a=void 0===(r=t.preTag)?"<em>":r,s=void 0===(r=t.postTag)?"</em>":r,r=t.highlightProperty,n=t.attribute;if(t=t.hit)return t=ue(t[r],n)||{},Array.isArray(t)?t.map(function(e){return ye({preTag:a,postTag:s,highlightedValue:e.value})}):ye({preTag:a,postTag:s,highlightedValue:t.value});throw new Error("`hit`, the matching record, must be provided")}var Rn=["name:asc"],bn=t({displayName:"AlgoliaHierarchicalMenu",$$type:"ais.hierarchicalMenu",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},separator:S.string,rootPath:S.string,showParentLevel:S.bool,defaultRefinement:S.string,showMore:S.bool,limit:S.number,showMoreLimit:S.number,transformItems:S.func,facetOrdering:S.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,separator:" > ",rootPath:null,showParentLevel:!0,facetOrdering:!0},getProvidedProps:function(e,t,n){var r=e.showMore,i=e.limit,a=e.showMoreLimit,s=e.facetOrdering,o=cn(e),n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return Boolean(n)&&Boolean(n.getFacetByName(o))?(r=r?a:i,i=(a=n.getFacetValues(o,{sortBy:Rn,facetOrdering:s})).data?gn(a.data,e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}):[],n=e.transformItems?e.transformItems(i):i,{items:xn(n,r),currentRefinement:pn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:0<n.length}):{items:[],currentRefinement:pn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:!1}},refine:function(e,t,n){return vn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(mn,".").concat(cn(n)));var n},getSearchParameters:function(e,t,n){var r=t.attributes,i=t.separator,a=t.rootPath,s=t.showParentLevel,o=t.showMore,c=t.limit,u=t.showMoreLimit,l=t.contextValue,f=cn(t),o=o?u:c,u=(e=e.addHierarchicalFacet({name:f,attributes:r,separator:i,rootPath:a,showParentLevel:s}).setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,o)}),pn(t,n,{ais:l,multiIndexContext:t.indexContextValue}));return e=null!==u?e.toggleHierarchicalFacetRefinement(f,u):e},getMetadata:function(t,e){var n=t.attributes[0],r=cn(t),e=pn(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),n=e?[{label:"".concat(n,": ").concat(le(e)),attribute:n,value:function(e){return vn(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]:[];return{id:r,index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:n}}}),Fn=t({displayName:"AlgoliaHighlighter",$$type:"ais.highlighter",propTypes:{},getProvidedProps:function(){return{highlight:yn}}}),Pn=t({displayName:"AlgoliaHits",$$type:"ais.hits",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{hits:se(ae(n.hits,n.hitsPerPage,n.page),n.queryID)}:{hits:[]}},getSearchParameters:function(e){return e}});function Cn(){return"hitsPerPage"}function Sn(e,t,n){e=u(e,t,n,"hitsPerPage",null);return"string"==typeof e?parseInt(e,10):e}var Vn=t({displayName:"AlgoliaHitsPerPage",$$type:"ais.hitsPerPage",propTypes:{defaultRefinement:S.number.isRequired,items:S.arrayOf(S.shape({label:S.string,value:S.number.isRequired})).isRequired,transformItems:S.func},getProvidedProps:function(e,t){var n=Sn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),t=e.items.map(function(e){return e.value===n?I(I({},e),{},{isRefined:!0}):I(I({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(t):t,currentRefinement:n}},refine:function(e,t,n){return g(t,_({},"hitsPerPage",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},Cn())},getSearchParameters:function(e,t,n){return e.setHitsPerPage(Sn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(){return{id:Cn()}}}),wn=["page"];function jn(e){e=e||{};e.page;return O(e,wn)}var In=t({displayName:"AlgoliaInfiniteHits",$$type:"ais.infiniteHits",getProvidedProps:function(e,t,n){var r,i,a,s,o,c,u,l,f,h,d=this,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?(r=n.page,c=n.hits,f=n.hitsPerPage,i=n.nbPages,a=n._state,this._cache=e.cache||this._cache||(o=s=void 0,{read:function(e){e=e.state;return ee(o,jn(e))?s:null},write:function(e){var t=e.state,e=e.hits;o=jn(t),s=e}}),e=this._cache.read({state:a})||{},c=se(ae(c,f,r),n.queryID),e[r]=c,this._cache.write({state:a,hits:e}),u=Math.min.apply(Math,m(Object.keys(e).map(Number))),l=Math.max.apply(Math,m(Object.keys(e).map(Number))),f=0<u,n=l<i-1,{hits:(h=e,Object.keys(h).map(Number).sort(function(e,t){return e-t}).reduce(function(e,t){return e.concat(h[t])},[])),hasPrevious:f,hasMore:n,refinePrevious:function(e){return d.refine(e,u-1)},refineNext:function(e){return d.refine(e,l+1)}}):{hits:[],hasPrevious:!1,hasMore:!1,refine:function(){},refinePrevious:function(){},refineNext:function(){}}},getSearchParameters:function(e,t,n){return e.setQueryParameters({page:(t={ais:(e=t).contextValue,multiIndexContext:t.indexContextValue},("string"==typeof(e=u(e,n,t,"page",1))?parseInt(e,10):e)-1)})},refine:function(e,t,n,r){return g(t,_({},"page",r+1),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!1)}}),_n="menu";function On(e){return e.attribute}function En(e,t,n){t=u(e,t,n,"".concat(_n,".").concat(On(e)),null);return""===t?null:t}function An(e,t,n,r){return e===En(t,n,r)?"":e}function Nn(e){var t=e.showMore,n=e.limit,e=e.showMoreLimit;return t?e:n}function Tn(e,t,n,r){return g(t,_({},On(e),n||""),r,!0,_n)}var Hn=["count:desc","name:asc"],kn=t({displayName:"AlgoliaMenu",$$type:"ais.menu",propTypes:{attribute:S.string.isRequired,showMore:S.bool,limit:S.number,showMoreLimit:S.number,defaultRefinement:S.string,transformItems:S.func,searchable:S.bool,facetOrdering:S.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a=t.attribute,s=t.searchable,o=t.indexContextValue,c=t.facetOrdering,e=p(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),u=Boolean(e)&&Boolean(e.getFacetByName(a)),l=Boolean(i&&i[a]&&""!==i.query);if(s&&o)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");return u?(o=l?i[a].map(function(e){return{label:e.value,value:An(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):e.getFacetValues(a,{sortBy:s?void 0:Hn,facetOrdering:c}).map(function(e){return{label:e.name,value:An(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}}),{items:(i=t.transformItems?t.transformItems(o):o).slice(0,Nn(t)),currentRefinement:En(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:s,canRefine:0<i.length}):{items:[],currentRefinement:En(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:s,canRefine:u}},refine:function(e,t,n){return Tn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:Nn(e)}},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(_n,".").concat(On(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,n=(e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,Nn(t))})).addDisjunctiveFacet(r),En(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}));return e=null!==n?e.addDisjunctiveFacetRefinement(r,n):e},getMetadata:function(t,e){var n=On(t),e=En(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:n,index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===e?[]:[{label:"".concat(t.attribute,": ").concat(le(e)),attribute:t.attribute,value:function(e){return Tn(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]}}});function Mn(e){var t;return void 0===e.start&&void 0===e.end?"":(t=void 0!==e.start?e.start:"",e=void 0!==e.end?e.end:"","".concat(t,":").concat(e))}var $n="multiRange";function Dn(e){return e.attribute}function Qn(e,t,n){return u(e,t,n,"".concat($n,".").concat(Dn(e)),"")}function Bn(e,t,n,r){return g(t,_({},Dn(e),n),r,!0,$n)}var Ln=t({displayName:"AlgoliaNumericMenu",$$type:"ais.numericMenu",propTypes:{id:S.string,attribute:S.string.isRequired,items:S.arrayOf(S.shape({label:S.node,start:S.number,end:S.number})).isRequired,transformItems:S.func},getProvidedProps:function(s,e,t){var n=s.attribute,o=Qn(s,e,{ais:s.contextValue,multiIndexContext:s.indexContextValue}),c=p(t,{ais:s.contextValue,multiIndexContext:s.indexContextValue}),e=s.items.map(function(e){var t,n,r,i,a=Mn(e);return{label:e.label,value:a,isRefined:a===o,noRefinement:!(!c||(e=Dn(s),a=a,t=(t=c).getFacetByName(e)?t.getFacetStats(e):null,e=a.split(":"),i=0===Number(e[0])||""===a?Number.NEGATIVE_INFINITY:Number(e[0]),a=0===Number(e[1])||""===a?Number.POSITIVE_INFINITY:Number(e[1]),Boolean(t)&&(e=i,r=a,(n=t).min>=e&&n.min<=r||n.max>=e&&n.max<=r||(e=a,(n=i)>=(r=t).min&&n<=r.max)||e>=r.min&&e<=r.max)))}}),t=c&&c.getFacetByName(n)?c.getFacetStats(n):null,n=oe(e,function(e){return!0===e.isRefined}),n=(e.some(function(e){return""===e.value})||e.push({value:"",isRefined:void 0===n,noRefinement:!t,label:"All"}),s.transformItems?s.transformItems(e):e);return{items:n,currentRefinement:o,canRefine:0<n.length&&n.some(function(e){return!1===e.noRefinement})}},refine:function(e,t,n){return Bn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat($n,".").concat(Dn(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,t=0===(n=Qn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})).length?{start:null,end:null}:(t=(n=U(n.split(":"),2))[0],n=n[1],{start:0<t.length?parseFloat(t):null,end:0<n.length?parseFloat(n):null}),n=t.start,t=t.end;return e=e.addDisjunctiveFacet(r),"number"==typeof n&&(e=e.addNumericRefinement(r,">=",n)),e="number"==typeof t?e.addNumericRefinement(r,"<=",t):e},getMetadata:function(t,e){var n,r=Dn(t),i=Qn(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),e=[],a=h({ais:t.contextValue,multiIndexContext:t.indexContextValue});return""!==i&&(n=oe(t.items,function(e){return Mn(e)===i}).label,e.push({label:"".concat(t.attribute,": ").concat(n),attribute:t.attribute,currentRefinement:n,value:function(e){return Bn(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})}})),{id:r,index:a,items:e}}});function qn(){return"page"}function Un(e,t,n){e=u(e,t,n,"page",1);return"string"==typeof e?parseInt(e,10):e}var Wn=t({displayName:"AlgoliaPagination",$$type:"ais.pagination",getProvidedProps:function(e,t,n){var n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{nbPages:n=n.nbPages,currentRefinement:Un(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:1<n}:null},refine:function(e,t,n){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},g(t,_({},"page",n),e,!1)},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},qn())},getSearchParameters:function(e,t,n){return e.setPage(Un(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})-1)},getMetadata:function(){return{id:qn()}}}),zn=t({displayName:"AlgoliaPoweredBy",$$type:"ais.poweredBy",getProvidedProps:function(){var e="undefined"==typeof window||void 0===window.location?"":window.location.hostname;return{url:"https://www.algolia.com/?utm_source=react-instantsearch&utm_medium=website&"+"utm_content=".concat(e,"&")+"utm_campaign=poweredby"}}});function Jn(e){return e.attribute}var Yn="range";function Gn(e,t,n,r){var t=u(e,t,r,"".concat(Yn,".").concat(Jn(e)),{}),r=t.min,t=t.max,i=Boolean(e.precision),r={min:r="string"==typeof r?i?parseFloat(r):parseInt(r,10):r,max:t="string"==typeof t?i?parseFloat(t):parseInt(t,10):t},i=void 0!==e.min,t=void 0!==e.max,e=void 0!==r.min,a=void 0!==r.max;if(i&&e&&r.min<n.min)throw Error("You can't provide min value lower than range.");if(t&&a&&r.max>n.max)throw Error("You can't provide max value greater than range.");return i&&!e&&(r.min=n.min),t&&!a&&(r.max=n.max),r}function Kn(e,t){return{min:(void 0!==e.min?e:t).min,max:(void 0!==e.max?e:t).max}}function Xn(e,t,n,r){e=e||n!==r?e&&t?n:r:void 0;return e}function Zn(e,t,n,r,i){var a=n.min,n=n.max,s=r.min,r=r.max,o=void 0===a||""===a,c=void 0===n||""===n,a=o?void 0:parseFloat(a),n=c?void 0:parseFloat(n),u=o||isFinite(a),l=c||isFinite(n);if(!u||!l)throw Error("You can't provide non finite values to the range connector.");if(a<s)throw Error("You can't provide min value lower than range.");if(r<n)throw Error("You can't provide max value greater than range.");return g(t,_({},Jn(e),{min:Xn(void 0!==e.min,o,s,a),max:Xn(void 0!==e.max,c,r,n)}),i,!0,Yn)}var er=t({displayName:"AlgoliaRange",$$type:"ais.range",propTypes:{id:S.string,attribute:S.string.isRequired,defaultRefinement:S.shape({min:S.number,max:S.number}),min:S.number,max:S.number,precision:S.number,header:S.node,footer:S.node},defaultProps:{precision:0},getProvidedProps:function(e,t,n){var r=e.attribute,i=e.precision,a=e.min,s=e.max,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),o=n&&n.getFacetByName(r),c=o&&n.getFacetStats(r)||{},o=(o?n.getFacetValues(r):[]).map(function(e){return{value:e.name,count:e.count}}),c=(n={min:a,max:s},r=c,a=i,a=Math.pow(10,a),s="number"==typeof n.min&&isFinite(n.min)?n.min:"number"==typeof r.min&&isFinite(r.min)?r.min:void 0,n="number"==typeof n.max&&isFinite(n.max)?n.max:"number"==typeof r.max&&isFinite(r.max)?r.max:void 0,{min:void 0!==s?Math.floor(s*a)/a:s,max:void 0!==n?Math.ceil(n*a)/a:n}),r=c.min,s=c.max,a=(this._currentRange={min:r,max:s},Gn(e,t,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue}));return{min:r,max:s,canRefine:0<o.length,currentRefinement:Kn(a,this._currentRange),count:o,precision:i}},refine:function(e,t,n){return Zn(e,t,n,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(Yn,".").concat(Jn(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,n=Gn(t,n,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),t=n.min,n=n.max;return e=e.addDisjunctiveFacet(r),void 0!==t&&(e=e.addNumericRefinement(r,">=",t)),e=void 0!==n?e.addNumericRefinement(r,"<=",n):e},getMetadata:function(t,e){var n=this,r=this._currentRange,i=r.min,r=r.max,e=Gn(t,e,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=e.min,e=e.max,s=[],o=void 0!==a,c=void 0!==e;return(o&&a!==i||c&&e!==r)&&(o=[o?"".concat(a," <= "):"",t.attribute,c?" <= ".concat(e):""],s.push({label:o.join(""),attribute:t.attribute,value:function(e){return Zn(t,e,{},n._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:Kn({min:a,max:e},{min:i,max:r})})),{id:Jn(t),index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:s}}}),tr="refinementList";function nr(e){return e.attribute}function T(e,t,n){t=u(e,t,n,"".concat(tr,".").concat(nr(e)),[]);return"string"!=typeof t?t:t?[t]:[]}function rr(t,e,n,r){e=T(e,n,r);return-1===e.indexOf(t)?e.concat([t]):e.filter(function(e){return e!==t})}function ir(e){var t=e.showMore,n=e.limit,e=e.showMoreLimit;return t?e:n}function ar(e,t,n,r){return g(t,_({},nr(e),0<n.length?n:""),r,!0,tr)}var sr=["isRefined","count:desc","name:asc"],or=t({displayName:"AlgoliaRefinementList",$$type:"ais.refinementList",propTypes:{id:S.string,attribute:S.string.isRequired,operator:S.oneOf(["and","or"]),showMore:S.bool,limit:S.number,showMoreLimit:S.number,defaultRefinement:S.arrayOf(S.oneOfType([S.string,S.number])),searchable:S.bool,transformItems:S.func,facetOrdering:S.bool},defaultProps:{operator:"or",showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a=t.attribute,s=t.searchable,o=t.indexContextValue,c=t.facetOrdering,e=p(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),u=Boolean(e)&&Boolean(e.getFacetByName(a)),l=Boolean(i&&i[a]&&""!==i.query);if(s&&o)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");return u?(o=l?i[a].map(function(e){return{label:e.value,value:rr(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):e.getFacetValues(a,{sortBy:sr,facetOrdering:c}).map(function(e){return{label:e.name,value:rr(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}}),{items:(i=t.transformItems?t.transformItems(o):o).slice(0,ir(t)),currentRefinement:T(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:s,canRefine:0<i.length}):{items:[],currentRefinement:T(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),canRefine:u,isFromSearch:l,searchable:s}},refine:function(e,t,n){return ar(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:ir(e)}},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(tr,".").concat(nr(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,i="and"===t.operator?"addFacet":"addDisjunctiveFacet",a="".concat(i,"Refinement");return e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,ir(t))}))[i](r),T(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}).reduce(function(e,t){return e[a](r,t)},e)},getMetadata:function(n,r){var e=nr(n),i={ais:n.contextValue,multiIndexContext:n.indexContextValue};return{id:e,index:h(i),items:0<T(n,r,i).length?[{attribute:n.attribute,label:"".concat(n.attribute,": "),currentRefinement:T(n,r,i),value:function(e){return ar(n,e,[],i)},items:T(n,r,i).map(function(t){return{label:le("".concat(t)),value:function(e){e=T(n,e,i).filter(function(e){return e!==t});return ar(n,r,e,i)}}})}]:[]}}}),cr=t({displayName:"AlgoliaScrollTo",$$type:"ais.scrollTo",propTypes:{scrollOn:S.string},defaultProps:{scrollOn:"page"},getProvidedProps:function(e,t){var n=e.scrollOn,r=u(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},n,null),e=(this._prevSearchState||(this._prevSearchState={}),l(t=d({ais:e.contextValue,multiIndexContext:e.indexContextValue})?t.indices?t.indices[h({ais:e.contextValue,multiIndexContext:e.indexContextValue})]:{}:t,["configure",n])),t=te(this._prevSearchState,e);return this._prevSearchState=e,{value:r,hasNotChanged:t}}});function ur(){return"query"}function lr(e,t,n){e=u(e,t,n,"query","");return e||""}function fr(e,t,n,r){return g(t,_({},"query",n),r,!0)}var hr=t({displayName:"AlgoliaSearchBox",$$type:"ais.searchBox",propTypes:{defaultRefinement:S.string},getProvidedProps:function(e,t,n){return{currentRefinement:lr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return fr(0,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},r(t,e,ur())},getSearchParameters:function(e,t,n){return e.setQuery(lr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(t,e){e=lr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===e?[]:[{label:"".concat("query",": ").concat(e),value:function(e){return fr(0,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]}}});function dr(){return"relevancyStrictness"}var mr=t({displayName:"AlgoliaRelevantSort",$$type:"ais.relevantSort",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{isVirtualReplica:void 0!==n.appliedRelevancyStrictness,isRelevantSorted:void 0!==n.appliedRelevancyStrictness&&0<n.appliedRelevancyStrictness}:{isVirtualReplica:!1,isRelevantSorted:!1}},getSearchParameters:function(e,t,n){return e.setQueryParameter("relevancyStrictness",(e={ais:t.contextValue,multiIndexContext:t.indexContextValue},u(t,n,e,"relevancyStrictness")))},refine:function(e,t,n){return g(t,_({},dr(),n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)}});function pr(){return"sortBy"}function gr(e,t,n){e=u(e,t,n,"sortBy",null);return e||null}var xr=t({displayName:"AlgoliaSortBy",$$type:"ais.sortBy",propTypes:{defaultRefinement:S.string,items:S.arrayOf(S.shape({label:S.string,value:S.string.isRequired})).isRequired,transformItems:S.func},getProvidedProps:function(e,t){var n=gr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),t=e.items.map(function(e){return e.value===n?I(I({},e),{},{isRefined:!0}):I(I({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(t):t,currentRefinement:n}},refine:function(e,t,n){return g(t,_({},"sortBy",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},pr())},getSearchParameters:function(e,t,n){n=gr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return e.setIndex(n)},getMetadata:function(){return{id:pr()}}}),vr=t({displayName:"AlgoliaStateResults",$$type:"ais.stateResults",getProvidedProps:function(e,t,n){return{searchState:t,searchResults:p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),allSearchResults:n.results,searching:n.searching,isSearchStalled:n.isSearchStalled,error:n.error,searchingForFacetValues:n.searchingForFacetValues,props:e}}}),yr=t({displayName:"AlgoliaStats",$$type:"ais.stats",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{areHitsSorted:void 0!==n.appliedRelevancyStrictness&&0<n.appliedRelevancyStrictness&&n.nbHits!==n.nbSortedHits,nbHits:n.nbHits,nbSortedHits:n.nbSortedHits,processingTimeMS:n.processingTimeMS}:null}});function Rr(e){return e.attribute}var br="toggle",Fr=["0","false","null","undefined"];function Pr(e,t,n){t=u(e,t,n,"".concat(br,".").concat(Rr(e)),!1);return-1===Fr.indexOf(t)&&Boolean(t)}function Cr(e,t,n,r){return g(t,_({},Rr(e),n||!1),r,!0,br)}var Sr=t({displayName:"AlgoliaToggle",$$type:"ais.toggle",propTypes:{label:S.string.isRequired,attribute:S.string.isRequired,value:S.any.isRequired,filter:S.func,defaultRefinement:S.bool},getProvidedProps:function(e,t,n){var r=e.attribute,i=e.value,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),t=Pr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),e=n&&n.getFacetByName(r)?n.getFacetValues(r):null,n=e&&e.length?oe(e,function(e){return e.name===i.toString()}):null,r=n&&n.count,n=e&&e.length?e.reduce(function(e,t){return e+t.count},0):null;return{currentRefinement:t,canRefine:t?null!==n&&0<n:null!==r&&0<r,count:{checked:n,unchecked:r}}},refine:function(e,t,n){return Cr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(br,".").concat(Rr(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,i=t.value,a=t.filter,n=Pr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),t=e.addDisjunctiveFacet(r);return t=n&&(t=t.addDisjunctiveFacetRefinement(r,i),a)?a(t):t},getMetadata:function(t,e){var n=Rr(t),e=Pr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),r=[],i=h({ais:t.contextValue,multiIndexContext:t.indexContextValue});return e&&r.push({label:t.label,currentRefinement:e,attribute:t.attribute,value:function(e){return Cr(t,e,!1,{ais:t.contextValue,multiIndexContext:t.indexContextValue})}}),{id:n,index:i,items:r}}});function Vr(r,i,a){return function(e,t){if("function"!=typeof r)throw new TypeError("Expected insightsClient to be a Function");var n=function(e){var t=e.method,n=e.results,r=e.currentHit,i=n.index,a=r.__queryID,s=[r.objectID];if(!a)throw new Error("Could not infer `queryID`. Ensure `clickAnalytics: true` was added with the Configure widget.\nSee: https://alg.li/VpPpLt");switch(t){case"clickedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s,positions:[r.__position]};case"convertedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s};default:throw new Error('Unsupported method "'.concat(t,'" passed to the insights function. The supported methods are: "clickedObjectIDsAfterSearch", "convertedObjectIDsAfterSearch".'))}}({method:e,results:i,currentHit:a});r(e,I(I({},n),t))}}function wr(){return"query"}function jr(){return"additionalVoiceParameters"}function Ir(e,t,n){e=u(e,t,n,"query","");return e||""}function _r(e,t,n,r){var i,a=e.language?{queryLanguages:[e.language.split("-")[0]]}:{},e="function"==typeof e.additionalQueryParameters?I({ignorePlurals:!0,removeStopWords:!0,optionalWords:n},e.additionalQueryParameters({query:n})):{};_(i={},"query",n),_(i,"additionalVoiceParameters",I(I({},a),e));return g(t,i,r,!0)}var S=t({displayName:"AlgoliaVoiceSearch",$$type:"ais.voiceSearch",propTypes:{defaultRefinement:S.string},getProvidedProps:function(e,t,n){return{currentRefinement:Ir(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return _r(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return n=t,e={ais:e.contextValue,multiIndexContext:e.indexContextValue},n=r(t,e,wr()),r(n,e,jr());var n},getSearchParameters:function(e,t,n){var r,i=Ir(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),n=(t={ais:(r=t).contextValue,multiIndexContext:t.indexContextValue},(r=u(r,n,t,"additionalVoiceParameters",""))||{});return e.setQuery(i).setQueryParameters(n)},getMetadata:function(t,e){e=Ir(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===e?[]:[{label:"".concat("query",": ").concat(e),value:function(e){return _r(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]}}}),Or=Et,Er=j;e.Configure=Se,e.DynamicWidgets=Et,e.EXPERIMENTAL_connectConfigureRelatedItems=R,e.EXPERIMENTAL_connectDynamicWidgets=Er,e.ExperimentalConfigureRelatedItems=b,e.ExperimentalDynamicWidgets=Or,e.HIGHLIGHT_TAGS=ve,e.Index=function(t){var n=t.indexName;return o.createElement(he,null,function(e){return o.createElement(kt,D({contextValue:e,indexId:n},t))})},e.InstantSearch=Xt,e.InstantSearchConsumer=he,e.InstantSearchProvider=de,e.QueryRuleContext=Tt,e.connectAutoComplete=tn,e.connectBreadcrumb=un,e.connectConfigure=me,e.connectCurrentRefinements=ln,e.connectDynamicWidgets=j,e.connectGeoSearch=dn,e.connectHierarchicalMenu=bn,e.connectHighlight=Fn,e.connectHitInsights=function(r){return t({displayName:"AlgoliaInsights",$$type:"ais.insights",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{insights:Vr(r,n,e.hit)}}})},e.connectHits=Pn,e.connectHitsPerPage=Vn,e.connectInfiniteHits=In,e.connectMenu=kn,e.connectNumericMenu=Ln,e.connectPagination=Wn,e.connectPoweredBy=zn,e.connectQueryRules=Nt,e.connectRange=er,e.connectRefinementList=or,e.connectRelevantSort=mr,e.connectScrollTo=cr,e.connectSearchBox=hr,e.connectSortBy=xr,e.connectStateResults=vr,e.connectStats=yr,e.connectToggleRefinement=Sr,e.connectVoiceSearch=S,e.createConnector=t,e.instantSearchContext=fe,e.translatable=function(s){return function(e){var t=function(){Q(i,a.Component);var r=q(i);function i(){var a;k(this,i);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _(c(a=r.call.apply(r,[this].concat(t))),"translate",function(e){var t=a.props.translations,t=(t&&t.hasOwnProperty(e)?t:s)[e];if("function"!=typeof t)return t;for(var n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.apply(void 0,r)}),a}return $(i,[{key:"render",value:function(){return o.createElement(e,D({translate:this.translate},this.props))}}]),i}(),n=e.displayName||e.name||"UnknownComponent";return t.displayName="Translatable(".concat(n,")"),t}},e.version=Re,Object.defineProperty(e,"__esModule",{value:!0})});
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactInstantSearchCore={},e.React)}(this,function(e,a){"use strict";var o="default"in a?a.default:a;function H(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?H(Object(n),!0).forEach(function(e){_(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J(r.key),r)}}function $(e,t,n){t&&M(e.prototype,t),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1})}function _(e,t,n){return(t=J(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Q(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function O(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};for(var n,r={},i=Object.keys(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=B(n),t=(e=r?(e=B(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}}function U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}(e,t)||W(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){return function(e){if(Array.isArray(e))return z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||W(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){var n;if(e)return"string"==typeof e?z(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e){e=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=typeof(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof e?e:String(e)}var Y="undefined"!=typeof Element,G="function"==typeof Map,K="function"==typeof Set,X="function"==typeof ArrayBuffer;function Z(e){re.then(e)}var ee=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,a,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1}else if(G&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1;for(s=t.entries();!(i=s.next()).done;)if(!e(i.value[1],n.get(i.value[0])))return!1}else if(K&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1}else if(X&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(t[i]!==n[i])return!1}else{if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;if(Y&&t instanceof Element)return!1;for(i=r;0!=i--;)if(!("_owner"===a[i]&&t.$$typeof||e(t[a[i]],n[a[i]])))return!1}return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}},te=function(e,t){if(e!==t){var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,a=0;a<n.length;a++)if(!i.call(t,n[a])||e[n[a]]!==t[n[a]])return!1}return!0},ne=function(e){return e.displayName||e.name||"UnknownComponent"},re=Promise.resolve(),ie=function r(i){return Object.keys(i).forEach(function(e){var t,n=i[e];"object"!==s(t=n)||null===t||Array.isArray(t)||(ce(n)?r(n):delete i[e])}),i};function ae(e,n,r){return e.map(function(e,t){return I(I({},e),{},{__position:n*r+t+1})})}function se(e,t){return t?e.map(function(e){return I(I({},e),{},{__queryID:t})}):e}function oe(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function ce(e){return e&&0<Object.keys(e).length}function l(e,t){if(null==e)return{};for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];0<=t.indexOf(a)||(n[a]=e[a])}return n}var ue=function(e,t){return(Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".")).reduce(function(e,t){return e?e[t]:void 0},e)};function le(e){return e.replace(/^\\-/,"-")}var fe=a.createContext({onInternalStateUpdate:function(){},createHrefForState:function(){return"#"},onSearchForFacetValues:function(){},onSearchStateChange:function(){},onSearchParameters:function(){},store:{},widgetsManager:{},mainTargetedIndex:""}),he=fe.Consumer,de=fe.Provider,me=a.createContext(void 0),pe=me.Consumer,ge=me.Provider,xe=["contextValue"];function t(n){return function(e,t){var r=function(u){var r;if(u.displayName)return r="function"==typeof u.getSearchParameters||"function"==typeof u.getMetadata||"function"==typeof u.transitionState,function(i){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=function(){Q(n,a.Component);var t=q(n);function n(e){var i;return k(this,n),_(c(i=t.call(this,e)),"unsubscribe",void 0),_(c(i),"unregisterWidget",void 0),_(c(i),"cleanupTimerRef",null),_(c(i),"isUnmounting",!1),_(c(i),"state",{providedProps:i.getProvidedProps(i.props)}),_(c(i),"refine",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onInternalStateUpdate((e=u.refine).call.apply(e,[c(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),_(c(i),"createURL",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return i.props.contextValue.createHrefForState((e=u.refine).call.apply(e,[c(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),_(c(i),"searchForFacetValues",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onSearchForFacetValues((e=u.searchForFacetValues).call.apply(e,[c(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),u.getSearchParameters&&i.props.contextValue.onSearchParameters(u.getSearchParameters.bind(c(i)),{ais:i.props.contextValue,multiIndexContext:i.props.indexContextValue},i.props,u.getMetadata&&u.getMetadata.bind(c(i)),u.displayName),i}return $(n,[{key:"componentDidMount",value:function(){var e=this;this.cleanupTimerRef&&(clearTimeout(this.cleanupTimerRef),this.cleanupTimerRef=null),this.unsubscribe=this.props.contextValue.store.subscribe(function(){e.isUnmounting||e.setState({providedProps:e.getProvidedProps(e.props)})}),r&&(this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this))}},{key:"shouldComponentUpdate",value:function(e,t){return"function"==typeof u.shouldComponentUpdate?u.shouldComponentUpdate.call(this,this.props,e,this.state,t):(e=te(this.props,e),null===this.state.providedProps||null===t.providedProps?this.state.providedProps!==t.providedProps||!e:!e||!te(this.state.providedProps,t.providedProps))}},{key:"componentDidUpdate",value:function(e){ee(e,this.props)||(this.setState({providedProps:this.getProvidedProps(this.props)}),r&&(this.props.contextValue.widgetsManager.update(),"function"==typeof u.transitionState)&&this.props.contextValue.onSearchStateChange(u.transitionState.call(this,this.props,this.props.contextValue.store.getState().widgets,this.props.contextValue.store.getState().widgets)))}},{key:"componentWillUnmount",value:function(){var t=this;this.cleanupTimerRef=setTimeout(function(){var e;t.isUnmounting=!0,t.unsubscribe&&t.unsubscribe(),t.unregisterWidget&&(t.unregisterWidget(),"function"==typeof u.cleanUp)&&(e=u.cleanUp.call(t,t.props,t.props.contextValue.store.getState().widgets),t.props.contextValue.store.setState(I(I({},t.props.contextValue.store.getState()),{},{widgets:e})),t.props.contextValue.onSearchStateChange(ie(e)))})}},{key:"getProvidedProps",value:function(e){var t=this.props.contextValue.store.getState(),n=t.widgets,r=t.results,i=t.resultsFacetValues,a=t.searching,s=t.searchingForFacetValues,o=t.isSearchStalled,c=t.metadata,t=t.error;return u.getProvidedProps.call(this,e,n,{results:r,searching:a,searchingForFacetValues:s,isSearchStalled:o,error:t},c,i)}},{key:"getSearchParameters",value:function(e){return"function"==typeof u.getSearchParameters?u.getSearchParameters.call(this,e,this.props,this.props.contextValue.store.getState().widgets):null}},{key:"getMetadata",value:function(e){return"function"==typeof u.getMetadata?u.getMetadata.call(this,this.props,e):{}}},{key:"transitionState",value:function(e,t){return"function"==typeof u.transitionState?u.transitionState.call(this,this.props,e,t):t}},{key:"render",value:function(){var e,t,n=this.props,n=(n.contextValue,O(n,xe)),r=this.state.providedProps;return null===r?null:(e="function"==typeof u.refine?{refine:this.refine,createURL:this.createURL}:{},t="function"==typeof u.searchForFacetValues?{searchForItems:this.searchForFacetValues}:{},o.createElement(i,D({},n,r,e,t)))}}]),n}();return _(t,"displayName","".concat(u.displayName,"(").concat(ne(i),")")),_(t,"$$type",u.$$type),_(t,"$$widgetType",e.$$widgetType),_(t,"defaultProps",u.defaultProps),_(t,"_connectorDesc",u),t};throw new Error("`createConnector` requires you to provide a `displayName` property.")}(n)(e,t);return function(n){return o.createElement(he,null,function(t){return o.createElement(pe,null,function(e){return o.createElement(r,D({contextValue:t,indexContextValue:e},n))})})}}}var ve={highlightPreTag:"<ais-highlight-0000000000>",highlightPostTag:"</ais-highlight-0000000000>"};function ye(e){var t,n=e.preTag,r=e.postTag,e=e.highlightedValue,e=(void 0===e?"":e).split(n),i=e.shift(),a=""===i?[]:[{value:i,isHighlighted:!1}];return r===n?(t=!0,e.forEach(function(e){a.push({value:e,isHighlighted:t}),t=!t})):e.forEach(function(e){e=e.split(r);a.push({value:e[0],isHighlighted:!0}),""!==e[1]&&a.push({value:e[1],isHighlighted:!1})}),a}var Re="6.39.0";function h(e){return d(e)?e.multiIndexContext.targetedIndex:e.ais.mainTargetedIndex}function p(e,t){if(e.results){if(e.results.hits)return e.results;t=h(t);if(e.results[t])return e.results[t]}return null}function d(e){return e&&e.multiIndexContext}function g(t,e,n,r,i){var a,s,o,c,u,l,f;return d(n)?(n=h(n),i?(o=e,c=n,l=i,u=(u=r)?{page:1}:void 0,f=(s=t).indices&&s.indices[c]?I(I({},s.indices),{},_({},c,I(I({},s.indices[c]),{},(_(f={},l,I(I({},s.indices[c][l]),o)),_(f,"page",1),f)))):I(I({},s.indices),{},_({},c,I(_({},l,o),u))),I(I({},s),{},{indices:f})):(c=e,l=n,o=(o=r)?{page:1}:void 0,l=(u=t).indices&&u.indices[l]?I(I({},u.indices),{},_({},l,I(I(I({},u.indices[l]),c),o))):I(I({},u.indices),{},_({},l,I(I({},c),o))),I(I({},u),{},{indices:l}))):(t.indices&&r&&Object.keys(t.indices).forEach(function(e){t=g(t,{page:1},{multiIndexContext:{targetedIndex:e}},!0,i)}),i?(s=e,f=i,n=(n=r)?{page:1}:void 0,I(I({},a=t),{},_({},f,I(I({},a[f]),s)),n)):(a=e,n=(n=r)?{page:1}:void 0,I(I(I({},t),a),n)))}function be(e){e=e.match(/^([^.]*)\.(.*)/);return{namespace:e&&e[1],attributeName:e&&e[2]}}function u(e,t,n,r,i){var a,s=h(n),o=be(r),c=o.namespace,o=o.attributeName,n={multiIndex:d(n),indexId:s,namespace:c,attributeName:o,id:r,searchState:t};return c=(s=n).multiIndex,o=s.indexId,r=s.namespace,t=s.attributeName,a=s.id,s=s.searchState,(c&&r?s.indices&&s.indices[o]&&s.indices[o][r]&&Object.hasOwnProperty.call(s.indices[o][r],t):c?s.indices&&s.indices[o]&&Object.hasOwnProperty.call(s.indices[o],a):r?s[r]&&Object.hasOwnProperty.call(s[r],t):Object.hasOwnProperty.call(s,a))?(o=(c=n).multiIndex,r=c.indexId,t=c.namespace,s=c.attributeName,a=c.id,c=c.searchState,o&&t?c.indices[r][t][s]:o?c.indices[r][a]:t?c[t][s]:c[a]):e.defaultRefinement||i}function r(e,t,n){var r,i,a,s,o=h(t),c=be(n),u=c.namespace,c=c.attributeName;return d(t)&&Boolean(e.indices)?(o=(t={attribute:c,searchState:e,indexId:o,id:n,namespace:u}).searchState,i=t.indexId,r=t.id,s=t.namespace,t=t.attribute,a=o.indices[i],s&&a?I(I({},o),{},{indices:I(I({},o.indices),{},_({},i,I(I({},a),{},_({},s,l(a[s],[t])))))}):a?I(I({},o),{},{indices:I(I({},o.indices),{},_({},i,l(a,[r])))}):o):(t=(s={attribute:c,searchState:e,id:n,namespace:u}).searchState,i=s.id,a=s.namespace,s=s.attribute,a?I(I({},t),{},_({},a,l(t[a],[s]))):l(t,[i]))}var Fe=["children","contextValue","indexContextValue"],Pe=["children","contextValue","indexContextValue"];function Ce(){return"configure"}var me=t({displayName:"AlgoliaConfigure",$$type:"ais.configure",getProvidedProps:function(){return{}},getSearchParameters:function(e,t){t.children,t.contextValue,t.indexContextValue;t=O(t,Fe);return e.setQueryParameters(t)},transitionState:function(e,t,n){var r=Ce(),i=(e.children,e.contextValue,e.indexContextValue,O(e,Pe)),a=Object.keys(e),s=this._props?Object.keys(this._props).filter(function(e){return-1===a.indexOf(e)}):[];return this._props=e,g(n,_({},r,I(I({},l(n[r],s)),i)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(n,e){var r=Ce(),t=h({ais:n.contextValue,multiIndexContext:n.indexContextValue}),i=d({ais:n.contextValue,multiIndexContext:n.indexContextValue})&&e.indices?e.indices[t]:e,t=(i&&i[r]?Object.keys(i[r]):[]).reduce(function(e,t){return n[t]||(e[t]=i[r][t]),e},{});return g(e,_({},r,t),{ais:n.contextValue,multiIndexContext:n.indexContextValue})}}),Se=me(function(){return null},{$$widgetType:"ais.configure"});function Ve(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function we(e,t){var n,r;if(e!==t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"__proto__"!==i&&"constructor"!==i&&(n=t[i],void 0!==(r=e[i])&&void 0===n||(Ve(r)&&Ve(n)?e[i]=we(r,n):e[i]="object"==typeof(r=n)&&null!==r?we(Array.isArray(r)?[]:{},r):r));return e}function x(){return Array.prototype.slice.call(arguments).reduceRight(function(t,n){return Object.keys(Object(n)).forEach(function(e){void 0!==n[e]&&(void 0!==t[e]&&delete t[e],t[e]=n[e])}),t},{})}var v=function(e){Ve(e)||(e={});for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];Ve(r)&&we(e,r)}return e};var je=function(n,r){return n.filter(function(e,t){return-1<r.indexOf(e)&&n.indexOf(e)===t})},y=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]};var Ie=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")};var _e=function(e,t){if(null===e)return{};for(var n,r={},i=Object.keys(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||(r[n]=e[n]);return r};var Oe=function(e){return e&&0<Object.keys(e).length},i={addRefinement:function(e,t,n){var r;return i.isRefined(e,t,n)?e:(n=""+n,n=e[t]?e[t].concat(n):[n],(r={})[t]=n,x({},r,e))},removeRefinement:function(e,n,t){var r;return void 0===t?i.clearRefinement(e,function(e,t){return n===t}):(r=""+t,i.clearRefinement(e,function(e,t){return n===t&&r===e}))},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return i.isRefined(e,t,n)?i.removeRefinement(e,t,n):i.addRefinement(e,t,n)},clearRefinement:function(i,a,s){var o,e;return void 0===a?Oe(i)?{}:i:"string"==typeof a?_e(i,[a]):"function"==typeof a?(o=!1,e=Object.keys(i).reduce(function(e,t){var n=i[t]||[],r=n.filter(function(e){return!a(e,t,s)});return r.length!==n.length&&(o=!0),e[t]=r,e},{}),o?e:i):void 0},isRefined:function(e,t,n){var r=!!e[t]&&0<e[t].length;return void 0!==n&&r?-1!==e[t].indexOf(""+n):r}},n=i;function Ee(e,n){return Array.isArray(e)&&Array.isArray(n)?e.length===n.length&&e.every(function(e,t){return Ee(n[t],e)}):e===n}function f(e){var r=e?f._parseNumbers(e):{},i=(void 0===r.userToken||null!==(e=r.userToken)&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=r.facets||[],this.disjunctiveFacets=r.disjunctiveFacets||[],this.hierarchicalFacets=r.hierarchicalFacets||[],this.facetsRefinements=r.facetsRefinements||{},this.facetsExcludes=r.facetsExcludes||{},this.disjunctiveFacetsRefinements=r.disjunctiveFacetsRefinements||{},this.numericRefinements=r.numericRefinements||{},this.tagRefinements=r.tagRefinements||[],this.hierarchicalFacetsRefinements=r.hierarchicalFacetsRefinements||{},this);Object.keys(r).forEach(function(e){var t=-1!==f.PARAMETERS.indexOf(e),n=void 0!==r[e];!t&&n&&(i[e]=r[e])})}f.PARAMETERS=Object.keys(new f),f._parseNumbers=function(i){var r,a;return i instanceof f?i:(r={},["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(e){var t,n=i[e];"string"==typeof n&&(t=parseFloat(n),r[e]=isNaN(t)?n:t)}),Array.isArray(i.insideBoundingBox)&&(r.insideBoundingBox=i.insideBoundingBox.map(function(e){return Array.isArray(e)?e.map(function(e){return parseFloat(e)}):e})),i.numericRefinements&&(a={},Object.keys(i.numericRefinements).forEach(function(n){var r=i.numericRefinements[n]||{};a[n]={},Object.keys(r).forEach(function(e){var t=r[e].map(function(e){return Array.isArray(e)?e.map(function(e){return"string"==typeof e?parseFloat(e):e}):"string"==typeof e?parseFloat(e):e});a[n][e]=t})}),r.numericRefinements=a),v({},i,r))},f.make=function(e){var n=new f(e);return(e.hierarchicalFacets||[]).forEach(function(e){var t;e.rootPath&&0===(t=(n=0<(t=n.getHierarchicalRefinement(e.name)).length&&0!==t[0].indexOf(e.rootPath)?n.clearRefinements(e.name):n).getHierarchicalRefinement(e.name)).length&&(n=n.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}),n},f.validate=function(e,t){t=t||{};return e.tagFilters&&t.tagRefinements&&0<t.tagRefinements.length?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):0<e.tagRefinements.length&&t.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&t.numericRefinements&&Oe(t.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):Oe(e.numericRefinements)&&t.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},f.prototype={constructor:f,clearRefinements:function(e){e={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:n.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:n.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:n.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:n.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return e.numericRefinements===this.numericRefinements&&e.facetsRefinements===this.facetsRefinements&&e.facetsExcludes===this.facetsExcludes&&e.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&e.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(e)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r,n=Ie(n);return this.isNumericRefined(e,t,n)?this:((r=v({},this.numericRefinements))[e]=v({},r[e]),r[e][t]?(r[e][t]=r[e][t].slice(),r[e][t].push(n)):r[e][t]=[n],this.setQueryParameters({numericRefinements:r}))},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(n,r,i){return void 0!==i?this.isNumericRefined(n,r,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r&&Ee(e.val,Ie(i))})}):this:void 0!==r?this.isNumericRefined(n,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r})}):this:this.isNumericRefined(n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(s){var o,t,e;return void 0===s?Oe(this.numericRefinements)?{}:this.numericRefinements:"string"==typeof s?_e(this.numericRefinements,[s]):"function"==typeof s?(o=!1,t=this.numericRefinements,e=Object.keys(t).reduce(function(e,r){var i=t[r],a={},i=i||{};return Object.keys(i).forEach(function(t){var e=i[t]||[],n=[];e.forEach(function(e){s({val:e,op:t},r,"numeric")||n.push(e)}),n.length!==e.length&&(o=!0),a[t]=n}),e[r]=a,e},{}),o?e:this.numericRefinements):void 0},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:n.addRefinement(this.facetsRefinements,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},addExcludeRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:n.addRefinement(this.facetsExcludes,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},addDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return n.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:n.addRefinement(this.disjunctiveFacetsRefinements,e,t)});throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},addTagRefinement:function(e){return this.isTagRefined(e)?this:(e={tagRefinements:this.tagRefinements.concat(e)},this.setQueryParameters(e))},removeFacet:function(t){return this.isConjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({facets:this.facets.filter(function(e){return e!==t})}):this},removeDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(e){return e!==t})}):this},removeHierarchicalFacet:function(t){return this.isHierarchicalFacet(t)?this.clearRefinements(t).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(e){return e.name!==t})}):this},removeFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:n.removeRefinement(this.facetsRefinements,e,t)}):this;throw new Error(e+" is not defined in the facets attribute of the helper configuration")},removeExcludeRefinement:function(e,t){if(this.isConjunctiveFacet(e))return n.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:n.removeRefinement(this.facetsExcludes,e,t)}):this;throw new Error(e+" is not defined in the facets attribute of the helper configuration")},removeDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return n.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:n.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this;throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},removeTagRefinement:function(t){var e;return this.isTagRefined(t)?(e={tagRefinements:this.tagRefinements.filter(function(e){return e!==t})},this.setQueryParameters(e)):this},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return this.setQueryParameters({facetsRefinements:n.toggleRefinement(this.facetsRefinements,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},toggleExcludeFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return this.setQueryParameters({facetsExcludes:n.toggleRefinement(this.facetsExcludes,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},toggleDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return this.setQueryParameters({disjunctiveFacetsRefinements:n.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)});throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},toggleHierarchicalFacetRefinement:function(e,t){var n,r;if(this.isHierarchicalFacet(e))return n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r={},void 0!==this.hierarchicalFacetsRefinements[e]&&0<this.hierarchicalFacetsRefinements[e].length&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n))?-1===t.indexOf(n)?r[e]=[]:r[e]=[t.slice(0,t.lastIndexOf(n))]:r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:x({},r,this.hierarchicalFacetsRefinements)});throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration")},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");var n;if(this.isHierarchicalFacet(e))return(n={})[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:x({},n,this.hierarchicalFacetsRefinements)});throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.")},removeHierarchicalFacetRefinement:function(e){var t;return this.isHierarchicalFacetRefined(e)?((t={})[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:x({},t,this.hierarchicalFacetsRefinements)})):this},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return-1<this.disjunctiveFacets.indexOf(e)},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return-1<this.facets.indexOf(e)},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&n.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&n.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&n.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){return!!this.isHierarchicalFacet(e)&&(e=this.getHierarchicalRefinement(e),t?-1!==e.indexOf(t):0<e.length)},isNumericRefined:function(e,t,n){var r,i;return void 0===n&&void 0===t?!!this.numericRefinements[e]:(r=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t],void 0!==n&&r?(n=Ie(n),t=void 0!==(e=this.numericRefinements[e][t],i=n,y(e,function(e){return Ee(e,i)})),r&&t):r)},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var t=this,e=je(Object.keys(this.numericRefinements).filter(function(e){return 0<Object.keys(t.numericRefinements[e]).length}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(e){return 0<t.disjunctiveFacetsRefinements[e].length}).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var t=this;return je(this.hierarchicalFacets.map(function(e){return e.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(e){return 0<t.hierarchicalFacetsRefinements[e].length}))},getUnrefinedDisjunctiveFacets:function(){var t=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(e){return-1===t.indexOf(e)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var n=this.managedParameters,r={},i=this;return Object.keys(this).forEach(function(e){var t=i[e];-1===n.indexOf(e)&&void 0!==t&&(r[e]=t)}),r},setQueryParameter:function(e,t){var n;return this[e]===t?this:((n={})[e]=t,this.setQueryParameters(n))},setQueryParameters:function(e){if(!e)return this;var t=f.validate(this,e);if(t)throw t;var n=this,i=f._parseNumbers(e),t=Object.keys(this).reduce(function(e,t){return e[t]=n[t],e},{}),e=Object.keys(i).reduce(function(e,t){var n=void 0!==e[t],r=void 0!==i[t];return n&&!r?_e(e,[t]):(r&&(e[t]=i[t]),e)},t);return new this.constructor(e)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(t){return y(this.hierarchicalFacets,function(e){return e.name===t})},getHierarchicalFacetBreadcrumb:function(e){var t;return this.isHierarchicalFacet(e)&&(t=this.getHierarchicalRefinement(e)[0])?(e=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),t.split(e).map(function(e){return e.trim()})):[]},toString:function(){return JSON.stringify(this,null,2)}};var Ae=f;function Ne(e){return Array.isArray(e)?e.filter(Boolean):[]}function Te(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function He(e,t){var r=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var n=t.split(":"),t=y(r,function(e){return e[0]===n[0]});return 1<n.length||!t?(e[0].push(n[0]),e[1].push(n[1])):(e[0].push(t[0]),e[1].push(t[1])),e},[[],[]])}var ke=function(e,n,i){return Array.isArray(e)?(Array.isArray(i)||(i=[]),(e=e.map(function(t,e){return{criteria:n.map(function(e){return t[e]}),index:e,value:t}})).sort(function(e,t){for(var n=-1;++n<e.criteria.length;){var r=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=void 0!==t,a=null===t;if(!a&&t<e||r&&i||!n)return 1;if(!r&&e<t||a&&n||!i)return-1}return 0}(e.criteria[n],t.criteria[n]);if(r)return!(n>=i.length)&&"desc"===i[n]?-r:r}return e.index-t.index}),e.map(function(e){return e.value})):[]};var R=function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},b=function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")},Me=function(m){return function(e,t){function n(e,s,t){var n,o=e;if(0<t){var r=0;for(o=e;r<t;){var i=o&&Array.isArray(o.data)?o.data:[],o=y(i,function(e){return e.isRefined});r++}}return o&&(n=Object.keys(s.data).map(function(e){return[e,s.data[e]]}).filter(function(e){var t,n,r,i,a,e=e[0];return e=e,t=o.path||u,n=f,r=c,a=l,(!(i=u)||0===e.indexOf(i)&&i!==e)&&(!i&&-1===e.indexOf(r)||i&&e.split(r).length-i.split(r).length==1||-1===e.indexOf(r)&&-1===n.indexOf(r)||0===n.indexOf(e)||0===e.indexOf(t+r)&&(a||0===e.indexOf(n)))}),o.data=ke(n.map(function(e){var t,n,r,i,a=e[0],e=e[1];return e=e,a=a,t=c,n=De(f),r=s.exhaustive,{name:(i=a.split(t))[i.length-1].trim(),path:a,escapedValue:$e(a),count:e,isRefined:n===a||0===n.indexOf(a+t),exhaustive:r,data:null}}),a[0],a[1])),e}var a,c,u,l,f,r=m.hierarchicalFacets[t],i=m.hierarchicalFacetsRefinements[r.name]&&m.hierarchicalFacetsRefinements[r.name][0]||"",s=m._getHierarchicalFacetSeparator(r),o=m._getHierarchicalRootPath(r),h=m._getHierarchicalShowParentLevel(r),r=He(m._getHierarchicalFacetSortBy(r)),d=e.every(function(e){return e.exhaustive}),r=(a=r,c=s,l=h,f=i,e);return(r=(u=o)?e.slice(o.split(s).length):r).reduce(n,{name:m.hierarchicalFacets[t].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:d,data:null})}},$e=R,De=b;var Qe=R,Be=b;function Le(e){var n={};return e.forEach(function(e,t){n[e]=t}),n}function qe(e,t,n){t&&t[n]&&(e.stats=t[n])}function F(l,t,n){var o=t[0],f=(this._rawResults=t,this),e=(Object.keys(o).forEach(function(e){f[e]=o[e]}),Object.keys(n||{}).forEach(function(e){f[e]=n[e]}),this.processingTimeMS=t.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=l.hierarchicalFacets.map(function(){return[]}),this.facets=[],l.getRefinedDisjunctiveFacets()),c=Le(l.facets),u=Le(l.disjunctiveFacets),r=1,h=o.facets||{};Object.keys(h).forEach(function(e){var t,n,r,i,a=h[e],s=(r=l.hierarchicalFacets,t=e,y(r,function(e){return-1<(e.attributes||[]).indexOf(t)}));s?(r=s.attributes.indexOf(e),n=Te(l.hierarchicalFacets,function(e){return e.name===s.name}),f.hierarchicalFacets[n][r]={attribute:e,data:a,exhaustive:o.exhaustiveFacetsCount}):(n=-1!==l.disjunctiveFacets.indexOf(e),r=-1!==l.facets.indexOf(e),n&&(i=u[e],f.disjunctiveFacets[i]={name:e,data:a,exhaustive:o.exhaustiveFacetsCount},qe(f.disjunctiveFacets[i],o.facets_stats,e)),r&&(i=c[e],f.facets[i]={name:e,data:a,exhaustive:o.exhaustiveFacetsCount},qe(f.facets[i],o.facets_stats,e)))}),this.hierarchicalFacets=Ne(this.hierarchicalFacets),e.forEach(function(e){var i=t[r],a=i&&i.facets?i.facets:{},s=l.getHierarchicalFacetByName(e);Object.keys(a).forEach(function(t){var n,e,r=a[t];s?(n=Te(l.hierarchicalFacets,function(e){return e.name===s.name}),-1!==(e=Te(f.hierarchicalFacets[n],function(e){return e.attribute===t}))&&(f.hierarchicalFacets[n][e].data=v({},f.hierarchicalFacets[n][e].data,r))):(n=u[t],e=o.facets&&o.facets[t]||{},f.disjunctiveFacets[n]={name:t,data:x({},r,e),exhaustive:i.exhaustiveFacetsCount},qe(f.disjunctiveFacets[n],i.facets_stats,t),l.disjunctiveFacetsRefinements[t]&&l.disjunctiveFacetsRefinements[t].forEach(function(e){!f.disjunctiveFacets[n].data[e]&&-1<l.disjunctiveFacetsRefinements[t].indexOf(Be(e))&&(f.disjunctiveFacets[n].data[e]=0)}))}),r++}),l.getRefinedHierarchicalFacets().forEach(function(e){var o=l.getHierarchicalFacetByName(e),c=l._getHierarchicalFacetSeparator(o),u=l.getHierarchicalRefinement(e);0===u.length||u[0].split(c).length<2||t.slice(r).forEach(function(e){var s=e&&e.facets?e.facets:{};Object.keys(s).forEach(function(t){var e,n,r=s[t],i=Te(l.hierarchicalFacets,function(e){return e.name===o.name}),a=Te(f.hierarchicalFacets[i],function(e){return e.attribute===t});-1!==a&&(e={},0<u.length&&(e[n=u[0].split(c)[0]]=f.hierarchicalFacets[i][a].data[n]),f.hierarchicalFacets[i][a].data=x(e,r,f.hierarchicalFacets[i][a].data))}),r++})}),Object.keys(l.facetsExcludes).forEach(function(t){var e=l.facetsExcludes[t],n=c[t];f.facets[n]={name:t,data:o.facets[t],exhaustive:o.exhaustiveFacetsCount},e.forEach(function(e){f.facets[n]=f.facets[n]||{name:t},f.facets[n].data=f.facets[n].data||{},f.facets[n].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(Me(l)),this.facets=Ne(this.facets),this.disjunctiveFacets=Ne(this.disjunctiveFacets),this._state=l}function Ue(n,r){function e(e){return e.name===r}var i,a,t,s;return n._state.isConjunctiveFacet(r)?(i=y(n.facets,e))?Object.keys(i.data).map(function(e){var t=Qe(e);return{name:e,escapedValue:t,count:i.data[e],isRefined:n._state.isFacetRefined(r,t),isExcluded:n._state.isExcludeRefined(r,e)}}):[]:n._state.isDisjunctiveFacet(r)?(a=y(n.disjunctiveFacets,e))?Object.keys(a.data).map(function(e){var t=Qe(e);return{name:e,escapedValue:t,count:a.data[e],isRefined:n._state.isDisjunctiveFacetRefined(r,t)}}):[]:n._state.isHierarchicalFacet(r)?((t=y(n.hierarchicalFacets,e))&&(s=n._state.getHierarchicalFacetByName(r),(s=Be(n._state.getHierarchicalRefinement(r)[0]||"").split(n._state._getHierarchicalFacetSeparator(s))).unshift(r),function t(e,n,r){e.isRefined=e.name===n[r];e.data&&e.data.forEach(function(e){t(e,n,r+1)})}(t,s,0)),t):void 0}function We(e,t){e=y(e,function(e){return e.name===t});return e&&e.stats}function ze(e,t,n,r,i){var i=y(i,function(e){return e.name===n}),a=i&&i.data&&i.data[r]?i.data[r]:0,i=i&&i.exhaustive||!1;return{type:t,attributeName:n,name:r,count:a,exhaustive:i}}F.prototype.getFacetByName=function(t){function e(e){return e.name===t}return y(this.facets,e)||y(this.disjunctiveFacets,e)||y(this.hierarchicalFacets,e)},F.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],F.prototype.getFacetValues=function(e,t){var s,o,n=Ue(this,e);if(n)return s=x({},t,{sortBy:F.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),o=this,function t(n,e,r,i){var a;return i=i||0,Array.isArray(e)?n(e,r[i]):e.data&&0!==e.data.length?(a=e.data.map(function(e){return t(n,e,r,i+1)}),a=n(a,r[i]),x({data:a},e)):e}(function(e,t){if(s.facetOrdering){t=t;a=(a=o).renderingContent&&a.renderingContent.facetOrdering&&a.renderingContent.facetOrdering.values&&a.renderingContent.facetOrdering.values[t];if(Boolean(a))return t=e,n=[],r=[],i=((a=a).order||[]).reduce(function(e,t,n){return e[t]=n,e},{}),t.forEach(function(e){var t=e.path||e.name;void 0!==i[t]?n[i[t]]=e:r.push(e)}),n=n.filter(function(e){return e}),"hidden"===(t=a.sortRemainingBy)?n:n.concat(ke(r,(a="alpha"===t?[["path","name"],["asc","asc"]]:[["count"],["desc"]])[0],a[1]))}var n,r,i,a;if(Array.isArray(s.sortBy))return t=He(s.sortBy,F.DEFAULT_SORT),ke(e,t[0],t[1]);if("function"==typeof s.sortBy)return a=s.sortBy,e.sort(a);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},n,Array.isArray(n)?[e]:o._state.getHierarchicalFacetByName(n.name).attributes)},F.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?We(this.facets,e):this._state.isDisjunctiveFacet(e)?We(this.disjunctiveFacets,e):void 0},F.prototype.getRefinements=function(){var s=this._state,o=this,c=[];return Object.keys(s.facetsRefinements).forEach(function(t){s.facetsRefinements[t].forEach(function(e){c.push(ze(0,"facet",t,e,o.facets))})}),Object.keys(s.facetsExcludes).forEach(function(t){s.facetsExcludes[t].forEach(function(e){c.push(ze(0,"exclude",t,e,o.facets))})}),Object.keys(s.disjunctiveFacetsRefinements).forEach(function(t){s.disjunctiveFacetsRefinements[t].forEach(function(e){c.push(ze(0,"disjunctive",t,e,o.disjunctiveFacets))})}),Object.keys(s.hierarchicalFacetsRefinements).forEach(function(a){s.hierarchicalFacetsRefinements[a].forEach(function(e){var t,n,r,i;c.push((t=s,n=a,e=e,r=o.hierarchicalFacets,i=t.getHierarchicalFacetByName(n),t=t._getHierarchicalFacetSeparator(i),i=e.split(t),e=y(r,function(e){return e.name===n}),t=i.reduce(function(e,t){var n=e&&y(e.data,function(e){return e.name===t});return void 0!==n?n:e},e),r=t&&t.count||0,i=t&&t.exhaustive||!1,e=t&&t.path||"",{type:"hierarchical",attributeName:n,name:e,count:r,exhaustive:i}))})}),Object.keys(s.numericRefinements).forEach(function(n){var e=s.numericRefinements[n];Object.keys(e).forEach(function(t){e[t].forEach(function(e){c.push({type:"numeric",attributeName:n,name:e,numericValue:e,operator:t})})})}),s.tagRefinements.forEach(function(e){c.push({type:"tag",attributeName:"_tags",name:e})}),c};var Je=F;function P(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}b=P;function C(e){return"function"==typeof e}function Ye(e){return"object"==typeof e&&null!==e}function Ge(e){return void 0===e}P.prototype._events=void 0,P.prototype._maxListeners=void 0,P.defaultMaxListeners=10,P.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},P.prototype.emit=function(e){var t,n,r,i,a,s,o;if((this._events||(this._events={}),"error"===e)&&(!this._events.error||Ye(this._events.error)&&!this._events.error.length))throw(o=arguments[1])instanceof Error?o:((s=new Error('Uncaught, unspecified "error" event. ('+o+")")).context=o,s);if(Ge(t=this._events[e]))return!1;if(C(t))switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:r=Array.prototype.slice.call(arguments,1),t.apply(this,r)}else if(Ye(t))for(r=Array.prototype.slice.call(arguments,1),n=(a=t.slice()).length,i=0;i<n;i++)a[i].apply(this,r);return!0},P.prototype.on=P.prototype.addListener=function(e,t){if(C(t))return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,C(t.listener)?t.listener:t),this._events[e]?Ye(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Ye(this._events[e])&&!this._events[e].warned&&(t=Ge(this._maxListeners)?P.defaultMaxListeners:this._maxListeners)&&0<t&&this._events[e].length>t&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace)&&console.trace(),this;throw TypeError("listener must be a function")},P.prototype.once=function(e,t){var n;if(C(t))return n=!1,r.listener=t,this.on(e,r),this;throw TypeError("listener must be a function");function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}},P.prototype.removeListener=function(e,t){var n,r,i,a;if(!C(t))throw TypeError("listener must be a function");if(this._events&&this._events[e])if(i=(n=this._events[e]).length,r=-1,n===t||C(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Ye(n)){for(a=i;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},P.prototype.removeAllListeners=function(e){var t,n;if(this._events)if(this._events.removeListener)if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);this.removeAllListeners("removeListener"),this._events={}}else{if(C(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);delete this._events[e]}else 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e];return this},P.prototype.listeners=function(e){e=this._events&&this._events[e]?C(this._events[e])?[this._events[e]]:this._events[e].slice():[];return e},P.prototype.listenerCount=function(e){if(this._events){e=this._events[e];if(C(e))return 1;if(e)return e.length}return 0},P.listenerCount=function(e,t){return e.listenerCount(t)};var S=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};function Ke(e,t){this.main=e,this.fn=t,this.lastResults=null}S(Ke,b),Ke.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},Ke.prototype.getModifiedState=function(e){return this.fn(e)};var Xe=Ke;function Ze(n){return Object.keys(n).sort(function(e,t){return e.localeCompare(t)}).reduce(function(e,t){return e[t]=n[t],e},{})}var V={_getQueries:function(o,c){var u=[];return u.push({indexName:o,params:V._getHitsSearchParams(c)}),c.getRefinedDisjunctiveFacets().forEach(function(e){u.push({indexName:o,params:V._getDisjunctiveFacetSearchParams(c,e)})}),c.getRefinedHierarchicalFacets().forEach(function(e){var a,s=c.getHierarchicalFacetByName(e),e=c.getHierarchicalRefinement(e),r=c._getHierarchicalFacetSeparator(s);0<e.length&&1<e[0].split(r).length&&(a=e[0].split(r).slice(0,-1).reduce(function(e,t,n){return e.concat({attribute:s.attributes[n],value:0===n?t:[e[e.length-1].value,t].join(r)})},[])).forEach(function(e,t){e=V._getDisjunctiveFacetSearchParams(c,e.attribute,0===t);function r(t){return s.attributes.some(function(e){return e===t.split(":")[0]})}var n=(e.facetFilters||[]).reduce(function(e,t){var n;return Array.isArray(t)&&0<(n=t.filter(function(e){return!r(e)})).length&&e.push(n),"string"!=typeof t||r(t)||e.push(t),e},[]),i=a[t-1];e.facetFilters=0<t?n.concat(i.attribute+":"+i.value):0<n.length?n:void 0,u.push({indexName:o,params:e})})}),u},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(V._getHitsHierarchicalFacetsAttributes(e)),n=V._getFacetFilters(e),r=V._getNumericFilters(e),i=V._getTagFilters(e),t={facets:-1<t.indexOf("*")?["*"]:t,tagFilters:i};return 0<n.length&&(t.facetFilters=n),0<r.length&&(t.numericFilters=r),Ze(v({},e.getQueryParams(),t))},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=V._getFacetFilters(e,t,n),i=V._getNumericFilters(e,t),a=V._getTagFilters(e),s={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1},a=(0<a.length&&(s.tagFilters=a),e.getHierarchicalFacetByName(t));return s.facets=a?V._getDisjunctiveHierarchicalFacetAttribute(e,a,n):t,0<i.length&&(s.numericFilters=i),0<r.length&&(s.facetFilters=r),Ze(v({},e.getQueryParams(),s))},_getNumericFilters:function(e,i){var a;return e.numericFilters||(a=[],Object.keys(e.numericRefinements).forEach(function(r){var t=e.numericRefinements[r]||{};Object.keys(t).forEach(function(n){var e=t[n]||[];i!==r&&e.forEach(function(e){var t;Array.isArray(e)?(t=e.map(function(e){return r+n+e}),a.push(t)):a.push(r+n+e)})})}),a)},_getTagFilters:function(e){return e.tagFilters||e.tagRefinements.join(",")},_getFacetFilters:function(s,o,c){var u=[],e=s.facetsRefinements||{},n=(Object.keys(e).forEach(function(t){(e[t]||[]).forEach(function(e){u.push(t+":"+e)})}),s.facetsExcludes||{}),r=(Object.keys(n).forEach(function(t){(n[t]||[]).forEach(function(e){u.push(t+":-"+e)})}),s.disjunctiveFacetsRefinements||{}),l=(Object.keys(r).forEach(function(t){var n,e=r[t]||[];t!==o&&e&&0!==e.length&&(n=[],e.forEach(function(e){n.push(t+":"+e)}),u.push(n))}),s.hierarchicalFacetsRefinements||{});return Object.keys(l).forEach(function(e){var t=(l[e]||[])[0];if(void 0!==t){var n,r=s.getHierarchicalFacetByName(e),i=s._getHierarchicalFacetSeparator(r),a=s._getHierarchicalRootPath(r);if(o===e){if(-1===t.indexOf(i)||!a&&!0===c||a&&a.split(i).length===t.split(i).length)return;t=a?(n=a.split(i).length-1,a):(n=t.split(i).length-2,t.slice(0,t.lastIndexOf(i)))}else n=t.split(i).length-1;(e=r.attributes[n])&&u.push([e+":"+t])}}),u},_getHitsHierarchicalFacetsAttributes:function(i){return i.hierarchicalFacets.reduce(function(e,t){var n,r=i.getHierarchicalRefinement(t.name)[0];return r?(n=i._getHierarchicalFacetSeparator(t),r=r.split(n).length,n=t.attributes.slice(0,r+1),e.concat(n)):(e.push(t.attributes[0]),e)},[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r,i=e._getHierarchicalFacetSeparator(t);return!0===n?(n=0,(r=e._getHierarchicalRootPath(t))&&(n=r.split(i).length),[t.attributes[n]]):(r=(e.getHierarchicalRefinement(t.name)[0]||"").split(i).length-1,t.attributes.slice(0,1+r))},getSearchForFacetQuery:function(e,t,n,r){r=r.isDisjunctiveFacet(e)?r.clearRefinements(e):r,t={facetQuery:t,facetName:e};return"number"==typeof n&&(t.maxFacetHits=n),Ze(v({},V._getHitsSearchParams(r),t))}},w=V,j="3.11.3",et=R;function E(e,t,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.3)"),this.setClient(e);e=n||{};e.index=t,this.state=Ae.make(e),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function tt(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function nt(){return this.state.page}S(E,b),E.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},E.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},E.prototype.getQuery=function(){var e=this.state;return w._getHitsSearchParams(e)},E.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,e=w._getQueries(n.index,n),r=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(e).then(function(e){return r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),{content:new Je(n,e.results),state:n,_originalResponse:e}},function(e){throw r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),e});this.client.search(e).then(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(null,new Je(n,e.results),n)}).catch(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(e,null,n)})},E.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,n=this.derivedHelpers[0];if(!n)return Promise.resolve([]);var n=n.getModifiedState(t),t=v({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:_e(w._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),r="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(r);var i=this.client.initIndex(n.index);if("function"!=typeof i.findAnswers)throw new Error(r);return i.findAnswers(n.query,e.queryLanguages,t)},E.prototype.searchForFacetValues=function(t,e,n,r){var i,a,s,o="function"==typeof this.client.searchForFacetValues,c="function"==typeof this.client.initIndex;if(o||c||"function"==typeof this.client.search)return i=this.state.setQueryParameters(r||{}),a=i.isDisjunctiveFacet(t),r=w.getSearchForFacetQuery(t,e,n,i),this._currentNbQueries++,s=this,n=o?this.client.searchForFacetValues([{indexName:i.index,params:r}]):c?this.client.initIndex(i.index).searchForFacetValues(r):(delete r.facetName,this.client.search([{type:"facet",facet:t,indexName:i.index,params:r}]).then(function(e){return e.results[0]})),this.emit("searchForFacetValues",{state:i,facet:t,query:e}),n.then(function(e){return s._currentNbQueries--,0===s._currentNbQueries&&s.emit("searchQueueEmpty"),(e=Array.isArray(e)?e[0]:e).facetHits.forEach(function(e){e.escapedValue=et(e.value),e.isRefined=a?i.isDisjunctiveFacetRefined(t,e.escapedValue):i.isFacetRefined(t,e.escapedValue)}),e},function(e){throw s._currentNbQueries--,0===s._currentNbQueries&&s.emit("searchQueueEmpty"),e});throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues")},E.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},E.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},E.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},E.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},E.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},E.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},E.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},E.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},E.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},E.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},E.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},E.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},E.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},E.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},E.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},E.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},E.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},E.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},E.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},E.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},E.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},E.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},E.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},E.prototype.setCurrentPage=tt,E.prototype.setPage=tt,E.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},E.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},E.prototype.setState=function(e){return this._change({state:Ae.make(e),isPageReset:!1}),this},E.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new Ae(e),this},E.prototype.hasRefinements=function(e){return!!Oe(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},E.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},E.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},E.prototype.hasTag=function(e){return this.state.isTagRefined(e)},E.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},E.prototype.getIndex=function(){return this.state.index},E.prototype.getCurrentPage=nt,E.prototype.getPage=nt,E.prototype.getTags=function(){return this.state.tagRefinements},E.prototype.getRefinements=function(e){var n=[],r=(this.state.isConjunctiveFacet(e)?(this.state.getConjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"conjunctive"})}),this.state.getExcludeRefinements(e).forEach(function(e){n.push({value:e,type:"exclude"})})):this.state.isDisjunctiveFacet(e)&&this.state.getDisjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"disjunctive"})}),this.state.getNumericRefinements(e));return Object.keys(r).forEach(function(e){var t=r[e];n.push({value:t,operator:e,type:"numeric"})}),n},E.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},E.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},E.prototype._search=function(e){var r=this.state,i=[],t=[],e=(e.onlyWithDerivedHelpers||(t=w._getQueries(r.index,r),i.push({state:r,queriesCount:t.length,helper:this}),this.emit("search",{state:r,results:this.lastResults})),this.derivedHelpers.map(function(e){var t=e.getModifiedState(r),n=w._getQueries(t.index,t);return i.push({state:t,queriesCount:n.length,helper:e}),e.emit("search",{state:t,results:e.lastResults}),n})),t=Array.prototype.concat.apply(t,e),e=this._queryId++;this._currentNbQueries++;try{this.client.search(t).then(this._dispatchAlgoliaResponse.bind(this,i,e)).catch(this._dispatchAlgoliaError.bind(this,e))}catch(e){this.emit("error",{error:e})}},E.prototype._dispatchAlgoliaResponse=function(e,t,n){var r;t<this._lastQueryIdReceived||(this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty"),r=n.results.slice(),e.forEach(function(e){var t=e.state,n=e.queriesCount,e=e.helper,n=r.splice(0,n),n=e.lastResults=new Je(t,n);e.emit("result",{results:n,state:t})}))},E.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},E.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},E.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&0<this.state.disjunctiveRefinements[e].length},E.prototype._change=function(e){var t=e.state,e=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:e}))},E.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},E.prototype.setClient=function(e){return this.client!==e&&("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.3)"),this.client=e),this},E.prototype.getClient=function(){return this.client},E.prototype.derive=function(e){e=new Xe(this,e);return this.derivedHelpers.push(e),e},E.prototype.detachDerivedHelper=function(e){e=this.derivedHelpers.indexOf(e);if(-1===e)throw new Error("Derived helper already detached");this.derivedHelpers.splice(e,1)},E.prototype.hasPendingRequests=function(){return 0<this._currentNbQueries};var rt=E;function it(e,t,n){return new rt(e,t,n)}it.version=j,it.AlgoliaSearchHelper=rt,it.SearchParameters=Ae,it.SearchResults=Je;var A=it;function at(e){var t=e.attributeName,n=e.attributeValue,e=e.attributeScore;return"".concat(t,":").concat(n,"<score=").concat(e||1,">")}function st(){return"configure"}function ot(a){var e=Object.keys(a.matchingPatterns).reduce(function(e,t){var n=a.matchingPatterns[t],r=ue(a.hit,t),i=n.score;return Array.isArray(r)?[].concat(m(e),[r.map(function(e){return at({attributeName:t,attributeValue:e,attributeScore:i})})]):"string"==typeof r?[].concat(m(e),[at({attributeName:t,attributeValue:r,attributeScore:i})]):e},[]);return a.transformSearchParameters(new A.SearchParameters({sumOrFiltersScores:!0,facetFilters:["objectID:-".concat(a.hit.objectID)],optionalFilters:e}))}R=t({displayName:"AlgoliaConfigureRelatedItems",$$type:"ais.configureRelatedItems",defaultProps:{transformSearchParameters:function(e){return I({},e)}},getProvidedProps:function(){return{}},getSearchParameters:function(e,t){return e.setQueryParameters(ot(t))},transitionState:function(e,t,n){var r,i=st(),a=(r=ie(ot(e)),Object.keys(r).forEach(function(e){var t=r[e];Array.isArray(t)&&0===t.length&&delete r[e]}),r),s=Object.keys(a),o=this._searchParameters?Object.keys(this._searchParameters).filter(function(e){return-1===s.indexOf(e)}):[];return this._searchParameters=a,g(n,_({},i,I(I({},l(n[i],o)),a)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){var n=this,r=st(),i=h({ais:e.contextValue,multiIndexContext:e.indexContextValue}),a=d({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&t.indices?t.indices[i]:t,i=(a&&a[r]?Object.keys(a[r]):[]).reduce(function(e,t){return n._searchParameters[t]||(e[t]=a[r][t]),e},{});return g(t,_({},r,i),{ais:e.contextValue,multiIndexContext:e.indexContextValue})}}),S=("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).performance||{};S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow;function ct(e,t){return e(t={exports:{}},t.exports),t.exports}var b="function"==typeof Symbol&&Symbol.for,ut=b?Symbol.for("react.element"):60103,lt=b?Symbol.for("react.portal"):60106,ft=b?Symbol.for("react.fragment"):60107,ht=b?Symbol.for("react.strict_mode"):60108,dt=b?Symbol.for("react.profiler"):60114,mt=b?Symbol.for("react.provider"):60109,pt=b?Symbol.for("react.context"):60110,gt=b?Symbol.for("react.async_mode"):60111,xt=b?Symbol.for("react.concurrent_mode"):60111,vt=b?Symbol.for("react.forward_ref"):60112,yt=b?Symbol.for("react.suspense"):60113,Rt=b?Symbol.for("react.suspense_list"):60120,bt=b?Symbol.for("react.memo"):60115,Ft=b?Symbol.for("react.lazy"):60116,Pt=b?Symbol.for("react.block"):60121,Ct=b?Symbol.for("react.fundamental"):60117,St=b?Symbol.for("react.responder"):60118,Vt=b?Symbol.for("react.scope"):60119;function N(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ut:switch(e=e.type){case gt:case xt:case ft:case dt:case ht:case yt:return e;default:switch(e=e&&e.$$typeof){case pt:case vt:case Ft:case bt:case mt:return e;default:return t}}case lt:return t}}}function wt(e){return N(e)===xt}var jt={AsyncMode:gt,ConcurrentMode:xt,ContextConsumer:pt,ContextProvider:mt,Element:ut,ForwardRef:vt,Fragment:ft,Lazy:Ft,Memo:bt,Portal:lt,Profiler:dt,StrictMode:ht,Suspense:yt,isAsyncMode:function(e){return wt(e)||N(e)===gt},isConcurrentMode:wt,isContextConsumer:function(e){return N(e)===pt},isContextProvider:function(e){return N(e)===mt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ut},isForwardRef:function(e){return N(e)===vt},isFragment:function(e){return N(e)===ft},isLazy:function(e){return N(e)===Ft},isMemo:function(e){return N(e)===bt},isPortal:function(e){return N(e)===lt},isProfiler:function(e){return N(e)===dt},isStrictMode:function(e){return N(e)===ht},isSuspense:function(e){return N(e)===yt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===ft||e===xt||e===dt||e===ht||e===yt||e===Rt||"object"==typeof e&&null!==e&&(e.$$typeof===Ft||e.$$typeof===bt||e.$$typeof===mt||e.$$typeof===pt||e.$$typeof===vt||e.$$typeof===Ct||e.$$typeof===St||e.$$typeof===Vt||e.$$typeof===Pt)},typeOf:N},j=ct(function(e,t){});j.AsyncMode,j.ConcurrentMode,j.ContextConsumer,j.ContextProvider,j.Element,j.ForwardRef,j.Fragment,j.Lazy,j.Memo,j.Portal,j.Profiler,j.StrictMode,j.Suspense,j.isAsyncMode,j.isConcurrentMode,j.isContextConsumer,j.isContextProvider,j.isElement,j.isForwardRef,j.isFragment,j.isLazy,j.isMemo,j.isPortal,j.isProfiler,j.isStrictMode,j.isSuspense,j.isValidElementType,j.typeOf,ct(function(e){e.exports=jt});function It(){}function _t(){}_t.resetWarningCache=It;S=ct(function(e){function t(e,t,n,r,i,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a)throw(a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")).name="Invariant Violation",a}function n(){return t}e.exports=(e={array:t.isRequired=t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:_t,resetWarningCache:It}).PropTypes=e});function Ot(){return null}Ot.propTypes={hit:S.object.isRequired,matchingPatterns:S.object.isRequired,transformSearchParameters:S.func};b=R(Ot,{$$widgetType:"ais.configureRelatedItems"}),j=t({displayName:"AlgoliaDynamicWidgets",$$type:"ais.dynamicWidgets",defaultProps:{transformItems:function(e){return e},maxValuesPerFacet:20},propTypes:{transformItems:S.func,facets:S.arrayOf(S.string),maxValuesPerFacet:S.number},getProvidedProps:function(e,t,n){var r,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!e.facets||Array.isArray(e.facets)&&e.facets.length<=1&&("*"===e.facets[0]||void 0===e.facets[0]))return n?(r=n.renderingContent&&n.renderingContent.facetOrdering&&n.renderingContent.facetOrdering.facets&&n.renderingContent.facetOrdering.facets.order||[],20<(r=e.transformItems(r,{results:n})).length&&!e.facets&&console.warn("More than ".concat(20," facets are requested to be displayed without explicitly setting which facets to retrieve. This could have a performance impact. Set \"facets\" to [] to do two smaller network requests, or explicitly to ['*'] to avoid this warning.")),e.maxValuesPerFacet<n._state.maxValuesPerFacet&&console.warn("The maxValuesPerFacet set by dynamic widgets (".concat(e.maxValuesPerFacet,") is smaller than one of the limits set by a widget (").concat(n._state.maxValuesPerFacet,"). This causes a mismatch in query parameters and thus an extra network request when that widget is mounted.")),{attributesToRender:r}):{attributesToRender:[]};throw new Error('The `facets` prop only accepts [] or ["*"], you passed '.concat(JSON.stringify(e.facets)))},getSearchParameters:function(e,t){return(t.facets||["*"]).reduce(function(e,t){return e.addFacet(t)},e.setQueryParameters({maxValuesPerFacet:Math.max(t.maxValuesPerFacet||0,e.maxValuesPerFacet||0)}))}});function Et(e){var t;if("object"===s(t=e)&&t.props)return e.props.attribute||(Array.isArray(e.props.attributes)?e.props.attributes[0]:e.props.children?Et(o.Children.only(e.props.children)):void 0)}var At=j(function(e){var t=e.children,n=e.attributesToRender,r=void 0===(e=e.fallbackComponent)?function(){return null}:e,i=new Map;return o.Children.forEach(t,function(e){var t=Et(e);if(!t)throw new Error('Could not find "attribute" prop for '.concat(ne(e),"."));i.set(t,e)}),o.createElement(o.Fragment,null,n.map(function(e){return o.createElement(a.Fragment,{key:e},i.get(e)||o.createElement(r,{attribute:e}))}))},{$$widgetType:"ais.dynamicWidgets"});function Nt(r,e){var i=1<arguments.length&&void 0!==e?e:{};return Object.keys(i).filter(function(e){return void 0!==i[e]&&void 0!==i[e][r]}).map(function(e){var t=r,n=i[e];switch(e){case"range":return Object.keys(n[t]).map(function(e){return n[t][e]});case"refinementList":return n[t];case"hierarchicalMenu":case"menu":return[n[t]];case"multiRange":return n[t].split(":");case"toggle":return[n[t]];default:return[]}}).reduce(function(e,t){return e.concat(t)},[])}var Tt=t({displayName:"AlgoliaQueryRules",$$type:"ais.queryRules",defaultProps:{transformItems:function(e){return e},transformRuleContexts:function(e){return e},trackedFilters:{}},getProvidedProps:function(e,t,n){var n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return null===n?{items:[],canRefine:!1}:(n=n.userData,{items:e=(0,e.transformItems)(void 0===n?[]:n),canRefine:0<e.length})},getSearchParameters:function(e,t,n){var i,a,r;return 0===Object.keys(t.trackedFilters).length?e:(n=d({ais:t.contextValue,multiIndexContext:t.indexContextValue})&&n.indices?n.indices[h({ais:t.contextValue,multiIndexContext:t.indexContextValue})]:n,n={searchState:n,trackedFilters:t.trackedFilters},i=n.searchState,a=n.trackedFilters,n=Object.keys(a).reduce(function(e,t){var n=Nt(t,i),r=(0,a[t])(n);return[].concat(m(e),m(n.filter(function(e){return r.includes(e)}).map(function(e){return"ais-".concat(t,"-").concat(e).replace(/[^a-z0-9-_]+/gi,"_")})))},[]),r=e.ruleContexts||[],r=[].concat(m(r),m(n)),n=t.transformRuleContexts(r).slice(0,10),e.setQueryParameter("ruleContexts",n))}}),Ht=Tt(function(){return null},{$$widgetType:"ais.queryRuleContext"});function kt(e){return{targetedIndex:e.indexId}}var Mt=function(){Q(n,a.Component);var t=q(n);function n(e){return k(this,n),_(c(e=t.call(this,e)),"state",{indexContext:kt(e.props)}),_(c(e),"unregisterWidget",void 0),e.props.contextValue.onSearchParameters(e.getSearchParameters.bind(c(e)),{ais:e.props.contextValue,multiIndexContext:e.state.indexContext},e.props,void 0,n.displayName),e}return $(n,[{key:"componentDidMount",value:function(){this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this)}},{key:"componentDidUpdate",value:function(e){this.props.indexName!==e.indexName&&this.props.contextValue.widgetsManager.update()}},{key:"componentWillUnmount",value:function(){"function"==typeof this.unregisterWidget&&this.unregisterWidget()}},{key:"getSearchParameters",value:function(e,t){return e.setIndex((this.props||t).indexName)}},{key:"render",value:function(){return 0===a.Children.count(this.props.children)?null:o.createElement(ge,{value:this.state.indexContext},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e){return{indexContext:kt(e)}}}]),n}();_(Mt,"displayName","AlgoliaIndex"),_(Mt,"$$type","ais.index"),_(Mt,"$$widgetType","ais.index");var $t=["resultsFacetValues"],Dt=["resultsFacetValues"],Qt=["resultsFacetValues"];function Bt(e){"function"==typeof e.addAlgoliaAgent&&(e.addAlgoliaAgent("react (".concat(a.version,")")),e.addAlgoliaAgent("react-instantsearch (".concat(Re,")")))}var Lt=function(e){return d({ais:e.props.contextValue,multiIndexContext:e.props.indexContextValue})},qt=function(e,t){return e.props.indexContextValue.targetedIndex===t},Ut=function(e){return Boolean(e.props.indexId)},Wt=function(e,t){return e.props.indexId===t},zt=function(e,t){e=Ut(e),t=Ut(t);return e&&!t?-1:!e&&t?1:0};function Jt(n){return Object.keys(n).map(function(e){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0;return e.replace(/%s/g,function(){return encodeURIComponent(n[i++])})}("%s=%s",e,(t=n[e],"[object Object]"===Object.prototype.toString.call(t)||"[object Array]"===Object.prototype.toString.call(t)?JSON.stringify(n[e]):n[e]));var t}).join("&")}function Yt(e){var i,t,n,r,a,s,o,c,u,l=e.indexName,f=e.initialState,f=void 0===f?{}:f,h=e.searchClient,d=e.resultsState,m=e.stalledSearchDelay,p=A(h,l,I({},ve)),g=(Bt(h),p.on("search",function(){x=x||setTimeout(function(){var e=P.getState(),e=(e.resultsFacetValues,O(e,Qt));P.setState(I(I({},e),{},{isSearchStalled:!0}))},m)}).on("result",w({indexId:l})).on("error",j),!1),x=null,v=p.state,y=(t=function(){var e=C(P.getState().widgets);P.setState(I(I({},P.getState()),{},{metadata:e,searching:!0})),V()},r=!(n=[]),{registerWidget:function(e){return n.push(e),R(),function(){n.splice(n.indexOf(e),1),R()}},update:R,getWidgets:function(){return n}});function R(){r||(r=!0,Z(function(){r=!1,t()}))}a=h,(e=d)&&(a.transporter&&!a._cacheHydrated||a._useCache&&"function"==typeof a.addAlgoliaAgent)&&(a.transporter&&!a._cacheHydrated&&(a._cacheHydrated=!0,s=a.search,a.search=function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=e.map(function(e){return I(I({},e),{},{params:Jt(e.params)})});return a.transporter.responsesCache.get({method:"search",args:[i].concat(n)},function(){return s.apply(void 0,[e].concat(n))})}),Array.isArray(e.results)?(u=a,o=e.results,u.transporter?u.transporter.responsesCache.set({method:"search",args:[o.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])]},{results:o.reduce(function(e,t){return e.concat(t.rawResults)},[])}):(c="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:o.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])})),u.cache=I(I({},u.cache),{},_({},c,JSON.stringify({results:o.reduce(function(e,t){return e.concat(t.rawResults)},[])}))))):(u=e,(c=a).transporter?c.transporter.responsesCache.set({method:"search",args:[u.rawResults.map(function(e){return{indexName:e.index,params:e.params}})]},{results:u.rawResults}):(o="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:u.rawResults.map(function(e){return{indexName:e.index,params:e.params}})})),c.cache=I(I({},c.cache),{},_({},o,JSON.stringify({results:u.rawResults}))))));e={widgets:f,metadata:(h=d)?h.metadata.map(function(e){return I(I({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return I(I({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return I({value:function(){return{}}},e)})})})})}):[],results:function(e){if(!e)return null;if(Array.isArray(e.results))return e.results.reduce(function(e,t){return I(I({},e),{},_({},t._internalIndexId,new A.SearchResults(new A.SearchParameters(t.state),t.rawResults)))},{});return new A.SearchResults(new A.SearchParameters(e.state),e.rawResults)}(d),error:null,searching:!1,isSearchStalled:!0,searchingForFacetValues:!1},b=e,F=[];var b,F,P={getState:function(){return b},setState:function(e){b=e,F.forEach(function(e){return e()})},subscribe:function(e){return F.push(e),function(){F.splice(F.indexOf(e),1)}}};function C(t){return y.getWidgets().filter(function(e){return Boolean(e.getMetadata)}).map(function(e){return e.getMetadata(t)})}function S(){var t=y.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){return!Lt(e)&&!Ut(e)}).reduce(function(e,t){return t.getSearchParameters(e)},v),e=y.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=Lt(e)&&qt(e,l),e=Ut(e)&&Wt(e,l);return t||e}).sort(zt).reduce(function(e,t){return t.getSearchParameters(e)},t),n=y.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=Lt(e)&&!qt(e,l),e=Ut(e)&&!Wt(e,l);return t||e}).sort(zt).reduce(function(e,t){var n=Lt(t)?t.props.indexContextValue.targetedIndex:t.props.indexId,r=e[n]||[];return I(I({},e),{},_({},n,r.concat(t)))},{});return{mainParameters:e,derivedParameters:Object.keys(n).map(function(e){return{parameters:n[e].reduce(function(e,t){return t.getSearchParameters(e)},t),indexId:e}})}}function V(){var e,t;g||(e=(t=S()).mainParameters,t=t.derivedParameters,i=t.length+1,p.derivedHelpers.slice().forEach(function(e){e.detach()}),t.forEach(function(e){var t=e.indexId,n=e.parameters;p.derive(function(){return n}).on("result",w({indexId:t})).on("error",j)}),p.setState(e),p.search())}function w(e){var r=e.indexId;return function(e){i--;var t=P.getState(),n=!p.derivedHelpers.length,t=t.results||{},t=!n&&t.getFacetByName?{}:t,n=(t=n?e.results:I(I({},t),{},_({},r,e.results)),P.getState()),e=n.isSearchStalled,n=(p.hasPendingRequests()||(clearTimeout(x),x=null,e=!1),n.resultsFacetValues,O(n,$t));P.setState(I(I({},n),{},{results:t,isSearchStalled:e,searching:0<i,error:null}))}}function j(e){var e=e.error,t=P.getState(),n=t.isSearchStalled,t=(p.hasPendingRequests()||(clearTimeout(x),n=!1),t.resultsFacetValues,O(t,Dt));P.setState(I(I({},t),{},{isSearchStalled:n,error:e,searching:!1}))}return{store:P,widgetsManager:y,getWidgetsIds:function(){return P.getState().metadata.reduce(function(e,t){return void 0!==t.id?e.concat(t.id):e},[])},getSearchParameters:S,onSearchForFacetValues:function(e){var n=e.facetName,r=e.query,e=e.maxFacetHits,e=Math.max(1,Math.min(void 0===e?10:e,100));P.setState(I(I({},P.getState()),{},{searchingForFacetValues:!0})),p.searchForFacetValues(n,r,e).then(function(e){var t;P.setState(I(I({},P.getState()),{},{error:null,searchingForFacetValues:!1,resultsFacetValues:I(I({},P.getState().resultsFacetValues),{},(_(t={},n,e.facetHits),_(t,"query",r),t))}))},function(e){P.setState(I(I({},P.getState()),{},{searchingForFacetValues:!1,error:e}))}).catch(function(e){setTimeout(function(){throw e})})},onExternalStateUpdate:function(e){var t=C(e);P.setState(I(I({},P.getState()),{},{widgets:e,metadata:t,searching:!0})),V()},transitionState:function(e){var n=P.getState().widgets;return y.getWidgets().filter(function(e){return Boolean(e.transitionState)}).reduce(function(e,t){return t.transitionState(n,e)},e)},updateClient:function(e){Bt(e),p.setClient(e),V()},updateIndex:function(e){v=v.setIndex(e)},clearCache:function(){p.clearCache(),V()},skipSearch:function(){g=!0}}}function Gt(e,t){var a,n=document.createElement("meta"),r=document.querySelector("head"),t=(n.name="algolia:metadata",t=t,a=["contextValue","indexContextValue"],e=(e=e).map(function(e){var t=e.props,e=e.constructor,n=e._connectorDesc||{},r=n.defaultProps,i=void 0===r?{}:r,r=n.displayName;return{displayName:void 0===r?e.displayName:r,$$type:e.$$type,$$widgetType:e.$$widgetType,params:Object.keys(t).filter(function(e){return!a.includes(e)&&i[e]!==t[e]&&void 0!==t[e]})}}),{ua:t.transporter&&t.transporter.userAgent?t.transporter.userAgent.value:t._ua,widgets:e});n.content=JSON.stringify(t),r.appendChild(n)}function Kt(e){return Boolean(e.searchState)}function Xt(){return"query"}var Zt=function(){Q(i,a.Component);var r=q(i);function i(e){k(this,i),_(c(e=r.call(this,e)),"cleanupTimerRef",null),_(c(e),"isUnmounting",!1);var t=Yt({indexName:e.props.indexName,searchClient:e.props.searchClient,initialState:e.props.searchState||{},resultsState:e.props.resultsState,stalledSearchDelay:e.props.stalledSearchDelay}),n={store:t.store,widgetsManager:t.widgetsManager,mainTargetedIndex:e.props.indexName,onInternalStateUpdate:e.onWidgetsInternalStateUpdate.bind(c(e)),createHrefForState:e.createHrefForState.bind(c(e)),onSearchForFacetValues:e.onSearchForFacetValues.bind(c(e)),onSearchStateChange:e.onSearchStateChange.bind(c(e)),onSearchParameters:e.onSearchParameters.bind(c(e))};return e.state={isControlled:Kt(e.props),instantSearchManager:t,contextValue:n},e}return $(i,[{key:"componentDidUpdate",value:function(e){var t=Kt(e);if(t&&!this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled");if(!t&&this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled");this.props.refresh!==e.refresh&&this.props.refresh&&this.state.instantSearchManager.clearCache(),e.indexName!==this.props.indexName&&this.state.instantSearchManager.updateIndex(this.props.indexName),e.searchClient!==this.props.searchClient&&this.state.instantSearchManager.updateClient(this.props.searchClient)}},{key:"componentDidMount",value:function(){this.cleanupTimerRef&&(clearTimeout(this.cleanupTimerRef),this.cleanupTimerRef=null),"object"===("undefined"==typeof window?"undefined":s(window))&&"object"===s(window.navigator)&&"string"==typeof window.navigator.userAgent&&window.navigator.userAgent.includes("Algolia Crawler")&&"object"===s(window.document)&&Gt(this.state.instantSearchManager.widgetsManager.getWidgets(),this.props.searchClient)}},{key:"componentWillUnmount",value:function(){var e=this;this.cleanupTimerRef=setTimeout(function(){e.isUnmounting=!0,e.state.instantSearchManager.skipSearch()})}},{key:"createHrefForState",value:function(e){return e=this.state.instantSearchManager.transitionState(e),this.state.isControlled&&this.props.createURL?this.props.createURL(e,this.getKnownKeys()):"#"}},{key:"onWidgetsInternalStateUpdate",value:function(e){e=this.state.instantSearchManager.transitionState(e),this.onSearchStateChange(e),this.state.isControlled||this.state.instantSearchManager.onExternalStateUpdate(e)}},{key:"onSearchStateChange",value:function(e){this.props.onSearchStateChange&&!this.isUnmounting&&this.props.onSearchStateChange(e)}},{key:"onSearchParameters",value:function(e,t,n,r,i){var a;this.props.onSearchParameters&&(a=this.props.searchState||{},this.props.onSearchParameters(e,t,n,a)),this.props.widgetsCollector&&(a=this.props.searchState||{},this.props.widgetsCollector({getSearchParameters:e,getMetadata:r,context:t,props:n,searchState:a,displayName:i}))}},{key:"onSearchForFacetValues",value:function(e){this.state.instantSearchManager.onSearchForFacetValues(e)}},{key:"getKnownKeys",value:function(){return this.state.instantSearchManager.getWidgetsIds()}},{key:"render",value:function(){return 0===a.Children.count(this.props.children)?null:o.createElement(de,{value:this.state.contextValue},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=Kt(e),r=t.instantSearchManager.store.getState().widgets,i=e.searchState;return n&&!ee(r,i)&&t.instantSearchManager.onExternalStateUpdate(e.searchState),{isControlled:n,contextValue:I(I({},t.contextValue),{},{mainTargetedIndex:e.indexName})}}}]),i}();_(Zt,"defaultProps",{stalledSearchDelay:200,refresh:!1});function en(e,t,n){Xt();e=u(e,t,n,"query","");return e||""}function tn(e){return e.attributes[0]}var nn=t({displayName:"AlgoliaAutoComplete",$$type:"ais.autoComplete",getProvidedProps:function(e,t,n){return{hits:(r=n).results?r.results.hits&&Array.isArray(r.results.hits)?ae(se(r.results.hits,r.results.queryID),r.results.hitsPerPage,r.results.page):Object.keys(r.results).reduce(function(e,t){return[].concat(m(e),[{index:t,hits:ae(se(r.results[t].hits,r.results[t].queryID),r.results[t].hitsPerPage,r.results[t].page)}])},[]):[],currentRefinement:en(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue})};var r},refine:function(e,t,n){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},Xt(),g(t,_({},"query",n),e,!0)},cleanUp:function(e,t){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},r(t,e,Xt())},getSearchParameters:function(e,t,n){return e.setQuery(en(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))}});function rn(){return"boundingBox"}function an(e){return[e.northEast.lat,e.northEast.lng,e.southWest.lat,e.southWest.lng].join()}function sn(e){return e=e.match(dn),{lat:parseFloat(e[1]),lng:parseFloat(e[2])}}function on(e,t,n){if(ce(e=u(e,t,n,rn(),{})))return{northEast:{lat:parseFloat(e.northEast.lat),lng:parseFloat(e.northEast.lng)},southWest:{lat:parseFloat(e.southWest.lat),lng:parseFloat(e.southWest.lng)}}}function cn(e,t,n){return g(e,_({},rn(),t),n,!0)}function un(e){return e.attributes[0]}var ln=t({displayName:"AlgoliaBreadcrumb",$$type:"ais.breadcrumb",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},transformItems:S.func},getProvidedProps:function(e,t,n){var r=tn(e),n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return Boolean(n)&&Boolean(n.getFacetByName(r))?(r=(n=n.getFacetValues(r)).data?function n(e){return e.reduce(function(e,t){return e=t.isRefined&&(e.push({label:t.name,value:t.escapedValue}),t.data)?e.concat(n(t.data)):e},[])}(n.data):[],{canRefine:0<(n=e.transformItems?e.transformItems(r):r).length,items:n}):{items:[],canRefine:!1}},refine:function(e,t,n){return r={ais:e.contextValue,multiIndexContext:e.indexContextValue},g(t,_({},tn(e),n||""),r,!0,"hierarchicalMenu");var r}}),fn=t({displayName:"AlgoliaCurrentRefinements",$$type:"ais.currentRefinements",propTypes:{transformItems:S.func},getProvidedProps:function(n,e,t,r){r=r.reduce(function(e,t){return void 0===t.items||!n.clearsQuery&&"query"===t.id||n.clearsQuery&&"query"===t.id&&""===t.items[0].currentRefinement?e:e.concat(t.items.map(function(e){return I(I({},e),{},{id:t.id,index:t.index})}))},[]),r=n.transformItems?n.transformItems(r):r;return{items:r,canRefine:0<r.length}},refine:function(e,t,n){return(n instanceof Array?n.map(function(e){return e.value}):[n]).reduce(function(e,t){return t(e)},t)}}),hn=["defaultRefinement"],dn=/^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/,mn=t({displayName:"AlgoliaGeoSearch",$$type:"ais.geoSearch",getProvidedProps:function(e,t,n){var r={ais:e.contextValue,multiIndexContext:e.indexContextValue},n=p(n,r),i=on(e,t,r),a=n&&n._state.insideBoundingBox&&function(e){e=e.split(",");return{northEast:{lat:parseFloat(e[0]),lng:parseFloat(e[1])},southWest:{lat:parseFloat(e[2]),lng:parseFloat(e[3])}}}(n._state.insideBoundingBox)||void 0,e=(t=t,r=r,(e=e).defaultRefinement,e=O(e,hn),(s=u(e,t,r,"aroundLatLng"))||(s=u(e,t,r,"configure.aroundLatLng"))&&sn(s)),t=n&&n._state.aroundLatLng&&sn(n._state.aroundLatLng)||void 0,r=i||a,s=e||t;return{hits:n?n.hits.filter(function(e){return Boolean(e._geoloc)}):[],isRefinedWithMap:Boolean(r),currentRefinement:r,position:s}},refine:function(e,t,n){return cn(t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},getSearchParameters:function(e,t,n){n=on(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return n?e.setQueryParameter("insideBoundingBox",an(n)):e},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},rn())},getMetadata:function(e,t){var n=[],r=rn(),i={ais:e.contextValue,multiIndexContext:e.indexContextValue},a=h(i),s={},e=on(e,t,i);return e&&n.push({label:"".concat(r,": ").concat(an(e)),value:function(e){return cn(e,s,i)},currentRefinement:e}),{id:r,index:a,items:n}},shouldComponentUpdate:function(){return!0}}),pn="hierarchicalMenu";function gn(e,t,n){t=u(e,t,n,"".concat(pn,".").concat(un(e)),null);return""===t?null:t}function xn(e,c,u,l){return e.map(function(e){return{label:e.name,value:(t=e.escapedValue,r=(n=c).id,i=c.attributes,a=c.separator,s=c.rootPath,o=c.showParentLevel,null===(n=gn(c,u,l))?t:new A.SearchParameters({hierarchicalFacets:[{name:r,attributes:i,separator:a,rootPath:s,showParentLevel:o}]}).toggleHierarchicalFacetRefinement(r,n).toggleHierarchicalFacetRefinement(r,t).getHierarchicalRefinement(r)[0]),count:e.count,isRefined:e.isRefined,items:e.data&&xn(e.data,c,u,l)};var t,n,r,i,a,s,o})}function vn(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e.slice(0,t).map(function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(e.items)?I(I({},e),{},{items:vn(e.items,t)}):e})}function yn(e,t,n,r){return g(t,_({},un(e),n||""),r,!0,pn)}function Rn(e){var t=e.attribute,n=e.hit,r=e.highlightProperty,i=void 0===(i=e.preTag)?ve.highlightPreTag:i,e=e.postTag,t={attribute:t,highlightProperty:r,hit:n,preTag:i,postTag:void 0===e?ve.highlightPostTag:e},a=void 0===(r=t.preTag)?"<em>":r,s=void 0===(r=t.postTag)?"</em>":r,r=t.highlightProperty,n=t.attribute;if(t=t.hit)return t=ue(t[r],n)||{},Array.isArray(t)?t.map(function(e){return ye({preTag:a,postTag:s,highlightedValue:e.value})}):ye({preTag:a,postTag:s,highlightedValue:t.value});throw new Error("`hit`, the matching record, must be provided")}var bn=["name:asc"],Fn=t({displayName:"AlgoliaHierarchicalMenu",$$type:"ais.hierarchicalMenu",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},separator:S.string,rootPath:S.string,showParentLevel:S.bool,defaultRefinement:S.string,showMore:S.bool,limit:S.number,showMoreLimit:S.number,transformItems:S.func,facetOrdering:S.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,separator:" > ",rootPath:null,showParentLevel:!0,facetOrdering:!0},getProvidedProps:function(e,t,n){var r=e.showMore,i=e.limit,a=e.showMoreLimit,s=e.facetOrdering,o=un(e),n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return Boolean(n)&&Boolean(n.getFacetByName(o))?(r=r?a:i,i=(a=n.getFacetValues(o,{sortBy:bn,facetOrdering:s})).data?xn(a.data,e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}):[],n=e.transformItems?e.transformItems(i):i,{items:vn(n,r),currentRefinement:gn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:0<n.length}):{items:[],currentRefinement:gn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:!1}},refine:function(e,t,n){return yn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(pn,".").concat(un(n)));var n},getSearchParameters:function(e,t,n){var r=t.attributes,i=t.separator,a=t.rootPath,s=t.showParentLevel,o=t.showMore,c=t.limit,u=t.showMoreLimit,l=t.contextValue,f=un(t),o=o?u:c,u=(e=e.addHierarchicalFacet({name:f,attributes:r,separator:i,rootPath:a,showParentLevel:s}).setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,o)}),gn(t,n,{ais:l,multiIndexContext:t.indexContextValue}));return e=null!==u?e.toggleHierarchicalFacetRefinement(f,u):e},getMetadata:function(t,e){var n=t.attributes[0],r=un(t),e=gn(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),n=e?[{label:"".concat(n,": ").concat(le(e)),attribute:n,value:function(e){return yn(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]:[];return{id:r,index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:n}}}),Pn=t({displayName:"AlgoliaHighlighter",$$type:"ais.highlighter",propTypes:{},getProvidedProps:function(){return{highlight:Rn}}}),Cn=t({displayName:"AlgoliaHits",$$type:"ais.hits",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{hits:se(ae(n.hits,n.hitsPerPage,n.page),n.queryID)}:{hits:[]}},getSearchParameters:function(e){return e}});function Sn(){return"hitsPerPage"}function Vn(e,t,n){e=u(e,t,n,"hitsPerPage",null);return"string"==typeof e?parseInt(e,10):e}var wn=t({displayName:"AlgoliaHitsPerPage",$$type:"ais.hitsPerPage",propTypes:{defaultRefinement:S.number.isRequired,items:S.arrayOf(S.shape({label:S.string,value:S.number.isRequired})).isRequired,transformItems:S.func},getProvidedProps:function(e,t){var n=Vn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),t=e.items.map(function(e){return e.value===n?I(I({},e),{},{isRefined:!0}):I(I({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(t):t,currentRefinement:n}},refine:function(e,t,n){return g(t,_({},"hitsPerPage",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},Sn())},getSearchParameters:function(e,t,n){return e.setHitsPerPage(Vn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(){return{id:Sn()}}}),jn=["page"];function In(e){e=e||{};e.page;return O(e,jn)}var _n=t({displayName:"AlgoliaInfiniteHits",$$type:"ais.infiniteHits",getProvidedProps:function(e,t,n){var r,i,a,s,o,c,u,l,f,h,d=this,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?(r=n.page,c=n.hits,f=n.hitsPerPage,i=n.nbPages,a=n._state,this._cache=e.cache||this._cache||(o=s=void 0,{read:function(e){e=e.state;return ee(o,In(e))?s:null},write:function(e){var t=e.state,e=e.hits;o=In(t),s=e}}),e=this._cache.read({state:a})||{},c=se(ae(c,f,r),n.queryID),e[r]=c,this._cache.write({state:a,hits:e}),u=Math.min.apply(Math,m(Object.keys(e).map(Number))),l=Math.max.apply(Math,m(Object.keys(e).map(Number))),f=0<u,n=l<i-1,{hits:(h=e,Object.keys(h).map(Number).sort(function(e,t){return e-t}).reduce(function(e,t){return e.concat(h[t])},[])),hasPrevious:f,hasMore:n,refinePrevious:function(e){return d.refine(e,u-1)},refineNext:function(e){return d.refine(e,l+1)}}):{hits:[],hasPrevious:!1,hasMore:!1,refine:function(){},refinePrevious:function(){},refineNext:function(){}}},getSearchParameters:function(e,t,n){return e.setQueryParameters({page:(t={ais:(e=t).contextValue,multiIndexContext:t.indexContextValue},("string"==typeof(e=u(e,n,t,"page",1))?parseInt(e,10):e)-1)})},refine:function(e,t,n,r){return g(t,_({},"page",r+1),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!1)}}),On="menu";function En(e){return e.attribute}function An(e,t,n){t=u(e,t,n,"".concat(On,".").concat(En(e)),null);return""===t?null:t}function Nn(e,t,n,r){return e===An(t,n,r)?"":e}function Tn(e){var t=e.showMore,n=e.limit,e=e.showMoreLimit;return t?e:n}function Hn(e,t,n,r){return g(t,_({},En(e),n||""),r,!0,On)}var kn=["count:desc","name:asc"],Mn=t({displayName:"AlgoliaMenu",$$type:"ais.menu",propTypes:{attribute:S.string.isRequired,showMore:S.bool,limit:S.number,showMoreLimit:S.number,defaultRefinement:S.string,transformItems:S.func,searchable:S.bool,facetOrdering:S.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a=t.attribute,s=t.searchable,o=t.indexContextValue,c=t.facetOrdering,e=p(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),u=Boolean(e)&&Boolean(e.getFacetByName(a)),l=Boolean(i&&i[a]&&""!==i.query);if(s&&o)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");return u?(o=l?i[a].map(function(e){return{label:e.value,value:Nn(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):e.getFacetValues(a,{sortBy:s?void 0:kn,facetOrdering:c}).map(function(e){return{label:e.name,value:Nn(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}}),{items:(i=t.transformItems?t.transformItems(o):o).slice(0,Tn(t)),currentRefinement:An(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:s,canRefine:0<i.length}):{items:[],currentRefinement:An(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:s,canRefine:u}},refine:function(e,t,n){return Hn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:Tn(e)}},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(On,".").concat(En(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,n=(e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,Tn(t))})).addDisjunctiveFacet(r),An(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}));return e=null!==n?e.addDisjunctiveFacetRefinement(r,n):e},getMetadata:function(t,e){var n=En(t),e=An(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:n,index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===e?[]:[{label:"".concat(t.attribute,": ").concat(le(e)),attribute:t.attribute,value:function(e){return Hn(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]}}});function $n(e){var t;return void 0===e.start&&void 0===e.end?"":(t=void 0!==e.start?e.start:"",e=void 0!==e.end?e.end:"","".concat(t,":").concat(e))}var Dn="multiRange";function Qn(e){return e.attribute}function Bn(e,t,n){return u(e,t,n,"".concat(Dn,".").concat(Qn(e)),"")}function Ln(e,t,n,r){return g(t,_({},Qn(e),n),r,!0,Dn)}var qn=t({displayName:"AlgoliaNumericMenu",$$type:"ais.numericMenu",propTypes:{id:S.string,attribute:S.string.isRequired,items:S.arrayOf(S.shape({label:S.node,start:S.number,end:S.number})).isRequired,transformItems:S.func},getProvidedProps:function(s,e,t){var n=s.attribute,o=Bn(s,e,{ais:s.contextValue,multiIndexContext:s.indexContextValue}),c=p(t,{ais:s.contextValue,multiIndexContext:s.indexContextValue}),e=s.items.map(function(e){var t,n,r,i,a=$n(e);return{label:e.label,value:a,isRefined:a===o,noRefinement:!(!c||(e=Qn(s),a=a,t=(t=c).getFacetByName(e)?t.getFacetStats(e):null,e=a.split(":"),i=0===Number(e[0])||""===a?Number.NEGATIVE_INFINITY:Number(e[0]),a=0===Number(e[1])||""===a?Number.POSITIVE_INFINITY:Number(e[1]),Boolean(t)&&(e=i,r=a,(n=t).min>=e&&n.min<=r||n.max>=e&&n.max<=r||(e=a,(n=i)>=(r=t).min&&n<=r.max)||e>=r.min&&e<=r.max)))}}),t=c&&c.getFacetByName(n)?c.getFacetStats(n):null,n=oe(e,function(e){return!0===e.isRefined}),n=(e.some(function(e){return""===e.value})||e.push({value:"",isRefined:void 0===n,noRefinement:!t,label:"All"}),s.transformItems?s.transformItems(e):e);return{items:n,currentRefinement:o,canRefine:0<n.length&&n.some(function(e){return!1===e.noRefinement})}},refine:function(e,t,n){return Ln(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(Dn,".").concat(Qn(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,t=0===(n=Bn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})).length?{start:null,end:null}:(t=(n=U(n.split(":"),2))[0],n=n[1],{start:0<t.length?parseFloat(t):null,end:0<n.length?parseFloat(n):null}),n=t.start,t=t.end;return e=e.addDisjunctiveFacet(r),"number"==typeof n&&(e=e.addNumericRefinement(r,">=",n)),e="number"==typeof t?e.addNumericRefinement(r,"<=",t):e},getMetadata:function(t,e){var n,r=Qn(t),i=Bn(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),e=[],a=h({ais:t.contextValue,multiIndexContext:t.indexContextValue});return""!==i&&(n=oe(t.items,function(e){return $n(e)===i}).label,e.push({label:"".concat(t.attribute,": ").concat(n),attribute:t.attribute,currentRefinement:n,value:function(e){return Ln(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})}})),{id:r,index:a,items:e}}});function Un(){return"page"}function Wn(e,t,n){e=u(e,t,n,"page",1);return"string"==typeof e?parseInt(e,10):e}var zn=t({displayName:"AlgoliaPagination",$$type:"ais.pagination",getProvidedProps:function(e,t,n){var n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{nbPages:n=n.nbPages,currentRefinement:Wn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:1<n}:null},refine:function(e,t,n){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},g(t,_({},"page",n),e,!1)},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},Un())},getSearchParameters:function(e,t,n){return e.setPage(Wn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})-1)},getMetadata:function(){return{id:Un()}}}),Jn=t({displayName:"AlgoliaPoweredBy",$$type:"ais.poweredBy",getProvidedProps:function(){var e="undefined"==typeof window||void 0===window.location?"":window.location.hostname;return{url:"https://www.algolia.com/?utm_source=react-instantsearch&utm_medium=website&"+"utm_content=".concat(e,"&")+"utm_campaign=poweredby"}}});function Yn(e){return e.attribute}var Gn="range";function Kn(e,t,n,r){var t=u(e,t,r,"".concat(Gn,".").concat(Yn(e)),{}),r=t.min,t=t.max,i=Boolean(e.precision),r={min:r="string"==typeof r?i?parseFloat(r):parseInt(r,10):r,max:t="string"==typeof t?i?parseFloat(t):parseInt(t,10):t},i=void 0!==e.min,t=void 0!==e.max,e=void 0!==r.min,a=void 0!==r.max;if(i&&e&&r.min<n.min)throw Error("You can't provide min value lower than range.");if(t&&a&&r.max>n.max)throw Error("You can't provide max value greater than range.");return i&&!e&&(r.min=n.min),t&&!a&&(r.max=n.max),r}function Xn(e,t){return{min:(void 0!==e.min?e:t).min,max:(void 0!==e.max?e:t).max}}function Zn(e,t,n,r){e=e||n!==r?e&&t?n:r:void 0;return e}function er(e,t,n,r,i){var a=n.min,n=n.max,s=r.min,r=r.max,o=void 0===a||""===a,c=void 0===n||""===n,a=o?void 0:parseFloat(a),n=c?void 0:parseFloat(n),u=o||isFinite(a),l=c||isFinite(n);if(!u||!l)throw Error("You can't provide non finite values to the range connector.");if(a<s)throw Error("You can't provide min value lower than range.");if(r<n)throw Error("You can't provide max value greater than range.");return g(t,_({},Yn(e),{min:Zn(void 0!==e.min,o,s,a),max:Zn(void 0!==e.max,c,r,n)}),i,!0,Gn)}var tr=t({displayName:"AlgoliaRange",$$type:"ais.range",propTypes:{id:S.string,attribute:S.string.isRequired,defaultRefinement:S.shape({min:S.number,max:S.number}),min:S.number,max:S.number,precision:S.number,header:S.node,footer:S.node},defaultProps:{precision:0},getProvidedProps:function(e,t,n){var r=e.attribute,i=e.precision,a=e.min,s=e.max,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),o=n&&n.getFacetByName(r),c=o&&n.getFacetStats(r)||{},o=(o?n.getFacetValues(r):[]).map(function(e){return{value:e.name,count:e.count}}),c=(n={min:a,max:s},r=c,a=i,a=Math.pow(10,a),s="number"==typeof n.min&&isFinite(n.min)?n.min:"number"==typeof r.min&&isFinite(r.min)?r.min:void 0,n="number"==typeof n.max&&isFinite(n.max)?n.max:"number"==typeof r.max&&isFinite(r.max)?r.max:void 0,{min:void 0!==s?Math.floor(s*a)/a:s,max:void 0!==n?Math.ceil(n*a)/a:n}),r=c.min,s=c.max,a=(this._currentRange={min:r,max:s},Kn(e,t,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue}));return{min:r,max:s,canRefine:0<o.length,currentRefinement:Xn(a,this._currentRange),count:o,precision:i}},refine:function(e,t,n){return er(e,t,n,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(Gn,".").concat(Yn(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,n=Kn(t,n,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),t=n.min,n=n.max;return e=e.addDisjunctiveFacet(r),void 0!==t&&(e=e.addNumericRefinement(r,">=",t)),e=void 0!==n?e.addNumericRefinement(r,"<=",n):e},getMetadata:function(t,e){var n=this,r=this._currentRange,i=r.min,r=r.max,e=Kn(t,e,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=e.min,e=e.max,s=[],o=void 0!==a,c=void 0!==e;return(o&&a!==i||c&&e!==r)&&(o=[o?"".concat(a," <= "):"",t.attribute,c?" <= ".concat(e):""],s.push({label:o.join(""),attribute:t.attribute,value:function(e){return er(t,e,{},n._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:Xn({min:a,max:e},{min:i,max:r})})),{id:Yn(t),index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:s}}}),nr="refinementList";function rr(e){return e.attribute}function T(e,t,n){t=u(e,t,n,"".concat(nr,".").concat(rr(e)),[]);return"string"!=typeof t?t:t?[t]:[]}function ir(t,e,n,r){e=T(e,n,r);return-1===e.indexOf(t)?e.concat([t]):e.filter(function(e){return e!==t})}function ar(e){var t=e.showMore,n=e.limit,e=e.showMoreLimit;return t?e:n}function sr(e,t,n,r){return g(t,_({},rr(e),0<n.length?n:""),r,!0,nr)}var or=["isRefined","count:desc","name:asc"],cr=t({displayName:"AlgoliaRefinementList",$$type:"ais.refinementList",propTypes:{id:S.string,attribute:S.string.isRequired,operator:S.oneOf(["and","or"]),showMore:S.bool,limit:S.number,showMoreLimit:S.number,defaultRefinement:S.arrayOf(S.oneOfType([S.string,S.number])),searchable:S.bool,transformItems:S.func,facetOrdering:S.bool},defaultProps:{operator:"or",showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a=t.attribute,s=t.searchable,o=t.indexContextValue,c=t.facetOrdering,e=p(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),u=Boolean(e)&&Boolean(e.getFacetByName(a)),l=Boolean(i&&i[a]&&""!==i.query);if(s&&o)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");return u?(o=l?i[a].map(function(e){return{label:e.value,value:ir(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):e.getFacetValues(a,{sortBy:or,facetOrdering:c}).map(function(e){return{label:e.name,value:ir(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}}),{items:(i=t.transformItems?t.transformItems(o):o).slice(0,ar(t)),currentRefinement:T(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:s,canRefine:0<i.length}):{items:[],currentRefinement:T(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),canRefine:u,isFromSearch:l,searchable:s}},refine:function(e,t,n){return sr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:ar(e)}},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(nr,".").concat(rr(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,i="and"===t.operator?"addFacet":"addDisjunctiveFacet",a="".concat(i,"Refinement");return e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,ar(t))}))[i](r),T(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}).reduce(function(e,t){return e[a](r,t)},e)},getMetadata:function(n,r){var e=rr(n),i={ais:n.contextValue,multiIndexContext:n.indexContextValue};return{id:e,index:h(i),items:0<T(n,r,i).length?[{attribute:n.attribute,label:"".concat(n.attribute,": "),currentRefinement:T(n,r,i),value:function(e){return sr(n,e,[],i)},items:T(n,r,i).map(function(t){return{label:le("".concat(t)),value:function(e){e=T(n,e,i).filter(function(e){return e!==t});return sr(n,r,e,i)}}})}]:[]}}}),ur=t({displayName:"AlgoliaScrollTo",$$type:"ais.scrollTo",propTypes:{scrollOn:S.string},defaultProps:{scrollOn:"page"},getProvidedProps:function(e,t){var n=e.scrollOn,r=u(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},n,null),e=(this._prevSearchState||(this._prevSearchState={}),l(t=d({ais:e.contextValue,multiIndexContext:e.indexContextValue})?t.indices?t.indices[h({ais:e.contextValue,multiIndexContext:e.indexContextValue})]:{}:t,["configure",n])),t=te(this._prevSearchState,e);return this._prevSearchState=e,{value:r,hasNotChanged:t}}});function lr(){return"query"}function fr(e,t,n){e=u(e,t,n,"query","");return e||""}function hr(e,t,n,r){return g(t,_({},"query",n),r,!0)}var dr=t({displayName:"AlgoliaSearchBox",$$type:"ais.searchBox",propTypes:{defaultRefinement:S.string},getProvidedProps:function(e,t,n){return{currentRefinement:fr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return hr(0,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:e.contextValue,multiIndexContext:e.indexContextValue},r(t,e,lr())},getSearchParameters:function(e,t,n){return e.setQuery(fr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(t,e){e=fr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===e?[]:[{label:"".concat("query",": ").concat(e),value:function(e){return hr(0,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]}}});function mr(){return"relevancyStrictness"}var pr=t({displayName:"AlgoliaRelevantSort",$$type:"ais.relevantSort",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{isVirtualReplica:void 0!==n.appliedRelevancyStrictness,isRelevantSorted:void 0!==n.appliedRelevancyStrictness&&0<n.appliedRelevancyStrictness}:{isVirtualReplica:!1,isRelevantSorted:!1}},getSearchParameters:function(e,t,n){return e.setQueryParameter("relevancyStrictness",(e={ais:t.contextValue,multiIndexContext:t.indexContextValue},u(t,n,e,"relevancyStrictness")))},refine:function(e,t,n){return g(t,_({},mr(),n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)}});function gr(){return"sortBy"}function xr(e,t,n){e=u(e,t,n,"sortBy",null);return e||null}var vr=t({displayName:"AlgoliaSortBy",$$type:"ais.sortBy",propTypes:{defaultRefinement:S.string,items:S.arrayOf(S.shape({label:S.string,value:S.string.isRequired})).isRequired,transformItems:S.func},getProvidedProps:function(e,t){var n=xr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),t=e.items.map(function(e){return e.value===n?I(I({},e),{},{isRefined:!0}):I(I({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(t):t,currentRefinement:n}},refine:function(e,t,n){return g(t,_({},"sortBy",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return r(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},gr())},getSearchParameters:function(e,t,n){n=xr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return e.setIndex(n)},getMetadata:function(){return{id:gr()}}}),yr=t({displayName:"AlgoliaStateResults",$$type:"ais.stateResults",getProvidedProps:function(e,t,n){return{searchState:t,searchResults:p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),allSearchResults:n.results,searching:n.searching,isSearchStalled:n.isSearchStalled,error:n.error,searchingForFacetValues:n.searchingForFacetValues,props:e}}}),Rr=t({displayName:"AlgoliaStats",$$type:"ais.stats",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return n?{areHitsSorted:void 0!==n.appliedRelevancyStrictness&&0<n.appliedRelevancyStrictness&&n.nbHits!==n.nbSortedHits,nbHits:n.nbHits,nbSortedHits:n.nbSortedHits,processingTimeMS:n.processingTimeMS}:null}});function br(e){return e.attribute}var Fr="toggle",Pr=["0","false","null","undefined"];function Cr(e,t,n){t=u(e,t,n,"".concat(Fr,".").concat(br(e)),!1);return-1===Pr.indexOf(t)&&Boolean(t)}function Sr(e,t,n,r){return g(t,_({},br(e),n||!1),r,!0,Fr)}var Vr=t({displayName:"AlgoliaToggle",$$type:"ais.toggle",propTypes:{label:S.string.isRequired,attribute:S.string.isRequired,value:S.any.isRequired,filter:S.func,defaultRefinement:S.bool},getProvidedProps:function(e,t,n){var r=e.attribute,i=e.value,n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),t=Cr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),e=n&&n.getFacetByName(r)?n.getFacetValues(r):null,n=e&&e.length?oe(e,function(e){return e.name===i.toString()}):null,r=n&&n.count,n=e&&e.length?e.reduce(function(e,t){return e+t.count},0):null;return{currentRefinement:t,canRefine:t?null!==n&&0<n:null!==r&&0<r,count:{checked:n,unchecked:r}}},refine:function(e,t,n){return Sr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return e={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},r(t,e,"".concat(Fr,".").concat(br(n)));var n},getSearchParameters:function(e,t,n){var r=t.attribute,i=t.value,a=t.filter,n=Cr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),t=e.addDisjunctiveFacet(r);return t=n&&(t=t.addDisjunctiveFacetRefinement(r,i),a)?a(t):t},getMetadata:function(t,e){var n=br(t),e=Cr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),r=[],i=h({ais:t.contextValue,multiIndexContext:t.indexContextValue});return e&&r.push({label:t.label,currentRefinement:e,attribute:t.attribute,value:function(e){return Sr(t,e,!1,{ais:t.contextValue,multiIndexContext:t.indexContextValue})}}),{id:n,index:i,items:r}}});function wr(r,i,a){return function(e,t){if("function"!=typeof r)throw new TypeError("Expected insightsClient to be a Function");var n=function(e){var t=e.method,n=e.results,r=e.currentHit,i=n.index,a=r.__queryID,s=[r.objectID];if(!a)throw new Error("Could not infer `queryID`. Ensure `clickAnalytics: true` was added with the Configure widget.\nSee: https://alg.li/VpPpLt");switch(t){case"clickedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s,positions:[r.__position]};case"convertedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s};default:throw new Error('Unsupported method "'.concat(t,'" passed to the insights function. The supported methods are: "clickedObjectIDsAfterSearch", "convertedObjectIDsAfterSearch".'))}}({method:e,results:i,currentHit:a});r(e,I(I({},n),t))}}function jr(){return"query"}function Ir(){return"additionalVoiceParameters"}function _r(e,t,n){e=u(e,t,n,"query","");return e||""}function Or(e,t,n,r){var i,a=e.language?{queryLanguages:[e.language.split("-")[0]]}:{},e="function"==typeof e.additionalQueryParameters?I({ignorePlurals:!0,removeStopWords:!0,optionalWords:n},e.additionalQueryParameters({query:n})):{};_(i={},"query",n),_(i,"additionalVoiceParameters",I(I({},a),e));return g(t,i,r,!0)}var S=t({displayName:"AlgoliaVoiceSearch",$$type:"ais.voiceSearch",propTypes:{defaultRefinement:S.string},getProvidedProps:function(e,t,n){return{currentRefinement:_r(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return Or(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return n=t,e={ais:e.contextValue,multiIndexContext:e.indexContextValue},n=r(t,e,jr()),r(n,e,Ir());var n},getSearchParameters:function(e,t,n){var r,i=_r(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),n=(t={ais:(r=t).contextValue,multiIndexContext:t.indexContextValue},(r=u(r,n,t,"additionalVoiceParameters",""))||{});return e.setQuery(i).setQueryParameters(n)},getMetadata:function(t,e){e=_r(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:h({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===e?[]:[{label:"".concat("query",": ").concat(e),value:function(e){return Or(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:e}]}}}),Er=At,Ar=j;e.Configure=Se,e.DynamicWidgets=At,e.EXPERIMENTAL_connectConfigureRelatedItems=R,e.EXPERIMENTAL_connectDynamicWidgets=Ar,e.ExperimentalConfigureRelatedItems=b,e.ExperimentalDynamicWidgets=Er,e.HIGHLIGHT_TAGS=ve,e.Index=function(t){var n=t.indexName;return o.createElement(he,null,function(e){return o.createElement(Mt,D({contextValue:e,indexId:n},t))})},e.InstantSearch=Zt,e.InstantSearchConsumer=he,e.InstantSearchProvider=de,e.QueryRuleContext=Ht,e.connectAutoComplete=nn,e.connectBreadcrumb=ln,e.connectConfigure=me,e.connectCurrentRefinements=fn,e.connectDynamicWidgets=j,e.connectGeoSearch=mn,e.connectHierarchicalMenu=Fn,e.connectHighlight=Pn,e.connectHitInsights=function(r){return t({displayName:"AlgoliaInsights",$$type:"ais.insights",getProvidedProps:function(e,t,n){n=p(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{insights:wr(r,n,e.hit)}}})},e.connectHits=Cn,e.connectHitsPerPage=wn,e.connectInfiniteHits=_n,e.connectMenu=Mn,e.connectNumericMenu=qn,e.connectPagination=zn,e.connectPoweredBy=Jn,e.connectQueryRules=Tt,e.connectRange=tr,e.connectRefinementList=cr,e.connectRelevantSort=pr,e.connectScrollTo=ur,e.connectSearchBox=dr,e.connectSortBy=vr,e.connectStateResults=yr,e.connectStats=Rr,e.connectToggleRefinement=Vr,e.connectVoiceSearch=S,e.createConnector=t,e.instantSearchContext=fe,e.translatable=function(s){return function(e){var t=function(){Q(i,a.Component);var r=q(i);function i(){var a;k(this,i);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _(c(a=r.call.apply(r,[this].concat(t))),"translate",function(e){var t=a.props.translations,t=(t&&t.hasOwnProperty(e)?t:s)[e];if("function"!=typeof t)return t;for(var n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.apply(void 0,r)}),a}return $(i,[{key:"render",value:function(){return o.createElement(e,D({translate:this.translate},this.props))}}]),i}(),n=e.displayName||e.name||"UnknownComponent";return t.displayName="Translatable(".concat(n,")"),t}},e.version=Re,Object.defineProperty(e,"__esModule",{value:!0})});
3
3
  //# sourceMappingURL=ReactInstantSearchCore.min.js.map