/*! React InstantSearch 6.7.0 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */
!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).ReactInstantSearch=e.ReactInstantSearch||{},e.ReactInstantSearch.Connectors={}),e.React)}(this,function(e,c){"use strict";var o="default"in c?c.default:c;function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function y(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],0<=t.indexOf(n)||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(e){F(t,e,n[e])})}return t}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e){return(t="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 h(e){return(h="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(e){return t(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f="undefined"!=typeof Element,g="function"==typeof Map,v="function"==typeof Set,x="function"==typeof ArrayBuffer;var R=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 i,r,a,s;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(g&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s=t.entries();!(r=s.next()).done;)if(!n.has(r.value[0]))return!1;for(s=t.entries();!(r=s.next()).done;)if(!e(r.value[1],n.get(r.value[0])))return!1;return!0}if(v&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s=t.entries();!(r=s.next()).done;)if(!n.has(r.value[0]))return!1;return!0}if(x&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(t[r]!==n[r])return!1;return!0}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((i=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;if(f&&t instanceof Element)return!1;for(r=i;0!=r--;)if(!("_owner"===a[r]&&t.$$typeof||e(t[a[r]],n[a[r]])))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}},b=function(e,t){if(e===t)return!0;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var r=Object.prototype.hasOwnProperty,a=0;a<n.length;a++)if(!r.call(t,n[a])||e[n[a]]!==t[n[a]])return!1;return!0},C=function i(r){return Object.keys(r).forEach(function(e){var t,n=r[e];"object"!==h(t=n)||null===t||Array.isArray(t)||(a(n)?i(n):delete r[e])}),r};function V(e,n,i){return e.map(function(e,t){return P({},e,{__position:n*i+t+1})})}function j(e,t){return t?e.map(function(e){return P({},e,{__queryID:t})}):e}function _(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function a(e){return e&&0<Object.keys(e).length}function I(e,t){if(null==e)return{};for(var n={},i=Object.keys(e),r=0;r<i.length;r++){var a=i[r];0<=t.indexOf(a)||(n[a]=e[a])}return n}var n=c.createContext({onInternalStateUpdate:function(){},createHrefForState:function(){return"#"},onSearchForFacetValues:function(){},onSearchStateChange:function(){},onSearchParameters:function(){},store:{},widgetsManager:{},mainTargetedIndex:""}),r=n.Consumer,i=(n.Provider,c.createContext(void 0)),s=i.Consumer;i.Provider;function w(f){if(!f.displayName)throw new Error("`createConnector` requires you to provide a `displayName` property.");var s="function"==typeof f.getSearchParameters||"function"==typeof f.getMetadata||"function"==typeof f.transitionState;return function(a){var e,t=function(e){function i(e){var r,t,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=this,n=m(i).call(this,e),F(d(r=!n||"object"!==h(n)&&"function"!=typeof n?d(t):n),"unsubscribe",void 0),F(d(r),"unregisterWidget",void 0),F(d(r),"isUnmounting",!1),F(d(r),"state",{providedProps:r.getProvidedProps(r.props)}),F(d(r),"refine",function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];r.props.contextValue.onInternalStateUpdate((e=f.refine).call.apply(e,[d(r),r.props,r.props.contextValue.store.getState().widgets].concat(n)))}),F(d(r),"createURL",function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return r.props.contextValue.createHrefForState((e=f.refine).call.apply(e,[d(r),r.props,r.props.contextValue.store.getState().widgets].concat(n)))}),F(d(r),"searchForFacetValues",function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];r.props.contextValue.onSearchForFacetValues((e=f.searchForFacetValues).call.apply(e,[d(r),r.props,r.props.contextValue.store.getState().widgets].concat(n)))}),f.getSearchParameters&&r.props.contextValue.onSearchParameters(f.getSearchParameters.bind(d(r)),{ais:r.props.contextValue,multiIndexContext:r.props.indexContextValue},r.props),r}var t,n,r;return function(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}}),t&&p(e,t)}(i,c.Component),t=i,(n=[{key:"componentDidMount",value:function(){var e=this;this.unsubscribe=this.props.contextValue.store.subscribe(function(){e.isUnmounting||e.setState({providedProps:e.getProvidedProps(e.props)})}),s&&(this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this))}},{key:"shouldComponentUpdate",value:function(e,t){if("function"==typeof f.shouldComponentUpdate)return f.shouldComponentUpdate.call(this,this.props,e,this.state,t);var n=b(this.props,e);return null===this.state.providedProps||null===t.providedProps?this.state.providedProps!==t.providedProps||!n:!n||!b(this.state.providedProps,t.providedProps)}},{key:"componentDidUpdate",value:function(e){R(e,this.props)||(this.setState({providedProps:this.getProvidedProps(this.props)}),s&&(this.props.contextValue.widgetsManager.update(),"function"==typeof f.transitionState&&this.props.contextValue.onSearchStateChange(f.transitionState.call(this,this.props,this.props.contextValue.store.getState().widgets,this.props.contextValue.store.getState().widgets))))}},{key:"componentWillUnmount",value:function(){if(this.isUnmounting=!0,this.unsubscribe&&this.unsubscribe(),this.unregisterWidget&&(this.unregisterWidget(),"function"==typeof f.cleanUp)){var e=f.cleanUp.call(this,this.props,this.props.contextValue.store.getState().widgets);this.props.contextValue.store.setState(P({},this.props.contextValue.store.getState(),{widgets:e})),this.props.contextValue.onSearchStateChange(C(e))}}},{key:"getProvidedProps",value:function(e){var t=this.props.contextValue.store.getState(),n=t.widgets,i=t.results,r=t.resultsFacetValues,a=t.searching,s=t.searchingForFacetValues,c=t.isSearchStalled,o=t.metadata,u={results:i,searching:a,searchingForFacetValues:s,isSearchStalled:c,error:t.error};return f.getProvidedProps.call(this,e,n,u,o,r)}},{key:"getSearchParameters",value:function(e){return"function"==typeof f.getSearchParameters?f.getSearchParameters.call(this,e,this.props,this.props.contextValue.store.getState().widgets):null}},{key:"getMetadata",value:function(e){return"function"==typeof f.getMetadata?f.getMetadata.call(this,this.props,e):{}}},{key:"transitionState",value:function(e,t){return"function"==typeof f.transitionState?f.transitionState.call(this,this.props,e,t):t}},{key:"render",value:function(){var e=this.props,t=(e.contextValue,y(e,["contextValue"])),n=this.state.providedProps;if(null===n)return null;var i="function"==typeof f.refine?{refine:this.refine,createURL:this.createURL}:{},r="function"==typeof f.searchForFacetValues?{searchForItems:this.searchForFacetValues}:{};return o.createElement(a,u({},t,n,i,r))}}])&&l(t.prototype,n),r&&l(t,r),i}();return F(t,"displayName","".concat(f.displayName,"(").concat((e=a).displayName||e.name||"UnknownComponent",")")),F(t,"propTypes",f.propTypes),F(t,"defaultProps",f.defaultProps),t}}var S=function(t){return function(e){var i=w(t)(e);return function(n){return o.createElement(r,null,function(t){return o.createElement(s,null,function(e){return o.createElement(i,u({contextValue:t,indexContextValue:e},n))})})}}},E="<ais-highlight-0000000000>",O="</ais-highlight-0000000000>";function N(e){var t=e.preTag,n=e.postTag,i=e.highlightedValue,r=(void 0===i?"":i).split(t),a=r.shift(),s=""===a?[]:[{value:a,isHighlighted:!1}];if(n===t){var c=!0;r.forEach(function(e){s.push({value:e,isHighlighted:c}),c=!c})}else r.forEach(function(e){var t=e.split(n);s.push({value:t[0],isHighlighted:!0}),""!==t[1]&&s.push({value:t[1],isHighlighted:!1})});return s}function A(e){var t=e.preTag,n=void 0===t?"<em>":t,i=e.postTag,r=void 0===i?"</em>":i,a=e.highlightProperty,s=e.attribute,c=e.hit;if(!c)throw new Error("`hit`, the matching record, must be provided");var o,u,f=(o=c[a],u=s,(Array.isArray(u)?u:u.replace(/\[(\d+)]/g,".$1").split(".")).reduce(function(e,t){return e?e[t]:void 0},o)||{});return Array.isArray(f)?f.map(function(e){return N({preTag:n,postTag:r,highlightedValue:e.value})}):N({preTag:n,postTag:r,highlightedValue:f.value})}function H(e){return Q(e)?e.multiIndexContext.targetedIndex:e.ais.mainTargetedIndex}function T(e,t){if(e.results){if(e.results.hits)return e.results;var n=H(t);if(e.results[n])return e.results[n]}return null}function Q(e){return e&&e.multiIndexContext}function k(t,e,n,i,r){if(Q(n)){var a=H(n);return r?(g=e,v=a,x=r,R=i?{page:1}:void 0,b=(p=t).indices&&p.indices[v]?P({},p.indices,F({},v,P({},p.indices[v],(F(y={},x,P({},p.indices[v][x],g)),F(y,"page",1),y)))):P({},p.indices,F({},v,P(F({},x,g),R))),P({},p,{indices:b})):(l=e,h=a,d=i?{page:1}:void 0,m=(f=t).indices&&f.indices[h]?P({},f.indices,F({},h,P({},f.indices[h],l,d))):P({},f.indices,F({},h,P({},l,d))),P({},f,{indices:m}))}return t.indices&&i&&Object.keys(t.indices).forEach(function(e){t=k(t,{page:1},{multiIndexContext:{targetedIndex:e}},!0,r)}),r?(c=e,u=i?{page:1}:void 0,P({},s=t,F({},o=r,P({},s[o],c)),u)):P({},t,e,i?{page:1}:void 0);var s,c,o,u,f,l,h,d,m,p,g,v,x,y,R,b}function D(e){var t=e.match(/^([^.]*)\.(.*)/);return{namespace:t&&t[1],attributeName:t&&t[2]}}function B(e,t,n,i,r){var a,s,c,o,u,f,l,h,d,m,p,g,v,x,y=H(n),R=D(i),b=R.namespace,F=R.attributeName,P={multiIndex:Q(n),indexId:y,namespace:b,attributeName:F,id:i,searchState:t};return(s=(a=P).multiIndex,c=a.indexId,o=a.namespace,u=a.attributeName,f=a.id,l=a.searchState,s&&o?l.indices&&l.indices[c]&&l.indices[c][o]&&Object.hasOwnProperty.call(l.indices[c][o],u):s?l.indices&&l.indices[c]&&Object.hasOwnProperty.call(l.indices[c],f):o?l[o]&&Object.hasOwnProperty.call(l[o],u):Object.hasOwnProperty.call(l,f))?(d=(h=P).multiIndex,m=h.indexId,p=h.namespace,g=h.attributeName,v=h.id,x=h.searchState,d&&p?x.indices[m][p][g]:d?x.indices[m][v]:p?x[p][g]:x[v]):e.defaultRefinement?e.defaultRefinement:r}function M(e,t,n){var i=H(t),r=D(n),a=r.namespace,s=r.attributeName;return Q(t)&&Boolean(e.indices)?function(e){var t=e.searchState,n=e.indexId,i=e.id,r=e.namespace,a=e.attribute,s=t.indices[n];if(r&&s)return P({},t,{indices:P({},t.indices,F({},n,P({},s,F({},r,I(s[r],[a])))))});if(s)return P({},t,{indices:P({},t.indices,F({},n,I(s,[i])))});return t}({attribute:s,searchState:e,indexId:i,id:n,namespace:a}):function(e){var t=e.searchState,n=e.id,i=e.namespace,r=e.attribute;if(i)return P({},t,F({},i,I(t[i],[r])));return I(t,[n])}({attribute:s,searchState:e,id:n,namespace:a})}var L=S({displayName:"AlgoliaConfigure",getProvidedProps:function(){return{}},getSearchParameters:function(e,t){t.children,t.contextValue,t.indexContextValue;var n=y(t,["children","contextValue","indexContextValue"]);return e.setQueryParameters(n)},transitionState:function(e,t,n){var i="configure",r=(e.children,e.contextValue,e.indexContextValue,y(e,["children","contextValue","indexContextValue"])),a=Object.keys(e),s=this._props?Object.keys(this._props).filter(function(e){return-1===a.indexOf(e)}):[];return this._props=e,k(n,F({},i,P({},I(n[i],s),r)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(n,e){var i="configure",t=H({ais:n.contextValue,multiIndexContext:n.indexContextValue}),r=Q({ais:n.contextValue,multiIndexContext:n.indexContextValue})&&e.indices?e.indices[t]:e,a=(r&&r[i]?Object.keys(r[i]):[]).reduce(function(e,t){return n[t]||(e[t]=r[i][t]),e},{});return k(e,F({},i,a),{ais:n.contextValue,multiIndexContext:n.indexContextValue})}}),q="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};q.setTimeout,q.clearTimeout;var U=q.performance||{};U.now||U.mozNow||U.msNow||U.oNow||U.webkitNow;function W(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Y(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function z(e,t){if(e===t)return e;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i=t[n],r=e[n];void 0!==r&&void 0===i||(Y(r)&&Y(i)?e[n]=z(r,i):e[n]="object"==typeof(a=i)&&null!==a?z(Array.isArray(a)?[]:{},a):a)}var a;return e}var $=function(e){Y(e)||(e={});for(var t=1,n=arguments.length;t<n;t++){var i=arguments[t];Y(i)&&z(e,i)}return e},G=function(){return Array.prototype.slice.call(arguments).reduceRight(function(t,n){return Object.keys(Object(n)).forEach(function(e){void 0!==n[e]&&(t[e]=n[e])}),t},{})};var J=function(n,i){return n.filter(function(e,t){return-1<i.indexOf(e)&&n.indexOf(e)===t})},X=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]};var K=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 Z=function(e,t){if(null===e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],0<=t.indexOf(n)||(r[n]=e[n]);return r};var ee=function(e){return e&&0<Object.keys(e).length},te={addRefinement:function(e,t,n){if(te.isRefined(e,t,n))return e;var i=""+n,r=e[t]?e[t].concat(i):[i],a={};return a[t]=r,G({},a,e)},removeRefinement:function(e,n,t){if(void 0===t)return te.clearRefinement(e,function(e,t){return n===t});var i=""+t;return te.clearRefinement(e,function(e,t){return n===t&&i===e})},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return te.isRefined(e,t,n)?te.removeRefinement(e,t,n):te.addRefinement(e,t,n)},clearRefinement:function(r,a,s){if(void 0===a)return ee(r)?{}:r;if("string"==typeof a)return Z(r,a);if("function"==typeof a){var c=!1,e=Object.keys(r).reduce(function(e,t){var n=r[t]||[],i=n.filter(function(e){return!a(e,t,s)});return i.length!==n.length&&(c=!0),e[t]=i,e},{});return c?e:r}},isRefined:function(e,t,n){var i=!!e[t]&&0<e[t].length;if(void 0===n||!i)return i;var r=""+n;return-1!==e[t].indexOf(r)}},ne=te;function ie(e,n){return Array.isArray(e)&&Array.isArray(n)?e.length===n.length&&e.every(function(e,t){return ie(n[t],e)}):e===n}function re(e){var i=e?re._parseNumbers(e):{};this.facets=i.facets||[],this.disjunctiveFacets=i.disjunctiveFacets||[],this.hierarchicalFacets=i.hierarchicalFacets||[],this.facetsRefinements=i.facetsRefinements||{},this.facetsExcludes=i.facetsExcludes||{},this.disjunctiveFacetsRefinements=i.disjunctiveFacetsRefinements||{},this.numericRefinements=i.numericRefinements||{},this.tagRefinements=i.tagRefinements||[],this.hierarchicalFacetsRefinements=i.hierarchicalFacetsRefinements||{};var r=this;Object.keys(i).forEach(function(e){var t=-1!==re.PARAMETERS.indexOf(e),n=void 0!==i[e];!t&&n&&(r[e]=i[e])})}re.PARAMETERS=Object.keys(new re),re._parseNumbers=function(r){if(r instanceof re)return r;var i={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(e){var t=r[e];if("string"==typeof t){var n=parseFloat(t);i[e]=isNaN(n)?t:n}}),Array.isArray(r.insideBoundingBox)&&(i.insideBoundingBox=r.insideBoundingBox.map(function(e){return e.map(function(e){return parseFloat(e)})})),r.numericRefinements){var a={};Object.keys(r.numericRefinements).forEach(function(n){var i=r.numericRefinements[n]||{};a[n]={},Object.keys(i).forEach(function(e){var t=i[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})}),i.numericRefinements=a}return $({},r,i)},re.make=function(e){var n=new re(e);return(e.hierarchicalFacets||[]).forEach(function(e){if(e.rootPath){var t=n.getHierarchicalRefinement(e.name);0<t.length&&0!==t[0].indexOf(e.rootPath)&&(n=n.clearRefinements(e.name)),0===(t=n.getHierarchicalRefinement(e.name)).length&&(n=n.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}}),n},re.validate=function(e,t){var n=t||{};return e.tagFilters&&n.tagRefinements&&0<n.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&&n.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&&n.numericRefinements&&ee(n.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."):ee(e.numericRefinements)&&n.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},re.prototype={constructor:re,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:ne.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:ne.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:ne.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:ne.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},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 i=K(n);if(this.isNumericRefined(e,t,i))return this;var r=$({},this.numericRefinements);return r[e]=$({},r[e]),r[e][t]?(r[e][t]=r[e][t].slice(),r[e][t].push(i)):r[e][t]=[i],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,i,r){return void 0!==r?this.isNumericRefined(n,i,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===i&&ie(e.val,K(r))})}):this:void 0!==i?this.isNumericRefined(n,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===i})}):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){if(void 0===s)return ee(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof s)return ee(this.numericRefinements[s])?Z(this.numericRefinements,s):this.numericRefinements;if("function"==typeof s){var c=!1,t=this.numericRefinements,e=Object.keys(t).reduce(function(e,i){var r=t[i],a={};return r=r||{},Object.keys(r).forEach(function(t){var e=r[t]||[],n=[];e.forEach(function(e){s({val:e,op:t},i,"numeric")||n.push(e)}),n.length!==e.length&&(c=!0),a[t]=n}),e[i]=a,e},{});return c?e:this.numericRefinements}},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))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return ne.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:ne.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return ne.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:ne.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return ne.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:ne.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},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))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return ne.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:ne.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return ne.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:ne.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return ne.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:ne.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(t){if(!this.isTagRefined(t))return this;var e={tagRefinements:this.tagRefinements.filter(function(e){return e!==t})};return this.setQueryParameters(e)},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))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:ne.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:ne.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:ne.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),i={};return 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)?i[e]=[]:i[e]=[t.slice(0,t.lastIndexOf(n))]:i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:G({},i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var n={};return n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:G({},n,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:G({},t,this.hierarchicalFacetsRefinements)})},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)&&ne.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&ne.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&ne.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var n=this.getHierarchicalRefinement(e);return t?-1!==n.indexOf(t):0<n.length},isNumericRefined:function(e,t,n){if(void 0===n&&void 0===t)return!!this.numericRefinements[e];var i=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===n||!i)return i;var r,a,s=K(n),c=void 0!==(r=this.numericRefinements[e][t],a=s,X(r,function(e){return ie(e,a)}));return i&&c},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var t=this,e=J(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 J(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","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var n=this.managedParameters,i={},r=this;return Object.keys(this).forEach(function(e){var t=r[e];-1===n.indexOf(e)&&void 0!==t&&(i[e]=t)}),i},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(e){if(!e)return this;var t=re.validate(this,e);if(t)throw t;var n=this,r=re._parseNumbers(e),i=Object.keys(this).reduce(function(e,t){return e[t]=n[t],e},{}),a=Object.keys(r).reduce(function(e,t){var n=void 0!==e[t],i=void 0!==r[t];return n&&!i?Z(e,[t]):(i&&(e[t]=r[t]),e)},i);return new this.constructor(a)},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 X(this.hierarchicalFacets,function(e){return e.name===t})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(n).map(function(e){return e.trim()})},toString:function(){return JSON.stringify(this,null,2)}};var ae=re;function se(e,t){if(e!==t){var n=void 0!==e,i=null===e,r=void 0!==t,a=null===t;if(!a&&t<e||i&&r||!n)return 1;if(!i&&e<t||a&&n||!r)return-1}return 0}var ce=function(e,n,r){if(!Array.isArray(e))return[];Array.isArray(r)||(r=[]);var t=e.map(function(t,e){return{criteria:n.map(function(e){return t[e]}),index:e,value:t}});return t.sort(function(e,t){for(var n=-1;++n<e.criteria.length;){var i=se(e.criteria[n],t.criteria[n]);if(i)return n>=r.length?i:"desc"===r[n]?-i:i}return e.index-t.index}),t.map(function(e){return e.value})},oe=function(e){return Array.isArray(e)?e.filter(Boolean):[]},ue=function(e,t){if(!Array.isArray(e))return-1;for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},fe=function(e,t){var r=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var n=t.split(":"),i=X(r,function(e){return e[0]===n[0]});return 1<n.length||!i?(e[0].push(n[0]),e[1].push(n[1])):(e[0].push(i[0]),e[1].push(i[1])),e},[[],[]])},le=function(g){return function(e,t){var a,f,l,h,d,n=g.hierarchicalFacets[t],i=g.hierarchicalFacetsRefinements[n.name]&&g.hierarchicalFacetsRefinements[n.name][0]||"",r=g._getHierarchicalFacetSeparator(n),s=g._getHierarchicalRootPath(n),c=g._getHierarchicalShowParentLevel(n),o=fe(g._getHierarchicalFacetSortBy(n)),u=e.every(function(e){return e.exhaustive}),m=(a=o,f=r,l=s,h=c,d=i,function(e,u,t){var o=e;if(0<t){var n=0;for(o=e;n<t;){var i=o&&Array.isArray(o.data)?o.data:[];o=X(i,function(e){return e.isRefined}),n++}}if(o){var r=Object.keys(u.data).map(function(e){return[e,u.data[e]]}).filter(function(e){var t,n,i,r,a,s,c=e[0];return t=c,n=o.path||l,i=d,r=f,s=h,(!(a=l)||0===t.indexOf(a)&&a!==t)&&(!a&&-1===t.indexOf(r)||a&&t.split(r).length-a.split(r).length==1||-1===t.indexOf(r)&&-1===i.indexOf(r)||0===i.indexOf(t)||0===t.indexOf(n+r)&&(s||0===t.indexOf(i)))});o.data=ce(r.map(function(e){var t,n,i,r,a,s,c=e[0],o=e[1];return t=o,n=c,i=f,r=d,a=u.exhaustive,{name:(s=n.split(i))[s.length-1].trim(),path:n,count:t,isRefined:r===n||0===r.indexOf(n+i),exhaustive:a,data:null}}),a[0],a[1])}return e}),p=e;return s&&(p=e.slice(s.split(r).length)),p.reduce(m,{name:g.hierarchicalFacets[t].name,count:null,isRefined:!0,path:null,exhaustive:u,data:null})}};function he(e){var n={};return e.forEach(function(e,t){n[e]=t}),n}function de(e,t,n){t&&t[n]&&(e.stats=t[n])}function me(f,n){var l=n[0];this._rawResults=n,this.query=l.query,this.parsedQuery=l.parsedQuery,this.hits=l.hits,this.index=l.index,this.hitsPerPage=l.hitsPerPage,this.nbHits=l.nbHits,this.nbPages=l.nbPages,this.page=l.page,this.processingTimeMS=n.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.aroundLatLng=l.aroundLatLng,this.automaticRadius=l.automaticRadius,this.serverUsed=l.serverUsed,this.timeoutCounts=l.timeoutCounts,this.timeoutHits=l.timeoutHits,this.exhaustiveFacetsCount=l.exhaustiveFacetsCount,this.exhaustiveNbHits=l.exhaustiveNbHits,this.userData=l.userData,this.queryID=l.queryID,this.disjunctiveFacets=[],this.hierarchicalFacets=f.hierarchicalFacets.map(function(){return[]}),this.facets=[];var e=f.getRefinedDisjunctiveFacets(),h=he(f.facets),d=he(f.disjunctiveFacets),i=1,m=this,p=l.facets||{};Object.keys(p).forEach(function(e){var t,n,i=p[e],r=(t=f.hierarchicalFacets,n=e,X(t,function(e){return-1<(e.attributes||[]).indexOf(n)}));if(r){var a=r.attributes.indexOf(e),s=ue(f.hierarchicalFacets,function(e){return e.name===r.name});m.hierarchicalFacets[s][a]={attribute:e,data:i,exhaustive:l.exhaustiveFacetsCount}}else{var c,o=-1!==f.disjunctiveFacets.indexOf(e),u=-1!==f.facets.indexOf(e);o&&(c=d[e],m.disjunctiveFacets[c]={name:e,data:i,exhaustive:l.exhaustiveFacetsCount},de(m.disjunctiveFacets[c],l.facets_stats,e)),u&&(c=h[e],m.facets[c]={name:e,data:i,exhaustive:l.exhaustiveFacetsCount},de(m.facets[c],l.facets_stats,e))}}),this.hierarchicalFacets=oe(this.hierarchicalFacets),e.forEach(function(e){var a=n[i],s=a&&a.facets?a.facets:{},c=f.getHierarchicalFacetByName(e);Object.keys(s).forEach(function(t){var n,e=s[t];if(c){n=ue(f.hierarchicalFacets,function(e){return e.name===c.name});var i=ue(m.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1===i)return;m.hierarchicalFacets[n][i].data=$({},m.hierarchicalFacets[n][i].data,e)}else{n=d[t];var r=l.facets&&l.facets[t]||{};m.disjunctiveFacets[n]={name:t,data:G({},e,r),exhaustive:a.exhaustiveFacetsCount},de(m.disjunctiveFacets[n],a.facets_stats,t),f.disjunctiveFacetsRefinements[t]&&f.disjunctiveFacetsRefinements[t].forEach(function(e){!m.disjunctiveFacets[n].data[e]&&-1<f.disjunctiveFacetsRefinements[t].indexOf(e)&&(m.disjunctiveFacets[n].data[e]=0)})}}),i++}),f.getRefinedHierarchicalFacets().forEach(function(e){var s=f.getHierarchicalFacetByName(e),c=f._getHierarchicalFacetSeparator(s),o=f.getHierarchicalRefinement(e);if(!(0===o.length||o[0].split(c).length<2)){var t=n[i],u=t&&t.facets?t.facets:{};Object.keys(u).forEach(function(t){var e=u[t],n=ue(f.hierarchicalFacets,function(e){return e.name===s.name}),i=ue(m.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1!==i){var r={};if(0<o.length){var a=o[0].split(c)[0];r[a]=m.hierarchicalFacets[n][i].data[a]}m.hierarchicalFacets[n][i].data=G(r,e,m.hierarchicalFacets[n][i].data)}}),i++}}),Object.keys(f.facetsExcludes).forEach(function(t){var e=f.facetsExcludes[t],n=h[t];m.facets[n]={name:t,data:l.facets[t],exhaustive:l.exhaustiveFacetsCount},e.forEach(function(e){m.facets[n]=m.facets[n]||{name:t},m.facets[n].data=m.facets[n].data||{},m.facets[n].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(le(f)),this.facets=oe(this.facets),this.disjunctiveFacets=oe(this.disjunctiveFacets),this._state=f}function pe(t,e){if(!e.data||0===e.data.length)return e;var n=e.data.map(function(e){return pe(t,e)}),i=t(n);return $({},e,{data:i})}function ge(e,t){var n=X(e,function(e){return e.name===t});return n&&n.stats}function ve(e,t,n,i,r){var a=X(r,function(e){return e.name===n}),s=a&&a.data&&a.data[i]?a.data[i]:0,c=a&&a.exhaustive||!1;return{type:t,attributeName:n,name:i,count:s,exhaustive:c}}me.prototype.getFacetByName=function(t){function e(e){return e.name===t}return X(this.facets,e)||X(this.disjunctiveFacets,e)||X(this.hierarchicalFacets,e)},me.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],me.prototype.getFacetValues=function(e,t){var n=function(t,n){function e(e){return e.name===n}if(t._state.isConjunctiveFacet(n)){var i=X(t.facets,e);return i?Object.keys(i.data).map(function(e){return{name:e,count:i.data[e],isRefined:t._state.isFacetRefined(n,e),isExcluded:t._state.isExcludeRefined(n,e)}}):[]}if(t._state.isDisjunctiveFacet(n)){var r=X(t.disjunctiveFacets,e);return r?Object.keys(r.data).map(function(e){return{name:e,count:r.data[e],isRefined:t._state.isDisjunctiveFacetRefined(n,e)}}):[]}if(t._state.isHierarchicalFacet(n))return X(t.hierarchicalFacets,e)}(this,e);if(n){var i=G({},t,{sortBy:me.DEFAULT_SORT});if(Array.isArray(i.sortBy)){var r=fe(i.sortBy,me.DEFAULT_SORT);return Array.isArray(n)?ce(n,r[0],r[1]):pe(function(e){return ce(e,r[0],r[1])},n)}if("function"==typeof i.sortBy)return Array.isArray(n)?n.sort(i.sortBy):pe(function(e){return t=i.sortBy,e.sort(t);var t},n);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}},me.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?ge(this.facets,e):this._state.isDisjunctiveFacet(e)?ge(this.disjunctiveFacets,e):void 0},me.prototype.getRefinements=function(){var m=this._state,p=this,g=[];return Object.keys(m.facetsRefinements).forEach(function(t){m.facetsRefinements[t].forEach(function(e){g.push(ve(m,"facet",t,e,p.facets))})}),Object.keys(m.facetsExcludes).forEach(function(t){m.facetsExcludes[t].forEach(function(e){g.push(ve(m,"exclude",t,e,p.facets))})}),Object.keys(m.disjunctiveFacetsRefinements).forEach(function(t){m.disjunctiveFacetsRefinements[t].forEach(function(e){g.push(ve(m,"disjunctive",t,e,p.disjunctiveFacets))})}),Object.keys(m.hierarchicalFacetsRefinements).forEach(function(d){m.hierarchicalFacetsRefinements[d].forEach(function(e){var t,n,i,r,a,s,c,o,u,f,l,h;g.push((t=m,n=d,i=e,r=p.hierarchicalFacets,a=t.getHierarchicalFacetByName(n),s=t._getHierarchicalFacetSeparator(a),c=i.split(s),o=X(r,function(e){return e.name===n}),u=c.reduce(function(e,t){var n=e&&X(e.data,function(e){return e.name===t});return void 0!==n?n:e},o),f=u&&u.count||0,l=u&&u.exhaustive||!1,h=u&&u.path||"",{type:"hierarchical",attributeName:n,name:h,count:f,exhaustive:l}))})}),Object.keys(m.numericRefinements).forEach(function(n){var e=m.numericRefinements[n];Object.keys(e).forEach(function(t){e[t].forEach(function(e){g.push({type:"numeric",attributeName:n,name:e,numericValue:e,operator:t})})})}),m.tagRefinements.forEach(function(e){g.push({type:"tag",attributeName:"_tags",name:e})}),g};var xe=me;function ye(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var Re=ye;function be(e){return"function"==typeof e}function Fe(e){return"object"==typeof e&&null!==e}function Pe(e){return void 0===e}(ye.EventEmitter=ye).prototype._events=void 0,ye.prototype._maxListeners=void 0,ye.defaultMaxListeners=10,ye.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},ye.prototype.emit=function(e){var t,n,i,r,a,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||Fe(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(Pe(n=this._events[e]))return!1;if(be(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:r=Array.prototype.slice.call(arguments,1),n.apply(this,r)}else if(Fe(n))for(r=Array.prototype.slice.call(arguments,1),i=(s=n.slice()).length,a=0;a<i;a++)s[a].apply(this,r);return!0},ye.prototype.on=ye.prototype.addListener=function(e,t){var n;if(!be(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,be(t.listener)?t.listener:t),this._events[e]?Fe(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Fe(this._events[e])&&!this._events[e].warned&&(n=Pe(this._maxListeners)?ye.defaultMaxListeners:this._maxListeners)&&0<n&&this._events[e].length>n&&(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},ye.prototype.once=function(e,t){if(!be(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},ye.prototype.removeListener=function(e,t){var n,i,r,a;if(!be(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||be(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Fe(n)){for(a=r;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},ye.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(be(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},ye.prototype.listeners=function(e){return this._events&&this._events[e]?be(this._events[e])?[this._events[e]]:this._events[e].slice():[]},ye.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(be(t))return 1;if(t)return t.length}return 0},ye.listenerCount=function(e,t){return e.listenerCount(t)};var Ce=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};function Ve(e,t){this.main=e,this.fn=t,this.lastResults=null}Ce(Ve,Re.EventEmitter),Ve.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},Ve.prototype.getModifiedState=function(e){return this.fn(e)};var je=Ve,_e={_getQueries:function(r,a){var s=[];return s.push({indexName:r,params:_e._getHitsSearchParams(a)}),a.getRefinedDisjunctiveFacets().forEach(function(e){s.push({indexName:r,params:_e._getDisjunctiveFacetSearchParams(a,e)})}),a.getRefinedHierarchicalFacets().forEach(function(e){var t=a.getHierarchicalFacetByName(e),n=a.getHierarchicalRefinement(e),i=a._getHierarchicalFacetSeparator(t);0<n.length&&1<n[0].split(i).length&&s.push({indexName:r,params:_e._getDisjunctiveFacetSearchParams(a,e,!0)})}),s},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(_e._getHitsHierarchicalFacetsAttributes(e)),n=_e._getFacetFilters(e),i=_e._getNumericFilters(e),r={facets:t,tagFilters:_e._getTagFilters(e)};return 0<n.length&&(r.facetFilters=n),0<i.length&&(r.numericFilters=i),$({},e.getQueryParams(),r)},_getDisjunctiveFacetSearchParams:function(e,t,n){var i=_e._getFacetFilters(e,t,n),r=_e._getNumericFilters(e,t),a={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:_e._getTagFilters(e),analytics:!1,clickAnalytics:!1},s=e.getHierarchicalFacetByName(t);return a.facets=s?_e._getDisjunctiveHierarchicalFacetAttribute(e,s,n):t,0<r.length&&(a.numericFilters=r),0<i.length&&(a.facetFilters=i),$({},e.getQueryParams(),a)},_getNumericFilters:function(e,r){if(e.numericFilters)return e.numericFilters;var a=[];return Object.keys(e.numericRefinements).forEach(function(i){var t=e.numericRefinements[i]||{};Object.keys(t).forEach(function(n){var e=t[n]||[];r!==i&&e.forEach(function(e){if(Array.isArray(e)){var t=e.map(function(e){return i+n+e});a.push(t)}else a.push(i+n+e)})})}),a},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(c,o,u){var f=[],e=c.facetsRefinements||{};Object.keys(e).forEach(function(t){(e[t]||[]).forEach(function(e){f.push(t+":"+e)})});var n=c.facetsExcludes||{};Object.keys(n).forEach(function(t){(n[t]||[]).forEach(function(e){f.push(t+":-"+e)})});var i=c.disjunctiveFacetsRefinements||{};Object.keys(i).forEach(function(t){var e=i[t]||[];if(t!==o&&e&&0!==e.length){var n=[];e.forEach(function(e){n.push(t+":"+e)}),f.push(n)}});var l=c.hierarchicalFacetsRefinements||{};return Object.keys(l).forEach(function(e){var t=(l[e]||[])[0];if(void 0!==t){var n,i,r=c.getHierarchicalFacetByName(e),a=c._getHierarchicalFacetSeparator(r),s=c._getHierarchicalRootPath(r);if(o===e){if(-1===t.indexOf(a)||!s&&!0===u||s&&s.split(a).length===t.split(a).length)return;t=s?(i=s.split(a).length-1,s):(i=t.split(a).length-2,t.slice(0,t.lastIndexOf(a))),n=r.attributes[i]}else i=t.split(a).length-1,n=r.attributes[i];n&&f.push([n+":"+t])}}),f},_getHitsHierarchicalFacetsAttributes:function(s){return s.hierarchicalFacets.reduce(function(e,t){var n=s.getHierarchicalRefinement(t.name)[0];if(!n)return e.push(t.attributes[0]),e;var i=s._getHierarchicalFacetSeparator(t),r=n.split(i).length,a=t.attributes.slice(0,r+1);return e.concat(a)},[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var i=e._getHierarchicalFacetSeparator(t);if(!0===n){var r=e._getHierarchicalRootPath(t),a=0;return r&&(a=r.split(i).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(i).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,n,i){var r=i.isDisjunctiveFacet(e)?i.clearRefinements(e):i,a={facetQuery:t,facetName:e};return"number"==typeof n&&(a.maxFacetHits=n),$({},_e._getHitsSearchParams(r),a)}},Ie=_e,we="3.1.0";function Se(e,t,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.1.0)"),this.setClient(e);var i=n||{};i.index=t,this.state=ae.make(i),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function Ee(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function Oe(){return this.state.page}Ce(Se,Re.EventEmitter),Se.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},Se.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},Se.prototype.getQuery=function(){var e=this.state;return Ie._getHitsSearchParams(e)},Se.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,i=Ie._getQueries(n.index,n),r=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(i).then(function(e){return r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),{content:new xe(n,e.results),state:n,_originalResponse:e}},function(e){throw r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),e});this.client.search(i).then(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(null,new xe(n,e.results),n)}).catch(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(e,null,n)})},Se.prototype.searchForFacetValues=function(t,e,n,i){var r="function"==typeof this.client.searchForFacetValues;if(!r&&"function"!=typeof this.client.initIndex)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");var a=this.state.setQueryParameters(i||{}),s=a.isDisjunctiveFacet(t),c=Ie.getSearchForFacetQuery(t,e,n,a);this._currentNbQueries++;var o=this;return this.emit("searchForFacetValues",{state:a,facet:t,query:e}),(r?this.client.searchForFacetValues([{indexName:a.index,params:c}]):this.client.initIndex(a.index).searchForFacetValues(c)).then(function(e){return o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),(e=Array.isArray(e)?e[0]:e).facetHits.forEach(function(e){e.isRefined=s?a.isDisjunctiveFacetRefined(t,e.value):a.isFacetRefined(t,e.value)}),e},function(e){throw o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),e})},Se.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},Se.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},Se.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},Se.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},Se.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},Se.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},Se.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},Se.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},Se.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},Se.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},Se.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},Se.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},Se.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},Se.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},Se.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},Se.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},Se.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},Se.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},Se.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},Se.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},Se.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},Se.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},Se.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},Se.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},Se.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},Se.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},Se.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},Se.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},Se.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},Se.prototype.setCurrentPage=Ee,Se.prototype.setPage=Ee,Se.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},Se.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},Se.prototype.setState=function(e){return this._change({state:ae.make(e),isPageReset:!1}),this},Se.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new ae(e),this},Se.prototype.hasRefinements=function(e){return!!ee(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))},Se.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},Se.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},Se.prototype.hasTag=function(e){return this.state.isTagRefined(e)},Se.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},Se.prototype.getIndex=function(){return this.state.index},Se.prototype.getCurrentPage=Oe,Se.prototype.getPage=Oe,Se.prototype.getTags=function(){return this.state.tagRefinements},Se.prototype.getRefinements=function(e){var n=[];if(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"})});else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"disjunctive"})})}var i=this.state.getNumericRefinements(e);return Object.keys(i).forEach(function(e){var t=i[e];n.push({value:t,operator:e,type:"numeric"})}),n},Se.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},Se.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},Se.prototype._search=function(e){var i=this.state,r=[],t=[];e.onlyWithDerivedHelpers||(t=Ie._getQueries(i.index,i),r.push({state:i,queriesCount:t.length,helper:this}),this.emit("search",{state:i,results:this.lastResults}));var n=this.derivedHelpers.map(function(e){var t=e.getModifiedState(i),n=Ie._getQueries(t.index,t);return r.push({state:t,queriesCount:n.length,helper:e}),e.emit("search",{state:t,results:e.lastResults}),n}),a=Array.prototype.concat.apply(t,n),s=this._queryId++;this._currentNbQueries++;try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(e){this.emit("error",{error:e})}},Se.prototype._dispatchAlgoliaResponse=function(e,t,n){if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var s=n.results.slice();e.forEach(function(e){var t=e.state,n=e.queriesCount,i=e.helper,r=s.splice(0,n),a=i.lastResults=new xe(t,r);i.emit("result",{results:a,state:t})})}},Se.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"))},Se.prototype.containsRefinement=function(e,t,n,i){return e||0!==t.length||0!==n.length||0!==i.length},Se.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&0<this.state.disjunctiveRefinements[e].length},Se.prototype._change=function(e){var t=e.state,n=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:n}))},Se.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},Se.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.1.0)"),this.client=e),this},Se.prototype.getClient=function(){return this.client},Se.prototype.derive=function(e){var t=new je(this,e);return this.derivedHelpers.push(t),t},Se.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},Se.prototype.hasPendingRequests=function(){return 0<this._currentNbQueries};var Ne=Se;function Ae(e,t,n){return new Ne(e,t,n)}Ae.version=we,Ae.AlgoliaSearchHelper=Ne,Ae.SearchParameters=ae,Ae.SearchResults=xe;var He=Ae;function Te(e){var t=e.attributeName,n=e.attributeValue,i=e.attributeScore;return"".concat(t,":").concat(n,"<score=").concat(i||1,">")}function Qe(a){var e=Object.keys(a.matchingPatterns).reduce(function(e,t){var n=a.matchingPatterns[t],i=a.hit[t],r=n.score;return Array.isArray(i)?[].concat(W(e),[i.map(function(e){return Te({attributeName:t,attributeValue:e,attributeScore:r})})]):"string"==typeof i?[].concat(W(e),[Te({attributeName:t,attributeValue:i,attributeScore:r})]):e},[]);return a.transformSearchParameters(new He.SearchParameters({sumOrFiltersScores:!0,facetFilters:["objectID:-".concat(a.hit.objectID)],optionalFilters:e}))}var ke=S({displayName:"AlgoliaConfigureRelatedItems",defaultProps:{transformSearchParameters:function(e){return P({},e)}},getProvidedProps:function(){return{}},getSearchParameters:function(e,t){return e.setQueryParameters(Qe(t))},transitionState:function(e,t,n){var i,r="configure",a=(i=C(Qe(e)),Object.keys(i).forEach(function(e){var t=i[e];Array.isArray(t)&&0===t.length&&delete i[e]}),i),s=Object.keys(a),c=this._searchParameters?Object.keys(this._searchParameters).filter(function(e){return-1===s.indexOf(e)}):[];return this._searchParameters=a,k(n,F({},r,P({},I(n[r],c),a)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){var n=this,i="configure",r=H({ais:e.contextValue,multiIndexContext:e.indexContextValue}),a=Q({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&t.indices?t.indices[r]:t,s=(a&&a[i]?Object.keys(a[i]):[]).reduce(function(e,t){return n._searchParameters[t]||(e[t]=a[i][t]),e},{});return k(t,F({},i,s),{ais:e.contextValue,multiIndexContext:e.indexContextValue})}});var De=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}})()&&Object.assign;function Le(){}var qe,Ue=(function(e){e.exports=function(){function e(e,t,n,i,r,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var s=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");throw s.name="Invariant Violation",s}}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=Le,n.PropTypes=n}()}(qe={exports:{}},qe.exports),qe.exports);function We(e,t,n){var i=B(e,t,n,"query","");return i||""}var Ye=S({displayName:"AlgoliaAutoComplete",getProvidedProps:function(e,t,n){return{hits:(i=n,i.results?i.results.hits&&Array.isArray(i.results.hits)?V(j(i.results.hits,i.results.queryID),i.results.hitsPerPage,i.results.page):Object.keys(i.results).reduce(function(e,t){return[].concat(W(e),[{index:t,hits:V(j(i.results[t].hits,i.results[t].queryID),i.results[t].hitsPerPage,i.results[t].page)}])},[]):[]),currentRefinement:We(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue})};var i},refine:function(e,t,n){return i=t,r=n,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},k(i,F({},"query",r),a,!0);var i,r,a},cleanUp:function(e,t){return n=t,i={ais:e.contextValue,multiIndexContext:e.indexContextValue},M(n,i,"query");var n,i},getSearchParameters:function(e,t,n){return e.setQuery(We(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))}}),ze=function(e){return e.attributes[0]};var $e=S({displayName:"AlgoliaBreadcrumb",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:Ue.func},getProvidedProps:function(e,t,n){var i=ze(e),r=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!(Boolean(r)&&Boolean(r.getFacetByName(i))))return{items:[],canRefine:!1};var a=r.getFacetValues(i),s=a.data?function n(e){return e.reduce(function(e,t){return t.isRefined&&(e.push({label:t.name,value:t.path}),t.data&&(e=e.concat(n(t.data)))),e},[])}(a.data):[],c=e.transformItems?e.transformItems(s):s;return{canRefine:0<c.length,items:c}},refine:function(e,t,n){return r=t,a=n,s={ais:(i=e).contextValue,multiIndexContext:e.indexContextValue},k(r,F({},ze(i),a||""),s,!0,"hierarchicalMenu");var i,r,a,s}}),Ge=S({displayName:"AlgoliaCurrentRefinements",propTypes:{transformItems:Ue.func},getProvidedProps:function(n,e,t,i){var r=i.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 P({},e,{id:t.id,index:t.index})})):e},[]),a=n.transformItems?n.transformItems(r):r;return{items:a,canRefine:0<a.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)}}),Je=function(e){return[e.northEast.lat,e.northEast.lng,e.southWest.lat,e.southWest.lng].join()},Xe=/^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/,Ke=function(e){var t=e.match(Xe);return{lat:parseFloat(t[1]),lng:parseFloat(t[2])}},Ze=function(e,t,n){var i=B(e,t,n,"boundingBox",{});if(a(i))return{northEast:{lat:parseFloat(i.northEast.lat),lng:parseFloat(i.northEast.lng)},southWest:{lat:parseFloat(i.southWest.lat),lng:parseFloat(i.southWest.lng)}}},et=function(e,t,n){return k(e,F({},"boundingBox",t),n,!0)},tt=S({displayName:"AlgoliaGeoSearch",getProvidedProps:function(e,t,n){var i,r,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},s=T(n,a),c=Ze(e,t,a),o=s&&s._state.insideBoundingBox&&(i=s._state.insideBoundingBox,r=i.split(","),{northEast:{lat:parseFloat(r[0]),lng:parseFloat(r[1])},southWest:{lat:parseFloat(r[2]),lng:parseFloat(r[3])}})||void 0,u=function(e,t,n){e.defaultRefinement;var i=y(e,["defaultRefinement"]),r=B(i,t,n,"aroundLatLng");if(r)return r;var a=B(i,t,n,"configure.aroundLatLng");return a&&Ke(a)}(e,t,a),f=s&&s._state.aroundLatLng&&Ke(s._state.aroundLatLng)||void 0,l=c||o,h=u||f;return{hits:s?s.hits.filter(function(e){return Boolean(e._geoloc)}):[],isRefinedWithMap:Boolean(l),currentRefinement:l,position:h}},refine:function(e,t,n){return et(t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},getSearchParameters:function(e,t,n){var i=Ze(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return i?e.setQueryParameter("insideBoundingBox",Je(i)):e},cleanUp:function(e,t){return M(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"boundingBox")},getMetadata:function(e,t){var n=[],i="boundingBox",r={ais:e.contextValue,multiIndexContext:e.indexContextValue},a=H(r),s={},c=Ze(e,t,r);return c&&n.push({label:"".concat(i,": ").concat(Je(c)),value:function(e){return et(e,s,r)},currentRefinement:c}),{id:i,index:a,items:n}},shouldComponentUpdate:function(){return!0}}),nt=function(e){return e.attributes[0]},it="hierarchicalMenu";function rt(e,t,n){var i=B(e,t,n,"".concat(it,".").concat(nt(e)),null);return""===i?null:i}function at(e,l,h,d){return e.map(function(e){return{label:e.name,value:(t=e.path,n=l,i=h,r=d,a=n.id,s=n.attributes,c=n.separator,o=n.rootPath,u=n.showParentLevel,f=rt(n,i,r),null===f?t:new He.SearchParameters({hierarchicalFacets:[{name:a,attributes:s,separator:c,rootPath:o,showParentLevel:u}]}).toggleHierarchicalFacetRefinement(a,f).toggleHierarchicalFacetRefinement(a,t).getHierarchicalRefinement(a)[0]),count:e.count,isRefined:e.isRefined,items:e.data&&at(e.data,l,h,d)};var t,n,i,r,a,s,c,o,u,f})}function st(e,t,n,i){return k(t,F({},nt(e),n||""),i,!0,it)}var ct=["name:asc"],ot=S({displayName:"AlgoliaHierarchicalMenu",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:Ue.string,rootPath:Ue.string,showParentLevel:Ue.bool,defaultRefinement:Ue.string,showMore:Ue.bool,limit:Ue.number,showMoreLimit:Ue.number,transformItems:Ue.func},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,separator:" > ",rootPath:null,showParentLevel:!0},getProvidedProps:function(e,t,n){var i=e.showMore,r=e.limit,a=e.showMoreLimit,s=nt(e),c=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!(Boolean(c)&&Boolean(c.getFacetByName(s))))return{items:[],currentRefinement:rt(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:!1};var o=i?a:r,u=c.getFacetValues(s,{sortBy:ct}),f=u.data?at(u.data,e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}):[],l=e.transformItems?e.transformItems(f):f;return{items:function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e.slice(0,n).map(function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(e.items)?P({},e,{items:t(e.items,n)}):e})}(l,o),currentRefinement:rt(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:0<l.length}},refine:function(e,t,n){return st(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return i=t,r={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},M(i,r,"".concat(it,".").concat(nt(n)));var n,i,r},getSearchParameters:function(e,t,n){var i=t.attributes,r=t.separator,a=t.rootPath,s=t.showParentLevel,c=t.showMore,o=t.limit,u=t.showMoreLimit,f=t.contextValue,l=nt(t),h=c?u:o;e=e.addHierarchicalFacet({name:l,attributes:i,separator:r,rootPath:a,showParentLevel:s}).setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,h)});var d=rt(t,n,{ais:f,multiIndexContext:t.indexContextValue});return null!==d&&(e=e.toggleHierarchicalFacetRefinement(l,d)),e},getMetadata:function(t,e){var n=t.attributes[0],i=nt(t),r=rt(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=r?[{label:"".concat(n,": ").concat(r),attribute:n,value:function(e){return st(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:r}]:[];return{id:i,index:H({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:a}}}),ut=function(e){var t=e.attribute,n=e.hit,i=e.highlightProperty,r=e.preTag,a=void 0===r?E:r,s=e.postTag;return A({attribute:t,highlightProperty:i,hit:n,preTag:a,postTag:void 0===s?O:s})},ft=S({displayName:"AlgoliaHighlighter",propTypes:{},getProvidedProps:function(){return{highlight:ut}}}),lt=S({displayName:"AlgoliaHits",getProvidedProps:function(e,t,n){var i=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return i?{hits:j(V(i.hits,i.hitsPerPage,i.page),i.queryID)}:{hits:[]}},getSearchParameters:function(e){return e}});function ht(e,t,n){var i=B(e,t,n,"hitsPerPage",null);return"string"==typeof i?parseInt(i,10):i}var dt=S({displayName:"AlgoliaHitsPerPage",propTypes:{defaultRefinement:Ue.number.isRequired,items:Ue.arrayOf(Ue.shape({label:Ue.string,value:Ue.number.isRequired})).isRequired,transformItems:Ue.func},getProvidedProps:function(e,t){var n=ht(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),i=e.items.map(function(e){return e.value===n?P({},e,{isRefined:!0}):P({},e,{isRefined:!1})});return{items:e.transformItems?e.transformItems(i):i,currentRefinement:n}},refine:function(e,t,n){return k(t,F({},"hitsPerPage",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return M(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"hitsPerPage")},getSearchParameters:function(e,t,n){return e.setHitsPerPage(ht(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(){return{id:"hitsPerPage"}}});function mt(e,t,n){var i=B(e,t,n,"page",1);return"string"==typeof i?parseInt(i,10):i}function pt(e){var t=e||{};t.page;return y(t,["page"])}function gt(n){return Object.keys(n).map(Number).sort(function(e,t){return e-t}).reduce(function(e,t){return e.concat(n[t])},[])}var vt=S({displayName:"AlgoliaInfiniteHits",getProvidedProps:function(e,t,n){var i=this,r=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});this._prevState=this._prevState||{};var a,s,c=e.cache||(s=a=void 0,{read:function(e){var t=e.state;return R(s,pt(t))?a:null},write:function(e){var t=e.state,n=e.hits;s=pt(t),a=n}});if(void 0===this._cachedHits&&(this._cachedHits=c.read({state:t})||{}),!r)return{hits:gt(this._cachedHits),hasPrevious:!1,hasMore:!1,refine:function(){},refinePrevious:function(){},refineNext:function(){}};var o=r.page,u=r.hits,f=r.hitsPerPage,l=r.nbPages,h=r._state,d=((h=void 0===h?{}:h).page,y(h,["page"])),m=j(V(u,f,o),r.queryID);R(d,this._prevState)||(this._cachedHits=c.read({state:t})||{}),void 0===this._cachedHits[o]&&(this._cachedHits[o]=m,c.write({state:t,hits:this._cachedHits})),this._prevState=d;var p=Math.min.apply(Math,W(Object.keys(this._cachedHits).map(Number))),g=Math.max.apply(Math,W(Object.keys(this._cachedHits).map(Number))),v=0<p,x=g<l-1;return{hits:gt(this._cachedHits),hasPrevious:v,hasMore:x,refinePrevious:function(e){return i.refine(e,p-1)},refineNext:function(e){return i.refine(e,g+1)}}},getSearchParameters:function(e,t,n){return e.setQueryParameters({page:mt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})-1})},refine:function(e,t,n,i){var r=Object.keys(this._cachedHits||{}).map(Number),a=0===r.length?void 0:Math.max.apply(Math,W(r));void 0===i&&void 0!==a?i=a+1:void 0===i&&(i=mt(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}));return k(t,F({},"page",i+1),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!1)}}),xt="menu";function yt(e){return e.attribute}function Rt(e,t,n){var i=B(e,t,n,"".concat(xt,".").concat(yt(e)),null);return""===i?null:i}function bt(e,t,n,i){return e===Rt(t,n,i)?"":e}function Ft(e){var t=e.showMore,n=e.limit,i=e.showMoreLimit;return t?i:n}function Pt(e,t,n,i){return k(t,F({},yt(e),n||""),i,!0,xt)}var Ct=["count:desc","name:asc"],Vt=S({displayName:"AlgoliaMenu",propTypes:{attribute:Ue.string.isRequired,showMore:Ue.bool,limit:Ue.number,showMoreLimit:Ue.number,defaultRefinement:Ue.string,transformItems:Ue.func,searchable:Ue.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20},getProvidedProps:function(t,n,e,i,r){var a,s=t.attribute,c=t.searchable,o=t.indexContextValue,u=T(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),f=Boolean(u)&&Boolean(u.getFacetByName(s)),l=Boolean(r&&r[s]&&""!==r.query);if(c&&o)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");if(!f)return{items:[],currentRefinement:Rt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:c,canRefine:f};a=l?r[s].map(function(e){return{label:e.value,value:bt(e.value,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):u.getFacetValues(s,{sortBy:c?void 0:Ct}).map(function(e){return{label:e.name,value:bt(e.name,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}});var h=t.transformItems?t.transformItems(a):a;return{items:h.slice(0,Ft(t)),currentRefinement:Rt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:l,searchable:c,canRefine:0<h.length}},refine:function(e,t,n){return Pt(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:Ft(e)}},cleanUp:function(e,t){return i=t,r={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},M(i,r,"".concat(xt,".").concat(yt(n)));var n,i,r},getSearchParameters:function(e,t,n){var i=t.attribute;e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,Ft(t))})).addDisjunctiveFacet(i);var r=Rt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return null!==r&&(e=e.addDisjunctiveFacetRefinement(i,r)),e},getMetadata:function(t,e){var n=yt(t),i=Rt(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:n,index:H({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===i?[]:[{label:"".concat(t.attribute,": ").concat(i),attribute:t.attribute,value:function(e){return Pt(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:i}]}}});function jt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],i=!0,r=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(i=(s=c.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function _t(e){if(void 0===e.start&&void 0===e.end)return"";var t=void 0!==e.start?e.start:"",n=void 0!==e.end?e.end:"";return"".concat(t,":").concat(n)}var It="multiRange";function wt(e){return e.attribute}function St(e,t,n){return B(e,t,n,"".concat(It,".").concat(wt(e)),"")}function Et(e,t,n,i){return k(t,F({},wt(e),n),i,!0,It)}var Ot=S({displayName:"AlgoliaNumericMenu",propTypes:{id:Ue.string,attribute:Ue.string.isRequired,items:Ue.arrayOf(Ue.shape({label:Ue.node,start:Ue.number,end:Ue.number})).isRequired,transformItems:Ue.func},getProvidedProps:function(p,e,t){var n=p.attribute,g=St(p,e,{ais:p.contextValue,multiIndexContext:p.indexContextValue}),v=T(t,{ais:p.contextValue,multiIndexContext:p.indexContextValue}),i=p.items.map(function(e){var t,n,i,r,a,s,c,o,u,f,l,h,d,m=_t(e);return{label:e.label,value:m,isRefined:m===g,noRefinement:!!v&&(t=wt(p),n=v,i=m,f=n.getFacetByName(t)?n.getFacetStats(t):null,l=i.split(":"),h=0===Number(l[0])||""===i?Number.NEGATIVE_INFINITY:Number(l[0]),d=0===Number(l[1])||""===i?Number.POSITIVE_INFINITY:Number(l[1]),!(Boolean(f)&&(o=h,u=d,(c=f).min>o&&c.min<u||c.max>o&&c.max<u||(s=d,(a=h)>(r=f).min&&a<r.max||s>r.min&&s<r.max))))}}),r=v&&v.getFacetByName(n)?v.getFacetStats(n):null,a=_(i,function(e){return!0===e.isRefined});i.some(function(e){return""===e.value})||i.push({value:"",isRefined:void 0===a,noRefinement:!r,label:"All"});var s=p.transformItems?p.transformItems(i):i;return{items:s,currentRefinement:g,canRefine:0<s.length&&s.some(function(e){return!1===e.noRefinement})}},refine:function(e,t,n){return Et(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return i=t,r={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},M(i,r,"".concat(It,".").concat(wt(n)));var n,i,r},getSearchParameters:function(e,t,n){var i=t.attribute,r=function(e){if(0===e.length)return{start:null,end:null};var t=jt(e.split(":"),2),n=t[0],i=t[1];return{start:0<n.length?parseInt(n,10):null,end:0<i.length?parseInt(i,10):null}}(St(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})),a=r.start,s=r.end;return e=e.addDisjunctiveFacet(i),"number"==typeof a&&(e=e.addNumericRefinement(i,">=",a)),"number"==typeof s&&(e=e.addNumericRefinement(i,"<=",s)),e},getMetadata:function(t,e){var n=wt(t),i=St(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),r=[],a=H({ais:t.contextValue,multiIndexContext:t.indexContextValue});if(""!==i){var s=_(t.items,function(e){return _t(e)===i}).label;r.push({label:"".concat(t.attribute,": ").concat(s),attribute:t.attribute,currentRefinement:s,value:function(e){return Et(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})}})}return{id:n,index:a,items:r}}});function Nt(e,t,n){var i=B(e,t,n,"page",1);return"string"==typeof i?parseInt(i,10):i}var At=S({displayName:"AlgoliaPagination",getProvidedProps:function(e,t,n){var i=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!i)return null;var r=i.nbPages;return{nbPages:r,currentRefinement:Nt(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:1<r}},refine:function(e,t,n){return i=t,r=n,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},k(i,F({},"page",r),a,!1);var i,r,a},cleanUp:function(e,t){return M(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"page")},getSearchParameters:function(e,t,n){return e.setPage(Nt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})-1)},getMetadata:function(){return{id:"page"}}}),Ht=S({displayName:"AlgoliaPoweredBy",getProvidedProps:function(){var e="undefined"==typeof window?"":window.location.hostname;return{url:"https://www.algolia.com/?utm_source=react-instantsearch&utm_medium=website&"+"utm_content=".concat(e,"&")+"utm_campaign=poweredby"}}});function Tt(e){return e.attribute}var Qt="range";function kt(e,t,n,i){var r=B(e,t,i,"".concat(Qt,".").concat(Tt(e)),{}),a=r.min,s=r.max,c=Boolean(e.precision),o=a;"string"==typeof o&&(o=c?parseFloat(o):parseInt(o,10));var u=s;"string"==typeof u&&(u=c?parseFloat(u):parseInt(u,10));var f={min:o,max:u},l=void 0!==e.min,h=void 0!==e.max,d=void 0!==f.min,m=void 0!==f.max;if(l&&d&&f.min<n.min)throw Error("You can't provide min value lower than range.");if(h&&m&&f.max>n.max)throw Error("You can't provide max value greater than range.");return l&&!d&&(f.min=n.min),h&&!m&&(f.max=n.max),f}function Dt(e,t){return{min:void 0!==e.min?e.min:t.min,max:void 0!==e.max?e.max:t.max}}function Bt(e,t,n,i){return e||n!==i?e&&t?n:i:void 0}function Mt(e,t,n,i,r){var a=n.min,s=n.max,c=i.min,o=i.max,u=void 0===a||""===a,f=void 0===s||""===s,l=u?void 0:parseFloat(a),h=f?void 0:parseFloat(s),d=u||isFinite(l),m=f||isFinite(h);if(!d||!m)throw Error("You can't provide non finite values to the range connector.");if(l<c)throw Error("You can't provide min value lower than range.");if(o<h)throw Error("You can't provide max value greater than range.");return k(t,F({},Tt(e),{min:Bt(void 0!==e.min,u,c,l),max:Bt(void 0!==e.max,f,o,h)}),r,!0,Qt)}var Lt=S({displayName:"AlgoliaRange",propTypes:{id:Ue.string,attribute:Ue.string.isRequired,defaultRefinement:Ue.shape({min:Ue.number,max:Ue.number}),min:Ue.number,max:Ue.number,precision:Ue.number,header:Ue.node,footer:Ue.node},defaultProps:{precision:0},getProvidedProps:function(e,t,n){var i,r,a,s,c,o,u=e.attribute,f=e.precision,l=e.min,h=e.max,d=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),m=d&&d.getFacetByName(u),p=m&&d.getFacetStats(u)||{},g=(m?d.getFacetValues(u):[]).map(function(e){return{value:e.name,count:e.count}}),v=(i={min:l,max:h},r=p,a=f,o=Math.pow(10,a),s="number"==typeof i.min&&isFinite(i.min)?i.min:"number"==typeof r.min&&isFinite(r.min)?r.min:void 0,c="number"==typeof i.max&&isFinite(i.max)?i.max:"number"==typeof r.max&&isFinite(r.max)?r.max:void 0,{min:void 0!==s?Math.floor(s*o)/o:s,max:void 0!==c?Math.ceil(c*o)/o:c}),x=v.min,y=v.max;this._currentRange={min:x,max:y};var R=kt(e,t,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{min:x,max:y,canRefine:0<g.length,currentRefinement:Dt(R,this._currentRange),count:g,precision:f}},refine:function(e,t,n){return Mt(e,t,n,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return i=t,r={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},M(i,r,"".concat(Qt,".").concat(Tt(n)));var n,i,r},getSearchParameters:function(e,t,n){var i=t.attribute,r=kt(t,n,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=r.min,s=r.max;return e=e.addDisjunctiveFacet(i),void 0!==a&&(e=e.addNumericRefinement(i,">=",a)),void 0!==s&&(e=e.addNumericRefinement(i,"<=",s)),e},getMetadata:function(t,e){var n=this,i=this._currentRange,r=i.min,a=i.max,s=kt(t,e,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),c=s.min,o=s.max,u=[],f=void 0!==c,l=void 0!==o;if(f&&c!==r||l&&o!==a){var h=[f?"".concat(c," <= "):"",t.attribute,l?" <= ".concat(o):""];u.push({label:h.join(""),attribute:t.attribute,value:function(e){return Mt(t,e,{},n._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:Dt({min:c,max:o},{min:r,max:a})})}return{id:Tt(t),index:H({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:u}}}),qt="refinementList";function Ut(e){return e.attribute}function Wt(e,t,n){var i=B(e,t,n,"".concat(qt,".").concat(Ut(e)),[]);return"string"!=typeof i?i:i?[i]:[]}function Yt(t,e,n,i){var r=Wt(e,n,i);return-1===r.indexOf(t)?r.concat([t]):r.filter(function(e){return e!==t})}function zt(e){var t=e.showMore,n=e.limit,i=e.showMoreLimit;return t?i:n}function $t(e,t,n,i){return k(t,F({},Ut(e),0<n.length?n:""),i,!0,qt)}var Gt=["isRefined","count:desc","name:asc"],Jt=S({displayName:"AlgoliaRefinementList",propTypes:{id:Ue.string,attribute:Ue.string.isRequired,operator:Ue.oneOf(["and","or"]),showMore:Ue.bool,limit:Ue.number,showMoreLimit:Ue.number,defaultRefinement:Ue.arrayOf(Ue.oneOfType([Ue.string,Ue.number])),searchable:Ue.bool,transformItems:Ue.func},defaultProps:{operator:"or",showMore:!1,limit:10,showMoreLimit:20},getProvidedProps:function(t,n,e,i,r){var a=t.attribute,s=t.searchable,c=t.indexContextValue,o=T(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),u=Boolean(o)&&Boolean(o.getFacetByName(a)),f=Boolean(r&&r[a]&&""!==r.query);if(s&&c)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");if(!u)return{items:[],currentRefinement:Wt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),canRefine:u,isFromSearch:f,searchable:s};var l=f?r[a].map(function(e){return{label:e.value,value:Yt(e.value,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):o.getFacetValues(a,{sortBy:Gt}).map(function(e){return{label:e.name,value:Yt(e.name,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}}),h=t.transformItems?t.transformItems(l):l;return{items:h.slice(0,zt(t)),currentRefinement:Wt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:f,searchable:s,canRefine:0<h.length}},refine:function(e,t,n){return $t(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:zt(e)}},cleanUp:function(e,t){return i=t,r={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},M(i,r,"".concat(qt,".").concat(Ut(n)));var n,i,r},getSearchParameters:function(e,t,n){var i=t.attribute,r="and"===t.operator?"addFacet":"addDisjunctiveFacet",a="".concat(r,"Refinement");return e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,zt(t))}))[r](i),Wt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}).reduce(function(e,t){return e[a](i,t)},e)},getMetadata:function(i,r){var e=Ut(i),a={ais:i.contextValue,multiIndexContext:i.indexContextValue};return{id:e,index:H(a),items:0<Wt(i,r,a).length?[{attribute:i.attribute,label:"".concat(i.attribute,": "),currentRefinement:Wt(i,r,a),value:function(e){return $t(i,e,[],a)},items:Wt(i,r,a).map(function(n){return{label:"".concat(n),value:function(e){var t=Wt(i,e,a).filter(function(e){return e!==n});return $t(i,r,t,a)}}})}]:[]}}}),Xt=S({displayName:"AlgoliaScrollTo",propTypes:{scrollOn:Ue.string},defaultProps:{scrollOn:"page"},getProvidedProps:function(e,t){var n=e.scrollOn,i=B(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},n,null);this._prevSearchState||(this._prevSearchState={}),Q({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&(t=t.indices?t.indices[H({ais:e.contextValue,multiIndexContext:e.indexContextValue})]:{});var r=I(t,["configure",n]),a=b(this._prevSearchState,r);return this._prevSearchState=r,{value:i,hasNotChanged:a}}});function Kt(e,t,n){var i=B(e,t,n,"query","");return i||""}function Zt(e,t,n,i){return k(t,F({},"query",n),i,!0)}var en=S({displayName:"AlgoliaSearchBox",propTypes:{defaultRefinement:Ue.string},getProvidedProps:function(e,t,n){return{currentRefinement:Kt(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return Zt(0,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return n=t,i={ais:e.contextValue,multiIndexContext:e.indexContextValue},M(n,i,"query");var n,i},getSearchParameters:function(e,t,n){return e.setQuery(Kt(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(t,e){var n=Kt(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:H({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===n?[]:[{label:"".concat("query",": ").concat(n),value:function(e){return Zt(0,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:n}]}}});function tn(e,t,n){var i=B(e,t,n,"sortBy",null);return i||null}var nn=S({displayName:"AlgoliaSortBy",propTypes:{defaultRefinement:Ue.string,items:Ue.arrayOf(Ue.shape({label:Ue.string,value:Ue.string.isRequired})).isRequired,transformItems:Ue.func},getProvidedProps:function(e,t){var n=tn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),i=e.items.map(function(e){return e.value===n?P({},e,{isRefined:!0}):P({},e,{isRefined:!1})});return{items:e.transformItems?e.transformItems(i):i,currentRefinement:n}},refine:function(e,t,n){return k(t,F({},"sortBy",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return M(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"sortBy")},getSearchParameters:function(e,t,n){var i=tn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return e.setIndex(i)},getMetadata:function(){return{id:"sortBy"}}}),rn=S({displayName:"AlgoliaStateResults",getProvidedProps:function(e,t,n){return{searchState:t,searchResults:T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),allSearchResults:n.results,searching:n.searching,isSearchStalled:n.isSearchStalled,error:n.error,searchingForFacetValues:n.searchingForFacetValues,props:e}}}),an=S({displayName:"AlgoliaStats",getProvidedProps:function(e,t,n){var i=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return i?{nbHits:i.nbHits,processingTimeMS:i.processingTimeMS}:null}});function sn(e){return e.attribute}var cn="toggle",on=["0","false","null","undefined"];function un(e,t,n){var i=B(e,t,n,"".concat(cn,".").concat(sn(e)),!1);return-1===on.indexOf(i)&&Boolean(i)}function fn(e,t,n,i){return k(t,F({},sn(e),n||!1),i,!0,cn)}var ln=S({displayName:"AlgoliaToggle",propTypes:{label:Ue.string.isRequired,attribute:Ue.string.isRequired,value:Ue.any.isRequired,filter:Ue.func,defaultRefinement:Ue.bool},getProvidedProps:function(e,t,n){var i=e.attribute,r=e.value,a=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),s=un(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),c=a&&a.getFacetByName(i)?a.getFacetValues(i):null,o=c&&c.length?_(c,function(e){return e.name===r.toString()}):null,u=o&&o.count,f=c&&c.length?c.reduce(function(e,t){return e+t.count},0):null;return{currentRefinement:s,canRefine:s?null!==f&&0<f:null!==u&&0<u,count:{checked:f,unchecked:u}}},refine:function(e,t,n){return fn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return i=t,r={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},M(i,r,"".concat(cn,".").concat(sn(n)));var n,i,r},getSearchParameters:function(e,t,n){var i=t.attribute,r=t.value,a=t.filter,s=un(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),c=e.addDisjunctiveFacet(i);return s&&(c=c.addDisjunctiveFacetRefinement(i,r),a&&(c=a(c))),c},getMetadata:function(t,e){var n=sn(t),i=un(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),r=[],a=H({ais:t.contextValue,multiIndexContext:t.indexContextValue});return i&&r.push({label:t.label,currentRefinement:i,attribute:t.attribute,value:function(e){return fn(t,e,!1,{ais:t.contextValue,multiIndexContext:t.indexContextValue})}}),{id:n,index:a,items:r}}});var hn=function(i,r,a){return function(e,t){if("function"!=typeof i)throw new TypeError("Expected insightsClient to be a Function");var n=function(e){var t=e.method,n=e.results,i=e.currentHit,r=n.index,a=i.__queryID,s=[i.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:r,queryID:a,objectIDs:s,positions:[i.__position]};case"convertedObjectIDsAfterSearch":return{index:r,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:r,currentHit:a});i(e,P({},n,t))}};e.EXPERIMENTAL_connectConfigureRelatedItems=ke,e.connectAutoComplete=Ye,e.connectBreadcrumb=$e,e.connectConfigure=L,e.connectCurrentRefinements=Ge,e.connectGeoSearch=tt,e.connectHierarchicalMenu=ot,e.connectHighlight=ft,e.connectHitInsights=function(r){return S({displayName:"AlgoliaInsights",getProvidedProps:function(e,t,n){var i=T(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{insights:hn(r,i,e.hit)}}})},e.connectHits=lt,e.connectHitsPerPage=dt,e.connectInfiniteHits=vt,e.connectMenu=Vt,e.connectNumericMenu=Ot,e.connectPagination=At,e.connectPoweredBy=Ht,e.connectRange=Lt,e.connectRefinementList=Jt,e.connectScrollTo=Xt,e.connectSearchBox=en,e.connectSortBy=nn,e.connectStateResults=rn,e.connectStats=an,e.connectToggleRefinement=ln,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=Connectors.min.js.map
