!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0){var d=this.state.results.map(function(a,c){return j.default.createElement(s,{key:a.objectID,post:a,showDetail:b.showDetail.bind(b,c)})});a=j.default.createElement("ul",{role:"list",className:"wpseo-kb-search-results"},d),(0,p.default)(this.props.foundResultsText.replace("%d",c))}else""!==this.state.searchString&&(a=j.default.createElement("p",null,this.props.noResultsText),(0,p.default)(this.props.noResultsText));return a}},{key:"renderDetail",value:function(){var a=this.state.showDetail,b=this.state.results[a];return j.default.createElement("div",{className:"wpseo-kb-search-detail"},j.default.createElement("div",{className:"wpseo-kb-search-navigation"},j.default.createElement("button",{className:"button dashicon-button wpseo-kb-search-back-button","aria-label":this.props.backLabel,onClick:this.hideDetail},this.props.back),j.default.createElement("a",{href:b.permalink,className:"button dashicon-button wpseo-kb-search-ext-link ","aria-label":this.props.openLabel,target:"_blank"},this.props.open)),j.default.createElement(t,{post:b,iframeTitle:this.props.iframeTitle}))}},{key:"renderError",value:function(a){return console.error(a),(0,p.default)(this.props.errorMessage),j.default.createElement("p",null,this.props.errorMessage)}},{key:"render",value:function(){var a="",b=j.default.createElement(r,{headingText:this.props.headingText,submitAction:this.searchButtonClicked,searchString:this.state.searchString,searchButtonText:this.props.searchButtonText});return a=this.state.errorMessage?j.default.createElement("div",null,b,this.renderError(this.state.errorMessage)):this.state.searching?j.default.createElement("div",null,b,j.default.createElement(u,{loadingPlaceholder:this.props.loadingPlaceholder})):this.state.showDetail===!1?j.default.createElement("div",null,b,this.state.results.length>0?j.default.createElement("h2",{className:"screen-reader-text"},this.props.searchResultsHeading):"",this.renderSearchResults()):this.renderDetail(),j.default.createElement("div",{className:"wpseo-kb-search-container"},a)}}]),b}(j.default.Component);q.propTypes={foundResultsText:j.default.PropTypes.string,noResultsText:j.default.PropTypes.string,headingText:j.default.PropTypes.string,searchButtonText:j.default.PropTypes.string,searchResultsHeading:j.default.PropTypes.string,iframeTitle:j.default.PropTypes.string,algoliaApplicationId:j.default.PropTypes.string.isRequired,algoliaApiKey:j.default.PropTypes.string.isRequired,algoliaIndexName:j.default.PropTypes.string.isRequired,errorMessage:j.default.PropTypes.string.isRequired,loadingPlaceholder:j.default.PropTypes.string.isRequired,open:j.default.PropTypes.string.isRequired,openLabel:j.default.PropTypes.string.isRequired,back:j.default.PropTypes.string.isRequired,backLabel:j.default.PropTypes.string.isRequired},q.defaultProps={foundResultsText:"Number of search results: %d",noResultsText:"No results found.",headingText:"Search the Yoast knowledge base",searchButtonText:"Search",searchResultsHeading:"Search results",iframeTitle:"Knowledge base article",algoliaApplicationId:"RC8G2UCWJK",algoliaApiKey:"459903434a7963f83e7d4cd9bfe89c0d",algoliaIndexName:"knowledge_base_all",errorMessage:"Something went wrong. Please try again later.",loadingPlaceholder:"Loading...",back:"Back",backLabel:"Back to search results",open:"Open",openLabel:"Open the knowledge base article in a new window or read it in the iframe below"};var r=function(a){return j.default.createElement("div",{className:"wpseo-kb-search-search-bar"},j.default.createElement("h2",{id:"wpseo-kb-search-heading"},a.headingText),j.default.createElement("form",{onSubmit:function(b){b.preventDefault(),a.submitAction(b)}},j.default.createElement("input",{type:"text","aria-labelledby":"wpseo-kb-search-heading",defaultValue:a.searchString}),j.default.createElement("button",{type:"submit",className:"button wpseo-kb-search-search-button"},a.searchButtonText)))},s=function(a){var b=a.post,c=b.excerpt||b.metadesc;return j.default.createElement("li",null,j.default.createElement("a",{href:b.permalink,onClick:function(b){b.preventDefault(),a.showDetail()},className:"wpseo-kb-search-result-link"},j.default.createElement("div",{className:"wpseo-kb-search-result"},j.default.createElement("h3",{className:"wpseo-kb-search-result-title"},b.post_title),c&&j.default.createElement("p",null,c))))},t=function(a){var b=a.post.permalink+"amp?source=wpseo-kb-search";return j.default.createElement("iframe",{src:b,className:"kb-search-content-frame",title:a.iframeTitle})},u=function(a){return j.default.createElement("div",{className:"wpseo-kb-loader"},a.loadingPlaceholder)};c.default=q},{"a11y-speak":4,algoliasearch:13,"lodash/isUndefined":58,react:215}],3:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}var e=a("./kb-search/wp-seo-kb-search-init"),f=d(e),g=a("a11y-speak"),h=d(g);!function(){function a(a){var b=!1,c="",d=[],e=["userid","name","user_description"],f=["date"],g=["title","parent_title","excerpt","excerpt_only","caption","focuskw","pt_single","pt_plural","modified","id"],i=["term404","searchphrase"],j=["term_title","term_description"],k=["category","category_description","tag","tag_description"];a.hasClass("posttype-template")?d=d.concat(i,j):a.hasClass("homepage-template")?d=d.concat(e,f,g,i,j,k):a.hasClass("taxonomy-template")?d=d.concat(e,f,g,i):a.hasClass("author-template")?d=d.concat(g,f,i,j,k):a.hasClass("date-template")?d=d.concat(e,g,i,j,k):a.hasClass("search-template")?d=d.concat(e,f,g,j,k,["term404"]):a.hasClass("error404-template")&&(d=d.concat(e,f,g,j,k,["searchphrase"])),jQuery.each(d,function(d,e){if(c=a.attr("id")+"-"+e+"-warning",a.val().search("%%"+e+"%%")!==-1){a.addClass("wpseo-variable-warning-element");var f=wpseoAdminL10n.variable_warning.replace("%s","%%"+e+"%%");jQuery("#"+c).length?jQuery("#"+c).html(f):a.after('
'+f+"
"),(0,h.default)(wpseoAdminL10n.variable_warning.replace("%s",e),"assertive"),b=!0}else jQuery("#"+c).length&&jQuery("#"+c).remove()}),b===!1&&a.removeClass("wpseo-variable-warning-element")}function b(a,b,c,d){jQuery.post(ajaxurl,{action:"wpseo_set_option",option:a,newval:b,_wpnonce:d},function(a){a&&jQuery("#"+c).hide()})}function c(a){jQuery.post(ajaxurl,{action:"wpseo_kill_blocking_files",_ajax_nonce:a}).done(function(a){var b=jQuery(".yoast-notice-blocking-files"),c=jQuery("#blocking_files");c.html(a.data.message),b.attr("tabindex","-1").focus(),a.success?b.removeClass("notice-error").addClass("notice-success"):b.addClass("yoast-blocking-files-error")})}function d(){jQuery("#og_frontpage_desc").val(jQuery("#meta_description").val())}function e(){var a=jQuery("#wpseo-conf");if(a.length){var b=a.attr("action").split("#")[0];a.attr("action",b+window.location.hash)}}function g(){var a=jQuery("#TB_ajaxContent");jQuery.post(ajaxurl,{_wpnonce:a.find("input[name=fb_admin_nonce]").val(),admin_name:a.find("input[name=fb_admin_name]").val(),admin_id:a.find("input[name=fb_admin_id]").val(),action:"wpseo_add_fb_admin"},function(b){var c=jQuery.parseJSON(b);switch(a.find("p.notice").remove(),c.success){case 1:a.find("input[type=text]").val(""),jQuery("#user_admin").append(c.html),jQuery("#connected_fb_admins").show(),tb_remove();break;case 0:a.find(".form-wrap").prepend(c.html)}})}function i(){var a="400px";jQuery("#company_or_person").select2({width:a,language:wpseoSelect2Locale}),jQuery("#twitter_card_type").select2({width:a,language:wpseoSelect2Locale}),jQuery("#post_types-post-maintax").select2({width:a,language:wpseoSelect2Locale}),jQuery("#profile").select2({width:a,language:wpseoSelect2Locale})}function j(){var a=window.location.hash.replace("#top#","");""!==a&&"#"!==a.charAt(0)||(a=jQuery(".wpseotab").attr("id")),jQuery("#"+a).addClass("active"),jQuery("#"+a+"-tab").addClass("nav-tab-active").click()}jQuery(window).on("hashchange",e),jQuery(document).on("ready",e),window.wpseoDetectWrongVariables=a,window.setWPOption=b,window.wpseoKillBlockingFiles=c,window.wpseoCopyHomeMeta=d,window.wpseo_add_fb_admin=g,window.wpseoSetTabHash=e,jQuery(document).ready(function(){(0,f.default)(),jQuery("#enablexmlsitemap").change(function(){jQuery("#sitemapinfo").toggle(jQuery(this).is(":checked"))}).change(),jQuery("#disable-author input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#author-archives-titles-metas-content").toggle("off"===jQuery(this).val())}).change(),jQuery("#disable-date input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#date-archives-titles-metas-content").toggle("off"===jQuery(this).val())}).change(),jQuery("#disable-post_format").change(function(){jQuery("#post_format-titles-metas").toggle(jQuery(this).is(":not(:checked)"))}).change(),jQuery("#breadcrumbs-enable").change(function(){jQuery("#breadcrumbsinfo").toggle(jQuery(this).is(":checked"))}).change(),jQuery("#disable_author_sitemap").find("input:radio").change(function(){jQuery(this).is(":checked")&&jQuery("#xml_user_block").toggle("off"===jQuery(this).val())}).change(),jQuery("#cleanpermalinks").change(function(){jQuery("#cleanpermalinksdiv").toggle(jQuery(this).is(":checked"))}).change(),jQuery("#wpseo-tabs").find("a").click(function(){jQuery("#wpseo-tabs").find("a").removeClass("nav-tab-active"),jQuery(".wpseotab").removeClass("active");var a=jQuery(this).attr("id").replace("-tab","");jQuery("#"+a).addClass("active"),jQuery(this).addClass("nav-tab-active")}),jQuery("#company_or_person").change(function(){var a=jQuery(this).val();"company"===a?(jQuery("#knowledge-graph-company").show(),jQuery("#knowledge-graph-person").hide()):"person"===a?(jQuery("#knowledge-graph-company").hide(),jQuery("#knowledge-graph-person").show()):(jQuery("#knowledge-graph-company").hide(),jQuery("#knowledge-graph-person").hide())}).change(),jQuery(".template").change(function(){a(jQuery(this))}).change(),jQuery("#blocking_files .button").on("click",function(){c(jQuery(this).data("nonce"))}),jQuery(".switch-yoast-seo input").on("keydown",function(a){"keydown"===a.type&&13===a.which&&a.preventDefault()}),j(),i()})}()},{"./kb-search/wp-seo-kb-search-init":1,"a11y-speak":4}],4:[function(a,b,c){var d,e,f=function(a){a=a||"polite";var b=document.createElement("div");b.id="a11y-speak-"+a,b.className="a11y-speak-region";var c="clip: rect(1px, 1px, 1px, 1px); position: absolute; height: 1px; width: 1px; overflow: hidden;";return b.setAttribute("style",c),b.setAttribute("aria-live",a),b.setAttribute("aria-relevant","additions text"),b.setAttribute("aria-atomic","true"),document.querySelector("body").appendChild(b),b},g=function(a){return"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?a():void document.addEventListener("DOMContentLoaded",a)};g(function(){d=document.getElementById("a11y-speak-polite"),e=document.getElementById("a11y-speak-assertive"),null===d&&(d=f("polite")),null===e&&(e=f("assertive"))});var h=function(){for(var a=document.querySelectorAll(".a11y-speak-region"),b=0;b]+>/g," "),e&&"assertive"===b?e.textContent=a:d&&(d.textContent=a)};b.exports=i},{}],5:[function(a,b,c){(function(d){function e(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function f(){var a=arguments,b=this.useColors;if(a[0]=(b?"%c":"")+this.namespace+(b?" %c":" ")+a[0]+(b?"%c ":" ")+"+"+c.humanize(this.diff),!b)return a;var d="color: "+this.color;a=[a[0],d,"color: inherit"].concat(Array.prototype.slice.call(a,1));var e=0,f=0;return a[0].replace(/%[a-z%]/g,function(a){"%%"!==a&&(e++,"%c"===a&&(f=e))}),a.splice(f,0,d),a}function g(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function h(a){try{null==a?c.storage.removeItem("debug"):c.storage.debug=a}catch(a){}}function i(){try{return c.storage.debug}catch(a){}if("undefined"!=typeof d&&"env"in d)return d.env.DEBUG}function j(){try{return window.localStorage}catch(a){}}c=b.exports=a("./debug"),c.log=g,c.formatArgs=f,c.save=h,c.load=i,c.useColors=e,c.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:j(),c.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],c.formatters.j=function(a){try{return JSON.stringify(a)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}},c.enable(i())}).call(this,a("_process"))},{"./debug":6,_process:62}],6:[function(a,b,c){function d(){return c.colors[k++%c.colors.length]}function e(a){function b(){}function e(){var a=e,b=+new Date,f=b-(j||b);a.diff=f,a.prev=j,a.curr=b,j=b,null==a.useColors&&(a.useColors=c.useColors()),null==a.color&&a.useColors&&(a.color=d());for(var g=new Array(arguments.length),h=0;h1e4)){var b=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(a);if(b){var c=parseFloat(b[1]),d=(b[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return c*l;case"days":case"day":case"d":return c*k;case"hours":case"hour":case"hrs":case"hr":case"h":return c*j;case"minutes":case"minute":case"mins":case"min":case"m":return c*i;case"seconds":case"second":case"secs":case"sec":case"s":return c*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function e(a){return a>=k?Math.round(a/k)+"d":a>=j?Math.round(a/j)+"h":a>=i?Math.round(a/i)+"m":a>=h?Math.round(a/h)+"s":a+"ms"}function f(a){return g(a,k,"day")||g(a,j,"hour")||g(a,i,"minute")||g(a,h,"second")||a+" ms"}function g(a,b,c){if(!(a0)return d(a);if("number"===c&&isNaN(a)===!1)return b.long?f(a):e(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}},{}],8:[function(a,b,c){function d(){i.apply(this,arguments)}function e(){var a="Not implemented in this environment.\nIf you feel this is a mistake, write to support@algolia.com";throw new k.AlgoliaSearchError(a)}b.exports=d;var f=a("./Index.js"),g=a("./deprecate.js"),h=a("./deprecatedMessage.js"),i=a("./AlgoliaSearchCore.js"),j=a("inherits"),k=a("./errors");j(d,i),d.prototype.deleteIndex=function(a,b){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(a),hostType:"write",callback:b})},d.prototype.moveIndex=function(a,b,c){var d={operation:"move",destination:b};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/operation",body:d,hostType:"write",callback:c})},d.prototype.copyIndex=function(a,b,c){var d={operation:"copy",destination:b};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/operation",body:d,hostType:"write",callback:c})},d.prototype.getLogs=function(b,c,d){var e=a("./clone.js"),f={};return"object"==typeof b?(f=e(b),d=c):0===arguments.length||"function"==typeof b?d=b:1===arguments.length||"function"==typeof c?(d=c,f.offset=b):(f.offset=b,f.length=c),void 0===f.offset&&(f.offset=0),void 0===f.length&&(f.length=10),this._jsonRequest({method:"GET",url:"/1/logs?"+this._getSearchParams(f,""),hostType:"read",callback:d})},d.prototype.listIndexes=function(a,b){var c="";return void 0===a||"function"==typeof a?b=a:c="?page="+a,this._jsonRequest({method:"GET",url:"/1/indexes"+c,hostType:"read",callback:b})},d.prototype.initIndex=function(a){return new f(this,a)},d.prototype.listUserKeys=function(a){return this._jsonRequest({method:"GET",url:"/1/keys",hostType:"read",callback:a})},d.prototype.getUserKeyACL=function(a,b){return this._jsonRequest({method:"GET",url:"/1/keys/"+a,hostType:"read",callback:b})},d.prototype.deleteUserKey=function(a,b){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+a,hostType:"write",callback:b})},d.prototype.addUserKey=function(b,c,d){var e=a("isarray"),f="Usage: client.addUserKey(arrayOfAcls[, params, callback])";if(!e(b))throw new Error(f);1!==arguments.length&&"function"!=typeof c||(d=c,c=null);var g={acl:b};return c&&(g.validity=c.validity,g.maxQueriesPerIPPerHour=c.maxQueriesPerIPPerHour,g.maxHitsPerQuery=c.maxHitsPerQuery,g.indexes=c.indexes,g.description=c.description,c.queryParameters&&(g.queryParameters=this._getSearchParams(c.queryParameters,"")),g.referers=c.referers),this._jsonRequest({method:"POST",url:"/1/keys",body:g,hostType:"write",callback:d})},d.prototype.addUserKeyWithValidity=g(function(a,b,c){return this.addUserKey(a,b,c)},h("client.addUserKeyWithValidity()","client.addUserKey()")),d.prototype.updateUserKey=function(b,c,d,e){var f=a("isarray"),g="Usage: client.updateUserKey(key, arrayOfAcls[, params, callback])";if(!f(c))throw new Error(g);2!==arguments.length&&"function"!=typeof d||(e=d,d=null);var h={acl:c};return d&&(h.validity=d.validity,h.maxQueriesPerIPPerHour=d.maxQueriesPerIPPerHour,h.maxHitsPerQuery=d.maxHitsPerQuery,h.indexes=d.indexes,h.description=d.description,d.queryParameters&&(h.queryParameters=this._getSearchParams(d.queryParameters,"")),h.referers=d.referers),this._jsonRequest({method:"PUT",url:"/1/keys/"+b,body:h,hostType:"write",callback:e})},d.prototype.startQueriesBatch=g(function(){this._batch=[]},h("client.startQueriesBatch()","client.search()")),d.prototype.addQueryInBatch=g(function(a,b,c){this._batch.push({indexName:a,query:b,params:c})},h("client.addQueryInBatch()","client.search()")),d.prototype.sendQueriesBatch=g(function(a){return this.search(this._batch,a)},h("client.sendQueriesBatch()","client.search()")),d.prototype.batch=function(b,c){var d=a("isarray"),e="Usage: client.batch(operations[, callback])";if(!d(b))throw new Error(e);return this._jsonRequest({method:"POST",url:"/1/indexes/*/batch",body:{requests:b},hostType:"write",callback:c})},d.prototype.destroy=e,d.prototype.enableRateLimitForward=e,d.prototype.disableRateLimitForward=e,d.prototype.useSecuredAPIKey=e,d.prototype.disableSecuredAPIKey=e,d.prototype.generateSecuredApiKey=e},{"./AlgoliaSearchCore.js":9,"./Index.js":10,"./clone.js":19,"./deprecate.js":20,"./deprecatedMessage.js":21,"./errors":22,inherits:56,isarray:57}],9:[function(a,b,c){function d(b,c,d){var f=a("debug")("algoliasearch"),h=a("./clone.js"),j=a("isarray"),k=a("./map.js"),l="Usage: algoliasearch(applicationID, apiKey, opts)";if(d._allowEmptyCredentials!==!0&&!b)throw new i.AlgoliaSearchError("Please provide an application ID. "+l);if(d._allowEmptyCredentials!==!0&&!c)throw new i.AlgoliaSearchError("Please provide an API key. "+l);this.applicationID=b,this.apiKey=c;var m=g([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},d=d||{};var n=d.protocol||"https:",o=void 0===d.timeout?2e3:d.timeout;if(/:$/.test(n)||(n+=":"),"http:"!==d.protocol&&"https:"!==d.protocol)throw new i.AlgoliaSearchError("protocol must be `http:` or `https:` (was `"+d.protocol+"`)");d.hosts?j(d.hosts)?(this.hosts.read=h(d.hosts),this.hosts.write=h(d.hosts)):(this.hosts.read=h(d.hosts.read),this.hosts.write=h(d.hosts.write)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(m),this.hosts.write=[this.applicationID+".algolia.net"].concat(m)),this.hosts.read=k(this.hosts.read,e(n)),this.hosts.write=k(this.hosts.write,e(n)),this.requestTimeout=o,this.extraHeaders=[],this.cache=d._cache||{},this._ua=d._ua,this._useCache=!(void 0!==d._useCache&&!d._cache)||d._useCache,this._useFallback=void 0===d.useFallback||d.useFallback,this._setTimeout=d._setTimeout,f("init done, %j",this)}function e(a){return function(b){return a+"//"+b.toLowerCase()}}function f(a){if(void 0===Array.prototype.toJSON)return JSON.stringify(a);var b=Array.prototype.toJSON;delete Array.prototype.toJSON;var c=JSON.stringify(a);return Array.prototype.toJSON=b,c}function g(a){for(var b,c,d=a.length;0!==d;)c=Math.floor(Math.random()*d),d-=1,b=a[d],a[d]=a[c],a[c]=b;return a}function h(a){var b={};for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d;d="x-algolia-api-key"===c||"x-algolia-application-id"===c?"**hidden for security purposes**":a[c],b[c]=d}return b}b.exports=d;var i=a("./errors"),j=a("./exitPromise.js"),k=a("./IndexCore.js"),l=500;d.prototype.initIndex=function(a){return new k(this,a)},d.prototype.setExtraHeader=function(a,b){this.extraHeaders.push({name:a.toLowerCase(),value:b})},d.prototype.addAlgoliaAgent=function(a){this._ua+=";"+a},d.prototype._jsonRequest=function(b){function c(a,j){function l(a){var b=a&&a.body&&a.body.message&&a.body.status||a.statusCode||a&&a.body&&200;g("received response: statusCode: %s, computed statusCode: %d, headers: %j",a.statusCode,b,a.headers);var c=2===Math.floor(b/100),f=new Date;if(q.push({currentHost:w,headers:h(e),content:d||null,contentLength:void 0!==d?d.length:null,method:j.method,timeout:j.timeout,url:j.url,startTime:v,endTime:f,duration:f-v,statusCode:b}),c)return m._useCache&&k&&(k[u]=a.responseText),a.body;var l=4!==Math.floor(b/100);if(l)return n+=1,s();g("unrecoverable error");var o=new i.AlgoliaSearchError(a.body&&a.body.message,{debugData:q,statusCode:b});return m._promise.reject(o)}function r(a){g("error: %s, stack: %s",a.message,a.stack);var c=new Date;return q.push({currentHost:w,headers:h(e),content:d||null,contentLength:void 0!==d?d.length:null,method:j.method,timeout:j.timeout,url:j.url,startTime:v,endTime:c,duration:c-v}),a instanceof i.AlgoliaSearchError||(a=new i.Unknown(a&&a.message,a)),n+=1,a instanceof i.Unknown||a instanceof i.UnparsableJSON||n>=m.hosts[b.hostType].length&&(o||!p)?(a.debugData=q,m._promise.reject(a)):a instanceof i.RequestTimeout?t():s()}function s(){return g("retrying request"),m.hostIndex[b.hostType]=(m.hostIndex[b.hostType]+1)%m.hosts[b.hostType].length,c(a,j)}function t(){return g("retrying request with higher timeout"),m.hostIndex[b.hostType]=(m.hostIndex[b.hostType]+1)%m.hosts[b.hostType].length,j.timeout=m.requestTimeout*(n+1),c(a,j)}var u,v=new Date;if(m._useCache&&(u=b.url),m._useCache&&d&&(u+="_body_"+j.body),m._useCache&&k&&void 0!==k[u])return g("serving response from cache"),m._promise.resolve(JSON.parse(k[u]));if(n>=m.hosts[b.hostType].length)return!p||o?(g("could not get any response"),m._promise.reject(new i.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:q}))):(g("switching to fallback"),n=0,j.method=b.fallback.method,j.url=b.fallback.url,j.jsonBody=b.fallback.body,j.jsonBody&&(j.body=f(j.jsonBody)),e=m._computeRequestHeaders(),j.timeout=m.requestTimeout*(n+1),m.hostIndex[b.hostType]=0,o=!0,c(m._request.fallback,j));var w=m.hosts[b.hostType][m.hostIndex[b.hostType]],x=w+j.url,y={body:j.body,jsonBody:j.jsonBody,method:j.method,headers:e,timeout:j.timeout,debug:g};return g("method: %s, url: %s, headers: %j, timeout: %d",y.method,x,y.headers,y.timeout),a===m._request.fallback&&g("using fallback"),a.call(m,x,y).then(l,r)}var d,e,g=a("debug")("algoliasearch:"+b.url),k=b.cache,m=this,n=0,o=!1,p=m._useFallback&&m._request.fallback&&b.fallback;this.apiKey.length>l&&void 0!==b.body&&(void 0!==b.body.params||void 0!==b.body.requests)?(b.body.apiKey=this.apiKey,e=this._computeRequestHeaders(!1)):e=this._computeRequestHeaders(),void 0!==b.body&&(d=f(b.body)),g("request start");var q=[],r=c(m._request,{url:b.url,method:b.method,body:d,jsonBody:b.body,timeout:m.requestTimeout*(n+1)});return b.callback?void r.then(function(a){j(function(){b.callback(null,a)},m._setTimeout||setTimeout)},function(a){j(function(){b.callback(a)},m._setTimeout||setTimeout)}):r},d.prototype._getSearchParams=function(a,b){if(void 0===a||null===a)return b;for(var c in a)null!==c&&void 0!==a[c]&&a.hasOwnProperty(c)&&(b+=""===b?"":"&",b+=c+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[c])?f(a[c]):a[c]));return b},d.prototype._computeRequestHeaders=function(b){var c=a("foreach"),d={"x-algolia-agent":this._ua,"x-algolia-application-id":this.applicationID};return b!==!1&&(d["x-algolia-api-key"]=this.apiKey),this.userToken&&(d["x-algolia-usertoken"]=this.userToken),this.securityTags&&(d["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&c(this.extraHeaders,function(a){d[a.name]=a.value}),d},d.prototype.search=function(b,c,d){var e=a("isarray"),f=a("./map.js"),g="Usage: client.search(arrayOfQueries[, callback])";if(!e(b))throw new Error(g);"function"==typeof c?(d=c,c={}):void 0===c&&(c={});var h=this,i={requests:f(b,function(a){var b="";return void 0!==a.query&&(b+="query="+encodeURIComponent(a.query)),{indexName:a.indexName,params:h._getSearchParams(a.params,b)}})},j=f(i.requests,function(a,b){return b+"="+encodeURIComponent("/1/indexes/"+encodeURIComponent(a.indexName)+"?"+a.params)}).join("&"),k="/1/indexes/*/queries";return void 0!==c.strategy&&(k+="?strategy="+c.strategy),this._jsonRequest({cache:this.cache,method:"POST",url:k,body:i,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:j}},callback:d})},d.prototype.setSecurityTags=function(a){if("[object Array]"===Object.prototype.toString.call(a)){for(var b=[],c=0;cg&&(b=g),"published"!==a.status?k._promise.delay(b).then(c):a})}function d(a){i(function(){b(null,a)},k._setTimeout||setTimeout)}function e(a){i(function(){b(a)},k._setTimeout||setTimeout)}var f=100,g=5e3,h=0,j=this,k=j.as,l=c();return b?void l.then(d,e):l},d.prototype.clearIndex=function(a){var b=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(b.indexName)+"/clear",hostType:"write",callback:a})},d.prototype.getSettings=function(a){var b=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(b.indexName)+"/settings?getVersion=2",hostType:"read",callback:a})},d.prototype.searchSynonyms=function(a,b){return"function"==typeof a?(b=a,a={}):void 0===a&&(a={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/search",body:a,hostType:"read",callback:b})},d.prototype.saveSynonym=function(a,b,c){return"function"==typeof b?(c=b,b={}):void 0===b&&(b={}),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(a.objectID)+"?forwardToSlaves="+(b.forwardToSlaves?"true":"false"),body:a,hostType:"write",callback:c})},d.prototype.getSynonym=function(a,b){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(a),hostType:"read",callback:b})},d.prototype.deleteSynonym=function(a,b,c){return"function"==typeof b?(c=b,b={}):void 0===b&&(b={}),this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(a)+"?forwardToSlaves="+(b.forwardToSlaves?"true":"false"),hostType:"write",callback:c})},d.prototype.clearSynonyms=function(a,b){return"function"==typeof a?(b=a,a={}):void 0===a&&(a={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/clear?forwardToSlaves="+(a.forwardToSlaves?"true":"false"),hostType:"write",callback:b})},d.prototype.batchSynonyms=function(a,b,c){return"function"==typeof b?(c=b,b={}):void 0===b&&(b={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/batch?forwardToSlaves="+(b.forwardToSlaves?"true":"false")+"&replaceExistingSynonyms="+(b.replaceExistingSynonyms?"true":"false"),hostType:"write",body:a,callback:c})},d.prototype.setSettings=function(a,b,c){1!==arguments.length&&"function"!=typeof b||(c=b,b={});var d=b.forwardToSlaves||!1,e=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(e.indexName)+"/settings?forwardToSlaves="+(d?"true":"false"),hostType:"write",body:a,callback:c})},d.prototype.listUserKeys=function(a){var b=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(b.indexName)+"/keys",hostType:"read",callback:a})},d.prototype.getUserKeyACL=function(a,b){var c=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/keys/"+a,hostType:"read",callback:b})},d.prototype.deleteUserKey=function(a,b){var c=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/keys/"+a,hostType:"write",callback:b})},d.prototype.addUserKey=function(b,c,d){var e=a("isarray"),f="Usage: index.addUserKey(arrayOfAcls[, params, callback])";if(!e(b))throw new Error(f);1!==arguments.length&&"function"!=typeof c||(d=c,c=null);var g={acl:b};return c&&(g.validity=c.validity,g.maxQueriesPerIPPerHour=c.maxQueriesPerIPPerHour,g.maxHitsPerQuery=c.maxHitsPerQuery,g.description=c.description,c.queryParameters&&(g.queryParameters=this.as._getSearchParams(c.queryParameters,"")),g.referers=c.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:g,hostType:"write",callback:d})},d.prototype.addUserKeyWithValidity=g(function(a,b,c){return this.addUserKey(a,b,c)},h("index.addUserKeyWithValidity()","index.addUserKey()")),d.prototype.updateUserKey=function(b,c,d,e){var f=a("isarray"),g="Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])";if(!f(c))throw new Error(g);2!==arguments.length&&"function"!=typeof d||(e=d,d=null);var h={acl:c};return d&&(h.validity=d.validity,h.maxQueriesPerIPPerHour=d.maxQueriesPerIPPerHour,h.maxHitsPerQuery=d.maxHitsPerQuery,h.description=d.description,d.queryParameters&&(h.queryParameters=this.as._getSearchParams(d.queryParameters,"")),h.referers=d.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+b,body:h,hostType:"write",callback:e})}},{"./IndexBrowser":11,"./IndexCore.js":12,"./clone.js":19,"./deprecate.js":20,"./deprecatedMessage.js":21,"./errors":22,"./exitPromise.js":23,"./map.js":24,"./merge.js":25,inherits:56,isarray:57}],11:[function(a,b,c){"use strict";function d(){}b.exports=d;var e=a("inherits"),f=a("events").EventEmitter;e(d,f),d.prototype.stop=function(){this._stopped=!0,this._clean()},d.prototype._end=function(){this.emit("end"),this._clean()},d.prototype._error=function(a){this.emit("error",a),this._clean()},d.prototype._result=function(a){this.emit("result",a)},d.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{events:30,inherits:56}],12:[function(a,b,c){function d(a,b){this.indexName=b,this.as=a,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}}var e=a("./buildSearchMethod.js"),f=a("./deprecate.js"),g=a("./deprecatedMessage.js");b.exports=d,d.prototype.clearCache=function(){this.cache={}},d.prototype.search=e("query"),d.prototype.similarSearch=e("similarQuery"),d.prototype.browse=function(b,c,d){var e,f,g=a("./merge.js"),h=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(e=0,d=arguments[0],b=void 0):"number"==typeof arguments[0]?(e=arguments[0],"number"==typeof arguments[1]?f=arguments[1]:"function"==typeof arguments[1]&&(d=arguments[1],f=void 0),b=void 0,c=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(d=arguments[1]),c=arguments[0],b=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(d=arguments[1],c=void 0),c=g({},c||{},{page:e,hitsPerPage:f,query:b});var i=this.as._getSearchParams(c,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(h.indexName)+"/browse?"+i,hostType:"read",callback:d})},d.prototype.browseFrom=function(a,b){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(a),hostType:"read",callback:b})},d.prototype.searchForFacetValues=function(b,c){var d=a("./clone.js"),e=a("./omit.js"),f="Usage: index.searchForFacetValues({facetName, facetQuery, ...params}[, callback])";if(void 0===b.facetName||void 0===b.facetQuery)throw new Error(f);var g=b.facetName,h=e(d(b),function(a){return"facetName"===a}),i=this.as._getSearchParams(h,"");return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/facets/"+encodeURIComponent(g)+"/query",hostType:"read",body:{params:i},callback:c})},d.prototype.searchFacet=f(function(a,b){return this.searchForFacetValues(a,b)},g("index.searchFacet(params[, callback])","index.searchForFacetValues(params[, callback])")),d.prototype._search=function(a,b,c){return this.as._jsonRequest({cache:this.cache,method:"POST",url:b||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:a},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:a}},callback:c})},d.prototype.getObject=function(a,b,c){var d=this;1!==arguments.length&&"function"!=typeof b||(c=b,b=void 0);var e="";if(void 0!==b){e="?attributes=";for(var f=0;f was loaded but did not call our provided callback"),JSONPScriptError:e("JSONPScriptError","