/*! algoliasearch 3.1.0 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
(function(h){var f;"undefined"!==typeof window?f=window:"undefined"!==typeof self&&(f=self);f.ALGOLIA_MIGRATION_LAYER=h()})(function(){return function f(a,k,c){function b(d,m){if(!k[d]){if(!a[d]){var n="function"==typeof require&&require;if(!m&&n)return n(d,!0);if(l)return l(d,!0);n=Error("Cannot find module '"+d+"'");throw n.code="MODULE_NOT_FOUND",n;}n=k[d]={exports:{}};a[d][0].call(n.exports,function(e){var g=a[d][1][e];return b(g?g:e)},n,n.exports,f,a,k,c)}return k[d].exports}for(var l="function"==
typeof require&&require,d=0;d<c.length;d++)b(c[d]);return b}({1:[function(f,a,k){function c(d,b){for(var c in b)d.setAttribute(c,b[c])}function b(d,b){d.onload=function(){this.onerror=this.onload=null;b(null,d)};d.onerror=function(){this.onerror=this.onload=null;b(Error("Failed to load "+this.src),d)}}function l(d,b){d.onreadystatechange=function(){if("complete"==this.readyState||"loaded"==this.readyState)this.onreadystatechange=null,b(null,d)}}a.exports=function(d,a,m){var k=document.head||document.getElementsByTagName("head")[0],
e=document.createElement("script");"function"===typeof a&&(m=a,a={});a=a||{};m=m||function(){};e.type=a.type||"text/javascript";e.charset=a.charset||"utf8";e.async="async"in a?!!a.async:!0;e.src=d;a.attrs&&c(e,a.attrs);a.text&&(e.text=""+a.text);("onload"in e?b:l)(e,m);e.onload||b(e,m);k.appendChild(e)}},{}],2:[function(f,a,k){a.exports=function(c){c=new RegExp("cdn\\.jsdelivr\\.net/algoliasearch/latest/"+c.replace(".","\\.")+"(?:\\.min)?\\.js$");for(var b=document.getElementsByTagName("script"),
l=!1,d=0,a=b.length;d<a;d++)if(b[d].src&&c.test(b[d].src)){l=!0;break}return l}},{}],3:[function(f,a,k){(function(c){function b(b){return function(){var d="AlgoliaSearch: loaded V2 script using "+b;c.console&&c.console.log&&c.console.log(d)}}a.exports=function(l){var d=f(1);l="//cdn.jsdelivr.net/algoliasearch/2/"+l+".min.js";c.console&&(c.console.warn?c.console.warn("-- AlgoliaSearch `latest` warning --\nWarning, you are using the `latest` version string from jsDelivr to load the AlgoliaSearch library.\nUsing `latest` is no more recommended, you should load //cdn.jsdelivr.net/algoliasearch/2/algoliasearch.min.js\n\nAlso, we updated the AlgoliaSearch JavaScript client to V3. If you want to upgrade,\nplease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch  `latest` warning --"):
c.console.log&&c.console.log("-- AlgoliaSearch `latest` warning --\nWarning, you are using the `latest` version string from jsDelivr to load the AlgoliaSearch library.\nUsing `latest` is no more recommended, you should load //cdn.jsdelivr.net/algoliasearch/2/algoliasearch.min.js\n\nAlso, we updated the AlgoliaSearch JavaScript client to V3. If you want to upgrade,\nplease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch  `latest` warning --"));
try{document.write("<script>window.ALGOLIA_SUPPORTS_DOCWRITE = true\x3c/script>"),!0===c.ALGOLIA_SUPPORTS_DOCWRITE?(document.write('<script src="'+l+'">\x3c/script>'),b("document.write")()):d(l,b("DOMElement"))}catch(a){d(l,b("DOMElement"))}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{1:1}],4:[function(f,a,k){(function(c){a.exports=function(){c.AlgoliaSearch=function(){throw Error("-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --");
};c.AlgoliaSearchHelper=function(){throw Error("-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --");};AlgoliaExplainResults=function(){throw Error("-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --");
}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],5:[function(f,a,k){a=f(2);k=f(3);f=f(4);a("algoliasearch.angular")?k("algoliasearch.angular"):f()},{2:2,3:3,4:4}]},{},[5])(5)});
(function e$$0(f,a,k){function c(d,l){if(!a[d]){if(!f[d]){var m="function"==typeof require&&require;if(!l&&m)return m(d,!0);if(b)return b(d,!0);m=Error("Cannot find module '"+d+"'");throw m.code="MODULE_NOT_FOUND",m;}m=a[d]={exports:{}};f[d][0].call(m.exports,function(b){var e=f[d][1][b];return c(e?e:b)},m,m.exports,e$$0,f,a,k)}return a[d].exports}for(var b="function"==typeof require&&require,l=0;l<k.length;l++)c(k[l]);return c})({1:[function(h,f,a){function k(){if(!l){l=!0;for(var d,c=b.length;c;){d=
b;b=[];for(var a=-1;++a<c;)d[a]();c=b.length}l=!1}}function c(){}h=f.exports={};var b=[],l=!1;h.nextTick=function(d){b.push(d);l||setTimeout(k,0)};h.title="browser";h.browser=!0;h.env={};h.argv=[];h.version="";h.versions={};h.on=c;h.addListener=c;h.once=c;h.off=c;h.removeListener=c;h.removeAllListeners=c;h.emit=c;h.binding=function(d){throw Error("process.binding is not supported");};h.cwd=function(){return"/"};h.chdir=function(d){throw Error("process.chdir is not supported");};h.umask=function(){return 0}},
{}],2:[function(h,f,a){f.exports=function(c,b,l,d){l=l||"=";var a={};if("string"!==typeof c||0===c.length)return a;var m=/\+/g;c=c.split(b||"&");b=1E3;d&&"number"===typeof d.maxKeys&&(b=d.maxKeys);d=c.length;0<b&&d>b&&(d=b);for(b=0;b<d;++b){var n=c[b].replace(m,"%20"),e=n.indexOf(l),g;0<=e?(g=n.substr(0,e),n=n.substr(e+1)):(g=n,n="");g=decodeURIComponent(g);n=decodeURIComponent(n);Object.prototype.hasOwnProperty.call(a,g)?k(a[g])?a[g].push(n):a[g]=[a[g],n]:a[g]=n}return a};var k=Array.isArray||function(c){return"[object Array]"===
Object.prototype.toString.call(c)}},{}],3:[function(h,f,a){function k(d,b){if(d.map)return d.map(b);for(var c=[],a=0;a<d.length;a++)c.push(b(d[a],a));return c}var c=function(d){switch(typeof d){case "string":return d;case "boolean":return d?"true":"false";case "number":return isFinite(d)?d:"";default:return""}};f.exports=function(d,a,m,h){a=a||"&";m=m||"=";null===d&&(d=void 0);return"object"===typeof d?k(l(d),function(e){var g=encodeURIComponent(c(e))+m;return b(d[e])?k(d[e],function(e){return g+
encodeURIComponent(c(e))}).join(a):g+encodeURIComponent(c(d[e]))}).join(a):h?encodeURIComponent(c(h))+m+encodeURIComponent(c(d)):""};var b=Array.isArray||function(d){return"[object Array]"===Object.prototype.toString.call(d)},l=Object.keys||function(d){var b=[],a;for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&b.push(a);return b}},{}],4:[function(h,f,a){a.decode=a.parse=h(2);a.encode=a.stringify=h(3)},{2:2,3:3}],5:[function(h,f,a){function k(){var b;try{b=c.debug}catch(d){}return b}a=f.exports=
h(6);a.log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)};a.formatArgs=function(){var b=arguments,d=this.useColors;b[0]=(d?"%c":"")+this.namespace+(d?" %c":" ")+b[0]+(d?"%c ":" ")+"+"+a.humanize(this.diff);if(!d)return b;var d="color: "+this.color,b=[b[0],d,"color: inherit"].concat(Array.prototype.slice.call(b,1)),c=0,k=0;b[0].replace(/%[a-z%]/g,function(b){"%%"!==b&&(c++,"%c"===b&&(k=c))});b.splice(k,0,d);return b};a.save=function(b){try{null==
b?c.removeItem("debug"):c.debug=b}catch(d){}};a.load=k;a.useColors=function(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)};var c;if("undefined"!==typeof chrome&&"undefined"!==typeof chrome.storage)c=chrome.storage.local;else a:{try{c=window.localStorage;break a}catch(b){}c=void 0}a.colors="lightseagreen forestgreen goldenrod dodgerblue darkorchid crimson".split(" ");
a.formatters.j=function(b){return JSON.stringify(b)};a.enable(k())},{6:6}],6:[function(h,f,a){a=f.exports=function(b){function l(){}function d(){var b=+new Date;d.diff=b-(c||b);d.prev=c;c=d.curr=b;null==d.useColors&&(d.useColors=a.useColors());null==d.color&&d.useColors&&(d.color=a.colors[k++%a.colors.length]);var l=Array.prototype.slice.call(arguments);l[0]=a.coerce(l[0]);"string"!==typeof l[0]&&(l=["%o"].concat(l));var e=0;l[0]=l[0].replace(/%([a-z%])/g,function(g,b){if("%%"===g)return g;e++;var p=
a.formatters[b];"function"===typeof p&&(g=p.call(d,l[e]),l.splice(e,1),e--);return g});"function"===typeof a.formatArgs&&(l=a.formatArgs.apply(d,l));(d.log||a.log||console.log.bind(console)).apply(d,l)}l.enabled=!1;d.enabled=!0;var h=a.enabled(b)?d:l;h.namespace=b;return h};a.coerce=function(b){return b instanceof Error?b.stack||b.message:b};a.disable=function(){a.enable("")};a.enable=function(b){a.save(b);for(var c=(b||"").split(/[\s,]+/),d=c.length,k=0;k<d;k++)c[k]&&(b=c[k].replace(/\*/g,".*?"),
"-"===b[0]?a.skips.push(new RegExp("^"+b.substr(1)+"$")):a.names.push(new RegExp("^"+b+"$")))};a.enabled=function(b){var c,d;c=0;for(d=a.skips.length;c<d;c++)if(a.skips[c].test(b))return!1;c=0;for(d=a.names.length;c<d;c++)if(a.names[c].test(b))return!0;return!1};a.humanize=h(7);a.names=[];a.skips=[];a.formatters={};var k=0,c},{7:7}],7:[function(h,f,a){function k(b){if(b=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(b)){var c=
parseFloat(b[1]);switch((b[2]||"ms").toLowerCase()){case "years":case "year":case "yrs":case "yr":case "y":return 315576E5*c;case "days":case "day":case "d":return 864E5*c;case "hours":case "hour":case "hrs":case "hr":case "h":return 36E5*c;case "minutes":case "minute":case "mins":case "min":case "m":return 6E4*c;case "seconds":case "second":case "secs":case "sec":case "s":return 1E3*c;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return c}}}function c(b,c,d){if(!(b<c))return b<
1.5*c?Math.floor(b/c)+" "+d:Math.ceil(b/c)+" "+d+"s"}f.exports=function(b,a){a=a||{};return"string"==typeof b?k(b):a.long?c(b,864E5,"day")||c(b,36E5,"hour")||c(b,6E4,"minute")||c(b,1E3,"second")||b+" ms":864E5<=b?Math.round(b/864E5)+"d":36E5<=b?Math.round(b/36E5)+"h":6E4<=b?Math.round(b/6E4)+"m":1E3<=b?Math.round(b/1E3)+"s":b+"ms"}},{}],8:[function(h,f,a){var k=Object.prototype.hasOwnProperty,c=Object.prototype.toString,b=h(9),l=function(b){if(!b||"[object Object]"!==c.call(b))return!1;var a=k.call(b,
"constructor"),l=b.constructor&&b.constructor.prototype&&k.call(b.constructor.prototype,"isPrototypeOf");if(b.constructor&&!a&&!l)return!1;for(var h in b);return void 0===h||k.call(b,h)};f.exports=function r(){var c,a,e,g,u,p=arguments[0],k=1,h=arguments.length,f=!1;if("boolean"===typeof p)f=p,p=arguments[1]||{},k=2;else if("object"!==typeof p&&"function"!==typeof p||null==p)p={};for(;k<h;++k)if(c=arguments[k],null!=c)for(a in c)e=p[a],g=c[a],p!==g&&(f&&g&&(l(g)||(u=b(g)))?(u?(u=!1,e=e&&b(e)?e:[]):
e=e&&l(e)?e:{},p[a]=r(f,e,g)):void 0!==g&&(p[a]=g));return p}},{9:9}],9:[function(h,f,a){f.exports=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)}},{}],10:[function(h,f,a){var k=Object.prototype.hasOwnProperty,c=Object.prototype.toString;f.exports=function(b,a,d){if("[object Function]"!==c.call(a))throw new TypeError("iterator must be a function");var h=b.length;if(h===+h)for(var f=0;f<h;f++)a.call(d,b[f],f,b);else for(f in b)k.call(b,f)&&a.call(d,b[f],f,b)}},
{}],11:[function(h,f,a){f.exports="function"===typeof Object.create?function(a,c){a.super_=c;a.prototype=Object.create(c.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:function(a,c){a.super_=c;var b=function(){};b.prototype=c.prototype;a.prototype=new b;a.prototype.constructor=a}},{}],12:[function(h,f,a){(function(a){function c(b){if(!a.localStorage)return!1;b=a.localStorage[b];return null==b?!1:"true"===String(b).toLowerCase()}f.exports=function(b,a){if(c("noDeprecation"))return b;
var d=!1;return function(){if(!d){if(c("throwDeprecation"))throw Error(a);c("traceDeprecation")?console.trace(a):console.warn(a);d=!0}return b.apply(this,arguments)}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],13:[function(h,f,a){(function(a){function c(e,g,a){var c=h(8);if(!e)throw Error("algoliasearch: Please provide an application ID. Usage: algoliasearch(applicationID, apiKey, opts)");if(!g)throw Error("algoliasearch: Please provide an API key. Usage: algoliasearch(applicationID, apiKey, opts)");
this.applicationID=e;this.apiKey=g;e=[this.applicationID+"-1.algolianet.com",this.applicationID+"-2.algolianet.com",this.applicationID+"-3.algolianet.com"];this.hosts={read:[],write:[]};this.hostIndex={read:0,write:0};a=a||{};g=a.protocol||"http:";var d=void 0===a.timeout?2E3:a.timeout;/:$/.test(g)||(g+=":");if("http:"!==a.protocol&&"https:"!==a.protocol)throw Error("algoliasearch: protocol must be `http:` or `https:` (was `"+a.protocol+"`)");a.hosts?(this.hosts.read=c([],a.hosts),this.hosts.write=
c([],a.hosts)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(e),this.hosts.write=[this.applicationID+".algolia.net"].concat(e));this.hosts.read=b(this.hosts.read,l(g));this.hosts.write=b(this.hosts.write,l(g));this.requestTimeout=d;this.extraHeaders=[];this.cache={};this._ua=a._ua;this._useCache=void 0===a._useCache?!0:a._useCache;m("init done, %j",this)}function b(e,g){for(var b=[],a=0;a<e.length;++a)b.push(g(e[a],a));return b}function l(e){return function(g){return e+"//"+g.toLowerCase()}}
function d(){throw Error("algoliasearch: Not implemented in this environment.\nIf you feel this is a mistake, write to support@algolia.com");}function r(e,g){var a=e.toLowerCase().replace(".","").replace("()","");return"algoliasearch: `"+e+"` was replaced by `"+g+"`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#"+a}f.exports=c;"development"===a.env.NODE_ENV&&h(5).enable("algoliasearch*");var m=h(5)("algoliasearch:AlgoliaSearch");a=h(12);var n=h(10);c.prototype={deleteIndex:function(e,
g){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(e),hostType:"write",callback:g})},moveIndex:function(e,g,a){g={operation:"move",destination:g};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:g,hostType:"write",callback:a})},copyIndex:function(e,g,a){g={operation:"copy",destination:g};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:g,hostType:"write",callback:a})},getLogs:function(e,
g,a){if(0===arguments.length||"function"===typeof e)a=e,e=0,g=10;else if(1===arguments.length||"function"===typeof g)a=g,g=10;return this._jsonRequest({method:"GET",url:"/1/logs?offset="+e+"&length="+g,hostType:"read",callback:a})},listIndexes:function(e,g){var a="";void 0===e||"function"===typeof e?g=e:a="?page="+e;return this._jsonRequest({method:"GET",url:"/1/indexes"+a,hostType:"read",callback:g})},initIndex:function(e){return new this.Index(this,e)},listUserKeys:function(e){return this._jsonRequest({method:"GET",
url:"/1/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,g){return this._jsonRequest({method:"GET",url:"/1/keys/"+e,hostType:"read",callback:g})},deleteUserKey:function(e,g){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+e,hostType:"write",callback:g})},addUserKey:function(e,g,a){if(1===arguments.length||"function"===typeof g)a=g,g=null;var b={acl:e};g&&(b.validity=g.validity,b.maxQueriesPerIPPerHour=g.maxQueriesPerIPPerHour,b.maxHitsPerQuery=g.maxHitsPerQuery,b.indexes=g.indexes);
return this._jsonRequest({method:"POST",url:"/1/keys",body:b,hostType:"write",callback:a})},addUserKeyWithValidity:a(function(e,g,a){return this.addUserKey(e,g,a)},r("client.addUserKeyWithValidity()","client.addUserKey()")),updateUserKey:function(e,g,a,b){if(2===arguments.length||"function"===typeof a)b=a,a=null;var c={acl:g};a&&(c.validity=a.validity,c.maxQueriesPerIPPerHour=a.maxQueriesPerIPPerHour,c.maxHitsPerQuery=a.maxHitsPerQuery,c.indexes=a.indexes);return this._jsonRequest({method:"PUT",url:"/1/keys/"+
e,body:c,hostType:"write",callback:b})},setSecurityTags:function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var a=[],b=0;b<e.length;++b)if("[object Array]"===Object.prototype.toString.call(e[b])){for(var c=[],d=0;d<e[b].length;++d)c.push(e[b][d]);a.push("("+c.join(",")+")")}else a.push(e[b]);e=a.join(",")}this.securityTags=e},setUserToken:function(e){this.userToken=e},startQueriesBatch:a(function(){this._batch=[]},r("client.startQueriesBatch()","client.search()")),addQueryInBatch:a(function(e,
a,b){this._batch.push({indexName:e,query:a,params:b})},r("client.addQueryInBatch()","client.search()")),clearCache:function(){this.cache={}},sendQueriesBatch:a(function(e){return this.search(this._batch,e)},r("client.sendQueriesBatch()","client.search()")),setRequestTimeout:function(e){e&&(this.requestTimeout=parseInt(e,10))},search:function(e,a){var c=this,d={requests:b(e,function(e){var a="";void 0!==e.query&&(a+="query="+encodeURIComponent(e.query));return{indexName:e.indexName,params:c._getSearchParams(e.params,
a)}})};return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:d,hostType:"read",callback:a})},destroy:d,enableRateLimitForward:d,disableRateLimitForward:d,useSecuredAPIKey:d,disableSecuredAPIKey:d,generateSecuredApiKey:d,Index:function(e,a){this.indexName=a;this.as=e;this.typeAheadValueOption=this.typeAheadArgs=null;this.cache={}},setExtraHeader:function(e,a){this.extraHeaders.push({name:e.toLowerCase(),value:a})},_sendQueriesBatch:function(e,a){return this._jsonRequest({cache:this.cache,
method:"POST",url:"/1/indexes/*/queries",body:e,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:function(){for(var a="",b=0;b<e.requests.length;++b)var g="/1/indexes/"+encodeURIComponent(e.requests[b].indexName)+"?"+e.requests[b].params,a=a+(b+"="+encodeURIComponent(g)+"&");return a}()}},callback:a})},_jsonRequest:function(e){function a(h,m){function n(){f.hostIndex[e.hostType]=++f.hostIndex[e.hostType]%f.hosts[e.hostType].length;l+=1;m.timeout=f.requestTimeout*(l+1);return a(h,
m)}if(f._useCache&&c&&void 0!==c[d])return b("serving response from cache, body: %j",c[d]),f._promise.resolve(c[d]);if(l>=f.hosts[e.hostType].length){if(!e.fallback||!f._request.fallback||k)return f._promise.reject(Error("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue."));l=0;m.method=e.fallback.method;m.url=e.fallback.url;m.body=e.fallback.body;m.timeout=f.requestTimeout*(l+1);f.hostIndex[e.hostType]=0;k=f.useFallback=!0;return a(f._request.fallback,
m)}b("request: %j",m);return h.call(f,f.hosts[e.hostType][f.hostIndex[e.hostType]]+m.url,{body:m.body,method:m.method,headers:f._computeRequestHeaders(),timeout:m.timeout}).then(function(e){if(e instanceof Error)return b("error: %s",e.message),n();b("response: %j",e);var a=e&&e.body&&e.body.message&&e.body.status||e.statusCode||e&&e.body&&200,g=200===a||201===a,a=!g&&4!==Math.floor(a/100)&&1!==Math.floor(a/100);f._useCache&&g&&c&&(c[d]=e.body);return g?e.body:a?n():f._promise.reject(Error(e.body&&
e.body.message||"Unknown error"))},function(c){b("error: %s, stack: %s",c.message,c.stack);f.useFallback?(f.hostIndex[e.hostType]=++f.hostIndex[e.hostType]%f.hosts[e.hostType].length,l+=1):l=f.hosts[e.hostType].length;return a(h,m)})}var b=h(5)("algoliasearch:AlgoliaSearch:_jsonRequest:"+e.url);b("start: body: %j",e.body);var c=e.cache,d,f=this,l=0,k=!1;f._useCache&&(d=e.url);f._useCache&&void 0!==e.body&&(d+="_body_"+JSON.stringify(e.body));void 0!==e.cache&&b("Will use cache if any");var m=f.useFallback&&
e.fallback,n=m?e.fallback:e,m=a(m?f._request.fallback:f._request,{url:n.url,method:n.method,body:n.body,timeout:f.requestTimeout*(l+1)});if(e.callback)m.then(function(a){setTimeout(function(){e.callback(null,a)},0)},function(a){setTimeout(function(){e.callback(a)},0)});else return m},_getSearchParams:function(e,a){if(this._isUndefined(e)||null===e)return a;for(var b in e)null!==b&&e.hasOwnProperty(b)&&(a+=""===a?"":"&",a+=b+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[b])?
JSON.stringify(e[b]):e[b]));return a},_isUndefined:function(e){return void 0===e},_computeRequestHeaders:function(){var e={"x-algolia-api-key":this.apiKey,"x-algolia-application-id":this.applicationID,"x-user-agent":this._ua};this.userToken&&(e["x-algolia-usertoken"]=this.userToken);this.securityTags&&(e["x-algolia-tagfilters"]=this.securityTags);this.extraHeaders&&n(this.extraHeaders,function(a){e[a.name]=a.value});return e}};c.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(e,
a,b){if(1===arguments.length||"function"===typeof a)b=a,a=void 0;return this.as._jsonRequest({method:void 0!==a?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+(void 0!==a?"/"+encodeURIComponent(a):""),body:e,hostType:"write",callback:b})},addObjects:function(e,a){for(var b={requests:[]},c=0;c<e.length;++c)b.requests.push({action:"addObject",body:e[c]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:b,hostType:"write",
callback:a})},getObject:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;var d="";if(void 0!==b)for(var d="?attributes=",f=0;f<b.length;++f)0!==f&&(d+=","),d+=b[f];return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a)+d,hostType:"read",callback:c})},getObjects:function(a,c){var d=this,f={requests:b(a,function(a){return{indexName:d.indexName,objectID:a}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",
hostType:"read",body:f,callback:c})},partialUpdateObject:function(a,b){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a.objectID)+"/partial",body:a,hostType:"write",callback:b})},partialUpdateObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"partialUpdateObject",objectID:a[d].objectID,body:a[d]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+
"/batch",body:c,hostType:"write",callback:b})},saveObject:function(a,b){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a.objectID),body:a,hostType:"write",callback:b})},saveObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"updateObject",objectID:a[d].objectID,body:a[d]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:c,hostType:"write",
callback:b})},deleteObject:function(a,b){if("function"===typeof a||"string"!==typeof a&&"number"!==typeof a){var c=Error("Cannot delete an object without an objectID");b=a;return"function"===typeof b?b(c):this.as._promise.reject(c)}return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a),hostType:"write",callback:b})},deleteObjects:function(a,c){var d={requests:b(a,function(a){return{action:"deleteObject",objectID:a,body:{objectID:a}}})};
return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:d,hostType:"write",callback:c})},deleteByQuery:function(a,c,d){function f(a){return l.waitTask(a.taskID)}function h(){return l.deleteByQuery(a,c)}var l=this;if(1===arguments.length||"function"===typeof c)d=c,c={};c.attributesToRetrieve="objectID";c.hitsPerPage=1E3;this.clearCache();var k=this.search(a,c).then(function(a){if(0===a.nbHits)return a;a=b(a.hits,function(a){return a.objectID});
return l.deleteObjects(a).then(f).then(h)});if(!d)return k;k.then(function(){setTimeout(function(){d(null)},0)},function(a){setTimeout(function(){d(a)},0)})},search:function(a,b,c){if("function"===typeof a&&"object"===typeof b||"object"===typeof c)throw Error("algoliasearch: index.search usage is index.search(query, params, cb)");if(0===arguments.length||"function"===typeof a)c=a,a="";else if(1===arguments.length||"function"===typeof b)c=b,b=void 0;if("object"===typeof a&&null!==a)b=a,a=void 0;else if(void 0===
a||null===a)a="";var d="";void 0!==a&&(d+="query="+encodeURIComponent(a));void 0!==b&&(d=this.as._getSearchParams(b,d));return this._search(d,c)},browse:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;var d="?page="+a;this.as._isUndefined(b)||(d+="&hitsPerPage="+b);return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse"+d,hostType:"read",callback:c})},ttAdapter:function(a){var b=this;return function(c,d){b.search(c,a,function(a,
b){a?d(a):d(b.hits)})}},waitTask:function(a,b){var c=this,d=this.as._jsonRequest({method:"GET",hostType:"read",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/task/"+a}).then(function(b){return"published"!==b.status?c.as._promise.delay(100).then(function(){return c.waitTask(a)}):b});if(!b)return d;d.then(function(a){setTimeout(function(){b(null,a)},0)},function(a){setTimeout(function(){b(a)},0)})},clearIndex:function(a){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+
"/clear",hostType:"write",callback:a})},getSettings:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",hostType:"read",callback:a})},setSettings:function(a,b){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",hostType:"write",body:a,callback:b})},listUserKeys:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",hostType:"read",
callback:a})},getUserKeyACL:function(a,b){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,hostType:"read",callback:b})},deleteUserKey:function(a,b){return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,hostType:"write",callback:b})},addUserKey:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=null;var d={acl:a};b&&(d.validity=b.validity,d.maxQueriesPerIPPerHour=b.maxQueriesPerIPPerHour,
d.maxHitsPerQuery=b.maxHitsPerQuery);return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:d,hostType:"write",callback:c})},addUserKeyWithValidity:a(function(a,b,c){return this.addUserKey(a,b,c)},r("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(a,b,c,d){if(2===arguments.length||"function"===typeof c)d=c,c=null;var f={acl:b};c&&(f.validity=c.validity,f.maxQueriesPerIPPerHour=c.maxQueriesPerIPPerHour,f.maxHitsPerQuery=
c.maxHitsPerQuery);return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,body:f,hostType:"write",callback:d})},_search:function(a,b){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:a},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:a}},callback:b})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}}).call(this,
h(1))},{1:1,10:10,12:12,5:5,8:8}],14:[function(h,f,a){f.exports=function(a,b,f){function d(){g("success");v||p||(v=!0,u||(g("fail: script loaded but did not call the callback"),m(),f(Error("Failed to load JSONP script"))))}function r(){"loaded"!==this.readyState&&"complete"!==this.readyState||d()}function m(){clearTimeout(w);q.onload=null;q.onreadystatechange=null;q.onerror=null;x.removeChild(q);try{delete window[t],delete window[t+"_loaded"]}catch(a){window[t]=null,window[t+"_loaded"]=null}}function n(){g("timeout");
p=!0;m();f(Error("Timeout - Could not connect to endpoint "+a))}function e(){g("error");v||p||(m(),f(Error("Failed to load JSONP script")))}if("GET"!==b.method)f(Error("Method "+b.method+" "+a+" is not supported by JSONP."));else{var g=h(5)("algoliasearch:JSONP-request:"+a);g("start");var u=!1,p=!1;k+=1;var x=document.getElementsByTagName("head")[0],q=document.createElement("script"),t="algoliaJSONP_"+k,v=!1;window[t]=function(a){try{delete window[t]}catch(b){window[t]=void 0}p||(u=!0,m(),f(null,
{body:a}))};a+="&callback="+t;b.body&&b.body.params&&(a+="&"+b.body.params);var w=setTimeout(n,b.timeout);q.onreadystatechange=r;q.onload=d;q.onerror=e;q.async=!0;q.defer=!0;q.src=a;x.appendChild(q)}};var k=0},{5:5}],15:[function(h,f,a){(function(a){var c=h(11),b=h(13),f=h(17),d=h(14);a.angular.module("algoliasearch",[]).service("algolia",["$http","$q","$timeout",function(a,k,n){function e(a,b,c){var d=h(8),f=h(16);c=d(!0,{},c)||{};void 0===c.protocol&&(c.protocol=f());c._ua=e.ua;return new g(a,b,
c)}function g(){b.apply(this,arguments)}e.version=h(18);e.ua="Algolia for AngularJS "+e.version;c(g,b);g.prototype._request=function(b,c){return k(function(d,e){var g,h=null;void 0!==c.body&&(h=JSON.stringify(c.body));b=f(b,c.headers);var w=k(function(a){n(function(){g=!0;a("test");d(Error("Timeout - Could not connect to endpoint "+b))},c.timeout)});a({url:b,method:c.method,data:h,cache:!1,timeout:w}).then(function(a){d({statusCode:a.status,body:a.data})},function(a){g||(0===a.status?e(Error("Network error")):
d({body:a.data,statusCode:a.status}))})})};g.prototype._request.fallback=function(a,b){a=f(a,b.headers);return k(function(c,e){d(a,b,function(a,b){a?e(a):c(b)})})};g.prototype._promise={reject:function(a){return k.reject(a)},resolve:function(a){return k.when(a)},delay:function(a){return k(function(b){n(b,a)})}};return{Client:function(a,b,c){return e(a,b,c)},ua:e.ua,version:e.version}}])}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:
{})},{11:11,13:13,14:14,16:16,17:17,18:18,8:8}],16:[function(h,f,a){(function(a){f.exports=function(){var c=a.document.location.protocol;"http:"!==c&&"https:"!==c&&(c="http:");return c}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],17:[function(h,f,a){f.exports=function(a,b){a=/\?/.test(a)?a+"&":a+"?";return a+k.encode(b)};var k=h(4)},{4:4}],18:[function(h,f,a){f.exports="3.1.0"},{}]},{},[15]);
