/* Minification failed. Returning unminified contents.
(9,4447-4450): run-time warning JS1028: Expected identifier or string: for
(9,4461-4466): run-time warning JS1028: Expected identifier or string: class
(11,3096-3102): run-time warning JS1010: Expected identifier: return
(11,3106-3112): run-time warning JS1010: Expected identifier: return
(11,3890-3897): run-time warning JS1010: Expected identifier: default
(11,8679-8685): run-time warning JS1010: Expected identifier: delete
(11,9422-9428): run-time warning JS1010: Expected identifier: delete
(11,9763-9769): run-time warning JS1010: Expected identifier: delete
(11,10186-10192): run-time warning JS1010: Expected identifier: delete
(11,13330-13336): run-time warning JS1010: Expected identifier: delete
(11,13797-13803): run-time warning JS1010: Expected identifier: delete
(11,14420-14426): run-time warning JS1010: Expected identifier: delete
(11,14432-14438): run-time warning JS1010: Expected identifier: delete
(11,15314-15320): run-time warning JS1010: Expected identifier: delete
(11,16385-16391): run-time warning JS1010: Expected identifier: delete
(11,16397-16403): run-time warning JS1010: Expected identifier: delete
(11,30342-30348): run-time warning JS1010: Expected identifier: delete
(11,78243-78250): run-time warning JS1028: Expected identifier or string: default
(11,78778-78785): run-time warning JS1010: Expected identifier: default
(11,82024-82031): run-time warning JS1010: Expected identifier: default
(11,86778-86783): run-time warning JS1010: Expected identifier: catch
(11,94602-94607): run-time warning JS1010: Expected identifier: catch
(11,134381-134384): run-time warning JS1010: Expected identifier: for
(11,134396-134399): run-time warning JS1010: Expected identifier: for
(11,134434-134437): run-time warning JS1010: Expected identifier: for
(11,134471-134474): run-time warning JS1010: Expected identifier: for
(11,134510-134513): run-time warning JS1010: Expected identifier: for
(11,134552-134555): run-time warning JS1010: Expected identifier: for
(11,134591-134594): run-time warning JS1010: Expected identifier: for
(11,134630-134633): run-time warning JS1010: Expected identifier: for
(11,134668-134671): run-time warning JS1010: Expected identifier: for
(11,134709-134712): run-time warning JS1010: Expected identifier: for
(11,134755-134758): run-time warning JS1010: Expected identifier: for
(11,134797-134800): run-time warning JS1010: Expected identifier: for
(11,134836-134839): run-time warning JS1010: Expected identifier: for
(11,134871-134874): run-time warning JS1010: Expected identifier: for
(11,147555-147558): run-time warning JS1010: Expected identifier: for
(11,147567-147570): run-time warning JS1010: Expected identifier: for
(11,147633-147636): run-time warning JS1010: Expected identifier: for
(11,147644-147647): run-time warning JS1010: Expected identifier: for
(11,151675-151680): run-time warning JS1010: Expected identifier: class
(11,152588-152593): run-time warning JS1010: Expected identifier: class
(11,152616-152621): run-time warning JS1010: Expected identifier: class
(11,157212-157219): run-time warning JS1010: Expected identifier: default
(11,157348-157355): run-time warning JS1010: Expected identifier: default
(11,199671-199678): run-time warning JS1010: Expected identifier: default
(11,201684-201690): run-time warning JS1010: Expected identifier: delete
(11,225724-225731): run-time warning JS1010: Expected identifier: default
(11,226893-226900): run-time warning JS1010: Expected identifier: default
(11,226959-226966): run-time warning JS1028: Expected identifier or string: default
(11,227847-227854): run-time warning JS1010: Expected identifier: default
(11,227865-227872): run-time warning JS1010: Expected identifier: default
(11,227885-227892): run-time warning JS1010: Expected identifier: default
(11,227906-227913): run-time warning JS1010: Expected identifier: default
(11,227921-227928): run-time warning JS1010: Expected identifier: default
(11,228081-228088): run-time warning JS1010: Expected identifier: default
(11,228145-228152): run-time warning JS1010: Expected identifier: default
(11,228336-228343): run-time warning JS1010: Expected identifier: default
(11,228362-228369): run-time warning JS1010: Expected identifier: default
(11,228389-228396): run-time warning JS1010: Expected identifier: default
(11,228415-228422): run-time warning JS1010: Expected identifier: default
(11,228440-228447): run-time warning JS1010: Expected identifier: default
(11,228466-228473): run-time warning JS1010: Expected identifier: default
(11,228494-228501): run-time warning JS1010: Expected identifier: default
(11,228515-228522): run-time warning JS1010: Expected identifier: default
(11,228540-228547): run-time warning JS1010: Expected identifier: default
(11,228564-228571): run-time warning JS1010: Expected identifier: default
(11,228590-228597): run-time warning JS1010: Expected identifier: default
(11,228621-228628): run-time warning JS1010: Expected identifier: default
(11,228653-228660): run-time warning JS1010: Expected identifier: default
(11,228686-228693): run-time warning JS1010: Expected identifier: default
(11,228717-228724): run-time warning JS1010: Expected identifier: default
(11,228744-228751): run-time warning JS1010: Expected identifier: default
(11,228833-228840): run-time warning JS1010: Expected identifier: default
(11,228884-228891): run-time warning JS1010: Expected identifier: default
(11,229240-229247): run-time warning JS1010: Expected identifier: default
(11,236723-236730): run-time warning JS1010: Expected identifier: default
(11,236839-236846): run-time warning JS1010: Expected identifier: default
(11,237033-237040): run-time warning JS1010: Expected identifier: default
(11,237445-237452): run-time warning JS1010: Expected identifier: default
(11,237717-237724): run-time warning JS1010: Expected identifier: default
(11,239229-239236): run-time warning JS1010: Expected identifier: default
(11,257517-257523): run-time warning JS1028: Expected identifier or string: delete
(11,257559-257565): run-time warning JS1010: Expected identifier: delete
(11,291278-291285): run-time warning JS1028: Expected identifier or string: default
(11,3096-3102): run-time error JS1137: 'return' is a new reserved word and should not be used as an identifier: return
(11,3106-3112): run-time error JS1137: 'return' is a new reserved word and should not be used as an identifier: return
(11,3890-3897): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,9763-9769): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,13330-13336): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,151675-151680): run-time error JS1137: 'class' is a new reserved word and should not be used as an identifier: class
(11,157212-157219): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,157348-157355): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,201684-201690): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,8679-8685): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,9422-9428): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,10186-10192): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,13797-13803): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,14420-14426): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,14432-14438): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,15314-15320): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,16385-16391): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,16397-16403): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,30342-30348): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
(11,78778-78785): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,82024-82031): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,86778-86783): run-time error JS1137: 'catch' is a new reserved word and should not be used as an identifier: catch
(11,94602-94607): run-time error JS1137: 'catch' is a new reserved word and should not be used as an identifier: catch
(11,134381-134384): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134396-134399): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134434-134437): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134471-134474): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134510-134513): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134552-134555): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134591-134594): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134630-134633): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134668-134671): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134709-134712): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134755-134758): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134797-134800): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134836-134839): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,134871-134874): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,147555-147558): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,147567-147570): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,147633-147636): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,147644-147647): run-time error JS1137: 'for' is a new reserved word and should not be used as an identifier: for
(11,152588-152593): run-time error JS1137: 'class' is a new reserved word and should not be used as an identifier: class
(11,152616-152621): run-time error JS1137: 'class' is a new reserved word and should not be used as an identifier: class
(11,199671-199678): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,225724-225731): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,226893-226900): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,227847-227854): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,227865-227872): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,227885-227892): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,227906-227913): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,227921-227928): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228081-228088): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228145-228152): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228336-228343): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228362-228369): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228389-228396): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228415-228422): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228440-228447): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228466-228473): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228494-228501): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228515-228522): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228540-228547): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228564-228571): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228590-228597): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228621-228628): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228653-228660): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228686-228693): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228717-228724): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228744-228751): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228833-228840): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,228884-228891): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,229240-229247): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,236723-236730): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,236839-236846): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,237033-237040): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,237445-237452): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,237717-237724): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,239229-239236): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(11,257559-257565): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete
 */
/*! algoliasearch 3.33.0 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.algoliasearch=e()}}(function(){var e;return function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){(function(n){function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,n)}}function a(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(t){}}function u(){var e;try{e=r.storage.debug}catch(t){}return!e&&"undefined"!=typeof n&&"env"in n&&(e=n.env.DEBUG),e}function c(){try{return window.localStorage}catch(e){}}r=t.exports=e(2),r.log=a,r.formatArgs=i,r.save=s,r.load=u,r.useColors=o,r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(u())}).call(this,e(11))},{11:11,2:2}],2:[function(e,t,r){function n(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function o(e){function t(){if(t.enabled){var e=t,n=+new Date,o=n-(c||n);e.diff=o,e.prev=c,e.curr=n,c=n;for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];i[0]=r.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var s=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;s++;var o=r.formatters[n];if("function"==typeof o){var a=i[s];t=o.call(e,a),i.splice(s,1),s--}return t}),r.formatArgs.call(e,i);var u=t.log||r.log||console.log.bind(console);u.apply(e,i)}}return t.namespace=e,t.enabled=r.enabled(e),t.useColors=r.useColors(),t.color=n(e),"function"==typeof r.init&&r.init(t),t}function i(e){r.save(e),r.names=[],r.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&(e=t[o].replace(/\*/g,".*?"),"-"===e[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))}function a(){r.enable("")}function s(e){var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}r=t.exports=o.debug=o["default"]=o,r.coerce=u,r.disable=a,r.enable=i,r.enabled=s,r.humanize=e(8),r.names=[],r.skips=[],r.formatters={};var c},{8:8}],3:[function(t,r,n){(function(o,i){!function(t,o){"object"==typeof n&&"undefined"!=typeof r?r.exports=o():"function"==typeof e&&e.amd?e(o):t.ES6Promise=o()}(this,function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function r(e){return"function"==typeof e}function n(e){Q=e}function a(e){Y=e}function s(){return function(){return o.nextTick(f)}}function u(){return"undefined"!=typeof G?function(){G(f)}:p()}function c(){var e=0,t=new Z(f),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function l(){var e=new MessageChannel;return e.port1.onmessage=f,function(){return e.port2.postMessage(0)}}function p(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e<V;e+=2){var t=re[e],r=re[e+1];t(r),re[e]=void 0,re[e+1]=void 0}V=0}function d(){try{var e=t,r=e("vertx");return G=r.runOnLoop||r.runOnContext,u()}catch(n){return p()}}function h(e,t){var r=arguments,n=this,o=new this.constructor(m);void 0===o[oe]&&P(o);var i=n._state;return i?!function(){var e=r[i-1];Y(function(){return I(i,o,e,n._result)})}():k(n,o,e,t),o}function y(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(m);return S(r,e),r}function m(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function b(e){try{return e.then}catch(t){return ue.error=t,ue}}function w(e,t,r,n){try{e.call(t,r,n)}catch(o){return o}}function _(e,t,r){Y(function(e){var n=!1,o=w(r,t,function(r){n||(n=!0,t!==r?S(e,r):j(e,r))},function(t){n||(n=!0,O(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,O(e,o))},e)}function x(e,t){t._state===ae?j(e,t._result):t._state===se?O(e,t._result):k(t,void 0,function(t){return S(e,t)},function(t){return O(e,t)})}function T(e,t,n){t.constructor===e.constructor&&n===h&&t.constructor.resolve===y?x(e,t):n===ue?(O(e,ue.error),ue.error=null):void 0===n?j(e,t):r(n)?_(e,t,n):j(e,t)}function S(t,r){t===r?O(t,g()):e(r)?T(t,r,b(r)):j(t,r)}function A(e){e._onerror&&e._onerror(e._result),R(e)}function j(e,t){e._state===ie&&(e._result=t,e._state=ae,0!==e._subscribers.length&&Y(R,e))}function O(e,t){e._state===ie&&(e._state=se,e._result=t,Y(A,e))}function k(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ae]=r,o[i+se]=n,0===i&&e._state&&Y(R,e)}function R(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,a=0;a<t.length;a+=3)n=t[a],o=t[a+r],n?I(r,n,o,i):o(i);e._subscribers.length=0}}function C(){this.error=null}function q(e,t){try{return e(t)}catch(r){return ce.error=r,ce}}function I(e,t,n,o){var i=r(n),a=void 0,s=void 0,u=void 0,c=void 0;if(i){if(a=q(n,o),a===ce?(c=!0,s=a.error,a.error=null):u=!0,t===a)return void O(t,v())}else a=o,u=!0;t._state!==ie||(i&&u?S(t,a):c?O(t,s):e===ae?j(t,a):e===se&&O(t,a))}function E(e,t){try{t(function(t){S(e,t)},function(t){O(e,t)})}catch(r){O(e,r)}}function N(){return le++}function P(e){e[oe]=le++,e._state=void 0,e._result=void 0,e._subscribers=[]}function U(e,t){this._instanceConstructor=e,this.promise=new e(m),this.promise[oe]||P(this.promise),K(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&j(this.promise,this._result))):O(this.promise,D())}function D(){return new Error("Array Methods must be provided an Array")}function H(e){return new U(this,e).promise}function J(e){var t=this;return new t(K(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function M(e){var t=this,r=new t(m);return O(r,e),r}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function $(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function L(e){this[oe]=N(),this._result=this._state=void 0,this._subscribers=[],m!==e&&("function"!=typeof e&&F(),this instanceof L?E(this,e):$())}function B(){var e=void 0;if("undefined"!=typeof i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=e.Promise;if(r){var n=null;try{n=Object.prototype.toString.call(r.resolve())}catch(t){}if("[object Promise]"===n&&!r.cast)return}e.Promise=L}var X=void 0;X=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var K=X,V=0,G=void 0,Q=void 0,Y=function(e,t){re[V]=e,re[V+1]=t,V+=2,2===V&&(Q?Q(f):ne())},z="undefined"!=typeof window?window:void 0,W=z||{},Z=W.MutationObserver||W.WebKitMutationObserver,ee="undefined"==typeof self&&"undefined"!=typeof o&&"[object process]"==={}.toString.call(o),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,re=new Array(1e3),ne=void 0;ne=ee?s():Z?c():te?l():void 0===z&&"function"==typeof t?d():p();var oe=Math.random().toString(36).substring(16),ie=void 0,ae=1,se=2,ue=new C,ce=new C,le=0;return U.prototype._enumerate=function(e){for(var t=0;this._state===ie&&t<e.length;t++)this._eachEntry(e[t],t)},U.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===y){var o=b(e);if(o===h&&e._state!==ie)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===L){var i=new r(m);T(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},U.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===ie&&(this._remaining--,e===se?O(n,r):this._result[t]=r),0===this._remaining&&j(n,this._result)},U.prototype._willSettleAt=function(e,t){var r=this;k(e,void 0,function(e){return r._settledAt(ae,t,e)},function(e){return r._settledAt(se,t,e)})},L.all=H,L.race=J,L.resolve=y,L.reject=M,L._setScheduler=n,L._setAsap=a,L._asap=Y,L.prototype={constructor:L,then:h,"catch":function(e){return this.then(null,e)}},L.polyfill=B,L.Promise=L,L})}).call(this,t(11),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{11:11}],4:[function(e,t,r){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=function(e,t,r){if("[object Function]"!==o.call(t))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var a=0;a<i;a++)t.call(r,e[a],a,e);else for(var s in e)n.call(e,s)&&t.call(r,e[s],s,e)}},{}],5:[function(e,t,r){(function(e){var r;r="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{},t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],8:[function(e,t,r){function n(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*p;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*u;case"seconds":case"second":case"secs":case"sec":case"s":return r*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=u?Math.round(e/u)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function i(e){return a(e,l,"day")||a(e,c,"hour")||a(e,u,"minute")||a(e,s,"second")||e+" ms"}function a(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var s=1e3,u=60*s,c=60*u,l=24*c,p=365.25*l;t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return n(e);if("number"===r&&isNaN(e)===!1)return t["long"]?i(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],9:[function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Array.prototype.slice,a=e(10),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},f={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&n.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),h=function(e){if("undefined"==typeof window||!d)return p(e);try{return p(e)}catch(t){return!1}},y=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),i=a(e),s=t&&"[object String]"===o.call(e),p=[];if(!t&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var f=c&&r;if(s&&e.length>0&&!n.call(e,0))for(var d=0;d<e.length;++d)p.push(String(d));if(i&&e.length>0)for(var y=0;y<e.length;++y)p.push(String(y));else for(var m in e)f&&"prototype"===m||!n.call(e,m)||p.push(String(m));if(u)for(var g=h(e),v=0;v<l.length;++v)g&&"constructor"===l[v]||!n.call(e,l[v])||p.push(l[v]);return p};y.shim=function(){if(Object.keys){var e=function(){return 2===(Object.keys(arguments)||"").length}(1,2);if(!e){var t=Object.keys;Object.keys=function(e){return t(a(e)?i.call(e):e)}}}else Object.keys=y;return Object.keys||y},t.exports=y},{10:10}],10:[function(e,t,r){"use strict";var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r="[object Arguments]"===t;return r||(r="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),r}},{}],11:[function(e,t,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(p===setTimeout)return setTimeout(e,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(e,0);try{return p(e,0)}catch(t){try{return p.call(null,e,0)}catch(t){return p.call(this,e,0)}}}function a(e){if(f===clearTimeout)return clearTimeout(e);if((f===o||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function s(){m&&h&&(m=!1,h.length?y=h.concat(y):g=-1,y.length&&u())}function u(){if(!m){var e=i(s);m=!0;for(var t=y.length;t;){for(h=y,y=[];++g<t;)h&&h[g].run();g=-1,t=y.length}h=null,m=!1,a(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var p,f,d=t.exports={};!function(){try{p="function"==typeof setTimeout?setTimeout:n}catch(e){p=n}try{f="function"==typeof clearTimeout?clearTimeout:o}catch(e){f=o}}();var h,y=[],m=!1,g=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];y.push(new c(e,t)),1!==y.length||m||i(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],12:[function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var p,f,d,h,y=e[l].replace(s,"%20"),m=y.indexOf(r);m>=0?(p=y.substr(0,m),f=y.substr(m+1)):(p=y,f=""),d=decodeURIComponent(p),h=decodeURIComponent(f),n(a,d)?o(a[d])?a[d].push(h):a[d]=[a[d],h]:a[d]=h}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],13:[function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?n(a(e),function(a){var s=encodeURIComponent(o(a))+r;return i(e[a])?n(e[a],function(e){return s+encodeURIComponent(o(e))}).join(t):s+encodeURIComponent(o(e[a]))}).join(t):s?encodeURIComponent(o(s))+r+encodeURIComponent(o(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],14:[function(e,t,r){"use strict";r.decode=r.parse=e(12),r.encode=r.stringify=e(13)},{12:12,13:13}],15:[function(e,t,r){(function(r){function n(t,r,n){var i=e(1)("algoliasearch"),a=e(22),s=e(7),c=e(27),l="Usage: algoliasearch(applicationID, apiKey, opts)";if(n._allowEmptyCredentials!==!0&&!t)throw new u.AlgoliaSearchError("Please provide an application ID. "+l);if(n._allowEmptyCredentials!==!0&&!r)throw new u.AlgoliaSearchError("Please provide an API key. "+l);this.applicationID=t,this.apiKey=r,this.hosts={read:[],write:[]},n=n||{},this._timeouts=n.timeouts||{connect:1e3,read:2e3,write:3e4},n.timeout&&(this._timeouts.connect=this._timeouts.read=this._timeouts.write=n.timeout);var p=n.protocol||"https:";if(/:$/.test(p)||(p+=":"),"http:"!==p&&"https:"!==p)throw new u.AlgoliaSearchError("protocol must be `http:` or `https:` (was `"+n.protocol+"`)");if(this._checkAppIdData(),n.hosts)s(n.hosts)?(this.hosts.read=a(n.hosts),this.hosts.write=a(n.hosts)):(this.hosts.read=a(n.hosts.read),this.hosts.write=a(n.hosts.write));else{var f=c(this._shuffleResult,function(e){return t+"-"+e+".algolianet.com"}),d=(n.dsn===!1?"":"-dsn")+".algolia.net";this.hosts.read=[this.applicationID+d].concat(f),this.hosts.write=[this.applicationID+".algolia.net"].concat(f)}this.hosts.read=c(this.hosts.read,o(p)),this.hosts.write=c(this.hosts.write,o(p)),this.extraHeaders={},this.cache=n._cache||{},this._ua=n._ua,this._useCache=!(void 0!==n._useCache&&!n._cache)||n._useCache,this._useRequestCache=this._useCache&&n._useRequestCache,this._useFallback=void 0===n.useFallback||n.useFallback,this._setTimeout=n._setTimeout,i("init done, %j",this)}function o(e){return function(t){return e+"//"+t.toLowerCase()}}function i(e){if(void 0===Array.prototype.toJSON)return JSON.stringify(e);var t=Array.prototype.toJSON;delete Array.prototype.toJSON;var r=JSON.stringify(e);return Array.prototype.toJSON=t,r}function a(e){for(var t,r,n=e.length;0!==n;)r=Math.floor(Math.random()*n),n-=1,t=e[n],e[n]=e[r],e[r]=t;return e}function s(e){var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n;n="x-algolia-api-key"===r||"x-algolia-application-id"===r?"**hidden for security purposes**":e[r],t[r]=n}return t}t.exports=n;var u=e(25),c=e(26),l=e(16),p=e(31),f=500,d=r.env.RESET_APP_DATA_TIMER&&parseInt(r.env.RESET_APP_DATA_TIMER,10)||12e4;n.prototype.initIndex=function(e){return new l(this,e)},n.prototype.setExtraHeader=function(e,t){this.extraHeaders[e.toLowerCase()]=t},n.prototype.getExtraHeader=function(e){return this.extraHeaders[e.toLowerCase()]},n.prototype.unsetExtraHeader=function(e){delete this.extraHeaders[e.toLowerCase()]},n.prototype.addAlgoliaAgent=function(e){var t="; "+e;this._ua.indexOf(t)===-1&&(this._ua+=t)},n.prototype._jsonRequest=function(t){function r(e,o){function c(e){var t=e&&e.body&&e.body.message&&e.body.status||e.statusCode||e&&e.body&&200;d("received response: statusCode: %s, computed statusCode: %d, headers: %j",e.statusCode,t,e.headers);var r=2===Math.floor(t/100),n=new Date;if(w.push({currentHost:A,headers:s(p),content:a||null,contentLength:void 0!==a?a.length:null,method:o.method,timeouts:o.timeouts,url:o.url,startTime:T,endTime:n,duration:n-T,statusCode:t}),r)return m._useCache&&!m._useRequestCache&&y&&(y[l]=e.responseText),{responseText:e.responseText,body:e.body};var i=4!==Math.floor(t/100);if(i)return g+=1,_();d("unrecoverable error");var c=new u.AlgoliaSearchError(e.body&&e.body.message,{debugData:w,statusCode:t});return m._promise.reject(c)}function f(e){d("error: %s, stack: %s",e.message,e.stack);var r=new Date;return w.push({currentHost:A,headers:s(p),content:a||null,contentLength:void 0!==a?a.length:null,method:o.method,timeouts:o.timeouts,url:o.url,startTime:T,endTime:r,duration:r-T}),e instanceof u.AlgoliaSearchError||(e=new u.Unknown(e&&e.message,e)),g+=1,e instanceof u.Unknown||e instanceof u.UnparsableJSON||g>=m.hosts[t.hostType].length&&(v||!b)?(e.debugData=w,m._promise.reject(e)):e instanceof u.RequestTimeout?x():_()}function _(){return d("retrying request"),m._incrementHostIndex(t.hostType),r(e,o)}function x(){return d("retrying request with higher timeout"),m._incrementHostIndex(t.hostType),m._incrementTimeoutMultipler(),o.timeouts=m._getTimeoutsForRequest(t.hostType),r(e,o)}m._checkAppIdData();var T=new Date;if(m._useCache&&!m._useRequestCache&&(l=t.url),m._useCache&&!m._useRequestCache&&a&&(l+="_body_"+o.body),n(!m._useRequestCache,y,l)){d("serving response from cache");var S=y[l];return m._promise.resolve({body:JSON.parse(S),responseText:S})}if(g>=m.hosts[t.hostType].length)return!b||v?(d("could not get any response"),m._promise.reject(new u.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue. Application id was: "+m.applicationID,{debugData:w}))):(d("switching to fallback"),g=0,o.method=t.fallback.method,o.url=t.fallback.url,o.jsonBody=t.fallback.body,o.jsonBody&&(o.body=i(o.jsonBody)),p=m._computeRequestHeaders({additionalUA:h,headers:t.headers}),o.timeouts=m._getTimeoutsForRequest(t.hostType),m._setHostIndexByType(0,t.hostType),v=!0,r(m._request.fallback,o));var A=m._getHostByType(t.hostType),j=A+o.url,O={body:o.body,jsonBody:o.jsonBody,method:o.method,headers:p,timeouts:o.timeouts,debug:d,forceAuthHeaders:o.forceAuthHeaders};return d("method: %s, url: %s, headers: %j, timeouts: %d",O.method,j,O.headers,O.timeouts),e===m._request.fallback&&d("using fallback"),e.call(m,j,O).then(c,f)}function n(e,t,r){return m._useCache&&e&&t&&void 0!==t[r]}function o(e,r){return n(m._useRequestCache,y,l)&&e["catch"](function(){delete y[l]}),"function"!=typeof t.callback?e.then(r):void e.then(function(e){c(function(){t.callback(null,r(e))},m._setTimeout||setTimeout)},function(e){c(function(){t.callback(e)},m._setTimeout||setTimeout)})}this._checkAppIdData();var a,l,p,d=e(1)("algoliasearch:"+t.url),h=t.additionalUA||"",y=t.cache,m=this,g=0,v=!1,b=m._useFallback&&m._request.fallback&&t.fallback;this.apiKey.length>f&&void 0!==t.body&&(void 0!==t.body.params||void 0!==t.body.requests)?(t.body.apiKey=this.apiKey,p=this._computeRequestHeaders({additionalUA:h,withApiKey:!1,headers:t.headers})):p=this._computeRequestHeaders({additionalUA:h,headers:t.headers}),void 0!==t.body&&(a=i(t.body)),d("request start");var w=[];if(m._useCache&&m._useRequestCache&&(l=t.url),m._useCache&&m._useRequestCache&&a&&(l+="_body_"+a),n(m._useRequestCache,y,l)){d("serving request from cache");var _=y[l],x="function"!=typeof _.then?m._promise.resolve({responseText:_}):_;return o(x,function(e){return JSON.parse(e.responseText)})}var T=r(m._request,{url:t.url,method:t.method,body:a,jsonBody:t.body,timeouts:m._getTimeoutsForRequest(t.hostType),forceAuthHeaders:t.forceAuthHeaders});return m._useCache&&m._useRequestCache&&y&&(y[l]=T),o(T,function(e){return e.body})},n.prototype._getSearchParams=function(e,t){if(void 0===e||null===e)return t;for(var r in e)null!==r&&void 0!==e[r]&&e.hasOwnProperty(r)&&(t+=""===t?"":"&",t+=r+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[r])?i(e[r]):e[r]));return t},n.prototype._computeRequestHeaders=function(t){var r=e(4),n=t.additionalUA?this._ua+"; "+t.additionalUA:this._ua,o={"x-algolia-agent":n,"x-algolia-application-id":this.applicationID};return t.withApiKey!==!1&&(o["x-algolia-api-key"]=this.apiKey),this.userToken&&(o["x-algolia-usertoken"]=this.userToken),this.securityTags&&(o["x-algolia-tagfilters"]=this.securityTags),r(this.extraHeaders,function(e,t){o[t]=e}),t.headers&&r(t.headers,function(e,t){o[t]=e}),o},n.prototype.search=function(t,r,n){var o=e(7),i=e(27),a="Usage: client.search(arrayOfQueries[, callback])";if(!o(t))throw new Error(a);"function"==typeof r?(n=r,r={}):void 0===r&&(r={});var s=this,u={requests:i(t,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:s._getSearchParams(e.params,t)}})},c=i(u.requests,function(e,t){return t+"="+encodeURIComponent("/1/indexes/"+encodeURIComponent(e.indexName)+"?"+e.params)}).join("&"),l="/1/indexes/*/queries";return void 0!==r.strategy&&(u.strategy=r.strategy),this._jsonRequest({cache:this.cache,method:"POST",url:l,body:u,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:c}},callback:n})},n.prototype.searchForFacetValues=function(t){var r=e(7),n=e(27),o="Usage: client.searchForFacetValues([{indexName, params: {facetName, facetQuery, ...params}}, ...queries])";if(!r(t))throw new Error(o);var i=this;return i._promise.all(n(t,function(t){if(!t||void 0===t.indexName||void 0===t.params.facetName||void 0===t.params.facetQuery)throw new Error(o);var r=e(22),n=e(29),a=t.indexName,s=t.params,u=s.facetName,c=n(r(s),function(e){return"facetName"===e}),l=i._getSearchParams(c,"");return i._jsonRequest({cache:i.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/facets/"+encodeURIComponent(u)+"/query",hostType:"read",body:{params:l}})}))},n.prototype.setSecurityTags=function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],r=0;r<e.length;++r)if("[object Array]"===Object.prototype.toString.call(e[r])){for(var n=[],o=0;o<e[r].length;++o)n.push(e[r][o]);t.push("("+n.join(",")+")")}else t.push(e[r]);e=t.join(",")}this.securityTags=e},n.prototype.setUserToken=function(e){this.userToken=e},n.prototype.clearCache=function(){this.cache={}},n.prototype.setRequestTimeout=function(e){e&&(this._timeouts.connect=this._timeouts.read=this._timeouts.write=e)},n.prototype.setTimeouts=function(e){this._timeouts=e},n.prototype.getTimeouts=function(){return this._timeouts},n.prototype._getAppIdData=function(){var e=p.get(this.applicationID);return null!==e&&this._cacheAppIdData(e),e},n.prototype._setAppIdData=function(e){return e.lastChange=(new Date).getTime(),this._cacheAppIdData(e),p.set(this.applicationID,e)},n.prototype._checkAppIdData=function(){var e=this._getAppIdData(),t=(new Date).getTime();return null===e||t-e.lastChange>d?this._resetInitialAppIdData(e):e},n.prototype._resetInitialAppIdData=function(e){var t=e||{};return t.hostIndexes={read:0,write:0},t.timeoutMultiplier=1,t.shuffleResult=t.shuffleResult||a([1,2,3]),this._setAppIdData(t)},n.prototype._cacheAppIdData=function(e){this._hostIndexes=e.hostIndexes,this._timeoutMultiplier=e.timeoutMultiplier,this._shuffleResult=e.shuffleResult},n.prototype._partialAppIdDataUpdate=function(t){var r=e(4),n=this._getAppIdData();return r(t,function(e,t){n[t]=e}),this._setAppIdData(n)},n.prototype._getHostByType=function(e){return this.hosts[e][this._getHostIndexByType(e)]},n.prototype._getTimeoutMultiplier=function(){return this._timeoutMultiplier},n.prototype._getHostIndexByType=function(e){return this._hostIndexes[e]},n.prototype._setHostIndexByType=function(t,r){var n=e(22),o=n(this._hostIndexes);return o[r]=t,this._partialAppIdDataUpdate({hostIndexes:o}),t},n.prototype._incrementHostIndex=function(e){return this._setHostIndexByType((this._getHostIndexByType(e)+1)%this.hosts[e].length,e)},n.prototype._incrementTimeoutMultipler=function(){var e=Math.max(this._timeoutMultiplier+1,4);return this._partialAppIdDataUpdate({timeoutMultiplier:e})},n.prototype._getTimeoutsForRequest=function(e){return{connect:this._timeouts.connect*this._timeoutMultiplier,complete:this._timeouts[e]*this._timeoutMultiplier}}}).call(this,e(11))},{1:1,11:11,16:16,22:22,25:25,26:26,27:27,29:29,31:31,4:4,7:7}],16:[function(e,t,r){function n(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}}var o=e(21),i=e(23),a=e(24);t.exports=n,n.prototype.clearCache=function(){this.cache={}},n.prototype.search=o("query"),n.prototype.similarSearch=i(o("similarQuery"),a("index.similarSearch(query[, callback])","index.search({ similarQuery: query }[, callback])")),n.prototype.browse=function(t,r,n){var o,i,a=e(28),s=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(o=0,n=arguments[0],t=void 0):"number"==typeof arguments[0]?(o=arguments[0],"number"==typeof arguments[1]?i=arguments[1]:"function"==typeof arguments[1]&&(n=arguments[1],i=void 0),t=void 0,r=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(n=arguments[1]),r=arguments[0],t=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(n=arguments[1],r=void 0),r=a({},r||{},{page:o,hitsPerPage:i,query:t});var u=this.as._getSearchParams(r,"");return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(s.indexName)+"/browse",body:{params:u},hostType:"read",callback:n})},n.prototype.browseFrom=function(e,t){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse",body:{cursor:e},hostType:"read",callback:t})},n.prototype.searchForFacetValues=function(t,r){var n=e(22),o=e(29),i="Usage: index.searchForFacetValues({facetName, facetQuery, ...params}[, callback])";if(void 0===t.facetName||void 0===t.facetQuery)throw new Error(i);var a=t.facetName,s=o(n(t),function(e){return"facetName"===e}),u=this.as._getSearchParams(s,"");return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/facets/"+encodeURIComponent(a)+"/query",hostType:"read",body:{params:u},callback:r})},n.prototype.searchFacet=i(function(e,t){return this.searchForFacetValues(e,t)},a("index.searchFacet(params[, callback])","index.searchForFacetValues(params[, callback])")),n.prototype._search=function(e,t,r,n){return this.as._jsonRequest({cache:this.cache,method:"POST",url:t||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:r,additionalUA:n})},n.prototype.getObject=function(e,t,r){var n=this;1!==arguments.length&&"function"!=typeof t||(r=t,t=void 0);var o="";if(void 0!==t){o="?attributes=";for(var i=0;i<t.length;++i)0!==i&&(o+=","),o+=t[i]}return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/"+encodeURIComponent(e)+o,hostType:"read",callback:r})},n.prototype.getObjects=function(t,r,n){var o=e(7),i=e(27),a="Usage: index.getObjects(arrayOfObjectIDs[, callback])";if(!o(t))throw new Error(a);var s=this;1!==arguments.length&&"function"!=typeof r||(n=r,
r=void 0);var u={requests:i(t,function(e){var t={indexName:s.indexName,objectID:e};return r&&(t.attributesToRetrieve=r.join(",")),t})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:u,callback:n})},n.prototype.as=null,n.prototype.indexName=null,n.prototype.typeAheadArgs=null,n.prototype.typeAheadValueOption=null},{21:21,22:22,23:23,24:24,27:27,28:28,29:29,7:7}],17:[function(e,t,r){"use strict";var n=e(15),o=e(18);t.exports=o(n,"Browser (lite)")},{15:15,18:18}],18:[function(e,t,r){(function(r){"use strict";var n=e(5),o=n.Promise||e(3).Promise;t.exports=function(t,i){function a(t,r,n){var o=e(22);return n=o(n||{}),n._ua=n._ua||a.ua,new s(t,r,n)}function s(){t.apply(this,arguments)}var u=e(6),c=e(25),l=e(19),p=e(20),f=e(30);i=i||"","debug"===r.env.NODE_ENV&&e(1).enable("algoliasearch*"),a.version=e(32),a.ua="Algolia for JavaScript ("+a.version+"); "+i,a.initPlaces=f(a),n.__algolia={debug:e(1),algoliasearch:a};var d={hasXMLHttpRequest:"XMLHttpRequest"in n,hasXDomainRequest:"XDomainRequest"in n};return d.hasXMLHttpRequest&&(d.cors="withCredentials"in new XMLHttpRequest),u(s,t),s.prototype._request=function(e,t){return new o(function(r,n){function o(){if(!h){clearTimeout(f);var e;try{e={body:JSON.parse(m.responseText),responseText:m.responseText,statusCode:m.status,headers:m.getAllResponseHeaders&&m.getAllResponseHeaders()||{}}}catch(t){e=new c.UnparsableJSON({more:m.responseText})}e instanceof c.UnparsableJSON?n(e):r(e)}}function i(e){h||(clearTimeout(f),n(new c.Network({more:e})))}function a(){h=!0,m.abort(),n(new c.RequestTimeout)}function s(){g=!0,clearTimeout(f),f=setTimeout(a,t.timeouts.complete)}function u(){g||s()}function p(){!g&&m.readyState>1&&s()}if(!d.cors&&!d.hasXDomainRequest)return void n(new c.Network("CORS not supported"));e=l(e,t.headers);var f,h,y=t.body,m=d.cors?new XMLHttpRequest:new XDomainRequest,g=!1;f=setTimeout(a,t.timeouts.connect),m.onprogress=u,"onreadystatechange"in m&&(m.onreadystatechange=p),m.onload=o,m.onerror=i,m instanceof XMLHttpRequest?(m.open(t.method,e,!0),t.forceAuthHeaders&&(m.setRequestHeader("x-algolia-application-id",t.headers["x-algolia-application-id"]),m.setRequestHeader("x-algolia-api-key",t.headers["x-algolia-api-key"]))):m.open(t.method,e),d.cors&&(y&&("POST"===t.method?m.setRequestHeader("content-type","application/x-www-form-urlencoded"):m.setRequestHeader("content-type","application/json")),m.setRequestHeader("accept","application/json")),y?m.send(y):m.send()})},s.prototype._request.fallback=function(e,t){return e=l(e,t.headers),new o(function(r,n){p(e,t,function(e,t){return e?void n(e):void r(t)})})},s.prototype._promise={reject:function(e){return o.reject(e)},resolve:function(e){return o.resolve(e)},delay:function(e){return new o(function(t){setTimeout(t,e)})},all:function(e){return o.all(e)}},a}}).call(this,e(11))},{1:1,11:11,19:19,20:20,22:22,25:25,3:3,30:30,32:32,5:5,6:6}],19:[function(e,t,r){"use strict";function n(e,t){return e+=/\?/.test(e)?"&":"?",e+o(t)}t.exports=n;var o=e(13)},{13:13}],20:[function(e,t,r){"use strict";function n(e,t,r){function n(){t.debug("JSONP: success"),m||f||(m=!0,p||(t.debug("JSONP: Fail. Script loaded but did not call the callback"),s(),r(new o.JSONPScriptFail)))}function a(){"loaded"!==this.readyState&&"complete"!==this.readyState||n()}function s(){clearTimeout(g),h.onload=null,h.onreadystatechange=null,h.onerror=null,d.removeChild(h)}function u(){try{delete window[y],delete window[y+"_loaded"]}catch(e){window[y]=window[y+"_loaded"]=void 0}}function c(){t.debug("JSONP: Script timeout"),f=!0,s(),r(new o.RequestTimeout)}function l(){t.debug("JSONP: Script error"),m||f||(s(),r(new o.JSONPScriptError))}if("GET"!==t.method)return void r(new Error("Method "+t.method+" "+e+" is not supported by JSONP."));t.debug("JSONP: start");var p=!1,f=!1;i+=1;var d=document.getElementsByTagName("head")[0],h=document.createElement("script"),y="algoliaJSONP_"+i,m=!1;window[y]=function(e){return u(),f?void t.debug("JSONP: Late answer, ignoring"):(p=!0,s(),void r(null,{body:e,responseText:JSON.stringify(e)}))},e+="&callback="+y,t.jsonBody&&t.jsonBody.params&&(e+="&"+t.jsonBody.params);var g=setTimeout(c,t.timeouts.complete);h.onreadystatechange=a,h.onload=n,h.onerror=l,h.async=!0,h.defer=!0,h.src=e,d.appendChild(h)}t.exports=n;var o=e(25),i=0},{25:25}],21:[function(e,t,r){function n(e,t){return function(r,n,i){if("function"==typeof r&&"object"==typeof n||"object"==typeof i)throw new o.AlgoliaSearchError("index.search usage is index.search(query, params, cb)");0===arguments.length||"function"==typeof r?(i=r,r=""):1!==arguments.length&&"function"!=typeof n||(i=n,n=void 0),"object"==typeof r&&null!==r?(n=r,r=void 0):void 0!==r&&null!==r||(r="");var a="";void 0!==r&&(a+=e+"="+encodeURIComponent(r));var s;return void 0!==n&&(n.additionalUA&&(s=n.additionalUA,delete n.additionalUA),a=this.as._getSearchParams(n,a)),this._search(a,t,i,s)}}t.exports=n;var o=e(25)},{25:25}],22:[function(e,t,r){t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],23:[function(e,t,r){t.exports=function(e,t){function r(){return n||(console.warn(t),n=!0),e.apply(this,arguments)}var n=!1;return r}},{}],24:[function(e,t,r){t.exports=function(e,t){var r=e.toLowerCase().replace(/[\.\(\)]/g,"");return"algoliasearch: `"+e+"` was replaced by `"+t+"`. Please see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated#"+r}},{}],25:[function(e,t,r){"use strict";function n(t,r){var n=e(4),o=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):o.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name="AlgoliaSearchError",this.message=t||"Unknown error",r&&n(r,function(e,t){o[t]=e})}function o(e,t){function r(){var r=Array.prototype.slice.call(arguments,0);"string"!=typeof r[0]&&r.unshift(t),n.apply(this,r),this.name="AlgoliaSearch"+e+"Error"}return i(r,n),r}var i=e(6);i(n,Error),t.exports={AlgoliaSearchError:n,UnparsableJSON:o("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:o("RequestTimeout","Request timed out before getting a response"),Network:o("Network","Network issue, see err.more for details"),JSONPScriptFail:o("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:o("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:o("Unknown","Unknown error occured")}},{4:4,6:6}],26:[function(e,t,r){t.exports=function(e,t){t(e,0)}},{}],27:[function(e,t,r){var n=e(4);t.exports=function(e,t){var r=[];return n(e,function(n,o){r.push(t(n,o,e))}),r}},{4:4}],28:[function(e,t,r){var n=e(4);t.exports=function o(e){var t=Array.prototype.slice.call(arguments);return n(t,function(t){for(var r in t)t.hasOwnProperty(r)&&("object"==typeof e[r]&&"object"==typeof t[r]?e[r]=o({},e[r],t[r]):void 0!==t[r]&&(e[r]=t[r]))}),e}},{4:4}],29:[function(e,t,r){t.exports=function(t,r){var n=e(9),o=e(4),i={};return o(n(t),function(e){r(e)!==!0&&(i[e]=t[e])}),i}},{4:4,9:9}],30:[function(e,t,r){function n(t){return function(r,n,a){var s=e(22);a=a&&s(a)||{},a.hosts=a.hosts||["places-dsn.algolia.net","places-1.algolianet.com","places-2.algolianet.com","places-3.algolianet.com"],0!==arguments.length&&"object"!=typeof r&&void 0!==r||(r="",n="",a._allowEmptyCredentials=!0);var u=t(r,n,a),c=u.initIndex("places");return c.search=i("query","/1/places/query"),c.reverse=function(e,t){var r=o.encode(e);return this.as._jsonRequest({method:"GET",url:"/1/places/reverse?"+r,hostType:"read",callback:t})},c.getObject=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/places/"+encodeURIComponent(e),hostType:"read",callback:t})},c}}t.exports=n;var o=e(14),i=e(21)},{14:14,21:21,22:22}],31:[function(e,t,r){(function(r){function n(e,t){return u("localStorage failed with",t),a(),s=l,s.get(e)}function o(e,t){return 1===arguments.length?s.get(e):s.set(e,t)}function i(){try{return"localStorage"in r&&null!==r.localStorage&&(r.localStorage[c]||r.localStorage.setItem(c,JSON.stringify({})),!0)}catch(e){return!1}}function a(){try{r.localStorage.removeItem(c)}catch(e){}}var s,u=e(1)("algoliasearch:src/hostIndexState.js"),c="algoliasearch-client-js",l={state:{},set:function(e,t){return this.state[e]=t,this.state[e]},get:function(e){return this.state[e]||null}},p={set:function(e,t){l.set(e,t);try{var o=JSON.parse(r.localStorage[c]);return o[e]=t,r.localStorage[c]=JSON.stringify(o),o[e]}catch(i){return n(e,i)}},get:function(e){try{return JSON.parse(r.localStorage[c])[e]||null}catch(t){return n(e,t)}}};s=i()?p:l,t.exports={get:o,set:o,supportsLocalStorage:i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1}],32:[function(e,t,r){"use strict";t.exports="3.33.0"},{}]},{},[17])(17)});
;/*!
 * autocomplete.js 0.36.0
 * https://github.com/algolia/autocomplete.js
 * Copyright 2019 Algolia, Inc. and other contributors; Licensed MIT
 */
!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.autocomplete=b():a.autocomplete=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";a.exports=c(1)},function(a,b,c){"use strict";function d(a,b,c,d){c=f.isArray(c)?c:[].slice.call(arguments,2);var j=e(a).each(function(a,f){var j=e(f),k=new i({el:j}),l=d||new h({input:j,eventBus:k,dropdownMenuContainer:b.dropdownMenuContainer,hint:void 0===b.hint||!!b.hint,minLength:b.minLength,autoselect:b.autoselect,autoselectOnBlur:b.autoselectOnBlur,tabAutocomplete:b.tabAutocomplete,openOnFocus:b.openOnFocus,templates:b.templates,debug:b.debug,clearOnSelected:b.clearOnSelected,cssClasses:b.cssClasses,datasets:c,keyboardShortcuts:b.keyboardShortcuts,appendTo:b.appendTo,autoWidth:b.autoWidth,ariaLabel:b.ariaLabel||f.getAttribute("aria-label")});j.data(g,l)});return j.autocomplete={},f.each(["open","close","getVal","setVal","destroy","getWrapper"],function(a){j.autocomplete[a]=function(){var b,c=arguments;return j.each(function(d,f){var h=e(f).data(g);b=h[a].apply(h,c)}),b}}),j}var e=c(2);c(3).element=e;var f=c(4);f.isArray=e.isArray,f.isFunction=e.isFunction,f.isObject=e.isPlainObject,f.bind=e.proxy,f.each=function(a,b){function c(a,c){return b(c,a)}e.each(a,c)},f.map=e.map,f.mixin=e.extend,f.Event=e.Event;var g="aaAutocomplete",h=c(5),i=c(6);d.sources=h.sources,d.escapeHighlightedString=f.escapeHighlightedString;var j="autocomplete"in window,k=window.autocomplete;d.noConflict=function(){return j?window.autocomplete=k:delete window.autocomplete,d},a.exports=d},function(a,b){!function(b,c){a.exports=function(a){var b=function(){function b(a){return null==a?String(a):V[W.call(a)]||"object"}function c(a){return"function"==b(a)}function d(a){return null!=a&&a==a.window}function e(a){return null!=a&&a.nodeType==a.DOCUMENT_NODE}function f(a){return"object"==b(a)}function g(a){return f(a)&&!d(a)&&Object.getPrototypeOf(a)==Object.prototype}function h(a){var b=!!a&&"length"in a&&a.length,c=z.type(a);return"function"!=c&&!d(a)&&("array"==c||0===b||"number"==typeof b&&b>0&&b-1 in a)}function i(a){return F.call(a,function(a){return null!=a})}function j(a){return a.length>0?z.fn.concat.apply([],a):a}function k(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(a){return a in J?J[a]:J[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function m(a,b){return"number"!=typeof b||K[k(a)]?b:b+"px"}function n(a){var b,c;return I[a]||(b=H.createElement(a),H.body.appendChild(b),c=getComputedStyle(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),"none"==c&&(c="block"),I[a]=c),I[a]}function o(a){return"children"in a?G.call(a.children):z.map(a.childNodes,function(a){if(1==a.nodeType)return a})}function p(a,b){var c,d=a?a.length:0;for(c=0;c<d;c++)this[c]=a[c];this.length=d,this.selector=b||""}function q(a,b,c){for(y in b)c&&(g(b[y])||$(b[y]))?(g(b[y])&&!g(a[y])&&(a[y]={}),$(b[y])&&!$(a[y])&&(a[y]=[]),q(a[y],b[y],c)):b[y]!==x&&(a[y]=b[y])}function r(a,b){return null==b?z(a):z(a).filter(b)}function s(a,b,d,e){return c(b)?b.call(a,d,e):b}function t(a,b,c){null==c?a.removeAttribute(b):a.setAttribute(b,c)}function u(a,b){var c=a.className||"",d=c&&c.baseVal!==x;if(b===x)return d?c.baseVal:c;d?c.baseVal=b:a.className=b}function v(a){try{return a?"true"==a||"false"!=a&&("null"==a?null:+a+""==a?+a:/^[\[\{]/.test(a)?z.parseJSON(a):a):a}catch(b){return a}}function w(a,b){b(a);for(var c=0,d=a.childNodes.length;c<d;c++)w(a.childNodes[c],b)}var x,y,z,A,B,C,D=[],E=D.concat,F=D.filter,G=D.slice,H=a.document,I={},J={},K={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},L=/^\s*<(\w+|!)[^>]*>/,M=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,N=/^(?:body|html)$/i,O=["val","css","html","text","data","width","height","offset"],P=["after","prepend","before","append"],Q=H.createElement("table"),R=H.createElement("tr"),S={tr:H.createElement("tbody"),tbody:Q,thead:Q,tfoot:Q,td:R,th:R,"*":H.createElement("div")},T=/complete|loaded|interactive/,U=/^[\w-]*$/,V={},W=V.toString,X={},Y=H.createElement("div"),Z={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},$=Array.isArray||function(a){return a instanceof Array};return X.matches=function(a,b){if(!b||!a||1!==a.nodeType)return!1;var c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=Y).appendChild(a),d=~X.qsa(e,b).indexOf(a),f&&Y.removeChild(a),d},B=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},C=function(a){return F.call(a,function(b,c){return a.indexOf(b)==c})},X.fragment=function(a,b,c){var d,e,f;return M.test(a)&&(d=z(H.createElement(RegExp.$1))),d||(a.replace&&(a=a.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>")),b===x&&(b=L.test(a)&&RegExp.$1),b in S||(b="*"),f=S[b],f.innerHTML=""+a,d=z.each(G.call(f.childNodes),function(){f.removeChild(this)})),g(c)&&(e=z(d),z.each(c,function(a,b){O.indexOf(a)>-1?e[a](b):e.attr(a,b)})),d},X.Z=function(a,b){return new p(a,b)},X.isZ=function(a){return a instanceof X.Z},X.init=function(a,b){var d;if(!a)return X.Z();if("string"==typeof a)if(a=a.trim(),"<"==a[0]&&L.test(a))d=X.fragment(a,RegExp.$1,b),a=null;else{if(b!==x)return z(b).find(a);d=X.qsa(H,a)}else{if(c(a))return z(H).ready(a);if(X.isZ(a))return a;if($(a))d=i(a);else if(f(a))d=[a],a=null;else if(L.test(a))d=X.fragment(a.trim(),RegExp.$1,b),a=null;else{if(b!==x)return z(b).find(a);d=X.qsa(H,a)}}return X.Z(d,a)},z=function(a,b){return X.init(a,b)},z.extend=function(a){var b,c=G.call(arguments,1);return"boolean"==typeof a&&(b=a,a=c.shift()),c.forEach(function(c){q(a,c,b)}),a},X.qsa=function(a,b){var c,d="#"==b[0],e=!d&&"."==b[0],f=d||e?b.slice(1):b,g=U.test(f);return a.getElementById&&g&&d?(c=a.getElementById(f))?[c]:[]:1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType?[]:G.call(g&&!d&&a.getElementsByClassName?e?a.getElementsByClassName(f):a.getElementsByTagName(b):a.querySelectorAll(b))},z.contains=H.documentElement.contains?function(a,b){return a!==b&&a.contains(b)}:function(a,b){for(;b&&(b=b.parentNode);)if(b===a)return!0;return!1},z.type=b,z.isFunction=c,z.isWindow=d,z.isArray=$,z.isPlainObject=g,z.isEmptyObject=function(a){var b;for(b in a)return!1;return!0},z.isNumeric=function(a){var b=Number(a),c=typeof a;return null!=a&&"boolean"!=c&&("string"!=c||a.length)&&!isNaN(b)&&isFinite(b)||!1},z.inArray=function(a,b,c){return D.indexOf.call(b,a,c)},z.camelCase=B,z.trim=function(a){return null==a?"":String.prototype.trim.call(a)},z.uuid=0,z.support={},z.expr={},z.noop=function(){},z.map=function(a,b){var c,d,e,f=[];if(h(a))for(d=0;d<a.length;d++)null!=(c=b(a[d],d))&&f.push(c);else for(e in a)null!=(c=b(a[e],e))&&f.push(c);return j(f)},z.each=function(a,b){var c,d;if(h(a)){for(c=0;c<a.length;c++)if(b.call(a[c],c,a[c])===!1)return a}else for(d in a)if(b.call(a[d],d,a[d])===!1)return a;return a},z.grep=function(a,b){return F.call(a,b)},a.JSON&&(z.parseJSON=JSON.parse),z.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){V["[object "+b+"]"]=b.toLowerCase()}),z.fn={constructor:X.Z,length:0,forEach:D.forEach,reduce:D.reduce,push:D.push,sort:D.sort,splice:D.splice,indexOf:D.indexOf,concat:function(){var a,b,c=[];for(a=0;a<arguments.length;a++)b=arguments[a],c[a]=X.isZ(b)?b.toArray():b;return E.apply(X.isZ(this)?this.toArray():this,c)},map:function(a){return z(z.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return z(G.apply(this,arguments))},ready:function(a){return T.test(H.readyState)&&H.body?a(z):H.addEventListener("DOMContentLoaded",function(){a(z)},!1),this},get:function(a){return a===x?G.call(this):this[a>=0?a:a+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(a){return D.every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this},filter:function(a){return c(a)?this.not(this.not(a)):z(F.call(this,function(b){return X.matches(b,a)}))},add:function(a,b){return z(C(this.concat(z(a,b))))},is:function(a){return this.length>0&&X.matches(this[0],a)},not:function(a){var b=[];if(c(a)&&a.call!==x)this.each(function(c){a.call(this,c)||b.push(this)});else{var d="string"==typeof a?this.filter(a):h(a)&&c(a.item)?G.call(a):z(a);this.forEach(function(a){d.indexOf(a)<0&&b.push(a)})}return z(b)},has:function(a){return this.filter(function(){return f(a)?z.contains(this,a):z(this).find(a).size()})},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!f(a)?a:z(a)},last:function(){var a=this[this.length-1];return a&&!f(a)?a:z(a)},find:function(a){var b=this;return a?"object"==typeof a?z(a).filter(function(){var a=this;return D.some.call(b,function(b){return z.contains(b,a)})}):1==this.length?z(X.qsa(this[0],a)):this.map(function(){return X.qsa(this,a)}):z()},closest:function(a,b){var c=[],d="object"==typeof a&&z(a);return this.each(function(f,g){for(;g&&!(d?d.indexOf(g)>=0:X.matches(g,a));)g=g!==b&&!e(g)&&g.parentNode;g&&c.indexOf(g)<0&&c.push(g)}),z(c)},parents:function(a){for(var b=[],c=this;c.length>0;)c=z.map(c,function(a){if((a=a.parentNode)&&!e(a)&&b.indexOf(a)<0)return b.push(a),a});return r(b,a)},parent:function(a){return r(C(this.pluck("parentNode")),a)},children:function(a){return r(this.map(function(){return o(this)}),a)},contents:function(){return this.map(function(){return this.contentDocument||G.call(this.childNodes)})},siblings:function(a){return r(this.map(function(a,b){return F.call(o(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return z.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=n(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var b=c(a);if(this[0]&&!b)var d=z(a).get(0),e=d.parentNode||this.length>1;return this.each(function(c){z(this).wrapAll(b?a.call(this,c):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){z(this[0]).before(a=z(a));for(var b;(b=a.children()).length;)a=b.first();z(a).append(this)}return this},wrapInner:function(a){var b=c(a);return this.each(function(c){var d=z(this),e=d.contents(),f=b?a.call(this,c):a;e.length?e.wrapAll(f):d.append(f)})},unwrap:function(){return this.parent().each(function(){z(this).replaceWith(z(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(a){return this.each(function(){var b=z(this);(a===x?"none"==b.css("display"):a)?b.show():b.hide()})},prev:function(a){return z(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return z(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return 0 in arguments?this.each(function(b){var c=this.innerHTML;z(this).empty().append(s(this,a,b,c))}):0 in this?this[0].innerHTML:null},text:function(a){return 0 in arguments?this.each(function(b){var c=s(this,a,b,this.textContent);this.textContent=null==c?"":""+c}):0 in this?this.pluck("textContent").join(""):null},attr:function(a,b){var c;return"string"!=typeof a||1 in arguments?this.each(function(c){if(1===this.nodeType)if(f(a))for(y in a)t(this,y,a[y]);else t(this,a,s(this,b,c,this.getAttribute(a)))}):0 in this&&1==this[0].nodeType&&null!=(c=this[0].getAttribute(a))?c:x},removeAttr:function(a){return this.each(function(){1===this.nodeType&&a.split(" ").forEach(function(a){t(this,a)},this)})},prop:function(a,b){return a=Z[a]||a,1 in arguments?this.each(function(c){this[a]=s(this,b,c,this[a])}):this[0]&&this[0][a]},removeProp:function(a){return a=Z[a]||a,this.each(function(){delete this[a]})},data:function(a,b){var c="data-"+a.replace(/([A-Z])/g,"-$1").toLowerCase(),d=1 in arguments?this.attr(c,b):this.attr(c);return null!==d?v(d):x},val:function(a){return 0 in arguments?(null==a&&(a=""),this.each(function(b){this.value=s(this,a,b,this.value)})):this[0]&&(this[0].multiple?z(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(b){if(b)return this.each(function(a){var c=z(this),d=s(this,b,a,c.offset()),e=c.offsetParent().offset(),f={top:d.top-e.top,left:d.left-e.left};"static"==c.css("position")&&(f.position="relative"),c.css(f)});if(!this.length)return null;if(H.documentElement!==this[0]&&!z.contains(H.documentElement,this[0]))return{top:0,left:0};var c=this[0].getBoundingClientRect();return{left:c.left+a.pageXOffset,top:c.top+a.pageYOffset,width:Math.round(c.width),height:Math.round(c.height)}},css:function(a,c){if(arguments.length<2){var d=this[0];if("string"==typeof a){if(!d)return;return d.style[B(a)]||getComputedStyle(d,"").getPropertyValue(a)}if($(a)){if(!d)return;var e={},f=getComputedStyle(d,"");return z.each(a,function(a,b){e[b]=d.style[B(b)]||f.getPropertyValue(b)}),e}}var g="";if("string"==b(a))c||0===c?g=k(a)+":"+m(a,c):this.each(function(){this.style.removeProperty(k(a))});else for(y in a)a[y]||0===a[y]?g+=k(y)+":"+m(y,a[y])+";":this.each(function(){this.style.removeProperty(k(y))});return this.each(function(){this.style.cssText+=";"+g})},index:function(a){return a?this.indexOf(z(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return!!a&&D.some.call(this,function(a){return this.test(u(a))},l(a))},addClass:function(a){return a?this.each(function(b){if("className"in this){A=[];var c=u(this);s(this,a,b,c).split(/\s+/g).forEach(function(a){z(this).hasClass(a)||A.push(a)},this),A.length&&u(this,c+(c?" ":"")+A.join(" "))}}):this},removeClass:function(a){return this.each(function(b){if("className"in this){if(a===x)return u(this,"");A=u(this),s(this,a,b,A).split(/\s+/g).forEach(function(a){A=A.replace(l(a)," ")}),u(this,A.trim())}})},toggleClass:function(a,b){return a?this.each(function(c){var d=z(this);s(this,a,c,u(this)).split(/\s+/g).forEach(function(a){(b===x?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})}):this},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===x?b?this[0].scrollTop:this[0].pageYOffset:this.each(b?function(){this.scrollTop=a}:function(){this.scrollTo(this.scrollX,a)})}},scrollLeft:function(a){if(this.length){var b="scrollLeft"in this[0];return a===x?b?this[0].scrollLeft:this[0].pageXOffset:this.each(b?function(){this.scrollLeft=a}:function(){this.scrollTo(a,this.scrollY)})}},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=N.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(z(a).css("margin-top"))||0,c.left-=parseFloat(z(a).css("margin-left"))||0,d.top+=parseFloat(z(b[0]).css("border-top-width"))||0,d.left+=parseFloat(z(b[0]).css("border-left-width"))||0,{top:c.top-d.top,left:c.left-d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||H.body;a&&!N.test(a.nodeName)&&"static"==z(a).css("position");)a=a.offsetParent;return a})}},z.fn.detach=z.fn.remove,["width","height"].forEach(function(a){var b=a.replace(/./,function(a){return a[0].toUpperCase()});z.fn[a]=function(c){var f,g=this[0];return c===x?d(g)?g["inner"+b]:e(g)?g.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){g=z(this),g.css(a,s(this,c,b,g[a]()))})}}),P.forEach(function(c,d){var e=d%2;z.fn[c]=function(){var c,f,g=z.map(arguments,function(a){var d=[];return c=b(a),"array"==c?(a.forEach(function(a){return a.nodeType!==x?d.push(a):z.zepto.isZ(a)?d=d.concat(a.get()):void(d=d.concat(X.fragment(a)))}),d):"object"==c||null==a?a:X.fragment(a)}),h=this.length>1;return g.length<1?this:this.each(function(b,c){f=e?c:c.parentNode,c=0==d?c.nextSibling:1==d?c.firstChild:2==d?c:null;var i=z.contains(H.documentElement,f);g.forEach(function(b){if(h)b=b.cloneNode(!0);else if(!f)return z(b).remove();f.insertBefore(b,c),i&&w(b,function(b){if(!(null==b.nodeName||"SCRIPT"!==b.nodeName.toUpperCase()||b.type&&"text/javascript"!==b.type||b.src)){var c=b.ownerDocument?b.ownerDocument.defaultView:a;c.eval.call(c,b.innerHTML)}})})})},z.fn[e?c+"To":"insert"+(d?"Before":"After")]=function(a){return z(a)[c](this),this}}),X.Z.prototype=p.prototype=z.fn,X.uniq=C,X.deserializeValue=v,z.zepto=X,z}();return function(b){function c(a){return a._zid||(a._zid=n++)}function d(a,b,d,g){if(b=e(b),b.ns)var h=f(b.ns);return(r[c(a)]||[]).filter(function(a){return a&&(!b.e||a.e==b.e)&&(!b.ns||h.test(a.ns))&&(!d||c(a.fn)===c(d))&&(!g||a.sel==g)})}function e(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function f(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function g(a,b){return a.del&&!t&&a.e in u||!!b}function h(a){return v[a]||t&&u[a]||a}function i(a,d,f,i,j,l,n){var o=c(a),p=r[o]||(r[o]=[]);d.split(/\s/).forEach(function(c){if("ready"==c)return b(document).ready(f);var d=e(c);d.fn=f,d.sel=j,d.e in v&&(f=function(a){var c=a.relatedTarget;if(!c||c!==this&&!b.contains(this,c))return d.fn.apply(this,arguments)}),d.del=l;var o=l||f;d.proxy=function(b){if(b=k(b),!b.isImmediatePropagationStopped()){try{var c=Object.getOwnPropertyDescriptor(b,"data");c&&!c.writable||(b.data=i)}catch(b){}var d=o.apply(a,b._args==m?[b]:[b].concat(b._args));return d===!1&&(b.preventDefault(),b.stopPropagation()),d}},d.i=p.length,p.push(d),"addEventListener"in a&&a.addEventListener(h(d.e),d.proxy,g(d,n))})}function j(a,b,e,f,i){var j=c(a);(b||"").split(/\s/).forEach(function(b){d(a,b,e,f).forEach(function(b){delete r[j][b.i],"removeEventListener"in a&&a.removeEventListener(h(b.e),b.proxy,g(b,i))})})}function k(a,c){return!c&&a.isDefaultPrevented||(c||(c=a),b.each(z,function(b,d){var e=c[b];a[b]=function(){return this[d]=w,e&&e.apply(c,arguments)},a[d]=x}),a.timeStamp||(a.timeStamp=Date.now()),(c.defaultPrevented!==m?c.defaultPrevented:"returnValue"in c?c.returnValue===!1:c.getPreventDefault&&c.getPreventDefault())&&(a.isDefaultPrevented=w)),a}function l(a){var b,c={originalEvent:a};for(b in a)y.test(b)||a[b]===m||(c[b]=a[b]);return k(c,a)}var m,n=1,o=Array.prototype.slice,p=b.isFunction,q=function(a){return"string"==typeof a},r={},s={},t="onfocusin"in a,u={focus:"focusin",blur:"focusout"},v={mouseenter:"mouseover",mouseleave:"mouseout"};s.click=s.mousedown=s.mouseup=s.mousemove="MouseEvents",b.event={add:i,remove:j},b.proxy=function(a,d){var e=2 in arguments&&o.call(arguments,2);if(p(a)){var f=function(){return a.apply(d,e?e.concat(o.call(arguments)):arguments)};return f._zid=c(a),f}if(q(d))return e?(e.unshift(a[d],a),b.proxy.apply(null,e)):b.proxy(a[d],a);throw new TypeError("expected function")},b.fn.bind=function(a,b,c){return this.on(a,b,c)},b.fn.unbind=function(a,b){return this.off(a,b)},b.fn.one=function(a,b,c,d){return this.on(a,b,c,d,1)};var w=function(){return!0},x=function(){return!1},y=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,z={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};b.fn.delegate=function(a,b,c){return this.on(b,a,c)},b.fn.undelegate=function(a,b,c){return this.off(b,a,c)},b.fn.live=function(a,c){return b(document.body).delegate(this.selector,a,c),this},b.fn.die=function(a,c){return b(document.body).undelegate(this.selector,a,c),this},b.fn.on=function(a,c,d,e,f){var g,h,k=this;return a&&!q(a)?(b.each(a,function(a,b){k.on(a,c,d,b,f)}),k):(q(c)||p(e)||e===!1||(e=d,d=c,c=m),e!==m&&d!==!1||(e=d,d=m),e===!1&&(e=x),k.each(function(k,m){f&&(g=function(a){return j(m,a.type,e),e.apply(this,arguments)}),c&&(h=function(a){var d,f=b(a.target).closest(c,m).get(0);if(f&&f!==m)return d=b.extend(l(a),{currentTarget:f,liveFired:m}),(g||e).apply(f,[d].concat(o.call(arguments,1)))}),i(m,a,e,d,c,h||g)}))},b.fn.off=function(a,c,d){var e=this;return a&&!q(a)?(b.each(a,function(a,b){e.off(a,c,b)}),e):(q(c)||p(d)||d===!1||(d=c,c=m),d===!1&&(d=x),e.each(function(){j(this,a,d,c)}))},b.fn.trigger=function(a,c){return a=q(a)||b.isPlainObject(a)?b.Event(a):k(a),a._args=c,this.each(function(){a.type in u&&"function"==typeof this[a.type]?this[a.type]():"dispatchEvent"in this?this.dispatchEvent(a):b(this).triggerHandler(a,c)})},b.fn.triggerHandler=function(a,c){var e,f;return this.each(function(g,h){e=l(q(a)?b.Event(a):a),e._args=c,e.target=h,b.each(d(h,a.type||a),function(a,b){if(f=b.proxy(e),e.isImmediatePropagationStopped())return!1})}),f},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(a){b.fn[a]=function(b){return 0 in arguments?this.bind(a,b):this.trigger(a)}}),b.Event=function(a,b){q(a)||(b=a,a=b.type);var c=document.createEvent(s[a]||"Events"),d=!0;if(b)for(var e in b)"bubbles"==e?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0),k(c)}}(b),function(a){var b,c=[];a.fn.remove=function(){return this.each(function(){this.parentNode&&("IMG"===this.tagName&&(c.push(this),this.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",b&&clearTimeout(b),b=setTimeout(function(){c=[]},6e4)),this.parentNode.removeChild(this))})}}(b),function(a){function b(b,d){var i=b[h],j=i&&e[i];if(void 0===d)return j||c(b);if(j){if(d in j)return j[d];var k=g(d);if(k in j)return j[k]}return f.call(a(b),d)}function c(b,c,f){var i=b[h]||(b[h]=++a.uuid),j=e[i]||(e[i]=d(b));return void 0!==c&&(j[g(c)]=f),j}function d(b){var c={};return a.each(b.attributes||i,function(b,d){0==d.name.indexOf("data-")&&(c[g(d.name.replace("data-",""))]=a.zepto.deserializeValue(d.value))}),c}var e={},f=a.fn.data,g=a.camelCase,h=a.expando="Zepto"+ +new Date,i=[];a.fn.data=function(d,e){return void 0===e?a.isPlainObject(d)?this.each(function(b,e){a.each(d,function(a,b){c(e,a,b)})}):0 in this?b(this[0],d):void 0:this.each(function(){c(this,d,e)})},a.data=function(b,c,d){return a(b).data(c,d)},a.hasData=function(b){var c=b[h],d=c&&e[c];return!!d&&!a.isEmptyObject(d)},a.fn.removeData=function(b){return"string"==typeof b&&(b=b.split(/\s+/)),this.each(function(){var c=this[h],d=c&&e[c];d&&a.each(b||d,function(a){delete d[b?g(this):a]})})},["remove","empty"].forEach(function(b){var c=a.fn[b];a.fn[b]=function(){var a=this.find("*");return"remove"===b&&(a=a.add(this)),a.removeData(),c.call(this)}})}(b),b}(b)}(window)},function(a,b){"use strict";a.exports={element:null}},function(a,b,c){"use strict";function d(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var e=c(3);a.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(a){if(void 0===a&&(a=navigator.userAgent),/(msie|trident)/i.test(a)){var b=a.match(/(msie |rv:)(\d+(.\d+)?)/i);if(b)return b[2]}return!1},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(a){return"number"==typeof a},toStr:function(a){return void 0===a||null===a?"":a+""},cloneDeep:function(a){var b=this.mixin({},a),c=this;return this.each(b,function(a,d){a&&(c.isArray(a)?b[d]=[].concat(a):c.isObject(a)&&(b[d]=c.cloneDeep(a)))}),b},error:function(a){throw new Error(a)},every:function(a,b){var c=!0;return a?(this.each(a,function(d,e){c&&(c=b.call(null,d,e,a)&&c)}),!!c):c},any:function(a,b){var c=!1;return a?(this.each(a,function(d,e){if(b.call(null,d,e,a))return c=!0,!1}),c):c},getUniqueId:function(){var a=0;return function(){return a++}}(),templatify:function(a){if(this.isFunction(a))return a;var b=e.element(a);return"SCRIPT"===b.prop("tagName")?function(){return b.text()}:function(){return String(a)}},defer:function(a){setTimeout(a,0)},noop:function(){},formatPrefix:function(a,b){return b?"":a+"-"},className:function(a,b,c){return(c?"":".")+a+b},escapeHighlightedString:function(a,b,c){b=b||"<em>";var e=document.createElement("div");e.appendChild(document.createTextNode(b)),c=c||"</em>";var f=document.createElement("div");f.appendChild(document.createTextNode(c));var g=document.createElement("div");return g.appendChild(document.createTextNode(a)),g.innerHTML.replace(RegExp(d(e.innerHTML),"g"),b).replace(RegExp(d(f.innerHTML),"g"),c)}}},function(a,b,c){"use strict";function d(a){var b,c;if(a=a||{},a.input||i.error("missing input"),this.isActivated=!1,this.debug=!!a.debug,this.autoselect=!!a.autoselect,this.autoselectOnBlur=!!a.autoselectOnBlur,this.openOnFocus=!!a.openOnFocus,this.minLength=i.isNumber(a.minLength)?a.minLength:1,this.autoWidth=void 0===a.autoWidth||!!a.autoWidth,this.clearOnSelected=!!a.clearOnSelected,this.tabAutocomplete=void 0===a.tabAutocomplete||!!a.tabAutocomplete,a.hint=!!a.hint,a.hint&&a.appendTo)throw new Error("[autocomplete.js] hint and appendTo options can't be used at the same time");this.css=a.css=i.mixin({},o,a.appendTo?o.appendTo:{}),this.cssClasses=a.cssClasses=i.mixin({},o.defaultClasses,a.cssClasses||{}),this.cssClasses.prefix=a.cssClasses.formattedPrefix=i.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix),this.listboxId=a.listboxId=[this.cssClasses.root,"listbox",i.getUniqueId()].join("-");var f=e(a);this.$node=f.wrapper;var g=this.$input=f.input;b=f.menu,c=f.hint,a.dropdownMenuContainer&&j.element(a.dropdownMenuContainer).css("position","relative").append(b.css("top","0")),g.on("blur.aa",function(a){var c=document.activeElement;i.isMsie()&&(b[0]===c||b[0].contains(c))&&(a.preventDefault(),a.stopImmediatePropagation(),i.defer(function(){g.focus()}))}),b.on("mousedown.aa",function(a){a.preventDefault()}),this.eventBus=a.eventBus||new k({el:g}),this.dropdown=new d.Dropdown({appendTo:a.appendTo,wrapper:this.$node,menu:b,datasets:a.datasets,templates:a.templates,cssClasses:a.cssClasses,minLength:this.minLength}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onSync("shown",this._onShown,this).onSync("empty",this._onEmpty,this).onSync("redrawn",this._onRedrawn,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new d.Input({input:g,hint:c}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._bindKeyboardShortcuts(a),this._setLanguageDirection()}function e(a){var b,c,d,e;b=j.element(a.input),c=j.element(n.wrapper.replace("%ROOT%",a.cssClasses.root)).css(a.css.wrapper),a.appendTo||"block"!==b.css("display")||"table"!==b.parent().css("display")||c.css("display","table-cell");var g=n.dropdown.replace("%PREFIX%",a.cssClasses.prefix).replace("%DROPDOWN_MENU%",a.cssClasses.dropdownMenu);d=j.element(g).css(a.css.dropdown).attr({role:"listbox",id:a.listboxId}),a.templates&&a.templates.dropdownMenu&&d.html(i.templatify(a.templates.dropdownMenu)()),e=b.clone().css(a.css.hint).css(f(b)),e.val("").addClass(i.className(a.cssClasses.prefix,a.cssClasses.hint,!0)).removeAttr("id name placeholder required").prop("readonly",!0).attr({"aria-hidden":"true",autocomplete:"off",spellcheck:"false",tabindex:-1}),e.removeData&&e.removeData(),b.data(h,{"aria-autocomplete":b.attr("aria-autocomplete"),"aria-expanded":b.attr("aria-expanded"),"aria-owns":b.attr("aria-owns"),autocomplete:b.attr("autocomplete"),dir:b.attr("dir"),role:b.attr("role"),spellcheck:b.attr("spellcheck"),style:b.attr("style"),type:b.attr("type")}),b.addClass(i.className(a.cssClasses.prefix,a.cssClasses.input,!0)).attr({autocomplete:"off",spellcheck:!1,role:"combobox","aria-autocomplete":a.datasets&&a.datasets[0]&&a.datasets[0].displayKey?"both":"list","aria-expanded":"false","aria-label":a.ariaLabel,"aria-owns":a.listboxId}).css(a.hint?a.css.input:a.css.inputWithNoHint);try{b.attr("dir")||b.attr("dir","auto")}catch(a){}return c=a.appendTo?c.appendTo(j.element(a.appendTo).eq(0)).eq(0):b.wrap(c).parent(),c.prepend(a.hint?e:null).append(d),{wrapper:c,input:b,hint:e,menu:d}}function f(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function g(a,b){var c=a.find(i.className(b.prefix,b.input));i.each(c.data(h),function(a,b){void 0===a?c.removeAttr(b):c.attr(b,a)}),c.detach().removeClass(i.className(b.prefix,b.input,!0)).insertAfter(a),c.removeData&&c.removeData(h),a.remove()}var h="aaAttrs",i=c(4),j=c(3),k=c(6),l=c(7),m=c(16),n=c(18),o=c(19);i.mixin(d.prototype,{_bindKeyboardShortcuts:function(a){if(a.keyboardShortcuts){var b=this.$input,c=[];i.each(a.keyboardShortcuts,function(a){"string"==typeof a&&(a=a.toUpperCase().charCodeAt(0)),c.push(a)}),j.element(document).keydown(function(a){var d=a.target||a.srcElement,e=d.tagName;if(!d.isContentEditable&&"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e){var f=a.which||a.keyCode;c.indexOf(f)!==-1&&(b.focus(),a.stopPropagation(),a.preventDefault())}})}},_onSuggestionClicked:function(a,b){var c,d={selectionMethod:"click"};(c=this.dropdown.getDatumForSuggestion(b))&&this._select(c,d)},_onCursorMoved:function(a,b){var c=this.dropdown.getDatumForCursor(),d=this.dropdown.getCurrentCursor().attr("id");this.input.setActiveDescendant(d),c&&(b&&this.input.setInputValue(c.value,!0),this.eventBus.trigger("cursorchanged",c.raw,c.datasetName))},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint(),this.eventBus.trigger("cursorremoved")},_onDatasetRendered:function(){this._updateHint(),this.eventBus.trigger("updated")},_onOpened:function(){this._updateHint(),this.input.expand(),this.eventBus.trigger("opened")},_onEmpty:function(){this.eventBus.trigger("empty")},_onRedrawn:function(){this.$node.css("top","0px"),this.$node.css("left","0px");var a=this.$input[0].getBoundingClientRect();this.autoWidth&&this.$node.css("width",a.width+"px");var b=this.$node[0].getBoundingClientRect(),c=a.bottom-b.top;this.$node.css("top",c+"px");var d=a.left-b.left;this.$node.css("left",d+"px"),this.eventBus.trigger("redrawn")},_onShown:function(){this.eventBus.trigger("shown"),this.autoselect&&this.dropdown.cursorTopSuggestion()},_onClosed:function(){this.input.clearHint(),this.input.removeActiveDescendant(),this.input.collapse(),this.eventBus.trigger("closed")},_onFocused:function(){if(this.isActivated=!0,this.openOnFocus){var a=this.input.getQuery();a.length>=this.minLength?this.dropdown.update(a):this.dropdown.empty(),this.dropdown.open()}},_onBlurred:function(){var a,b;a=this.dropdown.getDatumForCursor(),b=this.dropdown.getDatumForTopSuggestion();var c={selectionMethod:"blur"};this.debug||(this.autoselectOnBlur&&a?this._select(a,c):this.autoselectOnBlur&&b?this._select(b,c):(this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()))},_onEnterKeyed:function(a,b){var c,d;c=this.dropdown.getDatumForCursor(),
d=this.dropdown.getDatumForTopSuggestion();var e={selectionMethod:"enterKey"};c?(this._select(c,e),b.preventDefault()):this.autoselect&&d&&(this._select(d,e),b.preventDefault())},_onTabKeyed:function(a,b){if(!this.tabAutocomplete)return void this.dropdown.close();var c,d={selectionMethod:"tabKey"};(c=this.dropdown.getDatumForCursor())?(this._select(c,d),b.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var a=this.input.getQuery();this.dropdown.isEmpty&&a.length>=this.minLength?this.dropdown.update(a):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var a=this.input.getQuery();this.dropdown.isEmpty&&a.length>=this.minLength?this.dropdown.update(a):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(a,b){this.input.clearHintIfInvalid(),b.length>=this.minLength?this.dropdown.update(b):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var a=this.input.getLanguageDirection();this.dir!==a&&(this.dir=a,this.$node.css("direction",a),this.dropdown.setLanguageDirection(a))},_updateHint:function(){var a,b,c,d,e,f;a=this.dropdown.getDatumForTopSuggestion(),a&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(b=this.input.getInputValue(),c=l.normalizeQuery(b),d=i.escapeRegExChars(c),e=new RegExp("^(?:"+d+")(.+$)","i"),f=e.exec(a.value),f?this.input.setHint(b+f[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(a){var b,c,d,e;b=this.input.getHint(),c=this.input.getQuery(),d=a||this.input.isCursorAtEnd(),b&&c!==b&&d&&(e=this.dropdown.getDatumForTopSuggestion(),e&&this.input.setInputValue(e.value),this.eventBus.trigger("autocompleted",e.raw,e.datasetName))},_select:function(a,b){void 0!==a.value&&this.input.setQuery(a.value),this.clearOnSelected?this.setVal(""):this.input.setInputValue(a.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",a.raw,a.datasetName,b).isDefaultPrevented()===!1&&(this.dropdown.close(),i.defer(i.bind(this.dropdown.empty,this.dropdown)))},open:function(){if(!this.isActivated){var a=this.input.getInputValue();a.length>=this.minLength?this.dropdown.update(a):this.dropdown.empty()}this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(a){a=i.toStr(a),this.isActivated?this.input.setInputValue(a):(this.input.setQuery(a),this.input.setInputValue(a,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),g(this.$node,this.cssClasses),this.$node=null},getWrapper:function(){return this.dropdown.$container[0]}}),d.Dropdown=m,d.Input=l,d.sources=c(20),a.exports=d},function(a,b,c){"use strict";function d(a){a&&a.el||e.error("EventBus initialized without el"),this.$el=f.element(a.el)}var e=c(4),f=c(3);e.mixin(d.prototype,{trigger:function(a,b,c,d){var f=e.Event("autocomplete:"+a);return this.$el.trigger(f,[b,c,d]),f}}),a.exports=d},function(a,b,c){"use strict";function d(a){var b,c,d,f,g=this;a=a||{},a.input||i.error("input is missing"),b=i.bind(this._onBlur,this),c=i.bind(this._onFocus,this),d=i.bind(this._onKeydown,this),f=i.bind(this._onInput,this),this.$hint=j.element(a.hint),this.$input=j.element(a.input).on("blur.aa",b).on("focus.aa",c).on("keydown.aa",d),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=i.noop),i.isMsie()?this.$input.on("keydown.aa keypress.aa cut.aa paste.aa",function(a){h[a.which||a.keyCode]||i.defer(i.bind(g._onInput,g,a))}):this.$input.on("input.aa",f),this.query=this.$input.val(),this.$overflowHelper=e(this.$input)}function e(a){return j.element('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:a.css("font-family"),fontSize:a.css("font-size"),fontStyle:a.css("font-style"),fontVariant:a.css("font-variant"),fontWeight:a.css("font-weight"),wordSpacing:a.css("word-spacing"),letterSpacing:a.css("letter-spacing"),textIndent:a.css("text-indent"),textRendering:a.css("text-rendering"),textTransform:a.css("text-transform")}).insertAfter(a)}function f(a,b){return d.normalizeQuery(a)===d.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};var i=c(4),j=c(3),k=c(8);d.normalizeQuery=function(a){return(a||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},i.mixin(d.prototype,k,{_onBlur:function(){this.resetInputValue(),this.$input.removeAttr("aria-activedescendant"),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(a,b){var c,d,e;switch(a){case"tab":d=this.getHint(),e=this.getInputValue(),c=d&&d!==e&&!g(b);break;case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkInputValue:function(){var a,b,c;a=this.getInputValue(),b=f(a,this.query),c=!(!b||!this.query)&&this.query.length!==a.length,this.query=a,b?c&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(a){this.query=a},getInputValue:function(){return this.$input.val()},setInputValue:function(a,b){void 0===a&&(a=this.query),this.$input.val(a),b?this.clearHint():this._checkInputValue()},expand:function(){this.$input.attr("aria-expanded","true")},collapse:function(){this.$input.attr("aria-expanded","false")},setActiveDescendant:function(a){this.$input.attr("aria-activedescendant",a)},removeActiveDescendant:function(){this.$input.removeAttr("aria-activedescendant")},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),(d=""!==a&&c&&!this.hasOverflow())||this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,b,c;return a=this.$input.val().length,b=this.$input[0].selectionStart,i.isNumber(b)?b===a:!document.selection||(c=document.selection.createRange(),c.moveStart("character",-a),a===c.text.length)},destroy:function(){this.$hint.off(".aa"),this.$input.off(".aa"),this.$hint=this.$input=this.$overflowHelper=null}}),a.exports=d},function(a,b,c){"use strict";function d(a,b,c,d){var e;if(!c)return this;for(b=b.split(l),c=d?j(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function e(a,b,c){return d.call(this,"async",a,b,c)}function f(a,b,c){return d.call(this,"sync",a,b,c)}function g(a){var b;if(!this._callbacks)return this;for(a=a.split(l);b=a.shift();)delete this._callbacks[b];return this}function h(a){var b,c,d,e,f;if(!this._callbacks)return this;for(a=a.split(l),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=i(c.sync,this,[b].concat(d)),f=i(c.async,this,[b].concat(d)),e()&&k(f);return this}function i(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&e<f;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function j(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var k=c(9),l=/\s+/;a.exports={onSync:f,onAsync:e,off:g,trigger:h}},function(a,b,c){"use strict";function d(){h&&i&&(h=!1,i.length?m=i.concat(m):l=-1,m.length&&e())}function e(){if(!h){n=!1,h=!0;for(var a=m.length,b=setTimeout(d);a;){for(i=m,m=[];i&&++l<a;)i[l].run();l=-1,a=m.length}i=null,l=-1,h=!1,clearTimeout(b)}}function f(a,b){this.fun=a,this.array=b}function g(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];m.push(new f(a,b)),n||h||(n=!0,j())}for(var h,i,j,k=[c(10),c(12),c(13),c(14),c(15)],l=-1,m=[],n=!1,o=-1,p=k.length;++o<p;)if(k[o]&&k[o].test&&k[o].test()){j=k[o].install(e);break}f.prototype.run=function(){var a=this.fun,b=this.array;switch(b.length){case 0:return a();case 1:return a(b[0]);case 2:return a(b[0],b[1]);case 3:return a(b[0],b[1],b[2]);default:return a.apply(null,b)}},a.exports=g},function(a,b,c){(function(a){"use strict";b.test=function(){return void 0!==a&&!a.browser},b.install=function(b){return function(){a.nextTick(b)}}}).call(b,c(11))},function(a,b){function c(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}function e(a){if(k===setTimeout)return setTimeout(a,0);if((k===c||!k)&&setTimeout)return k=setTimeout,setTimeout(a,0);try{return k(a,0)}catch(b){try{return k.call(null,a,0)}catch(b){return k.call(this,a,0)}}}function f(a){if(l===clearTimeout)return clearTimeout(a);if((l===d||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(a);try{return l(a)}catch(b){try{return l.call(null,a)}catch(b){return l.call(this,a)}}}function g(){p&&n&&(p=!1,n.length?o=n.concat(o):q=-1,o.length&&h())}function h(){if(!p){var a=e(g);p=!0;for(var b=o.length;b;){for(n=o,o=[];++q<b;)n&&n[q].run();q=-1,b=o.length}n=null,p=!1,f(a)}}function i(a,b){this.fun=a,this.array=b}function j(){}var k,l,m=a.exports={};!function(){try{k="function"==typeof setTimeout?setTimeout:c}catch(a){k=c}try{l="function"==typeof clearTimeout?clearTimeout:d}catch(a){l=d}}();var n,o=[],p=!1,q=-1;m.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];o.push(new i(a,b)),1!==o.length||p||e(h)},i.prototype.run=function(){this.fun.apply(null,this.array)},m.title="browser",m.browser=!0,m.env={},m.argv=[],m.version="",m.versions={},m.on=j,m.addListener=j,m.once=j,m.off=j,m.removeListener=j,m.removeAllListeners=j,m.emit=j,m.binding=function(a){throw new Error("process.binding is not supported")},m.cwd=function(){return"/"},m.chdir=function(a){throw new Error("process.chdir is not supported")},m.umask=function(){return 0}},function(a,b){(function(a){"use strict";var c=a.MutationObserver||a.WebKitMutationObserver;b.test=function(){return c},b.install=function(b){var d=0,e=new c(b),f=a.document.createTextNode("");return e.observe(f,{characterData:!0}),function(){f.data=d=++d%2}}}).call(b,function(){return this}())},function(a,b){(function(a){"use strict";b.test=function(){return!a.setImmediate&&void 0!==a.MessageChannel},b.install=function(b){var c=new a.MessageChannel;return c.port1.onmessage=b,function(){c.port2.postMessage(0)}}}).call(b,function(){return this}())},function(a,b){(function(a){"use strict";b.test=function(){return"document"in a&&"onreadystatechange"in a.document.createElement("script")},b.install=function(b){return function(){var c=a.document.createElement("script");return c.onreadystatechange=function(){b(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},a.document.documentElement.appendChild(c),b}}}).call(b,function(){return this}())},function(a,b){"use strict";b.test=function(){return!0},b.install=function(a){return function(){setTimeout(a,0)}}},function(a,b,c){"use strict";function d(a){var b,c,d,h=this;a=a||{},a.menu||f.error("menu is required"),f.isArray(a.datasets)||f.isObject(a.datasets)||f.error("1 or more datasets required"),a.datasets||f.error("datasets is required"),this.isOpen=!1,this.isEmpty=!0,this.minLength=a.minLength||0,this.templates={},this.appendTo=a.appendTo||!1,this.css=f.mixin({},j,a.appendTo?j.appendTo:{}),this.cssClasses=a.cssClasses=f.mixin({},j.defaultClasses,a.cssClasses||{}),this.cssClasses.prefix=a.cssClasses.formattedPrefix||f.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix),b=f.bind(this._onSuggestionClick,this),c=f.bind(this._onSuggestionMouseEnter,this),d=f.bind(this._onSuggestionMouseLeave,this);var i=f.className(this.cssClasses.prefix,this.cssClasses.suggestion);this.$menu=g.element(a.menu).on("mouseenter.aa",i,c).on("mouseleave.aa",i,d).on("click.aa",i,b),this.$container=a.appendTo?a.wrapper:this.$menu,a.templates&&a.templates.header&&(this.templates.header=f.templatify(a.templates.header),this.$menu.prepend(this.templates.header())),a.templates&&a.templates.empty&&(this.templates.empty=f.templatify(a.templates.empty),this.$empty=g.element('<div class="'+f.className(this.cssClasses.prefix,this.cssClasses.empty,!0)+'"></div>'),this.$menu.append(this.$empty),this.$empty.hide()),this.datasets=f.map(a.datasets,function(b){return e(h.$menu,b,a.cssClasses)}),f.each(this.datasets,function(a){var b=a.getRoot();b&&0===b.parent().length&&h.$menu.append(b),a.onSync("rendered",h._onRendered,h)}),a.templates&&a.templates.footer&&(this.templates.footer=f.templatify(a.templates.footer),this.$menu.append(this.templates.footer()));var k=this;g.element(window).resize(function(){k._redraw()})}function e(a,b,c){return new d.Dataset(f.mixin({$menu:a,cssClasses:c},b))}var f=c(4),g=c(3),h=c(8),i=c(17),j=c(19);f.mixin(d.prototype,h,{_onSuggestionClick:function(a){this.trigger("suggestionClicked",g.element(a.currentTarget))},_onSuggestionMouseEnter:function(a){var b=g.element(a.currentTarget);if(!b.hasClass(f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0))){this._removeCursor();var c=this;setTimeout(function(){c._setCursor(b,!1)},0)}},_onSuggestionMouseLeave:function(a){if(a.relatedTarget){if(g.element(a.relatedTarget).closest("."+f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).length>0)return}this._removeCursor(),this.trigger("cursorRemoved")},_onRendered:function(a,b){function c(a){return a.isEmpty()}function d(a){return a.templates&&a.templates.empty}if(this.isEmpty=f.every(this.datasets,c),this.isEmpty)if(b.length>=this.minLength&&this.trigger("empty"),this.$empty)if(b.length<this.minLength)this._hide();else{var e=this.templates.empty({query:this.datasets[0]&&this.datasets[0].query});this.$empty.html(e),this.$empty.show(),this._show()}else f.any(this.datasets,d)?b.length<this.minLength?this._hide():this._show():this._hide();else this.isOpen&&(this.$empty&&(this.$empty.empty(),this.$empty.hide()),b.length>=this.minLength?this._show():this._hide());this.trigger("datasetRendered")},_hide:function(){this.$container.hide()},_show:function(){this.$container.css("display","block"),this._redraw(),this.trigger("shown")},_redraw:function(){this.isOpen&&this.appendTo&&this.trigger("redrawn")},_getSuggestions:function(){return this.$menu.find(f.className(this.cssClasses.prefix,this.cssClasses.suggestion))},_getCursor:function(){return this.$menu.find(f.className(this.cssClasses.prefix,this.cssClasses.cursor)).first()},_setCursor:function(a,b){a.first().addClass(f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).attr("aria-selected","true"),this.trigger("cursorMoved",b)},_removeCursor:function(){this._getCursor().removeClass(f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).removeAttr("aria-selected")},_moveCursor:function(a){var b,c,d,e;if(this.isOpen){if(c=this._getCursor(),b=this._getSuggestions(),this._removeCursor(),d=b.index(c)+a,(d=(d+1)%(b.length+1)-1)===-1)return void this.trigger("cursorRemoved");d<-1&&(d=b.length-1),this._setCursor(e=b.eq(d),!0),this._ensureVisible(e)}},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.height()+parseInt(a.css("margin-top"),10)+parseInt(a.css("margin-bottom"),10),d=this.$menu.scrollTop(),e=this.$menu.height()+parseInt(this.$menu.css("padding-top"),10)+parseInt(this.$menu.css("padding-bottom"),10),b<0?this.$menu.scrollTop(d+b):e<c&&this.$menu.scrollTop(d+(c-e))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,this.isEmpty||this._show(),this.trigger("opened"))},setLanguageDirection:function(a){this.$menu.css("ltr"===a?this.css.ltr:this.css.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(a){var b=null;return a.length&&(b={raw:i.extractDatum(a),value:i.extractValue(a),datasetName:i.extractDatasetName(a)}),b},getCurrentCursor:function(){return this._getCursor().first()},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},cursorTopSuggestion:function(){this._setCursor(this._getSuggestions().first(),!1)},update:function(a){function b(b){b.update(a)}f.each(this.datasets,b)},empty:function(){function a(a){a.clear()}f.each(this.datasets,a),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function a(a){a.destroy()}this.$menu.off(".aa"),this.$menu=null,f.each(this.datasets,a)}}),d.Dataset=i,a.exports=d},function(a,b,c){"use strict";function d(a){a=a||{},a.templates=a.templates||{},a.source||k.error("missing source"),a.name&&!g(a.name)&&k.error("invalid dataset name: "+a.name),this.query=null,this._isEmpty=!0,this.highlight=!!a.highlight,this.name=void 0===a.name||null===a.name?k.getUniqueId():a.name,this.source=a.source,this.displayFn=e(a.display||a.displayKey),this.debounce=a.debounce,this.cache=a.cache!==!1,this.templates=f(a.templates,this.displayFn),this.css=k.mixin({},n,a.appendTo?n.appendTo:{}),this.cssClasses=a.cssClasses=k.mixin({},n.defaultClasses,a.cssClasses||{}),this.cssClasses.prefix=a.cssClasses.formattedPrefix||k.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix);var b=k.className(this.cssClasses.prefix,this.cssClasses.dataset);this.$el=a.$menu&&a.$menu.find(b+"-"+this.name).length>0?l.element(a.$menu.find(b+"-"+this.name)[0]):l.element(m.dataset.replace("%CLASS%",this.name).replace("%PREFIX%",this.cssClasses.prefix).replace("%DATASET%",this.cssClasses.dataset)),this.$menu=a.$menu,this.clearCachedSuggestions()}function e(a){function b(b){return b[a]}return a=a||"value",k.isFunction(a)?a:b}function f(a,b){function c(a){return"<p>"+b(a)+"</p>"}return{empty:a.empty&&k.templatify(a.empty),header:a.header&&k.templatify(a.header),footer:a.footer&&k.templatify(a.footer),suggestion:a.suggestion||c}}function g(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var h="aaDataset",i="aaValue",j="aaDatum",k=c(4),l=c(3),m=c(18),n=c(19),o=c(8);d.extractDatasetName=function(a){return l.element(a).data(h)},d.extractValue=function(a){return l.element(a).data(i)},d.extractDatum=function(a){var b=l.element(a).data(j);return"string"==typeof b&&(b=JSON.parse(b)),b},k.mixin(d.prototype,o,{_render:function(a,b){function c(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!0}].concat(b),n.templates.empty.apply(this,b)}function d(){function a(a){var b,c=m.suggestion.replace("%PREFIX%",f.cssClasses.prefix).replace("%SUGGESTION%",f.cssClasses.suggestion);return b=l.element(c).attr({role:"option",id:["option",Math.floor(1e8*Math.random())].join("-")}).append(n.templates.suggestion.apply(this,[a].concat(e))),b.data(h,n.name),b.data(i,n.displayFn(a)||void 0),b.data(j,JSON.stringify(a)),b.children().each(function(){l.element(this).css(f.css.suggestionChild)}),b}var c,d,e=[].slice.call(arguments,0),f=this,g=m.suggestions.replace("%PREFIX%",this.cssClasses.prefix).replace("%SUGGESTIONS%",this.cssClasses.suggestions);return c=l.element(g).css(this.css.suggestions),d=k.map(b,a),c.append.apply(c,d),c}function e(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!g}].concat(b),n.templates.header.apply(this,b)}function f(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!g}].concat(b),n.templates.footer.apply(this,b)}if(this.$el){var g,n=this,o=[].slice.call(arguments,2);if(this.$el.empty(),g=b&&b.length,this._isEmpty=!g,!g&&this.templates.empty)this.$el.html(c.apply(this,o)).prepend(n.templates.header?e.apply(this,o):null).append(n.templates.footer?f.apply(this,o):null);else if(g)this.$el.html(d.apply(this,o)).prepend(n.templates.header?e.apply(this,o):null).append(n.templates.footer?f.apply(this,o):null);else if(b&&!Array.isArray(b))throw new TypeError("suggestions must be an array");this.$menu&&this.$menu.addClass(this.cssClasses.prefix+(g?"with":"without")+"-"+this.name).removeClass(this.cssClasses.prefix+(g?"without":"with")+"-"+this.name),this.trigger("rendered",a)}},getRoot:function(){return this.$el},update:function(a){function b(b){if(!this.canceled&&a===this.query){var c=[].slice.call(arguments,1);this.cacheSuggestions(a,b,c),this._render.apply(this,[a,b].concat(c))}}if(this.query=a,this.canceled=!1,this.shouldFetchFromCache(a))b.apply(this,[this.cachedSuggestions].concat(this.cachedRenderExtraArgs));else{var c=this,d=function(){c.canceled||c.source(a,b.bind(c))};if(this.debounce){var e=function(){c.debounceTimeout=null,d()};clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(e,this.debounce)}else d()}},cacheSuggestions:function(a,b,c){this.cachedQuery=a,this.cachedSuggestions=b,this.cachedRenderExtraArgs=c},shouldFetchFromCache:function(a){return this.cache&&this.cachedQuery===a&&this.cachedSuggestions&&this.cachedSuggestions.length},clearCachedSuggestions:function(){delete this.cachedQuery,delete this.cachedSuggestions,delete this.cachedRenderExtraArgs},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered","")},isEmpty:function(){return this._isEmpty},destroy:function(){this.clearCachedSuggestions(),this.$el=null}}),a.exports=d},function(a,b){"use strict";a.exports={wrapper:'<span class="%ROOT%"></span>',dropdown:'<span class="%PREFIX%%DROPDOWN_MENU%"></span>',dataset:'<div class="%PREFIX%%DATASET%-%CLASS%"></div>',suggestions:'<span class="%PREFIX%%SUGGESTIONS%"></span>',suggestion:'<div class="%PREFIX%%SUGGESTION%"></div>'}},function(a,b,c){"use strict";var d=c(4),e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:"0"},defaultClasses:{root:"algolia-autocomplete",prefix:"aa",noPrefix:!1,dropdownMenu:"dropdown-menu",input:"input",hint:"hint",suggestions:"suggestions",suggestion:"suggestion",cursor:"cursor",dataset:"dataset",empty:"empty"},appendTo:{wrapper:{position:"absolute",zIndex:"100",display:"none"},input:{},inputWithNoHint:{},dropdown:{display:"block"}}};d.isMsie()&&d.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),d.isMsie()&&d.isMsie()<=7&&d.mixin(e.input,{marginTop:"-1px"}),a.exports=e},function(a,b,c){"use strict";a.exports={hits:c(21),popularIn:c(24)}},function(a,b,c){"use strict";var d=c(4),e=c(22),f=c(23);a.exports=function(a,b){function c(c,e){a.search(c,b,function(a,b){if(a)return void d.error(a.message);e(b.hits,b)})}var g=f(a.as._ua);return g&&g[0]>=3&&g[1]>20&&(b=b||{},b.additionalUA="autocomplete.js "+e),c}},function(a,b){a.exports="0.36.0"},function(a,b){"use strict";a.exports=function(a){var b=a.match(/Algolia for vanilla JavaScript (\d+\.)(\d+\.)(\d+)/);if(b)return[b[1],b[2],b[3]]}},function(a,b,c){"use strict";var d=c(4),e=c(22),f=c(23);a.exports=function(a,b,c,g){function h(h,i){a.search(h,b,function(a,h){if(a)return void d.error(a.message);if(h.hits.length>0){var l=h.hits[0],m=d.mixin({hitsPerPage:0},c);delete m.source,delete m.index;var n=f(k.as._ua);return n&&n[0]>=3&&n[1]>20&&(b.additionalUA="autocomplete.js "+e),void k.search(j(l),m,function(a,b){if(a)return void d.error(a.message);var c=[];if(g.includeAll){var e=g.allTitle||"All departments";c.push(d.mixin({facet:{value:e,count:b.nbHits}},d.cloneDeep(l)))}d.each(b.facets,function(a,b){d.each(a,function(a,e){c.push(d.mixin({facet:{facet:b,value:e,count:a}},d.cloneDeep(l)))})});for(var f=1;f<h.hits.length;++f)c.push(h.hits[f]);i(c,h)})}i([])})}var i=f(a.as._ua);if(i&&i[0]>=3&&i[1]>20&&(b=b||{},b.additionalUA="autocomplete.js "+e),!c.source)return d.error("Missing 'source' key");var j=d.isFunction(c.source)?c.source:function(a){return a[c.source]};if(!c.index)return d.error("Missing 'index' key");var k=c.index;return g=g||{},h}}])});;/*! InstantSearch.js 3.5.3 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch.js */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).instantsearch=t()}(this,function(){"use strict";function f(e){return(f="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 T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}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 d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function H(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(e){F(t,e,n[e])})}return t}function I(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&&a(e,t)}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t,n){return(i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&a(i,n.prototype),i}).apply(null,arguments)}function k(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?o(e):t}function U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function y(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")}()}var l=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e,t){return e(t={exports:{}},t.exports),t.exports}var s="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,N=s||c||Function("return this")(),u=N.Symbol,h=Object.prototype,p=h.hasOwnProperty,m=h.toString,v=u?u.toStringTag:void 0;var g=function(e){var t=p.call(e,v),n=e[v];try{var r=!(e[v]=void 0)}catch(e){}var i=m.call(e);return r&&(t?e[v]=n:delete e[v]),i},b=Object.prototype.toString;var w=function(e){return b.call(e)},R=u?u.toStringTag:void 0;var S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":R&&R in Object(e)?g(e):w(e)};var P=function(e){return null!=e&&"object"==typeof e};var _=function(e){return P(e)&&"[object Arguments]"==S(e)},x=Object.prototype,C=x.hasOwnProperty,E=x.propertyIsEnumerable,j=_(function(){return arguments}())?_:function(e){return P(e)&&C.call(e,"callee")&&!E.call(e,"callee")},A=Array.isArray;function D(){return!1}var B=n(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n?N.Buffer:void 0,a=(i?i.isBuffer:void 0)||D;e.exports=a}),V=/^(?:0|[1-9]\d*)$/;var Q=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&V.test(e))&&-1<e&&e%1==0&&e<t};var q=function(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=9007199254740991},W={};W["[object Float32Array]"]=W["[object Float64Array]"]=W["[object Int8Array]"]=W["[object Int16Array]"]=W["[object Int32Array]"]=W["[object Uint8Array]"]=W["[object Uint8ClampedArray]"]=W["[object Uint16Array]"]=W["[object Uint32Array]"]=!0,W["[object Arguments]"]=W["[object Array]"]=W["[object ArrayBuffer]"]=W["[object Boolean]"]=W["[object DataView]"]=W["[object Date]"]=W["[object Error]"]=W["[object Function]"]=W["[object Map]"]=W["[object Number]"]=W["[object Object]"]=W["[object RegExp]"]=W["[object Set]"]=W["[object String]"]=W["[object WeakMap]"]=!1;function z(e){return P(e)&&q(e.length)&&!!W[S(e)]}var K=function(t){return function(e){return t(e)}},Y=n(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&s.process,a=function(){try{var e=r&&r.require&&r.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}),$=Y&&Y.isTypedArray,G=$?K($):z,J=Object.prototype.hasOwnProperty;var Z=function(e,t){var n=A(e),r=!n&&j(e),i=!n&&!r&&B(e),a=!n&&!r&&!i&&G(e),s=n||r||i||a,o=s?l(e.length,String):[],c=o.length;for(var u in e)!t&&!J.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Q(u,c))||o.push(u);return o},X=Object.prototype;var ee=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)};var te=function(t,n){return function(e){return t(n(e))}},ne=te(Object.keys,Object),re=Object.prototype.hasOwnProperty;var ie=function(e){if(!ee(e))return ne(e);var t=[];for(var n in Object(e))re.call(e,n)&&"constructor"!=n&&t.push(n);return t};var ae=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var se=function(e){if(!ae(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var oe=function(e){return null!=e&&q(e.length)&&!se(e)};var ce=function(e){return oe(e)?Z(e):ie(e)};var ue,le=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},he=N["__core-js_shared__"],fe=(ue=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+ue:"";var de=function(e){return!!fe&&fe in e},pe=Function.prototype.toString;var me=function(e){if(null!=e){try{return pe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ve=/^\[object .+?Constructor\]$/,ge=Function.prototype,ye=Object.prototype,be=ge.toString,we=ye.hasOwnProperty,Re=RegExp("^"+be.call(we).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Se=function(e){return!(!ae(e)||de(e))&&(se(e)?Re:ve).test(me(e))};var Pe=function(e,t){return null==e?void 0:e[t]};var _e=function(e,t){var n=Pe(e,t);return Se(n)?n:void 0},Ne=_e(Object,"create");function xe(){this.__data__=Ne?Ne(null):{},this.size=0}function Ce(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Fe=Object.prototype.hasOwnProperty;function Ee(e){var t=this.__data__;if(Ne){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Fe.call(t,e)?t[e]:void 0}var je=Object.prototype.hasOwnProperty;function Te(e){var t=this.__data__;return Ne?void 0!==t[e]:je.call(t,e)}function Me(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ne&&void 0===t?"__lodash_hash_undefined__":t,this}function Ie(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ie.prototype.clear=xe,Ie.prototype.delete=Ce,Ie.prototype.get=Ee,Ie.prototype.has=Te,Ie.prototype.set=Me;var Le=Ie;function ke(){this.__data__=[],this.size=0}var Oe=function(e,t){return e===t||e!=e&&t!=t};var Ae=function(e,t){for(var n=e.length;n--;)if(Oe(e[n][0],t))return n;return-1},De=Array.prototype.splice;function He(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():De.call(t,n,1),--this.size,!0)}function Ue(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]}function Be(e){return-1<Ae(this.__data__,e)}function Ve(e,t){var n=this.__data__,r=Ae(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Qe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qe.prototype.clear=ke,Qe.prototype.delete=He,Qe.prototype.get=Ue,Qe.prototype.has=Be,Qe.prototype.set=Ve;var qe=Qe,We=_e(N,"Map");var ze=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ke=function(e,t){var n=e.__data__;return ze(t)?n["string"==typeof t?"string":"hash"]:n.map};function Ye(e){var t=Ke(this,e).delete(e);return this.size-=t?1:0,t}function $e(e){return Ke(this,e).get(e)}function Ge(e){return Ke(this,e).has(e)}function Je(e,t){var n=Ke(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ze(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ze.prototype.clear=function(){this.size=0,this.__data__={hash:new Le,map:new(We||qe),string:new Le}},Ze.prototype.delete=Ye,Ze.prototype.get=$e,Ze.prototype.has=Ge,Ze.prototype.set=Je;var Xe=Ze;function et(e){return this.__data__.has(e)}function tt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Xe;++t<n;)this.add(e[t])}tt.prototype.add=tt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},tt.prototype.has=et;var nt=tt;var rt=function(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1};function it(e){return e!=e}var at=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1};var st=function(e,t,n){return t==t?at(e,t,n):rt(e,it,n)};var ot=function(e,t){return!!(null==e?0:e.length)&&-1<st(e,t,0)};function ct(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var ut=function(e,t){return e.has(t)},lt=Math.min;var ht=function(e,t,n){for(var r=n?ct:ot,i=e[0].length,a=e.length,s=a,o=Array(a),c=1/0,u=[];s--;){var l=e[s];s&&t&&(l=le(l,K(t))),c=lt(l.length,c),o[s]=!n&&(t||120<=i&&120<=l.length)?new nt(s&&l):void 0}l=e[0];var h=-1,f=o[0];e:for(;++h<i&&u.length<c;){var d=l[h],p=t?t(d):d;if(d=n||0!==d?d:0,!(f?ut(f,p):r(u,p,n))){for(s=a;--s;){var m=o[s];if(!(m?ut(m,p):r(e[s],p,n)))continue e}f&&f.push(p),u.push(d)}}return u};function ft(e){return e}var dt=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},pt=Math.max;var mt=function(a,s,o){return s=pt(void 0===s?a.length-1:s,0),function(){for(var e=arguments,t=-1,n=pt(e.length-s,0),r=Array(n);++t<n;)r[t]=e[s+t];t=-1;for(var i=Array(s+1);++t<s;)i[t]=e[t];return i[s]=o(r),dt(a,this,i)}};var vt=function(e){return function(){return e}},gt=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),yt=gt?function(e,t){return gt(e,"toString",{configurable:!0,enumerable:!1,value:vt(t),writable:!0})}:ft,bt=Date.now;var wt=function(n){var r=0,i=0;return function(){var e=bt(),t=16-(e-i);if(i=e,0<t){if(800<=++r)return arguments[0]}else r=0;return n.apply(void 0,arguments)}},Rt=wt(yt);var St=function(e,t){return Rt(mt(e,t,ft),e+"")};var Pt=function(e){return P(e)&&oe(e)};function _t(e){return Pt(e)?e:[]}var Nt=St(function(e){var t=le(e,_t);return t.length&&t[0]===e[0]?ht(t):[]});var xt=function(c){return function(e,t,n){for(var r=-1,i=Object(e),a=n(e),s=a.length;s--;){var o=a[c?s:++r];if(!1===t(i[o],o,i))break}return e}}();var Ct=function(e,t){return e&&xt(e,t,ce)};var Ft=function(e){return"function"==typeof e?e:ft};var Et=function(e,t){return e&&Ct(e,Ft(t))};var jt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};var Tt=function(a,s){return function(e,t){if(null==e)return e;if(!oe(e))return a(e,t);for(var n=e.length,r=s?n:-1,i=Object(e);(s?r--:++r<n)&&!1!==t(i[r],r,i););return e}}(Ct);var Mt=function(e,t){return(A(e)?jt:Tt)(e,Ft(t))};var It=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var s=e[n];t(s,n,e)&&(a[i++]=s)}return a};function Lt(e,r){var i=[];return Tt(e,function(e,t,n){r(e,t,n)&&i.push(e)}),i}function kt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Ot(e){return this.__data__.get(e)}function At(e){return this.__data__.has(e)}function Dt(e,t){var n=this.__data__;if(n instanceof qe){var r=n.__data__;if(!We||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xe(r)}return n.set(e,t),this.size=n.size,this}function Ht(e){var t=this.__data__=new qe(e);this.size=t.size}Ht.prototype.clear=function(){this.__data__=new qe,this.size=0},Ht.prototype.delete=kt,Ht.prototype.get=Ot,Ht.prototype.has=At,Ht.prototype.set=Dt;var Ut=Ht;var Bt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var Vt=function(e,t,n,r,i,a){var s=1&n,o=e.length,c=t.length;if(o!=c&&!(s&&o<c))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var l=-1,h=!0,f=2&n?new nt:void 0;for(a.set(e,t),a.set(t,e);++l<o;){var d=e[l],p=t[l];if(r)var m=s?r(p,d,l,t,e,a):r(d,p,l,e,t,a);if(void 0!==m){if(m)continue;h=!1;break}if(f){if(!Bt(t,function(e,t){if(!ut(f,t)&&(d===e||i(d,e,n,r,a)))return f.push(t)})){h=!1;break}}else if(d!==p&&!i(d,p,n,r,a)){h=!1;break}}return a.delete(e),a.delete(t),h},Qt=N.Uint8Array;function qt(e){var n=-1,r=Array(e.size);return e.forEach(function(e,t){r[++n]=[t,e]}),r}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var zt=u?u.prototype:void 0,Kt=zt?zt.valueOf:void 0;var Yt=function(e,t,n,r,i,a,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new Qt(e),new Qt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Oe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=qt;case"[object Set]":var c=1&r;if(o||(o=Wt),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var l=Vt(o(e),o(t),r,i,a,s);return s.delete(e),l;case"[object Symbol]":if(Kt)return Kt.call(e)==Kt.call(t)}return!1};var $t=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e};var Gt=function(e,t,n){var r=t(e);return A(e)?r:$t(r,n(e))};function Jt(){return[]}var Zt=Object.prototype.propertyIsEnumerable,Xt=Object.getOwnPropertySymbols,en=Xt?function(t){return null==t?[]:(t=Object(t),It(Xt(t),function(e){return Zt.call(t,e)}))}:Jt;var tn=function(e){return Gt(e,ce,en)},nn=Object.prototype.hasOwnProperty;var rn=function(e,t,n,r,i,a){var s=1&n,o=tn(e),c=o.length;if(c!=tn(t).length&&!s)return!1;for(var u=c;u--;){var l=o[u];if(!(s?l in t:nn.call(t,l)))return!1}var h=a.get(e);if(h&&a.get(t))return h==t;var f=!0;a.set(e,t),a.set(t,e);for(var d=s;++u<c;){var p=e[l=o[u]],m=t[l];if(r)var v=s?r(m,p,l,t,e,a):r(p,m,l,e,t,a);if(!(void 0===v?p===m||i(p,m,n,r,a):v)){f=!1;break}d||(d="constructor"==l)}if(f&&!d){var g=e.constructor,y=t.constructor;g!=y&&"constructor"in e&&"constructor"in t&&!("function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y)&&(f=!1)}return a.delete(e),a.delete(t),f},an=_e(N,"DataView"),sn=_e(N,"Promise"),on=_e(N,"Set"),cn=_e(N,"WeakMap"),un="[object Map]",ln="[object Promise]",hn="[object Set]",fn="[object WeakMap]",dn="[object DataView]",pn=me(an),mn=me(We),vn=me(sn),gn=me(on),yn=me(cn),bn=S;(an&&bn(new an(new ArrayBuffer(1)))!=dn||We&&bn(new We)!=un||sn&&bn(sn.resolve())!=ln||on&&bn(new on)!=hn||cn&&bn(new cn)!=fn)&&(bn=function(e){var t=S(e),n="[object Object]"==t?e.constructor:void 0,r=n?me(n):"";if(r)switch(r){case pn:return dn;case mn:return un;case vn:return ln;case gn:return hn;case yn:return fn}return t});var wn=bn,Rn="[object Arguments]",Sn="[object Array]",Pn="[object Object]",_n=Object.prototype.hasOwnProperty;var Nn=function(e,t,n,r,i,a){var s=A(e),o=A(t),c=s?Sn:wn(e),u=o?Sn:wn(t),l=(c=c==Rn?Pn:c)==Pn,h=(u=u==Rn?Pn:u)==Pn,f=c==u;if(f&&B(e)){if(!B(t))return!1;l=!(s=!0)}if(f&&!l)return a||(a=new Ut),s||G(e)?Vt(e,t,n,r,i,a):Yt(e,t,c,n,r,i,a);if(!(1&n)){var d=l&&_n.call(e,"__wrapped__"),p=h&&_n.call(t,"__wrapped__");if(d||p){var m=d?e.value():e,v=p?t.value():t;return a||(a=new Ut),i(m,v,n,r,a)}}return f&&(a||(a=new Ut),rn(e,t,n,r,i,a))};var xn=function e(t,n,r,i,a){return t===n||(null==t||null==n||!P(t)&&!P(n)?t!=t&&n!=n:Nn(t,n,r,i,e,a))};var Cn=function(e,t,n,r){var i=n.length,a=i,s=!r;if(null==e)return!a;for(e=Object(e);i--;){var o=n[i];if(s&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<a;){var c=(o=n[i])[0],u=e[c],l=o[1];if(s&&o[2]){if(void 0===u&&!(c in e))return!1}else{var h=new Ut;if(r)var f=r(u,l,c,e,t,h);if(!(void 0===f?xn(l,u,3,r,h):f))return!1}}return!0};var Fn=function(e){return e==e&&!ae(e)};var En=function(e){for(var t=ce(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Fn(i)]}return t};var jn=function(t,n){return function(e){return null!=e&&(e[t]===n&&(void 0!==n||t in Object(e)))}};var Tn=function(t){var n=En(t);return 1==n.length&&n[0][2]?jn(n[0][0],n[0][1]):function(e){return e===t||Cn(e,t,n)}};var Mn=function(e){return"symbol"==typeof e||P(e)&&"[object Symbol]"==S(e)},In=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ln=/^\w*$/;var kn=function(e,t){if(A(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Mn(e))||(Ln.test(e)||!In.test(e)||null!=t&&e in Object(t))},On="Expected a function";function An(i,a){if("function"!=typeof i||null!=a&&"function"!=typeof a)throw new TypeError(On);var s=function(){var e=arguments,t=a?a.apply(this,e):e[0],n=s.cache;if(n.has(t))return n.get(t);var r=i.apply(this,e);return s.cache=n.set(t,r)||n,r};return s.cache=new(An.Cache||Xe),s}An.Cache=Xe;var Dn=An;var Hn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Un=/\\(\\)?/g,Bn=function(e){var t=Dn(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var i=[];return 46===e.charCodeAt(0)&&i.push(""),e.replace(Hn,function(e,t,n,r){i.push(n?r.replace(Un,"$1"):t||e)}),i}),Vn=1/0,Qn=u?u.prototype:void 0,qn=Qn?Qn.toString:void 0;var Wn=function e(t){if("string"==typeof t)return t;if(A(t))return le(t,e)+"";if(Mn(t))return qn?qn.call(t):"";var n=t+"";return"0"==n&&1/t==-Vn?"-0":n};var zn=function(e){return null==e?"":Wn(e)};var Kn=function(e,t){return A(e)?e:kn(e,t)?[e]:Bn(zn(e))};var Yn=function(e){if("string"==typeof e||Mn(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var $n=function(e,t){for(var n=0,r=(t=Kn(t,e)).length;null!=e&&n<r;)e=e[Yn(t[n++])];return n&&n==r?e:void 0};var Gn=function(e,t,n){var r=null==e?void 0:$n(e,t);return void 0===r?n:r};function Jn(e,t){return null!=e&&t in Object(e)}var Zn=function(e,t,n){for(var r=-1,i=(t=Kn(t,e)).length,a=!1;++r<i;){var s=Yn(t[r]);if(!(a=null!=e&&n(e,s)))break;e=e[s]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&q(i)&&Q(s,i)&&(A(e)||j(e))};var Xn=function(e,t){return null!=e&&Zn(e,t,Jn)};var er=function(n,r){return kn(n)&&Fn(r)?jn(Yn(n),r):function(e){var t=Gn(e,n);return void 0===t&&t===r?Xn(e,n):xn(r,t,3)}};var tr=function(t){return function(e){return null==e?void 0:e[t]}};var nr=function(t){return function(e){return $n(e,t)}};var rr=function(e){return kn(e)?tr(Yn(e)):nr(e)};var ir=function(e){return"function"==typeof e?e:null==e?ft:"object"==typeof e?A(e)?er(e[0],e[1]):Tn(e):rr(e)};var ar=function(e,t){return(A(e)?It:Lt)(e,ir(t,3))};var sr=function(e,r){var i=-1,a=oe(e)?Array(e.length):[];return Tt(e,function(e,t,n){a[++i]=r(e,t,n)}),a};var or=function(e,t){return(A(e)?le:sr)(e,ir(t,3))};function cr(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function ur(e,r,i,a,t){return t(e,function(e,t,n){i=a?(a=!1,e):r(i,e,t,n)}),i}var lr=function(e,t,n){var r=A(e)?cr:ur,i=arguments.length<3;return r(e,ir(t,4),n,i,Tt)};var hr=function(e,t,n){"__proto__"==t&&gt?gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},fr=Object.prototype.hasOwnProperty;var dr=function(e,t,n){var r=e[t];fr.call(e,t)&&Oe(r,n)&&(void 0!==n||t in e)||hr(e,t,n)};var pr=function(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var o=t[a],c=r?r(n[o],e[o],o,n,e):void 0;void 0===c&&(c=e[o]),i?hr(n,o,c):dr(n,o,c)}return n};var mr=function(e,t){return e&&pr(t,ce(t),e)};var vr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},gr=Object.prototype.hasOwnProperty;var yr=function(e){if(!ae(e))return vr(e);var t=ee(e),n=[];for(var r in e)("constructor"!=r||!t&&gr.call(e,r))&&n.push(r);return n};var br=function(e){return oe(e)?Z(e,!0):yr(e)};var wr=function(e,t){return e&&pr(t,br(t),e)},Rr=n(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n?N.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}});var Sr=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Pr=function(e,t){return pr(e,en(e),t)},_r=te(Object.getPrototypeOf,Object),Nr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)$t(t,en(e)),e=_r(e);return t}:Jt;var xr=function(e,t){return pr(e,Nr(e),t)};var Cr=function(e){return Gt(e,br,Nr)},Fr=Object.prototype.hasOwnProperty;var Er=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Fr.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var jr=function(e){var t=new e.constructor(e.byteLength);return new Qt(t).set(new Qt(e)),t};var Tr=function(e,t){var n=t?jr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Mr=/\w*$/;var Ir=function(e){var t=new e.constructor(e.source,Mr.exec(e));return t.lastIndex=e.lastIndex,t},Lr=u?u.prototype:void 0,kr=Lr?Lr.valueOf:void 0;var Or=function(e){return kr?Object(kr.call(e)):{}};var Ar=function(e,t){var n=t?jr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Dr=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return jr(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Tr(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ar(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Ir(e);case"[object Set]":return new r;case"[object Symbol]":return Or(e)}},Hr=Object.create;function Ur(){}var Br=function(e){if(!ae(e))return{};if(Hr)return Hr(e);Ur.prototype=e;var t=new Ur;return Ur.prototype=void 0,t};var Vr=function(e){return"function"!=typeof e.constructor||ee(e)?{}:Br(_r(e))};function Qr(e){return P(e)&&"[object Map]"==wn(e)}var qr=Y&&Y.isMap,Wr=qr?K(qr):Qr;function zr(e){return P(e)&&"[object Set]"==wn(e)}var Kr=Y&&Y.isSet,Yr=Kr?K(Kr):zr,$r=1,Gr=2,Jr=4,Zr="[object Arguments]",Xr="[object Function]",ei="[object GeneratorFunction]",ti="[object Object]",ni={};ni[Zr]=ni["[object Array]"]=ni["[object ArrayBuffer]"]=ni["[object DataView]"]=ni["[object Boolean]"]=ni["[object Date]"]=ni["[object Float32Array]"]=ni["[object Float64Array]"]=ni["[object Int8Array]"]=ni["[object Int16Array]"]=ni["[object Int32Array]"]=ni["[object Map]"]=ni["[object Number]"]=ni[ti]=ni["[object RegExp]"]=ni["[object Set]"]=ni["[object String]"]=ni["[object Symbol]"]=ni["[object Uint8Array]"]=ni["[object Uint8ClampedArray]"]=ni["[object Uint16Array]"]=ni["[object Uint32Array]"]=!0,ni["[object Error]"]=ni[Xr]=ni["[object WeakMap]"]=!1;var ri=function n(r,i,a,e,t,s){var o,c=i&$r,u=i&Gr,l=i&Jr;if(a&&(o=t?a(r,e,t,s):a(r)),void 0!==o)return o;if(!ae(r))return r;var h=A(r);if(h){if(o=Er(r),!c)return Sr(r,o)}else{var f=wn(r),d=f==Xr||f==ei;if(B(r))return Rr(r,c);if(f==ti||f==Zr||d&&!t){if(o=u||d?{}:Vr(r),!c)return u?xr(r,wr(o,r)):Pr(r,mr(o,r))}else{if(!ni[f])return t?r:{};o=Dr(r,f,c)}}s||(s=new Ut);var p=s.get(r);if(p)return p;if(s.set(r,o),Yr(r))return r.forEach(function(e){o.add(n(e,i,a,e,r,s))}),o;if(Wr(r))return r.forEach(function(e,t){o.set(t,n(e,i,a,t,r,s))}),o;var m=l?u?Cr:tn:u?keysIn:ce,v=h?void 0:m(r);return jt(v||r,function(e,t){v&&(e=r[t=e]),dr(o,t,n(e,i,a,t,r,s))}),o};var ii=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var ai=function(e,t,n){var r=-1,i=e.length;t<0&&(t=i<-t?0:i+t),(n=i<n?i:n)<0&&(n+=i),i=n<t?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a};var si=function(e,t){return t.length<2?e:$n(e,ai(t,0,-1))};var oi=function(e,t){return t=Kn(t,e),null==(e=si(e,t))||delete e[Yn(ii(t))]},ci=Function.prototype,ui=Object.prototype,li=ci.toString,hi=ui.hasOwnProperty,fi=li.call(Object);var di=function(e){if(!P(e)||"[object Object]"!=S(e))return!1;var t=_r(e);if(null===t)return!0;var n=hi.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&li.call(n)==fi};function pi(e){return di(e)?void 0:e}var mi=u?u.isConcatSpreadable:void 0;var vi=function(e){return A(e)||j(e)||!!(mi&&e&&e[mi])};var gi=function e(t,n,r,i,a){var s=-1,o=t.length;for(r||(r=vi),a||(a=[]);++s<o;){var c=t[s];0<n&&r(c)?1<n?e(c,n-1,r,i,a):$t(a,c):i||(a[a.length]=c)}return a};var yi=function(e){return(null==e?0:e.length)?gi(e,1):[]};var bi=function(e){return Rt(mt(e,void 0,yi),e+"")},wi=bi(function(t,e){var n={};if(null==t)return n;var r=!1;e=le(e,function(e){return e=Kn(e,t),r||(r=1<e.length),e}),pr(t,Cr(t),n),r&&(n=ri(n,7,pi));for(var i=e.length;i--;)oi(n,e[i]);return n}),Ri=/^\s+|\s+$/g,Si=/^[-+]0x[0-9a-f]+$/i,Pi=/^0b[01]+$/i,_i=/^0o[0-7]+$/i,Ni=parseInt;var xi=function(e){if("number"==typeof e)return e;if(Mn(e))return NaN;if(ae(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ae(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ri,"");var n=Pi.test(e);return n||_i.test(e)?Ni(e.slice(2),n?2:8):Si.test(e)?NaN:+e};var Ci=function(e){return e?(e=xi(e))!==1/0&&e!==-1/0?e==e?e:0:17976931348623157e292*(e<0?-1:1):0===e?e:0};var Fi=function(e){var t=Ci(e),n=t%1;return t==t?n?t-n:t:0},Ei=Math.max;var ji=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Fi(n);return i<0&&(i=Ei(r+i,0)),st(e,t,i)};var Ti=function(e){return"number"==typeof e||P(e)&&"[object Number]"==S(e)};var Mi=function(e){return Ti(e)&&e!=+e},Ii=Object.prototype.hasOwnProperty;var Li=function(e){if(null==e)return!0;if(oe(e)&&(A(e)||"string"==typeof e||"function"==typeof e.splice||B(e)||G(e)||j(e)))return!e.length;var t=wn(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ee(e))return!ie(e).length;for(var n in e)if(Ii.call(e,n))return!1;return!0};var ki=function(e,t){return xn(e,t)};var Oi=function(e){return void 0===e};var Ai=function(e){return"string"==typeof e||!A(e)&&P(e)&&"[object String]"==S(e)};var Di=function(s){return function(e,t,n){var r=Object(e);if(!oe(e)){var i=ir(t,3);e=ce(e),t=function(e){return i(r[e],e,r)}}var a=s(e,t,n);return-1<a?r[i?e[a]:a]:void 0}},Hi=Math.max;var Ui=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Fi(n);return i<0&&(i=Hi(r+i,0)),rt(e,ir(t,3),i)},Bi=Di(Ui);var Vi=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&r<=n?e:ai(e,t,n)};var Qi=function(e,t){for(var n=e.length;n--&&-1<st(t,e[n],0););return n};var qi=function(e,t){for(var n=-1,r=e.length;++n<r&&-1<st(t,e[n],0););return n};var Wi=function(e){return e.split("")},zi=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Ki=function(e){return zi.test(e)},Yi="\\ud800-\\udfff",$i="["+Yi+"]",Gi="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ji="\\ud83c[\\udffb-\\udfff]",Zi="[^"+Yi+"]",Xi="(?:\\ud83c[\\udde6-\\uddff]){2}",ea="[\\ud800-\\udbff][\\udc00-\\udfff]",ta="(?:"+Gi+"|"+Ji+")"+"?",na="[\\ufe0e\\ufe0f]?",ra=na+ta+("(?:\\u200d(?:"+[Zi,Xi,ea].join("|")+")"+na+ta+")*"),ia="(?:"+[Zi+Gi+"?",Gi,Xi,ea,$i].join("|")+")",aa=RegExp(Ji+"(?="+Ji+")|"+ia+ra,"g");var sa=function(e){return e.match(aa)||[]};var oa=function(e){return Ki(e)?sa(e):Wi(e)},ca=/^\s+|\s+$/g;var ua=function(e,t,n){if((e=zn(e))&&(n||void 0===t))return e.replace(ca,"");if(!e||!(t=Wn(t)))return e;var r=oa(e),i=oa(t),a=qi(r,i),s=Qi(r,i)+1;return Vi(r,a,s).join("")};var la=function(e,t,n){if(!ae(n))return!1;var r=typeof t;return!!("number"==r?oe(n)&&Q(t,n.length):"string"==r&&t in n)&&Oe(n[t],e)},ha=Object.prototype,fa=ha.hasOwnProperty,da=St(function(e,t){e=Object(e);var n=-1,r=t.length,i=2<r?t[2]:void 0;for(i&&la(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],s=br(a),o=-1,c=s.length;++o<c;){var u=s[o],l=e[u];(void 0===l||Oe(l,ha[u])&&!fa.call(e,u))&&(e[u]=a[u])}return e});var pa=function(e,t,n){(void 0===n||Oe(e[t],n))&&(void 0!==n||t in e)||hr(e,t,n)};var ma=function(e,t){if("__proto__"!=t)return e[t]};var va=function(e){return pr(e,br(e))};var ga=function(e,t,n,r,i,a,s){var o=ma(e,n),c=ma(t,n),u=s.get(c);if(u)pa(e,n,u);else{var l=a?a(o,c,n+"",e,t,s):void 0,h=void 0===l;if(h){var f=A(c),d=!f&&B(c),p=!f&&!d&&G(c);l=c,f||d||p?l=A(o)?o:Pt(o)?Sr(o):d?Rr(c,!(h=!1)):p?Ar(c,!(h=!1)):[]:di(c)||j(c)?j(l=o)?l=va(o):ae(o)&&!se(o)||(l=Vr(c)):h=!1}h&&(s.set(c,l),i(l,c,r,a,s),s.delete(c)),pa(e,n,l)}};var ya=function r(i,a,s,o,c){i!==a&&xt(a,function(e,t){if(ae(e))c||(c=new Ut),ga(i,a,t,s,r,o,c);else{var n=o?o(ma(i,t),e,t+"",i,a,c):void 0;void 0===n&&(n=e),pa(i,t,n)}},br)};var ba=function(o){return St(function(e,t){var n=-1,r=t.length,i=1<r?t[r-1]:void 0,a=2<r?t[2]:void 0;for(i=3<o.length&&"function"==typeof i?(r--,i):void 0,a&&la(t[0],t[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var s=t[n];s&&o(e,s,n,i)}return e})}(function(e,t,n){ya(e,t,n)});var wa=function e(t){if(Ti(t))return t;if(Ai(t))return parseFloat(t);if(Array.isArray(t))return or(t,e);throw new Error("The value should be a number, a parseable string or an array of those.")};var Ra=function(n,e){var r={},t=ar(e,function(e){return-1!==e.indexOf("attribute:")}),i=or(t,function(e){return e.split(":")[1]});-1===ji(i,"*")?Mt(i,function(e){n.isConjunctiveFacet(e)&&n.isFacetRefined(e)&&(r.facetsRefinements||(r.facetsRefinements={}),r.facetsRefinements[e]=n.facetsRefinements[e]),n.isDisjunctiveFacet(e)&&n.isDisjunctiveFacetRefined(e)&&(r.disjunctiveFacetsRefinements||(r.disjunctiveFacetsRefinements={}),r.disjunctiveFacetsRefinements[e]=n.disjunctiveFacetsRefinements[e]),n.isHierarchicalFacet(e)&&n.isHierarchicalFacetRefined(e)&&(r.hierarchicalFacetsRefinements||(r.hierarchicalFacetsRefinements={}),r.hierarchicalFacetsRefinements[e]=n.hierarchicalFacetsRefinements[e]);var t=n.getNumericRefinements(e);Li(t)||(r.numericRefinements||(r.numericRefinements={}),r.numericRefinements[e]=n.numericRefinements[e])}):(Li(n.numericRefinements)||(r.numericRefinements=n.numericRefinements),Li(n.facetsRefinements)||(r.facetsRefinements=n.facetsRefinements),Li(n.disjunctiveFacetsRefinements)||(r.disjunctiveFacetsRefinements=n.disjunctiveFacetsRefinements),Li(n.hierarchicalFacetsRefinements)||(r.hierarchicalFacetsRefinements=n.hierarchicalFacetsRefinements));var a=ar(e,function(e){return-1===e.indexOf("attribute:")});return Mt(a,function(e){r[e]=n[e]}),r},Sa={addRefinement:function(e,t,n){if(Sa.isRefined(e,t,n))return e;var r=""+n,i=e[t]?e[t].concat(r):[r],a={};return a[t]=i,da({},a,e)},removeRefinement:function(e,n,t){if(Oi(t))return Sa.clearRefinement(e,n);var r=""+t;return Sa.clearRefinement(e,function(e,t){return n===t&&r===e})},toggleRefinement:function(e,t,n){if(Oi(n))throw new Error("toggleRefinement should be used with a value");return Sa.isRefined(e,t,n)?Sa.removeRefinement(e,t,n):Sa.addRefinement(e,t,n)},clearRefinement:function(e,i,a){if(Oi(i))return Li(e)?e:{};if(Ai(i))return Li(e[i])?e:wi(e,i);if(se(i)){var s=!1,t=lr(e,function(e,t,n){var r=ar(t,function(e){return!i(e,n,a)});return Li(r)?s=!0:(r.length!==t.length&&(s=!0),e[n]=r),e},{});return s?t:e}},isRefined:function(e,t,n){var r=ji,i=!!e[t]&&0<e[t].length;if(Oi(n)||!i)return i;var a=""+n;return-1!==r(e[t],a)}},Pa=Sa;function _a(e){var t=e?_a._parseNumbers(e):{};this.index=t.index||"",this.query=t.query||"",this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{},this.numericFilters=t.numericFilters,this.tagFilters=t.tagFilters,this.optionalTagFilters=t.optionalTagFilters,this.optionalFacetFilters=t.optionalFacetFilters,this.hitsPerPage=t.hitsPerPage,this.maxValuesPerFacet=t.maxValuesPerFacet,this.page=t.page||0,this.queryType=t.queryType,this.typoTolerance=t.typoTolerance,this.minWordSizefor1Typo=t.minWordSizefor1Typo,this.minWordSizefor2Typos=t.minWordSizefor2Typos,this.minProximity=t.minProximity,this.allowTyposOnNumericTokens=t.allowTyposOnNumericTokens,this.ignorePlurals=t.ignorePlurals,this.restrictSearchableAttributes=t.restrictSearchableAttributes,this.advancedSyntax=t.advancedSyntax,this.analytics=t.analytics,this.analyticsTags=t.analyticsTags,this.synonyms=t.synonyms,this.replaceSynonymsInHighlight=t.replaceSynonymsInHighlight,this.optionalWords=t.optionalWords,this.removeWordsIfNoResults=t.removeWordsIfNoResults,this.attributesToRetrieve=t.attributesToRetrieve,this.attributesToHighlight=t.attributesToHighlight,this.highlightPreTag=t.highlightPreTag,this.highlightPostTag=t.highlightPostTag,this.attributesToSnippet=t.attributesToSnippet,this.getRankingInfo=t.getRankingInfo,this.distinct=t.distinct,this.aroundLatLng=t.aroundLatLng,this.aroundLatLngViaIP=t.aroundLatLngViaIP,this.aroundRadius=t.aroundRadius,this.minimumAroundRadius=t.minimumAroundRadius,this.aroundPrecision=t.aroundPrecision,this.insideBoundingBox=t.insideBoundingBox,this.insidePolygon=t.insidePolygon,this.snippetEllipsisText=t.snippetEllipsisText,this.disableExactOnAttributes=t.disableExactOnAttributes,this.enableExactOnSingleWordQuery=t.enableExactOnSingleWordQuery,this.offset=t.offset,this.length=t.length;var n=this;Et(t,function(e,t){-1===_a.PARAMETERS.indexOf(t)&&(n[t]=e)})}_a.PARAMETERS=ce(new _a),_a._parseNumbers=function(r){if(r instanceof _a)return r;var i={};if(Mt(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"],function(e){var t=r[e];if(Ai(t)){var n=parseFloat(t);i[e]=Mi(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={};Mt(r.numericRefinements,function(e,r){a[r]={},Mt(e,function(e,t){var n=or(e,function(e){return Array.isArray(e)?or(e,function(e){return Ai(e)?parseFloat(e):e}):Ai(e)?parseFloat(e):e});a[r][t]=n})}),i.numericRefinements=a}return ba({},r,i)},_a.make=function(e){var n=new _a(e);return Mt(e.hierarchicalFacets,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},_a.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&&!Li(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."):!Li(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},_a.prototype={constructor:_a,clearRefinements:function(e){var t=Pa.clearRefinement,n={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:t(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:t(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:t(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:t(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return n.numericRefinements===this.numericRefinements&&n.facetsRefinements===this.facetsRefinements&&n.facetsExcludes===this.facetsExcludes&&n.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&n.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(n)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r=wa(n);if(this.isNumericRefined(e,t,r))return this;var i=ba({},this.numericRefinements);return i[e]=ba({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(r)):i[e][t]=[r],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsExcludes[e]||[]},removeNumericRefinement:function(n,r,e){if(void 0===e)return void 0!==r?this.isNumericRefined(n,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r})}):this:this.isNumericRefined(n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n})}):this;var i=wa(e);return this.isNumericRefined(n,r,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r&&ki(e.val,i)})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(a){if(Oi(a))return Li(this.numericRefinements)?this.numericRefinements:{};if(Ai(a))return Li(this.numericRefinements[a])?this.numericRefinements:wi(this.numericRefinements,a);if(se(a)){var s=!1,e=lr(this.numericRefinements,function(e,t,r){var i={};return Mt(t,function(e,t){var n=[];Mt(e,function(e){a({val:e,op:t},r,"numeric")||n.push(e)}),Li(n)?s=!0:(n.length!==e.length&&(s=!0),i[t]=n)}),Li(i)||(e[r]=i),e},{});return s?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 Pa.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:Pa.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 Pa.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:Pa.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 Pa.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:Pa.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:ar(this.facets,function(e){return e!==t})}):this},removeDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({disjunctiveFacets:ar(this.disjunctiveFacets,function(e){return e!==t})}):this},removeHierarchicalFacet:function(t){return this.isHierarchicalFacet(t)?this.clearRefinements(t).setQueryParameters({hierarchicalFacets:ar(this.hierarchicalFacets,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 Pa.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:Pa.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 Pa.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:Pa.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 Pa.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:Pa.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(t){if(!this.isTagRefined(t))return this;var e={tagRefinements:ar(this.tagRefinements,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:Pa.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:Pa.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:Pa.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)),r={};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)?r[e]=[]:r[e]=[t.slice(0,t.lastIndexOf(n))]:r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:da({},r,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");var n={};return n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:da({},n,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))throw new Error(e+" is not refined.");var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:da({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return-1<ji(this.disjunctiveFacets,e)},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return-1<ji(this.facets,e)},isFacetRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Pa.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Pa.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return Pa.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined: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.getHierarchicalRefinement(e);return t?-1!==ji(n,t):0<n.length},isNumericRefined:function(e,t,n){if(Oi(n)&&Oi(t))return!!this.numericRefinements[e];var r=this.numericRefinements[e]&&!Oi(this.numericRefinements[e][t]);if(Oi(n)||!r)return r;var i=wa(n),a=!Oi(function(e,t){return Bi(e,function(e){return ki(e,t)})}(this.numericRefinements[e][t],i));return r&&a},isTagRefined:function(e){return-1!==ji(this.tagRefinements,e)},getRefinedDisjunctiveFacets:function(){var e=Nt(ce(this.numericRefinements),this.disjunctiveFacets);return ce(this.disjunctiveFacetsRefinements).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){return Nt(or(this.hierarchicalFacets,"name"),ce(this.hierarchicalFacetsRefinements))},getUnrefinedDisjunctiveFacets:function(){var t=this.getRefinedDisjunctiveFacets();return ar(this.disjunctiveFacets,function(e){return-1===ji(t,e)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var n=this.managedParameters,r={};return Et(this,function(e,t){-1===ji(n,t)&&void 0!==e&&(r[t]=e)}),r},getQueryParameter:function(e){if(!this.hasOwnProperty(e))throw new Error("Parameter '"+e+"' is not an attribute of SearchParameters (http://algolia.github.io/algoliasearch-helper-js/docs/SearchParameters.html)");return this[e]},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(n){if(!n)return this;var e=_a.validate(this,n);if(e)throw e;var r=_a._parseNumbers(n);return this.mutateMe(function(t){var e=ce(n);return Mt(e,function(e){t[e]=r[e]}),t})},filter:function(e){return Ra(this,e)},mutateMe:function(e){var t=new this.constructor(this);return e(t,this),t},_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(e){return Bi(this.hierarchicalFacets,{name:e})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))throw new Error("Cannot get the breadcrumb of an unknown hierarchical facet: `"+e+"`");var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r=t.split(n);return or(r,ua)},toString:function(){return JSON.stringify(this,null,2)}};var Na=_a;var xa=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i};var Ca=function(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);void 0!==a&&(n=void 0===n?a:n+a)}return n};var Fa=function(e,t){return e&&e.length?Ca(e,ir(t,2)):0};var Ea=function(t,e){return le(e,function(e){return t[e]})};var ja=function(e){return null==e?[]:Ea(e,ce(e))},Ta=Math.max;var Ma=function(e,t,n,r){e=oe(e)?e:ja(e),n=n&&!r?Fi(n):0;var i=e.length;return n<0&&(n=Ta(i+n,0)),Ai(e)?n<=i&&-1<e.indexOf(t,n):!!i&&-1<st(e,t,n)};var Ia=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e};var La=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,a=Mn(e),s=void 0!==t,o=null===t,c=t==t,u=Mn(t);if(!o&&!u&&!a&&t<e||a&&s&&c&&!o&&!u||r&&s&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||o&&n&&i||!s&&i||!c)return-1}return 0};var ka=function(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,s=i.length,o=n.length;++r<s;){var c=La(i[r],a[r]);if(c)return o<=r?c:c*("desc"==n[r]?-1:1)}return e.index-t.index};var Oa=function(e,r,n){var i=-1;r=le(r.length?r:[ft],K(ir));var t=sr(e,function(t,e,n){return{criteria:le(r,function(e){return e(t)}),index:++i,value:t}});return Ia(t,function(e,t){return ka(e,t,n)})};var Aa=function(e,t,n,r){return null==e?[]:(A(t)||(t=null==t?[]:[t]),A(n=r?void 0:n)||(n=null==n?[]:[n]),Oa(e,t,n))},Da=cn&&new cn,Ha=Da?function(e,t){return Da.set(e,t),e}:ft;var Ua=function(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Br(r.prototype),n=r.apply(t,e);return ae(n)?n:t}};var Ba=function(t,e,n){var r=1&e,i=Ua(t);return function e(){return(this&&this!==N&&this instanceof e?i:t).apply(r?n:this,arguments)}},Va=Math.max;var Qa=function(e,t,n,r){for(var i=-1,a=e.length,s=n.length,o=-1,c=t.length,u=Va(a-s,0),l=Array(c+u),h=!r;++o<c;)l[o]=t[o];for(;++i<s;)(h||i<a)&&(l[n[i]]=e[i]);for(;u--;)l[o++]=e[i++];return l},qa=Math.max;var Wa=function(e,t,n,r){for(var i=-1,a=e.length,s=-1,o=n.length,c=-1,u=t.length,l=qa(a-o,0),h=Array(l+u),f=!r;++i<l;)h[i]=e[i];for(var d=i;++c<u;)h[d+c]=t[c];for(;++s<o;)(f||i<a)&&(h[d+n[s]]=e[i++]);return h};var za=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r};function Ka(){}function Ya(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}var $a=(Ya.prototype=Br(Ka.prototype)).constructor=Ya;var Ga=Da?function(e){return Da.get(e)}:function(){},Ja={},Za=Object.prototype.hasOwnProperty;var Xa=function(e){for(var t=e.name+"",n=Ja[t],r=Za.call(Ja,t)?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==e)return i.name}return t};function es(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}var ts=(es.prototype=Br(Ka.prototype)).constructor=es;var ns=function(e){if(e instanceof $a)return e.clone();var t=new ts(e.__wrapped__,e.__chain__);return t.__actions__=Sr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t},rs=Object.prototype.hasOwnProperty;function is(e){if(P(e)&&!A(e)&&!(e instanceof $a)){if(e instanceof ts)return e;if(rs.call(e,"__wrapped__"))return ns(e)}return new ts(e)}var as=(is.prototype=Ka.prototype).constructor=is;var ss=function(e){var t=Xa(e),n=as[t];if("function"!=typeof n||!(t in $a.prototype))return!1;if(e===n)return!0;var r=Ga(n);return!!r&&e===r[0]},os=wt(Ha),cs=/\{\n\/\* \[wrapped with (.+)\] \*/,us=/,? & /;var ls=function(e){var t=e.match(cs);return t?t[1].split(us):[]},hs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var fs=function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(1<n?"& ":"")+t[r],t=t.join(2<n?", ":" "),e.replace(hs,"{\n/* [wrapped with "+t+"] */\n")},ds=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var ps=function(n,r){return jt(ds,function(e){var t="_."+e[0];r&e[1]&&!ot(n,t)&&n.push(t)}),n.sort()};var ms=function(e,t,n){var r=t+"";return Rt(e,fs(r,ps(ls(r),n)))};var vs=function(e,t,n,r,i,a,s,o,c,u){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var h=[e,t,i,l?a:void 0,l?s:void 0,l?void 0:a,l?void 0:s,o,c,u],f=n.apply(void 0,h);return ss(e)&&os(f,h),f.placeholder=r,ms(f,e,t)};var gs=function(e){return e.placeholder},ys=Math.min;var bs=function(e,t){for(var n=e.length,r=ys(t.length,n),i=Sr(e);r--;){var a=t[r];e[r]=Q(a,n)?i[a]:void 0}return e},ws="__lodash_placeholder__";var Rs=function(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n];s!==t&&s!==ws||(e[n]=ws,a[i++]=n)}return a},Ss=1,Ps=2,_s=8,Ns=16,xs=128,Cs=512;function Fs(u,l,h,f,d,p,m,v,g,y){var b=l&xs,w=l&Ss,R=l&Ps,S=l&(_s|Ns),P=l&Cs,_=R?void 0:Ua(u);return function e(){for(var t=arguments.length,n=Array(t),r=t;r--;)n[r]=arguments[r];if(S)var i=gs(e),a=za(n,i);if(f&&(n=Qa(n,f,d,S)),p&&(n=Wa(n,p,m,S)),t-=a,S&&t<y){var s=Rs(n,i);return vs(u,l,Fs,e.placeholder,h,n,s,v,g,y-t)}var o=w?h:this,c=R?o[u]:u;return t=n.length,v?n=bs(n,v):P&&1<t&&n.reverse(),b&&g<t&&(n.length=g),this&&this!==N&&this instanceof e&&(c=_||Ua(c)),c.apply(o,n)}}var Es=Fs;var js=function(s,o,c){var u=Ua(s);return function e(){for(var t=arguments.length,n=Array(t),r=t,i=gs(e);r--;)n[r]=arguments[r];var a=t<3&&n[0]!==i&&n[t-1]!==i?[]:Rs(n,i);return(t-=a.length)<c?vs(s,o,Es,e.placeholder,void 0,n,a,void 0,void 0,c-t):dt(this&&this!==N&&this instanceof e?u:s,this,n)}};var Ts=function(o,e,c,u){var l=1&e,h=Ua(o);return function e(){for(var t=-1,n=arguments.length,r=-1,i=u.length,a=Array(i+n),s=this&&this!==N&&this instanceof e?h:o;++r<i;)a[r]=u[r];for(;n--;)a[r++]=arguments[++t];return dt(s,l?c:this,a)}},Ms="__lodash_placeholder__",Is=Math.min;var Ls=function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,s=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var o=t[3];if(o){var c=e[3];e[3]=c?Qa(c,o,t[4]):o,e[4]=c?Rs(e[3],Ms):t[4]}return(o=t[5])&&(c=e[5],e[5]=c?Wa(c,o,t[6]):o,e[6]=c?Rs(e[5],Ms):t[6]),(o=t[7])&&(e[7]=o),128&r&&(e[8]=null==e[8]?t[8]:Is(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e},ks=Math.max;var Os=function(e,t,n,r,i,a,s,o){var c=2&t;if(!c&&"function"!=typeof e)throw new TypeError("Expected a function");var u=r?r.length:0;if(u||(t&=-97,r=i=void 0),s=void 0===s?s:ks(Fi(s),0),o=void 0===o?o:Fi(o),u-=i?i.length:0,64&t){var l=r,h=i;r=i=void 0}var f=c?void 0:Ga(e),d=[e,t,n,r,i,l,h,a,s,o];if(f&&Ls(d,f),e=d[0],t=d[1],n=d[2],r=d[3],i=d[4],!(o=d[9]=void 0===d[9]?c?0:e.length:ks(d[9]-u,0))&&24&t&&(t&=-25),t&&1!=t)p=8==t||16==t?js(e,t,o):32!=t&&33!=t||i.length?Es.apply(void 0,d):Ts(e,t,n,r);else var p=Ba(e,t,n);return ms((f?Ha:os)(p,d),e,t)},As=St(function(e,t){var n=Rs(t,gs(As));return Os(e,32,void 0,t,n)});As.placeholder={};var Ds=As,Hs=St(function(e,t){var n=Rs(t,gs(Hs));return Os(e,64,void 0,t,n)});Hs.placeholder={};var Us=Hs;var Bs=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=t<=e?e:t)),e};function Vs(e,i){return lr(e,function(e,t){var n=t.split(":");if(i&&1===n.length){var r=Bi(i,function(e){return Qs(e,t[0])});r&&(n=r.split(":"))}return e[0].push(n[0]),e[1].push(n[1]),e},[[],[]])}var Qs=function(e,t,n){return e=zn(e),n=null==n?0:Bs(Fi(n),0,e.length),t=Wn(t),e.slice(n,n+t.length)==t};var qs=function(e,t,n,r){if(!ae(e))return e;for(var i=-1,a=(t=Kn(t,e)).length,s=a-1,o=e;null!=o&&++i<a;){var c=Yn(t[i]),u=n;if(i!=s){var l=o[c];void 0===(u=r?r(l,c,o):void 0)&&(u=ae(l)?l:Q(t[i+1])?[]:{})}dr(o,c,u),o=o[c]}return e};var Ws=function(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var s=t[r],o=$n(e,s);n(o,s)&&qs(a,Kn(s,e),o)}return a};var zs=function(e,n){if(null==e)return{};var t=le(Cr(e),function(e){return[e]});return n=ir(n),Ws(e,t,function(e,t){return n(e,t[0])})},Ks=function(u){return function(e,t){var n=u.hierarchicalFacets[t],r=u.hierarchicalFacetsRefinements[n.name]&&u.hierarchicalFacetsRefinements[n.name][0]||"",i=u._getHierarchicalFacetSeparator(n),a=u._getHierarchicalRootPath(n),s=u._getHierarchicalShowParentLevel(n),o=function(s,o,c,u,l){return function(e,t,n){var r=e;if(0<n){var i=0;for(r=e;i<n;)r=r&&Bi(r.data,{isRefined:!0}),i++}if(r){var a=function(n,r,i,a,s){return function(e,t){return(!a||0===t.indexOf(a)&&a!==t)&&(!a&&-1===t.indexOf(i)||a&&t.split(i).length-a.split(i).length==1||-1===t.indexOf(i)&&-1===r.indexOf(i)||0===r.indexOf(t)||0===t.indexOf(n+i)&&(s||0===t.indexOf(r)))}}(r.path||c,l,o,c,u);r.data=Aa(or(zs(t.data,a),function(n,r){return function(e,t){return{name:ua(ii(t.split(n))),path:t,count:e,isRefined:r===t||0===r.indexOf(t+n),data:null}}}(o,l)),s[0],s[1])}return e}}(Vs(u._getHierarchicalFacetSortBy(n)),i,a,s,r),c=e;return a&&(c=e.slice(a.split(i).length)),lr(c,o,{name:u.hierarchicalFacets[t].name,count:null,isRefined:!0,path:null,data:null})}};function Ys(e){var n={};return Mt(e,function(e,t){n[e]=t}),n}function $s(e,t,n){t&&t[n]&&(e.stats=t[n])}function Gs(u,n){var c=n[0];this._rawResults=n,this.query=c.query,this.parsedQuery=c.parsedQuery,this.hits=c.hits,this.index=c.index,this.hitsPerPage=c.hitsPerPage,this.nbHits=c.nbHits,this.nbPages=c.nbPages,this.page=c.page,this.processingTimeMS=Fa(n,"processingTimeMS"),this.aroundLatLng=c.aroundLatLng,this.automaticRadius=c.automaticRadius,this.serverUsed=c.serverUsed,this.timeoutCounts=c.timeoutCounts,this.timeoutHits=c.timeoutHits,this.exhaustiveFacetsCount=c.exhaustiveFacetsCount,this.exhaustiveNbHits=c.exhaustiveNbHits,this.userData=c.userData,this.queryID=c.queryID,this.disjunctiveFacets=[],this.hierarchicalFacets=or(u.hierarchicalFacets,function(){return[]}),this.facets=[];var e=u.getRefinedDisjunctiveFacets(),l=Ys(u.facets),h=Ys(u.disjunctiveFacets),r=1,f=this;Mt(c.facets,function(e,t){var n=function(e,t){return Bi(e,function(e){return Ma(e.attributes,t)})}(u.hierarchicalFacets,t);if(n){var r=n.attributes.indexOf(t),i=Ui(u.hierarchicalFacets,{name:n.name});f.hierarchicalFacets[i][r]={attribute:t,data:e,exhaustive:c.exhaustiveFacetsCount}}else{var a,s=-1!==ji(u.disjunctiveFacets,t),o=-1!==ji(u.facets,t);s&&(a=h[t],f.disjunctiveFacets[a]={name:t,data:e,exhaustive:c.exhaustiveFacetsCount},$s(f.disjunctiveFacets[a],c.facets_stats,t)),o&&(a=l[t],f.facets[a]={name:t,data:e,exhaustive:c.exhaustiveFacetsCount},$s(f.facets[a],c.facets_stats,t))}}),this.hierarchicalFacets=xa(this.hierarchicalFacets),Mt(e,function(e){var a=n[r],s=u.getHierarchicalFacetByName(e);Mt(a.facets,function(e,t){var n;if(s){n=Ui(u.hierarchicalFacets,{name:s.name});var r=Ui(f.hierarchicalFacets[n],{attribute:t});if(-1===r)return;f.hierarchicalFacets[n][r].data=ba({},f.hierarchicalFacets[n][r].data,e)}else{n=h[t];var i=c.facets&&c.facets[t]||{};f.disjunctiveFacets[n]={name:t,data:da({},e,i),exhaustive:a.exhaustiveFacetsCount},$s(f.disjunctiveFacets[n],a.facets_stats,t),u.disjunctiveFacetsRefinements[t]&&Mt(u.disjunctiveFacetsRefinements[t],function(e){!f.disjunctiveFacets[n].data[e]&&-1<ji(u.disjunctiveFacetsRefinements[t],e)&&(f.disjunctiveFacets[n].data[e]=0)})}}),r++}),Mt(u.getRefinedHierarchicalFacets(),function(e){var s=u.getHierarchicalFacetByName(e),o=u._getHierarchicalFacetSeparator(s),c=u.getHierarchicalRefinement(e);if(!(0===c.length||c[0].split(o).length<2)){var t=n[r];Mt(t.facets,function(e,t){var n=Ui(u.hierarchicalFacets,{name:s.name}),r=Ui(f.hierarchicalFacets[n],{attribute:t});if(-1!==r){var i={};if(0<c.length){var a=c[0].split(o)[0];i[a]=f.hierarchicalFacets[n][r].data[a]}f.hierarchicalFacets[n][r].data=da(i,e,f.hierarchicalFacets[n][r].data)}}),r++}}),Mt(u.facetsExcludes,function(e,t){var n=l[t];f.facets[n]={name:t,data:c.facets[t],exhaustive:c.exhaustiveFacetsCount},Mt(e,function(e){f.facets[n]=f.facets[n]||{name:t},f.facets[n].data=f.facets[n].data||{},f.facets[n].data[e]=0})}),this.hierarchicalFacets=or(this.hierarchicalFacets,Ks(u)),this.facets=xa(this.facets),this.disjunctiveFacets=xa(this.disjunctiveFacets),this._state=u}function Js(e,t){if(!t.data||0===t.data.length)return t;var n=e(or(t.data,Ds(Js,e)));return ba({},t,{data:n})}function Zs(e,t){return t.sort(e)}function Xs(e,t){var n=Bi(e,{name:t});return n&&n.stats}function eo(e,t,n,r,i){var a=Bi(i,{name:n});return{type:t,attributeName:n,name:r,count:Gn(a,"data["+r+"]")||0,exhaustive:Gn(a,"exhaustive")||!1}}Gs.prototype.getFacetByName=function(e){var t={name:e};return Bi(this.facets,t)||Bi(this.disjunctiveFacets,t)||Bi(this.hierarchicalFacets,t)},Gs.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],Gs.prototype.getFacetValues=function(e,t){var n=function(n,r){var e={name:r};if(n._state.isConjunctiveFacet(r)){var t=Bi(n.facets,e);return t?or(t.data,function(e,t){return{name:t,count:e,isRefined:n._state.isFacetRefined(r,t),isExcluded:n._state.isExcludeRefined(r,t)}}):[]}if(n._state.isDisjunctiveFacet(r)){var i=Bi(n.disjunctiveFacets,e);return i?or(i.data,function(e,t){return{name:t,count:e,isRefined:n._state.isDisjunctiveFacetRefined(r,t)}}):[]}if(n._state.isHierarchicalFacet(r))return Bi(n.hierarchicalFacets,e)}(this,e);if(!n)throw new Error(e+" is not a retrieved facet.");var r=da({},t,{sortBy:Gs.DEFAULT_SORT});if(Array.isArray(r.sortBy)){var i=Vs(r.sortBy,Gs.DEFAULT_SORT);return Array.isArray(n)?Aa(n,i[0],i[1]):Js(Us(Aa,i[0],i[1]),n)}if(se(r.sortBy))return Array.isArray(n)?n.sort(r.sortBy):Js(Ds(Zs,r.sortBy),n);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},Gs.prototype.getFacetStats=function(e){if(this._state.isConjunctiveFacet(e))return Xs(this.facets,e);if(this._state.isDisjunctiveFacet(e))return Xs(this.disjunctiveFacets,e);throw new Error(e+" is not present in `facets` or `disjunctiveFacets`")},Gs.prototype.getRefinements=function(){var n=this._state,r=this,i=[];return Mt(n.facetsRefinements,function(e,t){Mt(e,function(e){i.push(eo(n,"facet",t,e,r.facets))})}),Mt(n.facetsExcludes,function(e,t){Mt(e,function(e){i.push(eo(n,"exclude",t,e,r.facets))})}),Mt(n.disjunctiveFacetsRefinements,function(e,t){Mt(e,function(e){i.push(eo(n,"disjunctive",t,e,r.disjunctiveFacets))})}),Mt(n.hierarchicalFacetsRefinements,function(e,t){Mt(e,function(e){i.push(function(e,t,n,r){for(var i=Bi(r,{name:t}),a=e.getHierarchicalFacetByName(t),s=n.split(a.separator),o=s[s.length-1],c=0;void 0!==i&&c<s.length;++c)i=Bi(i.data,{name:s[c]});var u=Gn(i,"count"),l=Gn(i,"exhaustive");return{type:"hierarchical",attributeName:t,name:o,count:u||0,exhaustive:l||!1}}(n,t,e,r.hierarchicalFacets))})}),Mt(n.numericRefinements,function(e,n){Mt(e,function(e,t){Mt(e,function(e){i.push({type:"numeric",attributeName:n,name:e,numericValue:e,operator:t})})})}),Mt(n.tagRefinements,function(e){i.push({type:"tag",attributeName:"_tags",name:e})}),i};var to=Gs;function no(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var ro=no;function io(e){return"function"==typeof e}function ao(e){return"object"==typeof e&&null!==e}function so(e){return void 0===e}(no.EventEmitter=no).prototype._events=void 0,no.prototype._maxListeners=void 0,no.defaultMaxListeners=10,no.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},no.prototype.emit=function(e){var t,n,r,i,a,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||ao(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var o=new Error('Uncaught, unspecified "error" event. ('+t+")");throw o.context=t,o}if(so(n=this._events[e]))return!1;if(io(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:i=Array.prototype.slice.call(arguments,1),n.apply(this,i)}else if(ao(n))for(i=Array.prototype.slice.call(arguments,1),r=(s=n.slice()).length,a=0;a<r;a++)s[a].apply(this,i);return!0},no.prototype.on=no.prototype.addListener=function(e,t){var n;if(!io(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,io(t.listener)?t.listener:t),this._events[e]?ao(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,ao(this._events[e])&&!this._events[e].warned&&(n=so(this._maxListeners)?no.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},no.prototype.once=function(e,t){if(!io(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},no.prototype.removeListener=function(e,t){var n,r,i,a;if(!io(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||io(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(ao(n)){for(a=i;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},no.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(io(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},no.prototype.listeners=function(e){return this._events&&this._events[e]?io(this._events[e])?[this._events[e]]:this._events[e].slice():[]},no.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(io(t))return 1;if(t)return t.length}return 0},no.listenerCount=function(e,t){return e.listenerCount(t)};var oo=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};function co(e,t){this.main=e,this.fn=t,this.lastResults=null}oo(co,ro.EventEmitter),co.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},co.prototype.getModifiedState=function(e){return this.fn(e)};var uo=co,lo={_getQueries:function(i,a){var s=[];return s.push({indexName:i,params:lo._getHitsSearchParams(a)}),Mt(a.getRefinedDisjunctiveFacets(),function(e){s.push({indexName:i,params:lo._getDisjunctiveFacetSearchParams(a,e)})}),Mt(a.getRefinedHierarchicalFacets(),function(e){var t=a.getHierarchicalFacetByName(e),n=a.getHierarchicalRefinement(e),r=a._getHierarchicalFacetSeparator(t);0<n.length&&1<n[0].split(r).length&&s.push({indexName:i,params:lo._getDisjunctiveFacetSearchParams(a,e,!0)})}),s},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(lo._getHitsHierarchicalFacetsAttributes(e)),n=lo._getFacetFilters(e),r=lo._getNumericFilters(e),i={facets:t,tagFilters:lo._getTagFilters(e)};return 0<n.length&&(i.facetFilters=n),0<r.length&&(i.numericFilters=r),ba(e.getQueryParams(),i)},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=lo._getFacetFilters(e,t,n),i=lo._getNumericFilters(e,t),a={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:lo._getTagFilters(e),analytics:!1,clickAnalytics:!1},s=e.getHierarchicalFacetByName(t);return a.facets=s?lo._getDisjunctiveHierarchicalFacetAttribute(e,s,n):t,0<i.length&&(a.numericFilters=i),0<r.length&&(a.facetFilters=r),ba(e.getQueryParams(),a)},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var i=[];return Mt(e.numericRefinements,function(e,r){Mt(e,function(e,n){t!==r&&Mt(e,function(e){if(Array.isArray(e)){var t=or(e,function(e){return r+n+e});i.push(t)}else i.push(r+n+e)})})}),i},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(c,u,l){var h=[];return Mt(c.facetsRefinements,function(e,t){Mt(e,function(e){h.push(t+":"+e)})}),Mt(c.facetsExcludes,function(e,t){Mt(e,function(e){h.push(t+":-"+e)})}),Mt(c.disjunctiveFacetsRefinements,function(e,t){if(t!==u&&e&&0!==e.length){var n=[];Mt(e,function(e){n.push(t+":"+e)}),h.push(n)}}),Mt(c.hierarchicalFacetsRefinements,function(e,t){var n=e[0];if(void 0!==n){var r,i,a=c.getHierarchicalFacetByName(t),s=c._getHierarchicalFacetSeparator(a),o=c._getHierarchicalRootPath(a);if(u===t){if(-1===n.indexOf(s)||!o&&!0===l||o&&o.split(s).length===n.split(s).length)return;n=o?(i=o.split(s).length-1,o):(i=n.split(s).length-2,n.slice(0,n.lastIndexOf(s))),r=a.attributes[i]}else i=n.split(s).length-1,r=a.attributes[i];r&&h.push([r+":"+n])}}),h},_getHitsHierarchicalFacetsAttributes:function(s){return lr(s.hierarchicalFacets,function(e,t){var n=s.getHierarchicalRefinement(t.name)[0];if(!n)return e.push(t.attributes[0]),e;var r=s._getHierarchicalFacetSeparator(t),i=n.split(r).length,a=t.attributes.slice(0,i+1);return e.concat(a)},[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r=e._getHierarchicalFacetSeparator(t);if(!0===n){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(r).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(r).length-1;return t.attributes.slice(0,1+s)},getSearchForFacetQuery:function(e,t,n,r){var i=r.isDisjunctiveFacet(e)?r.clearRefinements(e):r,a={facetQuery:t,facetName:e};return"number"==typeof n&&(a.maxFacetHits=n),ba(lo._getHitsSearchParams(i),a)}},ho=lo;var fo=function(e,r,i,a){return Ct(e,function(e,t,n){r(a,i(e),t,n)}),a};function po(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n}function mo(e,t){Lo.apply(e,Io(t)?t:[t])}function vo(e,t,n,r,i,a,s,o,c,u,l,h,f){var d=e;if("function"==typeof s?d=s(t,d):d instanceof Date?d=u(d):"comma"===n&&Io(d)&&(d=d.join(",")),null===d){if(r)return a&&!h?a(t,Oo.encoder,f):t;d=""}if("string"==typeof d||"number"==typeof d||"boolean"==typeof d||Co.isBuffer(d))return a?[l(h?t:a(t,Oo.encoder,f))+"="+l(a(d,Oo.encoder,f))]:[l(t)+"="+l(String(d))];var p,m=[];if(void 0===d)return m;if(Io(s))p=s;else{var v=Object.keys(d);p=o?v.sort(o):v}for(var g=0;g<p.length;++g){var y=p[g];i&&null===d[y]||(Io(d)?mo(m,vo(d[y],"function"==typeof n?n(t,y):t,n,r,i,a,s,o,c,u,l,h,f)):mo(m,vo(d[y],t+(c?"."+y:"["+y+"]"),n,r,i,a,s,o,c,u,l,h,f)))}return m}function go(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),s=a?r.slice(0,a.index):r,o=[];if(s){if(!n.plainObjects&&Ao.call(Object.prototype,s)&&!n.allowPrototypes)return;o.push(s)}for(var c=0;null!==(a=i.exec(r))&&c<n.depth;){if(c+=1,!n.plainObjects&&Ao.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;o.push(a[1])}return a&&o.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,i=e.length-1;0<=i;--i){var a,s=e[i];if("[]"===s&&n.parseArrays)a=[].concat(r);else{a=n.plainObjects?Object.create(null):{};var o="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,c=parseInt(o,10);n.parseArrays||""!==o?!isNaN(c)&&s!==o&&String(c)===o&&0<=c&&n.parseArrays&&c<=n.arrayLimit?(a=[])[c]=r:a[o]=r:a={0:r}}r=a}return r}(o,t,n)}}var yo=function(n,r){return function(e,t){return fo(e,n,r(t),{})}},bo=Object.prototype.toString,wo=yo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=bo.call(t)),e[t]=n},vt(ft)),Ro={advancedSyntax:"aS",allowTyposOnNumericTokens:"aTONT",analyticsTags:"aT",analytics:"a",aroundLatLngViaIP:"aLLVIP",aroundLatLng:"aLL",aroundPrecision:"aP",aroundRadius:"aR",attributesToHighlight:"aTH",attributesToRetrieve:"aTR",attributesToSnippet:"aTS",disjunctiveFacetsRefinements:"dFR",disjunctiveFacets:"dF",distinct:"d",facetsExcludes:"fE",facetsRefinements:"fR",facets:"f",getRankingInfo:"gRI",hierarchicalFacetsRefinements:"hFR",hierarchicalFacets:"hF",highlightPostTag:"hPoT",highlightPreTag:"hPrT",hitsPerPage:"hPP",ignorePlurals:"iP",index:"idx",insideBoundingBox:"iBB",insidePolygon:"iPg",length:"l",maxValuesPerFacet:"mVPF",minimumAroundRadius:"mAR",minProximity:"mP",minWordSizefor1Typo:"mWS1T",minWordSizefor2Typos:"mWS2T",numericFilters:"nF",numericRefinements:"nR",offset:"o",optionalWords:"oW",page:"p",queryType:"qT",query:"q",removeWordsIfNoResults:"rWINR",replaceSynonymsInHighlight:"rSIH",restrictSearchableAttributes:"rSA",synonyms:"s",tagFilters:"tF",tagRefinements:"tR",typoTolerance:"tT",optionalTagFilters:"oTF",optionalFacetFilters:"oFF",snippetEllipsisText:"sET",disableExactOnAttributes:"dEOA",enableExactOnSingleWordQuery:"eEOSWQ"},So=wo(Ro),Po={ENCODED_PARAMETERS:ce(So),decode:function(e){return So[e]},encode:function(e){return Ro[e]}},_o=Object.prototype.hasOwnProperty,No=Array.isArray,xo=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Co={arrayToObject:po,assign:function(e,n){return Object.keys(n).reduce(function(e,t){return e[t]=n[t],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],s=Object.keys(a),o=0;o<s.length;++o){var c=s[o],u=a[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:c}),n.push(u))}return function(e){for(;1<e.length;){var t=e.pop(),n=t.obj[t.prop];if(No(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r="string"==typeof e?e:String(e);if("iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",a=0;a<r.length;++a){var s=r.charCodeAt(a);45===s||46===s||95===s||126===s||48<=s&&s<=57||65<=s&&s<=90||97<=s&&s<=122?i+=r.charAt(a):s<128?i+=xo[s]:s<2048?i+=xo[192|s>>6]+xo[128|63&s]:s<55296||57344<=s?i+=xo[224|s>>12]+xo[128|s>>6&63]+xo[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&r.charCodeAt(a)),i+=xo[240|s>>18]+xo[128|s>>12&63]+xo[128|s>>6&63]+xo[128|63&s])}return i},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function r(i,a,s){if(!a)return i;if("object"!=typeof a){if(No(i))i.push(a);else{if(!i||"object"!=typeof i)return[i,a];(s&&(s.plainObjects||s.allowPrototypes)||!_o.call(Object.prototype,a))&&(i[a]=!0)}return i}if(!i||"object"!=typeof i)return[i].concat(a);var e=i;return No(i)&&!No(a)&&(e=po(i,s)),No(i)&&No(a)?(a.forEach(function(e,t){if(_o.call(i,t)){var n=i[t];n&&"object"==typeof n&&e&&"object"==typeof e?i[t]=r(n,e,s):i.push(e)}else i[t]=e}),i):Object.keys(a).reduce(function(e,t){var n=a[t];return _o.call(e,t)?e[t]=r(e[t],n,s):e[t]=n,e},e)}},Fo=String.prototype.replace,Eo=/%20/g,jo={default:"RFC3986",formatters:{RFC1738:function(e){return Fo.call(e,Eo,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"},To=Object.prototype.hasOwnProperty,Mo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},Io=Array.isArray,Lo=Array.prototype.push,ko=Date.prototype.toISOString,Oo={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Co.encode,encodeValuesOnly:!1,formatter:jo.formatters[jo.default],indices:!1,serializeDate:function(e){return ko.call(e)},skipNulls:!1,strictNullHandling:!1},Ao=Object.prototype.hasOwnProperty,Do={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Co.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ho={formats:jo,parse:function(e,t){var n=function(e){if(!e)return Do;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?Do.charset:e.charset;return{allowDots:void 0===e.allowDots?Do.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:Do.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:Do.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Do.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:Do.comma,decoder:"function"==typeof e.decoder?e.decoder:Do.decoder,delimiter:"string"==typeof e.delimiter||Co.isRegExp(e.delimiter)?e.delimiter:Do.delimiter,depth:"number"==typeof e.depth?e.depth:Do.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:Do.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:Do.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:Do.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Do.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?function(e,t){var n,r={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=i.split(t.delimiter,a),o=-1,c=t.charset;if(t.charsetSentinel)for(n=0;n<s.length;++n)0===s[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[n]?c="utf-8":"utf8=%26%2310003%3B"===s[n]&&(c="iso-8859-1"),o=n,n=s.length);for(n=0;n<s.length;++n)if(n!==o){var u,l,h=s[n],f=h.indexOf("]="),d=-1===f?h.indexOf("="):f+1;(l=-1===d?(u=t.decoder(h,Do.decoder,c),t.strictNullHandling?null:""):(u=t.decoder(h.slice(0,d),Do.decoder,c),t.decoder(h.slice(d+1),Do.decoder,c)))&&t.interpretNumericEntities&&"iso-8859-1"===c&&(l=l.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})),l&&t.comma&&-1<l.indexOf(",")&&(l=l.split(",")),Ao.call(r,u)?r[u]=Co.combine(r[u],l):r[u]=l}return r}(e,n):e,i=n.plainObjects?Object.create(null):{},a=Object.keys(r),s=0;s<a.length;++s){var o=a[s],c=go(o,r[o],n);i=Co.merge(i,c,n)}return Co.compact(i)},stringify:function(e,t){var n,r=e,i=function(e){if(!e)return Oo;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||Oo.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=jo.default;if(void 0!==e.format){if(!To.call(jo.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=jo.formatters[n],i=Oo.filter;return"function"!=typeof e.filter&&!Io(e.filter)||(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:Oo.addQueryPrefix,allowDots:void 0===e.allowDots?Oo.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Oo.charsetSentinel,delimiter:void 0===e.delimiter?Oo.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:Oo.encode,encoder:"function"==typeof e.encoder?e.encoder:Oo.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:Oo.encodeValuesOnly,filter:i,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:Oo.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:Oo.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Oo.strictNullHandling}}(t);"function"==typeof i.filter?r=(0,i.filter)("",r):Io(i.filter)&&(n=i.filter);var a,s=[];if("object"!=typeof r||null===r)return"";a=t&&t.arrayFormat in Mo?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var o=Mo[a];n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var c=0;c<n.length;++c){var u=n[c];i.skipNulls&&null===r[u]||mo(s,vo(r[u],u,o,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.formatter,i.encodeValuesOnly,i.charset))}var l=s.join(i.delimiter),h=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),0<l.length?h+l:""}},Uo=St(function(e,t,n){var r=1;if(n.length){var i=Rs(n,gs(Uo));r|=32}return Os(e,r,t,n,i)});Uo.placeholder={};var Bo=Uo;var Vo=function(n,e){return Ws(n,e,function(e,t){return Xn(n,t)})},Qo=bi(function(e,t){return null==e?{}:Vo(e,t)});var qo=function(e,r){var i={};return r=ir(r,3),Ct(e,function(e,t,n){hr(i,r(e,t,n),e)}),i};var Wo=function(e,r){var i={};return r=ir(r,3),Ct(e,function(e,t,n){hr(i,t,r(e,t,n))}),i},zo=Co.encode;function Ko(e){return di(e)?Wo(e,Ko):Array.isArray(e)?or(e,Ko):Ai(e)?zo(e):e}var Yo=["dFR","fR","nR","hFR","tR"],$o=Po.ENCODED_PARAMETERS;function Go(e,t,n,r){if(null!==e&&(n=n.replace(e,""),r=r.replace(e,"")),n=t[n]||n,r=t[r]||r,-1!==$o.indexOf(n)||-1!==$o.indexOf(r)){if("q"===n)return-1;if("q"===r)return 1;var i=-1!==Yo.indexOf(n),a=-1!==Yo.indexOf(r);if(i&&!a)return 1;if(a&&!i)return-1}return n.localeCompare(r)}var Jo={getStateFromQueryString:function(e,t){var r=t&&t.prefix||"",n=t&&t.mapping||{},i=wo(n),a=Ho.parse(e),s=new RegExp("^"+r),o=qo(a,function(e,t){var n=r&&s.test(t)?t.replace(s,""):t;return Po.decode(i[n]||n)||n}),c=Na._parseNumbers(o);return Qo(c,Na.PARAMETERS)},getUnrecognizedParametersInQueryString:function(e,t){var n=t&&t.prefix,r=t&&t.mapping||{},i=wo(r),a={},s=Ho.parse(e);if(n){var o=new RegExp("^"+n);Mt(s,function(e,t){o.test(t)||(a[t]=e)})}else Mt(s,function(e,t){Po.decode(i[t]||t)||(a[t]=e)});return a},getQueryStringFromState:function(e,t){var n=t&&t.moreAttributes,r=t&&t.prefix||"",i=t&&t.mapping||{},a=t&&t.safe||!1,s=wo(i),o=a?e:Ko(e),c=qo(o,function(e,t){var n=Po.encode(t);return r+(i[n]||n)}),u=""===r?null:new RegExp("^"+r),l=Bo(Go,null,u,s);if(Li(n))return Ho.stringify(c,{encode:a,sort:l});var h=Ho.stringify(c,{encode:a,sort:l}),f=Ho.stringify(n,{encode:a});return h?h+"&"+f:f}},Zo="2.28.0";function Xo(e,t,n){e.addAlgoliaAgent&&!nc(e)&&e.addAlgoliaAgent("JS Helper (2.28.0)"),this.setClient(e);var r=n||{};r.index=t,this.state=Na.make(r),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function ec(e){if(e<0)throw new Error("Page requested below 0.");return this._change(this.state.setPage(e)),this}function tc(){return this.state.page}function nc(e){var t=e._ua;return!!t&&-1!==t.indexOf("JS Helper")}oo(Xo,ro.EventEmitter),Xo.prototype.search=function(){return this._search(),this},Xo.prototype.getQuery=function(){var e=this.state;return ho._getHitsSearchParams(e)},Xo.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,r=ho._getQueries(n.index,n),i=this;if(this._currentNbQueries++,this.emit("searchOnce",n),!t)return this.client.search(r).then(function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new to(n,e.results),state:n,_originalResponse:e}},function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e});this.client.search(r).then(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new to(n,e.results),n)}).catch(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,n)})},Xo.prototype.searchForFacetValues=function(t,e,n,r){var i="function"==typeof this.client.searchForFacetValues;if(!i&&"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(r||{}),s=a.isDisjunctiveFacet(t),o=ho.getSearchForFacetQuery(t,e,n,a);this._currentNbQueries++;var c=this;return this.emit("searchForFacetValues",a,t,e),(i?this.client.searchForFacetValues([{indexName:a.index,params:o}]):this.client.initIndex(a.index).searchForFacetValues(o)).then(function(e){return c._currentNbQueries--,0===c._currentNbQueries&&c.emit("searchQueueEmpty"),(e=Array.isArray(e)?e[0]:e).facetHits=Mt(e.facetHits,function(e){e.isRefined=s?a.isDisjunctiveFacetRefined(t,e.value):a.isFacetRefined(t,e.value)}),e},function(e){throw c._currentNbQueries--,0===c._currentNbQueries&&c.emit("searchQueueEmpty"),e})},Xo.prototype.setQuery=function(e){return this._change(this.state.setPage(0).setQuery(e)),this},Xo.prototype.clearRefinements=function(e){return this._change(this.state.setPage(0).clearRefinements(e)),this},Xo.prototype.clearTags=function(){return this._change(this.state.setPage(0).clearTags()),this},Xo.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change(this.state.setPage(0).addDisjunctiveFacetRefinement(e,t)),this},Xo.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},Xo.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change(this.state.setPage(0).addHierarchicalFacetRefinement(e,t)),this},Xo.prototype.addNumericRefinement=function(e,t,n){return this._change(this.state.setPage(0).addNumericRefinement(e,t,n)),this},Xo.prototype.addFacetRefinement=function(e,t){return this._change(this.state.setPage(0).addFacetRefinement(e,t)),this},Xo.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},Xo.prototype.addFacetExclusion=function(e,t){return this._change(this.state.setPage(0).addExcludeRefinement(e,t)),this},Xo.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},Xo.prototype.addTag=function(e){return this._change(this.state.setPage(0).addTagRefinement(e)),this},Xo.prototype.removeNumericRefinement=function(e,t,n){return this._change(this.state.setPage(0).removeNumericRefinement(e,t,n)),this},Xo.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change(this.state.setPage(0).removeDisjunctiveFacetRefinement(e,t)),this},Xo.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},Xo.prototype.removeHierarchicalFacetRefinement=function(e){return this._change(this.state.setPage(0).removeHierarchicalFacetRefinement(e)),this},Xo.prototype.removeFacetRefinement=function(e,t){return this._change(this.state.setPage(0).removeFacetRefinement(e,t)),this},Xo.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},Xo.prototype.removeFacetExclusion=function(e,t){return this._change(this.state.setPage(0).removeExcludeRefinement(e,t)),this},Xo.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},Xo.prototype.removeTag=function(e){return this._change(this.state.setPage(0).removeTagRefinement(e)),this},Xo.prototype.toggleFacetExclusion=function(e,t){return this._change(this.state.setPage(0).toggleExcludeFacetRefinement(e,t)),this},Xo.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},Xo.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},Xo.prototype.toggleFacetRefinement=function(e,t){return this._change(this.state.setPage(0).toggleFacetRefinement(e,t)),this},Xo.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},Xo.prototype.toggleTag=function(e){return this._change(this.state.setPage(0).toggleTagRefinement(e)),this},Xo.prototype.nextPage=function(){return this.setPage(this.state.page+1)},Xo.prototype.previousPage=function(){return this.setPage(this.state.page-1)},Xo.prototype.setCurrentPage=ec,Xo.prototype.setPage=ec,Xo.prototype.setIndex=function(e){return this._change(this.state.setPage(0).setIndex(e)),this},Xo.prototype.setQueryParameter=function(e,t){return this._change(this.state.setPage(0).setQueryParameter(e,t)),this},Xo.prototype.setState=function(e){return this._change(Na.make(e)),this},Xo.prototype.getState=function(e){return void 0===e?this.state:this.state.filter(e)},Xo.prototype.getStateAsQueryString=function(e){var t=e&&e.filters||["query","attribute:*"],n=this.getState(t);return Jo.getQueryStringFromState(n,e)},Xo.getConfigurationFromQueryString=Jo.getStateFromQueryString,Xo.getForeignConfigurationInQueryString=Jo.getUnrecognizedParametersInQueryString,Xo.prototype.setStateFromQueryString=function(e,t){var n=t&&t.triggerChange||!1,r=Jo.getStateFromQueryString(e,t),i=this.state.setQueryParameters(r);n?this.setState(i):this.overrideStateWithoutTriggeringChangeEvent(i)},Xo.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new Na(e),this},Xo.prototype.isRefined=function(e,t){if(this.state.isConjunctiveFacet(e))return this.state.isFacetRefined(e,t);if(this.state.isDisjunctiveFacet(e))return this.state.isDisjunctiveFacetRefined(e,t);throw new Error(e+" is not properly defined in this helper configuration(use the facets or disjunctiveFacets keys to configure it)")},Xo.prototype.hasRefinements=function(e){return!Li(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))},Xo.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},Xo.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},Xo.prototype.hasTag=function(e){return this.state.isTagRefined(e)},Xo.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},Xo.prototype.getIndex=function(){return this.state.index},Xo.prototype.getCurrentPage=tc,Xo.prototype.getPage=tc,Xo.prototype.getTags=function(){return this.state.tagRefinements},Xo.prototype.getQueryParameter=function(e){return this.state.getQueryParameter(e)},Xo.prototype.getRefinements=function(e){var n=[];if(this.state.isConjunctiveFacet(e)){var t=this.state.getConjunctiveRefinements(e);Mt(t,function(e){n.push({value:e,type:"conjunctive"})});var r=this.state.getExcludeRefinements(e);Mt(r,function(e){n.push({value:e,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(e)){var i=this.state.getDisjunctiveRefinements(e);Mt(i,function(e){n.push({value:e,type:"disjunctive"})})}var a=this.state.getNumericRefinements(e);return Mt(a,function(e,t){n.push({value:e,operator:t,type:"numeric"})}),n},Xo.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},Xo.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},Xo.prototype._search=function(){var r=this.state,e=ho._getQueries(r.index,r),i=[{state:r,queriesCount:e.length,helper:this}];this.emit("search",r,this.lastResults);var t=or(this.derivedHelpers,function(e){var t=e.getModifiedState(r),n=ho._getQueries(t.index,t);return i.push({state:t,queriesCount:n.length,helper:e}),e.emit("search",t,e.lastResults),n}),n=e.concat(yi(t)),a=this._queryId++;this._currentNbQueries++;try{this.client.search(n).then(this._dispatchAlgoliaResponse.bind(this,i,a)).catch(this._dispatchAlgoliaError.bind(this,a))}catch(e){this.emit("error",e)}},Xo.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();Mt(e,function(e){var t=e.state,n=e.queriesCount,r=e.helper,i=s.splice(0,n),a=r.lastResults=new to(t,i);r.emit("result",a,t)})}},Xo.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",t),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},Xo.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},Xo.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&0<this.state.disjunctiveRefinements[e].length},Xo.prototype._change=function(e){e!==this.state&&(this.state=e,this.emit("change",this.state,this.lastResults))},Xo.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},Xo.prototype.setClient=function(e){return this.client===e||(e.addAlgoliaAgent&&!nc(e)&&e.addAlgoliaAgent("JS Helper (2.28.0)"),this.client=e),this},Xo.prototype.getClient=function(){return this.client},Xo.prototype.derive=function(e){var t=new uo(this,e);return this.derivedHelpers.push(t),t},Xo.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)},Xo.prototype.hasPendingRequests=function(){return 0<this._currentNbQueries};var rc=Xo;function ic(e,t,n){return new rc(e,t,n)}ic.version=Zo,ic.AlgoliaSearchHelper=rc,ic.SearchParameters=Na,ic.SearchResults=to,ic.url=Jo;var ac=ic;function sc(e){var t="string"==typeof e,n=t?document.querySelector(e):e;if(function(e){return e instanceof HTMLElement||Boolean(e)&&0<e.nodeType}(n))return n;var r="Container must be `string` or `HTMLElement`.";throw t&&(r+=" Unable to find ".concat(e)),new Error(r)}function oc(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function cc(e){return e.filter(function(e,t,n){return n.indexOf(e)===t})}function uc(e){var t=e.defaultTemplates,n=e.templates;return H({templatesConfig:e.templatesConfig},function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return cc([].concat(y(Object.keys(a)),y(Object.keys(s)))).reduce(function(e,t){var n=a[t],r=s[t],i=void 0!==r&&r!==n;return e.templates[t]=i?r:n,e.useCustomCompileOptions[t]=i,e},{templates:{},useCustomCompileOptions:{}})}(t,n))}var lc=n(function(e,t){!function(w){var R=/\S/,t=/\"/g,n=/\n/g,r=/\r/g,i=/\\/g,a=/\u2028/,s=/\u2029/;function S(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function P(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function _(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;r<i;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}w.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},w.scan=function(e,t){var n,r,i,a,s,o=e.length,c=0,u=null,l=null,h="",f=[],d=!1,p=0,m=0,v="{{",g="}}";function y(){0<h.length&&(f.push({tag:"_t",text:new String(h)}),h="")}function b(e,t){if(y(),e&&function(){for(var e=!0,t=m;t<f.length;t++)if(!(e=w.tags[f[t].tag]<w.tags._v||"_t"==f[t].tag&&null===f[t].text.match(R)))return!1;return e}())for(var n,r=m;r<f.length;r++)f[r].text&&((n=f[r+1])&&">"==n.tag&&(n.indent=f[r].text.toString()),f.splice(r,1));else t||f.push({tag:"\n"});d=!1,m=f.length}for(t&&(t=t.split(" "),v=t[0],g=t[1]),p=0;p<o;p++)0==c?_(v,e,p)?(--p,y(),c=1):"\n"==e.charAt(p)?b(d):h+=e.charAt(p):1==c?(p+=v.length-1,c="="==(u=(l=w.tags[e.charAt(p+1)])?e.charAt(p+1):"_v")?(r=p,void 0,i="="+g,a=(n=e).indexOf(i,r),s=P(n.substring(n.indexOf("=",r)+1,a)).split(" "),v=s[0],g=s[s.length-1],p=a+i.length-1,0):(l&&p++,2),d=p):_(g,e,p)?(f.push({tag:u,n:P(h),otag:v,ctag:g,i:"/"==u?d-v.length:p+g.length}),h="",p+=g.length-1,c=0,"{"==u&&("}}"==g?p++:S(f[f.length-1]))):h+=e.charAt(p);return b(d,!0),f};var u={_t:!0,"\n":!0,$:!0,"/":!0};function l(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].o==e.n)return e.tag="#",!0}function h(e,t,n){for(var r=0,i=n.length;r<i;r++)if(n[r].c==e&&n[r].o==t)return!0}function o(e){var t=[];for(var n in e.partials)t.push('"'+f(n)+'":{name:"'+f(e.partials[n].name)+'", '+o(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var n in e)t.push('"'+f(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}(e.subs)}w.stringify=function(e,t,n){return"{code: function (c,p,i) { "+w.wrapMain(e.code)+" },"+o(e)+"}"};var c=0;function f(e){return e.replace(i,"\\\\").replace(t,'\\"').replace(n,"\\n").replace(r,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function d(e){return~e.indexOf(".")?"d":"f"}function p(e,t){var n="<"+(t.prefix||"")+e.n+c++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+f(n)+'",c,p,"'+(e.indent||"")+'"));',n}function e(e,t){t.code+="t.b(t.t(t."+d(e.n)+'("'+f(e.n)+'",c,p,0)));'}function m(e){return"t.b("+e+");"}w.generate=function(e,t,n){c=0;var r={code:"",subs:{},partials:{}};return w.walk(e,r),n.asString?this.stringify(r,t,n):this.makeTemplate(r,t,n)},w.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},w.template=w.Template,w.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},w.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},w.codegen={"#":function(e,t){t.code+="if(t.s(t."+d(e.n)+'("'+f(e.n)+'",c,p,1),c,p,0,'+e.i+","+e.end+',"'+e.otag+" "+e.ctag+'")){t.rs(c,p,function(c,p,t){',w.walk(e.nodes,t),t.code+="});c.pop();}"},"^":function(e,t){t.code+="if(!t.s(t."+d(e.n)+'("'+f(e.n)+'",c,p,1),c,p,1,0,0,"")){',w.walk(e.nodes,t),t.code+="};"},">":p,"<":function(e,t){var n={partials:{},code:"",subs:{},inPartial:!0};w.walk(e.nodes,n);var r=t.partials[p(e,t)];r.subs=n.subs,r.partials=n.partials},$:function(e,t){var n={subs:{},code:"",partials:t.partials,prefix:e.n};w.walk(e.nodes,n),t.subs[e.n]=n.code,t.inPartial||(t.code+='t.sub("'+f(e.n)+'",c,p,i);')},"\n":function(e,t){t.code+=m('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+d(e.n)+'("'+f(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=m('"'+f(e.text)+'"')},"{":e,"&":e},w.walk=function(e,t){for(var n,r=0,i=e.length;r<i;r++)(n=w.codegen[e[r].tag])&&n(e[r],t);return t},w.parse=function(e,t,n){return function e(t,n,r,i){var a,s=[],o=null,c=null;for(a=r[r.length-1];0<t.length;){if(c=t.shift(),a&&"<"==a.tag&&!(c.tag in u))throw new Error("Illegal content in < super tag.");if(w.tags[c.tag]<=w.tags.$||l(c,i))r.push(c),c.nodes=e(t,c.tag,r,i);else{if("/"==c.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+c.n);if(o=r.pop(),c.n!=o.n&&!h(c.n,o.n,i))throw new Error("Nesting error: "+o.n+" vs. "+c.n);return o.end=c.i,s}"\n"==c.tag&&(c.last=0==t.length||"\n"==t[0].tag)}s.push(c)}if(0<r.length)throw new Error("missing closing tag: "+r.pop().n);return s}(e,0,[],(n=n||{}).sectionTags||[])},w.cache={},w.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},w.compile=function(e,t){t=t||{};var n=w.cacheKey(e,t),r=this.cache[n];if(r){var i=r.partials;for(var a in i)delete i[a].instance;return r}return r=this.generate(this.parse(this.scan(e,t.delimiters),e,t),e,t),this.cache[n]=r}}(t)}),hc=n(function(e,t){!function(e){function l(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,n){return""},v:function(e){return e=o(e),s.test(e)?e.replace(t,"&amp;").replace(n,"&lt;").replace(r,"&gt;").replace(i,"&#39;").replace(a,"&quot;"):e},t:o,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var n=this.partials[e],r=t[n.name];if(n.instance&&n.base==r)return n.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[e].base=r,n.subs){for(key in t.stackText||(t.stackText={}),n.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);r=function(e,t,n,r,i,a){function s(){}function o(){}var c;o.prototype=(s.prototype=e).subs;var u=new s;for(c in u.subs=new o,u.subsText={},u.buf="",r=r||{},u.stackSubs=r,u.subsText=a,t)r[c]||(r[c]=t[c]);for(c in r)u.subs[c]=r[c];for(c in i=i||{},u.stackPartials=i,n)i[c]||(i[c]=n[c]);for(c in i)u.partials[c]=i[c];return u}(r,n.subs,n.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=r},rp:function(e,t,n,r){var i=this.ep(e,n);return i?i.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(h(r))for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop();else n(e,t,this)},s:function(e,t,n,r,i,a,s){var o;return(!h(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,n,r,i,a,s)),o=!!e,!r&&o&&t&&t.push("object"==typeof e?e:t[t.length-1]),o)},d:function(e,t,n,r){var i,a=e.split("."),s=this.f(a[0],t,n,r),o=this.options.modelGet,c=null;if("."===e&&h(t[t.length-2]))s=t[t.length-1];else for(var u=1;u<a.length;u++)s=void 0!==(i=l(a[u],s,o))?(c=s,i):"";return!(r&&!s)&&(r||"function"!=typeof s||(t.push(c),s=this.mv(s,t,n),t.pop()),s)},f:function(e,t,n,r){for(var i=!1,a=!1,s=this.options.modelGet,o=t.length-1;0<=o;o--)if(void 0!==(i=l(e,t[o],s))){a=!0;break}return a?(r||"function"!=typeof i||(i=this.mv(i,t,n)),i):!r&&""},ls:function(e,t,n,r,i){var a=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(o(e.call(t,r)),t,n)),this.options.delimiters=a,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,r,i,a,s){var o,c=t[t.length-1],u=e.call(c);return"function"==typeof u?!!r||(o=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,c,n,o.substring(i,a),s)):u},mv:function(e,t,n){var r=t[t.length-1],i=e.call(r);return"function"==typeof i?this.ct(o(i.call(r)),r,n):i},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}};var t=/&/g,n=/</g,r=/>/g,i=/\'/g,a=/\"/g,s=/[&<>\"\']/;function o(e){return String(null==e?"":e)}var h=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(t)});lc.Template=hc.Template,lc.template=lc.Template;var fc=lc;function dc(e){var t=e.templates,n=e.templateKey,r=e.compileOptions,i=e.helpers,a=e.data,s=t[n],o=f(s),c="function"===o;if(!("string"===o)&&!c)throw new Error("Template must be 'string' or 'function', was '".concat(o,"' (key: ").concat(n,")"));if(c)return s(a);var u=function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=1<arguments.length?arguments[1]:void 0,a=2<arguments.length?arguments[2]:void 0;return Object.keys(r).reduce(function(e,n){return H({},e,F({},n,function(){var t=this;return function(e){return r[n].call(a,e,function(e){return fc.compile(e,i).render(t)})}}))},{})}(i,r,a);return fc.compile(s,r).render(H({},a,{helpers:u})).replace(/[ \n\r\t\f\xA0]+/g,function(e){return e.replace(/(^|\xA0+)[^\xA0]+/g,"$1 ")}).trim()}function pc(e,t,n){return Array.prototype.find?e.find(t,n):e.filter(t,n)[0]}function mc(e){return String(e).replace(/^\\-/,"-")}function vc(i,e,a,s){var o,t=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],n={type:e,attributeName:a,name:s},c=pc(t,function(e){return e.name===a});"hierarchical"===e?function(){for(var e=i.getHierarchicalFacetByName(a),n=s.split(e.separator),t=function(t){c=c.data&&pc(Object.keys(c.data).map(function(t){return function(e){return t[e]}}(c.data)),function(e){return e.name===n[t]})},r=0;void 0!==c&&r<n.length;++r)t(r);o=c&&c.count}():o=c&&c.data&&c.data[n.name];var r=c&&c.exhaustive;return void 0!==o&&(n.count=o),void 0!==r&&(n.exhaustive=r),n}function gc(n,r){var e=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=[],t=r.facetsRefinements,a=void 0===t?{}:t,s=r.facetsExcludes,o=void 0===s?{}:s,c=r.disjunctiveFacetsRefinements,u=void 0===c?{}:c,l=r.hierarchicalFacetsRefinements,h=void 0===l?{}:l,f=r.numericRefinements,d=void 0===f?{}:f,p=r.tagRefinements,m=void 0===p?[]:p;return Object.keys(a).forEach(function(t){a[t].forEach(function(e){i.push(vc(r,"facet",t,e,n.facets))})}),Object.keys(o).forEach(function(t){o[t].forEach(function(e){i.push({type:"exclude",attributeName:t,name:e,exclude:!0})})}),Object.keys(u).forEach(function(t){u[t].forEach(function(e){i.push(vc(r,"disjunctive",t,mc(e),n.disjunctiveFacets))})}),Object.keys(h).forEach(function(t){h[t].forEach(function(e){i.push(vc(r,"hierarchical",t,e,n.hierarchicalFacets))})}),Object.keys(d).forEach(function(n){var r=d[n];Object.keys(r).forEach(function(t){var e=r[t];(Array.isArray(e)?e:[e]).forEach(function(e){i.push({type:"numeric",attributeName:n,name:"".concat(e),numericValue:e,operator:t})})})}),m.forEach(function(e){i.push({type:"tag",attributeName:"_tags",name:e})}),e&&r.query&&r.query.trim()&&i.push({attributeName:"query",type:"query",name:r.query,query:r.query}),i}function yc(e){var t=e.helper,n=e.attributesToClear,r=void 0===n?[]:n,i=t.state;return r.forEach(function(e){i="_tags"===e?i.clearTags():i.clearRefinements(e)}),-1!==r.indexOf("query")&&(i=i.setQuery("")),i}function bc(e){return"number"==typeof e&&e<0&&(e=String(e).replace(/^-/,"\\-")),e}function wc(e,t){if(void 0===e||"function"!=typeof e)throw new Error('The render function is not valid (got type "'.concat(f(e),'").\n\n').concat(t))}function Rc(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)}function Sc(){}function Pc(e){return"number"==typeof e&&isFinite(e)}function _c(e){if(!function(e){return"object"===f(e)&&null!==e}(e)||"[object Object]"!==function(e){return null===e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Nc(e){var t=e.start,n=void 0===t?0:t,r=e.end,i=e.step,a=void 0===i?1:i,s=0===a?1:a,o=Math.round((r-n)/s);return y(Array(o)).map(function(e,t){return(n+t)*s})}function xc(e){return e!==Object(e)}function Cc(e,t){if(e===t)return!0;if(xc(e)||xc(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!(i in t))return!1;if(!Cc(e[i],t[i]))return!1}return!0}var Fc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ec=/[&<>"']/g,jc=RegExp(Ec.source);function Tc(e){var t=e.name,n=e.connector;return["https://www.algolia.com/doc/api-reference/widgets/",t,"/js/",void 0!==n&&n?"#connector":""].join("")}function Mc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map(function(e){return Tc(e)}).join(", ");return function(e){return[e,"See documentation: ".concat(r)].filter(Boolean).join("\n\n")}}var Ic=Sc,Lc=/^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/;function kc(e){return Array.isArray(e)?function(e){var t=U(e,1)[0],n=U(t=void 0===t?[]:t,4),r=n[0],i=n[1],a=n[2],s=n[3];if(!(r&&i&&a&&s))throw new Error('Invalid value for "insideBoundingBox" parameter: ['.concat(e,"]"));return{northEast:{lat:r,lng:i},southWest:{lat:a,lng:s}}}(e):function(e){var t=U(e.split(",").map(parseFloat),4),n=t[0],r=t[1],i=t[2],a=t[3];if(!(n&&r&&i&&a))throw new Error('Invalid value for "insideBoundingBox" parameter: "'.concat(e,'"'));return{northEast:{lat:n,lng:r},southWest:{lat:i,lng:a}}}(e)}var Oc=function(e,n,r){return e.map(function(e,t){return H({},e,{__position:r*n+t+1})})},Ac=function(e,t){return t?e.map(function(e){return H({},e,{__queryID:t})}):e},Dc=function(){function i(e){var t=e.router,n=e.stateMapping,r=e.instantSearchInstance;T(this,i),F(this,"instantSearchInstance",void 0),F(this,"router",void 0),F(this,"stateMapping",void 0),F(this,"isFirstRender",!0),F(this,"currentUiState",void 0),F(this,"initState",void 0),F(this,"renderURLFromState",void 0),this.router=t,this.stateMapping=n,this.instantSearchInstance=r,this.currentUiState=this.stateMapping.routeToState(this.router.read())}return M(i,[{key:"getAllSearchParameters",value:function(e){var t=e.currentSearchParameters,n=e.uiState;return this.instantSearchInstance.widgets.reduce(function(e,t){return t.getWidgetSearchParameters?t.getWidgetSearchParameters(e,{uiState:n}):e},t)}},{key:"getAllUiStates",value:function(e){var n=e.searchParameters,t=this.instantSearchInstance.widgets,r=this.instantSearchInstance.helper;return t.reduce(function(e,t){return t.getWidgetState?t.getWidgetState(e,{helper:r,searchParameters:n}):e},{})}},{key:"setupRouting",value:function(r){var i=this,a=this.instantSearchInstance.helper;this.router.onUpdate(function(e){var t=i.stateMapping.routeToState(e);if(!Cc(t,i.getAllUiStates({searchParameters:a.state}))){i.currentUiState=t;var n=i.getAllSearchParameters({currentSearchParameters:r,uiState:i.currentUiState});a.overrideStateWithoutTriggeringChangeEvent(n).search()}}),this.renderURLFromState=function(e){i.currentUiState=i.getAllUiStates({searchParameters:e});var t=i.stateMapping.stateToRoute(i.currentUiState);i.router.write(t)},a.on("change",this.renderURLFromState);var e=this.getAllUiStates({searchParameters:r});if(!Cc(this.initState,e)){this.currentUiState=e;var t=this.stateMapping.stateToRoute(this.currentUiState);this.router.write(t)}}},{key:"getConfiguration",value:function(e){var t=ac.SearchParameters.make(e);return H({},this.getAllSearchParameters({uiState:this.currentUiState,currentSearchParameters:t}))}},{key:"init",value:function(e){var t=e.state;this.initState=this.getAllUiStates({searchParameters:t})}},{key:"render",value:function(e){var t=e.state;this.isFirstRender&&(this.isFirstRender=!1,this.setupRouting(t))}},{key:"dispose",value:function(e){var t=e.helper,n=e.state;this.renderURLFromState&&this.instantSearchInstance.helper.removeListener("change",this.renderURLFromState),this.router.dispose&&this.router.dispose({helper:t,state:n})}},{key:"createURL",value:function(e){var t=this.getAllUiStates({searchParameters:e}),n=this.stateMapping.stateToRoute(t);return this.router.createURL(n)}},{key:"onHistoryChange",value:function(r){var i=this,a=this.instantSearchInstance.helper;this.router.onUpdate(function(e){var t=i.stateMapping.routeToState(e);if(!Cc(t,i.getAllUiStates({searchParameters:a.state}))){i.currentUiState=t;var n=i.getAllSearchParameters({currentSearchParameters:a.state,uiState:i.currentUiState});r(H({},n))}})}}]),i}(),Hc=function(){function e(){T(this,e)}return M(e,[{key:"stateToRoute",value:function(e){return e}},{key:"routeToState",value:function(e){return e}}]),e}();function Uc(){return new Hc}function Bc(e){var t=e.qsModule,n=e.routeState,r=e.location,i=r.protocol,a=r.hostname,s=r.port,o=void 0===s?"":s,c=r.pathname,u=r.hash,l=t.stringify(n),h=""===o?"":":".concat(o);return n&&0!==Object.keys(n).length?"".concat(i,"//").concat(a).concat(h).concat(c,"?").concat(l).concat(u):"".concat(i,"//").concat(a).concat(h).concat(c).concat(u)}function Vc(e){var t=e.qsModule,n=e.location;return t.parse(n.search.slice(1),{arrayLimit:99})}function Qc(e){e&&(window.document.title=e)}var qc=function(){function u(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.windowTitle,n=e.writeDelay,r=void 0===n?400:n,i=e.createURL,a=void 0===i?Bc:i,s=e.parseURL,o=void 0===s?Vc:s;T(this,u),F(this,"windowTitle",void 0),F(this,"writeDelay",void 0),F(this,"_createURL",void 0),F(this,"parseURL",void 0),F(this,"writeTimer",void 0),this.windowTitle=t,this.writeTimer=void 0,this.writeDelay=r,this._createURL=a,this.parseURL=o;var c=this.windowTitle&&this.windowTitle(this.read());Qc(c)}return M(u,[{key:"read",value:function(){return this.parseURL({qsModule:Ho,location:window.location})}},{key:"write",value:function(e){var t=this,n=this.createURL(e),r=this.windowTitle&&this.windowTitle(e);this.writeTimer&&window.clearTimeout(this.writeTimer),this.writeTimer=window.setTimeout(function(){Qc(r),window.history.pushState(e,r||"",n),t.writeTimer=void 0},this.writeDelay)}},{key:"onUpdate",value:function(n){var r=this;this._onPopState=function(e){r.writeTimer&&(window.clearTimeout(r.writeTimer),r.writeTimer=void 0);var t=e.state;n(t||r.read())},window.addEventListener("popstate",this._onPopState)}},{key:"createURL",value:function(e){return this._createURL({qsModule:Ho,routeState:e,location:window.location})}},{key:"dispose",value:function(){this._onPopState&&window.removeEventListener("popstate",this._onPopState),this.writeTimer&&window.clearTimeout(this.writeTimer),this.write({})}}]),u}();function Wc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(qc,t)}var zc={highlightPreTag:"__ais-highlight__",highlightPostTag:"__/ais-highlight__"},Kc={highlightPreTag:"<mark>",highlightPostTag:"</mark>"};function Yc(e){return function(e){return e&&jc.test(e)?e.replace(Ec,function(e){return Fc[e]}):e}(e).replace(new RegExp(zc.highlightPreTag,"g"),Kc.highlightPreTag).replace(new RegExp(zc.highlightPostTag,"g"),Kc.highlightPostTag)}function $c(n){return _c(n)&&"string"!=typeof n.value?Object.keys(n).reduce(function(e,t){return H({},e,F({},t,$c(n[t])))},{}):Array.isArray(n)?n.map($c):H({},n,{value:Yc(n.value)})}function Gc(e){return void 0===e.__escaped&&((e=e.map(function(e){return e._highlightResult&&(e._highlightResult=$c(e._highlightResult)),e._snippetResult&&(e._snippetResult=$c(e._snippetResult)),e})).__escaped=!0),e}function Jc(a){return function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.descendantName,n=e.modifierName,r=t?"-".concat(t):"",i=n?"--".concat(n):"";return"".concat("ais","-").concat(a).concat(r).concat(i)}}var Zc=Jc("Highlight");function Xc(e){var t=e.attribute,n=e.highlightedTagName,r=void 0===n?"mark":n,i=Rc(e.hit,"_highlightResult.".concat(t,".value"))||"",a=Zc({descendantName:"highlighted"});return i.replace(new RegExp(Kc.highlightPreTag,"g"),"<".concat(r,' class="').concat(a,'">')).replace(new RegExp(Kc.highlightPostTag,"g"),"</".concat(r,">"))}var eu=Jc("Snippet");function tu(e){var t=e.attribute,n=e.highlightedTagName,r=void 0===n?"mark":n,i=Rc(e.hit,"_snippetResult.".concat(t,".value"))||"",a=eu({descendantName:"highlighted"});return i.replace(new RegExp(Kc.highlightPreTag,"g"),"<".concat(r,' class="').concat(a,'">')).replace(new RegExp(Kc.highlightPostTag,"g"),"</".concat(r,">"))}var nu=Mc({name:"instantsearch"}),ru={stateMapping:Uc(),router:Wc()};function iu(){return"#"}var au=function(e){function v(e){var t;T(this,v),t=O(this,L(v).call(this));var n=e.indexName,r=void 0===n?null:n,i=e.numberLocale,a=e.searchParameters,s=void 0===a?{}:a,o=e.routing,c=void 0===o?null:o,u=e.searchFunction,l=e.stalledSearchDelay,h=void 0===l?200:l,f=e.searchClient,d=void 0===f?null:f,p=e.insightsClient,m=void 0===p?null:p;if(null===r)throw new Error(nu("The `indexName` option is required."));if(null===d)throw new Error(nu("The `searchClient` option is required."));if(void 0!==e.urlSync)throw new Error(nu("The `urlSync` option was removed in InstantSearch.js 3. You may want to use the `routing` option."));if("function"!=typeof d.search)throw new Error("The `searchClient` must implement a `search` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/");if("function"==typeof d.addAlgoliaAgent&&d.addAlgoliaAgent("instantsearch.js (".concat("3.5.3",")")),m&&"function"!=typeof m)throw new Error("The provided `insightsClient` must be a function.");return t.client=d,t.insightsClient=m,t.helper=null,t.indexName=r,t.searchParameters=H({},s,{index:r}),t.widgets=[],t.templatesConfig={helpers:function(e){var n=e.numberLocale;return{formatNumber:function(e,t){return Number(t(e)).toLocaleString(n)},highlight:function(e,t){try{return t(Xc(H({},JSON.parse(e),{hit:this})))}catch(e){throw new Error('\nThe highlight helper expects a JSON object of the format:\n{ "attribute": "name", "highlightedTagName": "mark" }')}},snippet:function(e,t){try{return t(tu(H({},JSON.parse(e),{hit:this})))}catch(e){throw new Error('\nThe snippet helper expects a JSON object of the format:\n{ "attribute": "name", "highlightedTagName": "mark" }')}}}}({numberLocale:i}),compileOptions:{}},t._stalledSearchDelay=h,u&&(t._searchFunction=u),!0===c?t.routing=ru:_c(c)&&(t.routing=H({},ru,c)),t}return I(v,ro),M(v,[{key:"addWidget",value:function(e){this.addWidgets([e])}},{key:"addWidgets",value:function(e){var t=this;if(!Array.isArray(e))throw new Error(nu("The `addWidgets` method expects an array of widgets. Please use `addWidget`."));var n=this.widgets.pop();e.forEach(function(e){if(void 0===e.render&&void 0===e.init)throw new Error("The widget definition expects a `render` and/or an `init` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/widgets/create-your-own-widgets/js/");t.widgets.push(e)}),n&&this.widgets.push(n),this.started&&Boolean(e.length)&&(this.searchParameters=this.widgets.reduce(su,H({},this.helper.state)),this.helper.setState(this.searchParameters),e.forEach(function(e){e.init&&e.init({state:t.helper.state,helper:t.helper,templatesConfig:t.templatesConfig,createURL:t._createAbsoluteURL,onHistoryChange:t._onHistoryChange,instantSearchInstance:t})}),this.helper.search())}},{key:"removeWidget",value:function(e){this.removeWidgets([e])}},{key:"removeWidgets",value:function(e){var n=this;if(!Array.isArray(e))throw new Error(nu("The `removeWidgets` method expects an array of widgets. Please use `removeWidget`."));e.forEach(function(t){if(!n.widgets.includes(t)||"function"!=typeof t.dispose)throw new Error("The `dispose` method is required to remove the widget.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/widgets/create-your-own-widgets/js/#the-widget-lifecycle-and-api");n.widgets=n.widgets.filter(function(e){return e!==t});var e=t.dispose({helper:n.helper,state:n.helper.state});e&&(n.searchParameters=n.widgets.reduce(su,H({},e)),n.helper.setState(n.searchParameters))}),setTimeout(function(){0<n.widgets.length&&n.helper.search()},0)}},{key:"refresh",value:function(){this.helper&&this.helper.clearCache().search()}},{key:"start",value:function(){var t=this;if(this.started)throw new Error(nu("The `start` method has already been called once."));if(this.routing){var e=new Dc(H({},this.routing,{instantSearchInstance:this}));this._onHistoryChange=e.onHistoryChange.bind(e),this._createURL=e.createURL.bind(e),this._createAbsoluteURL=this._createURL,this.widgets.push(e)}else this._createURL=iu,this._createAbsoluteURL=iu,this._onHistoryChange=Sc;this.searchParameters=this.widgets.reduce(su,this.searchParameters);var n=ac(this.client,this.searchParameters.index||this.indexName,this.searchParameters);this._searchFunction&&(this._mainHelperSearch=n.search.bind(n),n.search=function(){var e=ac({search:function(){return new Promise(Sc)}},n.state.index,n.state);e.once("search",function(e){n.overrideStateWithoutTriggeringChangeEvent(e),t._mainHelperSearch()}),t._searchFunction(e)}),this.helper=n,this._init(n.state,this.helper),this.helper.on("result",this._render.bind(this,this.helper)),this.helper.on("error",function(e){t.emit("error",e)}),this._searchStalledTimer=null,this._isSearchStalled=!0,this.helper.search(),this.helper.on("search",function(){t._isSearchStalled||t._searchStalledTimer||(t._searchStalledTimer=setTimeout(function(){t._isSearchStalled=!0,t._render(t.helper,t.helper.lastResults,t.helper.lastResults._state)},t._stalledSearchDelay))}),this.started=!0}},{key:"dispose",value:function(){this.removeWidgets(this.widgets),this.started=!1,this.helper.removeAllListeners(),this.helper=null}},{key:"createURL",value:function(e){if(!this._createURL)throw new Error("The `start` method needs to be called before `createURL`.");return this._createURL(this.helper.state.setQueryParameters(e))}},{key:"_render",value:function(t,n,r){var i=this;this.helper.hasPendingRequests()||(clearTimeout(this._searchStalledTimer),this._searchStalledTimer=null,this._isSearchStalled=!1),this.widgets.forEach(function(e){e.render&&e.render({templatesConfig:i.templatesConfig,results:n,state:r,helper:t,createURL:i._createAbsoluteURL,instantSearchInstance:i,searchMetadata:{isSearchStalled:i._isSearchStalled}})}),this.emit("render")}},{key:"_init",value:function(t,n){var r=this;this.widgets.forEach(function(e){e.init&&e.init({state:t,helper:n,templatesConfig:r.templatesConfig,createURL:r._createAbsoluteURL,onHistoryChange:r._onHistoryChange,instantSearchInstance:r})})}}]),v}();function su(e,t){return t.getConfiguration?function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(r){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(i).forEach(function(e){var t=r[e],n=i[e];Array.isArray(t)&&Array.isArray(n)?r[e]=cc([].concat(y(t),y(n))):_c(t)&&_c(n)?r[e]=a(t,n):r[e]=n}),r},{})}(e,t.getConfiguration(e)):e}var ou=Mc({name:"clear-refinements",connector:!0});function cu(u,r){return wc(u,ou()),function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(a.includedAttributes&&a.excludedAttributes)throw new Error(ou("The options `includedAttributes` and `excludedAttributes` cannot be used together."));var e=a.includedAttributes,s=void 0===e?[]:e,t=a.excludedAttributes,o=void 0===t?["query"]:t,n=a.transformItems,c=void 0===n?function(e){return e}:n;return{init:function(e){var t=e.helper,n=e.instantSearchInstance,r=e.createURL,i=0<uu({helper:t,includedAttributes:s,excludedAttributes:o,transformItems:c}).length;this._refine=function(){t.setState(yc({helper:t,attributesToClear:uu({helper:t,includedAttributes:s,excludedAttributes:o,transformItems:c})})).search()},this._createURL=function(){return r(yc({helper:t,attributesToClear:uu({helper:t,includedAttributes:s,excludedAttributes:o,transformItems:c})}))},u({hasRefinements:i,refine:this._refine,createURL:this._createURL,instantSearchInstance:n,widgetParams:a},!0)},render:function(e){var t=e.helper,n=e.instantSearchInstance,r=0<uu({helper:t,includedAttributes:s,excludedAttributes:o,transformItems:c}).length;u({hasRefinements:r,refine:this._refine,createURL:this._createURL,instantSearchInstance:n,widgetParams:a},!1)},dispose:function(){r()}}}}function uu(e){var t=e.helper,n=e.includedAttributes,r=e.excludedAttributes,i=e.transformItems,a=-1!==n.indexOf("query")||-1===r.indexOf("query");return i(gc(t.lastResults||{},t.state,a).map(function(e){return e.attributeName}).filter(function(e){return 0===n.length||-1!==n.indexOf(e)}).filter(function(e){return"query"===e&&a||-1===r.indexOf(e)}))}var lu=Mc({name:"current-refinements",connector:!0});function hu(h,n){return wc(h,lu()),function(){var o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(o.includedAttributes&&o.excludedAttributes)throw new Error(lu("The options `includedAttributes` and `excludedAttributes` cannot be used together."));var c=o.includedAttributes,e=o.excludedAttributes,u=void 0===e?["query"]:e,t=o.transformItems,l=void 0===t?function(e){return e}:t;return{init:function(e){var t=e.helper,n=e.createURL,r=e.instantSearchInstance,i=l(fu({results:{},state:t.state,helper:t,includedAttributes:c,excludedAttributes:u}));h({items:i,refine:function(e){return pu(t,e)},createURL:function(e){return n(du(t.state,e))},instantSearchInstance:r,widgetParams:o},!0)},render:function(e){var t=e.results,n=e.helper,r=e.state,i=e.createURL,a=e.instantSearchInstance,s=l(fu({results:t,state:r,helper:n,includedAttributes:c,excludedAttributes:u}));h({items:s,refine:function(e){return pu(n,e)},createURL:function(e){return i(du(n.state,e))},instantSearchInstance:a,widgetParams:o},!1)},dispose:function(){n()}}}}function fu(e){var t=e.results,n=e.state,r=e.helper,i=e.includedAttributes,a=e.excludedAttributes,s=-1!==(i||[]).indexOf("query")||-1===(a||[]).indexOf("query"),o=i?function(e){return-1!==i.indexOf(e.attributeName)}:function(e){return-1===a.indexOf(e.attributeName)};return function(n,r){return n.reduce(function(e,t){return[].concat(y(e.filter(function(e){return e.attribute!==t.attribute})),[{attribute:t.attribute,label:t.attribute,refinements:n.filter(function(e){return e.attribute===t.attribute}).sort(function(e,t){return"numeric"===e.type?e.value-t.value:0}),refine:function(e){return pu(r,e)}}])},[])}(gc(t,n,s).filter(o).map(mu),r)}function du(e,t){switch(t.type){case"facet":return e.removeFacetRefinement(t.attribute,t.value);case"disjunctive":return e.removeDisjunctiveFacetRefinement(t.attribute,t.value);case"hierarchical":return e.removeHierarchicalFacetRefinement(t.attribute);case"exclude":return e.removeExcludeRefinement(t.attribute,t.value);case"numeric":return e.removeNumericRefinement(t.attribute,t.operator,t.value);case"tag":return e.removeTagRefinement(t.value);case"query":return e.setQueryParameter("query","");default:throw new Error("clearRefinement: type ".concat(t.type," is not handled"))}}function pu(e,t){e.setState(du(e.state,t)).search()}function mu(e){var t="numeric"===e.type?Number(e.name):e.name,n=e.operator?"".concat(function(e){switch(e){case">=":return"≥";case"<=":return"≤";default:return e}}(e.operator)," ").concat(e.name):e.name,r={attribute:e.attributeName,type:e.type,value:t,label:n};return void 0!==e.operator&&(r.operator=e.operator),void 0!==e.count&&(r.count=e.count),void 0!==e.exhaustive&&(r.exhaustive=e.exhaustive),r}var vu=Mc({name:"hierarchical-menu",connector:!0});function gu(b,w){return wc(b,vu()),function(){var l=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=l.attributes,e=l.separator,a=void 0===e?" > ":e,t=l.rootPath,s=void 0===t?null:t,n=l.showParentLevel,o=void 0===n||n,r=l.limit,c=void 0===r?10:r,u=l.showMore,h=void 0!==u&&u,f=l.showMoreLimit,d=void 0===f?20:f,p=l.sortBy,m=void 0===p?["name:asc"]:p,v=l.transformItems,g=void 0===v?function(e){return e}:v;if(!i||!Array.isArray(i)||0===i.length)throw new Error(vu("The `attributes` option expects an array of strings."));if(!0===h&&d<=c)throw new Error(vu("The `showMoreLimit` option must be greater than `limit`."));var y=U(i,1)[0];return{isShowingMore:!1,toggleShowMore:function(){},cachedToggleShowMore:function(){this.toggleShowMore()},createToggleShowMore:function(e){var t=this;return function(){t.isShowingMore=!t.isShowingMore,t.render(e)}},getLimit:function(){return this.isShowingMore?d:c},getConfiguration:function(e){if(e.hierarchicalFacets){var t=pc(e.hierarchicalFacets,function(e){return e.name===y});if(t&&(!Cc(t.attributes,i)||t.separator!==a))return Ic(Cc(t.attributes,i)&&t.separator===a,"Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu."),{}}var n={hierarchicalFacets:[{name:y,attributes:i,separator:a,rootPath:s,showParentLevel:o}]},r=e.maxValuesPerFacet||0;return n.maxValuesPerFacet=Math.max(r,h?d:c),n},init:function(e){var t=e.helper,n=e.createURL,r=e.instantSearchInstance;this.cachedToggleShowMore=this.cachedToggleShowMore.bind(this),this._refine=function(e){t.toggleRefinement(y,e).search()},b({items:[],createURL:function(e){return n(t.state.toggleRefinement(y,e))},refine:this._refine,instantSearchInstance:r,widgetParams:l,isShowingMore:!1,toggleShowMore:this.cachedToggleShowMore,canToggleShowMore:!1},!0)},_prepareFacetValues:function(e,i){var a=this;return e.slice(0,this.getLimit()).map(function(e){var t=e.name,n=e.path,r=k(e,["name","path"]);return Array.isArray(r.data)&&(r.data=a._prepareFacetValues(r.data,i)),H({},r,{label:t,value:n})})},render:function(e){var t=e.results,n=e.state,r=e.createURL,i=e.instantSearchInstance,a=t.getFacetValues(y,{sortBy:m}).data||[],s=g(this._prepareFacetValues(a),n);var o=n.getQueryParameter("maxValuesPerFacet"),c=this.getLimit(),u=c<o?a.length<=c:a.length<c;this.toggleShowMore=this.createToggleShowMore(e),b({items:s,refine:this._refine,createURL:function(e){return r(n.toggleRefinement(y,e))},instantSearchInstance:i,widgetParams:l,isShowingMore:this.isShowingMore,toggleShowMore:this.cachedToggleShowMore,canToggleShowMore:h&&(this.isShowingMore||!u)},!1)},dispose:function(e){var t=e.state;w();var n=t;return t.isHierarchicalFacetRefined(y)&&(n=t.removeHierarchicalFacetRefinement(y)),(n=n.removeHierarchicalFacet(y)).maxValuesPerFacet===c&&n.setQueryParameters("maxValuesPerFacet",void 0),n},getWidgetState:function(e,t){var n=t.searchParameters.getHierarchicalFacetBreadcrumb(y);return n&&0!==n.length?e.hierarchicalMenu&&Cc(n,e.hierarchicalMenu[y])?e:H({},e,{hierarchicalMenu:H({},e.hierarchicalMenu,F({},y,n))}):e},getWidgetSearchParameters:function(e,t){var n=t.uiState;return n.hierarchicalMenu&&n.hierarchicalMenu[y]?e.clearRefinements(y).toggleRefinement(y,n.hierarchicalMenu[y].join(a)):e}}}}var yu=Mc({name:"hits",connector:!0});function bu(s,n){return wc(s,yu()),function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=r.escapeHTML,i=void 0===e||e,t=r.transformItems,a=void 0===t?function(e){return e}:t;return{getConfiguration:function(){return i?zc:void 0},init:function(e){var t=e.instantSearchInstance;s({hits:[],results:void 0,instantSearchInstance:t,widgetParams:r},!0)},render:function(e){var t=e.results,n=e.instantSearchInstance;i&&t.hits&&0<t.hits.length&&(t.hits=Gc(t.hits)),t.hits=Oc(t.hits,t.page,t.hitsPerPage),t.hits=Ac(t.hits,t.queryID),t.hits=a(t.hits),s({hits:t.hits,results:t,instantSearchInstance:n,widgetParams:r},!1)},dispose:function(){n()}}}}function wu(e){var t=e.method,n=e.results,r=e.hits,i=e.objectIDs,a=n.index,s=function(n,e){return e.map(function(t){var e=pc(n,function(e){return e.objectID===t});if(void 0===e)throw new Error('Could not find objectID "'.concat(t,'" passed to `clickedObjectIDsAfterSearch` in the returned hits. This is necessary to infer the absolute position and the query ID.'));return e})}(r,i),o=function(e){var t=cc(e.map(function(e){return e.__queryID}));if(1<t.length)throw new Error("Insights currently allows a single `queryID`. The `objectIDs` provided map to multiple `queryID`s.");var n=t[0];if("string"!=typeof n)throw new Error("Could not infer `queryID`. Ensure InstantSearch is configured with `clickAnalytics: true`");return n}(s);switch(t){case"clickedObjectIDsAfterSearch":return{index:a,queryID:o,objectIDs:i,positions:function(e){return e.map(function(e){return e.__position})}(s)};case"convertedObjectIDsAfterSearch":return{index:a,queryID:o,objectIDs:i};default:throw new Error('Unsupported method passed to insights: "'.concat(t,'".'))}}var Ru=function(r,i,a){return function(e,t){if(!Array.isArray(t.objectIDs))throw new TypeError("Expected `objectIDs` to be an array.");var n=wu({method:e,results:i,hits:a,objectIDs:t.objectIDs});r(e,H({},n,t))}};function Su(n){return function(e,t){return n(function(s){return function(e,t){var n=e.results,r=e.hits,i=e.instantSearchInstance;if(n&&r&&i&&i.insightsClient){var a=Ru(i.insightsClient,n,r);return s(H({},e,{insights:a}),t)}return s(e,t)}}(e),t)}}var Pu=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,o=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case h:case a:case o:case s:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case c:return e;default:return t}}case m:case p:case i:return t}}}function g(e){return v(e)===h}t.typeOf=v,t.AsyncMode=l,t.ConcurrentMode=h,t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=f,t.Fragment=a,t.Lazy=m,t.Memo=p,t.Portal=i,t.Profiler=o,t.StrictMode=s,t.Suspense=d,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===h||e===o||e===s||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===p||e.$$typeof===c||e.$$typeof===u||e.$$typeof===f)},t.isAsyncMode=function(e){return g(e)||v(e)===l},t.isConcurrentMode=g,t.isContextConsumer=function(e){return v(e)===u},t.isContextProvider=function(e){return v(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return v(e)===f},t.isFragment=function(e){return v(e)===a},t.isLazy=function(e){return v(e)===m},t.isMemo=function(e){return v(e)===p},t.isPortal=function(e){return v(e)===i},t.isProfiler=function(e){return v(e)===o},t.isStrictMode=function(e){return v(e)===s},t.isSuspense=function(e){return v(e)===d}});t(Pu);Pu.typeOf,Pu.AsyncMode,Pu.ConcurrentMode,Pu.ContextConsumer,Pu.ContextProvider,Pu.Element,Pu.ForwardRef,Pu.Fragment,Pu.Lazy,Pu.Memo,Pu.Portal,Pu.Profiler,Pu.StrictMode,Pu.Suspense,Pu.isValidElementType,Pu.isAsyncMode,Pu.isConcurrentMode,Pu.isContextConsumer,Pu.isContextProvider,Pu.isElement,Pu.isForwardRef,Pu.isFragment,Pu.isLazy,Pu.isMemo,Pu.isPortal,Pu.isProfiler,Pu.isStrictMode,Pu.isSuspense;var _u=n(function(e,t){});t(_u);_u.typeOf,_u.AsyncMode,_u.ConcurrentMode,_u.ContextConsumer,_u.ContextProvider,_u.Element,_u.ForwardRef,_u.Fragment,_u.Lazy,_u.Memo,_u.Portal,_u.Profiler,_u.StrictMode,_u.Suspense,_u.isValidElementType,_u.isAsyncMode,_u.isConcurrentMode,_u.isContextConsumer,_u.isContextProvider,_u.isElement,_u.isForwardRef,_u.isFragment,_u.isLazy,_u.isMemo,_u.isPortal,_u.isProfiler,_u.isStrictMode,_u.isSuspense,n(function(e){e.exports=Pu});var Nu=Object.getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Cu=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 r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()||Object.assign,Function.call.bind(Object.prototype.hasOwnProperty);function Fu(){}function Eu(){}Eu.resetWarningCache=Fu;var ju=n(function(e){e.exports=function(){function e(e,t,n,r,i,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,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Eu,resetWarningCache:Fu};return n.PropTypes=n}()}),Tu=function(){},Mu={},Iu=[],Lu=[];function ku(e,t){var n,r,i,a,s=Lu;for(a=arguments.length;2<a--;)Iu.push(arguments[a]);for(t&&null!=t.children&&(Iu.length||Iu.push(t.children),delete t.children);Iu.length;)if((r=Iu.pop())&&void 0!==r.pop)for(a=r.length;a--;)Iu.push(r[a]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&n?s[s.length-1]+=r:s===Lu?s=[r]:s.push(r),n=i;var o=new Tu;return o.nodeName=e,o.children=s,o.attributes=null==t?void 0:t,o.key=null==t?void 0:t.key,void 0!==Mu.vnode&&Mu.vnode(o),o}function Ou(e,t){for(var n in t)e[n]=t[n];return e}function Au(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}var Du="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var Hu=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Uu=[];function Bu(e){!e._dirty&&(e._dirty=!0)&&1==Uu.push(e)&&Du(Vu)}function Vu(){for(var e;e=Uu.pop();)e._dirty&&ol(e)}function Qu(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function qu(e){var t=Ou({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function Wu(e){var t=e.parentNode;t&&t.removeChild(e)}function zu(e,t,n,r,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)Au(n,null),Au(r,e);else if("class"!==t||i)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var a in n)a in r||(e.style[a]="");for(var a in r)e.style[a]="number"==typeof r[a]&&!1===Hu.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,Ku,s):e.removeEventListener(t,Ku,s),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!i&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var o=i&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?o?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(o?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function Ku(e){return this._listeners[e.type](Mu.event&&Mu.event(e)||e)}var Yu=[],$u=0,Gu=!1,Ju=!1;function Zu(){for(var e;e=Yu.shift();)e.componentDidMount&&e.componentDidMount()}function Xu(e,t,n,r,i,a){$u++||(Gu=null!=i&&void 0!==i.ownerSVGElement,Ju=null!=e&&!("__preactattr_"in e));var s=el(e,t,n,r,a);return i&&s.parentNode!==i&&i.appendChild(s),--$u||(Ju=!1,a||Zu()),s}function el(e,t,n,r,i){var a=e,s=Gu;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(a=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(a,e),tl(e,!0))),a.__preactattr_=!0,a;var o=t.nodeName;if("function"==typeof o)return function(e,t,n,r){var i=e&&e._component,a=i,s=e,o=i&&e._componentConstructor===t.nodeName,c=o,u=qu(t);for(;i&&!c&&(i=i._parentComponent);)c=i.constructor===t.nodeName;i&&c&&(!r||i._component)?(sl(i,u,3,n,r),e=i.base):(a&&!o&&(cl(a),e=s=null),i=il(t.nodeName,u,n),e&&!i.nextBase&&(i.nextBase=e,s=null),sl(i,u,1,n,r),e=i.base,s&&e!==s&&(s._component=null,tl(s,!1)));return e}(e,t,n,r);if(Gu="svg"===o||"foreignObject"!==o&&Gu,o=String(o),(!e||!Qu(e,o))&&(a=function(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}(o,Gu),e)){for(;e.firstChild;)a.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(a,e),tl(e,!0)}var c=a.firstChild,u=a.__preactattr_,l=t.children;if(null==u){u=a.__preactattr_={};for(var h=a.attributes,f=h.length;f--;)u[h[f].name]=h[f].value}return!Ju&&l&&1===l.length&&"string"==typeof l[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=l[0]&&(c.nodeValue=l[0]):(l&&l.length||null!=c)&&function(e,t,n,r,i){var a,s,o,c,u,l=e.childNodes,h=[],f={},d=0,p=0,m=l.length,v=0,g=t?t.length:0;if(0!==m)for(var y=0;y<m;y++){var b=l[y],w=b.__preactattr_;null!=(R=g&&w?b._component?b._component.__key:w.key:null)?(d++,f[R]=b):(w||(void 0!==b.splitText?!i||b.nodeValue.trim():i))&&(h[v++]=b)}if(0!==g)for(y=0;y<g;y++){var R;if(c=t[y],(u=null)!=(R=c.key))d&&void 0!==f[R]&&(u=f[R],f[R]=void 0,d--);else if(p<v)for(a=p;a<v;a++)if(void 0!==h[a]&&(S=s=h[a],_=i,"string"==typeof(P=c)||"number"==typeof P?void 0!==S.splitText:"string"==typeof P.nodeName?!S._componentConstructor&&Qu(S,P.nodeName):_||S._componentConstructor===P.nodeName)){u=s,h[a]=void 0,a===v-1&&v--,a===p&&p++;break}u=el(u,c,n,r),o=l[y],u&&u!==e&&u!==o&&(null==o?e.appendChild(u):u===o.nextSibling?Wu(o):e.insertBefore(u,o))}var S,P,_;if(d)for(var y in f)void 0!==f[y]&&tl(f[y],!1);for(;p<=v;)void 0!==(u=h[v--])&&tl(u,!1)}(a,l,n,r,Ju||null!=u.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||zu(e,r,n[r],n[r]=void 0,Gu);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||zu(e,r,n[r],n[r]=t[r],Gu)}(a,t.attributes,u),Gu=s,a}function tl(e,t){var n=e._component;n?cl(n):(null!=e.__preactattr_&&Au(e.__preactattr_.ref,null),!1!==t&&null!=e.__preactattr_||Wu(e),nl(e))}function nl(e){for(e=e.lastChild;e;){var t=e.previousSibling;tl(e,!0),e=t}}var rl=[];function il(e,t,n){var r,i=rl.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),ul.call(r,t,n)):((r=new ul(t,n)).constructor=e,r.render=al);i--;)if(rl[i].constructor===e)return r.nextBase=rl[i].nextBase,rl.splice(i,1),r;return r}function al(e,t,n){return this.constructor(e,n)}function sl(e,t,n,r,i){e._disable||(e._disable=!0,e.__ref=t.ref,e.__key=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===Mu.syncComponentUpdates&&e.base?Bu(e):ol(e,1,i)),Au(e.__ref,e))}function ol(e,t,n,r){if(!e._disable){var i,a,s,o=e.props,c=e.state,u=e.context,l=e.prevProps||o,h=e.prevState||c,f=e.prevContext||u,d=e.base,p=e.nextBase,m=d||p,v=e._component,g=!1,y=f;if(e.constructor.getDerivedStateFromProps&&(c=Ou(Ou({},c),e.constructor.getDerivedStateFromProps(o,c)),e.state=c),d&&(e.props=l,e.state=h,e.context=f,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(o,c,u)?g=!0:e.componentWillUpdate&&e.componentWillUpdate(o,c,u),e.props=o,e.state=c,e.context=u),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!g){i=e.render(o,c,u),e.getChildContext&&(u=Ou(Ou({},u),e.getChildContext())),d&&e.getSnapshotBeforeUpdate&&(y=e.getSnapshotBeforeUpdate(l,h));var b,w,R=i&&i.nodeName;if("function"==typeof R){var S=qu(i);(a=v)&&a.constructor===R&&S.key==a.__key?sl(a,S,1,u,!1):(b=a,e._component=a=il(R,S,u),a.nextBase=a.nextBase||p,a._parentComponent=e,sl(a,S,0,u,!1),ol(a,1,n,!0)),w=a.base}else s=m,(b=v)&&(s=e._component=null),!m&&1!==t||(s&&(s._component=null),w=Xu(s,i,u,n||!d,m&&m.parentNode,!0));if(m&&w!==m&&a!==v){var P=m.parentNode;P&&w!==P&&(P.replaceChild(w,m),b||(m._component=null,tl(m,!1)))}if(b&&cl(b),(e.base=w)&&!r){for(var _=e,N=e;N=N._parentComponent;)(_=N).base=w;w._component=_,w._componentConstructor=_.constructor}}for(!d||n?Yu.push(e):g||e.componentDidUpdate&&e.componentDidUpdate(l,h,y);e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);$u||r||Zu()}}function cl(e){var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?cl(n):t&&(null!=t.__preactattr_&&Au(t.__preactattr_.ref,null),Wu(e.nextBase=t),rl.push(e),nl(t)),Au(e.__ref,null)}function ul(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}function ll(e,t,n){return Xu(n,e,{},!1,t,!1)}Ou(ul.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=Ou(Ou({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),Bu(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),ol(this,2)},render:function(){}});var hl="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),fl="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,dl="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("__preactCompatWrapper"):"__preactCompatWrapper",pl={constructor:1,render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},ml=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/,vl={},gl=!1;try{gl=!1}catch(e){}function yl(){return null}var bl=ku("a",null).constructor;bl.prototype.$$typeof=fl,bl.prototype.preactCompatUpgraded=!1,bl.prototype.preactCompatNormalized=!1,Object.defineProperty(bl.prototype,"type",{get:function(){return this.nodeName},set:function(e){this.nodeName=e},configurable:!0}),Object.defineProperty(bl.prototype,"props",{get:function(){return this.attributes},set:function(e){this.attributes=e},configurable:!0});var wl=Mu.event;Mu.event=function(e){return wl&&(e=wl(e)),e.persist=Object,e.nativeEvent=e};var Rl=Mu.vnode;function Sl(e,t,n){var r=t&&t._preactCompatRendered&&t._preactCompatRendered.base;r&&r.parentNode!==t&&(r=null),!r&&t&&(r=t.firstElementChild);for(var i=t.childNodes.length;i--;)t.childNodes[i]!==r&&t.removeChild(t.childNodes[i]);var a=ll(e,t,r);return t&&(t._preactCompatRendered=a&&(a._component||{base:a})),"function"==typeof n&&n(),a&&a._component||a}Mu.vnode=function(e){if(!e.preactCompatUpgraded){e.preactCompatUpgraded=!0;var t=e.nodeName,n=e.attributes=null==e.attributes?{}:Dl({},e.attributes);"function"==typeof t?(!0===t[dl]||t.prototype&&"isReactComponent"in t.prototype)&&(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),e.preactCompatNormalized||kl(e),function(e){var t=e.nodeName,n=e.attributes;e.attributes={},t.defaultProps&&Dl(e.attributes,t.defaultProps);n&&Dl(e.attributes,n)}(e)):(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),n.defaultValue&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),function(e,t){var n,r,i;if(t){for(i in t)if(n=ml.test(i))break;if(n)for(i in r=e.attributes={},t)t.hasOwnProperty(i)&&(r[ml.test(i)?i.replace(/([A-Z0-9])/,"-$1").toLowerCase():i]=t[i])}}(e,n))}Rl&&Rl(e)};var Pl=function(){};function _l(e,t,n,r){var i=Sl(ku(Pl,{context:e.context},t),n),a=i._component||i.base;return r&&r.call(a,i),a}function Nl(e){_l(this,e.vnode,e.container)}function xl(e){var t=e._preactCompatRendered&&e._preactCompatRendered.base;return!(!t||t.parentNode!==e)&&(ll(ku(yl),e,t),!0)}Pl.prototype.getChildContext=function(){return this.props.context},Pl.prototype.render=function(e){return e.children[0]};var Cl,Fl=[],El={map:function(e,t,n){return null==e?null:(e=El.toArray(e),n&&n!==e&&(t=t.bind(n)),e.map(t))},forEach:function(e,t,n){if(null==e)return null;e=El.toArray(e),n&&n!==e&&(t=t.bind(n)),e.forEach(t)},count:function(e){return e&&e.length||0},only:function(e){if(1!==(e=El.toArray(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:function(e){return null==e?[]:Fl.concat(e)}};function jl(e){return Ll.bind(null,e)}for(var Tl={},Ml=hl.length;Ml--;)Tl[hl[Ml]]=jl(hl[Ml]);function Il(e){var t=e[dl];return t?!0===t?e:t:(t=function(e){return Bl({displayName:e.displayName||e.name,render:function(){return e(this.props,this.context)}})}(e),Object.defineProperty(t,dl,{configurable:!0,value:!0}),t.displayName=e.displayName,t.propTypes=e.propTypes,t.defaultProps=e.defaultProps,Object.defineProperty(e,dl,{configurable:!0,value:t}),t)}function Ll(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function e(t,n){for(var r=n||0;r<t.length;r++){var i=t[r];Array.isArray(i)?e(i):i&&"object"==typeof i&&!Ol(i)&&(i.props&&i.type||i.attributes&&i.nodeName||i.children)&&(t[r]=Ll(i.type||i.nodeName,i.props||i.attributes,i.children))}}(e,2),kl(ku.apply(void 0,e))}function kl(e){e.preactCompatNormalized=!0,function(e){var t=e.attributes||(e.attributes={});Al.enumerable="className"in t,t.className&&(t.class=t.className);Object.defineProperty(t,"className",Al)}(e),function(e){return"function"==typeof e&&!(e.prototype&&e.prototype.render)}(e.nodeName)&&(e.nodeName=Il(e.nodeName));var t=e.attributes.ref,n=t&&typeof t;return!Cl||"string"!==n&&"number"!==n||(e.attributes.ref=function(t,n){return n._refProxies[t]||(n._refProxies[t]=function(e){n&&n.refs&&null===(n.refs[t]=e)&&(delete n._refProxies[t],n=null)})}(t,Cl)),function(e){var t=e.nodeName,n=e.attributes;if(!n||"string"!=typeof t)return;var r={};for(var i in n)r[i.toLowerCase()]=i;r.ondoubleclick&&(n.ondblclick=n[r.ondoubleclick],delete n[r.ondoubleclick]);if(r.onchange&&("textarea"===t||"input"===t.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var a=r.oninput||"oninput";n[a]||(n[a]=Ql([n[a],n[r.onchange]]),delete n[r.onchange])}}(e),e}function Ol(e){return e&&(e instanceof bl||e.$$typeof===fl)}var Al={configurable:!0,get:function(){return this.class},set:function(e){this.class=e}};function Dl(e,t){for(var n=arguments,r=1,i=void 0;r<arguments.length;r++)if(i=n[r])for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a]);return e}function Hl(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}function Ul(){}function Bl(e){function t(e,t){!function(e){for(var t in e){var n=e[t];"function"!=typeof n||n.__bound||pl.hasOwnProperty(t)||((e[t]=n.bind(e)).__bound=!0)}}(this),Yl.call(this,e,t,vl),ql.call(this,e,t)}return(e=Dl({constructor:t},e)).mixins&&function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=Ql(t[n].concat(e[n]||Fl),"getDefaultProps"===n||"getInitialState"===n||"getChildContext"===n))}(e,function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];for(var i in r)r.hasOwnProperty(i)&&"function"==typeof r[i]&&(t[i]||(t[i]=[])).push(r[i])}return t}(e.mixins)),e.statics&&Dl(t,e.statics),e.propTypes&&(t.propTypes=e.propTypes),e.defaultProps&&(t.defaultProps=e.defaultProps),e.getDefaultProps&&(t.defaultProps=e.getDefaultProps.call(t)),Ul.prototype=Yl.prototype,t.prototype=Dl(new Ul,e),t.displayName=e.displayName||"Component",t}function Vl(e,t,n){if("string"==typeof t&&(t=e.constructor.prototype[t]),"function"==typeof t)return t.apply(e,n)}function Ql(a,s){return function(){for(var e,t=arguments,n=0;n<a.length;n++){var r=Vl(this,a[n],t);if(s&&null!=r)for(var i in e||(e={}),r)r.hasOwnProperty(i)&&(e[i]=r[i]);else void 0!==r&&(e=r)}return e}}function ql(e,t){Wl.call(this,e,t),this.componentWillReceiveProps=Ql([Wl,this.componentWillReceiveProps||"componentWillReceiveProps"]),this.render=Ql([Wl,zl,this.render||"render",Kl])}function Wl(e,t){if(e){var n=e.children;if(n&&Array.isArray(n)&&1===n.length&&("string"==typeof n[0]||"function"==typeof n[0]||n[0]instanceof bl)&&(e.children=n[0],e.children&&"object"==typeof e.children&&(e.children.length=1,e.children[0]=e.children)),gl){var r="function"==typeof this?this:this.constructor,i=this.propTypes||r.propTypes,a=this.displayName||r.name;i&&ju.checkPropTypes(i,e,"prop",a)}}}function zl(e){Cl=this}function Kl(){Cl===this&&(Cl=null)}function Yl(e,t,n){ul.call(this,e,t),this.state=this.getInitialState?this.getInitialState():{},this.refs={},this._refProxies={},n!==vl&&ql.call(this,e,t)}function $l(e,t){Yl.call(this,e,t)}Dl(Yl.prototype=new ul,{constructor:Yl,isReactComponent:{},replaceState:function(e,t){for(var n in this.setState(e,t),this.state)n in e||delete this.state[n]},getDOMNode:function(){return this.base},isMounted:function(){return!!this.base}}),Ul.prototype=Yl.prototype,($l.prototype=new Ul).isPureReactComponent=!0,$l.prototype.shouldComponentUpdate=function(e,t){return Hl(this.props,e)||Hl(this.state,t)};function Gl(e){return function(i){return Jl.createElement("div",{onClick:function(e){if(function(e){return e.hasAttribute("data-insights-method")}(e.target)){if(!i.insights)throw new Error("The `insightsClient` option has not been provided to `instantsearch`.");var t=function(e){var t=e.getAttribute("data-insights-method"),n=e.getAttribute("data-insights-payload");if("string"!=typeof n)throw new Error("The insights helper expects `data-insights-payload` to be a base64-encoded JSON string.");try{return{method:t,payload:JSON.parse(atob(n))}}catch(e){throw new Error("The insights helper was unable to parse `data-insights-payload`.")}}(e.target),n=t.method,r=t.payload;i.insights(n,r)}}},Jl.createElement(e,i))}}var Jl={version:"15.1.0",DOM:Tl,PropTypes:ju,Children:El,render:Sl,hydrate:Sl,createClass:Bl,createPortal:function(e,t){return ku(Nl,{vnode:e,container:t})},createFactory:jl,createElement:Ll,cloneElement:function(e,t){for(var n=[],r=arguments.length-2;0<r--;)n[r]=arguments[r+2];if(!Ol(e))return e;var i=e.attributes||e.props,a=[ku(e.nodeName||e.type,Dl({},i),e.children||i&&i.children),t];return n&&n.length?a.push(n):t&&t.children&&a.push(t.children),kl(function(e,t){return ku(e.nodeName,Ou(Ou({},e.attributes),t),2<arguments.length?[].slice.call(arguments,2):e.children)}.apply(void 0,a))},createRef:function(){return{}},isValidElement:Ol,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},unmountComponentAtNode:xl,Component:Yl,PureComponent:$l,unstable_renderSubtreeIntoContainer:_l,unstable_batchedUpdates:function(e){e()},__spread:Dl},Zl=Su(bu),Xl=Mc({name:"hits-per-page",connector:!0});function eh(c,i){return wc(c,Xl()),function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=a.items,t=a.transformItems,s=void 0===t?function(e){return e}:t,o=e;if(!Array.isArray(o))throw new Error(Xl("The `items` option expects an array of objects."));var n=o.filter(function(e){return e.default});if(1<n.length)throw new Error(Xl("More than one default value is specified in `items`."));var r=pc(e,function(e){return!0===e.default});return{getConfiguration:function(){return 0<n.length?{hitsPerPage:n[0].value}:{}},init:function(e){var t=e.helper,n=e.createURL,r=e.state,i=e.instantSearchInstance;o.some(function(e){return Number(r.hitsPerPage)===Number(e.value)})||(Ic(void 0!==r.hitsPerPage,"\n`hitsPerPage` is not defined.\nThe option `hitsPerPage` needs to be set using the `configure` widget.\n\nLearn more: https://community.algolia.com/instantsearch.js/v2/widgets/configure.html\n            "),Ic(!1,'\nThe `items` option of `hitsPerPage` does not contain the "hits per page" value coming from the state: '.concat(r.hitsPerPage,".\n\nYou may want to add another entry to the `items` option with this value.")),o=[{value:"",label:""}].concat(y(o))),this.setHitsPerPage=function(e){return e||0===e?t.setQueryParameter("hitsPerPage",e).search():t.setQueryParameter("hitsPerPage",void 0).search()},this.createURL=function(t){return function(e){return n(t.setQueryParameter("hitsPerPage",e||0===e?e:void 0))}},c({items:s(this._normalizeItems(r)),refine:this.setHitsPerPage,createURL:this.createURL(t.state),hasNoResults:!0,widgetParams:a,instantSearchInstance:i},!0)},render:function(e){var t=e.state,n=e.results,r=e.instantSearchInstance,i=0===n.nbHits;c({items:s(this._normalizeItems(t)),refine:this.setHitsPerPage,createURL:this.createURL(t),hasNoResults:i,widgetParams:a,instantSearchInstance:r},!1)},_normalizeItems:function(e){var t=e.hitsPerPage;return o.map(function(e){return H({},e,{isRefined:Number(e.value)===Number(t)})})},dispose:function(){i()},getWidgetState:function(e,t){var n=t.searchParameters.hitsPerPage;return r&&n===r.value||void 0===n||e.hitsPerPage===n?e:H({},e,{hitsPerPage:n})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return n.hitsPerPage?e.setQueryParameter("hitsPerPage",n.hitsPerPage):r?e.setQueryParameter("hitsPerPage",r.value):e.setQueryParameter("hitsPerPage",void 0)}}}}function th(g){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Sc;return wc(g,nh()),function(c){var u,l,h,e=c||{},t=e.escapeHTML,f=void 0===t||t,n=e.transformItems,d=void 0===n?function(e){return e}:n,r=e.showPrevious,i=void 0!==r&&r,p=[],m=1/0,v=-1;return{getConfiguration:function(){return f?zc:{}},init:function(e){var t=e.instantSearchInstance,n=e.helper;l=function(e){return function(){e.overrideStateWithoutTriggeringChangeEvent(H({},e.state,{page:m-1})).search()}}(n),h=function(e){return function(){e.setPage(v+1).search()}}(n),m=n.state.page,v=n.state.page,g({hits:p,results:void 0,showPrevious:l,showMore:h,isFirstPage:0===m,isLastPage:!0,instantSearchInstance:t,widgetParams:c},!0)},render:function(e){var t=e.results,n=e.state,r=e.instantSearchInstance,i=n.page,a=k(n,["page"]);Cc(a,u)||(p=[],v=m=i,u=a),f&&t.hits&&0<t.hits.length&&(t.hits=Gc(t.hits)),t.hits=Oc(t.hits,t.page,t.hitsPerPage),t.hits=Ac(t.hits,t.queryID),t.hits=d(t.hits),v<i||!p.length?(p=[].concat(y(p),y(t.hits)),v=i):i<m&&(p=[].concat(y(t.hits),y(p)),m=i);var s=0===m,o=t.nbPages<=t.page+1;g({hits:p,results:t,showPrevious:l,showMore:h,isFirstPage:s,isLastPage:o,instantSearchInstance:r,widgetParams:c},!1)},dispose:function(){a()},getWidgetState:function(e,t){var n=t.searchParameters.page;return i&&0!==n&&n+1!==e.page?H({},e,{page:n+1}):e},getWidgetSearchParameters:function(e,t){var n=t.uiState;if(!i)return e;var r=n.page;return r?e.setQueryParameter("page",r-1):e.setQueryParameter("page",0)}}}}var nh=Mc({name:"infinite-hits",connector:!0}),rh=Su(th),ih=Mc({name:"menu",connector:!0});function ah(f,d){return wc(f,ih()),function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},s=a.attribute,e=a.limit,r=void 0===e?10:e,t=a.showMore,o=void 0!==t&&t,n=a.showMoreLimit,i=void 0===n?20:n,c=a.sortBy,u=void 0===c?["isRefined","name:asc"]:c,l=a.transformItems,h=void 0===l?function(e){return e}:l;if(!s)throw new Error(ih("The `attribute` option is required."));if(!0===o&&i<=r)throw new Error(ih("The `showMoreLimit` option must be greater than `limit`."));return{isShowingMore:!1,toggleShowMore:function(){},cachedToggleShowMore:function(){this.toggleShowMore()},createToggleShowMore:function(e){var t=this,n=e.results,r=e.instantSearchInstance;return function(){t.isShowingMore=!t.isShowingMore,t.render({results:n,instantSearchInstance:r})}},getLimit:function(){return this.isShowingMore?i:r},refine:function(n){return function(e){var t=U(n.getHierarchicalFacetBreadcrumb(s),1)[0];n.toggleRefinement(s,e||t).search()}},getConfiguration:function(e){var t={hierarchicalFacets:[{name:s,attributes:[s]}]},n=e.maxValuesPerFacet||0;return t.maxValuesPerFacet=Math.max(n,o?i:r),t},init:function(e){var t=e.helper,n=e.createURL,r=e.instantSearchInstance;this.cachedToggleShowMore=this.cachedToggleShowMore.bind(this),this._createURL=function(e){return n(t.state.toggleRefinement(s,e))},this._refine=this.refine(t),f({items:[],createURL:this._createURL,refine:this._refine,instantSearchInstance:r,canRefine:!1,widgetParams:a,isShowingMore:this.isShowingMore,toggleShowMore:this.cachedToggleShowMore,canToggleShowMore:!1},!0)},render:function(e){var t=e.results,n=e.instantSearchInstance,r=t.getFacetValues(s,{sortBy:u}).data||[],i=h(r.slice(0,this.getLimit()).map(function(e){var t=e.name,n=e.path;return H({},k(e,["name","path"]),{label:t,value:n})}));this.toggleShowMore=this.createToggleShowMore({results:t,instantSearchInstance:n}),f({items:i,createURL:this._createURL,refine:this._refine,instantSearchInstance:n,canRefine:0<i.length,widgetParams:a,isShowingMore:this.isShowingMore,toggleShowMore:this.cachedToggleShowMore,canToggleShowMore:o&&(this.isShowingMore||r.length>this.getLimit())},!1)},dispose:function(e){var t=e.state;d();var n=t;return t.isHierarchicalFacetRefined(s)&&(n=t.removeHierarchicalFacetRefinement(s)),((n=n.removeHierarchicalFacet(s)).maxValuesPerFacet===r||i&&n.maxValuesPerFacet===i)&&n.setQueryParameters("maxValuesPerFacet",void 0),n},getWidgetState:function(e,t){var n=U(t.searchParameters.getHierarchicalFacetBreadcrumb(s),1)[0];return!n||e.menu&&e.menu[s]===n?e:H({},e,{menu:H({},e.menu,F({},s,n))})},getWidgetSearchParameters:function(e,t){var n=t.uiState;if(n.menu&&n.menu[s]){var r=n.menu[s];return e.isHierarchicalFacetRefined(s,r)?e:e.toggleRefinement(s,r)}if(e.isHierarchicalFacetRefined(s)){var i=U(e.getHierarchicalFacetBreadcrumb(s),1)[0];return e.toggleRefinement(s,i)}return e}}}}var sh=Mc({name:"numeric-menu",connector:!0});function oh(o,n){return wc(o,sh()),function(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},u=i.attribute,a=i.items,e=i.transformItems,s=void 0===e?function(e){return e}:e;if(!u)throw new Error(sh("The `attribute` option is required."));if(!a)throw new Error(sh("The `items` option expects an array of objects."));return{init:function(e){var n=e.helper,r=e.createURL,t=e.instantSearchInstance;this._refine=function(e){var t=uh(n.state,u,a,e);n.setState(t).search()},this._createURL=function(t){return function(e){return r(uh(t,u,a,e))}},this._prepareItems=function(r){return a.map(function(e){var t=e.start,n=e.end;return{label:e.label,value:window.encodeURI(JSON.stringify({start:t,end:n})),isRefined:ch(r,u,{start:t,end:n})}})},o({createURL:this._createURL(n.state),items:s(this._prepareItems(n.state)),hasNoResults:!0,refine:this._refine,instantSearchInstance:t,widgetParams:i},!0)},render:function(e){var t=e.results,n=e.state,r=e.instantSearchInstance;o({createURL:this._createURL(n),items:s(this._prepareItems(n)),hasNoResults:0===t.nbHits,refine:this._refine,instantSearchInstance:r,widgetParams:i},!1)},dispose:function(e){var t=e.state;return n(),t.clearRefinements(u)},getWidgetState:function(e,t){var n=t.searchParameters.getNumericRefinements(u),r=n["="]&&n["="][0];if(r||0===r)return H({},e,{numericMenu:H({},e.numericMenu,F({},u,"".concat(n["="])))});var i=n[">="]&&n[">="][0]||"",a=n["<="]&&n["<="][0]||"";return""!==i||""!==a?e.numericMenu&&e.numericMenu[u]==="".concat(i,":").concat(a)?e:H({},e,{numericMenu:H({},e.numericMenu,F({},u,"".concat(i,":").concat(a)))}):e},getWidgetSearchParameters:function(e,t){var n=t.uiState,r=e.clearRefinements(u),i=n.numericMenu&&n.numericMenu[u];if(!i)return r;var a=-1===i.indexOf(":")&&i;if(a)return r.addNumericRefinement(u,"=",a);var s=U(i.split(":").map(parseFloat),2),o=s[0],c=s[1];return Pc(o)&&(r=r.addNumericRefinement(u,">=",o)),Pc(c)&&(r=r.addNumericRefinement(u,"<=",c)),r}}}}function ch(e,t,n){var r=e.getNumericRefinements(t);return void 0!==n.start&&void 0!==n.end&&n.start===n.end?lh(r,"=",n.start):void 0!==n.start?lh(r,">=",n.start):void 0!==n.end?lh(r,"<=",n.end):void 0===n.start&&void 0===n.end?0===Object.keys(r).length:void 0}function uh(e,t,n,r){var i=e,a=JSON.parse(window.decodeURI(r)),s=i.getNumericRefinements(t);if(void 0===a.start&&void 0===a.end)return i.clearRefinements(t);if(ch(i,t,a)||(i=i.clearRefinements(t)),void 0!==a.start&&void 0!==a.end){if(a.start>a.end)throw new Error("option.start should be > to option.end");if(a.start===a.end)return i=lh(s,"=",a.start)?i.removeNumericRefinement(t,"=",a.start):i.addNumericRefinement(t,"=",a.start)}return void 0!==a.start&&(i=lh(s,">=",a.start)?i.removeNumericRefinement(t,">=",a.start):i.addNumericRefinement(t,">=",a.start)),void 0!==a.end&&(i=lh(s,"<=",a.end)?i.removeNumericRefinement(t,"<=",a.end):i.addNumericRefinement(t,"<=",a.end)),i.page=0,i}function lh(e,t,n){return void 0!==e[t]&&e[t].includes(n)}var hh=function(){function t(e){T(this,t),this.currentPage=e.currentPage,this.total=e.total,this.padding=e.padding}return M(t,[{key:"pages",value:function(){var e=this.total,t=this.currentPage,n=this.padding;if(0===e)return[0];var r=this.nbPagesDisplayed(n,e);if(r===e)return Nc({end:e});var i=this.calculatePaddingLeft(t,n,e,r);return Nc({start:t-i,end:t+(r-i)})}},{key:"nbPagesDisplayed",value:function(e,t){return Math.min(2*e+1,t)}},{key:"calculatePaddingLeft",value:function(e,t,n,r){return e<=t?e:n-t<=e?r-(n-e):t}},{key:"isLastPage",value:function(){return this.currentPage===this.total-1}},{key:"isFirstPage",value:function(){return 0===this.currentPage}}]),t}(),fh=Mc({name:"pagination",connector:!0});function dh(o,t){return wc(o,fh()),function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=a.totalPages,e=a.padding,s=new hh({currentPage:0,total:0,padding:void 0===e?3:e});return{init:function(e){var t=e.helper,n=e.createURL,r=e.instantSearchInstance;this.refine=function(e){t.setPage(e),t.search()},this.createURL=function(t){return function(e){return n(t.setPage(e))}},o({createURL:this.createURL(t.state),currentRefinement:t.getPage()||0,nbHits:0,nbPages:0,pages:[],isFirstPage:!0,isLastPage:!0,refine:this.refine,widgetParams:a,instantSearchInstance:r},!0)},getMaxPage:function(e){var t=e.nbPages;return void 0!==n?Math.min(n,t):t},render:function(e){var t=e.results,n=e.state,r=e.instantSearchInstance,i=this.getMaxPage(t);s.currentPage=n.page,s.total=i,o({createURL:this.createURL(n),currentRefinement:n.page,refine:this.refine,nbHits:t.nbHits,nbPages:i,pages:s.pages(),isFirstPage:s.isFirstPage(),isLastPage:s.isLastPage(),widgetParams:a,instantSearchInstance:r},!1)},dispose:function(){t()},getWidgetState:function(e,t){var n=t.searchParameters.page;return 0===n||n+1===e.page?e:H({},e,{page:n+1})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return n.page?e.setQueryParameter("page",n.page-1):e.setQueryParameter("page",0)}}}}var ph=Mc({name:"range-input",connector:!0},{name:"range-slider",connector:!0});function mh(h,n){return wc(h,ph()),function(){var c=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},S=c.attribute,P=c.min,_=c.max,e=c.precision,u=void 0===e?2:e;if(!S)throw new Error(ph("The `attribute` option is required."));function N(e){return Number(Number(e).toFixed(u))}var x=Pc(P),C=Pc(_),l={from:function(e){return e},to:function(e){return N(e).toLocaleString()}};return{_getCurrentRange:function(e){var t,n,r=Math.pow(10,u);return t=x?P:Pc(e.min)?e.min:0,n=C?_:Pc(e.max)?e.max:0,{min:Math.floor(t*r)/r,max:Math.ceil(n*r)/r}},_getCurrentRefinement:function(e){var t=U(e.getNumericRefinement(S,">=")||[],1)[0],n=U(e.getNumericRefinement(S,"<=")||[],1)[0];return[Pc(t)?t:-1/0,Pc(n)?n:1/0]},_refine:function(w,R){return function(){var e,t,n=U(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],2),r=n[0],i=n[1],a=R.min,s=R.max,o=U(w.getNumericRefinement(S,">=")||[],1)[0],c=U(w.getNumericRefinement(S,"<=")||[],1)[0],u=void 0===r||""===r,l=void 0===i||""===i,h=u?void 0:parseFloat(r),f=l?void 0:parseFloat(i);t=C||s!==f?C&&l?_:f:void 0;var d=void 0===(e=x||a!==h?x&&u?P:h:void 0),p=Pc(e),m=Pc(a),v=d||p&&(!m||m&&a<=e),g=void 0===t,y=Pc(t),b=Pc(s);(o!==e||c!==t)&&v&&(g||y&&(!b||b&&t<=s))&&(w.clearRefinements(S),p&&w.addNumericRefinement(S,">=",N(e)),y&&w.addNumericRefinement(S,"<=",N(t)),w.search())}},getConfiguration:function(e){var t={disjunctiveFacets:[S]},n=x||C,r=e&&e.numericRefinements&&void 0!==e.numericRefinements[S],i=Pc(P),a=Pc(_);return n&&!r&&(i&&a?P<_:i||a)&&(t.numericRefinements=F({},S,{}),x&&(t.numericRefinements[S][">="]=[P]),C&&(t.numericRefinements[S]["<="]=[_])),t},init:function(e){var t=e.helper,n=e.instantSearchInstance,r=this._getCurrentRange({}),i=this._getCurrentRefinement(t);h({refine:this._refine(t,{}),format:l,range:r,widgetParams:H({},c,{precision:u}),start:i,instantSearchInstance:n},!0)},render:function(e){var t=e.results,n=e.helper,r=e.instantSearchInstance,i=pc(t.disjunctiveFacets||[],function(e){return e.name===S}),a=i&&i.stats||{},s=this._getCurrentRange(a),o=this._getCurrentRefinement(n);h({refine:this._refine(n,s),format:l,range:s,widgetParams:H({},c,{precision:u}),start:o,instantSearchInstance:r},!1)},dispose:function(e){var t=e.state;return n(),t.removeNumericRefinement(S).removeDisjunctiveFacet(S)},getWidgetState:function(e,t){var n=t.searchParameters.getNumericRefinements(S),r=n[">="],i=void 0===r?"":r,a=n["<="],s=void 0===a?"":a;return""===i&&""===s||e&&e.range&&e.range[S]==="".concat(i,":").concat(s)?e:H({},e,{range:H({},e.range,F({},S,"".concat(i,":").concat(s)))})},getWidgetSearchParameters:function(e,t){var n=t.uiState,r=n&&n.range&&n.range[S];if(!r||-1===r.indexOf(":"))return e;var i=e.getNumericRefinements(S),a=i[">="],s=void 0===a?[NaN]:a,o=i["<="],c=void 0===o?[NaN]:o,u=e.clearRefinements(S),l=U(r.split(":").map(parseFloat),2),h=l[0],f=l[1];return s.includes(h)&&c.includes(f)?e:(Pc(h)&&(u=u.addNumericRefinement(S,">=",h)),Pc(f)&&(u=u.addNumericRefinement(S,"<=",f)),u)}}}}var vh=Mc({name:"refinement-list",connector:!0});function gh(S,P){return wc(S,vh()),function(){var d=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},p=d.attribute,e=d.operator,i=void 0===e?"or":e,t=d.limit,c=void 0===t?10:t,n=d.showMore,m=void 0!==n&&n,r=d.showMoreLimit,a=void 0===r?20:r,s=d.sortBy,l=void 0===s?["isRefined","count:desc","name:asc"]:s,o=d.escapeFacetValues,u=void 0===o||o,h=d.transformItems,f=void 0===h?function(e){return e}:h;if(!p)throw new Error(vh("The `attribute` option is required."));if(!/^(and|or)$/.test(i))throw new Error(vh('The `operator` must one of: `"and"`, `"or"` (got "'.concat(i,'").')));if(!0===m&&a<=c)throw new Error(vh("`showMoreLimit` should be greater than `limit`."));function v(e){var t=e.name;return H({},k(e,["name"]),{label:t,value:t,highlighted:t})}function g(e){var t=e.items,n=e.state,r=e.createURL,i=e.helperSpecializedSearchFacetValues,a=e.refine,s=e.isFromSearch,o=e.isFirstSearch,c=e.isShowingMore,u=e.toggleShowMore,l=e.hasExhaustiveItems,h=e.instantSearchInstance,f=i&&i(n,r,i,a,h);S({createURL:function(e){return r(n.toggleRefinement(p,e))},items:t,refine:a,searchForItems:f,instantSearchInstance:h,isFromSearch:s,canRefine:s||0<t.length,widgetParams:d,isShowingMore:c,canToggleShowMore:m&&(c||!l),toggleShowMore:u,hasExhaustiveItems:l},o)}function y(n){return function(r,i,a,s,o){return function(e){if(""===e&&b)g({items:b,state:r,createURL:i,helperSpecializedSearchFacetValues:a,refine:s,isFromSearch:!1,isFirstSearch:!1,instantSearchInstance:o,hasExhaustiveItems:!1});else{var t={highlightPreTag:u?zc.highlightPreTag:Kc.highlightPreTag,highlightPostTag:u?zc.highlightPostTag:Kc.highlightPostTag};n.searchForFacetValues(p,e,c,t).then(function(e){var t=u?function(e){return e.map(function(e){return H({},e,{highlighted:Yc(e.highlighted)})})}(e.facetHits):e.facetHits,n=f(t.map(function(e){var t=e.value;return H({},k(e,["value"]),{value:t,label:t})}));g({items:n,state:r,createURL:i,helperSpecializedSearchFacetValues:a,refine:s,isFromSearch:!0,isFirstSearch:!1,instantSearchInstance:o,hasExhaustiveItems:!1})})}}}}var b,w,R;return{isShowingMore:!1,toggleShowMore:function(){},cachedToggleShowMore:function(){this.toggleShowMore()},createToggleShowMore:function(e){var t=this;return function(){t.isShowingMore=!t.isShowingMore,t.render(e)}},getLimit:function(){return this.isShowingMore?a:c},getConfiguration:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=F({},"and"===i?"facets":"disjunctiveFacets",[p]),n=e.maxValuesPerFacet||0;return t.maxValuesPerFacet=Math.max(n,m?a:c),t},init:function(e){var t=e.helper,n=e.createURL,r=e.instantSearchInstance;this.cachedToggleShowMore=this.cachedToggleShowMore.bind(this),R=function(e){return t.toggleRefinement(p,e).search()},w=y(t),g({items:[],state:t.state,createURL:n,helperSpecializedSearchFacetValues:w,refine:R,isFromSearch:!1,isFirstSearch:!0,instantSearchInstance:r,isShowingMore:this.isShowingMore,toggleShowMore:this.cachedToggleShowMore,hasExhaustiveItems:!0})},render:function(e){var t=e.results,n=e.state,r=e.createURL,i=e.instantSearchInstance,a=t.getFacetValues(p,{sortBy:l}),s=f(a.slice(0,this.getLimit()).map(v)),o=n.getQueryParameter("maxValuesPerFacet"),c=this.getLimit(),u=c<o?a.length<=c:a.length<c;b=s,this.toggleShowMore=this.createToggleShowMore(e),g({items:s,state:n,createURL:r,helperSpecializedSearchFacetValues:w,refine:R,isFromSearch:!1,isFirstSearch:!1,instantSearchInstance:i,isShowingMore:this.isShowingMore,toggleShowMore:this.cachedToggleShowMore,hasExhaustiveItems:u})},dispose:function(e){var t=e.state;return P(),"and"===i?t.removeFacetRefinement(p).removeFacet(p):t.removeDisjunctiveFacetRefinement(p).removeDisjunctiveFacet(p)},getWidgetState:function(e,t){var n=t.searchParameters,r="or"===i?n.getDisjunctiveRefinements(p):n.getConjunctiveRefinements(p);return 0===r.length||e.refinementList&&Cc(r,e.refinementList[p])?e:H({},e,{refinementList:H({},e.refinementList,F({},p,r))})},getWidgetSearchParameters:function(e,t){var n=t.uiState,r=n.refinementList&&n.refinementList[p];return void 0===r?e:r.reduce(function(e,t){return"or"===i?e.addDisjunctiveFacetRefinement(p,t):e.addFacetRefinement(p,t)},e.clearRefinements(p))}}}}var yh=Mc({name:"search-box",connector:!0});function bh(c,n){return wc(c,yh()),function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},s=a.queryHook;function o(e){return function(){e.setQuery(""),e.search()}}return{_clear:function(){},_cachedClear:function(){this._clear()},init:function(e){var n,r=e.helper,t=e.instantSearchInstance;function i(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];e!==r.state.query&&(n=r.state.query,r.setQuery(e)),t&&void 0!==n&&n!==e&&r.search()}this._cachedClear=this._cachedClear.bind(this),this._clear=o(r),this._refine=s?function(e){return s(e,i)}:i,c({query:r.state.query,refine:this._refine,clear:this._cachedClear,widgetParams:a,instantSearchInstance:t},!0)},render:function(e){var t=e.helper,n=e.instantSearchInstance,r=e.searchMetadata;this._clear=o(t),c({query:t.state.query,refine:this._refine,clear:this._cachedClear,widgetParams:a,instantSearchInstance:n,isSearchStalled:r.isSearchStalled},!1)},dispose:function(e){var t=e.state;return n(),t.setQuery("")},getWidgetState:function(e,t){var n=t.searchParameters.query;return""===n||e&&e.query===n?e:H({},e,{query:n})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return e.setQuery(n.query||"")}}}}var wh=Mc({name:"sort-by",connector:!0});function Rh(o,n){return wc(o,wh()),function(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=i.items,e=i.transformItems,s=void 0===e?function(e){return e}:e;if(!Array.isArray(a))throw new Error(wh("The `items` option expects an array of objects."));return{init:function(e){var t=e.helper,n=e.instantSearchInstance,r=t.getIndex();if(!pc(a,function(e){return e.value===r}))throw new Error("[sortBy]: Index ".concat(r," not present in `items`"));this.initialIndex=n.indexName,this.setIndex=function(e){return t.setIndex(e).search()},o({currentRefinement:r,options:s(a),refine:this.setIndex,hasNoResults:!0,widgetParams:i,instantSearchInstance:n},!0)},render:function(e){var t=e.helper,n=e.results,r=e.instantSearchInstance;o({currentRefinement:t.getIndex(),options:s(a),refine:this.setIndex,hasNoResults:0===n.nbHits,widgetParams:i,instantSearchInstance:r},!1)},dispose:function(e){var t=e.state;return n(),t.setIndex(this.initialIndex)},getWidgetState:function(e,t){var n=t.searchParameters,r=n.getQueryParameter("index");return r===this.initialIndex||e&&e.sortBy===r?e:H({},e,{sortBy:n.getQueryParameter("index")})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return e.setQueryParameter("index",n.sortBy||this.initialIndex)}}}}var Sh=Mc({name:"rating-menu",connector:!0});function Ph(v,n){return wc(v,Sh()),function(){var d=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},p=d.attribute,e=d.max,m=void 0===e?5:e;if(!p)throw new Error(Sh("The `attribute` option is required."));return{getConfiguration:function(){return{disjunctiveFacets:[p]}},init:function(e){var t=e.helper,n=e.createURL,r=e.instantSearchInstance;this._toggleRefinement=this._toggleRefinement.bind(this,t),this._createURL=function(t){return function(e){return n(t.toggleRefinement(p,e))}},v({instantSearchInstance:r,items:[],hasNoResults:!0,refine:this._toggleRefinement,createURL:this._createURL(t.state),widgetParams:d},!0)},render:function(e){for(var t=e.helper,n=e.results,r=e.state,i=e.instantSearchInstance,a=[],s={},o=m;0<=o;--o)s[o]=0;n.getFacetValues(p).forEach(function(e){var t=Math.round(e.name);if(t&&!(m<t))for(var n=t;1<=n;--n)s[n]+=e.count});for(var c=this._getRefinedStar(t.state),u=m-1;1<=u;--u){var l=s[u];if(!c||u===c||0!==l){for(var h=[],f=1;f<=m;++f)h.push(f<=u);a.push({stars:h,name:String(u),value:String(u),count:l,isRefined:c===u})}}v({instantSearchInstance:i,items:a,hasNoResults:0===n.nbHits,refine:this._toggleRefinement,createURL:this._createURL(r),widgetParams:d},!1)},dispose:function(e){var t=e.state;return n(),t.removeDisjunctiveFacetRefinement(p).removeDisjunctiveFacet(p)},getWidgetState:function(e,t){var n=t.searchParameters,r=this._getRefinedStar(n);return void 0===r||e&&e.ratingMenu&&e.ratingMenu[p]===r?e:H({},e,{ratingMenu:H({},e.ratingMenu,F({},p,r))})},getWidgetSearchParameters:function(e,t){var n=t.uiState,r=n.ratingMenu&&n.ratingMenu[p];if(r===this._getRefinedStar(e))return e;var i=e.clearRefinements(p);if(void 0!==r)for(var a=Number(r);a<=m;++a)i=i.addDisjunctiveFacetRefinement(p,a);return i},_toggleRefinement:function(e,t){var n=this._getRefinedStar(e.state)===Number(t);if(e.clearRefinements(p),!n)for(var r=Number(t);r<=m;++r)e.addDisjunctiveFacetRefinement(p,r);e.search()},_getRefinedStar:function(e){var t=void 0;return e.getDisjunctiveRefinements(p).forEach(function(e){(!t||Number(e)<t)&&(t=Number(e))}),t}}}}var _h=Mc({name:"stats",connector:!0});function Nh(i,e){return wc(i,_h()),function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return{init:function(e){var t=e.helper,n=e.instantSearchInstance;i({instantSearchInstance:n,hitsPerPage:t.state.hitsPerPage,nbHits:0,nbPages:0,page:t.state.page,processingTimeMS:-1,query:t.state.query,widgetParams:r},!0)},render:function(e){var t=e.results,n=e.instantSearchInstance;i({instantSearchInstance:n,hitsPerPage:t.hitsPerPage,nbHits:t.nbHits,nbPages:t.nbPages,page:t.page,processingTimeMS:t.processingTimeMS,query:t.query,widgetParams:r},!1)},dispose:function(){e()}}}}var xh=Mc({name:"toggle-refinement",connector:!0});function Ch(y,r){return wc(y,xh()),function(){var d=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},p=d.attribute,e=d.on,t=void 0===e||e,n=d.off;if(!p)throw new Error(xh("The `attribute` option is required."));var m=void 0!==n,v=bc(t),g=m?bc(n):void 0;return{getConfiguration:function(){return{disjunctiveFacets:[p]}},_toggleRefinement:function(e){(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).isRefined?(e.removeDisjunctiveFacetRefinement(p,v),m&&e.addDisjunctiveFacetRefinement(p,g)):(m&&e.removeDisjunctiveFacetRefinement(p,g),e.addDisjunctiveFacetRefinement(p,v)),e.search()},init:function(e){var t=this,n=e.state,r=e.helper,i=e.createURL,a=e.instantSearchInstance;this._createURL=function(e){return function(){return i(n.removeDisjunctiveFacetRefinement(p,e?v:g).addDisjunctiveFacetRefinement(p,e?g:v))}},this.toggleRefinement=function(e){t._toggleRefinement(r,e)};var s=n.isDisjunctiveFacetRefined(p,v);if(m&&!s){var o=r.getPage();r.addDisjunctiveFacetRefinement(p,g).setPage(o)}var c={name:p,isRefined:s,count:null,onFacetValue:{isRefined:s,count:0},offFacetValue:{isRefined:m&&!s,count:0}};y({value:c,createURL:this._createURL(c.isRefined),refine:this.toggleRefinement,instantSearchInstance:a,widgetParams:d},!0)},render:function(e){var t=e.helper,n=e.results,r=e.state,i=e.instantSearchInstance,a=t.state.isDisjunctiveFacetRefined(p,v),s=void 0!==g&&g,o=n.getFacetValues(p),c=pc(o,function(e){return e.name===mc(v)}),u={isRefined:void 0!==c&&c.isRefined,count:void 0===c?null:c.count},l=m?pc(o,function(e){return e.name===mc(s)}):void 0,h={isRefined:void 0!==l&&l.isRefined,count:void 0===l?o.reduce(function(e,t){return e+t.count},0):l.count},f={name:p,isRefined:a,count:(a?h:u).count,onFacetValue:u,offFacetValue:h};y({value:f,state:r,createURL:this._createURL(f.isRefined),refine:this.toggleRefinement,helper:t,instantSearchInstance:i,widgetParams:d},!1)},dispose:function(e){var t=e.state;return r(),t.removeDisjunctiveFacetRefinement(p).removeDisjunctiveFacet(p)},getWidgetState:function(e,t){var n=t.searchParameters.isDisjunctiveFacetRefined(p,v);return!n||e&&e.toggle&&e.toggle[p]===n?e:H({},e,{toggle:H({},e.toggle,F({},p,n))})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return Boolean(n.toggle&&n.toggle[p])?m?e.removeDisjunctiveFacetRefinement(p,g).addDisjunctiveFacetRefinement(p,v):e.addDisjunctiveFacetRefinement(p,v):m?e.removeDisjunctiveFacetRefinement(p,v).addDisjunctiveFacetRefinement(p,g):e.removeDisjunctiveFacetRefinement(p,v)}}}}var Fh=Mc({name:"breadcrumb",connector:!0});function Eh(u,l){return wc(u,Fh()),function(){var o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=o.attributes,e=o.separator,r=void 0===e?" > ":e,t=o.rootPath,i=void 0===t?null:t,a=o.transformItems,c=void 0===a?function(e){return e}:a;if(!n||!Array.isArray(n)||0===n.length)throw new Error(Fh("The `attributes` option expects an array of strings."));var s=U(n,1)[0];return{getConfiguration:function(e){if(e.hierarchicalFacets){var t=pc(e.hierarchicalFacets,function(e){return e.name===s});if(t)return Ic(Cc(t.attributes,n)&&t.separator===r,"Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu."),{}}return{hierarchicalFacets:[{attributes:n,name:s,separator:r,rootPath:i}]}},init:function(e){var n=e.createURL,r=e.helper,t=e.instantSearchInstance;this._createURL=function(e){if(!e){var t=r.getHierarchicalFacetBreadcrumb(s);if(0<t.length)return n(r.state.toggleRefinement(s,t[0]))}return n(r.state.toggleRefinement(s,e))},this._refine=function(e){if(e)r.toggleRefinement(s,e).search();else{var t=r.getHierarchicalFacetBreadcrumb(s);0<t.length&&r.toggleRefinement(s,t[0]).search()}},u({createURL:this._createURL,canRefine:!1,instantSearchInstance:t,items:[],refine:this._refine,widgetParams:o},!0)},render:function(e){var t=e.instantSearchInstance,n=e.results,r=U(e.state.hierarchicalFacets,1)[0].name,i=n.getFacetValues(r),a=Array.isArray(i.data)?i.data:[],s=c(function(n){return n.map(function(e,t){return{label:e.label,value:t+1===n.length?null:n[t+1].value}})}(function n(e){return e.reduce(function(e,t){return t.isRefined&&(e.push({label:t.name,value:t.path}),Array.isArray(t.data)&&(e=e.concat(n(t.data)))),e},[])}(a)));u({canRefine:0<s.length,createURL:this._createURL,instantSearchInstance:t,items:s,refine:this._refine,widgetParams:o},!1)},dispose:function(){l()}}}}function jh(P,r){return wc(P,Th()),function(){var u=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=u.enableRefineOnMapMove,t=void 0===e||e,n=u.transformItems,l=void 0===n?function(e){return e}:n;Ic(!1,"\nThe option `enableGeolocationWithIP` has been removed from the GeoSearch widget.\nPlease consider using the `Configure` widget instead:\n\nsearch.addWidget(\n  configure({\n    aroundLatLngViaIP: ".concat(u.enableGeolocationWithIP||"true",",\n  })\n);\n\nYou can find more information inside the migration guide:\nhttp://community.algolia.com/instantsearch.js/migration-guide\n        ")),Ic(void 0===u.position,"\nThe option `position` has been removed from the GeoSearch widget.\nPlease consider using the `Configure` widget instead:\n\nsearch.addWidget(\n  configure({\n    aroundLatLng: '".concat(u.position&&u.position.lat,", ").concat(u.position&&u.position.lng,"',\n  })\n);\n\nYou can find more information inside the migration guide:\nhttp://community.algolia.com/instantsearch.js/migration-guide\n      ")),Ic(void 0===u.radius,"\nThe option `radius` has been removed from the GeoSearch widget.\nPlease consider using the `Configure` widget instead:\n\nsearch.addWidget(\n  configure({\n    aroundRadius: ".concat(u.radius,",\n  })\n);\n\nYou can find more information inside the migration guide:\n\nhttp://community.algolia.com/instantsearch.js/migration-guide\n      ")),Ic(void 0===u.precision,"\nThe option `precision` has been removed from the GeoSearch widget.\nPlease consider using the `Configure` widget instead:\n\nsearch.addWidget(\n  configure({\n    aroundPrecision: ".concat(u.precision,",\n  })\n);\n\nYou can find more information inside the migration guide:\n\nhttp://community.algolia.com/instantsearch.js/migration-guide\n      "));function h(e){return e.aroundLatLng&&function(e){var t=e.match(Lc);if(!t)throw new Error('Invalid value for "aroundLatLng" parameter: "'.concat(e,'"'));return{lat:parseFloat(t[1]),lng:parseFloat(t[2])}}(e.aroundLatLng)}function f(e){return e.insideBoundingBox&&kc(e.insideBoundingBox)}function d(i){return function(e){var t=e.northEast,n=e.southWest,r=[t.lat,t.lng,n.lat,n.lng].join();i.setQueryParameter("insideBoundingBox",r).search(),S.hasMapMoveSinceLastRefine=!1,S.lastRefineBoundingBox=r}}function p(e){return function(){e.setQueryParameter("insideBoundingBox").search()}}function m(e){return function(){return Boolean(e.insideBoundingBox)}}function v(){return S.internalToggleRefineOnMapMove()}function g(e,t){return function(){S.isRefineOnMapMove=!S.isRefineOnMapMove,e(t)}}function y(){return S.isRefineOnMapMove}function b(){return S.internalSetMapMoveSinceLastRefine()}function w(t,n){return function(){var e=!0!==S.hasMapMoveSinceLastRefine;S.hasMapMoveSinceLastRefine=!0,e&&t(n)}}function R(){return S.hasMapMoveSinceLastRefine}var S={isRefineOnMapMove:t,hasMapMoveSinceLastRefine:!1,lastRefinePosition:"",lastRefineBoundingBox:"",internalToggleRefineOnMapMove:Sc,internalSetMapMoveSinceLastRefine:Sc};return{init:function(e){var t=e.state,n=e.helper,r=e.instantSearchInstance;S.internalToggleRefineOnMapMove=g(Sc,e),S.internalSetMapMoveSinceLastRefine=w(Sc,e),P({items:[],position:h(t),currentRefinement:f(t),refine:d(n),clearMapRefinement:p(n),isRefinedWithMap:m(t),toggleRefineOnMapMove:v,isRefineOnMapMove:y,setMapMoveSinceLastRefine:b,hasMapMoveSinceLastRefine:R,widgetParams:u,instantSearchInstance:r},!0)},render:function e(t){var n=t.results,r=t.helper,i=t.instantSearchInstance,a=r.state,s=Boolean(a.aroundLatLng)&&Boolean(S.lastRefinePosition)&&a.aroundLatLng!==S.lastRefinePosition,o=!a.insideBoundingBox&&Boolean(S.lastRefineBoundingBox)&&a.insideBoundingBox!==S.lastRefineBoundingBox;(s||o)&&(S.hasMapMoveSinceLastRefine=!1),S.lastRefinePosition=a.aroundLatLng||"",S.lastRefineBoundingBox=a.insideBoundingBox||"",S.internalToggleRefineOnMapMove=g(e,t),S.internalSetMapMoveSinceLastRefine=w(e,t);var c=l(n.hits.filter(function(e){return e._geoloc}));P({items:c,position:h(a),currentRefinement:f(a),refine:d(r),clearMapRefinement:p(r),isRefinedWithMap:m(a),toggleRefineOnMapMove:v,isRefineOnMapMove:y,setMapMoveSinceLastRefine:b,hasMapMoveSinceLastRefine:R,widgetParams:u,instantSearchInstance:i},!1)},dispose:function(e){var t=e.state;return r(),t.setQueryParameter("insideBoundingBox")},getWidgetState:function(e,t){var n=t.searchParameters.insideBoundingBox;return!n||e&&e.geoSearch&&e.geoSearch.boundingBox===n?e:H({},e,{geoSearch:{boundingBox:n}})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return n&&n.geoSearch?e.setQueryParameter("insideBoundingBox",n.geoSearch.boundingBox):e.setQueryParameter("insideBoundingBox")}}}}var Th=Mc({name:"geo-search",connector:!0}),Mh=Mc({name:"powered-by",connector:!0});function Ih(r,i){wc(r,Mh());var a="https://www.algolia.com/?utm_source=instantsearch.js&utm_medium=website&"+"utm_content=".concat("undefined"!=typeof window&&window.location?window.location.hostname:"","&")+"utm_campaign=poweredby";return function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.url,n=void 0===t?a:t;return{init:function(){r({url:n,widgetParams:e},!0)},render:function(){r({url:n,widgetParams:e},!1)},dispose:function(){i()}}}}var Lh=Mc({name:"configure",connector:!0});function kh(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Sc,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Sc;return function(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!_c(i.searchParameters))throw new Error(Lh("The `searchParameters` option expects an object."));return{getConfiguration:function(){return i.searchParameters},init:function(e){var t=e.helper;this._refine=this.refine(t),n({refine:this._refine,widgetParams:i},!0)},refine:function(n){var r=this;return function(e){var t=su(H({},r.removeSearchParameters(n.state)),{getConfiguration:function(){return e}});n.setState(t).search(),i.searchParameters=e}},render:function(){n({refine:this._refine,widgetParams:i},!1)},dispose:function(e){var t=e.state;return r(),this.removeSearchParameters(t)},removeSearchParameters:function(e){return e.mutateMe(function(t){Object.keys(i.searchParameters).forEach(function(e){delete t[e]})})}}}}var Oh=Mc({name:"autocomplete",connector:!0});var Ah=Mc({name:"query-rules",connector:!0});function Dh(e){var t=this.helper,n=this.initialRuleContexts,r=this.trackedFilters,i=this.transformRuleContexts,a=e.ruleContexts||[],s=function(e){var i=e.helper,a=e.sharedHelperState,s=e.trackedFilters;return Object.keys(s).reduce(function(e,t){var n=gc(i.lastResults||{},a).filter(function(e){return e.attributeName===t}).map(function(e){return e.numericValue||e.name}),r=(0,s[t])(n);return[].concat(y(e),y(n.filter(function(e){return r.includes(e)}).map(function(e){return function(e){return e.replace(/[^a-z0-9-_]+/gi,"_")}("ais-".concat(t,"-").concat(e))})))},[])}({helper:t,sharedHelperState:e,trackedFilters:r}),o=[].concat(y(n),y(s));Ic(o.length<=10,"\nThe maximum number of `ruleContexts` is 10. They have been sliced to that limit.\nConsider using `transformRuleContexts` to minimize the number of rules sent to Algolia.\n");var c=i(o).slice(0,10);Cc(a,c)||t.overrideStateWithoutTriggeringChangeEvent(H({},e,{ruleContexts:c}))}function Hh(d){var p=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Sc;return wc(d,Ah()),function(a){var e=a||{},t=e.trackedFilters,i=void 0===t?{}:t,n=e.transformRuleContexts,s=void 0===n?function(e){return e}:n,r=e.transformItems,o=void 0===r?function(e){return e}:r;Object.keys(i).forEach(function(e){if("function"!=typeof i[e])throw new Error(Ah("'The \"".concat(e,'" filter value in the `trackedFilters` option expects a function.')))});var c,u,l=0<Object.keys(i).length,h=[];return{init:function(e){var t=e.helper,n=e.state,r=e.instantSearchInstance;h=n.ruleContexts||[],c=Dh.bind({helper:t,initialRuleContexts:h,trackedFilters:i,transformRuleContexts:s}),l&&((function(e){return[e.disjunctiveFacetsRefinements,e.facetsRefinements,e.hierarchicalFacetsRefinements,e.numericRefinements].some(function(e){return Boolean(e&&0<Object.keys(e).length)})}(n)||Boolean(a.transformRuleContexts))&&c(n),t.on("change",c)),d({items:[],instantSearchInstance:r,widgetParams:a},!0)},render:(u=function(e){var t=e.results,n=e.instantSearchInstance,r=t.userData,i=o(void 0===r?[]:r);d({items:i,instantSearchInstance:n,widgetParams:a},!1)},f.toString=function(){return u.toString()},f),dispose:function(e){var t=e.helper,n=e.state;return p(),l?(t.removeListener("change",c),n.setQueryParameter("ruleContexts",h)):n}};function f(e){return u.apply(this,arguments)}}}var Uh="initial",Bh="askingPermission",Vh="waiting",Qh="recognizing";function qh(e){function t(e){return{status:e,transcript:"",isSpeechFinal:!1,errorCode:void 0}}function n(){return Boolean(p)}function r(){return m.status===Bh||m.status===Vh||m.status===Qh}function i(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};m=H({},m,e),d()}function a(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Uh;i(t(e))}function s(){i({status:Vh})}function o(e){i({status:"error",errorCode:e.error})}function c(e){i({status:Qh,transcript:e.results[0]&&e.results[0][0]&&e.results[0][0].transcript||"",isSpeechFinal:e.results[0]&&e.results[0].isFinal}),h&&m.transcript&&f(m.transcript)}function u(){m.errorCode||!m.transcript||h||f(m.transcript),"error"!==m.status&&i({status:"finished"})}var l,h=e.searchAsYouSpeak,f=e.onQueryChange,d=e.onStateChange,p=window.webkitSpeechRecognition||window.SpeechRecognition,m=t(Uh);return{getState:function(){return m},isBrowserSupported:n,isListening:r,toggleListening:function(){n()&&(r()?(l&&(l.stop(),l=void 0),a()):(l=new p)&&(a(Bh),l.interimResults=!0,l.addEventListener("start",s),l.addEventListener("error",o),l.addEventListener("result",c),l.addEventListener("end",u),l.start()))},dispose:function(){l&&(l.stop(),l.removeEventListener("start",s),l.removeEventListener("error",o),l.removeEventListener("result",c),l.removeEventListener("end",u),l=void 0)}}}function Wh(u){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Sc;return wc(u,zh()),function(c){function a(e){var t=e.isFirstRendering,n=e.instantSearchInstance,r=e.voiceSearchHelper,i=r.isBrowserSupported,a=r.isListening,s=r.toggleListening,o=r.getState;u({isBrowserSupported:i(),isListening:a(),toggleListening:s,voiceListeningState:o(),widgetParams:c,instantSearchInstance:n},t)}var e=c.searchAsYouSpeak,s=void 0!==e&&e;return{init:function(e){var t,n=this,r=e.helper,i=e.instantSearchInstance;this._refine=function(e){e!==r.state.query&&(t=r.state.query,r.setQuery(e)),void 0!==t&&t!==e&&r.search()},this._voiceSearchHelper=qh({searchAsYouSpeak:s,onQueryChange:function(e){return n._refine(e)},onStateChange:function(){a({isFirstRendering:!1,instantSearchInstance:i,voiceSearchHelper:n._voiceSearchHelper})}}),a({isFirstRendering:!0,instantSearchInstance:i,voiceSearchHelper:this._voiceSearchHelper})},render:function(e){var t=e.instantSearchInstance;a({isFirstRendering:!1,instantSearchInstance:t,voiceSearchHelper:this._voiceSearchHelper})},dispose:function(e){var t=e.state;return this._voiceSearchHelper.dispose(),n(),t.setQuery("")},getWidgetState:function(e,t){var n=t.searchParameters.query;return""===n||e&&e.query===n?e:H({},e,{query:n})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return e.setQuery(n.query||"")}}}}var zh=Mc({name:"voice-search",connector:!0}),Kh=Object.freeze({connectClearRefinements:cu,connectCurrentRefinements:hu,connectHierarchicalMenu:gu,connectHits:bu,connectHitsWithInsights:Zl,connectHitsPerPage:eh,connectInfiniteHits:th,connectInfiniteHitsWithInsights:rh,connectMenu:ah,connectNumericMenu:oh,connectPagination:dh,connectRange:mh,connectRefinementList:gh,connectSearchBox:bh,connectSortBy:Rh,connectRatingMenu:Ph,connectStats:Nh,connectToggleRefinement:Ch,connectBreadcrumb:Eh,connectGeoSearch:jh,connectPoweredBy:Ih,connectConfigure:kh,connectAutocomplete:function(a,s){return wc(a,Oh()),function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=r.escapeHTML,i=void 0===e||e,t=r.indices,n=void 0===t?[]:t;if(!Array.isArray(n))throw new Error(Oh("The `indices` option expects an array of objects."));return{getConfiguration:function(){return i?zc:void 0},init:function(e){var i=this,t=e.instantSearchInstance,a=e.helper;this._refine=this.refine(a),this.indices=[{helper:a,label:"primary",index:a.getIndex(),results:void 0,hits:[]}],n.forEach(function(e){var t=e.label,n=e.value,r=a.derive(function(e){return e.setIndex(n)});i.indices.push({label:t,index:n,helper:r,results:void 0,hits:[]}),r.on("result",function(e){return i.saveResults({results:e,label:t})})}),this.instantSearchInstance=t,this.renderWithAllIndices({isFirstRendering:!0})},saveResults:function(e){var t=e.results,n=e.label,r=pc(this.indices,function(e){return e.label===n});i&&t&&t.hits&&0<t.hits.length&&(t.hits=Gc(t.hits)),r.results=t,r.hits=t&&t.hits&&Array.isArray(t.hits)?t.hits:[],this.renderWithAllIndices()},refine:function(t){return function(e){return t.setQuery(e).search()}},render:function(e){var t=e.results;this.saveResults({results:t,label:this.indices[0].label})},renderWithAllIndices:function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).isFirstRendering,t=void 0!==e&&e,n=this.indices[0].helper.state.query;a({widgetParams:r,currentRefinement:n,indices:this.indices.map(function(e){return{index:e.index,label:e.label,hits:e.hits,results:e.results}}),instantSearchInstance:this.instantSearchInstance,refine:this._refine},t)},dispose:function(){this.indices.slice(1).forEach(function(e){return e.helper.detach()}),s()}}}},connectQueryRules:Hh,connectVoiceSearch:Wh}),Yh=n(function(e){function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"==r||"number"==r)e.push(n);else if(Array.isArray(n)&&n.length){var i=s.apply(null,n);i&&e.push(i)}else if("object"==r)for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}return e.join(" ")}var o;o={}.hasOwnProperty,e.exports?(s.default=s,e.exports=s):window.classNames=s}),$h=function(e){function t(){return T(this,t),O(this,L(t).apply(this,arguments))}return I(t,Yl),M(t,[{key:"shouldComponentUpdate",value:function(e){return!Cc(this.props.data,e.data)||this.props.templateKey!==e.templateKey||!Cc(this.props.rootProps,e.rootProps)}},{key:"render",value:function(){var e=this.props.rootTagName,t=this.props.useCustomCompileOptions[this.props.templateKey]?this.props.templatesConfig.compileOptions:{},n=dc({templates:this.props.templates,templateKey:this.props.templateKey,compileOptions:t,helpers:this.props.templatesConfig.helpers,data:this.props.data});return null===n?null:Jl.createElement(e,d({},this.props.rootProps,{dangerouslySetInnerHTML:{__html:n}}))}}]),t}();$h.defaultProps={data:{},rootTagName:"div",useCustomCompileOptions:{},templates:{},templatesConfig:{}};function Gh(e){var t=e.hasRefinements,n=e.refine,r=e.cssClasses,i=e.templateProps;return Jl.createElement("div",{className:r.root},Jl.createElement($h,d({},i,{templateKey:"resetLabel",rootTagName:"button",rootProps:{className:Yh(r.button,F({},r.disabledButton,!t)),onClick:n,disabled:!t},data:{hasRefinements:t}})))}var Jh={resetLabel:"Clear refinements"},Zh=Mc({name:"clear-refinements"}),Xh=Jc("ClearRefinements");function ef(e){var t=e.items,n=e.cssClasses;return Jl.createElement("div",{className:n.root},Jl.createElement("ul",{className:n.list},t.map(function(t,e){return Jl.createElement("li",{key:"".concat(t.attribute,"-").concat(e),className:n.item},Jl.createElement("span",{className:n.label},function(e){return e.toString().charAt(0).toUpperCase()+e.toString().slice(1)}(t.label),":"),t.refinements.map(function(e){return Jl.createElement("span",{key:function(e){var t=e.attribute,n=e.value;return[t,e.type,n,e.operator].map(function(e){return e}).filter(Boolean).join(":")}(e),className:n.category},Jl.createElement("span",{className:n.categoryLabel},"query"===e.attribute?Jl.createElement("q",null,e.label):e.label),Jl.createElement("button",{className:n.delete,onClick:function(t){return function(e){oc(e)||(e.preventDefault(),t())}}(t.refine.bind(null,e))},"✕"))}))})))}var tf=Mc({name:"current-refinements"}),nf=Jc("CurrentRefinements");function rf(e){var t=e.className,n=e.disabled,r=e.onClick,i=e.children;return Jl.createElement("button",{className:t,onClick:r,disabled:n},i)}rf.defaultProps={disabled:!1};function af(e){var t=e.classNameLabel,n=e.classNameInput,r=e.checked,i=e.onToggle,a=e.children;return Jl.createElement("label",{className:t},Jl.createElement("input",{className:n,type:"checkbox",checked:r,onChange:i}),a)}function sf(e){var t=e.cssClasses,n=e.enableRefine,r=e.enableRefineControl,i=e.enableClearMapRefinement,a=e.isRefineOnMapMove,s=e.isRefinedWithMap,o=e.hasMapMoveSinceLastRefine,c=e.onRefineToggle,u=e.onRefineClick,l=e.onClearClick,h=e.templateProps;return n&&Jl.createElement("div",null,r&&Jl.createElement("div",{className:t.control},a||!o?Jl.createElement(af,{classNameLabel:Yh(t.label,F({},t.selectedLabel,a)),classNameInput:t.input,checked:a,onToggle:c},Jl.createElement($h,d({},h,{templateKey:"toggle",rootTagName:"span"}))):Jl.createElement(rf,{className:t.redo,disabled:!o,onClick:u},Jl.createElement($h,d({},h,{templateKey:"redo",rootTagName:"span"})))),!r&&!a&&Jl.createElement("div",{className:t.control},Jl.createElement(rf,{className:Yh(t.redo,F({},t.disabledRedo,!o)),disabled:!o,onClick:u},Jl.createElement($h,d({},h,{templateKey:"redo",rootTagName:"span"})))),i&&s&&Jl.createElement(rf,{className:t.reset,onClick:l},Jl.createElement($h,d({},h,{templateKey:"reset",rootTagName:"span"}))))}function of(e){var t=e.refine,n=e.mapInstance;return t({northEast:n.getBounds().getNorthEast().toJSON(),southWest:n.getBounds().getSouthWest().toJSON()})}function cf(e,t){e.isUserInteraction=!1,t(),e.isUserInteraction=!0}function uf(e,t){var n=e.items,r=e.position,i=e.currentRefinement,a=e.refine,s=e.clearMapRefinement,o=e.toggleRefineOnMapMove,c=e.isRefineOnMapMove,u=e.setMapMoveSinceLastRefine,l=e.hasMapMoveSinceLastRefine,h=e.isRefinedWithMap,f=e.widgetParams,d=e.instantSearchInstance,p=f.container,m=f.googleReference,v=f.cssClasses,g=f.templates,y=f.initialZoom,b=f.initialPosition,w=f.enableRefine,R=f.enableClearMapRefinement,S=f.enableRefineControl,P=f.mapOptions,_=f.createMarker,N=f.markerOptions,x=f.renderState;if(t){x.isUserInteraction=!0,x.isPendingRefine=!1,x.markers=[];var C=document.createElement("div");C.className=v.root,p.appendChild(C);var F=document.createElement("div");F.className=v.map,C.appendChild(F);var E=document.createElement("div");E.className=v.tree,C.appendChild(E),x.mapInstance=new m.maps.Map(F,H({mapTypeControl:!1,fullscreenControl:!1,streetViewControl:!1,clickableIcons:!1,zoomControlOptions:{position:m.maps.ControlPosition.LEFT_TOP}},P));return m.maps.event.addListenerOnce(x.mapInstance,"idle",function(){function e(){x.isUserInteraction&&w&&(u(),c()&&(x.isPendingRefine=!0))}x.mapInstance.addListener("center_changed",e),x.mapInstance.addListener("zoom_changed",e),x.mapInstance.addListener("dragstart",e),x.mapInstance.addListener("idle",function(){x.isUserInteraction&&x.isPendingRefine&&(x.isPendingRefine=!1,of({mapInstance:x.mapInstance,refine:a}))})}),void(x.templateProps=uc({templatesConfig:d.templatesConfig,templates:g}))}var j=n.map(function(e){return e.objectID}),T=U(function(e,a){return e.reduce(function(e,t){var n=U(e,2),r=n[0],i=n[1];return a.includes(t.__id)?[r.concat(t),i]:[r,i.concat(t)]},[[],[]])}(x.markers,j),2),M=T[0],I=T[1],L=M.map(function(e){return e.__id}),k=n.filter(function(e){return!L.includes(e.objectID)});I.forEach(function(e){return e.setMap(null)}),x.markers=M.concat(k.map(function(n){var r=_({map:x.mapInstance,item:n});return Object.keys(N.events).forEach(function(t){r.addListener(t,function(e){N.events[t]({map:x.mapInstance,event:e,item:n,marker:r})})}),r}));var O=!l(),A=i?0:null,D=!i&&Boolean(x.markers.length)?function(e,t){var n=t.reduce(function(e,t){return e.extend(t.getPosition())},new e.maps.LatLngBounds);return{northEast:n.getNorthEast().toJSON(),southWest:n.getSouthWest().toJSON()}}(m,x.markers):i;D&&O?cf(x,function(){x.mapInstance.fitBounds(new m.maps.LatLngBounds(D.southWest,D.northEast),A)}):O&&cf(x,function(){x.mapInstance.setCenter(r||b),x.mapInstance.setZoom(y)}),Sl(Jl.createElement(sf,{cssClasses:v,enableRefine:w,enableRefineControl:S,enableClearMapRefinement:R,isRefineOnMapMove:c(),isRefinedWithMap:h(),hasMapMoveSinceLastRefine:l(),onRefineToggle:o,onRefineClick:function(){return of({mapInstance:x.mapInstance,refine:a})},onClearClick:s,templateProps:x.templateProps}),p.querySelector(".".concat(v.tree)))}var lf={HTMLMarker:"<p>Your custom HTML Marker</p>",reset:"Clear the map refinement",toggle:"Search as I move the map",redo:"Redo search here"},hf=Mc({name:"geo-search"}),ff=Jc("GeoSearch"),df=function(e){function t(){return T(this,t),O(this,L(t).apply(this,arguments))}return I(t,Yl),M(t,[{key:"componentWillMount",value:function(){this.handleClick=this.handleClick.bind(this)}},{key:"shouldComponentUpdate",value:function(e){return!Cc(this.props,e)}},{key:"handleClick",value:function(e){this.props.handleClick({facetValueToRefine:this.props.facetValueToRefine,isRefined:this.props.isRefined,originalEvent:e})}},{key:"render",value:function(){return Jl.createElement("li",{className:this.props.className,onClick:this.handleClick},Jl.createElement($h,d({},this.props.templateProps,{templateKey:this.props.templateKey,data:this.props.templateData})),this.props.subItems)}}]),t}(),pf=function(e){function i(){var e,s;T(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return F(o(s=O(this,(e=L(i)).call.apply(e,[this].concat(n)))),"state",{query:s.props.searchAsYouType?"":s.props.query}),F(o(s),"onChange",function(e){var t=s.props,n=t.searchAsYouType,r=t.refine,i=t.onChange,a=e.target.value;n?r(a):s.setState({query:a}),i(e)}),F(o(s),"onSubmit",function(e){var t=s.props,n=t.searchAsYouType,r=t.refine,i=t.onSubmit;return e.preventDefault(),e.stopPropagation(),s.input.blur(),n||r(s.state.query),i(e),!1}),F(o(s),"onReset",function(e){var t=s.props,n=t.searchAsYouType,r=t.refine,i=t.onReset;s.input.focus(),r(""),n||s.setState({query:""}),i(e)}),s}return I(i,Yl),M(i,[{key:"resetInput",value:function(){this.setState({query:""})}},{key:"render",value:function(){var t=this,e=this.props,n=e.cssClasses,r=e.placeholder,i=e.autofocus,a=e.showSubmit,s=e.showReset,o=e.showLoadingIndicator,c=e.templates,u=e.isSearchStalled,l=e.searchAsYouType?this.props.query:this.state.query;return Jl.createElement("div",{className:n.root},Jl.createElement("form",{action:"",role:"search",className:n.form,noValidate:!0,onSubmit:this.onSubmit,onReset:this.onReset},Jl.createElement("input",{ref:function(e){return t.input=e},value:l,disabled:this.props.disabled,className:n.input,type:"search",placeholder:r,autoFocus:i,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,maxLength:512,onChange:this.onChange}),Jl.createElement($h,{templateKey:"submit",rootTagName:"button",rootProps:{className:n.submit,type:"submit",title:"Submit the search query.",hidden:!a},templates:c,data:{cssClasses:n}}),Jl.createElement($h,{templateKey:"reset",rootTagName:"button",rootProps:{className:n.reset,type:"reset",title:"Clear the search query.",hidden:!(s&&l.trim()&&!u)},templates:c,data:{cssClasses:n}}),o&&Jl.createElement($h,{templateKey:"loadingIndicator",rootTagName:"span",rootProps:{className:n.loadingIndicator,hidden:!u},templates:c,data:{cssClasses:n}})))}}]),i}();F(pf,"defaultProps",{query:"",showSubmit:!0,showReset:!0,showLoadingIndicator:!0,autofocus:!1,searchAsYouType:!0,isSearchStalled:!1,disabled:!1,onChange:Sc,onSubmit:Sc,onReset:Sc,refine:Sc});var mf=function(e){function s(e){var t;return T(this,s),(t=O(this,L(s).call(this,e))).handleItemClick=t.handleItemClick.bind(o(t)),t}return I(s,Yl),M(s,[{key:"shouldComponentUpdate",value:function(e,t){var n=t!==this.state,r=!Cc(this.props.facetValues,e.facetValues);return n||r}},{key:"refine",value:function(e,t){this.props.toggleRefinement(e,t)}},{key:"_generateFacetItem",value:function(e){var t,n,r=e.data&&0<e.data.length;r&&(n=Jl.createElement(s,d({},this.props,{depth:this.props.depth+1,facetValues:e.data,showMore:!1,className:this.props.cssClasses.childList})));var i=H({},e,{url:this.props.createURL(e.value),attribute:this.props.attribute,cssClasses:this.props.cssClasses}),a=e.value;return void 0!==e.isRefined&&(a+="/".concat(e.isRefined)),void 0!==e.count&&(a+="/".concat(e.count)),Jl.createElement(df,{templateKey:"item",key:a,facetValueToRefine:e.value,handleClick:this.handleItemClick,isRefined:e.isRefined,className:Yh(this.props.cssClasses.item,(t={},F(t,this.props.cssClasses.selectedItem,e.isRefined),F(t,this.props.cssClasses.disabledItem,!e.count),F(t,this.props.cssClasses.parentItem,r),t)),subItems:n,templateData:i,templateProps:this.props.templateProps})}},{key:"handleItemClick",value:function(e){var t=e.facetValueToRefine,n=e.originalEvent,r=e.isRefined;if(!(oc(n)||r&&n.target.parentNode.querySelector('input[type="radio"]:checked')))if("INPUT"!==n.target.tagName){for(var i=n.target;i!==n.currentTarget;){if("LABEL"===i.tagName&&(i.querySelector('input[type="checkbox"]')||i.querySelector('input[type="radio"]')))return;"A"===i.tagName&&i.href&&n.preventDefault(),i=i.parentNode}n.stopPropagation(),this.refine(t,r)}else this.refine(t,r)}},{key:"componentWillReceiveProps",value:function(e){this.searchBox&&!e.isFromSearch&&this.searchBox.resetInput()}},{key:"refineFirstValue",value:function(){var e=this.props.facetValues[0];if(e){var t=e.value;this.props.toggleRefinement(t)}}},{key:"render",value:function(){var t=this,e=Yh(this.props.cssClasses.list,F({},"".concat(this.props.cssClasses.depth).concat(this.props.depth),this.props.cssClasses.depth)),n=Yh(this.props.cssClasses.showMore,F({},this.props.cssClasses.disabledShowMore,!(!0===this.props.showMore&&this.props.canToggleShowMore))),r=!0===this.props.showMore&&Jl.createElement($h,d({},this.props.templateProps,{templateKey:"showMoreText",rootTagName:"button",rootProps:{className:n,onClick:this.props.toggleShowMore},data:{isShowingMore:this.props.isShowingMore}})),i=!0!==this.props.searchIsAlwaysActive&&!(this.props.isFromSearch||!this.props.hasExhaustiveItems),a=this.props.searchFacetValues&&Jl.createElement("div",{className:this.props.cssClasses.searchBox},Jl.createElement(pf,{ref:function(e){return t.searchBox=e},placeholder:this.props.searchPlaceholder,disabled:i,cssClasses:this.props.cssClasses.searchable,templates:this.props.templateProps.templates,onChange:function(e){return t.props.searchFacetValues(e.target.value)},onReset:function(){return t.props.searchFacetValues("")},onSubmit:function(){return t.refineFirstValue()},searchAsYouType:!1})),s=this.props.facetValues&&0<this.props.facetValues.length&&Jl.createElement("ul",{className:e},this.props.facetValues.map(this._generateFacetItem,this)),o=this.props.searchFacetValues&&this.props.isFromSearch&&0===this.props.facetValues.length&&Jl.createElement($h,d({},this.props.templateProps,{templateKey:"searchableNoResults",rootProps:{className:this.props.cssClasses.noResults}}));return Jl.createElement("div",{className:Yh(this.props.cssClasses.root,F({},this.props.cssClasses.noRefinementRoot,!this.props.facetValues||0===this.props.facetValues.length),this.props.className)},this.props.children,a,s,o,r)}}]),s}();mf.defaultProps={cssClasses:{},depth:0};var vf={item:'<a class="{{cssClasses.link}}" href="{{url}}"><span class="{{cssClasses.label}}">{{label}}</span><span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span></a>',showMoreText:"\n    {{#isShowingMore}}\n      Show less\n    {{/isShowingMore}}\n    {{^isShowingMore}}\n      Show more\n    {{/isShowingMore}}\n  "},gf=Mc({name:"hierarchical-menu"}),yf=Jc("HierarchicalMenu");function bf(e){var t=e.results,n=e.hits,r=e.cssClasses,i=e.templateProps;return 0===t.hits.length?Jl.createElement($h,d({},i,{templateKey:"empty",rootProps:{className:Yh(r.root,r.emptyRoot)},data:t})):Jl.createElement("div",{className:r.root},Jl.createElement("ol",{className:r.list},n.map(function(e,t){return Jl.createElement($h,d({},i,{templateKey:"item",rootTagName:"li",rootProps:{className:r.item},key:e.objectID,data:H({},e,{__hitIndex:t})}))})))}bf.defaultProps={results:{hits:[]},hits:[]};var wf={empty:"No results",item:function(e){return JSON.stringify(e,null,2)}},Rf=Mc({name:"hits"}),Sf=Jc("Hits"),Pf=Gl(bf);var _f=function(e){function t(){return T(this,t),O(this,L(t).apply(this,arguments))}return I(t,Yl),M(t,[{key:"componentWillMount",value:function(){this.handleChange=this.handleChange.bind(this)}},{key:"handleChange",value:function(e){this.props.setValue(e.target.value)}},{key:"render",value:function(){var t=this,e=this.props,n=e.currentValue,r=e.options;return Jl.createElement("select",{className:Yh(this.props.cssClasses.select),onChange:this.handleChange,value:"".concat(n)},r.map(function(e){return Jl.createElement("option",{className:Yh(t.props.cssClasses.option),key:e.label+e.value,value:"".concat(e.value)},e.label)}))}}]),t}(),Nf=Mc({name:"hits-per-page"}),xf=Jc("HitsPerPage");var Cf={empty:"No results",showPreviousText:"Show previous results",showMoreText:"Show more results",item:function(e){return JSON.stringify(e,null,2)}},Ff=Mc({name:"infinite-hits"}),Ef=Jc("InfiniteHits"),jf=Gl(function(e){var t=e.results,n=e.hits,r=e.hasShowPrevious,i=e.showPrevious,a=e.showMore,s=e.isFirstPage,o=e.isLastPage,c=e.cssClasses,u=e.templateProps;return 0===t.hits.length?Jl.createElement($h,d({},u,{templateKey:"empty",rootProps:{className:Yh(c.root,c.emptyRoot)},data:t})):Jl.createElement("div",{className:c.root},r&&Jl.createElement($h,d({},u,{templateKey:"showPreviousText",rootTagName:"button",rootProps:{className:Yh(c.loadPrevious,F({},c.disabledLoadPrevious,s)),disabled:s,onClick:i}})),Jl.createElement("ol",{className:c.list},n.map(function(e,t){return Jl.createElement($h,d({},u,{templateKey:"item",rootTagName:"li",rootProps:{className:c.item},key:e.objectID,data:H({},e,{__hitIndex:t})}))})),Jl.createElement($h,d({},u,{templateKey:"showMoreText",rootTagName:"button",rootProps:{className:Yh(c.loadMore,F({},c.disabledLoadMore,o)),disabled:o,onClick:a}})))}),Tf={item:'<a class="{{cssClasses.link}}" href="{{url}}"><span class="{{cssClasses.label}}">{{label}}</span><span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span></a>',showMoreText:"\n    {{#isShowingMore}}\n      Show less\n    {{/isShowingMore}}\n    {{^isShowingMore}}\n      Show more\n    {{/isShowingMore}}\n  "},Mf=Mc({name:"menu"}),If=Jc("Menu");var Lf={item:'<label class="{{cssClasses.label}}">\n  <input type="checkbox"\n         class="{{cssClasses.checkbox}}"\n         value="{{value}}"\n         {{#isRefined}}checked{{/isRefined}} />\n  <span class="{{cssClasses.labelText}}">{{{highlighted}}}</span>\n  <span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>\n</label>',showMoreText:"\n    {{#isShowingMore}}\n      Show less\n    {{/isShowingMore}}\n    {{^isShowingMore}}\n      Show more\n    {{/isShowingMore}}\n    ",searchableNoResults:"No results",searchableReset:'\n  <svg class="{{cssClasses.resetIcon}}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="10" height="10">\n    <path d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"></path>\n  </svg>\n    ',searchableSubmit:'\n  <svg class="{{cssClasses.submitIcon}}" xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 40 40">\n    <path d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"></path>\n  </svg>\n    ',searchableLoadingIndicator:'\n  <svg class="{{cssClasses.loadingIcon}}" width="16" height="16" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#444">\n    <g fill="none" fillRule="evenodd">\n      <g transform="translate(1 1)" strokeWidth="2">\n        <circle strokeOpacity=".5" cx="18" cy="18" r="18" />\n        <path d="M36 18c0-9.94-8.06-18-18-18">\n          <animateTransform\n            attributeName="transform"\n            type="rotate"\n            from="0 18 18"\n            to="360 18 18"\n            dur="1s"\n            repeatCount="indefinite"\n          />\n        </path>\n      </g>\n    </g>\n  </svg>\n    '},kf=Mc({name:"refinement-list"}),Of=Jc("RefinementList"),Af=Jc("SearchBox");var Df={item:'<label class="{{cssClasses.label}}">\n  <input type="radio" class="{{cssClasses.radio}}" name="{{attribute}}"{{#isRefined}} checked{{/isRefined}} />\n  <span class="{{cssClasses.labelText}}">{{label}}</span>\n</label>'},Hf=Mc({name:"numeric-menu"}),Uf=Jc("NumericMenu");var Bf=function(e){function t(){return T(this,t),O(this,L(t).apply(this,arguments))}return I(t,Yl),M(t,[{key:"componentWillMount",value:function(){this.handleClick=this.handleClick.bind(this)}},{key:"shouldComponentUpdate",value:function(e){return!Cc(this.props,e)}},{key:"handleClick",value:function(e){this.props.handleClick(this.props.pageNumber,e)}},{key:"render",value:function(){var e=this.props,t=e.cssClasses,n=e.label,r=e.ariaLabel,i=e.url,a=e.isDisabled,s="span",o={className:t.link,dangerouslySetInnerHTML:{__html:n}};a||(s="a",o=H({},o,{"aria-label":r,href:i,onClick:this.handleClick}));var c=Jl.createElement(s,o);return Jl.createElement("li",{className:t.item},c)}}]),t}(),Vf=function(e){function a(){var e,n;T(this,a);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return F(o(n=O(this,(e=L(a)).call.apply(e,[this].concat(r)))),"handleClick",function(e,t){oc(t)||(t.preventDefault(),n.props.setCurrentPage(e))}),n}return I(a,Yl),M(a,[{key:"pageLink",value:function(e){var t=e.label,n=e.ariaLabel,r=e.pageNumber,i=e.additionalClassName,a=void 0===i?null:i,s=e.isDisabled,o=void 0!==s&&s,c=e.isSelected,u=void 0!==c&&c,l=e.createURL,h={item:Yh(this.props.cssClasses.item,a),link:this.props.cssClasses.link};o?h.item=Yh(h.item,this.props.cssClasses.disabledItem):u&&(h.item=Yh(h.item,this.props.cssClasses.selectedItem));var f=l&&!o?l(r):"#";return Jl.createElement(Bf,{ariaLabel:n,cssClasses:h,handleClick:this.handleClick,isDisabled:o,key:t+r+n,label:t,pageNumber:r,url:f})}},{key:"previousPageLink",value:function(e){var t=e.isFirstPage,n=e.currentPage,r=e.createURL;return this.pageLink({ariaLabel:"Previous",additionalClassName:this.props.cssClasses.previousPageItem,isDisabled:0===this.props.nbHits||t,label:this.props.templates.previous,pageNumber:n-1,createURL:r})}},{key:"nextPageLink",value:function(e){var t=e.isLastPage,n=e.currentPage,r=e.createURL;return this.pageLink({ariaLabel:"Next",additionalClassName:this.props.cssClasses.nextPageItem,isDisabled:0===this.props.nbHits||t,label:this.props.templates.next,pageNumber:n+1,createURL:r})}},{key:"firstPageLink",value:function(e){var t=e.isFirstPage,n=e.createURL;return this.pageLink({ariaLabel:"First",additionalClassName:this.props.cssClasses.firstPageItem,isDisabled:0===this.props.nbHits||t,label:this.props.templates.first,pageNumber:0,createURL:n})}},{key:"lastPageLink",value:function(e){var t=e.isLastPage,n=e.nbPages,r=e.createURL;return this.pageLink({ariaLabel:"Last",additionalClassName:this.props.cssClasses.lastPageItem,isDisabled:0===this.props.nbHits||t,label:this.props.templates.last,pageNumber:n-1,createURL:r})}},{key:"pages",value:function(e){var t=this,n=e.currentPage,r=e.pages,i=e.createURL;return r.map(function(e){return t.pageLink({ariaLabel:e+1,additionalClassName:t.props.cssClasses.pageItem,isSelected:e===n,label:e+1,pageNumber:e,createURL:i})})}},{key:"render",value:function(){return Jl.createElement("div",{className:Yh(this.props.cssClasses.root,F({},this.props.cssClasses.noRefinementRoot,this.props.isFirstPage))},Jl.createElement("ul",{className:this.props.cssClasses.list},this.props.showFirst&&this.firstPageLink(this.props),this.props.showPrevious&&this.previousPageLink(this.props),this.pages(this.props),this.props.showNext&&this.nextPageLink(this.props),this.props.showLast&&this.lastPageLink(this.props)))}}]),a}();Vf.defaultProps={nbHits:0,currentPage:0,nbPages:0};var Qf=Mc({name:"pagination"}),qf=Jc("Pagination"),Wf={previous:"‹",next:"›",first:"«",last:"»"};var zf=function(e){function t(e){var n;return T(this,t),F(o(n=O(this,L(t).call(this,e))),"onChange",function(t){return function(e){n.setState(F({},t,e.currentTarget.value))}}),F(o(n),"onSubmit",function(e){e.preventDefault(),n.props.refine([n.state.min,n.state.max])}),n.state={min:e.values.min,max:e.values.max},n}return I(t,Yl),M(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({min:e.values.min,max:e.values.max})}},{key:"render",value:function(){var e=this.state,t=e.min,n=e.max,r=this.props,i=r.min,a=r.max,s=r.step,o=r.cssClasses,c=r.templateProps,u=a<=i,l=Boolean(t||n),h=Yh(o.root,F({},o.noRefinement,!l));return Jl.createElement("div",{className:h},Jl.createElement("form",{className:o.form,onSubmit:this.onSubmit},Jl.createElement("label",{className:o.label},Jl.createElement("input",{className:Yh(o.input,o.inputMin),type:"number",min:i,max:a,step:s,value:t,onChange:this.onChange("min"),placeholder:i,disabled:u})),Jl.createElement($h,d({},c,{templateKey:"separatorText",rootTagName:"span",rootProps:{className:o.separator}})),Jl.createElement("label",{className:o.label},Jl.createElement("input",{className:Yh(o.input,o.inputMax),type:"number",min:i,max:a,step:s,value:n,onChange:this.onChange("max"),placeholder:a,disabled:u})),Jl.createElement($h,d({},c,{templateKey:"submitText",rootTagName:"button",rootProps:{type:"submit",className:o.submit,disabled:u}}))))}}]),t}(),Kf=Mc({name:"range-input"}),Yf=Jc("RangeInput");var $f={reset:'\n<svg class="{{cssClasses.resetIcon}}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="10" height="10">\n  <path d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"></path>\n</svg>\n  ',submit:'\n<svg class="{{cssClasses.submitIcon}}" xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 40 40">\n  <path d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"></path>\n</svg>\n  ',loadingIndicator:'\n<svg class="{{cssClasses.loadingIcon}}" width="16" height="16" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#444">\n  <g fill="none" fillRule="evenodd">\n    <g transform="translate(1 1)" strokeWidth="2">\n      <circle strokeOpacity=".5" cx="18" cy="18" r="18" />\n      <path d="M36 18c0-9.94-8.06-18-18-18">\n        <animateTransform\n          attributeName="transform"\n          type="rotate"\n          from="0 18 18"\n          to="360 18 18"\n          dur="1s"\n          repeatCount="indefinite"\n        />\n      </path>\n    </g>\n  </g>\n</svg>\n  '},Gf=Mc({name:"search-box"}),Jf=Jc("SearchBox");var Zf=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.KEYS={DOWN:40,END:35,ESC:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,UP:38},t.PERCENT_EMPTY=0,t.PERCENT_FULL=100});t(Zf);Zf.KEYS,Zf.PERCENT_EMPTY,Zf.PERCENT_FULL;var Xf=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={getPosition:function(e,t,n){return(e-t)/(n-t)*100},getValue:function(e,t,n){var r=e/100;return 0===e?t:100===e?n:Math.round((n-t)*r+t)}}});t(Xf);function ed(e){var t=e.style,n=e.children,r=Math.round(parseFloat(t.left)),i=[0,50,100].includes(r),a=Array.isArray(n)?n[0]:n,s=Math.round(100*parseInt(a,10))/100;return Jl.createElement("div",{style:H({},t,{marginLeft:100===r?"-2px":0}),className:Yh("rheostat-marker","rheostat-marker-horizontal",{"rheostat-marker-large":i})},i&&Jl.createElement("div",{className:"rheostat-value"},s))}var td=t(n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e};function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var v=o(Jl),a=o(ju),y=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(Zf),s=o(Xf);function o(e){return e&&e.__esModule?e:{default:e}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function p(e){return["rheostat","vertical"===e.orientation?"rheostat-vertical":"rheostat-horizontal"].concat(e.className.split(" ")).join(" ")}var w=Object.prototype.hasOwnProperty,h=a.default.arrayOf(a.default.number),f=a.default.oneOfType([a.default.func,a.default.string]);function d(e){return Number(e.currentTarget.getAttribute("data-handle-key"))}function m(e){e.stopPropagation(),e.preventDefault()}var g=(l(R,v.default.Component),r(R,[{key:"render",value:function(){return v.default.createElement("button",n({},this.props,{type:"button"}))}}]),R);function R(){return c(this,R),u(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}var S={algorithm:a.default.shape({getValue:a.default.func,getPosition:a.default.func}),children:a.default.node,className:a.default.string,disabled:a.default.bool,handle:f,max:a.default.number,min:a.default.number,onClick:a.default.func,onChange:a.default.func,onKeyPress:a.default.func,onSliderDragEnd:a.default.func,onSliderDragMove:a.default.func,onSliderDragStart:a.default.func,onValuesUpdated:a.default.func,orientation:a.default.oneOf(["horizontal","vertical"]),pitComponent:f,pitPoints:h,progressBar:f,snap:a.default.bool,snapPoints:h,values:h},P={algorithm:s.default,className:"",children:null,disabled:!1,handle:g,max:y.PERCENT_FULL,min:y.PERCENT_EMPTY,onClick:null,onChange:null,onKeyPress:null,onSliderDragEnd:null,onSliderDragMove:null,onSliderDragStart:null,onValuesUpdated:null,orientation:"horizontal",pitComponent:null,pitPoints:[],progressBar:"div",snap:!1,snapPoints:[],values:[y.PERCENT_EMPTY]},_=(l(N,v.default.Component),r(N,[{key:"componentWillReceiveProps",value:function(n){var e=this.props,t=e.className,r=e.disabled,i=e.min,a=e.max,s=e.orientation,o=this.state,c=o.values,u=o.slidingIndex,l=n.min!==i||n.max!==a,h=c.length!==n.values.length||c.some(function(e,t){return n.values[t]!==e}),f=n.className!==t||n.orientation!==s,d=n.disabled&&!r;f&&this.setState({className:p(n)}),(l||h)&&this.updateNewValues(n),d&&null!==u&&this.endSlide()}},{key:"getPublicState",value:function(){var e=this.props,t=e.min;return{max:e.max,min:t,values:this.state.values}}},{key:"getSliderBoundingBox",value:function(){var e=this.refs.rheostat,t=e.getDOMNode?e.getDOMNode():e,n=t.getBoundingClientRect();return{height:n.height||t.clientHeight,left:n.left,top:n.top,width:n.width||t.clientWidth}}},{key:"getProgressStyle",value:function(e){var t=this.state.handlePos,n=t[e];if(0===e)return"vertical"===this.props.orientation?{height:String(n)+"%",top:0}:{left:0,width:String(n)+"%"};var r=t[e-1],i=n-r;return"vertical"===this.props.orientation?{height:i+"%",top:String(r)+"%"}:{left:String(r)+"%",width:i+"%"}}},{key:"getMinValue",value:function(e){return this.state.values[e-1]?Math.max(this.props.min,this.state.values[e-1]):this.props.min}},{key:"getMaxValue",value:function(e){return this.state.values[e+1]?Math.min(this.props.max,this.state.values[e+1]):this.props.max}},{key:"getHandleDimensions",value:function(e,t){var n=e.currentTarget||null;return n?"vertical"===this.props.orientation?n.clientHeight/t.height*y.PERCENT_FULL/2:n.clientWidth/t.width*y.PERCENT_FULL/2:0}},{key:"getClosestSnapPoint",value:function(n){return this.props.snapPoints.length?this.props.snapPoints.reduce(function(e,t){return Math.abs(e-n)<Math.abs(t-n)?e:t}):n}},{key:"getSnapPosition",value:function(e){if(!this.props.snap)return e;var t=this.props,n=t.algorithm,r=t.max,i=t.min,a=n.getValue(e,i,r),s=this.getClosestSnapPoint(a);return n.getPosition(s,i,r)}},{key:"getNextPositionForKey",value:function(e,t){var n,r=this.state,i=r.handlePos,a=r.values,s=this.props,o=s.algorithm,c=s.max,u=s.min,l=s.snapPoints,h=this.props.snap,f=a[e],d=i[e],p=d,m=1;100<=c?d=Math.round(d):m=100/(c-u);var v=null;h&&(v=l.indexOf(this.getClosestSnapPoint(a[e])));var g=(b(n={},y.KEYS.LEFT,function(e){return-1*e}),b(n,y.KEYS.RIGHT,function(e){return 1*e}),b(n,y.KEYS.UP,function(e){return 1*e}),b(n,y.KEYS.DOWN,function(e){return-1*e}),b(n,y.KEYS.PAGE_DOWN,function(e){return 1<e?-e:-10*e}),b(n,y.KEYS.PAGE_UP,function(e){return 1<e?e:10*e}),n);if(w.call(g,t))d+=g[t](m),h&&(p<d?v<l.length-1&&(f=l[v+1]):0<v&&(f=l[v-1]));else if(t===y.KEYS.HOME)d=y.PERCENT_EMPTY,h&&(f=l[0]);else{if(t!==y.KEYS.END)return null;d=y.PERCENT_FULL,h&&(f=l[l.length-1])}return h?o.getPosition(f,u,c):d}},{key:"getNextState",value:function(n,e){var t=this,r=this.state.handlePos,i=this.props,a=i.max,s=i.min,o=this.validatePosition(n,e),c=r.map(function(e,t){return t===n?o:e});return{handlePos:c,values:c.map(function(e){return t.props.algorithm.getValue(e,s,a)})}}},{key:"getClosestHandle",value:function(r){var i=this.state.handlePos;return i.reduce(function(e,t,n){return Math.abs(i[n]-r)<Math.abs(i[e]-r)?n:e},0)}},{key:"setStartSlide",value:function(e,t,n){var r=this.getSliderBoundingBox();this.setState({handleDimensions:this.getHandleDimensions(e,r),mousePos:{x:t,y:n},sliderBox:r,slidingIndex:d(e)})}},{key:"startMouseSlide",value:function(e){this.setStartSlide(e,e.clientX,e.clientY),"function"==typeof document.addEventListener?(document.addEventListener("mousemove",this.handleMouseSlide,!1),document.addEventListener("mouseup",this.endSlide,!1)):(document.attachEvent("onmousemove",this.handleMouseSlide),document.attachEvent("onmouseup",this.endSlide)),m(e)}},{key:"startTouchSlide",value:function(e){if(!(1<e.changedTouches.length)){var t=e.changedTouches[0];this.setStartSlide(e,t.clientX,t.clientY),document.addEventListener("touchmove",this.handleTouchSlide,!1),document.addEventListener("touchend",this.endSlide,!1),this.props.onSliderDragStart&&this.props.onSliderDragStart(),m(e)}}},{key:"handleMouseSlide",value:function(e){null!==this.state.slidingIndex&&(this.handleSlide(e.clientX,e.clientY),m(e))}},{key:"handleTouchSlide",value:function(e){if(null!==this.state.slidingIndex)if(1<e.changedTouches.length)this.endSlide();else{var t=e.changedTouches[0];this.handleSlide(t.clientX,t.clientY),m(e)}}},{key:"handleSlide",value:function(e,t){var n=this.state,r=n.slidingIndex,i=n.sliderBox,a="vertical"===this.props.orientation?(t-i.top)/i.height*y.PERCENT_FULL:(e-i.left)/i.width*y.PERCENT_FULL;this.slideTo(r,a),this.canMove(r,a)&&(this.setState({x:e,y:t}),this.props.onSliderDragMove&&this.props.onSliderDragMove())}},{key:"endSlide",value:function(){var e=this,t=this.state.slidingIndex;if(this.setState({slidingIndex:null}),"function"==typeof document.removeEventListener?(document.removeEventListener("mouseup",this.endSlide,!1),document.removeEventListener("touchend",this.endSlide,!1),document.removeEventListener("touchmove",this.handleTouchSlide,!1),document.removeEventListener("mousemove",this.handleMouseSlide,!1)):(document.detachEvent("onmousemove",this.handleMouseSlide),document.detachEvent("onmouseup",this.endSlide)),this.props.onSliderDragEnd&&this.props.onSliderDragEnd(),this.props.snap){var n=this.getSnapPosition(this.state.handlePos[t]);this.slideTo(t,n,function(){return e.fireChangeEvent()})}else this.fireChangeEvent()}},{key:"handleClick",value:function(e){var t=this;if(!e.target.getAttribute("data-handle-key")){var n=this.getSliderBoundingBox(),r=("vertical"===this.props.orientation?(e.clientY-n.top)/n.height:(e.clientX-n.left)/n.width)*y.PERCENT_FULL,i=this.getClosestHandle(r),a=this.getSnapPosition(r);this.slideTo(i,a,function(){return t.fireChangeEvent()}),this.props.onClick&&this.props.onClick()}}},{key:"handleKeydown",value:function(e){var t=this,n=d(e);if(e.keyCode!==y.KEYS.ESC){var r=this.getNextPositionForKey(n,e.keyCode);null!==r&&(this.canMove(n,r)&&(this.slideTo(n,r,function(){return t.fireChangeEvent()}),this.props.onKeyPress&&this.props.onKeyPress()),m(e))}else e.currentTarget.blur()}},{key:"validatePosition",value:function(e,t){var n=this.state,r=n.handlePos,i=n.handleDimensions;return Math.max(Math.min(t,void 0!==r[e+1]?r[e+1]-i:y.PERCENT_FULL),void 0!==r[e-1]?r[e-1]+i:y.PERCENT_EMPTY)}},{key:"validateValues",value:function(e,t){var n=t||this.props,i=n.max,a=n.min;return e.map(function(e,t,n){var r=Math.max(Math.min(e,i),a);return n.length&&r<n[t-1]?n[t-1]:r})}},{key:"canMove",value:function(e,t){var n=this.state,r=n.handlePos,i=n.handleDimensions;return!(t<y.PERCENT_EMPTY||t>y.PERCENT_FULL||(void 0!==r[e+1]?r[e+1]-i:1/0)<t||t<(void 0!==r[e-1]?r[e-1]+i:-1/0))}},{key:"fireChangeEvent",value:function(){var e=this.props.onChange;e&&e(this.getPublicState())}},{key:"slideTo",value:function(e,t,n){var r=this,i=this.getNextState(e,t);this.setState(i,function(){var e=r.props.onValuesUpdated;e&&e(r.getPublicState()),n&&n()})}},{key:"updateNewValues",value:function(e){var t=this;if(null===this.state.slidingIndex){var n=e.max,r=e.min,i=e.values,a=this.props.algorithm,s=this.validateValues(i,e);this.setState({handlePos:s.map(function(e){return a.getPosition(e,r,n)}),values:s},function(){return t.fireChangeEvent()})}}},{key:"render",value:function(){var r=this,e=this.props,i=e.algorithm,t=e.children,a=e.disabled,s=e.handle,o=e.max,c=e.min,u=e.orientation,l=e.pitComponent,n=e.pitPoints,h=e.progressBar,f=this.state,d=f.className,p=f.handlePos,m=f.values;return v.default.createElement("div",{className:d,ref:"rheostat",onClick:!a&&this.handleClick,style:{position:"relative"}},v.default.createElement("div",{className:"rheostat-background"}),p.map(function(e,t){var n="vertical"===u?{top:String(e)+"%",position:"absolute"}:{left:String(e)+"%",position:"absolute"};return v.default.createElement(s,{"aria-valuemax":r.getMaxValue(t),"aria-valuemin":r.getMinValue(t),"aria-valuenow":m[t],"aria-disabled":a,"data-handle-key":t,className:"rheostat-handle",key:"handle-"+String(t),onClick:r.killEvent,onKeyDown:!a&&r.handleKeydown,onMouseDown:!a&&r.startMouseSlide,onTouchStart:!a&&r.startTouchSlide,role:"slider",style:n,tabIndex:0})}),p.map(function(e,t,n){return 0===t&&1<n.length?null:v.default.createElement(h,{className:"rheostat-progress",key:"progress-bar-"+String(t),style:r.getProgressStyle(t)})}),l&&n.map(function(e){var t=i.getPosition(e,c,o),n="vertical"===u?{top:String(t)+"%",position:"absolute"}:{left:String(t)+"%",position:"absolute"};return v.default.createElement(l,{key:"pit-"+String(e),style:n},e)}),t)}}]),N);function N(e){c(this,N);var t=u(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,e)),n=t.props,r=n.algorithm,i=n.max,a=n.min,s=n.values;return t.state={className:p(t.props),handlePos:s.map(function(e){return r.getPosition(e,a,i)}),handleDimensions:0,mousePos:null,sliderBox:{},slidingIndex:null,values:s},t.getPublicState=t.getPublicState.bind(t),t.getSliderBoundingBox=t.getSliderBoundingBox.bind(t),t.getProgressStyle=t.getProgressStyle.bind(t),t.getMinValue=t.getMinValue.bind(t),t.getMaxValue=t.getMaxValue.bind(t),t.getHandleDimensions=t.getHandleDimensions.bind(t),t.getClosestSnapPoint=t.getClosestSnapPoint.bind(t),t.getSnapPosition=t.getSnapPosition.bind(t),t.getNextPositionForKey=t.getNextPositionForKey.bind(t),t.getNextState=t.getNextState.bind(t),t.handleClick=t.handleClick.bind(t),t.getClosestHandle=t.getClosestHandle.bind(t),t.setStartSlide=t.setStartSlide.bind(t),t.startMouseSlide=t.startMouseSlide.bind(t),t.startTouchSlide=t.startTouchSlide.bind(t),t.handleMouseSlide=t.handleMouseSlide.bind(t),t.handleTouchSlide=t.handleTouchSlide.bind(t),t.handleSlide=t.handleSlide.bind(t),t.endSlide=t.endSlide.bind(t),t.handleKeydown=t.handleKeydown.bind(t),t.validatePosition=t.validatePosition.bind(t),t.validateValues=t.validateValues.bind(t),t.canMove=t.canMove.bind(t),t.fireChangeEvent=t.fireChangeEvent.bind(t),t.slideTo=t.slideTo.bind(t),t.updateNewValues=t.updateNewValues.bind(t),t}_.propTypes=S,_.defaultProps=P,t.default=_})),nd=function(e){function a(){var e,n;T(this,a);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return F(o(n=O(this,(e=L(a)).call.apply(e,[this].concat(r)))),"handleChange",function(e){var t=e.values;n.isDisabled||n.props.refine(t)}),F(o(n),"createHandleComponent",function(i){return function(e){var t=Math.round(100*parseFloat(e["aria-valuenow"]))/100,n=i&&i.format?i.format(t):t,r=Yh(e.className,{"rheostat-handle-lower":0===e["data-handle-key"],"rheostat-handle-upper":1===e["data-handle-key"]});return Jl.createElement("div",d({},e,{className:r}),i&&Jl.createElement("div",{className:"rheostat-tooltip"},n))}}),n}return I(a,Yl),M(a,[{key:"computeDefaultPitPoints",value:function(e){var t=e.min,n=e.max,r=(n-t)/34;return[t].concat(y(Nc({end:33}).map(function(e){return t+r*(e+1)})),[n])}},{key:"computeSnapPoints",value:function(e){var t=e.min,n=e.max,r=e.step;if(r)return[].concat(y(Nc({start:t,end:n,step:r})),[n])}},{key:"render",value:function(){var e=this.props,t=e.tooltips,n=e.step,r=e.pips,i=e.values,a=e.cssClasses,s=this.isDisabled?{min:this.props.min,max:this.props.max+.001}:this.props,o=s.min,c=s.max,u=this.computeSnapPoints({min:o,max:c,step:n}),l=!1===r?[]:this.computeDefaultPitPoints({min:o,max:c});return Jl.createElement("div",{className:Yh(a.root,F({},a.disabledRoot,this.isDisabled))},Jl.createElement(td,{handle:this.createHandleComponent(t),onChange:this.handleChange,min:o,max:c,pitComponent:ed,pitPoints:l,snap:!0,snapPoints:u,values:this.isDisabled?[o,c]:i,disabled:this.isDisabled}))}},{key:"isDisabled",get:function(){return this.props.min>=this.props.max}}]),a}(),rd=Mc({name:"range-slider"}),id=Jc("RangeSlider");var ad=Mc({name:"sort-by"}),sd=Jc("SortBy");var od={item:'{{#count}}<a class="{{cssClasses.link}}" aria-label="{{value}} & up" href="{{href}}">{{/count}}{{^count}}<div class="{{cssClasses.link}}" aria-label="{{value}} & up" disabled>{{/count}}\n  {{#stars}}<svg class="{{cssClasses.starIcon}} {{#.}}{{cssClasses.fullStarIcon}}{{/.}}{{^.}}{{cssClasses.emptyStarIcon}}{{/.}}" aria-hidden="true" width="24" height="24">\n    {{#.}}<use xlink:href="#ais-RatingMenu-starSymbol"></use>{{/.}}{{^.}}<use xlink:href="#ais-RatingMenu-starEmptySymbol"></use>{{/.}}\n  </svg>{{/stars}}\n  <span class="{{cssClasses.label}}">& Up</span>\n  {{#count}}<span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>{{/count}}\n{{#count}}</a>{{/count}}{{^count}}</div>{{/count}}'},cd=Mc({name:"rating-menu"}),ud=Jc("RatingMenu"),ld=Jl.createElement("path",{d:"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z"}),hd=Jl.createElement("path",{d:"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z"});function fd(e){var t=e.nbHits,n=e.hitsPerPage,r=e.nbPages,i=e.page,a=e.processingTimeMS,s=e.query,o=e.templateProps,c=e.cssClasses;return Jl.createElement("div",{className:c.root},Jl.createElement($h,d({},o,{templateKey:"text",rootTagName:"span",rootProps:{className:c.text},data:{hasManyResults:1<t,hasNoResults:0===t,hasOneResult:1===t,hitsPerPage:n,nbHits:t,nbPages:r,page:i,processingTimeMS:a,query:s,cssClasses:c}})))}var dd={text:"{{#hasNoResults}}No results{{/hasNoResults}}\n    {{#hasOneResult}}1 result{{/hasOneResult}}\n    {{#hasManyResults}}{{#helpers.formatNumber}}{{nbHits}}{{/helpers.formatNumber}} results{{/hasManyResults}} found in {{processingTimeMS}}ms"},pd=Mc({name:"stats"}),md=Jc("Stats");function vd(e){var t=e.currentRefinement,n=e.refine,r=e.cssClasses,i=e.templateProps;return Jl.createElement("div",{className:r.root},Jl.createElement("label",{className:r.label},Jl.createElement("input",{className:r.checkbox,type:"checkbox",checked:t.isRefined,onChange:function(e){return n(!e.target.checked)}}),Jl.createElement($h,d({},i,{rootTagName:"span",rootProps:{className:r.labelText},templateKey:"labelText",data:t}))))}var gd={labelText:"{{name}}"},yd=Mc({name:"toggle-refinement"}),bd=Jc("ToggleRefinement");var wd=Mc({name:"analytics"});function Rd(e){var t=e.createURL,n=e.items,r=e.refine,i=e.cssClasses,a=e.templateProps;return Jl.createElement("div",{className:Yh(i.root,F({},i.noRefinementRoot,0===n.length))},Jl.createElement("ul",{className:i.list},Jl.createElement("li",{className:Yh(i.item,F({},i.selectedItem,0===n.length))},Jl.createElement($h,d({},a,{templateKey:"home",rootTagName:"a",rootProps:{className:i.link,href:t(null),onClick:function(e){e.preventDefault(),r(null)}}}))),n.map(function(e){var a=e.cssClasses,s=e.createURL,o=e.refine,c=e.templateProps;return function(t,e,n){var r=e===n.length-1,i=r?t.label:Jl.createElement("a",{className:a.link,href:s(t.value),onClick:function(e){e.preventDefault(),o(t.value)}},t.label);return Jl.createElement("li",{key:t.label+e,className:Yh(a.item,F({},a.selectedItem,r))},Jl.createElement($h,d({},c,{templateKey:"separator",rootTagName:"span",rootProps:{className:a.separator,"aria-hidden":!0}})),i)}}({cssClasses:i,createURL:t,refine:r,templateProps:a}))))}var Sd={home:"Home",separator:">"},Pd=Mc({name:"breadcrumb"}),_d=Jc("Breadcrumb");var Nd=function(e){function a(){var e,n;T(this,a);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return F(o(n=O(this,(e=L(a)).call.apply(e,[this].concat(r)))),"handleSelectChange",function(e){var t=e.target.value;n.props.refine(t)}),n}return I(a,Yl),M(a,[{key:"render",value:function(){var e=this.props,t=e.cssClasses,n=e.templateProps,r=e.items,i=(pc(r,function(e){return e.isRefined})||{value:""}).value,a=Yh(t.root,F({},t.noRefinementRoot,0===r.length));return Jl.createElement("div",{className:a},Jl.createElement("select",{className:t.select,value:i,onChange:this.handleSelectChange},Jl.createElement($h,d({},n,{templateKey:"defaultOption",rootTagName:"option",rootProps:{value:"",className:t.option}})),r.map(function(e){return Jl.createElement($h,d({},n,{templateKey:"item",rootTagName:"option",rootProps:{value:e.value,className:t.option},key:e.value,data:e}))})))}}]),a}(),xd={item:"{{label}} ({{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}})",defaultOption:"See all"},Cd=Mc({name:"menu-select"}),Fd=Jc("MenuSelect");function Ed(e){var t=e.url,n=e.theme,r=e.cssClasses;return Jl.createElement("div",{className:r.root},Jl.createElement("a",{href:t,target:"_blank",className:r.link,"aria-label":"Search by Algolia",rel:"noopener noreferrer"},Jl.createElement("svg",{height:"1.2em",className:r.logo,viewBox:"0 0 168 24",style:{width:"auto"}},Jl.createElement("path",{fill:"dark"===n?"#FFF":"#5D6494",d:"M6.97 6.68V8.3a4.47 4.47 0 0 0-2.42-.67 2.2 2.2 0 0 0-1.38.4c-.34.26-.5.6-.5 1.02 0 .43.16.77.49 1.03.33.25.83.53 1.51.83a7.04 7.04 0 0 1 1.9 1.08c.34.24.58.54.73.89.15.34.23.74.23 1.18 0 .95-.33 1.7-1 2.24a4 4 0 0 1-2.6.81 5.71 5.71 0 0 1-2.94-.68v-1.71c.84.63 1.81.94 2.92.94.58 0 1.05-.14 1.39-.4.34-.28.5-.65.5-1.13 0-.29-.1-.55-.3-.8a2.2 2.2 0 0 0-.65-.53 23.03 23.03 0 0 0-1.64-.78 13.67 13.67 0 0 1-1.11-.64c-.12-.1-.28-.22-.46-.4a1.72 1.72 0 0 1-.39-.5 4.46 4.46 0 0 1-.22-.6c-.07-.23-.1-.48-.1-.75 0-.91.33-1.63 1-2.17a4 4 0 0 1 2.57-.8c.97 0 1.8.18 2.47.52zm7.47 5.7v-.3a2.26 2.26 0 0 0-.5-1.44c-.3-.35-.74-.53-1.32-.53-.53 0-.99.2-1.37.58-.38.39-.62.95-.72 1.68h3.91zm1 2.79v1.4c-.6.34-1.38.51-2.36.51a4.02 4.02 0 0 1-3-1.13 4.04 4.04 0 0 1-1.11-2.97c0-1.3.34-2.32 1.02-3.06a3.38 3.38 0 0 1 2.6-1.1c1.03 0 1.85.32 2.46.96.6.64.9 1.57.9 2.78 0 .33-.03.68-.09 1.04h-5.31c.1.7.4 1.24.89 1.61.49.38 1.1.56 1.85.56.86 0 1.58-.2 2.15-.6zm6.61-1.78h-1.21c-.6 0-1.05.12-1.35.36-.3.23-.46.53-.46.89 0 .37.12.66.36.88.23.2.57.32 1.02.32.5 0 .9-.15 1.2-.43.3-.28.44-.65.44-1.1v-.92zm-4.07-2.55V9.33a4.96 4.96 0 0 1 2.5-.55c2.1 0 3.17 1.03 3.17 3.08V17H22.1v-.96c-.42.68-1.15 1.02-2.19 1.02-.76 0-1.38-.22-1.84-.66-.46-.44-.7-1-.7-1.68 0-.78.3-1.38.88-1.81.59-.43 1.4-.65 2.46-.65h1.34v-.46c0-.55-.13-.97-.4-1.25-.26-.29-.7-.43-1.32-.43-.86 0-1.65.24-2.35.72zm9.34-1.93v1.42c.39-1 1.1-1.5 2.12-1.5.15 0 .31.02.5.05v1.53c-.23-.1-.48-.14-.76-.14-.54 0-.99.24-1.34.71a2.8 2.8 0 0 0-.52 1.71V17h-1.57V8.91h1.57zm5 4.09a3 3 0 0 0 .76 2.01c.47.53 1.14.8 2 .8.64 0 1.24-.18 1.8-.53v1.4c-.53.32-1.2.48-2 .48a3.98 3.98 0 0 1-4.17-4.18c0-1.16.38-2.15 1.14-2.98a4 4 0 0 1 3.1-1.23c.7 0 1.34.15 1.92.44v1.44a3.24 3.24 0 0 0-1.77-.5A2.65 2.65 0 0 0 32.33 13zm7.92-7.28v4.58c.46-1 1.3-1.5 2.5-1.5.8 0 1.42.24 1.9.73.48.5.72 1.17.72 2.05V17H43.8v-5.1c0-.56-.14-.99-.43-1.29-.28-.3-.65-.45-1.1-.45-.54 0-1 .2-1.42.6-.4.4-.61 1.02-.61 1.85V17h-1.56V5.72h1.56zM55.2 15.74c.6 0 1.1-.25 1.5-.76.4-.5.6-1.16.6-1.95 0-.92-.2-1.62-.6-2.12-.4-.5-.92-.74-1.55-.74-.56 0-1.05.22-1.5.67-.44.45-.66 1.13-.66 2.06 0 .96.22 1.67.64 2.14.43.47.95.7 1.57.7zM53 5.72v4.42a2.74 2.74 0 0 1 2.43-1.34c1.03 0 1.86.38 2.51 1.15.65.76.97 1.78.97 3.05 0 1.13-.3 2.1-.92 2.9-.62.81-1.47 1.21-2.54 1.21s-1.9-.45-2.46-1.34V17h-1.58V5.72H53zm9.9 11.1l-3.22-7.9h1.74l1 2.62 1.26 3.42c.1-.32.48-1.46 1.15-3.42l.91-2.63h1.66l-2.92 7.87c-.78 2.07-1.96 3.1-3.56 3.1-.28 0-.53-.02-.73-.07v-1.34c.17.04.35.06.54.06 1.03 0 1.76-.57 2.17-1.7z"}),jd,Td,Jl.createElement("path",{fill:"dark"===n?"#FFF":"#5468FF",d:"M120.92 18.8c-4.38.02-4.38-3.54-4.38-4.1V1.36l2.67-.42v13.25c0 .32 0 2.36 1.71 2.37v2.24zm-10.84-2.18c.82 0 1.43-.04 1.85-.12v-2.72a5.48 5.48 0 0 0-1.57-.2c-.3 0-.6.02-.9.07-.3.04-.57.12-.81.24-.24.11-.44.28-.58.49a.93.93 0 0 0-.22.65c0 .63.22 1 .61 1.23.4.24.94.36 1.62.36zm-.23-9.7c.88 0 1.62.11 2.23.33.6.22 1.09.53 1.44.92.36.4.61.92.76 1.48.16.56.23 1.17.23 1.85v6.87c-.4.1-1.03.2-1.86.32-.84.12-1.78.18-2.82.18-.69 0-1.32-.07-1.9-.2a4 4 0 0 1-1.46-.63c-.4-.3-.72-.67-.96-1.13a4.3 4.3 0 0 1-.34-1.8c0-.66.13-1.08.39-1.53.26-.45.6-.82 1.04-1.1.45-.3.95-.5 1.54-.62a8.8 8.8 0 0 1 3.79.05v-.44c0-.3-.04-.6-.11-.87a1.78 1.78 0 0 0-1.1-1.22c-.31-.12-.7-.2-1.15-.2a9.75 9.75 0 0 0-2.95.46l-.33-2.19c.34-.12.84-.23 1.48-.35.65-.12 1.34-.18 2.08-.18zm52.84 9.63c.82 0 1.43-.05 1.85-.13V13.7a5.42 5.42 0 0 0-1.57-.2c-.3 0-.6.02-.9.07-.3.04-.57.12-.81.24-.24.12-.44.28-.58.5a.93.93 0 0 0-.22.65c0 .63.22.99.61 1.23.4.24.94.36 1.62.36zm-.23-9.7c.88 0 1.63.11 2.23.33.6.22 1.1.53 1.45.92.35.39.6.92.76 1.48.15.56.23 1.18.23 1.85v6.88c-.41.08-1.03.19-1.87.31-.83.12-1.77.18-2.81.18-.7 0-1.33-.06-1.9-.2a4 4 0 0 1-1.47-.63c-.4-.3-.72-.67-.95-1.13a4.3 4.3 0 0 1-.34-1.8c0-.66.13-1.08.38-1.53.26-.45.61-.82 1.05-1.1.44-.3.95-.5 1.53-.62a8.8 8.8 0 0 1 3.8.05v-.43c0-.31-.04-.6-.12-.88-.07-.28-.2-.52-.38-.73a1.78 1.78 0 0 0-.73-.5c-.3-.1-.68-.2-1.14-.2a9.85 9.85 0 0 0-2.95.47l-.32-2.19a11.63 11.63 0 0 1 3.55-.53zm-8.03-1.27a1.62 1.62 0 0 0 0-3.24 1.62 1.62 0 1 0 0 3.24zm1.35 13.22h-2.7V7.27l2.7-.42V18.8zm-4.72 0c-4.38.02-4.38-3.54-4.38-4.1l-.01-13.34 2.67-.42v13.25c0 .32 0 2.36 1.72 2.37v2.24zm-8.7-5.9a4.7 4.7 0 0 0-.74-2.79 2.4 2.4 0 0 0-2.07-1 2.4 2.4 0 0 0-2.06 1 4.7 4.7 0 0 0-.74 2.8c0 1.16.25 1.94.74 2.62a2.4 2.4 0 0 0 2.07 1.02c.88 0 1.57-.34 2.07-1.02.49-.68.73-1.46.73-2.63zm2.74 0a6.46 6.46 0 0 1-1.52 4.23c-.49.53-1.07.94-1.76 1.22-.68.29-1.73.45-2.26.45-.53 0-1.58-.15-2.25-.45a5.1 5.1 0 0 1-2.88-3.13 7.3 7.3 0 0 1-.01-4.84 5.13 5.13 0 0 1 2.9-3.1 5.67 5.67 0 0 1 2.22-.42c.81 0 1.56.14 2.24.42.69.29 1.28.69 1.75 1.22.49.52.87 1.15 1.14 1.89a7 7 0 0 1 .43 2.5zm-20.14 0c0 1.11.25 2.36.74 2.88.5.52 1.13.78 1.91.78a4.07 4.07 0 0 0 2.12-.6V9.33c-.19-.04-.99-.2-1.76-.23a2.67 2.67 0 0 0-2.23 1 4.73 4.73 0 0 0-.78 2.8zm7.44 5.27c0 1.82-.46 3.16-1.4 4-.94.85-2.37 1.27-4.3 1.27-.7 0-2.17-.13-3.34-.4l.43-2.11c.98.2 2.27.26 2.95.26 1.08 0 1.84-.22 2.3-.66.46-.43.68-1.08.68-1.94v-.44a5.2 5.2 0 0 1-2.54.6 5.6 5.6 0 0 1-2.01-.36 4.2 4.2 0 0 1-2.58-2.71 9.88 9.88 0 0 1 .02-5.35 4.92 4.92 0 0 1 2.93-2.96 6.6 6.6 0 0 1 2.43-.46 19.64 19.64 0 0 1 4.43.66v10.6z"}))))}var jd=Jl.createElement("path",{fill:"#5468FF",d:"M78.99.94h16.6a2.97 2.97 0 0 1 2.96 2.96v16.6a2.97 2.97 0 0 1-2.97 2.96h-16.6a2.97 2.97 0 0 1-2.96-2.96V3.9A2.96 2.96 0 0 1 79 .94"}),Td=Jl.createElement("path",{fill:"#FFF",d:"M89.63 5.97v-.78a.98.98 0 0 0-.98-.97h-2.28a.98.98 0 0 0-.97.97V6c0 .09.08.15.17.13a7.13 7.13 0 0 1 3.9-.02c.08.02.16-.04.16-.13m-6.25 1L83 6.6a.98.98 0 0 0-1.38 0l-.46.46a.97.97 0 0 0 0 1.38l.38.39c.06.06.15.04.2-.02a7.49 7.49 0 0 1 1.63-1.62c.07-.04.08-.14.02-.2m4.16 2.45v3.34c0 .1.1.17.2.12l2.97-1.54c.06-.03.08-.12.05-.18a3.7 3.7 0 0 0-3.08-1.87c-.07 0-.14.06-.14.13m0 8.05a4.49 4.49 0 1 1 0-8.98 4.49 4.49 0 0 1 0 8.98m0-10.85a6.37 6.37 0 1 0 0 12.74 6.37 6.37 0 0 0 0-12.74"}),Md=Jc("PoweredBy"),Id=Mc({name:"powered-by"});var Ld=function(e){function a(){var e,t;T(this,a);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return F(o(t=O(this,(e=L(a)).call.apply(e,[this].concat(r)))),"state",{collapsed:t.props.collapsed,controlled:!1}),t}return I(a,Yl),M(a,[{key:"componentDidMount",value:function(){this.bodyRef.appendChild(this.props.bodyElement)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.cssClasses,i=n.hidden,a=n.collapsible,s=n.templateProps,o=n.data;return Jl.createElement("div",{className:Yh(r.root,(e={},F(e,r.noRefinementRoot,i),F(e,r.collapsibleRoot,a),F(e,r.collapsedRoot,this.state.collapsed),e)),hidden:i},s.templates.header&&Jl.createElement("div",{className:r.header},Jl.createElement($h,d({},s,{templateKey:"header",rootTagName:"span",data:o})),a&&Jl.createElement("button",{className:r.collapseButton,"aria-expanded":!this.state.collapsed,onClick:function(e){e.preventDefault(),t.setState(function(e){return{controlled:!0,collapsed:!e.collapsed}})}},Jl.createElement($h,d({},s,{templateKey:"collapseButtonText",rootTagName:"span",data:{collapsed:this.state.collapsed}})))),Jl.createElement("div",{className:r.body,ref:function(e){return t.bodyRef=e}}),s.templates.footer&&Jl.createElement($h,d({},s,{templateKey:"footer",rootProps:{className:r.footer},data:o})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return t.controlled||e.collapsed===t.collapsed?null:{collapsed:e.collapsed}}}]),a}(),kd=Mc({name:"panel"}),Od=Jc("Panel");function Ad(e){var t=e.cssClasses,n=e.isBrowserSupported,r=e.isListening,i=e.toggleListening,a=e.voiceListeningState,s=e.templates,o=a.status,c=a.transcript,u=a.isSpeechFinal,l=a.errorCode;return Jl.createElement("div",{className:t.root},Jl.createElement($h,{templateKey:"buttonText",rootTagName:"button",rootProps:{className:t.button,type:"button",title:"Search by voice".concat(n?"":" (not supported on this browser)"),onClick:function(e){e.currentTarget.blur(),i()},disabled:!n},data:{status:o,errorCode:l,isListening:r,transcript:c,isSpeechFinal:u,isBrowserSupported:n},templates:s}),Jl.createElement($h,{templateKey:"status",rootProps:{className:t.status},data:{status:o,errorCode:l,isListening:r,transcript:c,isSpeechFinal:u,isBrowserSupported:n},templates:s}))}function Dd(e){var t=e.isBrowserSupported,n=e.isListening,r=e.toggleListening,i=e.voiceListeningState,a=e.widgetParams,s=a.container,o=a.cssClasses,c=a.templates;Sl(Jl.createElement(Ad,{cssClasses:o,templates:c,isBrowserSupported:t,isListening:n,toggleListening:r,voiceListeningState:i}),s)}function Hd(e){var t=e.cssClasses,n=e.templates,r=e.items;return Jl.createElement($h,{templateKey:"default",templates:n,rootProps:{className:t.root},data:{items:r}})}function Ud(e){var t=e.items,n=e.widgetParams,r=n.container,i=n.cssClasses,a=n.templates;Sl(Jl.createElement(Hd,{cssClasses:i,templates:a,items:t}),r)}function Bd(e){return new au(e)}var Vd={buttonText:function(e){var t=e.status,n=e.errorCode,r=e.isListening;return'<svg\n       xmlns="http://www.w3.org/2000/svg"\n       width="16"\n       height="16"\n       viewBox="0 0 24 24"\n       fill="none"\n       stroke="currentColor"\n       stroke-width="2"\n       stroke-linecap="round"\n       stroke-linejoin="round"\n     >\n       '.concat(function(e,t,n){return"error"===e&&"not-allowed"===t?'<line x1="1" y1="1" x2="23" y2="23"></line>\n            <path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"></path>\n            <path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"></path>\n            <line x1="12" y1="19" x2="12" y2="23"></line>\n            <line x1="8" y1="23" x2="16" y2="23"></line>':'<path\n            d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"\n            fill="'.concat(n?"currentColor":"none",'">\n          </path>\n          <path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>\n          <line x1="12" y1="19" x2="12" y2="23"></line>\n          <line x1="8" y1="23" x2="16" y2="23"></line>')}(t,n,r),"\n     </svg>")},status:"<p>{{transcript}}</p>"},Qd=Mc({name:"voice-search"}),qd=Jc("VoiceSearch"),Wd=Mc({name:"query-rule-custom-data"}),zd=Jc("QueryRuleCustomData"),Kd=Mc({name:"query-rule-context"}),Yd=Object.freeze({clearRefinements:function(e){var t=e.container,n=e.templates,r=void 0===n?Jh:n,i=e.includedAttributes,a=e.excludedAttributes,s=e.transformItems,o=e.cssClasses,c=void 0===o?{}:o;if(!t)throw new Error(Zh("The `container` option is required."));var u=sc(t),l={root:Yh(Xh(),c.root),button:Yh(Xh({descendantName:"button"}),c.button),disabledButton:Yh(Xh({descendantName:"button",modifierName:"disabled"}),c.disabledButton)};return cu(function(e){var a=e.containerNode,s=e.cssClasses,o=e.renderState,c=e.templates;return function(e,t){var n=e.refine,r=e.hasRefinements,i=e.instantSearchInstance;t?o.templateProps=uc({defaultTemplates:Jh,templatesConfig:i.templatesConfig,templates:c}):Sl(Jl.createElement(Gh,{refine:n,cssClasses:s,hasRefinements:r,templateProps:o.templateProps}),a)}}({containerNode:u,cssClasses:l,renderState:{},templates:r}),function(){return xl(u)})({includedAttributes:i,excludedAttributes:a,transformItems:s})},configure:function(e){return kh()({searchParameters:e})},currentRefinements:function(e){var t=e.container,n=e.includedAttributes,r=e.excludedAttributes,i=e.cssClasses,a=void 0===i?{}:i,s=e.transformItems;if(!t)throw new Error(tf("The `container` option is required."));var o=sc(t),c={root:Yh(nf(),a.root),list:Yh(nf({descendantName:"list"}),a.list),item:Yh(nf({descendantName:"item"}),a.item),label:Yh(nf({descendantName:"label"}),a.label),category:Yh(nf({descendantName:"category"}),a.category),categoryLabel:Yh(nf({descendantName:"categoryLabel"}),a.categoryLabel),delete:Yh(nf({descendantName:"delete"}),a.delete)};return hu(function(e){var r=e.containerNode,i=e.cssClasses;return function(e,t){var n=e.items;t||Sl(Jl.createElement(ef,{cssClasses:i,items:n}),r)}}({containerNode:o,cssClasses:c}),function(){return xl(o)})({includedAttributes:n,excludedAttributes:r,transformItems:s})},geoSearch:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.initialZoom,n=void 0===t?1:t,r=e.initialPosition,i=void 0===r?{lat:0,lng:0}:r,a=e.templates,s=void 0===a?{}:a,o=e.cssClasses,c=void 0===o?{}:o,u=e.builtInMarker,l=void 0===u?{}:u,h=e.customHTMLMarker,f=e.enableRefine,d=void 0===f||f,p=e.enableClearMapRefinement,m=void 0===p||p,v=e.enableRefineControl,g=void 0===v||v,y=e.container,b=e.googleReference,w=k(e,["initialZoom","initialPosition","templates","cssClasses","builtInMarker","customHTMLMarker","enableRefine","enableClearMapRefinement","enableRefineControl","container","googleReference"]),R={createOptions:Sc,events:{}},S={createOptions:Sc,events:{}};if(!y)throw new Error(hf("The `container` option is required."));if(!b)throw new Error(hf("The `googleReference` option is required."));var P=sc(y),_={root:Yh(ff(),c.root),tree:ff({descendantName:"tree"}),map:Yh(ff({descendantName:"map"}),c.map),control:Yh(ff({descendantName:"control"}),c.control),label:Yh(ff({descendantName:"label"}),c.label),selectedLabel:Yh(ff({descendantName:"label",modifierName:"selected"}),c.selectedLabel),input:Yh(ff({descendantName:"input"}),c.input),redo:Yh(ff({descendantName:"redo"}),c.redo),disabledRedo:Yh(ff({descendantName:"redo",modifierName:"disabled"}),c.disabledRedo),reset:Yh(ff({descendantName:"reset"}),c.reset)},N=H({},lf,s),x=H({},R,l),C=(Boolean(h)||Boolean(s.HTMLMarker))&&H({},S,h),F=function(l){return function(e){function u(e){var t,n=e.__id,r=e.position,i=e.map,a=e.template,s=e.className,o=e.anchor,c=void 0===o?{x:0,y:0}:o;return T(this,u),(t=O(this,L(u).call(this))).__id=n,t.anchor=c,t.listeners={},t.latLng=new l.maps.LatLng(r),t.element=document.createElement("div"),t.element.className=s,t.element.style.position="absolute",t.element.innerHTML=a,t.setMap(i),t}return I(u,l.maps.OverlayView),M(u,[{key:"onAdd",value:function(){this.getPanes().overlayMouseTarget.appendChild(this.element);var e=this.element.getBoundingClientRect();this.offset={x:this.anchor.x+e.width/2,y:this.anchor.y+e.height},this.element.style.width="".concat(e.width,"px")}},{key:"draw",value:function(){var e=this.getProjection().fromLatLngToDivPixel(this.latLng);this.element.style.left="".concat(Math.round(e.x-this.offset.x),"px"),this.element.style.top="".concat(Math.round(e.y-this.offset.y),"px"),this.element.style.zIndex=parseInt(this.element.style.top,10)}},{key:"onRemove",value:function(){var t=this;this.element&&(this.element.parentNode.removeChild(this.element),Object.keys(this.listeners).forEach(function(e){t.element.removeEventListener(e,t.listeners[e])}),delete this.element,delete this.listeners)}},{key:"addListener",value:function(e,t){this.listeners[e]=t,this.element.addEventListener(e,t)}},{key:"getPosition",value:function(){return this.latLng}}]),u}()}(b),E=C?function(e){var t=e.item,n=k(e,["item"]);return new F(H({},C.createOptions(t),n,{__id:t.objectID,position:t._geoloc,className:Yh(ff({descendantName:"marker"})),template:dc({templateKey:"HTMLMarker",templates:N,data:t})}))}:function(e){var t=e.item,n=k(e,["item"]);return new b.maps.Marker(H({},x.createOptions(t),n,{__id:t.objectID,position:t._geoloc}))},j=C||x;return jh(uf,function(){for(xl(P.querySelector(".".concat(_.tree)));P.firstChild;)P.removeChild(P.firstChild)})(H({},w,{renderState:{},container:P,googleReference:b,initialZoom:n,initialPosition:i,templates:N,cssClasses:_,createMarker:E,markerOptions:j,enableRefine:d,enableClearMapRefinement:m,enableRefineControl:g}))},hierarchicalMenu:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attributes,r=e.separator,i=e.rootPath,a=e.showParentLevel,s=e.limit,o=e.showMore,c=void 0!==o&&o,u=e.showMoreLimit,l=e.sortBy,h=e.transformItems,f=e.templates,d=void 0===f?vf:f,p=e.cssClasses,m=void 0===p?{}:p;if(!t)throw new Error(gf("The `container` option is required."));var v=sc(t);return gu(function(e){var u=e.cssClasses,l=e.containerNode,h=e.showMore,f=e.templates,d=e.renderState;return function(e,t){var n=e.createURL,r=e.items,i=e.refine,a=e.instantSearchInstance,s=e.isShowingMore,o=e.toggleShowMore,c=e.canToggleShowMore;t?d.templateProps=uc({defaultTemplates:vf,templatesConfig:a.templatesConfig,templates:f}):Sl(Jl.createElement(mf,{createURL:n,cssClasses:u,facetValues:r,templateProps:d.templateProps,toggleRefinement:i,showMore:h,toggleShowMore:o,isShowingMore:s,canToggleShowMore:c}),l)}}({cssClasses:{root:Yh(yf(),m.root),noRefinementRoot:Yh(yf({modifierName:"noRefinement"}),m.noRefinementRoot),list:Yh(yf({descendantName:"list"}),m.list),childList:Yh(yf({descendantName:"list",modifierName:"child"}),m.childList),item:Yh(yf({descendantName:"item"}),m.item),selectedItem:Yh(yf({descendantName:"item",modifierName:"selected"}),m.selectedItem),parentItem:Yh(yf({descendantName:"item",modifierName:"parent"}),m.parentItem),link:Yh(yf({descendantName:"link"}),m.link),label:Yh(yf({descendantName:"label"}),m.label),count:Yh(yf({descendantName:"count"}),m.count),showMore:Yh(yf({descendantName:"showMore"}),m.showMore),disabledShowMore:Yh(yf({descendantName:"showMore",modifierName:"disabled"}),m.disabledShowMore)},containerNode:v,templates:d,showMore:c,renderState:{}}),function(){return xl(v)})({attributes:n,separator:r,rootPath:i,showParentLevel:a,limit:s,showMore:c,showMoreLimit:u,sortBy:l,transformItems:h})},hits:function(e){var t=e.container,n=e.escapeHTML,r=e.transformItems,i=e.templates,a=void 0===i?wf:i,s=e.cssClasses,o=void 0===s?{}:s;if(!t)throw new Error(Rf("The `container` option is required."));Ic(void 0===a.allItems,"The template `allItems` does not exist since InstantSearch.js 3.\n\nYou may want to migrate using `connectHits`: ".concat(Tc({name:"hits",connector:!0}),"."));var c=sc(t),u={root:Yh(Sf(),o.root),emptyRoot:Yh(Sf({modifierName:"empty"}),o.emptyRoot),list:Yh(Sf({descendantName:"list"}),o.list),item:Yh(Sf({descendantName:"item"}),o.item)},l=function(e){var s=e.renderState,o=e.cssClasses,c=e.containerNode,u=e.templates;return function(e,t){var n=e.hits,r=e.results,i=e.instantSearchInstance,a=e.insights;t?s.templateProps=uc({defaultTemplates:wf,templatesConfig:i.templatesConfig,templates:u}):Sl(Jl.createElement(Pf,{cssClasses:o,hits:n,results:r,templateProps:s.templateProps,insights:a}),c)}}({containerNode:c,cssClasses:u,renderState:{},templates:a});return Su(bu)(l,function(){return xl(c)})({escapeHTML:n,transformItems:r})},hitsPerPage:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.items,r=e.cssClasses,i=void 0===r?{}:r,a=e.transformItems;if(!t)throw new Error(Nf("The `container` option is required."));var s=sc(t),o={root:Yh(xf(),i.root),select:Yh(xf({descendantName:"select"}),i.select),option:Yh(xf({descendantName:"option"}),i.option)};return eh(function(e){var a=e.containerNode,s=e.cssClasses;return function(e,t){var n=e.items,r=e.refine;if(!t){var i=(pc(n,function(e){return e.isRefined})||{}).value;Sl(Jl.createElement("div",{className:s.root},Jl.createElement(_f,{cssClasses:s,currentValue:i,options:n,setValue:r})),a)}}}({containerNode:s,cssClasses:o}),function(){return xl(s)})({items:n,transformItems:a})},infiniteHits:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.escapeHTML,r=e.transformItems,i=e.templates,a=void 0===i?Cf:i,s=e.cssClasses,o=void 0===s?{}:s,c=e.showPrevious;if(!t)throw new Error(Ff("The `container` option is required."));Ic(void 0===a.allItems,"The template `allItems` does not exist since InstantSearch.js 3.\n\n You may want to migrate using `connectInfiniteHits`: ".concat(Tc({name:"infinite-hits",connector:!0}),"."));var u=sc(t),l={root:Yh(Ef(),o.root),emptyRoot:Yh(Ef({modifierName:"empty"}),o.emptyRoot),item:Yh(Ef({descendantName:"item"}),o.item),list:Yh(Ef({descendantName:"list"}),o.list),loadPrevious:Yh(Ef({descendantName:"loadPrevious"}),o.loadPrevious),disabledLoadPrevious:Yh(Ef({descendantName:"loadPrevious",modifierName:"disabled"}),o.disabledLoadPrevious),loadMore:Yh(Ef({descendantName:"loadMore"}),o.loadMore),disabledLoadMore:Yh(Ef({descendantName:"loadMore",modifierName:"disabled"}),o.disabledLoadMore)},h=function(e){var l=e.cssClasses,h=e.containerNode,f=e.renderState,d=e.templates,p=e.showPrevious;return function(e,t){var n=e.hits,r=e.results,i=e.showMore,a=e.showPrevious,s=e.isFirstPage,o=e.isLastPage,c=e.instantSearchInstance,u=e.insights;t?f.templateProps=uc({defaultTemplates:Cf,templatesConfig:c.templatesConfig,templates:d}):Sl(Jl.createElement(jf,{cssClasses:l,hits:n,results:r,hasShowPrevious:p,showPrevious:a,showMore:i,templateProps:f.templateProps,isFirstPage:s,isLastPage:o,insights:u}),h)}}({containerNode:u,cssClasses:l,templates:a,showPrevious:c,renderState:{}});return Su(th)(h,function(){return xl(u)})({escapeHTML:n,transformItems:r,showPrevious:c})},menu:function(e){var t=e.container,n=e.attribute,r=e.sortBy,i=e.limit,a=e.showMore,s=e.showMoreLimit,o=e.cssClasses,c=void 0===o?{}:o,u=e.templates,l=void 0===u?Tf:u,h=e.transformItems;if(!t)throw new Error(Mf("The `container` option is required."));var f=sc(t),d={root:Yh(If(),c.root),noRefinementRoot:Yh(If({modifierName:"noRefinement"}),c.noRefinementRoot),list:Yh(If({descendantName:"list"}),c.list),item:Yh(If({descendantName:"item"}),c.item),selectedItem:Yh(If({descendantName:"item",modifierName:"selected"}),c.selectedItem),link:Yh(If({descendantName:"link"}),c.link),label:Yh(If({descendantName:"label"}),c.label),count:Yh(If({descendantName:"count"}),c.count),showMore:Yh(If({descendantName:"showMore"}),c.showMore),disabledShowMore:Yh(If({descendantName:"showMore",modifierName:"disabled"}),c.disabledShowMore)};return ah(function(e){var l=e.containerNode,h=e.cssClasses,f=e.renderState,d=e.templates,p=e.showMore;return function(e,t){var n=e.refine,r=e.items,i=e.createURL,a=e.instantSearchInstance,s=e.isShowingMore,o=e.toggleShowMore,c=e.canToggleShowMore;if(t)f.templateProps=uc({defaultTemplates:Tf,templatesConfig:a.templatesConfig,templates:d});else{var u=r.map(function(e){return H({},e,{url:i(e.name)})});Sl(Jl.createElement(mf,{createURL:i,cssClasses:h,facetValues:u,showMore:p,templateProps:f.templateProps,toggleRefinement:n,toggleShowMore:o,isShowingMore:s,canToggleShowMore:c}),l)}}}({containerNode:f,cssClasses:d,renderState:{},templates:l,showMore:a}),function(){return xl(f)})({attribute:n,limit:i,showMore:a,showMoreLimit:s,sortBy:r,transformItems:h})},refinementList:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attribute,r=e.operator,i=e.sortBy,a=e.limit,s=e.showMore,o=e.showMoreLimit,c=e.searchable,u=void 0!==c&&c,l=e.searchablePlaceholder,h=void 0===l?"Search...":l,f=e.searchableEscapeFacetValues,d=void 0===f||f,p=e.searchableIsAlwaysActive,m=void 0===p||p,v=e.cssClasses,g=void 0===v?{}:v,y=e.templates,b=void 0===y?Lf:y,w=e.transformItems;if(!t)throw new Error(kf("The `container` option is required."));var R=!!u&&Boolean(d),S=sc(t),P=function(e){var t=H({},e,{submit:e.searchableSubmit,reset:e.searchableReset,loadingIndicator:e.searchableLoadingIndicator});return t.searchableReset,t.searchableSubmit,t.searchableLoadingIndicator,k(t,["searchableReset","searchableSubmit","searchableLoadingIndicator"])}(H({},Lf,b)),_={root:Yh(Of(),g.root),noRefinementRoot:Yh(Of({modifierName:"noRefinement"}),g.noRefinementRoot),list:Yh(Of({descendantName:"list"}),g.list),item:Yh(Of({descendantName:"item"}),g.item),selectedItem:Yh(Of({descendantName:"item",modifierName:"selected"}),g.selectedItem),searchBox:Yh(Of({descendantName:"searchBox"}),g.searchBox),label:Yh(Of({descendantName:"label"}),g.label),checkbox:Yh(Of({descendantName:"checkbox"}),g.checkbox),labelText:Yh(Of({descendantName:"labelText"}),g.labelText),count:Yh(Of({descendantName:"count"}),g.count),noResults:Yh(Of({descendantName:"noResults"}),g.noResults),showMore:Yh(Of({descendantName:"showMore"}),g.showMore),disabledShowMore:Yh(Of({descendantName:"showMore",modifierName:"disabled"}),g.disabledShowMore),searchable:{root:Yh(Af(),g.searchableRoot),form:Yh(Af({descendantName:"form"}),g.searchableForm),input:Yh(Af({descendantName:"input"}),g.searchableInput),submit:Yh(Af({descendantName:"submit"}),g.searchableSubmit),submitIcon:Yh(Af({descendantName:"submitIcon"}),g.searchableSubmitIcon),reset:Yh(Af({descendantName:"reset"}),g.searchableReset),resetIcon:Yh(Af({descendantName:"resetIcon"}),g.searchableResetIcon),loadingIndicator:Yh(Af({descendantName:"loadingIndicator"}),g.searchableLoadingIndicator),loadingIcon:Yh(Af({descendantName:"loadingIcon"}),g.searchableLoadingIcon)}};return gh(function(e){var f=e.containerNode,d=e.cssClasses,p=e.templates,m=e.renderState,v=e.showMore,g=e.searchable,y=e.searchablePlaceholder,b=e.searchableIsAlwaysActive;return function(e,t){var n=e.refine,r=e.items,i=e.createURL,a=e.searchForItems,s=e.isFromSearch,o=e.instantSearchInstance,c=e.toggleShowMore,u=e.isShowingMore,l=e.hasExhaustiveItems,h=e.canToggleShowMore;t?m.templateProps=uc({templatesConfig:o.templatesConfig,templates:p}):Sl(Jl.createElement(mf,{createURL:i,cssClasses:d,facetValues:r,templateProps:m.templateProps,toggleRefinement:n,searchFacetValues:g?a:void 0,searchPlaceholder:y,searchIsAlwaysActive:b,isFromSearch:s,showMore:v,toggleShowMore:c,isShowingMore:u,hasExhaustiveItems:l,canToggleShowMore:h}),f)}}({containerNode:S,cssClasses:_,templates:P,renderState:{},searchable:u,searchablePlaceholder:h,searchableIsAlwaysActive:m,showMore:s}),function(){return xl(S)})({attribute:n,operator:r,limit:a,showMore:s,showMoreLimit:o,sortBy:i,escapeFacetValues:R,transformItems:w})},numericMenu:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attribute,r=e.items,i=e.cssClasses,a=void 0===i?{}:i,s=e.templates,o=void 0===s?Df:s,c=e.transformItems;if(!t)throw new Error(Hf("The `container` option is required."));var u=sc(t),l={root:Yh(Uf(),a.root),noRefinementRoot:Yh(Uf({modifierName:"noRefinement"}),a.noRefinementRoot),list:Yh(Uf({descendantName:"list"}),a.list),item:Yh(Uf({descendantName:"item"}),a.item),selectedItem:Yh(Uf({descendantName:"item",modifierName:"selected"}),a.selectedItem),label:Yh(Uf({descendantName:"label"}),a.label),radio:Yh(Uf({descendantName:"radio"}),a.radio),labelText:Yh(Uf({descendantName:"labelText"}),a.labelText)};return oh(function(e){var s=e.containerNode,o=e.attribute,c=e.cssClasses,u=e.renderState,l=e.templates;return function(e,t){var n=e.createURL,r=e.instantSearchInstance,i=e.refine,a=e.items;t?u.templateProps=uc({defaultTemplates:Df,templatesConfig:r.templatesConfig,templates:l}):Sl(Jl.createElement(mf,{createURL:n,cssClasses:c,facetValues:a,templateProps:u.templateProps,toggleRefinement:i,attribute:o}),s)}}({containerNode:u,attribute:n,cssClasses:l,renderState:{},templates:o}),function(){return xl(u)})({attribute:n,items:r,transformItems:c})},pagination:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.templates,r=void 0===n?{}:n,i=e.cssClasses,a=void 0===i?{}:i,s=e.totalPages,o=e.padding,c=e.showFirst,u=void 0===c||c,l=e.showLast,h=void 0===l||l,f=e.showPrevious,d=void 0===f||f,p=e.showNext,m=void 0===p||p,v=e.scrollTo,g=void 0===v?"body":v;if(!t)throw new Error(Qf("The `container` option is required."));var y=sc(t),b=!0===g?"body":g,w=!1!==b&&sc(b),R={root:Yh(qf(),a.root),noRefinementRoot:Yh(qf({modifierName:"noRefinement"}),a.noRefinementRoot),list:Yh(qf({descendantName:"list"}),a.list),item:Yh(qf({descendantName:"item"}),a.item),firstPageItem:Yh(qf({descendantName:"item",modifierName:"firstPage"}),a.firstPageItem),lastPageItem:Yh(qf({descendantName:"item",modifierName:"lastPage"}),a.lastPageItem),previousPageItem:Yh(qf({descendantName:"item",modifierName:"previousPage"}),a.previousPageItem),nextPageItem:Yh(qf({descendantName:"item",modifierName:"nextPage"}),a.nextPageItem),pageItem:Yh(qf({descendantName:"item",modifierName:"page"}),a.pageItem),selectedItem:Yh(qf({descendantName:"item",modifierName:"selected"}),a.selectedItem),disabledItem:Yh(qf({descendantName:"item",modifierName:"disabled"}),a.disabledItem),link:Yh(qf({descendantName:"link"}),a.link)},S=H({},Wf,r);return dh(function(e){var l=e.containerNode,h=e.cssClasses,f=e.templates,d=e.totalPages,p=e.showFirst,m=e.showLast,v=e.showPrevious,g=e.showNext,y=e.scrollToNode;return function(e,t){var n=e.createURL,r=e.currentRefinement,i=e.nbHits,a=e.nbPages,s=e.pages,o=e.isFirstPage,c=e.isLastPage,u=e.refine;if(!t){Sl(Jl.createElement(Vf,{createURL:n,cssClasses:h,currentPage:r,templates:f,nbHits:i,nbPages:a,pages:s,totalPages:d,isFirstPage:o,isLastPage:c,setCurrentPage:function(e){u(e),!1!==y&&y.scrollIntoView()},showFirst:p,showLast:m,showPrevious:v,showNext:g}),l)}}}({containerNode:y,cssClasses:R,templates:S,showFirst:u,showLast:h,showPrevious:d,showNext:m,padding:o,scrollToNode:w}),function(){return xl(y)})({totalPages:s,padding:o})},rangeInput:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attribute,r=e.min,i=e.max,a=e.precision,s=void 0===a?0:a,o=e.cssClasses,c=void 0===o?{}:o,u=e.templates,l=void 0===u?{}:u;if(!t)throw new Error(Kf("The `container` option is required."));var h=sc(t),f=H({separatorText:"to",submitText:"Go"},l);return mh(function(e){var p=e.containerNode,m=e.cssClasses,v=e.renderState,g=e.templates;return function(e,t){var n=e.refine,r=e.range,i=e.start,a=e.widgetParams,s=e.instantSearchInstance;if(t)v.templateProps=uc({templatesConfig:s.templatesConfig,templates:g});else{var o=r.min,c=r.max,u=U(i,2),l=u[0],h=u[1],f=1/Math.pow(10,a.precision),d={min:l!==-1/0&&l!==o?l:void 0,max:h!==1/0&&h!==c?h:void 0};Sl(Jl.createElement(zf,{min:o,max:c,step:f,values:d,cssClasses:m,refine:n,templateProps:v.templateProps}),p)}}}({containerNode:h,cssClasses:{root:Yh(Yf(),c.root),noRefinement:Yh(Yf({modifierName:"noRefinement"})),form:Yh(Yf({descendantName:"form"}),c.form),label:Yh(Yf({descendantName:"label"}),c.label),input:Yh(Yf({descendantName:"input"}),c.input),inputMin:Yh(Yf({descendantName:"input",modifierName:"min"}),c.inputMin),inputMax:Yh(Yf({descendantName:"input",modifierName:"max"}),c.inputMax),separator:Yh(Yf({descendantName:"separator"}),c.separator),submit:Yh(Yf({descendantName:"submit"}),c.submit)},templates:f,renderState:{}}))({attribute:n,min:r,max:i,precision:s})},searchBox:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.placeholder,r=void 0===n?"":n,i=e.cssClasses,a=void 0===i?{}:i,s=e.autofocus,o=void 0!==s&&s,c=e.searchAsYouType,u=void 0===c||c,l=e.showReset,h=void 0===l||l,f=e.showSubmit,d=void 0===f||f,p=e.showLoadingIndicator,m=void 0===p||p,v=e.queryHook,g=e.templates;if(!t)throw new Error(Gf("The `container` option is required."));var y=sc(t);if("INPUT"===y.tagName)throw new Error("The `container` option doesn't accept `input` elements since InstantSearch.js 3.\n\nYou may want to migrate using `connectSearchBox`: ".concat(Tc({name:"searchbox",connector:!0}),"."));Ic("boolean"==typeof o,"The `autofocus` option only supports boolean values since InstantSearch.js 3.");var b={root:Yh(Jf(),a.root),form:Yh(Jf({descendantName:"form"}),a.form),input:Yh(Jf({descendantName:"input"}),a.input),submit:Yh(Jf({descendantName:"submit"}),a.submit),submitIcon:Yh(Jf({descendantName:"submitIcon"}),a.submitIcon),reset:Yh(Jf({descendantName:"reset"}),a.reset),resetIcon:Yh(Jf({descendantName:"resetIcon"}),a.resetIcon),loadingIndicator:Yh(Jf({descendantName:"loadingIndicator"}),a.loadingIndicator),loadingIcon:Yh(Jf({descendantName:"loadingIcon"}),a.loadingIcon)};return bh(function(e){var i=e.containerNode,a=e.cssClasses,s=e.placeholder,o=e.templates,c=e.autofocus,u=e.searchAsYouType,l=e.showReset,h=e.showSubmit,f=e.showLoadingIndicator;return function(e){var t=e.refine,n=e.query,r=e.isSearchStalled;Sl(Jl.createElement(pf,{query:n,placeholder:s,autofocus:c,refine:t,searchAsYouType:u,templates:o,showSubmit:h,showReset:l,showLoadingIndicator:f,isSearchStalled:r,cssClasses:a}),i)}}({containerNode:y,cssClasses:b,placeholder:r,templates:H({},$f,g),autofocus:o,searchAsYouType:u,showReset:h,showSubmit:d,showLoadingIndicator:m}),function(){return xl(y)})({queryHook:v})},rangeSlider:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attribute,r=e.min,i=e.max,a=e.cssClasses,s=void 0===a?{}:a,o=e.step,c=e.pips,u=void 0===c||c,l=e.precision,h=void 0===l?0:l,f=e.tooltips,d=void 0===f||f;if(!t)throw new Error(rd("The `container` option is required."));var p=sc(t),m={root:Yh(id(),s.root),disabledRoot:Yh(id({modifierName:"disabled"}),s.disabledRoot)};return mh(function(e){var d=e.containerNode,p=e.cssClasses,m=e.pips,v=e.step,g=e.tooltips;return function(e,t){var n=e.refine,r=e.range,i=e.start;if(!t){var a=r.min,s=r.max,o=U(i,2),c=o[0],u=o[1],l=c===-1/0?a:c,h=u===1/0?s:u,f=[s<l?s:l,h<a?a:h];Sl(Jl.createElement(nd,{cssClasses:p,refine:n,min:a,max:s,values:f,tooltips:g,step:v,pips:m}),d)}}}({containerNode:p,step:o,pips:u,tooltips:d,renderState:{},cssClasses:m}),function(){return xl(p)})({attribute:n,min:r,max:i,precision:h})},sortBy:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.items,r=e.cssClasses,i=void 0===r?{}:r,a=e.transformItems;if(!t)throw new Error(ad("The `container` option is required."));var s=sc(t),o={root:Yh(sd(),i.root),select:Yh(sd({descendantName:"select"}),i.select),option:Yh(sd({descendantName:"option"}),i.option)};return Rh(function(e){var a=e.containerNode,s=e.cssClasses;return function(e,t){var n=e.currentRefinement,r=e.options,i=e.refine;t||Sl(Jl.createElement("div",{className:s.root},Jl.createElement(_f,{cssClasses:s,currentValue:n,options:r,setValue:i})),a)}}({containerNode:s,cssClasses:o}),function(){return xl(s)})({items:n,transformItems:a})},ratingMenu:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attribute,r=e.max,i=void 0===r?5:r,a=e.cssClasses,s=void 0===a?{}:a,o=e.templates,c=void 0===o?od:o;if(!t)throw new Error(cd("The `container` option is required."));var u=sc(t),l={root:Yh(ud(),s.root),noRefinementRoot:Yh(ud({modifierName:"noRefinement"}),s.noRefinementRoot),list:Yh(ud({descendantName:"list"}),s.list),item:Yh(ud({descendantName:"item"}),s.item),selectedItem:Yh(ud({descendantName:"item",modifierName:"selected"}),s.selectedItem),disabledItem:Yh(ud({descendantName:"item",modifierName:"disabled"}),s.disabledItem),link:Yh(ud({descendantName:"link"}),s.link),starIcon:Yh(ud({descendantName:"starIcon"}),s.starIcon),fullStarIcon:Yh(ud({descendantName:"starIcon",modifierName:"full"}),s.fullStarIcon),emptyStarIcon:Yh(ud({descendantName:"starIcon",modifierName:"empty"}),s.emptyStarIcon),label:Yh(ud({descendantName:"label"}),s.label),count:Yh(ud({descendantName:"count"}),s.count)};return Ph(function(e){var s=e.containerNode,o=e.cssClasses,c=e.templates,u=e.renderState;return function(e,t){var n=e.refine,r=e.items,i=e.createURL,a=e.instantSearchInstance;t?u.templateProps=uc({defaultTemplates:od,templatesConfig:a.templatesConfig,templates:c}):Sl(Jl.createElement(mf,{createURL:i,cssClasses:o,facetValues:r,templateProps:u.templateProps,toggleRefinement:n},Jl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:"display:none;"},Jl.createElement("symbol",{id:ud({descendantName:"starSymbol"}),viewBox:"0 0 24 24"},ld),Jl.createElement("symbol",{id:ud({descendantName:"starEmptySymbol"}),viewBox:"0 0 24 24"},hd))),s)}}({containerNode:u,cssClasses:l,renderState:{},templates:c}),function(){return xl(u)})({attribute:n,max:i})},stats:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.cssClasses,r=void 0===n?{}:n,i=e.templates,a=void 0===i?dd:i;if(!t)throw new Error(pd("The `container` option is required."));var s=sc(t),o={root:Yh(md(),r.root),text:Yh(md({descendantName:"text"}),r.text)};return Nh(function(e){var u=e.containerNode,l=e.cssClasses,h=e.renderState,f=e.templates;return function(e,t){var n=e.hitsPerPage,r=e.nbHits,i=e.nbPages,a=e.page,s=e.processingTimeMS,o=e.query,c=e.instantSearchInstance;t?h.templateProps=uc({defaultTemplates:dd,templatesConfig:c.templatesConfig,templates:f}):Sl(Jl.createElement(fd,{cssClasses:l,hitsPerPage:n,nbHits:r,nbPages:i,page:a,processingTimeMS:s,query:o,templateProps:h.templateProps}),u)}}({containerNode:s,cssClasses:o,renderState:{},templates:a}),function(){return xl(s)})()},toggleRefinement:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attribute,r=e.cssClasses,i=void 0===r?{}:r,a=e.templates,s=void 0===a?gd:a,o=e.on,c=void 0===o||o,u=e.off;if(!t)throw new Error(yd("The `container` option is required."));var l=sc(t),h={root:Yh(bd(),i.root),label:Yh(bd({descendantName:"label"}),i.label),checkbox:Yh(bd({descendantName:"checkbox"}),i.checkbox),labelText:Yh(bd({descendantName:"labelText"}),i.labelText)};return Ch(function(e){var s=e.containerNode,o=e.cssClasses,c=e.renderState,u=e.templates;return function(e,t){var n=e.value,r=e.createURL,i=e.refine,a=e.instantSearchInstance;t?c.templateProps=uc({defaultTemplates:gd,templatesConfig:a.templatesConfig,templates:u}):Sl(Jl.createElement(vd,{createURL:r,cssClasses:o,currentRefinement:n,templateProps:c.templateProps,refine:function(e){return i({isRefined:e})}}),s)}}({containerNode:l,cssClasses:h,renderState:{},templates:s}),function(){return xl(l)})({attribute:n,on:c,off:u})},analytics:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=e.pushFunction,t=e.delay,r=void 0===t?3e3:t,n=e.triggerOnUIInteraction,i=void 0!==n&&n,s=e.pushInitialSearch,o=void 0===s||s,c=e.pushPagination,u=void 0!==c&&c;if(!a)throw new Error(wd("The `pushFunction` option is required."));function l(e){if(null!==e){var t=[],n=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n].join("+");t.push("".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(n),"_").concat(encodeURIComponent(r)))}return t.join("&")}(H({},e.state.disjunctiveFacetsRefinements,e.state.facetsRefinements,e.state.hierarchicalFacetsRefinements)),r=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(r.hasOwnProperty(">=")&&r.hasOwnProperty("<="))r[">="][0]===r["<="][0]?t.push("".concat(n,"=").concat(n,"_").concat(r[">="])):t.push("".concat(n,"=").concat(n,"_").concat(r[">="],"to").concat(r["<="]));else if(r.hasOwnProperty(">="))t.push("".concat(n,"=").concat(n,"_from").concat(r[">="]));else if(r.hasOwnProperty("<="))t.push("".concat(n,"=").concat(n,"_to").concat(r["<="]));else if(r.hasOwnProperty("=")){var i=[];for(var a in r["="])r["="].hasOwnProperty(a)&&i.push(r["="][a]);t.push("".concat(n,"=").concat(n,"_").concat(i.join("-")))}}return t.join("&")}(e.state.numericRefinements);""!==n&&t.push(n),""!==r&&t.push(r),t=t.join("&");var i="Query: ".concat(e.state.query,", ").concat(t);!0===u&&(i+=", Page: ".concat(e.state.page)),d!==i&&(a(t,e.state,e.results),d=i)}}var h,f=null,d="",p=!0;return!0===o&&(p=!1),{init:function(){!0===i&&(document.addEventListener("click",function(){l(f)}),window.addEventListener("beforeunload",function(){l(f)}))},render:function(e){var t=e.results,n=e.state;!0!==p?(f={results:t,state:n},h&&clearTimeout(h),h=setTimeout(function(){return l(f)},r)):p=!1}}},breadcrumb:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.attributes,r=e.separator,i=e.rootPath,a=void 0===i?null:i,s=e.transformItems,o=e.templates,c=void 0===o?Sd:o,u=e.cssClasses,l=void 0===u?{}:u;if(!t)throw new Error(Pd("The `container` option is required."));var h=sc(t),f={root:Yh(_d(),l.root),noRefinementRoot:Yh(_d({modifierName:"noRefinement"}),l.noRefinementRoot),list:Yh(_d({descendantName:"list"}),l.list),item:Yh(_d({descendantName:"item"}),l.item),selectedItem:Yh(_d({descendantName:"item",modifierName:"selected"}),l.selectedItem),separator:Yh(_d({descendantName:"separator"}),l.separator),link:Yh(_d({descendantName:"link"}),l.link)};return Eh(function(e){var o=e.containerNode,c=e.cssClasses,u=e.renderState,l=e.templates;return function(e,t){var n=e.canRefine,r=e.createURL,i=e.instantSearchInstance,a=e.items,s=e.refine;t?u.templateProps=uc({defaultTemplates:Sd,templatesConfig:i.templatesConfig,templates:l}):Sl(Jl.createElement(Rd,{canRefine:n,cssClasses:c,createURL:r,items:a,refine:s,templateProps:u.templateProps}),o)}}({containerNode:h,cssClasses:f,renderState:{},templates:c}),function(){return xl(h)})({attributes:n,separator:r,rootPath:a,transformItems:s})},menuSelect:function(e){var t=e.container,n=e.attribute,r=e.sortBy,i=void 0===r?["name:asc"]:r,a=e.limit,s=void 0===a?10:a,o=e.cssClasses,c=void 0===o?{}:o,u=e.templates,l=void 0===u?xd:u,h=e.transformItems;if(!t)throw new Error(Cd("The `container` option is required."));return ah(function(e){var s=e.containerNode,o=e.cssClasses,c=e.renderState,u=e.templates;return function(e,t){var n=e.refine,r=e.items,i=e.canRefine,a=e.instantSearchInstance;t?c.templateProps=uc({defaultTemplates:xd,templatesConfig:a.templatesConfig,templates:u}):Sl(Jl.createElement(Nd,{cssClasses:o,items:r,refine:n,templateProps:c.templateProps,canRefine:i}),s)}}({containerNode:sc(t),cssClasses:{root:Yh(Fd(),c.root),noRefinementRoot:Yh(Fd({modifierName:"noRefinement"}),c.noRefinementRoot),select:Yh(Fd({descendantName:"select"}),c.select),option:Yh(Fd({descendantName:"option"}),c.option)},renderState:{},templates:l}))({attribute:n,limit:s,sortBy:i,transformItems:h})},poweredBy:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.cssClasses,r=void 0===n?{}:n,i=e.theme,a=void 0===i?"light":i;if(!t)throw new Error(Id("The `container` option is required."));var s=sc(t),o={root:Yh(Md(),Md({modifierName:"dark"===a?"dark":"light"}),r.root),link:Yh(Md({descendantName:"link"}),r.link),logo:Yh(Md({descendantName:"logo"}),r.logo)};return Ih(function(e){var a=e.containerNode,s=e.cssClasses;return function(e,t){var n=e.url,r=e.widgetParams;if(t){var i=r.theme;Sl(Jl.createElement(Ed,{cssClasses:s,url:n,theme:i}),a)}else;}}({containerNode:s,cssClasses:o}),function(){return xl(s)})({theme:a})},panel:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.templates,r=void 0===t?{}:t,n=e.hidden,o=void 0===n?function(){return!1}:n,i=e.collapsed,a=e.cssClasses,s=void 0===a?{}:a;Ic("function"==typeof o,'The `hidden` option in the "panel" widget expects a function returning a boolean (received "'.concat(f(o),'" type).')),Ic(void 0===i||"function"==typeof i,'The `collapsed` option in the "panel" widget expects a function returning a boolean (received "'.concat(f(i),'" type).'));var c=document.createElement("div"),u=Boolean(i),l="function"==typeof i?i:function(){return!1},h={root:Yh(Od(),s.root),noRefinementRoot:Yh(Od({modifierName:"noRefinement"}),s.noRefinementRoot),collapsibleRoot:Yh(Od({modifierName:"collapsible"}),s.collapsibleRoot),collapsedRoot:Yh(Od({modifierName:"collapsed"}),s.collapsedRoot),collapseButton:Yh(Od({descendantName:"collapseButton"}),s.collapseButton),collapseIcon:Yh(Od({descendantName:"collapseIcon"}),s.collapseIcon),body:Yh(Od({descendantName:"body"}),s.body),header:Yh(Od({descendantName:"header"}),s.header),footer:Yh(Od({descendantName:"footer"}),s.footer)};return function(n){return function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=e.container;if(!i)throw new Error(kd("The `container` option is required in the widget within the panel."));var t=uc({defaultTemplates:{header:"",footer:"",collapseButtonText:function(e){var t=e.collapsed;return'<svg\n          class="'.concat(h.collapseIcon,'"\n          width="1em"\n          height="1em"\n          viewBox="0 0 500 500"\n        >\n        <path d="').concat(t?"M100 250l300-150v300z":"M250 400l150-300H100z",'" fill="currentColor" />\n        </svg>')}},templates:r}),a=function(e){var a=e.containerNode,s=e.bodyContainerNode,o=e.cssClasses,c=e.templateProps;return function(e){var t=e.options,n=e.hidden,r=e.collapsible,i=e.collapsed;Sl(Jl.createElement(Ld,{cssClasses:o,hidden:n,collapsible:r,collapsed:i,templateProps:c,data:t,bodyElement:s}),a)}}({containerNode:sc(i),bodyContainerNode:c,cssClasses:h,templateProps:t});a({options:{},hidden:!0,collapsible:u,collapsed:!1});var s=n(H({},e,{container:c}));return H({},s,{dispose:function(){if(xl(sc(i)),"function"==typeof s.dispose){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=s.dispose).call.apply(e,[this].concat(n))}},render:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0];a({options:i,hidden:Boolean(o(i)),collapsible:u,collapsed:Boolean(l(i))}),"function"==typeof s.render&&(r=s.render).call.apply(r,[this].concat(t))}})}}},voiceSearch:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.cssClasses,r=void 0===n?{}:n,i=e.templates,a=e.searchAsYouSpeak;if(!t)throw new Error(Qd("The `container` option is required."));var s=sc(t),o={root:Yh(qd(),r.root),button:Yh(qd({descendantName:"button"}),r.button),status:Yh(qd({descendantName:"status"}),r.status)};return Wh(Dd,function(){return xl(s)})({container:s,cssClasses:o,templates:H({},Vd,i),searchAsYouSpeak:a})},queryRuleCustomData:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.container,n=e.cssClasses,r=void 0===n?{}:n,i=e.templates,a=void 0===i?{}:i,s=e.transformItems,o=void 0===s?function(e){return e}:s;if(!t)throw new Error(Wd("The `container` option is required."));var c={root:Yh(zd(),r.root)},u=H({},{default:function(e){var t=e.items;return JSON.stringify(t,null,2)}},a),l=sc(t);return Hh(Ud,function(){xl(l)})({container:l,cssClasses:c,templates:u,transformItems:o})},queryRuleContext:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.trackedFilters,n=e.transformRuleContexts;if(!t)throw new Error(Kd("The `trackedFilters` option is required."));return Hh(Sc)({trackedFilters:t,transformRuleContexts:n})}}),$d=Object.freeze({history:Wc}),Gd=Object.freeze({simple:Uc});return Bd.routers=$d,Bd.stateMappings=Gd,Bd.connectors=Kh,Bd.widgets=Yd,Bd.version="3.5.3",Bd.highlight=Xc,Bd.snippet=tu,Bd.insights=function(e,t){return function(e){var t,n=e.method,r=e.payload;if("object"!==f(r))throw new Error("The insights helper expects the payload to be an object.");try{t=btoa(JSON.stringify(r))}catch(e){throw new Error("Could not JSON serialize the payload object.")}return'data-insights-method="'.concat(n,'" data-insights-payload="').concat(t,'"')}({method:e,payload:t})},Bd});

;

function AppInisghtsTrackSearchClick(service, searchId, searchIndex, clickType, documentId, resultPosition, auctionRef, auctionType, biddingType) {
    if (searchId && documentId) {
        window.appInsights.trackEvent('Click',
            {
                SearchServiceName: service, SearchId: searchId, IndexName: searchIndex,
                ClickedDocId: documentId, Rank: 0,
                AuctionRef: auctionRef, AuctionType: auctionType, BiddingType: biddingType,
                ClickType: clickType, ResultPosition: resultPosition,
                gaId: GetCookie("_ga"),
                expId: GetCookie("_gaexp"),
                expInOut: GetCookie("esOptOut")
            });
    }
    // ensure sent now
    window.appInsights.flush();
}

function AppInisghtsTrackSearch(service, searchId, searchIndex, searchType, queryTerms, resultCount, hitsPerPage, nbPages, page, params, indexUsed, abTestId, abVariantId) {
    window.appInsights.trackEvent('Search',
        {
            SearchServiceName: service, SearchId: searchId, IndexName: searchIndex,
            QueryTerms: queryTerms,
            ResultCount: resultCount,
            SearchType: searchType,
            gaId: GetCookie("_ga"),
            expId: GetCookie("_gaexp"),
            expInOut: GetCookie("esOptOut"),
            HitsPerPage: hitsPerPage,
            NbPages: nbPages,
            Page: page,
            Params: params,
            IndexUsed: indexUsed,
            ABTestId: abTestId,
            ABVariantId: abVariantId
        });
     // ensure sent now
    window.appInsights.flush();
}
;"use strict";

// function to remove html coding like &amp; from strings
var decode = function () {
  var parser = $(document.createElement('div')); // store in closure for reuse

  return function (encodedStr) {
    return parser.html(encodedStr).text();
  };
}(); // strip unsafe chars from strings


var escapeHTML = function escapeHTML(unsafe_str) {
  return unsafe_str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/\'/g, '&#39;').replace(/\//g, '&#x2F;');
}; // Do a double decode as the instantsearch snippet encodes the item description
// Then remove any html


var snippetDescStripHTML = function snippetDescStripHTML(htmlStr, stripNewlines) {
  if (typeof htmlStr === 'undefined') return '';
  var str = decode(decode(htmlStr)); // Strip any html

  var regex = /<.*?>/g;

  if (str.match(regex)) {
    str = str.replace(regex, '');
  }

  if (stripNewlines) {
    str = str.replace(/\s\s+/gm, ' ');
  }

  return str;
}; // Remove any <> chars from the search query string


var stripHtmlTagStartEnd = function stripHtmlTagStartEnd(htmlStr) {
  if (typeof htmlStr === 'undefined') return '';
  var str = htmlStr;
  var regex = /[<>]/g;

  if (str.match(regex)) {
    str = str.replace(regex, '');
  }

  return str;
};

var sepToIndex = function sepToIndex(specialStr) {
  return specialStr.replace(/&/g, '%26').replace(/#/g, '%23').replace(/\s/g, '%20');
}; //
// Exclude lots listed in private platforms


var setExclusionFacets = function setExclusionFacets(helper) {
  if (typeof helper === 'undefined') return;

  if (typeof saytVM.config.facetExcludes !== 'undefined') {
    for (var i = 0; i < saytVM.config.facetExcludes.length; i++) {
      var state = helper.getState();
      var facetName = saytVM.config.facetExcludes[i]; // Add facet to list if it doesn't already exist

      if (!state.facets.includes(facetName)) {
        state.facets.push(facetName);
      } // Update helper state before adding exclusion


      helper.setState(state); // Add value in facet to exclude

      switch (facetName) {
        case 'privatePlatformCodes':
          helper.addFacetExclusion(facetName, saytVM.config.platform);
          break;
      }
    }
  }

  return helper;
}; //
// Templates for recent and suggested searches panels


var recentSearches = "<div class=\"search-auto-complete recent-search search-panel\">\n                <div class=\"container\">\n                    <h2>".concat(saytVM.searchbox.recentLabel, "</h2>\n                    <ul class=\"recent-search-select\"></ul>\n                    <div class=\"clear-all\">").concat(saytVM.searchbox.clearAllLabel, "</div>\n                </div>\n            </div>"); //

var suggestedSearches = "<div class=\"search-auto-complete suggested-search search-panel\">\n                <div class=\"container\">\n                    <h2>".concat(saytVM.searchbox.suggestedLabel, "</h2>\n                    <ul class=\"suggested-search-select\"></ul>\n                </div>\n            </div>"); //

var storeIndexUsed = function storeIndexUsed(indexUsed, abTestId, abVariantId) {
  // Add data to dl
  window.dataLayer = window.dataLayer || [];
  window.dataLayer[0].indexUsed = typeof indexUsed !== 'undefined' ? indexUsed : '';
  window.dataLayer[0].abTestId = typeof abTestId !== 'undefined' ? abTestId : 0;
  window.dataLayer[0].abVariantId = typeof abVariantId !== 'undefined' ? abVariantId : 0;
};

var truncateAtWord = function truncateAtWord(str, maxLen) {
  str = str.trim();
  if (str.length <= maxLen) return str;
  return str.substr(0, str.lastIndexOf(' ', maxLen)) + '...';
};;"use strict";

var UNKNOWN_SEARCH_POSITION = 9999;
var CLICK_ON_SEARCH_RESULT_EVENT = "click_on_search_page_result";
var CLICK_RESULT = "clickedObjectIDsAfterSearch";
var ALGOLIA_INSIGHTS_SRC = "https://cdn.jsdelivr.net/npm/search-insights@1.1.1";
var ALGOLIA_INSIGHTS_INIT = "init";
var ALGOLIA_APP_INSIGHTS_SERVICE_NAME = "algolia";

var addClickAnalytics = function addClickAnalytics() {
  // Anthony says this is OK!
  // we might want to serve this ourselves
  // snippet from Algolia instant search doc
  !function (e, a, t, n, s, i, c) {
    e.AlgoliaAnalyticsObject = s, e.aa = e.aa || function () {
      (e.aa.queue = e.aa.queue || []).push(arguments);
    }, i = a.createElement(t), c = a.getElementsByTagName(t)[0], i.async = 1, i.src = ALGOLIA_INSIGHTS_SRC, c.parentNode.insertBefore(i, c);
  }(window, document, "script", 0, "aa"); //
  // Initialize library

  aa(ALGOLIA_INSIGHTS_INIT, {
    appId: saytVM.config.searchClientId,
    apiKey: saytVM.config.searchClientKey
  });
}; //


var hitClickEvent = function hitClickEvent(evnt) {
  var target = evnt.target;

  while (target.tagName !== "ARTICLE") {
    if (!target.parentNode) return;
    target = target.parentNode;
  }

  ; //

  var dataset = target.dataset;

  if (dataset && dataset.lotId) {
    var position = dataset.position ? parseInt(dataset.position) + 1 : UNKNOWN_SEARCH_POSITION;
    var pageStart = dataset.pageStart ? parseInt(dataset.pageStart) : 0;
    position += pageStart; // there are other anchors that can be clicked or filtered
    // this is click on lot search result, get all info needed 
    // queue to send to algolia

    var evnt = {
      userToken: userToken,
      eventName: CLICK_ON_SEARCH_RESULT_EVENT,
      index: dataset.index,
      queryID: dataset.queryid,
      objectIDs: [dataset.lotId],
      positions: [position]
    }; // send click through data to app insights

    AppInisghtsTrackSearchClick(ALGOLIA_APP_INSIGHTS_SERVICE_NAME, dataset.queryid, dataset.index, "lot", dataset.lotId, position, dataset.auctionRef, dataset.auctionType, dataset.biddingType);
    aa(CLICK_RESULT, evnt); // store if there is later conversion event

    sessionStorage.setItem('algoliaClick', JSON.stringify({
      clientId: saytVM.config.searchClientId,
      key: saytVM.config.searchClientKey,
      auctionRef: dataset.auctionRef,
      evnt: evnt
    }));
  }

  ;
};;"use strict";

// Image
var showImageTemplate = function showImageTemplate(item) {
  var overlay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  if (typeof item === 'undefined') return "";
  return "\n        <div id=\"a".concat(item.objectID, "\" class=\"thumb update-history-url-after-back\" data-lot-id=\"").concat(item.objectID, "\" data-auction-ref=\"").concat(item.auctionRef, "\" data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\">\n            <a id=\"").concat(overlay ? "overlayLotImg-".concat(item.objectID) : '', "\" href=\"").concat(lotDetailsUrl(item), "\" ").concat(overlay && query != '' ? "onClick=\"manualAddRecentAndSubmit('".concat(query, "')\"") : "", " class=\"click-track\" data-click-type=\"image\">").concat(lotImageTemplate(item), "</a>\n        </div>\n    ");
}; //


var lotImageTemplate = function lotImageTemplate(item) {
  var lotSearchImageSize = "".concat(saytVM.hitsrendering.imageThumbnailSize);
  var altText = "".concat(saytVM.hitsrendering.lotLabel, " ").concat(item.lotNumber, " ").concat(saytVM.hitsrendering.imageLabel);

  if (typeof item.imageUrl === 'undefined' || item.imageUrl === '') {
    return "".concat(noImgHolderTemplate(item.objectID, altText));
  } else {
    return "<img id=\"i".concat(item.objectID, "\" alt=\"").concat(altText, "\" src=\"").concat(item.imageUrl).concat(lotSearchImageSize, "\" onerror=\"ImageNotFound('i").concat(item.objectID, "', 'a").concat(item.objectID, "')\">").concat(noImgHolderTemplate());
  }
}; //


var noImgHolderTemplate = function noImgHolderTemplate(itemId, altText) {
  return "<span class=\"no-image\"><span>".concat(saytVM.hitsrendering.noImageLabel, "</span>").concat(noImgTemplate(itemId, altText), "</span>");
}; //


var noImgTemplate = function noImgTemplate(itemId, altText) {
  var blankImgSrc = '/content/sr/images/blank-image.png';

  if (typeof itemId !== 'undefined') {
    return "<img id=\"i".concat(itemId, "\" alt=\"").concat(altText, "\" src=\"").concat(blankImgSrc, "\" />");
  } else {
    return "<img src=\"".concat(blankImgSrc, "\" />");
  }
}; //
// Urls


var lotDetailsUrl = function lotDetailsUrl(item) {
  if (typeof item === 'undefined') return "";
  return getLinkUrls(saytVM.hitsrendering.lotDetailsUrl, item.auctioneerRef, item.objectID, item.auctionRef);
}; //


var auctioneerUrl = function auctioneerUrl(item) {
  if (typeof item === 'undefined') return "";
  return getLinkUrls(saytVM.hitsrendering.auctioneerUrl, item.auctioneerRef);
}; //


var getLinkUrls = function getLinkUrls(urlToChange, clientUrl, lotId, auctionRef) {
  if (typeof urlToChange === 'undefined' || urlToChange === '') return "";
  var url = urlToChange;

  if (typeof clientUrl !== 'undefined' || clientUrl !== '') {
    if (url.indexOf('$clienturl$') > 0) {
      url = url.replace('$clienturl$', clientUrl);
    }
  }

  if (typeof lotId !== 'undefined' || lotId !== '') {
    if (url.indexOf('$lotid$') > 0) {
      url = url.replace('$lotid$', lotId);
    }
  }

  if (typeof auctionRef !== 'undefined' || auctionRef !== '') {
    if (url.indexOf('$auctionreference$') > 0) {
      url = url.replace('$auctionreference$', auctionRef);
    }
  }

  return url;
}; //


var auctioneerLink = function auctioneerLink(item) {
  if (typeof item === 'undefined') return "";

  if (typeof saytVM.config.platform === 'undefined' && saytVM.config.platform == 'WL') {
    return "";
  } else {
    return "<div class=\"byline client-url\"><a href=\"".concat(auctioneerUrl(item), "\" class=\"a-wrapped click-track\" data-click-type=\"client\">").concat(item.auctioneerName, "</a></div>");
  }
}; //


var moreDetailsLink = function moreDetailsLink(item) {
  if (typeof item === 'undefined') return "";
  return "<a href=\"".concat(lotDetailsUrl(item), "\" class=\"update-history-url-after-back\" data-lot-id=\"").concat(item.objectID, "\" data-auction-ref=\"").concat(item.auctionRef, "\" data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\" >").concat(saytVM.hitsrendering.moreDetailsLabel, "</a>");
}; //
// Featured lot flag


var featuredLotTemplate = function featuredLotTemplate(item) {
  if (typeof item === 'undefined') return "";
  var saytFeaturedLot = saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? saytVM.hitsrendering.featuredLabel : saytVM.hitsrendering.featuredLotLabel;

  if (item.isFeaturedLot) {
    return "<div class=\"featured-lot-text\" id=\"featuredLabel-".concat(item.objectID, "\">\n        ").concat(saytFeaturedLot, "\n        </div>");
  } else {
    return "";
  }
}; // Main
// Lot header


var renderLotHeader = function renderLotHeader(item) {
  if (typeof item === 'undefined') return "";
  return "\n        <div class=\"lot-header\">\n            <div class=\"number\"><span>".concat(saytVM.hitsrendering.lotLabel, "</span> ").concat(item.lotNumber, "</div>\n            <h3><a href=\"").concat(lotDetailsUrl(item), "\" class=\"a-wrapped update-history-url-after-back click-track\" data-click-type=\"title\" data-lot-id=\"").concat(item.lotNumber, "\">").concat(item.title, "</a></h3>\n        </div>\n        <div class=\"lot-header-grid-only\">\n            <a name=\"lot-title\" href=\"").concat(lotDetailsUrl(item), "\" class=\"update-history-url-after-back click-track lot-link\" data-click-type=\"title\" data-lot-id=\"").concat(item.objectID, "\">\n                <span class=\"lot-number\">").concat(item.lotNumber, "</span><span class=\"lot-title\">").concat(item.title, "</span>\n            </a>\n        </div>\n    ");
}; // Lot description


var formatLotDescription = function formatLotDescription(item, makeSubstitute) {
  if (typeof item === 'undefined') return "";
  var substituteTitleWithDescription = typeof makeSubstitute === 'undefined' ? false : makeSubstitute;
  return substituteTitleWithDescription ? "" : snippetDescStripHTML(instantsearch.snippet({
    attribute: 'description',
    hit: item,
    highlightedTagName: 'span'
  }));
};

var renderLotDescription = function renderLotDescription(item) {
  if (typeof item === 'undefined') return "";
  if (item.description.length > 0) return "\n            <div class=\"description\">\n                <p>".concat(item.description, "</p>").concat(moreDetailsLink(item), "\n            </div>\n        ");
}; // Auction type


var renderAuctionType = function renderAuctionType(item) {
  if (typeof item === 'undefined') return "";
  return "\n        <label class=\"link-icon icon-timed auction-type-icon\"><i class=\"icon ".concat(getAuctionTypeClass(item.auctionType), "\"></i><span>").concat(item.auctionType, "</span></label>\n    ");
};

var getAuctionTypeClass = function getAuctionTypeClass(auctionType) {
  if (typeof auctionType === 'undefined') return "";

  switch (auctionType.toLowerCase()) {
    case 'timed':
      return 'clock';

    case 'tender':
      return 'envelope';

    default:
      return 'wifi';
  }
};;"use strict";

var COMMAS_REGEX = /\B(?=(\d{3})+(?!\d))/g;
var AUCTION_TYPE_TENDER = 'tender';
var AUCTION_TYPE_TIMED = 'timed';
var AUCTION_TYPE_LIVE = 'live';

var bidInfo = function bidInfo(item) {
  var hideFromOverlay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  if (typeof item === 'undefined') return "";
  return "\n        ".concat(hideFromOverlay ? "" : LotQuantity(item), "\n        ").concat(LotEstimate(item, hideFromOverlay), "\n    ");
};

var renderLotDates = function renderLotDates(item) {
  if (typeof item === 'undefined') return "";

  switch (item.auctionType.toLowerCase()) {
    case AUCTION_TYPE_TENDER:
      return "<div class=\"date countdown auctionCatalogueData tender\" id=\"countdown-".concat(item.objectID, "\"><span id=\"expiryDateTimeLabel\">").concat(portalScriptResources.TimerHeadingBiddingEnds, "</span> <span id=\"expiryDateTime\"><strong>").concat(LotDate(item), "</strong></span></div>");

    case AUCTION_TYPE_TIMED:
      return "<div class=\"date countdown auctionCatalogueData\"><span id=\"timerHeading-".concat(item.objectID, "\">").concat(portalScriptResources.TimerHeadingBiddingEnds, "</span> <span id=\"timer-").concat(item.objectID, "\"><strong>").concat(LotDate(item), "</strong></span></div>");

    case AUCTION_TYPE_LIVE:
      return "<div class=\"date\"><span>".concat(saytVM.hitsrendering.dateLabel, ":</span> <strong>").concat(LotDate(item), "</strong></div>");

    default:
      return "<div class=\"date\"><span>".concat(saytVM.hitsrendering.dateLabel, ":</span> <strong>").concat(LotDate(item), "</strong></div>");
  }
};

var renderLotDatesNewUiSkin = function renderLotDatesNewUiSkin(item) {
  if (typeof item === 'undefined') return "";
  var lowEstimate = item.hasLowEstimate ? formatEstimate(item.lowEstimate) : null;
  var highEstimate = item.hasHighEstimate ? formatEstimate(item.highEstimate) : null;
  var showEstimatesHtml = "<span class=\"question-icon\">".concat(additionalFeesTemplate(item), "</span>");

  if (highEstimate || lowEstimate) {
    showEstimatesHtml = '';
  }

  switch (item.auctionType.toLowerCase()) {
    case AUCTION_TYPE_TENDER:
      return "<div class=\"date countdown auctionCatalogueData tender\" id=\"countdown-".concat(item.objectID, "\"><span class=\"lot-details-subtitle\" id=\"expiryDateTimeLabel\">").concat(saytVM.hitsrendering.endsLabel, "</span> <span class=\"lot-details-subtitle-text\" id=\"expiryDateTime\"><strong>").concat(LotDate(item), "</strong></span></div>");

    case AUCTION_TYPE_TIMED:
      return "<div class=\"date countdown auctionCatalogueData\"><span class=\"lot-details-subtitle\"  id=\"timerHeading-".concat(item.objectID, "\">").concat(saytVM.hitsrendering.endsLabel, "</span> <span class=\"lot-details-subtitle-text\" id=\"timer-").concat(item.objectID, "\">").concat(LotDate(item), "</span></div>");

    case AUCTION_TYPE_LIVE:
      return "\n            <div class=\"date\">\n                <span class=\"lot-details-subtitle\" >".concat(saytVM.hitsrendering.dateLabel, "</span> \n                <span class=\"lot-details-subtitle-text\">").concat(LotDate(item), "</span>\n            </div>");

    default:
      return "\n            <div class=\"date\">\n                <span class=\"lot-details-subtitle\" >".concat(saytVM.hitsrendering.dateLabel, ":</span> \n                <span class=\"lot-details-subtitle-text\">").concat(LotDate(item), "</span>\n            </div>");
  }
};

var LotDate = function LotDate(item) {
  // we need to convert to users locale
  // we want to check if the day is the same not including the time
  // item.auctionStartDateTimeUtc is already a number not a string
  var startDate = getUTCWithOffset(item.auctionStartDateTimeUtc);
  var endDate = item.auctionEndDateTimeUtc ? getUTCWithOffset(item.auctionEndDateTimeUtc) : null;

  if (item.auctionType.toLowerCase() == 'timed' || item.auctionType.toLowerCase() == 'tender') {
    return endDate.format('DD MMM');
  } else {
    return startDate.format('DD MMM') + (!endDate || startDate.isSame(endDate, 'day') ? "" : " - " + endDate.format('DD MMM'));
  }
};

var getUTCWithOffset = function getUTCWithOffset(utcNum) {
  return moment.utc(utcNum).clone().add(_getTMZOffset(), 'minute');
};

var _getTMZOffset = function getTMZOffset() {
  // lazy load 
  var _TMZOffset = new Date().getTimezoneOffset();

  _getTMZOffset = function getTMZOffset() {
    return _TMZOffset;
  }; // replace with improved function


  return _TMZOffset; // first time through
};

var LotEstimate = function LotEstimate(item, hideFromOverlay) {
  // conditionally render, so include markup
  // 
  var lowEstimate = item.hasLowEstimate ? formatEstimate(item.lowEstimate) : null;
  var highEstimate = item.hasHighEstimate ? formatEstimate(item.highEstimate) : null; //

  if (!highEstimate && !lowEstimate) return ""; // no estimates don't show anything
  //

  var estimates = lowEstimate ? lowEstimate + (highEstimate ? ' - ' + highEstimate : '') : highEstimate;

  if (saytVM.featureSwitch.isNewUiSkinSearchResultEnabled) {
    return "<li class=\"estimate\">\n                <span class=\"lot-details-subtitle\">".concat(saytVM.hitsrendering.estimateLabel, "</span>\n                <span  class=\"lot-details-subtitle-text\">").concat(estimates, " ").concat(item.currency, "</span>\n                ").concat(hideFromOverlay ? '' : "<label class=\"link-icon additional-fees-toggle color-secondary\" id=\"popup-trigger-".concat(item.objectID, "\" data-url=\"").concat(additionalFeesUrl(item), "\">\n                ").concat(feesPopupTrigger(), "\n                </label>"), "\n                </li>\n                ").concat(hideFromOverlay ? '' : additionalFeesTemplate(item), "   \n            ");
  }

  return "<li class=\"estimate\">\n                <span>".concat(saytVM.hitsrendering.estimateLabel, "</span>\n                <strong>").concat(estimates, " ").concat(item.currency, "</strong>\n            </li> ");
};

var formatEstimate = function formatEstimate(value) {
  // display 2 decimal places if there is decimal value
  // insert commas , do we have any support for this already ???
  var parts = value.toString().split(".");
  var whole = addCommas2Num(parts[0]); // there will only be a parts[1] if there is a decimal 

  var decs = parts[1];
  if (!decs) return whole; // we have decimals 

  if (decs.length < 2) decs += '0';else if (decs.length > 2) decs = decs.substring(2);
  return whole + "." + decs;
};

var LotQuantity = function LotQuantity(item) {
  // conditionally render so include markup
  if (item.bulkQuantity <= 1) return "";

  if (saytVM.featureSwitch.isNewUiSkinSearchResultEnabled) {
    return "\n                <li class=\"quantity\">\n                    <span class=\"lot-details-subtitle\">".concat(saytVM.hitsrendering.quantityLabel, "</span>\n                    <span class=\"bulk-quantity-value lot-details-subtitle-text \" data-piecemeal-enabled=\"\">").concat(addCommas2Num(item.bulkQuantity.toString()), "</span>\n                </li>\n                    ");
  }

  return "\n        <li class=\"quantity\">\n            <span>".concat(saytVM.hitsrendering.quantityLabel, "</span>\n            <strong class=\"bulk-quantity-value\" data-piecemeal-enabled=\"\">").concat(addCommas2Num(item.bulkQuantity.toString()), "</strong>\n        </li>\n    ");
};

var addCommas2Num = function addCommas2Num(numberAsString) {
  return numberAsString.replace(COMMAS_REGEX, ",");
};

var renderLotLocation = function renderLotLocation(item) {
  if (typeof item === 'undefined') return "";

  if (typeof item.lotLocation === 'undefined') {
    return "";
  } else {
    return "<div class=\"lotlocationDiv\"><span class=\"lotlocation\">".concat(saytVM.hitsrendering.locationLabel, ": <strong>").concat(item.lotLocation, "</strong></span></div>");
  }
};;"use strict";

// Search query parsing
var searchTermParser = function searchTermParser(query, divider) {
  if (typeof query === 'undefined') return; // set space divider (encoded)

  var div = typeof divider === 'undefined' ? '%20' : divider;
  var multipleSpacesRegEx = new RegExp(/ {2,}/g); // remove multiple spaces

  query = query.replace(multipleSpacesRegEx, ' ');
  query = encodeURI(query).toLowerCase(); // replace any unsupported terms in the query

  query = replaceQuerySyntax(query, div); // decode query

  query = decodeURI(query);
  return query;
};

var addOptionalWords = function addOptionalWords(query, divider) {
  if (typeof query === 'undefined') return []; //return empty object

  var div = typeof divider === 'undefined' ? '%20' : divider;
  var term = 'or'; // always uppercase

  var searchFor = div + term + div;
  var encodedQuery = encodeURI(query).toLowerCase(); // if we have any 'or' syntax in the query

  if (encodedQuery.indexOf(searchFor) > -1) {
    var queryArr = encodedQuery.split(div);
    var optWords = [];
    var i = 0;

    while (i < queryArr.length) {
      // find position in array of the 'or' syntax
      var pos = queryArr.indexOf(term, i);

      if (pos > -1) {
        // add the term before the 'or' syntax if it doesn't already exist
        if (optWords.indexOf(queryArr[pos - 1]) == -1) {
          optWords.push(removeSpecialChars(queryArr[pos - 1]));
        } // add the term after the 'or' syntax if it doesn't already exist


        if (optWords.indexOf(queryArr[pos + 1]) == -1) {
          optWords.push(removeSpecialChars(queryArr[pos + 1]));
        } // update the index


        i = pos;
      } // don't forget to increment index


      i++;
    }

    return optWords;
  } // otherwise return empty object


  return [];
};

var removeSpecialChars = function removeSpecialChars(str) {
  if (typeof str === 'undefined') return '';
  var finalStr = str;
  var dict = ['(', ')', '%22'];

  for (var d = 0; d < dict.length; d++) {
    if (finalStr.indexOf(dict[d]) > -1) {
      finalStr = finalStr.replaceAll(dict[d], '');
    }
  }

  return finalStr;
};

var replaceQuerySyntax = function replaceQuerySyntax(encodedQuery, separator) {
  if (typeof encodedQuery === 'undefined') return '*'; // query gets all results

  var dict = [{
    syntax: '|',
    type: 'or',
    divAfter: true
  }, {
    syntax: '%7c',
    type: 'or',
    divAfter: true
  }, {
    syntax: 'not',
    type: '-',
    divAfter: false
  }];
  var div = typeof separator === 'undefined' ? '%20' : separator; // detect if encoded query has spaces (this signifies if any search syntax has been used)

  if (encodedQuery.indexOf(div) > -1) {
    var convQuery = '';
    var queryArr = encodedQuery.split(div);
    var i = 0;

    while (i < queryArr.length) {
      // make sure there is a value to work with
      if (queryArr[i] != '') {
        var queryItem = ''; // loop through dictionary to see if we need to replace anything

        for (var d = 0; d < dict.length; d++) {
          // if our array starts with syntax that is in the dictionary
          if (queryArr[i].indexOf(dict[d].syntax) == 0) {
            // replace syntax
            if (queryArr[i] == dict[d].syntax) {
              queryItem = dict[d].type; // only if it is not the last term

              if (i != queryArr.length - 1) {
                // add a space afterwards if needed
                if (dict[d].divAfter) {
                  queryItem += div;
                } // if a replacement was made, also add next term


                queryItem += queryArr[i + 1]; // don't forget to increment index

                i++;
              }
            } // for cases when the syntax is not followed by a space. E.g. not(query2)
            else {
                var brkSyntax = '(';
                var hasBrk = false; // if the 'not' syntax is followed by an opening bracket

                if (queryArr[i].indexOf(brkSyntax) == dict[d].syntax.length) {
                  hasBrk = true;
                } // then replace the 'not' with a '-'


                if (hasBrk && queryArr[i].length > dict[d].syntax.length) {
                  queryItem = dict[d].type + queryArr[i].substring(dict[d].syntax.length);
                }
              } // exit loop


            break;
          }
        } // build the final query


        var divBefore = i > 0 ? div : ''; // if a replacement has occured, insert the replacement

        if (queryItem != '') {
          convQuery += divBefore + queryItem;
        } // otherwise insert the original item
        else {
            convQuery += divBefore + queryArr[i];
          }
      } // don't forget to increment index


      i++;
    }

    return convQuery;
  } // if there are no spaces, return query unchanged


  return encodedQuery;
};

var addEndDateTimeFilters = function addEndDateTimeFilters() {
  var currentTimeStampUtc = Math.floor(new Date().getTime() / 1000) * 1000;
  var d = new Date();
  var day = d.getUTCDate();
  var month = d.getUTCMonth();
  var year = d.getUTCFullYear();
  var previousDay = new Date(year, month, day).getTime();
  var previousDayTimeStampUtc = Math.floor(previousDay / 1000) * 1000;
  var endDateFilter = 'endDateTimeUtc >= ' + previousDayTimeStampUtc;
  var auctionDateFilter = 'auctionEndDateTimeUtc >= ' + previousDayTimeStampUtc;
  var filter = [];
  filter.push(endDateFilter);
  filter.push(auctionDateFilter);
  return filter;
};;"use strict";

var routingHelper = function () {
  var getNonFuncParams = function getNonFuncParams(location) {
    return location.search.slice(1).split('&').map(function (item) {
      var nameValue = item.split('=');
      var param;

      switch (nameValue[0].toLowerCase()) {
        case 'bbc':
          param = '&' + item;
          break;

        case 'distancelocation':
          param = '&' + item;
          break;

        case 'postcodelocation':
          param = '&' + item;
          break;

        case 'countrylocation':
          param = '&' + item;
          break;
      }

      return param;
    }).join('');
  };

  var normalizeQueryString = function normalizeQueryString(location) {
    return location.search.slice(1).split('&').map(function (item) {
      var nameValue = item.split('=');
      return nameValue[0].toLowerCase().concat('=', nameValue[1]);
    }).join('&');
  };

  var mapRouteSortBy = function mapRouteSortBy(sortBy) {
    var value = ''; // Default to master index that uses relevance as the sort when no sort term is defined

    if (typeof sortBy === 'undefined') {
      value = saytVM.config.indexName;
    } else {
      var sortOptions = JSON.parse(saytVM.searchheader.sortOptions); // If the sort term is one of our sort options, use that index

      for (var i = 0; i < sortOptions.length; i++) {
        if (sortOptions[i].value.toLowerCase().endsWith(sortBy.toLowerCase())) {
          value = sortOptions[i].value;
          break;
        }
      } // Otherwise use a particular index


      if (value.length == 0) {
        switch (sortBy.toLowerCase()) {
          case 'startdate':
            value = "".concat(saytVM.config.indexName, "_auctionDate");
            break;

          default:
            // Always resort to the master index 
            value = saytVM.config.indexName;
            break;
        }
      }
    }

    return value;
  };

  var mapUiSortBy = function mapUiSortBy(sortTerm) {
    var value = '';

    if (typeof sortTerm === 'undefined' || sortTerm.toLowerCase() == saytVM.config.indexName) {
      value = 'Relevance';
    } else {
      var sortOptions = JSON.parse(saytVM.searchheader.sortOptions);

      for (var i = 0; i < sortOptions.length; i++) {
        if (sortTerm == sortOptions[i].value) {
          value = sortOptions[i].value.substring(sortOptions[i].value.lastIndexOf('_') + 1);
          break;
        }
      }
    }

    return value;
  };

  return {
    getNonFuncParams: getNonFuncParams,
    normalizeQueryString: normalizeQueryString,
    mapRouteSortBy: mapRouteSortBy,
    mapUiSortBy: mapUiSortBy
  };
}();;"use strict";

var searchRouting = function searchRouting(routingHelper) {
  var searchUrl = 'search-results';
  var searchEndpoints = ['search-results', 'search-filter'];
  var router = instantsearch.routers.history({
    // Update title in browser window
    windowTitle: function windowTitle(_ref) {
      var searchterm = _ref.searchterm;
      var metaTitle = ''; // if search term is empty insert asterix to indicate all results are being returned

      var query = searchterm ? escapeHTML(searchterm) : '*'; // as the search term is inputted, update the title
      // check we are on the search pages

      var isSearchResultsPage = false;

      for (var i = 0; i < searchEndpoints.length; i++) {
        if (document.title.indexOf(searchEndpoints[i]) > -1) {
          isSearchResultsPage = true;
        }
      } // if enhanced search is enabled and we are on a search page


      if (typeof saytVM !== 'undefined' && isSearchResultsPage) {
        metaTitle = saytVM.config.metaTitle.replace('$SearchTerm$', query);
      } // otherwise use the existing title
      else {
          metaTitle = document.title;
        }

      return metaTitle;
    },
    // Create URL reflecting interaction with UI
    createURL: function createURL(_ref2) {
      var qsModule = _ref2.qsModule,
          routeState = _ref2.routeState,
          location = _ref2.location;
      var regExp, urlParts, baseUrl;

      for (var i = 0; i < searchEndpoints.length; i++) {
        // Make sure url before endpoint persists
        regExp = new RegExp("^(.*?)/".concat(searchEndpoints[i]));
        urlParts = location.href.match(regExp);

        if (urlParts) {
          // Once we have a match, set base url and exit loop
          baseUrl = urlParts[1] + '/';
          break;
        }
      } // Create encoded string of parameters to display


      var queryString = qsModule.stringify(routeState, {
        addQueryPrefix: true,
        arrayFormat: 'repeat'
      }); // Get parameters that do not affect the search results

      var nonFuncParams = routingHelper.getNonFuncParams(location);
      return "".concat(baseUrl).concat(searchUrl).concat(queryString).concat(nonFuncParams);
    },
    // For when the page loads (including navigating back and forwards in the browser)
    parseURL: function parseURL(_ref3) {
      var qsModule = _ref3.qsModule,
          location = _ref3.location;
      // format parameters in the URL
      var queryString = routingHelper.normalizeQueryString(location); // Parse the location string and assign parameters

      var _qsModule$parse = qsModule.parse(queryString),
          _qsModule$parse$searc = _qsModule$parse.searchterm,
          searchterm = _qsModule$parse$searc === void 0 ? '' : _qsModule$parse$searc,
          page = _qsModule$parse.page,
          sortterm = _qsModule$parse.sortterm,
          pagesize = _qsModule$parse.pagesize,
          categorycode = _qsModule$parse.categorycode,
          brand = _qsModule$parse.brand,
          type = _qsModule$parse.type,
          countrycode = _qsModule$parse.countrycode,
          auctiontype = _qsModule$parse.auctiontype,
          clientid = _qsModule$parse.clientid,
          hasimage = _qsModule$parse.hasimage,
          mastercategorycode = _qsModule$parse.mastercategorycode,
          bbc = _qsModule$parse.bbc,
          publisheddatetimeutc = _qsModule$parse.publisheddatetimeutc,
          lowestimate = _qsModule$parse.lowestimate,
          highestimate = _qsModule$parse.highestimate,
          distancelocation = _qsModule$parse.distancelocation,
          postcodelocation = _qsModule$parse.postcodelocation,
          countrylocation = _qsModule$parse.countrylocation;

      return {
        searchterm: decodeURIComponent(searchterm),
        page: page,
        sortterm: sortterm,
        pagesize: pagesize,
        categorycode: categorycode,
        brand: brand,
        type: type,
        countrycode: countrycode,
        auctiontype: auctiontype,
        clientid: clientid,
        hasimage: hasimage,
        mastercategorycode: mastercategorycode,
        bbc: bbc,
        publisheddatetimeutc: publisheddatetimeutc,
        lowestimate: lowestimate,
        highestimate: highestimate,
        distancelocation: distancelocation,
        postcodelocation: postcodelocation,
        countrylocation: countrylocation
      };
    },
    // Help performance by delaying the update of the URL in the address bar
    writeDelay: 400
  });
  var stateMapping = {
    // Reflect amy UI changes back to the url parameters
    stateToRoute: function stateToRoute(uiState) {
      var query = uiState.query,
          page = uiState.page,
          sortBy = uiState.sortBy,
          hitsPerPage = uiState.hitsPerPage,
          refinementList = uiState.refinementList,
          menu = uiState.menu,
          range = uiState.range;
      return {
        searchterm: query,
        page: page,
        sortterm: typeof sortBy !== 'undefined' ? routingHelper.mapUiSortBy(sortBy) : undefined,
        pagesize: hitsPerPage,
        categorycode: typeof refinementList !== 'undefined' ? refinementList && refinementList.categoryCode && refinementList.categoryCode.join('~') : undefined,
        brand: typeof refinementList !== 'undefined' ? refinementList && refinementList.makes && refinementList.makes.join('~') : undefined,
        type: typeof refinementList !== 'undefined' ? refinementList && refinementList.items && refinementList.items.join('~') : undefined,
        countrycode: typeof refinementList !== 'undefined' ? refinementList && refinementList.countryName && refinementList.countryName.join('~') : undefined,
        auctiontype: typeof menu !== 'undefined' ? menu && menu.auctionDisplayType : undefined,
        clientid: typeof refinementList !== 'undefined' ? refinementList && refinementList.auctioneerName && refinementList.auctioneerName.join('~') : undefined,
        hasimage: typeof refinementList !== 'undefined' ? refinementList && refinementList.hasImages && refinementList.hasImages.join('~') : undefined,
        mastercategorycode: typeof menu !== 'undefined' ? menu && menu.masterCategoryCode : undefined,
        publisheddatetimeutc: typeof range !== 'undefined' ? range && getPublishedDateTimeFromRangeUTC(range.publishedDateTimeUtc) : undefined,
        lowestimate: typeof range !== 'undefined' ? range && addRemoveColonFromRangeValues(range.lowEstimate) : undefined,
        highestimate: typeof range !== 'undefined' ? range && addRemoveColonFromRangeValues(range.highEstimate) : undefined
      };
    },
    // Map the url parameters to the UI
    routeToState: function routeToState(routeState) {
      var searchterm = routeState.searchterm,
          page = routeState.page,
          sortterm = routeState.sortterm,
          pagesize = routeState.pagesize,
          categorycode = routeState.categorycode,
          brand = routeState.brand,
          type = routeState.type,
          countrycode = routeState.countrycode,
          auctiontype = routeState.auctiontype,
          clientid = routeState.clientid,
          hasimage = routeState.hasimage,
          mastercategorycode = routeState.mastercategorycode,
          publisheddatetimeutc = routeState.publisheddatetimeutc,
          lowestimate = routeState.lowestimate,
          highestimate = routeState.highestimate;
      return {
        query: searchterm != '' ? searchterm : '',
        page: page !== 1 ? page : undefined,
        sortBy: sortterm == 'Relevance' || sortterm != '' ? routingHelper.mapRouteSortBy(sortterm) : undefined,
        hitsPerPage: pagesize != '' ? pagesize : undefined,
        refinementList: {
          categoryCode: categorycode != '' ? categorycode && categorycode.split('~') : undefined,
          makes: brand != '' ? brand && brand.split('~') : undefined,
          items: type != '' ? type && type.split('~') : undefined,
          countryName: countrycode != '' ? countrycode && countrycode.split('~') : undefined,
          auctioneerName: clientid != '' ? clientid && clientid.split('~') : undefined,
          hasImages: typeof hasimage !== 'undefined' ? hasimage.toLowerCase() && hasimage.toLowerCase().split('~') : undefined
        },
        menu: {
          auctionDisplayType: auctiontype != '' ? auctiontype : undefined,
          masterCategoryCode: mastercategorycode != '' ? mastercategorycode : undefined
        },
        range: {
          publishedDateTimeUtc: typeof publisheddatetimeutc !== 'undefined' ? getPublishedRangeUTC(publisheddatetimeutc) : undefined,
          lowEstimate: typeof lowestimate !== 'undefined' ? addRemoveColonFromRangeValues(lowestimate) : undefined,
          highEstimate: typeof highestimate !== 'undefined' ? addRemoveColonFromRangeValues(highestimate, true) : undefined
        }
      };
    }
  };
  return {
    router: router,
    stateMapping: stateMapping
  };
};;"use strict";

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }

function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }

var searchRoutingOnLandingPage = function searchRoutingOnLandingPage(routingHelper) {
  var searchUrl = 'search-filter';
  var router = instantsearch.routers.history({
    windowTitle: function windowTitle() {
      return document.title;
    },
    createURL: function createURL(_ref) {
      var qsModule = _ref.qsModule,
          routeState = _ref.routeState,
          location = _ref.location;
      var baseUrl = location.href;
      var regExp = new RegExp(/^(.*?)(\/search-filter|\?.*)/);
      var urlParts = location.href.match(regExp);

      if (urlParts) {
        baseUrl = urlParts[1];
      }

      var queryString = qsModule.stringify(routeState, {
        addQueryPrefix: true,
        arrayFormat: 'repeat'
      });
      var nonFuncParams = routingHelper.getNonFuncParams(location);
      var urlSegments = [baseUrl];

      if (queryString || nonFuncParams) {
        urlSegments = [].concat(_toConsumableArray(urlSegments), ['/', searchUrl, queryString, nonFuncParams]);
      }

      return urlSegments.join('');
    },
    parseURL: function parseURL(_ref2) {
      var qsModule = _ref2.qsModule,
          location = _ref2.location;
      var queryString = routingHelper.normalizeQueryString(location);
      var parsedQueryString = qsModule.parse(queryString);
      parsedQueryString.mastercategorycode = saytVM.landingPage.masterCategoryCode;
      parsedQueryString.searchterm = decodeURIComponent(parsedQueryString.searchterm || '');
      return parsedQueryString;
    },
    writeDelay: 400
  });
  var stateMapping = {
    stateToRoute: function stateToRoute(uiState) {
      var query = uiState.query,
          page = uiState.page,
          sortBy = uiState.sortBy,
          hitsPerPage = uiState.hitsPerPage,
          refinementList = uiState.refinementList,
          menu = uiState.menu,
          range = uiState.range;
      return {
        searchterm: query,
        page: page,
        sortterm: typeof sortBy !== 'undefined' ? routingHelper.mapUiSortBy(sortBy) : undefined,
        pagesize: hitsPerPage,
        categorycode: typeof refinementList !== 'undefined' ? refinementList && refinementList.categoryCode && refinementList.categoryCode.join('~') : undefined,
        brand: typeof refinementList !== 'undefined' ? refinementList && refinementList.makes && refinementList.makes.join('~') : undefined,
        type: typeof refinementList !== 'undefined' ? refinementList && refinementList.items && refinementList.items.join('~') : undefined,
        countrycode: typeof refinementList !== 'undefined' ? refinementList && refinementList.countryName && refinementList.countryName.join('~') : undefined,
        auctiontype: typeof menu !== 'undefined' ? menu && menu.auctionDisplayType : undefined,
        clientid: typeof refinementList !== 'undefined' ? refinementList && refinementList.auctioneerName && refinementList.auctioneerName.join('~') : undefined,
        hasimage: typeof refinementList !== 'undefined' ? refinementList && refinementList.hasImages && refinementList.hasImages.join('~') : undefined,
        publisheddatetimeutc: typeof range !== 'undefined' ? range && getPublishedDateTimeFromRangeUTC(range.publishedDateTimeUtc) : undefined,
        lowestimate: typeof range !== 'undefined' ? range && addRemoveColonFromRangeValues(range.lowEstimate) : undefined,
        highestimate: typeof range !== 'undefined' ? range && addRemoveColonFromRangeValues(range.highEstimate) : undefined
      };
    },
    routeToState: function routeToState(routeState) {
      var searchterm = routeState.searchterm,
          page = routeState.page,
          sortterm = routeState.sortterm,
          pagesize = routeState.pagesize,
          categorycode = routeState.categorycode,
          brand = routeState.brand,
          type = routeState.type,
          countrycode = routeState.countrycode,
          auctiontype = routeState.auctiontype,
          clientid = routeState.clientid,
          hasimage = routeState.hasimage,
          publisheddatetimeutc = routeState.publisheddatetimeutc,
          lowestimate = routeState.lowestimate,
          highestimate = routeState.highestimate;
      return {
        query: searchterm != '' ? searchterm : '',
        page: page !== 1 ? page : undefined,
        sortBy: sortterm == 'Relevance' || sortterm != '' ? routingHelper.mapRouteSortBy(sortterm) : undefined,
        hitsPerPage: pagesize != '' ? pagesize : undefined,
        refinementList: {
          categoryCode: categorycode != '' ? categorycode && categorycode.split('~') : undefined,
          makes: brand != '' ? brand && brand.split('~') : undefined,
          items: type != '' ? type && type.split('~') : undefined,
          countryName: countrycode != '' ? countrycode && countrycode.split('~') : undefined,
          auctioneerName: clientid != '' ? clientid && clientid.split('~') : undefined,
          hasImages: typeof hasimage !== 'undefined' ? hasimage.toLowerCase() && hasimage.toLowerCase().split('~') : undefined
        },
        menu: {
          auctionDisplayType: auctiontype != '' ? auctiontype : undefined,
          masterCategoryCode: saytVM.landingPage.masterCategoryCode
        },
        range: {
          publishedDateTimeUtc: typeof publisheddatetimeutc !== 'undefined' ? getPublishedRangeUTC(publisheddatetimeutc) : undefined,
          lowEstimate: typeof lowestimate !== 'undefined' ? addRemoveColonFromRangeValues(lowestimate) : undefined,
          highEstimate: typeof highestimate !== 'undefined' ? addRemoveColonFromRangeValues(highestimate, true) : undefined
        }
      };
    }
  };
  return {
    router: router,
    stateMapping: stateMapping
  };
};;"use strict";

var renderSearchbox = function renderSearchbox(renderOptions, isFirstRender) {
  var SEARCHTERMID = 'main-search-term';
  var query = renderOptions.query,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container,
      searchAsYouType = widgetParams.searchAsYouType; // Overlay creates the searchbox but ensure query is updated for results page

  if (isFirstRender) {
    var _searchInput = container.querySelector("#".concat(SEARCHBOXID));

    if (_searchInput) {
      // If a search has been already been performed, set the value of the input onload
      if (query.length > 0) {
        _searchInput.value = query;
      } // Update search results as the customer types the query


      _searchInput.addEventListener('input', function (event) {
        event.preventDefault();

        if (searchAsYouType && !showOverlayOnSearchResults) {
          refine(event.target.value);
        }
      });
    }
  }

  var searchInput = document.querySelector("#".concat(SEARCHTERMID));

  if (searchInput) {
    searchInput.value = query;
  }
};

var customSearchbox = instantsearch.connectors.connectSearchBox(renderSearchbox);;"use strict";

var renderBreadCrumbs = function renderBreadCrumbs(renderOptions, isFirstRender) {// In previous version of search, we don't change of breadcrumbs.
};

var renderBreadCrumbsNewUiSkin = function renderBreadCrumbsNewUiSkin(renderOptions, isFirstRender) {
  var nbHits = renderOptions.nbHits,
      query = renderOptions.query,
      widgetParams = renderOptions.widgetParams;
  var searchTerm = displaySearchTerm(query);
  widgetParams.container.innerHTML = "<span>".concat(escapeHTML(searchTerm), "</span>");
};

var renderBreadCrumbsForLandingPage = function renderBreadCrumbsForLandingPage(renderOptions, isFirstRender) {
  var nbHits = renderOptions.nbHits,
      query = renderOptions.query,
      widgetParams = renderOptions.widgetParams;
  var currentPageName = window.categoryNameLookup[saytVM.landingPage.masterCategoryCode];
  var currentPageUrl = saytVM.landingPage.categoryPageUrl;
  widgetParams.container.innerHTML = "<a href=\"".concat(currentPageUrl, "\"><span>").concat(currentPageName, "</span></a>");
};

var renderBreadCrumbsEntry = function renderBreadCrumbsEntry(renderOptions, isFirstRender) {
  if (saytVM.featureSwitch.isLandingPage) {
    renderBreadCrumbsForLandingPage(renderOptions, isFirstRender);
  } else if (saytVM.featureSwitch.isNewUiSkinSearchResultEnabled) {
    renderBreadCrumbsNewUiSkin(renderOptions, isFirstRender);
  } else {
    renderBreadCrumbs(renderOptions, isFirstRender);
  }
};

var customBreadCrumbs = instantsearch.connectors.connectStats(renderBreadCrumbsEntry);;"use strict";

var renderPageHeader = function renderPageHeader(renderOptions, isFirstRender) {
  var nbHits = renderOptions.nbHits,
      query = renderOptions.query,
      widgetParams = renderOptions.widgetParams;
  var searchTerm = displaySearchTerm(query);

  if (!isFirstRender) {
    var headingTxt = '';

    if (typoTolerance) {
      headingTxt = saytVM.pageheader.listingPageHeadingTypo;
      headingTxt = headingTxt.replace('$SearchTerm$', "<h1>".concat(escapeHTML(searchTerm), "</h1>"));
      headingTxt = headingTxt.replace('$NumberOfResults$', nbHits);

      if (nbHits == 1) {
        headingTxt = headingTxt.replace('have', 'has');
      }
    } else {
      headingTxt = saytVM.pageheader.listingPageHeading;
      headingTxt = headingTxt.replace('$SearchTerm$', "<h1>".concat(escapeHTML(searchTerm), "</h1>"));
      headingTxt = headingTxt.replace('$NumberOfResults$', nbHits > 0 ? nbHits : saytVM.pageheader.noLabel);
    }

    if (nbHits == 1) {
      headingTxt = headingTxt.replace('item(s)', 'item');
    } else {
      headingTxt = headingTxt.replace('item(s)', 'items');
    }

    widgetParams.container.innerHTML = "<span class=\"searchResultsHeading\">".concat(headingTxt, "</span>").concat(instantSearchHelp());
  }
};

var renderPageHeaderNewUiSkin = function renderPageHeaderNewUiSkin(renderOptions, isFirstRender) {
  var nbHits = renderOptions.nbHits,
      query = renderOptions.query,
      widgetParams = renderOptions.widgetParams;

  if (!isFirstRender) {
    var searchTerm = displaySearchTerm(query);
    var nbHitsTxt = "<span class=\"search-results-items search-results-items-mobile\">".concat(nbHits, " ").concat(nbHits == 1 ? 'item' : 'items', "</span>");

    if (widgetParams.container) {
      widgetParams.container.innerHTML = "<span class=\"searchResultsHeading\"><h1>".concat(escapeHTML(searchTerm), "</h1></span>").concat(nbHitsTxt);
    }
  }
};

var customPageHeader = saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? instantsearch.connectors.connectStats(renderPageHeaderNewUiSkin) : instantsearch.connectors.connectStats(renderPageHeader);

var displaySearchTerm = function displaySearchTerm(query) {
  var searchTerm = '';
  var div = '=';
  var defaultQuery = '*';
  var params = window.location.search.substr(1).split('&'); // if the url has parameters, work through these first

  if (params.length > 0) {
    params.map(function (item) {
      // params should have an equals sign
      if (item.indexOf(div) > -1) {
        var nameVal = item.split(div); // if we have a master category code parameter, return the category name
        // and ignore the search term if it is present
        // (always make sure the master category code is lowercase)

        switch (nameVal[0].toLowerCase()) {
          case 'mastercategorycode':
            searchTerm = window.categoryNameLookup[nameVal[1]];
            break;
        }
      }
    });
  } // otherwise get the search term from the query submitted to algolia


  if (searchTerm.length == 0) {
    searchTerm = query.length > 0 ? query : defaultQuery;
  }

  return searchTerm;
};

var instantSearchHelp = function instantSearchHelp() {
  var showHelp = false,
      helpTxt = '',
      helpUrl = '';

  if (saytVM.searchheader.showHelp) {
    showHelp = saytVM.searchheader.showHelp.toLowerCase() == 'true' ? true : false;

    if (saytVM.searchheader.helpTxt) {
      helpTxt = saytVM.searchheader.helpTxt;
    }

    if (saytVM.searchheader.helpUrl) {
      helpUrl = saytVM.searchheader.helpUrl;
    }
  }

  if (showHelp) {
    return "<h3 class=\"instantSearchHelp\"><a href=\"".concat(helpUrl, "\" target=\"_blank\">").concat(helpTxt, "</a></h3>");
  }

  return '';
};;"use strict";

var DEFAULTPAGESIZE = 60; // Sort by drop-down and view type switch

var renderSortByViewType = function renderSortByViewType(renderOptions, isFirstRender) {
  var options = renderOptions.options,
      currentRefinement = renderOptions.currentRefinement,
      hasNoResults = renderOptions.hasNoResults,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container;

  if (isFirstRender) {
    container.innerHTML = "\n            <div class=\"pagination-sort-container\">\n                <div class=\"pagination-sort\">\n                    <label for=\"sortBy\" class=\"label\">".concat(saytVM.searchheader.sortLabel, "</label>\n                    <select name=\"sortBy\" id=\"sortBy\">\n                    </select>\n                </div>\n                <ul class=\"display-type\">\n                    ").concat(saytVM.searchheader.infiniteListHeaderViews.split(',').map(function (item) {
      return "<li id=\"".concat(item.toLowerCase(), "_Select\" class=\"").concat(item.toLowerCase(), "\" onclick=\"saytSetInfiniteListView('").concat(item.toLowerCase(), "')\"><span>").concat(item, "</span></li>");
    }).join(''), "\n                </ul>\n            </div>\n        ");

    var _select = container.querySelector('#sortBy');

    _select.addEventListener('change', function (event) {
      refine(event.target.value);
    });
  }

  if (hasNoResults) {
    container.style.display = 'none';
  } else {
    container.style.display = 'block';
  }

  var select = widgetParams.container.querySelector('#sortBy');
  select.innerHTML = "\n        ".concat(options.map(function (option) {
    return "<option value=\"".concat(option.value, "\" ").concat(option.value === currentRefinement ? 'selected' : '', ">").concat(option.label, "</option>");
  }).join(''), "\n    ");
};

var renderSortByViewTypeNewUiSkin = function renderSortByViewTypeNewUiSkin(renderOptions, isFirstRender) {
  var options = renderOptions.options,
      currentRefinement = renderOptions.currentRefinement,
      hasNoResults = renderOptions.hasNoResults,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container;

  if (isFirstRender) {
    container.innerHTML = " \n            <div class=\"pagination-sort-container\"> \n                <ul class=\"display-type\">\n                    ".concat(saytVM.searchheader.infiniteListHeaderViews.split(',').map(function (item) {
      return "<li id=\"".concat(item.toLowerCase(), "_Select\" class=\"").concat(item.toLowerCase(), "\" onclick=\"saytSetInfiniteListView('").concat(item.toLowerCase(), "')\"><span>").concat(item, "</span></li>");
    }).join(''), "\n                </ul>\n                <div class=\"pagination-sort\">\n                    <select name=\"sortBy\" id=\"sortBy\" class=\"ui dropdown filters-dropdown filters-header\"></select>\n                </div>\n            </div>\n        ");

    var _select2 = container.querySelector('#sortBy');

    _select2.addEventListener('change', function (event) {
      refine(event.target.value);
    });
  }

  if (hasNoResults) {
    container.style.display = 'none';
  } else {
    container.style.display = 'block';
  }

  var select = widgetParams.container.querySelector('#sortBy');
  select.innerHTML = "\n        ".concat(options.map(function (option) {
    return "<option value=\"".concat(option.value, "\" ").concat(option.value === currentRefinement ? 'selected' : '', ">").concat(option.label, "</option>");
  }).join(''), "\n    ");
};

var customSortByViewType = saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? instantsearch.connectors.connectSortBy(renderSortByViewTypeNewUiSkin) : instantsearch.connectors.connectSortBy(renderSortByViewType); // Sort by drop-down for mobile

var renderSortMobile = function renderSortMobile(renderOptions, isFirstRender) {
  var options = renderOptions.options,
      currentRefinement = renderOptions.currentRefinement,
      hasNoResults = renderOptions.hasNoResults,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container;

  if (isFirstRender) {
    container.innerHTML = "\n                <div>\n                    <label for=\"sortBy\" class=\"label\">".concat(saytVM.searchheader.sortLabel, "</label>\n                    <select name=\"sortBy\" id=\"sortBy\" ").concat(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? 'class="ui dropdown filters-dropdown"' : '', ">\n                    </select>\n                </div>\n        ");

    var _select3 = container.querySelector('#sortBy');

    _select3.addEventListener('change', function (event) {
      refine(event.target.value);
    });
  }

  if (hasNoResults) {
    container.style.display = 'none';
  } else {
    container.style.display = 'block';
  }

  var select = widgetParams.container.querySelector('#sortBy');
  select.innerHTML = "\n        ".concat(options.map(function (option) {
    return "<option value=\"".concat(option.value, "\" ").concat(option.value === currentRefinement ? 'selected' : '', ">").concat(option.label, "</option>");
  }).join(''), "\n    ");
};

var customSortMobile = instantsearch.connectors.connectSortBy(renderSortMobile); // Display switch

function saytSetInfiniteListView(viewType, dontSetCookie) {
  // Set the view class on the results container. 
  $('.region-main').removeClass('view-type-list').removeClass('view-type-grid').addClass('view-type-' + viewType);
  $('#results').removeClass().addClass(viewType); // Hack for Webkits to force a re-draw - re-paint to display grid and list views (in jquery)

  $('#results').hide().show(0);

  if (dontSetCookie) {
    return;
  } // Save selected view type as cookie


  SetCookie(saytVM.searchheader.viewTypeCookie, viewType, 365);
}

function esJumpToTop() {
  $('html, body').animate({
    scrollTop: 0
  }, 'fast');
} // Page size options


var renderPageSize = function renderPageSize(renderOptions, isFirstRender) {
  var items = renderOptions.items,
      hasNoResults = renderOptions.hasNoResults,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var cookieKey = saytVM.searchheader.pageSizeCookie;
  var defaultItem = items.find(function (x) {
    if (x["default"]) return x;
  });
  var defaultVal = defaultItem ? defaultItem.value : items && items.length > 0 && items[0].value ? items[0].value : DEFAULTPAGESIZE;
  var container = widgetParams.container;

  var saytGetOrSetTheDefaultPageSizeCookie = function saytGetOrSetTheDefaultPageSizeCookie(cookieKey, defaultVal) {
    var isIpadVersionLessThen = function isIpadVersionLessThen(minVersion) {
      var pattern = /iPad.+CPU OS (\d+)_/;
      var userAgent = navigator.userAgent;
      var match = pattern.exec(userAgent);

      if (match == null || match.length !== 2) {
        return false;
      }

      var currentIosVersion = parseInt(match[1]);
      return currentIosVersion < minVersion;
    };

    var pagingVal = GetCookie(cookieKey);

    if (isIpadVersionLessThen(9)) {
      pagingVal = "60";
      SetCookie(cookieKey, pagingVal, '100');
      $(".page-size").hide();
    }

    if (!pagingVal) {
      //Default, PageSize from model will be the config value default unless a cookie was found (on server and passed to model).
      SetCookie(cookieKey, defaultVal, '100');
      pagingVal = defaultVal;
    }

    ;
    return pagingVal;
  };

  if (isFirstRender) {
    var _sizeList = document.createElement('ul');

    _sizeList.setAttribute('id', 'pageSizeOptionContainer_' + widgetParams.position);

    _sizeList.setAttribute('class', 'page-size pageSize');

    _sizeList.setAttribute('data-user-preference-pagesize-cookie-key', cookieKey);

    _sizeList.setAttribute('data-default-page-size', defaultVal);

    _sizeList.setAttribute('data-search-url', document.location);

    container.appendChild(_sizeList); // Get the paging size from the cookie
    // Refine search if it is different

    var pagingVal = saytGetOrSetTheDefaultPageSizeCookie(cookieKey, defaultVal);

    if (pagingVal != defaultVal) {
      refine(pagingVal);
    }
  }

  var sizeList = container.querySelector('ul');
  sizeList.innerHTML = "<li>".concat(saytVM.searchheader.pageSizeLabel, "</li>\n                ").concat(items.map(function (item) {
    return "<li><span class=\"pageSizeOption ".concat(item.isRefined ? 'active' : '', "\">").concat(item.label, "</span></li>");
  }).join(''), "\n                ");
  var sizeOptions = container.querySelectorAll('span.pageSizeOption');

  for (var i = 0; i < sizeOptions.length; i++) {
    sizeOptions[i].addEventListener('click', function (event) {
      event.preventDefault(); // Update user preference cookie

      SetCookie(cookieKey, event.target.innerText, '100');
      esJumpToTop();
      refine(event.target.innerText);
    });
  }

  if (hasNoResults) {
    container.style.display = 'none';
  } else {
    container.style.display = 'block';
  }
};

var renderPageSizeNewUiSkin = function renderPageSizeNewUiSkin(renderOptions, isFirstRender) {
  var items = renderOptions.items,
      hasNoResults = renderOptions.hasNoResults,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var cookieKey = saytVM.searchheader.pageSizeCookie;
  var defaultItem = items.find(function (x) {
    if (x["default"]) return x;
  });
  var defaultVal = defaultItem ? defaultItem.value : items && items.length > 0 && items[0].value ? items[0].value : DEFAULTPAGESIZE;
  var container = widgetParams.container;

  if (widgetParams.position !== 'top') {
    return;
  }

  var saytGetOrSetTheDefaultPageSizeCookie = function saytGetOrSetTheDefaultPageSizeCookie(cookieKey, defaultVal) {
    var isIpadVersionLessThen = function isIpadVersionLessThen(minVersion) {
      var pattern = /iPad.+CPU OS (\d+)_/;
      var userAgent = navigator.userAgent;
      var match = pattern.exec(userAgent);

      if (match == null || match.length !== 2) {
        return false;
      }

      var currentIosVersion = parseInt(match[1]);
      return currentIosVersion < minVersion;
    };

    var pagingVal = GetCookie(cookieKey);

    if (isIpadVersionLessThen(9)) {
      pagingVal = "60";
      SetCookie(cookieKey, pagingVal, '100');
      $(".page-size").hide();
    }

    if (!pagingVal) {
      //Default, PageSize from model will be the config value default unless a cookie was found (on server and passed to model).
      SetCookie(cookieKey, defaultVal, '100');
      pagingVal = defaultVal;
    }

    ;
    return pagingVal;
  };

  if (isFirstRender) {
    var sizeListElement = document.createElement('select');
    sizeListElement.setAttribute('id', 'pageSizeOptionContainer_' + widgetParams.position);
    sizeListElement.setAttribute('class', 'page-size pageSize ui dropdown filters-dropdown filters-header');
    container.appendChild(sizeListElement);
    var perPageElement = document.createElement('span');
    perPageElement.setAttribute('class', 'page-size-label');
    container.appendChild(perPageElement);
    var perPage = container.querySelector('.page-size-label');
    perPage.innerHTML = saytVM.searchheader.perPageLabel; // Get the paging size from the cookie
    // Refine search if it is different

    var pagingVal = saytGetOrSetTheDefaultPageSizeCookie(cookieKey, defaultVal);

    if (pagingVal != defaultVal) {
      refine(pagingVal);
    }

    var sizeList = container.querySelector('select');
    sizeList.innerHTML = items.map(function (item) {
      return "<option value=\"".concat(item.value, "\" ").concat(item.isRefined ? 'selected' : '', ">").concat(item.label, "</option>");
    }).join('');
    sizeList.addEventListener('change', function (event) {
      event.preventDefault(); // Update user preference cookie

      SetCookie(cookieKey, event.target.value, '100');
      esJumpToTop();
      refine(event.target.value);
    });
  }

  if (hasNoResults) {
    container.style.display = 'none';
  } else {
    container.style.display = 'flex';
  }
};

var customPageSize = saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? instantsearch.connectors.connectHitsPerPage(renderPageSizeNewUiSkin) : instantsearch.connectors.connectHitsPerPage(renderPageSize); // Pagination controls

var renderPagination = function renderPagination(renderOptions, isFirstRender) {
  var pages = renderOptions.pages,
      currentRefinement = renderOptions.currentRefinement,
      nbPages = renderOptions.nbPages,
      nbHits = renderOptions.nbHits,
      isFirstPage = renderOptions.isFirstPage,
      isLastPage = renderOptions.isLastPage,
      refine = renderOptions.refine,
      createURL = renderOptions.createURL,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container;
  var selectId = "pageNumberDropDown_".concat(widgetParams.position);
  var cookieKey = saytVM.searchheader.pageSizeCookie;
  var pagingVal = GetCookie(cookieKey) > 0 ? GetCookie(cookieKey) : DEFAULTPAGESIZE;
  var tPages = nbPages; // Only for first 1K of results

  var pageNumbers = [];

  for (var i = 1; i <= tPages; i++) {
    pageNumbers.push(i);
  }

  container.innerHTML = "\n        <div class=\"pagination-paging\">\n        ".concat(!isFirstPage ? "<a class=\"previous\" rel=\"prev\" href=\"".concat(createURL(currentRefinement - 1), "\" data-value=\"").concat(currentRefinement - 1, "\"></a>") : "<div class=\"previous disabled\"></div>", "\n        <span class=\"pageselect\">\n        <span>").concat(saytVM.searchheader.pageLabel, "</span>\n        <select class=\"jumpPagination\" id=\"").concat(selectId, "\" name=\"").concat(selectId, "\">\n        ").concat(pageNumbers.map(function (page) {
    return "\n        <option ".concat(currentRefinement == page - 1 ? 'selected' : '', " value=\"").concat(page - 1, "\" data-value=\"").concat(page - 1, "\">").concat(page, "</option>\n        ");
  }).join(''), "\n        </select>\n        <span>&nbsp;").concat(saytVM.searchheader.ofLabel, "&nbsp;</span>\n        <span>").concat(tPages, "</span>\n        </span>\n        ").concat(!isLastPage ? "<a class=\"next\" rel=\"next\" href=\"".concat(createURL(currentRefinement + 1), "\" data-value=\"").concat(currentRefinement + 1, "\"></a>") : "<div class=\"next disabled\"></div>", "\n        </div>\n    ");
  var select = widgetParams.container.querySelector("#".concat(selectId));
  select.addEventListener('change', function (event) {
    event.preventDefault();
    refine(event.target.value);
    esJumpToTop();
  });
  var nextPrev = widgetParams.container.querySelectorAll('a');

  for (var _i = 0; _i < nextPrev.length; _i++) {
    nextPrev[_i].addEventListener('click', function (event) {
      event.preventDefault();
      refine(event.currentTarget.dataset.value);
      esJumpToTop();
    });
  }

  if (nbHits == 0 || nbHits < pagingVal) {
    container.style.display = 'none';
  } else {
    container.style.display = 'block';
  }
};

var renderPaginationNewUiSkin = function renderPaginationNewUiSkin(renderOptions, isFirstRender) {
  var pages = renderOptions.pages,
      currentRefinement = renderOptions.currentRefinement,
      nbPages = renderOptions.nbPages,
      nbHits = renderOptions.nbHits,
      isFirstPage = renderOptions.isFirstPage,
      isLastPage = renderOptions.isLastPage,
      refine = renderOptions.refine,
      createURL = renderOptions.createURL,
      widgetParams = renderOptions.widgetParams;

  if (widgetParams.position === 'top') {
    return;
  }

  var container = widgetParams.container;
  var selectId = "pageNumberDropDown_".concat(widgetParams.position);
  var cookieKey = saytVM.searchheader.pageSizeCookie;
  var pagingVal = GetCookie(cookieKey) > 0 ? GetCookie(cookieKey) : DEFAULTPAGESIZE;
  var tPages = nbPages; // Only for first 1K of results

  var pageNumbers = [];

  for (var i = 1; i <= tPages; i++) {
    pageNumbers.push(i);
  }

  container.innerHTML = "\n        <div class=\"pagination-paging\">\n        ".concat(!isFirstPage ? "<a class=\"previous\" rel=\"prev\" href=\"".concat(createURL(currentRefinement - 1), "\" data-value=\"").concat(currentRefinement - 1, "\">\n        </a>") : "<div class=\"previous disabled\">\n            <span class=\"material-icons\">\n                keyboard_arrow_left\n            </span>\n        </div>", "\n        <span class=\"pageselect\">\n        <select class=\"jumpPagination ui dropdown\" id=\"").concat(selectId, "\" name=\"").concat(selectId, "\">\n        ").concat(pageNumbers.map(function (page) {
    return "\n        <option ".concat(currentRefinement == page - 1 ? 'selected' : '', " value=\"").concat(page - 1, "\" data-value=\"").concat(page - 1, "\">").concat(page, "</option>\n        ");
  }).join(''), "\n        </select>\n        <span>&nbsp;").concat(saytVM.searchheader.ofLabel, "&nbsp;</span>\n        <span>").concat(tPages, "</span>\n        </span>\n        ").concat(!isLastPage ? "\n        <a class=\"next\" rel=\"next\" href=\"".concat(createURL(currentRefinement + 1), "\" data-value=\"").concat(currentRefinement + 1, "\">\n        </a>\n        ") : "<div class=\"next disabled\"> \n            <span class=\"material-icons\">\n            keyboard_arrow_right\n            </span>\n        </div>", "\n        </div>\n    ");
  var desktopView = window.matchMedia('(min-width: 1200px)');

  function dropdownInit(e) {
    if (e.matches) {
      $('.ui.dropdown').dropdown();
    }
  }

  dropdownInit(desktopView);
  var select = widgetParams.container.querySelector("#".concat(selectId));
  select.addEventListener('change', function (event) {
    event.preventDefault();
    refine(event.target.value);
    esJumpToTop();
  });
  var nextPrev = widgetParams.container.querySelectorAll('a');

  for (var _i2 = 0; _i2 < nextPrev.length; _i2++) {
    nextPrev[_i2].addEventListener('click', function (event) {
      event.preventDefault();
      refine(event.currentTarget.dataset.value);
      esJumpToTop();
    });
  }

  if (nbHits == 0 || nbHits < pagingVal) {
    container.style.display = 'none';
  } else {
    container.style.display = 'block';
  }
};

var customPagination = saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? instantsearch.connectors.connectPagination(renderPaginationNewUiSkin) : instantsearch.connectors.connectPagination(renderPagination); // Result Pagination controls

var renderResultsInfo = function renderResultsInfo(renderOptions, isFirstRender) {// In previous version of search, we don't change of result info - stay it empty.
};

var renderResultsInfoNewUiSkin = function renderResultsInfoNewUiSkin(renderOptions, isFirstRender) {
  var pages = renderOptions.pages,
      currentRefinement = renderOptions.currentRefinement,
      nbPages = renderOptions.nbPages,
      nbHits = renderOptions.nbHits,
      isFirstPage = renderOptions.isFirstPage,
      isLastPage = renderOptions.isLastPage,
      refine = renderOptions.refine,
      createURL = renderOptions.createURL,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container;
  var culture = saytVM.config.culture;
  var numberOfAll = nbHits.toLocaleString(culture);
  var paginationInfo = saytVM.searchheader.foundLabel;
  paginationInfo = paginationInfo.replace('$NumberOfAll$', numberOfAll);

  if (nbHits == 1) {
    paginationInfo = paginationInfo.replace('items', 'item');
  }

  container.innerHTML = paginationInfo;
};

var customResultsInfo = saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? instantsearch.connectors.connectPagination(renderResultsInfoNewUiSkin) : instantsearch.connectors.connectPagination(renderResultsInfo);;"use strict";

var additionalFeesTemplate = function additionalFeesTemplate(item) {
  if (typeof item === 'undefined' || saytVM.config.platform == 'BSC') return "";

  if (saytVM.featureSwitch.isNewUiSkinSearchResultEnabled) {
    return " \n                <div class=\"tooltip\">\n                <div class=\"ui custom popup bottom center transition \" id=\"popup-".concat(item.objectID, "\">\n                <div class=\"popup-icon\">\n                </div>\n\n                    </span>\n                    <p><strong>").concat(saytVM.additionalfees.additionalFeesLabel, ":</strong>\n                    </p>\n                    <div class=\"results-loader\" style=\"width: 10%; margin: 0 auto;\">\n                        <div>\n                            <img src=\"/content/bs/images/ajax-loader.gif\" alt=\"Loading...\" width=\"25\" height=\"25\"/>\n                        </div>\n                    </div>\n                <div class=\"popup-main-content hide\">\n                    <table>\n                        <tbody>\n                        ").concat(commissionsTemplate(saytVM.config.platform), " \n        \n                        <tr class=\"vat-rate-row\">\n                            <td>").concat(saytVM.additionalfees.vatOnHammerLabel, ":</td>\n                            <td><span id=\"additionalFeeVatRate\"><span class=\"vat-rate\"></span>%</span></td>\n                        </tr>\n        \n                        </tbody>\n                    </table>\n                    <p>\n                        <i><span class=\"hammer-excess\"></span></i>\n                    </p>\n        \n                    <p class=\"artist-resale-rights\">").concat(saytVM.additionalfees.artistRightsLabel, "</p>\n        \n                    <small name=\"commission-info\">").concat(commissionsUrl(item), "</small>\n                    <small name=\"short-commission-info\" class=\"hide\">").concat(commissionsUrlShort(item), "</small>\n                </div>\n                </div>\n            </div>  \n        ");
  }

  return "\n        <label class=\"link-icon additional-fees-toggle color-secondary\" id=\"popup-trigger-".concat(item.objectID, "\" data-url=\"").concat(additionalFeesUrl(item), "\">\n            ").concat(feesPopupTrigger(), "\n        </label>\n        <div class=\"tooltip\">\n            <div class=\"popup\" id=\"popup-").concat(item.objectID, "\">\n                    \n                <p><strong>").concat(saytVM.additionalfees.additionalFeesLabel, ":</strong>\n                </p>\n                <div class=\"results-loader\" style=\"width: 10%; margin: 0 auto;\">\n                    <div>\n                        <img src=\"/content/bs/images/ajax-loader.gif\" alt=\"Loading...\" width=\"25\" height=\"25\"/>\n                    </div>\n                </div>\n            <div class=\"popup-main-content hide\">\n                <table>\n                    <tbody>\n                    ").concat(commissionsTemplate(saytVM.config.platform), "\n\n                    <tr class=\"vat-rate-row\">\n                        <td>").concat(saytVM.additionalfees.vatOnHammerLabel, ":</td>\n                        <td><span id=\"additionalFeeVatRate\"><span class=\"vat-rate\"></span>%</span></td>\n                    </tr>\n\n                    </tbody>\n                </table>\n                <p>\n                    <i><span class=\"hammer-excess\"></span></i>\n                </p>\n\n                <p class=\"artist-resale-rights\">").concat(saytVM.additionalfees.artistRightsLabel, "</p>\n\n                <small name=\"commission-info\">").concat(commissionsUrl(item), "</small>\n                <small name=\"short-commission-info\" class=\"hide\">").concat(commissionsUrlShort(item), "</small>\n            </div>\n            </div>\n        </div>\n    ");
};

var feesPopupTrigger = function feesPopupTrigger() {
  if (saytVM.featureSwitch.isNewUiSkinSearchResultEnabled) {
    return "<span class=\"material-icons additional-fees-toggle-icon\">help</span>";
  }

  return "<i class=\"icon icon-question-mark\"></i><span>".concat(saytVM.additionalfees.additionalFeesLabel, "</span>");
};

var commissionsTemplate = function commissionsTemplate(platform) {
  if (platform == 'IB' || platform == 'BS') {
    return "\n            <tr name=\"commissions\">\n                <td>".concat(saytVM.additionalfees.commissionsLabel, "*:</td>\n                <td><span id=\"commissionsExVAT\"><span class=\"commissions-ex-vat\"></span>%</span> ex. ").concat(saytVM.additionalfees.vatLabel, "</td>\n            </tr>\n            <tr name=\"alternative-buyers-premium\" class=\"hide\">\n                <td colspan=\"2\"></td>\n            </tr>\n        ");
  } else {
    return "\n            <tr name=\"commissions\">\n                <td>".concat(saytVM.additionalfees.commissionsLabel, "*:</td>\n                <td><span id=\"commissionsWithVAT\"><span class=\"commissions-with-vat\"></span>%</span> inc. ").concat(saytVM.additionalfees.vatLabel, "</td>\n            </tr>\n            <tr name=\"alternative-buyers-premium\" class=\"hide\">\n                <td colspan=\"2\"></td>\n            </tr>\n        ");
  }
};

var additionalFeesUrl = function additionalFeesUrl(item) {
  if (typeof item === 'undefined') return "";
  return getLinkUrls(saytVM.additionalfees.additionalFeesUrl, null, item.objectID, item.auctionRef);
};

var commissionsUrl = function commissionsUrl(item) {
  if (typeof item === 'undefined') return "";
  var timedAuc = "";

  if (item.auctionDisplayType.toLowerCase().indexOf('timed') >= 0) {
    if (item.auctionDisplayType.toLowerCase().indexOf('catalog') == -1) {
      timedAuc += "timed/";
    }
  }

  timedAuc += item.auctioneerRef;
  return getLinkUrls(saytVM.additionalfees.commissionInfoUrl, timedAuc, null, item.auctionRef);
};

var commissionsUrlShort = function commissionsUrlShort(item) {
  if (typeof item === 'undefined') return "";
  var timedAuc = "";

  if (item.auctionDisplayType.toLowerCase().indexOf('timed') >= 0) {
    if (item.auctionDisplayType.toLowerCase().indexOf('catalog') == -1) {
      timedAuc += "timed/";
    }
  }

  timedAuc += item.auctioneerRef;
  return getLinkUrls(saytVM.additionalfees.commissionInfoShortUrl, timedAuc, null, item.auctionRef);
};;"use strict";

var renderSearchResults = function renderSearchResults(renderOptions, isFirstRender) {
  var hits = renderOptions.hits,
      widgetParams = renderOptions.widgetParams; //

  var container = widgetParams.container; // we need queryid and indexname for search analytics

  var queryID = renderOptions.results ? renderOptions.results.queryID : "";
  var indexName = renderOptions.instantSearchInstance.indexName;
  var sideFilterHeader = document.querySelector('#refineResults > h2');
  var sideFilterClearBtn = document.querySelector('#refineResults > #clearFacetsPlaceholder');
  var pageStart = renderOptions.results ? renderOptions.results.page * renderOptions.results.hitsPerPage : 0;
  var hitsPerPage = renderOptions.results ? renderOptions.results.hitsPerPage : 0;
  var nbPages = renderOptions.results ? renderOptions.results.nbPages : 0;
  var page = renderOptions.results ? renderOptions.results.page : 0;
  var rr = renderOptions.results ? renderOptions.results._rawResults[0] : '';
  var params = rr != '' ? rr.params : '';
  var indexUsed = rr != '' ? rr.indexUsed : indexName;
  var abTestId = rr != '' ? rr.abTestID : 0;
  var abVariantId = rr != '' ? rr.abTestVariantID : 0;
  var substituteTitleWithDescription = saytVM.searchResults.substituteTitleWithDescription; //

  if (isFirstRender) {
    // add click handler to search results container
    container.addEventListener('click', function (event) {
      hitClickEvent(event);
    });
  } //


  if (!isFirstRender) {
    //
    storeIndexUsed(indexUsed, abTestId, abVariantId); //

    var query = renderOptions.results.query ? renderOptions.results.query : "";
    AppInisghtsTrackSearch(ALGOLIA_APP_INSIGHTS_SERVICE_NAME, queryID, indexName, "algolia-search", query, hits.length, hitsPerPage, nbPages, page, params, indexUsed, abTestId, abVariantId);

    if (hits.length > 0) {
      // Determine if typo-tolerance has kicked in
      if (typeof hits !== 'undefined') {
        if (typeof hits[0]._rankingInfo !== 'undefined') {
          typoTolerance = hits[0]._rankingInfo.nbTypos > 0;
        }
      } // Render items as normal


      widgetParams.container.innerHTML = "\n            ".concat(hits.map(function (item, position) {
        item.title = substituteTitleWithDescription ? truncateAtWord(snippetDescStripHTML(item.description, true), saytVM.searchResults.titleMaxLength) : decode(item.title);
        item.description = formatLotDescription(item, substituteTitleWithDescription);
        return renderSingleLot(item, position, indexName, queryID, pageStart);
      }).join(''), "\n            ");
      sideFilterHeader.style.display = 'inline-block';
      sideFilterClearBtn.style.display = 'block';
    } else {
      widgetParams.container.innerHTML = "\n                ".concat(saytVM.hitsrendering.noHitsMsg, "\n                ").concat(function () {
        if (!saytVM.featureSwitch.isLandingPage) {
          return '<br/><a id="restartSearch" class="button primary">' + saytVM.hitsrendering.startNewSearchLabel + '</a>';
        }

        return '';
      }(), "\n            ");
      sideFilterHeader.style.display = 'none';
      sideFilterClearBtn.style.display = 'none';

      if (!saytVM.featureSwitch.isLandingPage) {
        var restartBtn = widgetParams.container.querySelector('#restartSearch');
        restartBtn.addEventListener('click', function (event) {
          event.preventDefault(); // Reload page with new search term

          var newQueryUrl = "".concat(window.location.pathname, "?searchTerm=");
          window.location.assign(newQueryUrl);
        });
      }
    }
  }

  setupPopupClickHandlers(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled);
};

var renderSearchResultsNewUiSkin = function renderSearchResultsNewUiSkin(renderOptions, isFirstRender) {
  var hits = renderOptions.hits,
      widgetParams = renderOptions.widgetParams; //

  var container = widgetParams.container; // we need queryid and indexname for search analytics

  var queryID = renderOptions.results ? renderOptions.results.queryID : "";
  var indexName = renderOptions.instantSearchInstance.indexName;
  var sideFilterHeader = document.querySelector('#refineResults > h2');
  var sideFilterClearBtn = document.querySelector('#refineResults > #clearFacetsPlaceholder');
  var pageStart = renderOptions.results ? renderOptions.results.page * renderOptions.results.hitsPerPage : 0;
  var hitsPerPage = renderOptions.results ? renderOptions.results.hitsPerPage : 0;
  var nbPages = renderOptions.results ? renderOptions.results.nbPages : 0;
  var page = renderOptions.results ? renderOptions.results.page : 0;
  var rr = renderOptions.results ? renderOptions.results._rawResults[0] : '';
  var params = rr != '' ? rr.params : '';
  var indexUsed = rr != '' ? rr.indexUsed : indexName;
  var abTestId = rr != '' ? rr.abTestID : 0;
  var abVariantId = rr != '' ? rr.abTestVariantID : 0;
  var substituteTitleWithDescription = saytVM.searchResults.substituteTitleWithDescription; //

  if (isFirstRender) {
    // add click handler to search results container
    container.addEventListener('click', function (event) {
      hitClickEvent(event);
    });
  } //


  if (!isFirstRender) {
    //
    storeIndexUsed(indexUsed, abTestId, abVariantId); //

    var query = renderOptions.results.query ? renderOptions.results.query : "";
    AppInisghtsTrackSearch(ALGOLIA_APP_INSIGHTS_SERVICE_NAME, queryID, indexName, "algolia-search", query, hits.length, hitsPerPage, nbPages, page, params, indexUsed, abTestId, abVariantId);

    if (hits.length > 0) {
      // Determine if typo-tolerance has kicked in
      if (typeof hits !== 'undefined') {
        if (typeof hits[0]._rankingInfo !== 'undefined') {
          typoTolerance = hits[0]._rankingInfo.nbTypos > 0;
        }
      } // Render items as normal


      widgetParams.container.innerHTML = "\n            ".concat(hits.map(function (item, position) {
        item.title = substituteTitleWithDescription ? truncateAtWord(snippetDescStripHTML(item.description, true), saytVM.searchResults.titleMaxLength) : decode(item.title);
        item.description = formatLotDescription(item, substituteTitleWithDescription);
        return renderSingleLotNewUiSkin(item, position, indexName, queryID, pageStart);
      }).join(''), "\n            ");
      sideFilterHeader.style.display = 'inline-block';
      sideFilterClearBtn.style.display = 'block';
    } else {
      widgetParams.container.innerHTML = "\n            <div class=\"no-result-content\"> \n                <p>".concat(saytVM.hitsrendering.noHitsMsg, "</p>\n                ").concat(function () {
        if (!saytVM.featureSwitch.isLandingPage) {
          return '<a id="restartSearch" class="ui button primary">' + saytVM.hitsrendering.startNewSearchLabel + '</a>';
        }

        return '';
      }(), "\n            </div>");
      sideFilterHeader.style.display = 'none';
      sideFilterClearBtn.style.display = 'none';

      if (!saytVM.featureSwitch.isLandingPage) {
        var restartBtn = widgetParams.container.querySelector('#restartSearch');
        restartBtn.addEventListener('click', function (event) {
          event.preventDefault(); // Reload page with new search term

          var newQueryUrl = "".concat(window.location.pathname, "?searchTerm=");
          window.location.assign(newQueryUrl);
        });
      }
    }
  }

  setupPopupClickHandlers(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled);
};

var customSearchResults = saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? instantsearch.connectors.connectHits(renderSearchResultsNewUiSkin) : instantsearch.connectors.connectHits(renderSearchResults);

var renderSingleLot = function renderSingleLot(item, position, indexName, queryID, pageStart) {
  if (typeof item === 'undefined') return "";
  return "\n        <article class=\"panel item".concat(item.isFeaturedLot ? " featured" : "", "\"\n            data-auction-ref=\"").concat(item.auctionRef, "\"\n                       data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\"\n                       data-index=\"").concat(typeof indexName === 'undefined' ? '' : indexName, "\" \n                       data-position=\"").concat(typeof position === 'undefined' ? '' : position, "\"\n                       data-queryID=\"").concat(typeof queryID === 'undefined' ? '' : queryID, "\"\n                       data-page-start=\"").concat(typeof pageStart === 'undefined' ? '' : pageStart, "\"\n                       data-lot-id=\"").concat(item.objectID, "\">\n            <div class=\"lot-single\" id=\"lot-").concat(item.objectID, "\" data-position=\"").concat(typeof position === 'undefined' ? '' : position, "\" data-auction-ref=\"").concat(item.auctionRef, "\" data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\" data-bidding-type=\"competitive\" data-bidder-id=\"\" data-customer-id=\"\">\n                ").concat(featuredLotTemplate(item), "  \n                ").concat(showImageTemplate(item), "\n                <div class=\"main\">\n                    ").concat(renderLotHeader(item), "\n                    ").concat(auctioneerLink(item), "\n                    ").concat(renderLotDescription(item), "\n                    <div class=\"main-buttons\">\n                        ").concat(renderWishListButton(item), "\n                        ").concat(renderAuctionType(item), "\n                    </div>\n                </div>\n                <aside>\n                    <div class=\"lot-details-wrapper\">\n                        <ul class=\"lot-details\">\n                            ").concat(bidInfo(item), "\n                            ").concat(distances(item), "\n                        </ul>\n                        ").concat(additionalFeesTemplate(item), "\n                    </div>\n                    <footer>\n                        <div class=\"buttons\"></div>\n                        ").concat(renderLotDates(item), "\n                        ").concat(renderLotLocation(item), "\n                    </footer>\n                </aside>\n            </div>\n        </article>\n    ");
};

var renderSingleLotNewUiSkin = function renderSingleLotNewUiSkin(item, position, indexName, queryID, pageStart) {
  if (typeof item === 'undefined') return "";
  return "\n        <article class=\"panel item".concat(item.isFeaturedLot ? " featured" : "", "\"\n            data-auction-ref=\"").concat(item.auctionRef, "\"\n                       data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\"\n                       data-index=\"").concat(typeof indexName === 'undefined' ? '' : indexName, "\" \n                       data-position=\"").concat(typeof position === 'undefined' ? '' : position, "\"\n                       data-queryID=\"").concat(typeof queryID === 'undefined' ? '' : queryID, "\"\n                       data-page-start=\"").concat(typeof pageStart === 'undefined' ? '' : pageStart, "\"\n                       data-lot-id=\"").concat(item.objectID, "\">\n            <div class=\"lot-single\" id=\"lot-").concat(item.objectID, "\" data-position=\"").concat(typeof position === 'undefined' ? '' : position, "\" data-auction-ref=\"").concat(item.auctionRef, "\" data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\" data-bidding-type=\"competitive\" data-bidder-id=\"\" data-customer-id=\"\">\n                <div class=\"lot-image\">\n                    ").concat(featuredLotTemplate(item), "  \n                    ").concat(renderWishListButton(item), "\n                    ").concat(showImageTemplate(item), "\n                </div>\n                <div class=\"main main-container\">\n                    ").concat(renderLotHeader(item), "\n                    ").concat(auctioneerLink(item), "\n                    <div class=\"lot-details-wrapper\">\n                        <ul class=\"lot-details\">\n                            ").concat(bidInfo(item), "\n                            ").concat(distances(item), "\n                        </ul>\n                        ").concat(renderLotDatesNewUiSkin(item), "\n                        ").concat(renderLotLocation(item), "\n                    </div>\n                    ").concat(renderLotDescription(item), "\n                    <div class=\"main-buttons\">\n                        ").concat(renderWishListButton(item), "\n                        ").concat(renderAuctionType(item), "\n                    </div>\n                </div>\n                <aside>                     \n                    <footer> \n                        <div class=\"buttons\"></div>                        \n                    </footer>\n                </aside>\n            </div>\n        </article>\n    ");
};

var wishListOnClick = function wishListOnClick(lotId, auctionRef) {
  if (typeof lotId === 'undefined' || typeof auctionRef === 'undefined') return; // Show login box, after user signs in watchlist will be updated 

  var link = "window.showLoginBoxWishList('".concat(lotId, "'); return false");
  var isAuthenticated = saytVM.wishlist.isUserAuthenticated.toLowerCase() == 'true' ? true : false; // If user is already logged in, go straight to updating watchlist

  if (isAuthenticated) {
    link = "updateWishList('".concat(lotId, "','").concat(auctionRef, "'); return false");
  }

  return link;
};

var updateWishList = function updateWishList(lotId, auctionRef) {
  if (typeof lotId === 'undefined' || typeof auctionRef === 'undefined') return; // When the watchlist btn is clicked, get the auction id as this is not in the Algolia index
  // Then update the customer's watchlist

  WishlistAddRemove(lotId, null, auctionRef); // Finally update watchlist in model directly
  // so that there is no delay in displaying the icon state
  // this will get overwritten on page load

  var exists = isInWishList(lotId);

  if (!exists) {
    if (saytVM.wishlist.extraLotInfo != '') {
      saytVM.wishlist.extraLotInfo += ',';
    }

    ;
    saytVM.wishlist.extraLotInfo += lotId;
  } else {
    var str = ''; // Only 1 lot in model

    if (saytVM.wishlist.extraLotInfo == lotId) {
      saytVM.wishlist.extraLotInfo = '';
    } // Lot is first in model
    else if (saytVM.wishlist.extraLotInfo.indexOf(lotId) == 0) {
        saytVM.wishlist.extraLotInfo = saytVM.wishlist.extraLotInfo.replace(lotId + ',', '');
      } // Remove comma and lot id from model
      else {
          saytVM.wishlist.extraLotInfo = saytVM.wishlist.extraLotInfo.replace(',' + lotId, '');
        }

    ;
  }
};

var isInWishList = function isInWishList(id) {
  if (typeof id === 'undefined') return "";
  var wishList = saytVM.wishlist.extraLotInfo;

  if (wishList) {
    return wishList.indexOf(id) != -1;
  }
};

var renderWishListButton = function renderWishListButton(item) {
  if (typeof item === 'undefined') return "";
  var wishListIcon = saytVM.wishlist.wishListIcon.length > 0 ? saytVM.wishlist.wishListIcon : 'star';
  var defaultIconClass = saytVM.wishlist.wishListIconClass.length > 0 ? saytVM.wishlist.wishListIconClass : 'empty';
  var wishListState = isInWishList(item.objectID) ? '' : defaultIconClass;
  var wishListBtnMessage = isInWishList(item.objectID) ? saytVM.wishlist.watchlistRemoveMessage : saytVM.wishlist.watchlistAddMessage;
  return "\n        <div id=\"wishList".concat(item.objectID, "\" class=\"button link-icon icon-watch-link\" role=\"button\" onclick=\"").concat(wishListOnClick(item.objectID, item.auctionRef), "\" title=\"").concat(wishListBtnMessage, "\">\n            <i class=\"icon ").concat(wishListState, " ").concat(wishListIcon, "\"></i>\n            <span>").concat(wishListBtnMessage, "</span>\n        </div>\n    ");
};

var updateWishListStatesOnPageLoad = function updateWishListStatesOnPageLoad() {
  var wishList = saytVM.wishlist.extraLotInfo;

  if (wishList) {
    var wl = wishList.split(',');

    for (var i = 0; i < wl.length; i++) {
      var item = document.querySelector('wishlist' + i);

      if (item) {
        var icon = item.querySelector('icon');

        if (icon) {
          if (icon.classList.contains('empty')) {
            icon.classList.remove('empty');
          }
        }

        var message = item.querySelector('span');

        if (message) {
          message.innerHTML = saytVM.wishlist.watchlistRemoveMessage;
        }
      }
    }
  }
}; //


var distances = function distances(item) {
  if (typeof item === 'undefined') return "";
  var distHtml = "";

  if (typeof item._rankingInfo !== 'undefined') {
    if (typeof item._rankingInfo.matchedGeoLocation !== 'undefined') {
      distHtml = "<li class=\"distance last-item\">\n                <span>Distance:</span>\n                <strong>".concat(Math.ceil(item._rankingInfo.matchedGeoLocation.distance * 0.000621371), " miles</strong>\n            </li>");
    }
  }

  return distHtml;
};;"use strict";

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

// Create the render function for the custom published date widget
var renderPublishedDateFrom = function renderPublishedDateFrom(renderOptions, isFirstRender) {
  var start = renderOptions.start,
      range = renderOptions.range,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;

  var _start = _slicedToArray(start, 2),
      min = _start[0],
      max = _start[1];

  if (isFirstRender) {
    var form = document.createElement('form');
    form.addEventListener('submit', function (event) {
      event.preventDefault(); // Get the unix timestamp from the url paramater as our min value to search against

      var rawMinInputValue = parseFloat(event.target.elements.min.value); // Update search results - no max result is set
      // Only lots with a published date greater than the date set in the url parameter are returned

      refine([Number.isFinite(rawMinInputValue) ? rawMinInputValue : undefined, //min
      undefined]);
    });
    widgetParams.container.appendChild(form);
  } // Add hidden fields to our form
  // Min input auto-populated from url parameter
  // Btn to submit form on load


  widgetParams.container.querySelector('form').innerHTML = "\n        <input type=\"number\" name=\"min\" placeholder=\"".concat(range.min, "\" value=\"").concat(Number.isFinite(min) ? min : '', "\" hidden />\n        <input type=\"submit\" hidden />\n    ");
}; // Create the custom published date widget


var customPublishedDateFrom = instantsearch.connectors.connectRange(renderPublishedDateFrom); // Convert publishedDateTimeUTC url parameter into timestamp and then format as algolia range string

var getPublishedRangeUTC = function getPublishedRangeUTC(dateTime) {
  if (typeof dateTime === 'undefined') return;
  var utcTimeStamp = new Date(dateTime).valueOf().toString(); // Return UTC timestamp as Algolia range string

  return utcTimeStamp + ':';
}; // Format algolia range string to match publishedDateTimeUtc url parameter


var getPublishedDateTimeFromRangeUTC = function getPublishedDateTimeFromRangeUTC(range) {
  if (typeof range === 'undefined') return; // remove colon from end of str

  var timestamp = range.substr(0, range.length - 1); // Convert timestamp into date obj

  var d = new Date(parseInt(timestamp)); // Get values for date and time

  var year = d.getFullYear().toString();
  var month = addPreceedingZero((d.getMonth() + 1).toString()); // Month always starts from 0 not 1

  var day = addPreceedingZero(d.getDate().toString());
  var hr = addPreceedingZero(d.getHours().toString());
  var min = addPreceedingZero(d.getMinutes().toString());
  var sec = addPreceedingZero(d.getSeconds().toString()); // Return dateTime in required format
  // Example of format: 2019-07-16T04:03:10

  return year.concat('-', month, '-', day, 'T', hr, ':', min, ':', sec);
};

var addPreceedingZero = function addPreceedingZero(dateTime) {
  if (typeof dateTime === 'undefined') return; // Add zero to any string that is only 1 char in length
  // Always using double char format for dateTime strings. E.g. '00'

  return dateTime.length == 1 ? '0' + dateTime : dateTime;
};;"use strict";

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

// Create the render function for the custom low estimates widget
var renderLowEstimates = function renderLowEstimates(renderOptions, isFirstRender) {
  var start = renderOptions.start,
      range = renderOptions.range,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;

  var _start = _slicedToArray(start, 2),
      min = _start[0],
      max = _start[1];

  if (isFirstRender) {
    var _input = document.createElement('input');

    _input.type = 'number';
    _input.name = widgetParams.placeholder.toLowerCase();
    _input.placeholder = widgetParams.placeholder;
    _input.value = Number.isFinite(min) ? min : '';

    _input.addEventListener('input', function (event) {
      event.preventDefault(); // Get the min value from the input

      var rawMinInputValue = parseFloat(event.target.value); // Update search results - no max result is set
      // Only lots with an estimate greater than the price set in the url parameter are returned

      refine([Number.isFinite(rawMinInputValue) ? rawMinInputValue : undefined, //min
      undefined]);
    });

    widgetParams.container.appendChild(_input);
  }

  var input = widgetParams.container.querySelector('input');
  input.value = Number.isFinite(min) ? min : '';
}; // Create the high estimates widget


var customLowEstimates = instantsearch.connectors.connectRange(renderLowEstimates); // Create the render function for the custom low estimates widget

var renderHighEstimates = function renderHighEstimates(renderOptions, isFirstRender) {
  var start = renderOptions.start,
      range = renderOptions.range,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;

  var _start2 = _slicedToArray(start, 2),
      min = _start2[0],
      max = _start2[1];

  if (isFirstRender) {
    var _input2 = document.createElement('input');

    _input2.type = 'number';
    _input2.name = widgetParams.placeholder.toLowerCase();
    _input2.placeholder = widgetParams.placeholder;
    _input2.value = Number.isFinite(max) ? max : '';

    _input2.addEventListener('input', function (event) {
      event.preventDefault(); // Get the max value from the input

      var rawMaxInputValue = parseFloat(event.target.value); // Update search results - no min result is set
      // Only lots with an estimate lower than the price set in the url parameter are returned

      refine([undefined, //min
      Number.isFinite(rawMaxInputValue) ? rawMaxInputValue : undefined]);
    });

    widgetParams.container.appendChild(_input2);
  }

  var input = widgetParams.container.querySelector('input');
  input.value = Number.isFinite(max) ? max : '';
}; // Create the high estimates widget


var customHighEstimates = instantsearch.connectors.connectRange(renderHighEstimates);;"use strict";

function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }

var renderPrefix = function renderPrefix(renderOptions, isFirstRender) {
  // Setup our variables
  var refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams; //

  var container = widgetParams.container,
      searchParameters = widgetParams.searchParameters; //

  _objectDestructuringEmpty(searchParameters); //
  // When the widget is first loaded insert the default html and event listeners


  if (isFirstRender && container) {
    container.innerHTML = "\n            <div class=\"ais-RefinementList\">\n                <ul class=\"ais-RefinementList-list\">\n                    <li class=\"ais-RefinementList-item\">\n                        <div><a href=\"javascript:void(0);\" class=\"facet-item ".concat(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? 'ui checkbox' : '', "\">\n                        <input type=\"checkbox\" class=\"ais-RefinementList-checkbox\" value=\"false\">\n                        <label>").concat(saytVM.widgets.exactMatchesOnlyLabel, "</label>\n                        </a></div>\n                    </li>\n                </ul>\n            </div>\n        "); //
    // Update results when option is clicked

    var option = container.querySelector('a.facet-item');
    option.addEventListener("click", function (event) {
      var chkBox; // Make sure we are getting the checkbox input and not the parent hyperlink

      switch (event.target.tagName) {
        case 'A':
          chkBox = event.target.querySelector('input[type="checkbox"]');
          break;

        case 'LABEL':
          chkBox = event.target.parentElement.querySelector('input[type="checkbox"]');
          break;

        case 'INPUT':
          chkBox = event.target;
      } // Update the state of the checkbox


      var val = chkBox.value == 'true' ? true : false;
      chkBox.value = !val;
      chkBox.checked = !val; // Update results

      if (val) {
        // Checkbox is unchecked, so allow for typos and show all matching results
        refine({
          queryType: 'prefixLast',
          typoTolerance: 'min'
        });
      } else {
        // Checkbox is checked, so exact matches and suppress typos
        refine({
          queryType: 'prefixNone',
          typoTolerance: false
        });
      }
    });
  }
};

var customPrefix = instantsearch.connectors.connectConfigure(renderPrefix);;"use strict";

function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }

var d, pc, c; //

var renderLocation = function renderLocation(renderOptions, isFirstRender) {
  var refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container,
      distances = widgetParams.distances,
      countries = widgetParams.countries,
      subtitle = widgetParams.subtitle,
      separator = widgetParams.separator,
      postCodePlaceholder = widgetParams.postCodePlaceholder,
      searchParameters = widgetParams.searchParameters;

  _objectDestructuringEmpty(searchParameters);

  if (isFirstRender) {
    var _div = document.createElement('div');

    _div.setAttribute('class', 'customLocationFacet');

    _div.innerHTML = "<div><label>".concat(subtitle, "</label></div>\n        <div class=\"first-row\">\n            <div class=\"field\"><select class=\"").concat(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? 'ui dropdown filters-dropdown' : '', "\" id=\"FilteredSearch_distancelocation\" name=\"FilteredSearch_distancelocation\">").concat(setDistanceOptions(distances), "</select></div>\n            <div><label>").concat(separator, "</label></div>\n            <div class=\"field\"><input id=\"FilteredSearch_postCodelocation\" name=\"FilteredSearch_postCodelocation\" value=\"\" type=\"text\" maxlength=\"20\" placeholder=\"").concat(postCodePlaceholder, "\" /></div>\n        </div>\n        <div class=\"second-row\">\n            <div class=\"field\"><select class=\"").concat(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? 'ui dropdown filters-dropdown' : '', "\" id=\"FilteredSearch_countrylocation\" name=\"FilteredSearch_countrylocation\">").concat(countries.map(function (item) {
      return "<option value=\"".concat(item.Code, "\">").concat(item.Name, "</option>");
    }).join(''), "</select></div>\n            <div><button id=\"FilteredSearch_submit\" type=\"submit\" class=\"button\" disabled><i class=\"icon-search\"></i></button></div>\n        </div>\n        <div class=\"third-row\">\n            <div class=\"field field-error\">\n                <span></span>\n            </div>\n        </div>\n        <a rel=\"nofollow\" id=\"FilteredSearch_FilteredSearch_location_Clear\" class=\"button button-remove\" href=\"\"><span class=\"a11y\">Remove filter</span></a>\n        ");

    var distSelect = _div.querySelector('#FilteredSearch_distancelocation');

    var postcodeInput = _div.querySelector('#FilteredSearch_postCodelocation');

    var countrySelect = _div.querySelector('#FilteredSearch_countrylocation');

    var submitBtn = _div.querySelector('#FilteredSearch_submit');

    var clearBtn = _div.querySelector('#FilteredSearch_FilteredSearch_location_Clear');

    distSelect.addEventListener('change', function (event) {
      // Update distance
      d = event.target.value;
      validationHandler();
    });
    postcodeInput.addEventListener('input', function (event) {
      // Update postcode
      pc = event.target.value;
      validationHandler();
    });
    countrySelect.addEventListener('change', function (event) {
      // Update country
      c = event.target.value;
      validationHandler();
    });
    submitBtn.addEventListener('click', function (event) {
      locSearchSubmit();
    });
    window.addEventListener('load', function (event) {
      // Get params from url and refine results
      window.location.search.split('&').map(function (param) {
        var nameValPair = param.split('='); // Check if we have already filtered by location and update values if needed

        switch (nameValPair[0].toLowerCase()) {
          case 'distancelocation':
            d = nameValPair[1];
            distSelect.value = d;
            break;

          case 'postcodelocation':
            pc = nameValPair[1];
            postcodeInput.value = decodeURIComponent(pc);
            break;

          case 'countrylocation':
            c = nameValPair[1];
            countrySelect.value = c;
            break;
        }

        return param;
      });

      if (checkInputsAreFilled(d, pc, c)) {
        var longLat = getLongLat(pc, c); // Lookup the postcode to get the longitude and latitude values

        if (typeof longLat !== 'undefined') {
          longLat.done(function (result) {
            // Once we have a longitude and latitude, update results
            if (result !== false) {
              toggleError();
              refine({
                aroundLatLng: result.reverse(),
                // Algolia requires latitude first, then longitude
                aroundRadius: d * 1000 // Set radius

              });
            } // Show error message if there is no result
            else {
                toggleError(portalScriptResources.IncorrectPostCodeCountry);
              }
          }) // If there is a problem with the ajax call
          .fail(function (error) {
            toggleError(error);
          });
        } // If postcode invalid or the postcode/country combination display error message to use
        else {
            toggleError(portalScriptResources.IncorrectPostCodeCountry);
          }

        container.parentNode.classList.add('filter-group--selected');
        var newloc = constructNewUrl();
        clearBtn.href = newloc;
        clearBtn.style.display = 'block';
      } else {
        container.parentNode.classList.remove('filter-group--selected');
        clearBtn.href = '';
        clearBtn.style.display = 'none';
      }
    });
    container.appendChild(_div);
  }

  ;
  var div = container.querySelector('.customLocationFacet'); // Get values from form

  d = div.querySelector('#FilteredSearch_distancelocation').value;
  pc = div.querySelector('#FilteredSearch_postCodelocation').value;
  c = div.querySelector('#FilteredSearch_countrylocation').value;
};

var renderLocationNewUiSkin = function renderLocationNewUiSkin(renderOptions, isFirstRender) {
  var refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container,
      distances = widgetParams.distances,
      countries = widgetParams.countries,
      subtitle = widgetParams.subtitle,
      separator = widgetParams.separator,
      postCodePlaceholder = widgetParams.postCodePlaceholder,
      searchParameters = widgetParams.searchParameters;

  _objectDestructuringEmpty(searchParameters);

  if (isFirstRender) {
    var _div2 = document.createElement('div');

    _div2.setAttribute('class', 'customLocationFacet');

    _div2.innerHTML = "\n        <div class=\"second-row\">\n        <div class=\"field\"><select class=\"".concat(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? 'ui dropdown filters-dropdown' : '', "\" id=\"FilteredSearch_countrylocation\" name=\"FilteredSearch_countrylocation\">").concat(countries.map(function (item) {
      return "<option value=\"".concat(item.Code, "\">").concat(item.Name, "</option>");
    }).join(''), "</select></div>\n        </div>\n        <div><label>").concat(subtitle, "</label></div>\n        <div class=\"first-row\">\n            <div class=\"field\"><select class=\"").concat(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? 'ui dropdown filters-dropdown' : '', "\" id=\"FilteredSearch_distancelocation\" name=\"FilteredSearch_distancelocation\">").concat(setDistanceOptions(distances), "</select></div>\n            <div><label>").concat(separator, "</label></div>\n            <div class=\"field\"><input id=\"FilteredSearch_postCodelocation\" name=\"FilteredSearch_postCodelocation\" value=\"\" type=\"text\" maxlength=\"20\" placeholder=\"").concat(postCodePlaceholder, "\" /></div>\n        </div>\n        <div class=\"third-row\">\n            <div class=\"field field-error\">\n                <span></span>\n            </div>\n        </div>\n        <div><button id=\"FilteredSearch_submit\" type=\"submit\" class=\"button\" disabled>Apply</button></div>\n        <a rel=\"nofollow\" id=\"FilteredSearch_FilteredSearch_location_Clear\" class=\"button button-remove\" href=\"\"><span class=\"a11y\">Remove filter</span></a>\n        ");

    var distSelect = _div2.querySelector('#FilteredSearch_distancelocation');

    var postcodeInput = _div2.querySelector('#FilteredSearch_postCodelocation');

    var countrySelect = _div2.querySelector('#FilteredSearch_countrylocation');

    var submitBtn = _div2.querySelector('#FilteredSearch_submit');

    var clearBtn = _div2.querySelector('#FilteredSearch_FilteredSearch_location_Clear');

    distSelect.addEventListener('change', function (event) {
      // Update distance
      d = event.target.value;
      validationHandler();
    });
    postcodeInput.addEventListener('input', function (event) {
      // Update postcode
      pc = event.target.value;
      validationHandler();
    });
    countrySelect.addEventListener('change', function (event) {
      // Update country
      c = event.target.value;
      validationHandler();
    });
    submitBtn.addEventListener('click', function (event) {
      locSearchSubmit();
    });
    window.addEventListener('load', function (event) {
      // Get params from url and refine results
      window.location.search.split('&').map(function (param) {
        var nameValPair = param.split('='); // Check if we have already filtered by location and update values if needed

        switch (nameValPair[0].toLowerCase()) {
          case 'distancelocation':
            d = nameValPair[1];
            distSelect.value = d;
            break;

          case 'postcodelocation':
            pc = nameValPair[1];
            postcodeInput.value = decodeURIComponent(pc);
            break;

          case 'countrylocation':
            c = nameValPair[1];
            countrySelect.value = c;
            break;
        }

        return param;
      });

      if (checkInputsAreFilled(d, pc, c)) {
        var longLat = getLongLat(pc, c); // Lookup the postcode to get the longitude and latitude values

        if (typeof longLat !== 'undefined') {
          longLat.done(function (result) {
            // Once we have a longitude and latitude, update results
            if (result !== false) {
              toggleError();
              refine({
                aroundLatLng: result.reverse(),
                // Algolia requires latitude first, then longitude
                aroundRadius: d * 1000 // Set radius

              });
            } // Show error message if there is no result
            else {
                toggleError(portalScriptResources.IncorrectPostCodeCountry);
              }
          }) // If there is a problem with the ajax call
          .fail(function (error) {
            toggleError(error);
          });
        } // If postcode invalid or the postcode/country combination display error message to use
        else {
            toggleError(portalScriptResources.IncorrectPostCodeCountry);
          }

        container.parentNode.classList.add('filter-group--selected');
        var newloc = constructNewUrl();
        clearBtn.href = newloc;
        clearBtn.style.display = 'block';
      } else {
        container.parentNode.classList.remove('filter-group--selected');
        clearBtn.href = '';
        clearBtn.style.display = 'none';
      }
    });
    container.appendChild(_div2);
  }

  ;
  var div = container.querySelector('.customLocationFacet'); // Get values from form

  d = div.querySelector('#FilteredSearch_distancelocation').value;
  pc = div.querySelector('#FilteredSearch_postCodelocation').value;
  c = div.querySelector('#FilteredSearch_countrylocation').value;
};

var customLocation = instantsearch.connectors.connectConfigure(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? renderLocationNewUiSkin : renderLocation); // Helper functions
//

var checkInputsAreFilled = function checkInputsAreFilled(d, pc, c) {
  if (typeof d === 'undefined' || typeof pc === 'undefined' || typeof c === 'undefined') return false;
  return d !== '' && pc !== '' && pc.length > 2 && c !== '' && c !== '-';
}; //


var createUrlLocParams = function createUrlLocParams() {
  if (checkInputsAreFilled(d, pc, c)) {
    var newUrl = window.location.pathname; //

    var newloc = constructNewUrl(); // Add location specific parameters

    newloc += '&distancelocation=' + d + '&postcodelocation=' + pc + '&countrylocation=' + c + '&sortterm=distance'; // Update url

    if (saytVM.featureSwitch.isLandingPage && newUrl.endsWith('search-filter') && !newloc.startsWith('?')) {
      newUrl += '?';
    }

    newUrl += newloc; //

    return newUrl;
  }

  return '';
}; //


var getLongLat = function getLongLat() {
  // Use geoCode service to get coordinates
  return $.ajax({
    method: 'GET',
    url: saytVM.geosearch.geoCodeService,
    contentType: 'application/json; charset=utf-8',
    data: {
      countryCode: c,
      postalCode: pc
    },
    dataType: 'json',
    success: function success(response) {
      return response;
    },
    error: function error(_error) {
      return _error;
    }
  });
}; //


var validationHandler = function validationHandler() {
  setTimeout(function () {
    // Check if values have been entered for all inputs
    if (checkInputsAreFilled(d, pc, c)) {
      var checkLatLongIsValid = getLongLat();

      if (typeof checkLatLongIsValid !== 'undefined') {
        checkLatLongIsValid.done(function (result) {
          // Once we have a longitude and latitude, update results
          if (result !== false) {
            toggleError();
            return result;
          } // Show error message if there is no result
          else {
              toggleError(portalScriptResources.IncorrectPostCodeCountry);
              return false;
            }
        }) // If there is a problem with the ajax call
        .fail(function (error) {
          toggleError(error);
          return false;
        });
      } // If postcode or the postcode/country combination is invalid, display error message to use
      else {
          toggleError(portalScriptResources.IncorrectPostCodeCountry);
          return false;
        }
    } // Otherwise prompt user to enter info
    else {
        toggleError(portalScriptResources.PleaseSetPostCodeAndCountry);
        return false;
      }
  }, 1000);
  return false;
}; //


var toggleError = function toggleError(errMsg) {
  var submitBtn = document.querySelector('.customLocationFacet #FilteredSearch_submit');
  var errContainer = document.querySelector('.customLocationFacet .field.field-error');
  var postcodeInput = document.querySelector('.customLocationFacet #FilteredSearch_postCodelocation');

  if (typeof errMsg === 'undefined') {
    errContainer.innerHTML = '';
    errContainer.style.display = 'none';
    postcodeInput.classList.remove('isInvalid');
    submitBtn.disabled = false;
  } else {
    errContainer.innerHTML = "<span>".concat(errMsg, "</span>");
    errContainer.style.display = 'block';
    postcodeInput.classList.add('isInvalid');
    postcodeInput.focus();
    submitBtn.disabled = true;
  }
}; //


var constructNewUrl = function constructNewUrl() {
  var ignoreParams = ['distancelocation', 'postcodelocation', 'countrylocation', 'sortterm'];
  var i = 0;
  var url = window.location.search.substr(1).split('&').map(function (param) {
    var nameValPair = param.split('='); // Check if we have already filtered by location and ignore any location params in url

    if (ignoreParams.indexOf(nameValPair[0].toLowerCase()) == -1) {
      // if this is the first matching param, insert the ? otherwise include the &
      if (i == 0) {
        i++;
        return '?' + param;
      } else {
        i++;
        return '&' + param;
      }
    }
  }).join('');
  return url;
}; //


var locSearchSubmit = function locSearchSubmit() {
  if (!validationHandler()) {
    window.location.replace(createUrlLocParams());
  }
}; //


var setDistanceOptions = function setDistanceOptions(options) {
  if (typeof options === 'undefined') return;
  return options.map(function (item) {
    return "<option value=\"".concat(item.Kilomiters, "\">").concat(item.Name, "</option>");
  }).join('');
};;"use strict";

var SEARCHFORMID = 'main-search-form';
var SEARCHBOXID = 'main-search-term';
var SEARCHBTNID = 'main-search_btn';
var OVERLAYCLASSNAME = 'aa-dropdown-menu'; // Rendering of the overlay

var renderAutocomplete = function renderAutocomplete(renderOptions, isFirstRendering) {
  var indices = renderOptions.indices,
      currentRefinement = renderOptions.currentRefinement,
      refine = renderOptions.refine,
      widgetParams = renderOptions.widgetParams;
  var container = widgetParams.container,
      recentSearches = widgetParams.recentSearches;
  var showSuggestedSearches = saytVM.config.showSuggestedSearches.toLowerCase() == 'true' ? true : false;

  if (showOverlayOnSearchResults) {
    showSuggestedSearches = showOverlayOnSearchResults;
  }

  var searchInputIcon = "";

  if (saytVM.featureSwitch.isNewSkinForEnhanceSearchEnabled) {
    searchInputIcon = "<i id=\"search-input-icon\" class=\"material-icons\">search</i>";
  }

  if (container) {
    if (isFirstRendering) {
      // existing js to populate recent searches in local storage
      var autoAddRecentAndSubmit = function autoAddRecentAndSubmit() {
        // submit handler for search box
        var searchTerm = stripHtmlTagStartEnd(_input.value); // strip html from query

        if (searchTerm.length > 0) {
          ors.storeTerm(); // add term to local storage to display in recent searches drop-down
        }

        _holder.style.display = 'none'; // hide overlay

        var newQueryUrl = saytVM.overlay.searchResultsURL.replace('$query$', searchTerm); // reload page with new search term

        window.location.assign(newQueryUrl);
      };

      if (container.querySelector('.algolia-autocomplete')) {
        container.querySelector('.algolia-autocomplete').remove(); // clear any previous overlays
      }

      container.innerHTML = "\n            <div class=\"main-search\">\n            <fieldset class=\"lot-search\">\n            <legend class=\"hide\">".concat(saytVM.searchbox.searchForLotsLabel, "</legend>\n            <form id=\"").concat(SEARCHFORMID, "\" action role=\"search\" class=\"").concat(SEARCHFORMID, "\" novalidate>\n            <span class=\"algolia-autocomplete\" style=\"position: relative; display: inline-block; direction: ltr;\">\n            ").concat(searchInputIcon, "\n            <input id=\"").concat(SEARCHBOXID, "\" class=\"").concat(SEARCHBOXID, " top-nav-search autocomplete-input\" type=\"search\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" maxlength=\"512\" placeholder=\"").concat(saytVM.searchbox.searchInputPlaceholder, "\"  data-gap-ac-url=\"").concat(saytVM.searchbox.autocompleteAction, "\" />         \n            <button id=\"").concat(SEARCHBTNID, "\" class=\"main-search-submit search-button\" type=\"submit\" aria-label=\"search-button\"><i class=\"icon icon-search\"></i></button>\n            <span id=\"algolia-autocomplete-listbox-0\" class=\"").concat(OVERLAYCLASSNAME, "\" role=\"listbox\"><div class=\"aa-dataset-1\"></div></span>\n            </span>\n            </form></fieldset></div>\n        ");

      var _input = container.querySelector("#".concat(SEARCHBOXID));

      var _holder = container.querySelector(".".concat(OVERLAYCLASSNAME));

      _input.addEventListener('focus', function (event) {
        // Show overlay when customer clicks into search box
        event.preventDefault();

        if (typeof recentSearches !== 'undefined' && event.target.value.length == 0 || showSuggestedSearches) {
          _holder.style.display = 'block'; // ensure overlay is visible
        }
      });

      _input.addEventListener('input', function (event) {
        // When a customer types in a search term
        event.preventDefault();

        if (showSuggestedSearches || typeof recentSearches !== 'undefined' && event.target.value.length == 0) {
          refine(event.target.value); // update search results as the customer types the query              

          _holder.style.display = 'block'; // ensure overlay is visible
        } else {
          _holder.style.display = 'none'; // hide overlay
        }
      });

      var _searchForm = container.querySelector("#".concat(SEARCHFORMID));

      var searchBtn = container.querySelector("#".concat(SEARCHBTNID));
      searchBtn.addEventListener('click', function (event) {
        // Update search on button click
        event.preventDefault();
        autoAddRecentAndSubmit();
      });

      _searchForm.addEventListener('submit', function (event) {
        // Update search when form is submitted
        event.preventDefault();
        autoAddRecentAndSubmit();
      });

      window.addEventListener('click', function (event) {
        var hideOverlay;
        var n = event.target;

        while (n != document) {
          // loop through parent items until we reach the root
          if (n == _input || n == _holder) {
            // if current item is search box or overlay don't hide overlay and exit loop
            hideOverlay = false;
            break;
          } else {
            hideOverlay = true; // if no match set flag to hide overlay
          }

          if (n.parentNode) {
            n = n.parentNode; // get parent of current item under eval
          } else {
            break;
          }
        }

        if (hideOverlay) {
          _holder.style.display = 'none'; // Hide overlay
        }
      });
      var ors = new GapRecentlySearched("#".concat(SEARCHFORMID), autoAddRecentAndSubmit);
    }

    var searchForm = container.querySelector("#".concat(SEARCHFORMID));
    searchForm.action = saytVM.overlay.searchResultsURL.replace('$query$', currentRefinement); // update form action as input changes

    var input = container.querySelector("#".concat(SEARCHBOXID));
    var holder = container.querySelector(".".concat(OVERLAYCLASSNAME));
    holder.innerHTML = indices.map(function (index) {
      switch (index.label) {
        case 'primary':
          // we need queryid and indexname for search analytics
          CLICK_ON_SEARCH_RESULT_EVENT = "click_on_overlay";
          var queryID = index.results ? index.results.queryID : "";
          var pageStart = index.results ? index.results.page * index.results.hitsPerPage : 0;
          var hitsPerPage = index.results ? index.results.hitsPerPage : 0;
          var nbPages = index.results ? index.results.nbPages : 0;
          var page = index.results ? index.results.page : 0;
          var rr = index.results ? index.results._rawResults[0] : '';
          var params = rr != '' ? rr.params : '';
          var indexUsed = rr != '' ? rr.indexUsed : index.index;
          var abTestId = rr != '' ? rr.abTestID : 0;
          var abVariantId = rr != '' ? rr.abTestVariantID : 0;
          storeIndexUsed(indexUsed, abTestId, abVariantId);
          AppInisghtsTrackSearchClick(ALGOLIA_APP_INSIGHTS_SERVICE_NAME, queryID, index.index, "algolia-search", currentRefinement, index.hits.length, hitsPerPage, nbPages, page, params, indexUsed, abTestId, abVariantId);
          return renderIndexListItem(index, queryID, pageStart);
          break;

        case 'suggestions':
          if (typeof recentSearches !== 'undefined' && (input.value.length == 0 || !showSuggestedSearches)) {
            return renderRecentSearches(recentSearches, currentRefinement);
          } else {
            return renderIndexSuggestion(index, currentRefinement);
          }

          break;
      }
    }).join('');
    var suggestedResults = container.querySelector('#resultsOverlay');

    if (suggestedResults) {
      suggestedResults.addEventListener('click', function (event) {
        // add click handler to search results container
        hitClickEvent(event);
      });
    }
  }
}; // Create widget


var customAutocomplete = instantsearch.connectors.connectAutocomplete(renderAutocomplete); // Helpers

var emptyResults = function emptyResults(lbl) {
  return "<div class=\"empty\">".concat(lbl, "</div>");
};

var renderIndexListItem = function renderIndexListItem(index, queryID, pageStart) {
  var or = "<div class=\"aa-".concat(index.label, "\">"); // if there are results to show

  if (index.hits.length > 0) {
    // templates for header and footer
    var title = saytVM.overlay.topLotsLabel;

    if (index.results.query.length > 0) {
      title = title.replace('$SearchTerm$', "<strong>".concat(index.results._state.query, "</strong>"));
    } else {
      title = saytVM.overlay.topResultsLabel;
    }

    var header = "<div class=\"colHeader\"><h3>".concat(title, "</h3></div>");
    var footer = "<div class=\"colFooter\"><a href=\"".concat(encodeURI(saytVM.overlay.searchResultsURL.replace('$query$', index.results._state.query)), "\" class=\"button primary\" ").concat(storeTermInRecentSearches(index.results._state.query) ? "onClick=\"manualAddRecentAndSubmit('".concat(index.results._state.query, "')\"") : "", ">").concat(saytVM.overlay.viewAllItemsLabel.replace('$nbHits$', index.results.nbHits), "</a></div>"); // template for hits

    or += "".concat(header, "<div id=\"resultsOverlay\">").concat(index.hits.map(function (item, position) {
      var itemTitle = saytVM.searchResults.substituteTitleWithDescription ? truncateAtWord(snippetDescStripHTML(item.description, true), saytVM.searchResults.titleMaxLength) : item._highlightResult ? item._highlightResult.title.value : decode(item.title);
      return "<article class=\"panel item\"\n                           data-auction-ref=\"".concat(item.auctionRef, "\"\n                           data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\"\n                           data-index=\"").concat(index.index, "\" \n                           data-position=\"").concat(position, "\"\n                           data-queryID=\"").concat(queryID, "\"\n                           data-page-start=\"").concat(pageStart, "\"\n                           data-lot-id=\"").concat(item.objectID, "\">\n                        <div class=\"lot-single\" id=\"lot-").concat(item.objectID, "\" data-position=\"").concat(position, "\" data-auction-ref=\"").concat(item.auctionRef, "\" data-auction-type=\"").concat(item.auctionType.toLowerCase(), "\" data-bidding-type=\"competitive\" data-bidder-id=\"\" data-customer-id=\"\">\n                        ").concat(showImageTemplate(item, true, index.results._state.query), "\n                        <div class=\"main\">\n                            <div class=\"lot-header\">\n                                <h3><a id=\"overlayLot-").concat(item.objectID, "\" href=\"").concat(lotDetailsUrl(item), "\" class=\"a-wrapped update-history-url-after-back click-track\" data-click-type=\"title\" data-lot-id=\"").concat(item.lotNumber, "\"\n                                ").concat(storeTermInRecentSearches(index.results._state.query) ? "onClick=\"manualAddRecentAndSubmit('".concat(index.results._state.query, "')\"") : "", ">").concat(item.title, "</a></h3>\n                            </div>\n                            <div class=\"main-buttons\">\n                                ").concat(renderAuctionType(item), "\n                            </div>\n                        </div>\n                        <aside>\n                            <div class=\"lot-details-wrapper\">\n                                <ul class=\"lot-details\">\n                                    ").concat(bidInfo(item, true), "\n                                </ul>\n                            </div>\n                            <footer>\n                                ").concat(renderLotDates(item), "\n                                ").concat(renderLotLocation(item), "\n                            </footer>\n                        </aside>\n                        </div>\n                        </article>");
    }).join(''), "</div>").concat(footer);
  } // Otherwise show appropriate message
  else {
      or += emptyResults(saytVM.overlay.noResultsLabel);
    } // don't forget to close tag


  or += "</div>"; //

  return or;
};

var renderIndexSuggestion = function renderIndexSuggestion(index, currentRefinement) {
  var os = "<aside class=\"aa-".concat(index.label, "\">"); // template for header

  var header = "<div class=\"colHeader\"><h3>".concat(saytVM.overlay.suggestedSearchesLabel, "</h3></div>"); // if there are results to show

  if (index.hits.length > 0) {
    // template for hits
    os += "".concat(header, "<div><ul>").concat(index.hits.slice(0, 15).map(function (item) {
      var activeItem = typeof currentRefinement !== 'undefined' && item.query == currentRefinement ? true : false;
      return "<li><a id=\"overlaySuggested-".concat(item.query, "\" href=\"").concat(saytVM.overlay.searchResultsURL.replace('$query$', item.query), "\" ").concat(storeTermInRecentSearches(item.query) ? "onClick=\"manualAddRecentAndSubmit('".concat(item.query, "')\"") : "", " class=\"").concat(activeItem ? 'active' : '', "\">").concat(item._highlightResult ? item._highlightResult.query.value : item.query, "</a></li>");
    }).join(''), "</ul></div>");
  } // otherwise show appropriate message
  else {
      os += "".concat(header).concat(emptyResults('<p>No suggestions</p>'));
    } // don't forget to close tag


  os += "</aside>"; //

  return os;
};

var renderRecentSearches = function renderRecentSearches(rsList, currentRefinement) {
  if (typeof rsList === 'undefined') return '';
  var or = "<aside class=\"aa-recentSearches\">"; // if there are results to show

  if (rsList.length > 0) {
    // template for header
    var header = "<div class=\"colHeader\"><h3>Recent searches</h3></div>"; // template for hits

    or += "".concat(header, "<div><ul>").concat(rsList.slice(0, 15).map(function (item) {
      var activeItem = typeof currentRefinement !== 'undefined' && item == currentRefinement ? true : false;
      return "<li><a id=\"overlayRecent-".concat(item, "\" href=\"").concat(saytVM.overlay.searchResultsURL.replace('$query$', item), "\" ").concat(storeTermInRecentSearches(item) ? "onClick=\"manualAddRecentAndSubmit('".concat(item, "')\"") : "", " class=\"").concat(activeItem ? 'active' : '', "\">").concat(activeItem ? "<mark>".concat(item, "</mark>") : item, "</a></li>");
    }).join(''), "</ul></div>");
  } // otherwise show appropriate message
  else {
      or += emptyResults('<p>No searches</p>');
    } // don't forget to close tag


  or += "</aside>"; //

  return or;
};

function manualAddRecentAndSubmit(query) {
  var input = document.querySelector("#".concat(SEARCHFORMID, " #").concat(SEARCHBOXID));
  var ors = new GapRecentlySearched("#".concat(SEARCHFORMID));

  if (typeof query != 'undefined') {
    // Strip html from term
    var searchTerm = stripHtmlTagStartEnd(query); // Update search input

    input.value = searchTerm; // Add term to local storage to display in recent searches drop-down

    ors.storeTerm(); // Reload page with new search term

    var newQueryUrl = saytVM.overlay.searchResultsURL.replace('$query$', searchTerm);
    window.location.assign(newQueryUrl);
  }
}

var storeTermInRecentSearches = function storeTermInRecentSearches(query) {
  var store = false;

  if (typeof query !== 'undefined') {
    switch (query.length) {
      case 0:
        store = false;
        break;

      case 1:
        if (query == '*' || query == ' ') {
          store = false;
        } else {
          store = true;
        }

        break;

      default:
        store = true;
    }
  }

  return store;
};;"use strict";

var s = 'suggestions'; //

var UNKNOWN_USER_TOKEN = '111111111';
var userToken = dataLayer && dataLayer[0] && dataLayer[0].globalId ? dataLayer[0].globalId : UNKNOWN_USER_TOKEN;
addClickAnalytics(); //

var searchClient = algoliasearch(saytVM.config.searchClientId, saytVM.config.searchClientKey);
var showOverlayOnSearchResults = false;

if (sessionStorage) {
  if (sessionStorage.showOverlayOnSearchResults) {
    showOverlayOnSearchResults = sessionStorage.showOverlayOnSearchResults.toLowerCase() == 'true' ? true : false;
  }
} //


function runOverlay() {
  var RSKEY = 'gap-recent-searches';

  var getRecentSearches = function getRecentSearches(key) {
    if (localStorage.getItem(key)) {
      // get recent searches
      return JSON.parse(localStorage.getItem(key));
    }
  };

  var latestRecentSearch = getRecentSearches(RSKEY) ? getRecentSearches(RSKEY)[0] : '';
  var saytOverlay = instantsearch({
    indexName: saytVM.config.indexName,
    searchClient: searchClient,
    searchParameters: {
      clickAnalytics: true,
      hitsPerPage: 6,
      analyticsTags: ['overlay']
    },
    searchFunction: function searchFunction(helper) {
      // when overlay loads, populate top matching lots with most recent search query
      if (latestRecentSearch.length > 0 && helper.state.query.length == 0) {
        helper.setQuery(latestRecentSearch);
      } // maintain paging - this always needs to be done first


      var page = helper.getPage(); // add any facet values to exclude lots from the results

      helper = setExclusionFacets(helper); // perform search with new query

      helper.setQuery(helper.state.query).setPage(page).search();
    }
  }); // 

  saytOverlay.client.setUserToken(userToken); //
  // Add overlay widget to the search

  saytOverlay.addWidget(customAutocomplete({
    indices: [{
      label: s,
      value: "".concat(saytVM.config.indexName, "_").concat(s)
    }],
    container: document.querySelector('#searchPlaceholder'),
    searchAsYouType: saytVM.config.searchAsYouTypeOn.toLowerCase() == 'true' ? true : false,
    recentSearches: getRecentSearches(RSKEY)
  })); //
  //

  saytOverlay.start(); //

  saytOverlay.on('error', function (event) {
    // Hide overlay, search box will still function
    var container = document.querySelector('.aa-dropdown-menu');
    container.style.display = 'none';
  });
}

;

function setEnhancedSearchSessions(esActive, showSearchOnOverlay) {
  var enhancedSearchActiveSessionVar = 'esActive';
  var enhancedSearchOverlayOnSearchSessionVar = 'showOverlayOnSearchResults';
  var enhancedSearchActivationCookieName = 'esactivation';

  function isSessionStorageSupported() {
    var storage = window.sessionStorage;

    try {
      storage.setItem('test', 'test');
      storage.removeItem('test');
      return true;
    } catch (e) {
      return false;
    }
  }

  if (isSessionStorageSupported()) {
    sessionStorage.setItem(enhancedSearchActiveSessionVar, esActive);
    sessionStorage.setItem(enhancedSearchOverlayOnSearchSessionVar, showSearchOnOverlay);
  }
};"use strict";

var typoTolerance = false;

function runSearchResults() {
  var queryDivider = '%20'; //

  var saytSearchResults = instantsearch({
    indexName: saytVM.config.indexName,
    searchClient: searchClient,
    searchParameters: {
      clickAnalytics: true,
      getRankingInfo: true,
      analyticsTags: ['search']
    },
    routing: saytVM.featureSwitch.isLandingPage ? searchRoutingOnLandingPage(routingHelper) : searchRouting(routingHelper),
    searchFunction: function searchFunction(helper) {
      // maintain paging - this always needs to be done first
      var page = helper.getPage(); // parse the query and add optional words

      var sanitisedQuery = searchTermParser(helper.state.query, queryDivider);
      var optionalWords = addOptionalWords(sanitisedQuery, queryDivider); // add any facet values to exclude lots from the results

      helper = setExclusionFacets(helper); // perform search with new query

      helper.setQuery(sanitisedQuery) // add search terms to optional words array
      .setQueryParameter('optionalWords', optionalWords) // add end time filters
      .addNumericRefinement('endDateTimeUtc', '>=', calcTimestampYesterday()).addNumericRefinement('auctionEndDateTimeUtc', '>=', calcTimestampYesterday()) // reset page and perform new search
      .setPage(page).search();
    }
  }); //

  saytSearchResults.client.setUserToken(userToken); // add search box

  saytSearchResults.addWidget(customSearchbox({
    container: document.querySelector('#searchPlaceholder'),
    searchAsYouType: saytVM.config.searchAsYouTypeOn.toLowerCase() == 'true' ? true : false
  })); // show search results - must be before other widgets to detect typo-tolerance

  saytSearchResults.addWidget(customSearchResults({
    container: document.querySelector('#results')
  })); // add breadcrumb

  saytSearchResults.addWidget(customBreadCrumbs({
    container: document.querySelector('.primary-breadcrumb .active')
  })); // add result info about number of items controls

  saytSearchResults.addWidget(customResultsInfo({
    container: document.querySelector('#resultsInfoPlaceholder')
  })); // add page header (stats widget)

  saytSearchResults.addWidget(customResultsInfo({
    container: document.querySelector('#mobileNbHitsPlaceholder')
  }));
  saytSearchResults.addWidget(customPageHeader({
    container: document.querySelector('#pageHeaderPlaceholder')
  })); // add sort and view type controls

  saytSearchResults.addWidget(customSortByViewType({
    container: document.querySelector('#sortViewPlaceholder'),
    items: JSON.parse(saytVM.searchheader.sortOptions)
  })); // add sort for mobile

  saytSearchResults.addWidget(customSortMobile({
    container: document.querySelector('#sortMobilePlaceholder'),
    items: JSON.parse(saytVM.searchheader.sortOptions)
  })); // add page size controls in search header (hits per page widget)

  saytSearchResults.addWidget(customPageSize({
    container: document.querySelector('#hitsPerPageTopPlaceholder'),
    items: JSON.parse(saytVM.searchheader.pageSizeOptions),
    position: 'top'
  })); // add pagination controls in search header

  saytSearchResults.addWidget(customPagination({
    container: document.querySelector('#pagingTopPlaceholder'),
    position: 'top'
  })); // add page size controls in search footer (hits per page widget)

  saytSearchResults.addWidget(customPageSize({
    container: document.querySelector('#hitsPerPageBotPlaceholder'),
    items: JSON.parse(saytVM.searchheader.pageSizeOptions),
    position: 'bot'
  })); // add pagination controls in search footer

  saytSearchResults.addWidget(customPagination({
    container: document.querySelector('#pagingBotPlaceholder'),
    position: 'bot'
  })); // Add clear refinements btn

  saytSearchResults.addWidget(instantsearch.widgets.clearRefinements({
    container: '#clearFacetsPlaceholder',
    includedAttributes: ['hasImages', 'categoryCode', 'makes', 'items', 'countryName', 'auctionDisplayType', 'auctioneerName', 'lowEstimate', 'highEstimate'],
    templates: {
      resetLabel: saytVM.widgets.resetFiltersLabel
    }
  })); // Exact phrase widget

  saytSearchResults.addWidget(customPrefix({
    container: document.querySelector('#exactPhrasePlaceholder'),
    searchParameters: {
      queryType: 'prefixLast'
    }
  })); // Add images only facet

  saytSearchResults.addWidget(instantsearch.widgets.refinementList({
    container: '#hasImagePlaceholder',
    attribute: 'hasImages',
    operator: 'or',
    sortBy: ['name:desc'],
    templates: {
      item: facetTemplateCheckbox
    },
    transformItems: function transformItems(items) {
      return items.map(function (item) {
        switch (item.label) {
          case 'true':
            item.label = saytVM.widgets.imagesOnlyLabel;
            break;

          case 'false':
            item.label = saytVM.widgets.withoutImagesLabel;
            break;
        }

        ;
        return item;
      });
    }
  })); // Add low estimates facet

  saytSearchResults.addWidget(customLowEstimates({
    container: document.querySelector('#lowEstimatePlaceholder'),
    attribute: 'lowEstimate',
    placeholder: saytVM.widgets.minPlaceholder
  })); // Add high estimates facet

  saytSearchResults.addWidget(customHighEstimates({
    container: document.querySelector('#highEstimatePlaceholder'),
    attribute: 'highEstimate',
    placeholder: saytVM.widgets.maxPlaceholder
  })); // Add location facet

  saytSearchResults.addWidget(customLocation({
    container: document.querySelector('#locationPlaceholder'),
    distances: JSON.parse(saytVM.geosearch.distancesOptions),
    countries: JSON.parse(saytVM.geosearch.countryOptions),
    subtitle: saytVM.geosearch.withinLabel + ':',
    separator: saytVM.geosearch.ofLabel,
    postCodePlaceholder: saytVM.geosearch.postCodePlaceholder,
    searchParameters: {
      aroundLatLng: '',
      aroundRadius: '',
      minimumAroundRadius: 1000 //1KM

    }
  })); // Add category facet

  saytSearchResults.addWidget(instantsearch.widgets.refinementList({
    container: '#categoryPlaceholder',
    attribute: 'categoryCode',
    operator: 'or',
    limit: 5,
    showMore: true,
    searchable: false,
    searchablePlaceholder: saytVM.widgets.facetPlaceholderCategory,
    sortBy: ['isRefined', 'count:desc'],
    templates: {
      item: facetTemplateCheckbox,
      showMoreText: saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? showMoreTemplateNewUiSkin : showMoreTemplate
    },
    transformItems: function transformItems(items) {
      return window.categoryNameLookup ? items.map(function (item) {
        var catName = window.categoryNameLookup[item.label];
        if (catName) item.label = catName;
        return item;
      }) : items;
    }
  })); // Add master category facet

  saytSearchResults.addWidget(instantsearch.widgets.menu({
    container: '#masterCategoryPlaceholder',
    attribute: 'masterCategoryCode'
  })); // Add brand facet

  saytSearchResults.addWidget(instantsearch.widgets.refinementList({
    container: '#brandPlaceholder',
    attribute: 'makes',
    operator: 'or',
    limit: 5,
    showMore: true,
    searchable: true,
    searchablePlaceholder: saytVM.widgets.facetPlaceholderBrand,
    sortBy: ['isRefined', 'count:desc'],
    templates: {
      item: facetTemplateCheckbox,
      showMoreText: saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? showMoreTemplateNewUiSkin : showMoreTemplate
    }
  })); // Add item facet

  saytSearchResults.addWidget(instantsearch.widgets.refinementList({
    container: '#itemTypePlaceholder',
    attribute: 'items',
    operator: 'or',
    limit: 5,
    showMore: true,
    searchable: true,
    searchableIsAlwaysActive: true,
    searchablePlaceholder: saytVM.widgets.facetPlaceholderItemType,
    sortBy: ['isRefined', 'count:desc'],
    templates: {
      item: facetTemplateCheckbox,
      showMoreText: saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? showMoreTemplateNewUiSkin : showMoreTemplate
    }
  })); // Add country facet

  saytSearchResults.addWidget(instantsearch.widgets.refinementList({
    container: '#countryPlaceholder',
    attribute: 'countryName',
    operator: 'or',
    limit: 5,
    showMore: true,
    searchable: false,
    sortBy: ['isRefined', 'count:desc'],
    templates: {
      item: facetTemplateCheckbox,
      showMoreText: saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? showMoreTemplateNewUiSkin : showMoreTemplate
    }
  })); // Add auction type facet

  saytSearchResults.addWidget(instantsearch.widgets.menu({
    container: '#auctionTypePlaceholder',
    attribute: 'auctionDisplayType',
    limit: 5,
    showMore: false,
    searchable: false,
    sortBy: ['isRefined', 'count:desc'],
    templates: {
      item: facetTemplateCheckbox
    }
  })); // Add auctioneer facet

  saytSearchResults.addWidget(instantsearch.widgets.refinementList({
    container: '#auctioneerPlaceholder',
    attribute: 'auctioneerName',
    operator: 'or',
    limit: 5,
    showMore: true,
    searchable: true,
    searchablePlaceholder: saytVM.widgets.facetPlaceholderAuctioneer,
    sortBy: ['isRefined', 'name:asc'],
    templates: {
      item: facetTemplateCheckbox,
      showMoreText: saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? showMoreTemplateNewUiSkin : showMoreTemplate
    }
  })); // Add published date facet - auction alerts

  saytSearchResults.addWidget(customPublishedDateFrom({
    container: document.querySelector('#publishedDatePlaceholder'),
    attribute: 'publishedDateTimeUtc'
  })); //

  saytSearchResults.start(); // After the instantsearch has finished the initial render

  saytSearchResults.on('render', function () {
    // Find facets that have no refinements and hide them
    hideFacetNoRefinements(); // Return user to correct location in the search results

    returnToPrevLoc(); // Update wishlist states on page load

    updateWishListStatesOnPageLoad();
  });
}

; //

var facetTemplateCheckbox = "\n<a href=\"javascript:void(0);\" class=\"facet-item ".concat(saytVM.featureSwitch.isNewUiSkinSearchResultEnabled ? 'ui checkbox' : '', "\">\n<input type=\"checkbox\" class=\"{{cssClasses.checkbox}} \" value=\"{{value}}\" {{#isRefined}}checked{{/isRefined}} />\n<label>{{label}}<span class=\"facet-count\">({{count}})</span></label>\n</a>");
var showMoreTemplate = "{{#isShowingMore}}Show less \u25B2{{/isShowingMore}}{{^isShowingMore}}Show more \u25BC{{/isShowingMore}}";
var showMoreTemplateNewUiSkin = "\n{{#isShowingMore}}\nShow less <span class=\"material-icons\">keyboard_arrow_up</span>\n{{/isShowingMore}}{{^isShowingMore}}\nShow more <span class=\"material-icons\">keyboard_arrow_down</span>{{/isShowingMore}}"; //

var returnToPrevLoc = function returnToPrevLoc() {
  // Only return user to previous location, on page load
  // This is so that modifying the facets or pagination 
  // doesn't cause any flickering and unnecessary scrolling
  window.addEventListener('load', function (event) {
    if (window.location.hash !== "" && $(window.location.hash).length > 0) {
      window.scrollTo(0, $(window.location.hash).offset().top);
    }

    ;
  });
};

var addRemoveColonFromRangeValues = function addRemoveColonFromRangeValues(range) {
  var addToStart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  if (typeof range === 'undefined') return;

  if (range.indexOf(':') != -1) {
    range = range.replace(':', '');
  } else {
    range = addToStart ? ':' + range : range + ':';
  }

  return range;
};

var hideFacetNoRefinements = function hideFacetNoRefinements() {
  var facets = document.querySelectorAll('.filter-group');

  for (var i = 0; i < facets.length; i++) {
    var facetList = ['ais-RefinementList', 'ais-Menu'];

    for (var f = 0; f < facetList.length; f++) {
      var facet = facets[i].querySelector('.' + facetList[f]);

      if (facet !== null) {
        if (facet.classList.contains(facetList[f] + '--noRefinement')) {
          facets[i].classList.add('hide');
        } else {
          facets[i].classList.remove('hide');
        }
      }
    }
  }
};

var calcTimestampYesterday = function calcTimestampYesterday() {
  // calculate timestamp for midnight yesterday to filter end times against
  var d = new Date();
  var day = d.getUTCDate();
  var month = d.getUTCMonth();
  var year = d.getUTCFullYear();
  var t = new Date(year, month, day).getTime();
  return Math.floor(t / 1000) * 1000;
};;