UNPKG

vue-searchbox

Version:

Lightweight searchbox component for Vue

16 lines 80.8 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e=e||self).VueSearchbox=t(e.Vue)}(this,(function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function n(e,t){return t||(t=e.slice(0)),e.raw=t,e}
/*!
             * isobject <https://github.com/jonschlinkert/isobject>
             *
             * Copyright (c) 2014-2017, Jon Schlinkert.
             * Released under the MIT License.
             */
/*!
             * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
             *
             * Copyright (c) 2014-2017, Jon Schlinkert.
             * Released under the MIT License.
             */
function i(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function s(e){var t,r;return!1!==i(e)&&("function"==typeof(t=e.constructor)&&(!1!==i(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}var o=Object.prototype,a=o.toString,u=o.hasOwnProperty,c=/^\s*function (\w+)/;function l(e){var t=null!=e?e.type?e.type:e:null,r=t&&t.toString().match(c);return r&&r[1]}function h(){}var d=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},f=Array.isArray||function(e){return"[object Array]"===a.call(e)},p=function(e){return"[object Function]"===a.call(e)};function g(e,t,r){var n;return void 0===r&&(r=!1),Object.defineProperty(t,"_vueTypes_name",{enumerable:!1,writable:!1,value:e}),function(e){Object.defineProperty(e,"def",{value:function(e){return void 0!==e||this.default?p(e)||y(this,e)?(f(e)?this.default=function(){return[].concat(e)}:s(e)?this.default=function(){return Object.assign({},e)}:this.default=e,this):(v(this._vueTypes_name+' - invalid default value: "'+e+'"',e),this):this},enumerable:!1,writable:!1})}((n=t,Object.defineProperty(n,"isRequired",{get:function(){return this.required=!0,this},enumerable:!1}))),r&&function(e){Object.defineProperty(e,"validate",{value:function(e){return this.validator=e.bind(this),this},enumerable:!1})}(t),p(t.validator)&&(t.validator=t.validator.bind(t)),t}function y(e,t,r){void 0===r&&(r=!1);var n,i=e,o=!0;s(e)||(i={type:e});var a,d=i._vueTypes_name?i._vueTypes_name+" - ":"";if(u.call(i,"type")&&null!==i.type){if(void 0===i.type)throw new TypeError("[VueTypes error]: Setting type to undefined is not allowed.");if(!i.required&&void 0===t)return o;f(i.type)?(o=i.type.some((function(e){return y(e,t,!0)})),n=i.type.map((function(e){return l(e)})).join(" or ")):o="Array"===(n=l(i))?f(t):"Object"===n?s(t):"String"===n||"Number"===n||"Boolean"===n||"Function"===n?function(e){if(null==e)return null;var t=e.constructor.toString().match(c);return t&&t[1]}(t)===n:t instanceof i.type}return o?u.call(i,"validator")&&p(i.validator)?(r&&(a=v,v=h),o=i.validator(t),a&&(v=a),o||!1!==r||v(d+"custom validation failed"),o):o:(!1===r&&v(d+'value "'+t+'" should be of type "'+n+'"'),!1)}var v=h;var m,b,w={get any(){return g("any",{type:null},!0)},get func(){return g("function",{type:Function},!0).def(w.sensibleDefaults.func)},get bool(){return g("boolean",{type:Boolean},!0).def(w.sensibleDefaults.bool)},get string(){return g("string",{type:String},!0).def(w.sensibleDefaults.string)},get number(){return g("number",{type:Number},!0).def(w.sensibleDefaults.number)},get array(){return g("array",{type:Array},!0).def(w.sensibleDefaults.array)},get object(){return g("object",{type:Object},!0).def(w.sensibleDefaults.object)},get integer(){return g("integer",{type:Number,validator:function(e){return d(e)}}).def(w.sensibleDefaults.integer)},get symbol(){return g("symbol",{type:null,validator:function(e){return"symbol"==typeof e}},!0)},extend:function(e){void 0===e&&(e={});var t,r=e,n=r.name,i=r.validate,s=void 0!==i&&i,o=r.getter,a=void 0!==o&&o,u=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(r,["name","validate","getter"]);if(a)t={get:function(){return g(n,Object.assign({},u),s)},enumerable:!0,configurable:!1};else{var c=u.validator;t={value:function(){var e=g(n,Object.assign({},u),s);if(c){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.validator=c.bind.apply(c,[e].concat(r))}return e},writable:!1,enumerable:!0,configurable:!1}}return Object.defineProperty(this,n,t)},custom:function(e,t){if(void 0===t&&(t="custom validation failed"),"function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return g(e.name||"<<anonymous function>>",{validator:function(r){var n=e(r);return n||v(this._vueTypes_name+" - "+t),n}})},oneOf:function(e){if(!f(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");var t='oneOf - value should be one of "'+e.join('", "')+'"',r=e.reduce((function(e,t){return null!=t&&-1===e.indexOf(t.constructor)&&e.push(t.constructor),e}),[]);return g("oneOf",{type:r.length>0?r:null,validator:function(r){var n=-1!==e.indexOf(r);return n||v(t),n}})},instanceOf:function(e){return g("instanceOf",{type:e})},oneOfType:function(e){if(!f(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");var t=!1,r=e.reduce((function(e,r){if(s(r)){if("oneOf"===r._vueTypes_name)return e.concat(r.type||[]);if(r.type&&!p(r.validator)){if(f(r.type))return e.concat(r.type);e.push(r.type)}else p(r.validator)&&(t=!0);return e}return e.push(r),e}),[]);if(!t)return g("oneOfType",{type:r});var n=e.map((function(e){return e&&f(e.type)?e.type.map(l):l(e)})).reduce((function(e,t){return e.concat(f(t)?t:[t])}),[]).join('", "');return this.custom((function(t){var r=e.some((function(e){return"oneOf"===e._vueTypes_name?!e.type||y(e.type,t,!0):y(e,t,!0)}));return r||v('oneOfType - value type should be one of "'+n+'"'),r}))},arrayOf:function(e){return g("arrayOf",{type:Array,validator:function(t){var r=t.every((function(t){return y(e,t)}));return r||v('arrayOf - value must be an array of "'+l(e)+'"'),r}})},objectOf:function(e){return g("objectOf",{type:Object,validator:function(t){var r=Object.keys(t).every((function(r){return y(e,t[r])}));return r||v('objectOf - value must be an object of "'+l(e)+'"'),r}})},shape:function(e){var t=Object.keys(e),r=t.filter((function(t){return e[t]&&!0===e[t].required})),n=g("shape",{type:Object,validator:function(n){var i=this;if(!s(n))return!1;var o=Object.keys(n);return r.length>0&&r.some((function(e){return-1===o.indexOf(e)}))?(v('shape - at least one of required properties "'+r.join('", "')+'" is not present'),!1):o.every((function(r){return-1===t.indexOf(r)?!0===i._vueTypes_isLoose||(v('shape - object is missing "'+r+'" property'),!1):y(e[r],n[r])}))}});return Object.defineProperty(n,"_vueTypes_isLoose",{enumerable:!1,writable:!0,value:!1}),Object.defineProperty(n,"loose",{get:function(){return this._vueTypes_isLoose=!0,this},enumerable:!1}),n}};m=w,b={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0},Object.defineProperty(m,"sensibleDefaults",{enumerable:!1,set:function(e){b=!1===e?{}:!0===e?{func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}:e},get:function(){return b}}),w.utils={validate:function(e,t){return y(t,e,!0)},toType:g},w.sensibleDefaults=!1;var S=w.shape({field:w.string,weight:w.number}),C={app:w.string.isRequired,url:w.string.def("https://scalr.api.appbase.io"),credentials:w.string.isRequired,analytics:w.bool.def(!1),headers:w.object,dataField:w.oneOfType([w.string,w.arrayOf(w.oneOfType([w.string,S]))]),nestedField:w.string,title:w.string,defaultValue:w.string,placeholder:w.string.def("Search"),showIcon:w.bool.def(!0),iconPosition:w.oneOf(["left","right"]).def("right"),icon:w.any,showClear:w.bool.def(!1),clearIcon:w.any,autosuggest:w.bool.def(!0),strictSelection:w.bool.def(!1),defaultSuggestions:w.arrayOf(w.object),debounce:w.number.def(0),highlight:w.bool.def(!1),highlightField:w.oneOfType([w.string,w.arrayOf(w.string)]),customHighlight:w.func,queryFormat:w.oneOf(["and","or"]).def("or"),fuzziness:w.oneOf([0,1,2,"AUTO"]),showVoiceSearch:w.bool.def(!1),searchOperators:w.bool.def(!1),render:w.func,renderError:w.oneOfType([w.string,w.any]),renderNoSuggestion:w.oneOfType([w.string,w.any]),renderAllSuggestions:w.oneOfType([w.string,w.func]),renderMic:w.func,innerClass:w.object,style:w.object,defaultQuery:w.func,beforeValueChange:w.func,className:w.string.def(""),loader:w.object,autoFocus:w.bool.def(!1),currentURL:w.string.def(""),searchTerm:w.string.def("search"),URLParams:w.bool.def(!1),analyticsConfig:w.shape({emptyQuery:w.bool,suggestionAnalytics:w.bool,userId:w.string,customEvents:w.object}).def({})};var _=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(r,t),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var s=105===e.charCodeAt(1)&&64===e.charCodeAt(0);i.insertRule(e,s?0:i.cssRules.length)}catch(e){}}else n.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}();function k(e){function t(e,t,n){var i=t.trim().split(p);t=i;var s=i.length,o=e.length;switch(o){case 0:case 1:var a=0;for(e=0===o?"":e[0]+" ";a<s;++a)t[a]=r(e,t[a],n).trim();break;default:var u=a=0;for(t=[];a<s;++a)for(var c=0;c<o;++c)t[u++]=r(e[c]+" ",i[a],n).trim()}return t}function r(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(g,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function n(e,t,r,s){var o=e+";",a=2*t+3*r+4*s;if(944===a){e=o.indexOf(":",9)+1;var u=o.substring(e,o.length-1).trim();return u=o.substring(0,e).trim()+u+";",1===E||2===E&&i(u,1)?"-webkit-"+u+u:u}if(0===E||2===E&&!i(o,1))return o;switch(a){case 1015:return 97===o.charCodeAt(10)?"-webkit-"+o+o:o;case 951:return 116===o.charCodeAt(3)?"-webkit-"+o+o:o;case 963:return 110===o.charCodeAt(5)?"-webkit-"+o+o:o;case 1009:if(100!==o.charCodeAt(4))break;case 969:case 942:return"-webkit-"+o+o;case 978:return"-webkit-"+o+"-moz-"+o+o;case 1019:case 983:return"-webkit-"+o+"-moz-"+o+"-ms-"+o+o;case 883:if(45===o.charCodeAt(8))return"-webkit-"+o+o;if(0<o.indexOf("image-set(",11))return o.replace(O,"$1-webkit-$2")+o;break;case 932:if(45===o.charCodeAt(4))switch(o.charCodeAt(5)){case 103:return"-webkit-box-"+o.replace("-grow","")+"-webkit-"+o+"-ms-"+o.replace("grow","positive")+o;case 115:return"-webkit-"+o+"-ms-"+o.replace("shrink","negative")+o;case 98:return"-webkit-"+o+"-ms-"+o.replace("basis","preferred-size")+o}return"-webkit-"+o+"-ms-"+o+o;case 964:return"-webkit-"+o+"-ms-flex-"+o+o;case 1023:if(99!==o.charCodeAt(8))break;return"-webkit-box-pack"+(u=o.substring(o.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+o+"-ms-flex-pack"+u+o;case 1005:return d.test(o)?o.replace(h,":-webkit-")+o.replace(h,":-moz-")+o:o;case 1e3:switch(t=(u=o.substring(13).trim()).indexOf("-")+1,u.charCodeAt(0)+u.charCodeAt(t)){case 226:u=o.replace(b,"tb");break;case 232:u=o.replace(b,"tb-rl");break;case 220:u=o.replace(b,"lr");break;default:return o}return"-webkit-"+o+"-ms-"+u+o;case 1017:if(-1===o.indexOf("sticky",9))break;case 975:switch(t=(o=e).length-10,a=(u=(33===o.charCodeAt(t)?o.substring(0,t):o).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|u.charCodeAt(7))){case 203:if(111>u.charCodeAt(8))break;case 115:o=o.replace(u,"-webkit-"+u)+";"+o;break;case 207:case 102:o=o.replace(u,"-webkit-"+(102<a?"inline-":"")+"box")+";"+o.replace(u,"-webkit-"+u)+";"+o.replace(u,"-ms-"+u+"box")+";"+o}return o+";";case 938:if(45===o.charCodeAt(5))switch(o.charCodeAt(6)){case 105:return u=o.replace("-items",""),"-webkit-"+o+"-webkit-box-"+u+"-ms-flex-"+u+o;case 115:return"-webkit-"+o+"-ms-flex-item-"+o.replace(C,"")+o;default:return"-webkit-"+o+"-ms-flex-line-pack"+o.replace("align-content","").replace(C,"")+o}break;case 973:case 989:if(45!==o.charCodeAt(3)||122===o.charCodeAt(4))break;case 931:case 953:if(!0===k.test(e))return 115===(u=e.substring(e.indexOf(":")+1)).charCodeAt(0)?n(e.replace("stretch","fill-available"),t,r,s).replace(":fill-available",":stretch"):o.replace(u,"-webkit-"+u)+o.replace(u,"-moz-"+u.replace("fill-",""))+o;break;case 962:if(o="-webkit-"+o+(102===o.charCodeAt(5)?"-ms-"+o:"")+o,211===r+s&&105===o.charCodeAt(13)&&0<o.indexOf("transform",10))return o.substring(0,o.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+o}return o}function i(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),j(2!==t?n:n.replace(_,"$1"),r,t)}function s(e,t){var r=n(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(S," or ($1)").substring(4):"("+t+")"}function o(e,t,r,n,i,s,o,a,c,l){for(var h,d=0,f=t;d<R;++d)switch(h=P[d].call(u,e,f,r,n,i,s,o,a,c,l)){case void 0:case!1:case!0:case null:break;default:f=h}if(f!==t)return f}function a(e){return void 0!==(e=e.prefix)&&(j=null,e?"function"!=typeof e?E=1:(E=2,j=e):E=0),a}function u(e,r){var a=e;if(33>a.charCodeAt(0)&&(a=a.trim()),a=[a],0<R){var u=o(-1,r,a,a,I,x,0,0,0,0);void 0!==u&&"string"==typeof u&&(r=u)}var h=function e(r,a,u,h,d){for(var f,p,g,b,S,C=0,_=0,k=0,O=0,P=0,j=0,D=g=f=0,B=0,q=0,V=0,Q=0,z=u.length,$=z-1,M="",N="",U="",L="";B<z;){if(p=u.charCodeAt(B),B===$&&0!==_+O+k+C&&(0!==_&&(p=47===_?10:47),O=k=C=0,z++,$++),0===_+O+k+C){if(B===$&&(0<q&&(M=M.replace(l,"")),0<M.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:M+=u.charAt(B)}p=59}switch(p){case 123:for(f=(M=M.trim()).charCodeAt(0),g=1,Q=++B;B<z;){switch(p=u.charCodeAt(B)){case 123:g++;break;case 125:g--;break;case 47:switch(p=u.charCodeAt(B+1)){case 42:case 47:e:{for(D=B+1;D<$;++D)switch(u.charCodeAt(D)){case 47:if(42===p&&42===u.charCodeAt(D-1)&&B+2!==D){B=D+1;break e}break;case 10:if(47===p){B=D+1;break e}}B=D}}break;case 91:p++;case 40:p++;case 34:case 39:for(;B++<$&&u.charCodeAt(B)!==p;);}if(0===g)break;B++}switch(g=u.substring(Q,B),0===f&&(f=(M=M.replace(c,"").trim()).charCodeAt(0)),f){case 64:switch(0<q&&(M=M.replace(l,"")),p=M.charCodeAt(1)){case 100:case 109:case 115:case 45:q=a;break;default:q=F}if(Q=(g=e(a,q,g,p,d+1)).length,0<R&&(S=o(3,g,q=t(F,M,V),a,I,x,Q,p,d,h),M=q.join(""),void 0!==S&&0===(Q=(g=S.trim()).length)&&(p=0,g="")),0<Q)switch(p){case 115:M=M.replace(w,s);case 100:case 109:case 45:g=M+"{"+g+"}";break;case 107:g=(M=M.replace(y,"$1 $2"))+"{"+g+"}",g=1===E||2===E&&i("@"+g,3)?"@-webkit-"+g+"@"+g:"@"+g;break;default:g=M+g,112===h&&(N+=g,g="")}else g="";break;default:g=e(a,t(a,M,V),g,h,d+1)}U+=g,g=V=q=D=f=0,M="",p=u.charCodeAt(++B);break;case 125:case 59:if(1<(Q=(M=(0<q?M.replace(l,""):M).trim()).length))switch(0===D&&(f=M.charCodeAt(0),45===f||96<f&&123>f)&&(Q=(M=M.replace(" ",":")).length),0<R&&void 0!==(S=o(1,M,a,r,I,x,N.length,h,d,h))&&0===(Q=(M=S.trim()).length)&&(M="\0\0"),f=M.charCodeAt(0),p=M.charCodeAt(1),f){case 0:break;case 64:if(105===p||99===p){L+=M+u.charAt(B);break}default:58!==M.charCodeAt(Q-1)&&(N+=n(M,f,p,M.charCodeAt(2)))}V=q=D=f=0,M="",p=u.charCodeAt(++B)}}switch(p){case 13:case 10:47===_?_=0:0===1+f&&107!==h&&0<M.length&&(q=1,M+="\0"),0<R*T&&o(0,M,a,r,I,x,N.length,h,d,h),x=1,I++;break;case 59:case 125:if(0===_+O+k+C){x++;break}default:switch(x++,b=u.charAt(B),p){case 9:case 32:if(0===O+C+_)switch(P){case 44:case 58:case 9:case 32:b="";break;default:32!==p&&(b=" ")}break;case 0:b="\\0";break;case 12:b="\\f";break;case 11:b="\\v";break;case 38:0===O+_+C&&(q=V=1,b="\f"+b);break;case 108:if(0===O+_+C+A&&0<D)switch(B-D){case 2:112===P&&58===u.charCodeAt(B-3)&&(A=P);case 8:111===j&&(A=j)}break;case 58:0===O+_+C&&(D=B);break;case 44:0===_+k+O+C&&(q=1,b+="\r");break;case 34:case 39:0===_&&(O=O===p?0:0===O?p:O);break;case 91:0===O+_+k&&C++;break;case 93:0===O+_+k&&C--;break;case 41:0===O+_+C&&k--;break;case 40:if(0===O+_+C){if(0===f)switch(2*P+3*j){case 533:break;default:f=1}k++}break;case 64:0===_+k+O+C+D+g&&(g=1);break;case 42:case 47:if(!(0<O+C+k))switch(_){case 0:switch(2*p+3*u.charCodeAt(B+1)){case 235:_=47;break;case 220:Q=B,_=42}break;case 42:47===p&&42===P&&Q+2!==B&&(33===u.charCodeAt(Q+2)&&(N+=u.substring(Q,B+1)),b="",_=0)}}0===_&&(M+=b)}j=P,P=p,B++}if(0<(Q=N.length)){if(q=a,0<R&&(void 0!==(S=o(2,N,q,r,I,x,Q,h,d,h))&&0===(N=S).length))return L+N+U;if(N=q.join(",")+"{"+N+"}",0!=E*A){switch(2!==E||i(N,2)||(A=0),A){case 111:N=N.replace(m,":-moz-$1")+N;break;case 112:N=N.replace(v,"::-webkit-input-$1")+N.replace(v,"::-moz-$1")+N.replace(v,":-ms-input-$1")+N}A=0}}return L+N+U}(F,a,r,0,0);return 0<R&&(void 0!==(u=o(-2,h,a,a,I,x,h.length,0,0,0))&&(h=u)),"",A=0,x=I=1,h}var c=/^\0+/g,l=/[\0\r\f]/g,h=/: */g,d=/zoo|gra/,f=/([,: ])(transform)/g,p=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,m=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,S=/([\s\S]*?);/g,C=/-self|flex-/g,_=/[^]*?(:[rp][el]a[\w-]+)[^]*/,k=/stretch|:\s*\w+\-(?:conte|avail)/,O=/([^-])(image-set\()/,x=1,I=1,A=0,E=1,F=[],P=[],R=0,j=null,T=0;return u.use=function e(t){switch(t){case void 0:case null:R=P.length=0;break;default:if("function"==typeof t)P[R++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else T=0|!!t}return e},u.set=a,void 0!==e&&a(e),u}function O(e){e&&x.current.insert(e+"}")}var x={current:null},I=function(e,t,r,n,i,s,o,a,u,c){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return x.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return x.current.insert(r[0]+t),"";default:return t+(0===c?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(O)}};var A={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var E,F,P=/[A-Z]|^ms/g,R=/_EMO_([^_]+?)_([^]*?)_EMO_/g,j=function(e){return 45===e.charCodeAt(1)},T=(E=function(e){return j(e)?e:e.replace(P,"-$&").toLowerCase()},F={},function(e){return void 0===F[e]&&(F[e]=E(e)),F[e]}),D=function(e,t){if(null==t||"boolean"==typeof t)return"";switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(R,(function(e,t,r){return q={name:t,styles:r,next:q},t}))}return 1===A[e]||j(e)||"number"!=typeof t||0===t?t:t+"px"};function B(e,t,r,n){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return q={name:r.name,styles:r.styles,next:q},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)q={name:i.name,styles:i.styles,next:q},i=i.next;return r.styles}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=B(e,t,r[i],!1);else for(var s in r){var o=r[s];if("object"!=typeof o)null!=t&&void 0!==t[o]?n+=s+"{"+t[o]+"}":n+=T(s)+":"+D(s,o)+";";else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var a=B(e,t,o,!1);switch(s){case"animation":case"animationName":n+=T(s)+":"+a+";";break;default:n+=s+"{"+a+"}"}}else for(var u=0;u<o.length;u++)n+=T(s)+":"+D(s,o[u])+";"}return n}(e,t,r);case"function":if(void 0!==e){var s=q,o=r(e);return q=s,B(e,t,o,n)}default:if(null==t)return r;var a=t[r];return void 0===a||n?r:a}}var q,V=/label:\s*([^\s;\n{]+)\s*;/g,Q=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";q=void 0;var s=e[0];null==s||void 0===s.raw?(n=!1,i+=B(r,t,s,!1)):i+=s[0];for(var o=1;o<e.length;o++)i+=B(r,t,e[o],46===i.charCodeAt(i.length-1)),n&&(i+=s[o]);V.lastIndex=0;for(var a,u="";null!==(a=V.exec(i));)u+="-"+a[1];return{name:function(e){for(var t,r=e.length,n=r^r,i=0;r>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(t>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),r-=4,++i;switch(r){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)}(i)+u,styles:i,next:q}};function z(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]):n+=r+" "})),n}var $=function(e,t,r){var n=e.key+"-"+t.name;if(!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var i=t;do{e.insert("."+n,i,e.sheet,!0);i=i.next}while(void 0!==i)}};function M(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function N(e,t,r){var n=[],i=z(e,n,r);return n.length<2?r:i+t(n)}var U=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(null!=i){var s=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))s=e(i);else for(var o in s="",i)i[o]&&o&&(s&&(s+=" "),s+=o);break;default:s=i}s&&(r&&(r+=" "),r+=s)}}return r},L=function(e){var t=function(e){void 0===e&&(e={});var t,r=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var n,i=new k(t),s={};n=e.container||document.head;var o,a=document.querySelectorAll("style[data-emotion-"+r+"]");Array.prototype.forEach.call(a,(function(e){e.getAttribute("data-emotion-"+r).split(" ").forEach((function(e){s[e]=!0})),e.parentNode!==n&&n.appendChild(e)})),i.use(e.stylisPlugins)(I),o=function(e,t,r,n){var s=t.name;x.current=r,i(e,t.styles),n&&(u.inserted[s]=!0)};var u={key:r,sheet:new _({key:r,container:n,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:s,registered:{},insert:o};return u}(e);t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var r=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=Q(r,t.registered,void 0!==this?this.mergedProps:void 0);return $(t,i,!1),t.key+"-"+i.name};return{css:r,cx:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return N(t.registered,r,U(n))},injectGlobal:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=Q(r,t.registered);M(t,i)},keyframes:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=Q(r,t.registered),s="animation-"+i.name;return M(t,{name:i.name,styles:"@keyframes "+s+"{"+i.styles+"}"}),s},hydrate:function(e){e.forEach((function(e){t.inserted[e]=!0}))},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:z.bind(null,t.registered),merge:N.bind(null,t.registered,r)}}(),H=L.getRegisteredStyles,W=L.css,X=function(e){for(var t=arguments,r=1;r<arguments.length;r++)for(var n in arguments[r])e[n]=t[r][n];return e},G="__emotion_styles";function K(e){return(K="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 Y(e){return Array.isArray(e)?e.join(" "):"object"===K(e)?Object.keys(e).filter((function(t){return Boolean(e[t])})).join(" "):e}var J=function(e,t){var r,n,i,s;void 0!==t&&(r=t.e,n=t.label,i=t.target,s=t.props);var o=e.__emotion_real===e,a=void 0===r&&o&&e.__emotion_base||e;return function(){var t=o&&void 0!==e[G]?e[G].slice(0):[];if(void 0!==n&&t.push("label:".concat(n,";")),void 0===r){for(var u=arguments.length,c=new Array(u),l=0;l<u;l++)c[l]=arguments[l];if(null===c[0]||void 0===c[0].raw)t.push.apply(t,c);else{t.push(c[0][0]);for(var h=c.length,d=1;d<h;d++)t.push(c[d],c[0][d])}}var f={name:"Styled".concat(e.name||n||"Component"),functional:!0,inject:{theme:{from:"theme_reactivesearch",default:null}},props:s,render:function(n,s){var o=s.data,a=s.children,u=s.props,c=s.injections,l="",h=[],d=Y(o.class),f={};for(var p in o.attrs)"$"!==p[0]&&(f[p]=o.attrs[p]);if(d&&(l+=void 0===r?H(h,d):"".concat(d," ")),void 0===r){var g={mergedProps:X({theme:c.theme},u)};l+=W.apply(g,t.concat(h))}else l+=r;return void 0!==i&&(l+=" ".concat(i)),n(e,X({},o,{attrs:f,class:l}),a)}};return f[G]=t,f.__emotion_base=a,f.__emotion_real=f,Object.defineProperty(f,"toString",{enumerable:!1,value:function(){return".".concat(i)}}),f}};function Z(){var e=n(["\n      padding-right: 48px;\n    "]);return Z=function(){return e},e}function ee(){var e=n(["\n      padding-right: 32px;\n    "]);return ee=function(){return e},e}function te(){var e=n(["\n      padding-right: 32px;\n    "]);return te=function(){return e},e}function re(){var e=n(["\n      padding-left: 32px;\n    "]);return re=function(){return e},e}function ne(){var e=n(["\n  ","\n\n  ",";\n\n  ",";\n\n  ",";\n\n  ",";\n"]);return ne=function(){return e},e}function ie(){var e=n(["\n  width: 100%;\n  height: 42px;\n  padding: 8px 12px;\n  border: 1px solid #ccc;\n  background-color: #fafafa;\n  font-size: 0.9rem;\n  outline: none;\n  box-sizing: border-box;\n\n  &:focus {\n    background-color: #fff;\n  }\n"]);return ie=function(){return e},e}var se=W(ie()),oe=J("input")(ne(),se,(function(e){return e.showIcon&&"left"===e.iconPosition&&W(re())}),(function(e){return e.showIcon&&"right"===e.iconPosition&&W(te())}),(function(e){return e.showClear&&W(ee())}),(function(e){return e.showClear&&e.showIcon&&"right"===e.iconPosition&&W(Z())})),ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var ue=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){var r=function(e){function t(){this.fetch=!1,this.DOMException=e.DOMException}return t.prototype=e,new t}("undefined"!=typeof self?self:ae);!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function c(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function l(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function h(e){var t=new FileReader,r=l(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=c(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,r,n=c(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=l(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=o(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=o(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),a(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),a(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),a(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,n,i=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function v(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var m=[301,302,303,307,308];v.redirect=function(e,t){if(-1===m.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function b(e,n){return new Promise((function(i,s){var o=new g(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new v(n,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&r.blob&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",c)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}b.polyfill=!0,e.fetch||(e.fetch=b,e.Headers=u,e.Request=g,e.Response=v),t.Headers=u,t.Request=g,t.Response=v,t.fetch=b}({})}(r),delete r.fetch.polyfill,(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t}));ue.fetch,ue.Headers,ue.Request,ue.Response;function ce(){return(ce=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function le(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function he(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function de(e){var t="";return e&&Object.keys(e).forEach((function(r,n){t+=r+"="+e[r],n<Object.keys(e).length-1&&(t+=",")})),t}function fe(e){return e&&""!==e.trim()?e:"https://scalr.api.appbase.io"}function pe(e){void 0===e&&(e="");for(var t,r=e,n="",i=0,s=0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.charAt(0|s)||(o="=",s%1);n+=o.charAt(63&i>>8-s%1*8)){if((t=r.charCodeAt(s+=.75))>255)throw new Error('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');i=i<<8|t}return n}function ge(e){void 0===e&&(e={}),this.index=e.index,this.credentials=e.credentials,this.url=fe(e.url),this.userID=e.userID,this.customEvents=e.customEvents,this.searchQuery=void 0,this.searchID=void 0,this.searchState=null,this.filters=null,this.emptyQuery=void 0===e.emptyQuery||e.emptyQuery,this.headers=null}function ye(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ve(e,t,r){return t&&ye(e.prototype,t),r&&ye(e,r),e}function me(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function be(){return(be=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var we=function(e){var t=[];return e&&(t=[].concat(e).map((function(e){var t={};e._updated?t._updated=e._updated:e._deleted&&(t._deleted=e._deleted);var r=function(e){var t=be({},e);return t.highlight&&Object.keys(t.highlight).forEach((function(e){var r,n=t.highlight[e][0];t._source=be({},t._source,((r={})[e]=n,r))})),t}(e);return Object.keys(r).filter((function(e){return"_source"!==e})).reduce((function(e,t){return e[t]=r[t],e}),be({},r._source,{},t))}))),t},Se=function(e){return"object"==typeof e?Array.isArray(e)?function e(t){return t.reduce((function(t,r){return t.concat(Array.isArray(r)?e(r):r)}),[])}(e):null:e},Ce=function(e,t,r){void 0===e&&(e=[]),void 0===r&&(r="");var n=[],i=[],s=function(e,t,s){if(r.trim().split(" ").some((function(t){return String(e).toLowerCase().includes(t)}))&&!i.includes(e)){var o={label:e,value:e,source:s};i=[].concat(i,[e]),n=[].concat(n,[o])}};return t.forEach((function(t){var r=t._score,n=t._index,i=t._type,o=be({},t,{_id:t._id,_index:n,_score:r,_type:i});e.forEach((function(e){!function e(t,r,n){if(void 0===n&&(n=t),"object"==typeof t){var i=r.split("."),o=t[i[0]];if(o)if(i.length>1){var a=r.substring(i[0].length+1);Array.isArray(o)?o.forEach((function(t){e(t,a,n)})):e(o,a,n)}else{var u=Se(o);u&&(Array.isArray(u)?u.forEach((function(e){return s(e,0,n)})):s(u,0,n))}}}(o,e)}))})),n},_e=function(){function e(e){var t=this;me(this,"data",void 0),me(this,"raw",void 0),me(this,"parseResults",void 0),me(this,"setRaw",(function(e){t.raw=e,e.hits&&e.hits.hits&&t.setData(e.hits.hits)})),this.data=e||[]}return e.prototype.setData=function(e){var t=we(e);if(this.promotedData.length){var r=this.promotedData.map((function(e){return e._id})).filter(Boolean);r&&(t=t.filter((function(e){return!r.includes(e._id)}))),t=[].concat(this.promotedData,t)}this.parseResults?this.data=this.parseResults(t):this.data=t},ve(e,[{key:"numberOfResults",get:function(){return this.raw&&this.raw.hits?"object"==typeof this.raw.hits.total?this.raw.hits.total.value:this.raw.hits.total:0}},{key:"time",get:function(){return this.raw?this.raw.took:0}},{key:"promotedData",get:function(){return this.raw&&this.raw.promoted&&this.raw.promoted||[]}},{key:"rawData",get:function(){return this.raw&&this.raw.hits&&this.raw.hits&&this.raw.hits.hits||[]}}]),e}(),ke=function(){function e(){me(this,"observers",void 0),this.observers=[]}var t=e.prototype;return t.subscribe=function(e,t){this.observers.push({callback:e,properties:t})},t.unsubscribe=function(e){this.observers=e?this.observers.filter((function(t){return t.callback!==e?t:null})):[]},t.next=function(e,t,r){var n=r||window;this.observers.forEach((function(r){void 0===r.properties?r.callback.call(n,e):r.properties instanceof Array&&r.properties.length&&r.properties.includes(t)?r.callback.call(n,e):"string"==typeof r.properties&&r.properties&&r.properties===t&&r.callback.call(n,e)}))},e}(),Oe={inactive:"INACTIVE",active:"ACTIVE",denied:"DENIED"},xe={inactive:"INACTIVE",pending:"PENDING",error:"ERROR"},Ie={triggerQuery:!0,triggerSuggestionsQuery:!1,stateChanges:!0},Ae={stateChanges:!0},Ee=function(){function e(e){var t=this,r=e.index,n=e.url,i=e.credentials,s=e.analytics,o=e.headers,a=e.value,u=e.suggestions,c=e.results,l=e.fuzziness,h=e.searchOperators,d=e.queryFormat,f=e.size,p=e.from,g=e.dataField,y=e.includeFields,v=e.excludeFields,m=e.transformQuery,b=e.transformSuggestionsQuery,w=e.transformRequest,S=e.transformResponse,C=e.beforeValueChange,_=e.sortBy,k=e.nestedField,O=e.sortOptions,x=e.sortByField,I=e.highlight,A=e.highlightField;if(me(this,"index",void 0),me(this,"url",void 0),me(this,"credentials",void 0),me(this,"analytics",void 0),me(this,"value",void 0),me(this,"headers",void 0),me(this,"suggestions",void 0),me(this,"suggestionsError",void 0),me(this,"results",void 0),me(this,"error",void 0),me(this,"stateChanges",void 0),me(this,"requestStatus",void 0),me(this,"suggestionsRequestStatus",void 0),me(this,"nestedField",void 0),me(this,"queryFormat",void 0),me(this,"searchOperators",void 0),me(this,"size",void 0),me(this,"from",void 0),me(this,"fuzziness",void 0),me(this,"sortBy",void 0),me(this,"sortByField",void 0),me(this,"dataField",void 0),me(this,"includeFields",void 0),me(this,"excludeFields",void 0),me(this,"sortOptions",void 0),me(this,"highlight",void 0),me(this,"highlightField",void 0),me(this,"analyticsInstance",void 0),me(this,"onValueChange",void 0),me(this,"onResults",void 0),me(this,"onSuggestions",void 0),me(this,"onError",void 0),me(this,"onSuggestionsError",void 0),me(this,"onRequestStatusChange",void 0),me(this,"onSuggestionsRequestStatusChange",void 0),me(this,"onQueryChange",void 0),me(this,"onSuggestionsQueryChange",void 0),me(this,"onMicStatusChange",void 0),me(this,"transformQuery",void 0),me(this,"transformSuggestionsQuery",void 0),me(this,"transformRequest",void 0),me(this,"transformResponse",void 0),me(this,"beforeValueChange",void 0),me(this,"_query",void 0),me(this,"_suggestionsQuery",void 0),me(this,"_queryOptions",void 0),me(this,"_micStatus",void 0),me(this,"_micInstance",void 0),me(this,"onMicClick",(function(e,r){void 0===e&&(e={}),void 0===r&&(r=Ie);var n=t._micStatus;if(window.SpeechRecognition=window.webkitSpeechRecognition||window.SpeechRecognition||null,window.SpeechRecognition&&n!==Oe.denied){n===Oe.active&&t._setMicStatus(Oe.inactive,r);var i=window.SpeechRecognition;if(t._micInstance)return void t._stopMic();t._micInstance=new i,t._micInstance.continuous=!0,t._micInstance.interimResults=!0,Object.assign(t._micInstance,e),t._micInstance.start(),t._micInstance.onstart=function(){t._setMicStatus(Oe.active,r)},t._micInstance.onresult=function(e){var n=e.results;n&&n[0]&&n[0].isFinal&&t._stopMic(),t._handleVoiceResults({results:n},r)},t._micInstance.onerror=function(e){"no-speech"===e.error||"audio-capture"===e.error?t._setMicStatus(Oe.inactive,r):"not-allowed"===e.error&&t._setMicStatus(Oe.denied,r),console.error(e)}}})),me(this,"_handleVoiceResults",(function(e,r){var n=e.results;void 0===r&&(r=Ie),n&&n[0]&&n[0].isFinal&&n[0][0]&&n[0][0].transcript&&n[0][0].transcript.trim()&&t.setValue(n[0][0].transcript.trim(),r)})),me(this,"_stopMic",(function(){t._micInstance&&(t._micInstance.stop(),t._micInstance=null,t._setMicStatus(Oe.inactive))})),me(this,"_setMicStatus",(function(e,r){void 0===r&&(r=Ie);var n=t._micStatus;t._micStatus=e,t._applyOptions(r,"micStatus",n,t._micStatus)})),me(this,"_parseSuggestions",(function(e){var r=[];return"string"===t.dataField?r=[t.dataField]:Array.isArray(t.dataField)&&t.dataField.forEach((function(e){"object"==typeof e?r.push(e.field):r.push(e)})),Ce(r,e,t.value).slice(0,t.size)})),!r)throw new Error("Please provide a valid index.");if(!n)throw new Error("Please provide a valid url.");if(!g)throw new Error("Please provide a valid data field.");this.index=r,this.url=n,this.analytics=s||!1,this.analytics&&(this.analyticsInstance=function(e){void 0===e&&(e={});var t=new ge(e);return ge.prototype.setIndex=function(e){return this.index=e,this},ge.prototype.setCredentials=function(e){return this.credentials=e,this},ge.prototype.setURL=function(e){return this.url=fe(e),this},ge.prototype.setHeaders=function(e){return this.headers=e,this},ge.prototype.setSearchQuery=function(e){return this.searchQuery=e,this},ge.prototype.clearSearchQuery=function(){return this.searchQuery=void 0,this},ge.prototype.setSearchID=function(e){return this.searchID=e,this},ge.prototype.clearSearchID=function(){return this.searchID=void 0,this},ge.prototype.setSearchState=function(e){return this.searchState=e,this},ge.prototype.clearSearchState=function(){return this.searchState=null,this},ge.prototype.setUserID=function(e){return this.userID=e,this},ge.prototype.clearUserID=function(){return this.userID=null,this},ge.prototype.setCustomEvents=function(e){return this.customEvents=e,this},ge.prototype.clearCustomEvents=function(){return this.customEvents=null,this},ge.prototype.addCustomEvent=function(e){return this.customEvents=ce({},this.customEvents,{customEvent:e}),this},ge.prototype.removeCustomEvent=function(e){var t=this.customEvents,r=(t[e],le(t,[e].map(he)));return this.customEvents=r,this},ge.prototype.setFilters=function(e){return this.filters=e,this},ge.prototype.clearFilters=function(){return this.filters=null,this},ge.prototype.addFilter=function(e){return this.filters=ce({},this.filters,{filter:e}),this},ge.prototype.removeFilter=function(e){var t=this.filters,r=(t[e],le(t,[e].map(he)));return this.filters=r,this},ge.prototype.enableEmptyQuery=function(){return this.emptyQuery=!0,this},ge.prototype.disableEmptyQuery=function(){return this.emptyQuery=!1,this},ge.prototype.registerClick=function(e,t){if(Number.isNaN(parseInt(e,10)))throw new Error("appbase-analytics: click position must be an integer.");var r=this._recordEventHeaders();return ue(this.url+"/"+this.index+"/_analytics",{method:"POST",headers:ce({},r,{},t?{"X-Search-Suggestions-Click":!0,"X-Search-Suggestions-ClickPosition":e}:{"X-Search-Click":!0,"X-Search-ClickPosition":e})})},ge.prototype.registerConversion=function(){var e=this._recordEventHeaders();return ue(this.url+"/"+this.index+"/_analytics",{method:"POST",headers:ce({},e,{"X-Search-Conversion":!0})})},ge.prototype.getAnalyticsHeaders=function(){return ce({},this.searchQuery||this.emptyQuery?{"X-Search-Query":this.searchQuery||""}:null,{},this.searchID?{"X-Search-Id":this.searchID}:null,{},this.searchState?{"X-Search-State":JSON.stringify(this.searchState)}:null,{},this.userID?{"X-User-Id":this.userID}:null,{},this.customEvents?{"X-Search-CustomEvent":de(this.customEvents)}:null,{},this.filters?{"X-Search-Filters":de(this.filters)}:null)},ge.prototype._recordEventHeaders=function(){if(!this.index)throw new Error("appbase-analytics: A valid index must be present to record an event.");if(!this.credentials)throw new Error("appbase-analytics: Auth credentials is missing.");if(!this.searchID)throw new Error("appbase-analytics: searchID must be present to record an event.");return ce({},this.headers,{"Content-Type":"application/json",Authorization:"Basic "+pe(this.credentials),"X-Search-Id":this.searchID},this.userID?{"X-User-Id":this.userID}:null,{},this.customEvents?{"X-Search-CustomEvent":de(this.customEvents)}:null)},t}({index:r,url:n,credentials:i})),this.dataField=g,this.credentials=i||"",this.nestedField=k||"",this.queryFormat=d||"or",this.fuzziness=l||0,this.searchOperators=h||!1,this.size=Number(f)||10,this.from=Number(p)||0,this.sortBy=_||"",this.includeFields=y||["*"],this.excludeFields=v||[],this.sortOptions=O||null,this.sortByField=x||"",this.highlight=I,this.highlightField=A,this.requestStatus=xe.inactive,this.suggestionsRequestStatus=xe.inactive,this.transformRequest=w||null,this.transformResponse=S||null,this.transformQuery=m||null,this.transformSuggestionsQuery=b||null,this.beforeValueChange=C||null,this.stateChanges=new ke,this.suggestions=new _e(u),this.suggestions.parseResults=this._parseSuggestions,this.results=new _e(c),this.headers={Accept:"application/json","Content-Type":"application/json"},this.credentials&&(this.headers=be({},this.headers,{Authorization:"Basic "+btoa(this.credentials)})),o&&this.setHeaders(o,{stateChanges:!1}),a?this.setValue(a,{stateChanges:!0}):this.value=""}var t=e.prototype;return t.subscribeToStateChanges=function(e,t){this.stateChanges.subscribe(e,t)},t.unsubscribeToStateChanges=function(e){this.stateChanges.unsubscribe(e)},t.setHeaders=function(e,t){void 0===t&&(t=Ie);var r=this.headers;this.headers=be({},this.headers,{},e),this._applyOptions(t,"headers",r,this.headers)},t.setSize=function(e,t){void 0===t&&(t=Ie);var r=this.size;this.size=e,this._applyOptions(t,"size",r,this.size)},t.setFrom=function(e,t){void 0===t&&(t=Ie);var r=this.from;this.from=e,this._applyOptions(t,"from",r,this.from)},t.setFuzziness=function(e,t){void 0===t&&(t=Ie);var r=this.fuzziness;this.fuzziness=e,this._applyOptions(t,"fuzziness",r,this.fuzziness)},t.setIncludeFields=function(e,t){void 0===t&&(t=Ie);var r=this.includeFields;this.includeFields=e,this._applyOptions(t,"includeFields",r,e)},t.setExcludeFields=function(e,t){void 0===t&&(t=Ie);var r=this.excludeFields;this.excludeFields=e,this._applyOptions(t,"excludeFields",r,e)},t.setSortBy=function(e,t){void 0===t&&(t=Ie);var r=this.sortBy;this.sortBy=e,this._applyOptions(t,"sortBy",r,e)},t.setSortByField=function(e,t){void 0===t&&(t=Ie);var r=this.sortByField;this.sortByField=e,this._applyOptions(t,"sortByField",r,e)},t.setNestedField=function(e,t){void 0===t&&(t=Ie);var r=this.nestedField;this.nestedField=e,this._applyOptions(t,"nestedField",r,e)},t.setDataField=function(e,t){void 0===t&&(t=Ie);var r=this.dataField;this.dataField=e,this._applyOptions(t,"dataField",r,e)},t.setResults=function(e,t){if(void 0===t&&(t=Ae),e){var r=this.results;this.results=new _e(e),this._applyOptions({stateChanges:t.stateChanges},"results",r,this.results)}},t.setSuggestions=function(e,t){if(void 0===t&&(t=Ae),e){var r=this.suggestions;this.suggestions=new _e(e),this.suggestions.parseResults=this._parseSuggestions,this._applyOptions({stateChanges:t.stateChanges},"suggestions",r,this.suggestions)}},t.setValue=function(e,t){var r=this;void 0===t&&(t=Ie);var n=function(){var n=r.value;r.value=e,r._applyOptions(t,"value",n,r.value)};this.beforeValueChange?this.beforeValueChange(e).then(n).catch((function(e){console.warn("beforeValueChange rejected the promise with ",e)})):n()},t.triggerQuery=function(e){var t=this;void 0===e&&(e=Ae);var r=function(r){return t._setError(r,{stateChanges:e.stateChanges}),console.error(r),Promise.reject(r)};try{return this._updateQuery(),this._setRequestStatus(xe.pending),(this.transformQuery?this.transformQuery(this.query):new Promise((function(e){return e(t.query)}))).then((function(n){t._fetchRequest(n).then((function(r){t._setRequestStatus(xe.inactive);var n=t.results;return t.results.setRaw(r),t._applyOptions({stateChanges:e.stateChanges},"results",n,t.results),Promise.resolve(r)})).catch(r)})).catch(r)}catch(e){return r(e)}},t.triggerSuggestionsQuery=function(e){var t=this;void 0===e&&(e=Ae);var r=function(r){return t._setSuggestionsError(r,{stateChanges:e.stateChanges}),console.error(r),Promise.reject(r)};try{return this._updateSuggestionsQuery(),this._setSuggestionsRequestStatus(xe.pending),(this.transformSuggestionsQuery?this.transformSuggestionsQuery(this.suggestionsQuery):new Promise((function(e){return e(t.suggestionsQuery)}))).then((function(n){t._fetchRequest(n).then((function(r){t._setSuggestionsRequestStatus(xe.inactive);var n=t.suggestions;return t.suggestions.setRaw(r),t._applyOptions({stateChanges:e.stateChanges},"suggestions",n,t.suggestions),Promise.resolve(r)})).catch(r)})).catch(r)}catch(e){return r(e)}},t._handleTransformResponse=function(e){return this.transformResponse&&"function"==typeof this.transformResponse?this.transformResponse(e):new Promise((function(t){return t(e)}))},t._handleTransformRequest=function(e){return this.transformRequest&&"function"==typeof this.transformRequest?this.transformRequest(e):new Promise((function(t){return t(e)}))},t._fetchRequest=function(e){var t=this,r={method:"POST",body:JSON.stringify(e),headers:be({},this.headers,{},this.analytics?this.analyticsInstance.setSearchQuery(this.value).getAnalyticsHeaders():null)};return new Promise((function(e,n){t._handleTransformRequest(r).then((function(r){var i=Date.now();return ue(t.url+"/"+t.index+"/_search",r).then((function(r){var s=r.headers;return r.headers&&t.analytics&&t.analyticsInstance.setSearchID(r.headers.get("X-Search-Id")||null),r.status>=500?n(r):r.status>=400?n(r):r.json().then((function(r){t._handleTransformResponse(r).then((function(t){t&&Object.prototype.hasOwnProperty.call(t,"error")&&n(t);var r=be({},t,{_timestamp:i,_headers:s});return e(r)})).catch((function(e){return console.warn("transformResponse rejected the promise with ",e),n(e)}))}))})).catch((function(e){return n(e)}))})).catch((function(e){return console.warn("transformRequest rejected the promise with ",e),n(e)}))}))},t._setSuggestionsError=function(e,t){void 0===t&&(t=Ie),this._setSuggestionsRequestStatus(xe.error);var r=this.suggestionsError;this.suggestionsError=e,this._applyOptions(t,"suggestionsError",r,this.suggestionsError)},t._setError=function(e,t){void 0===t&&(t=Ie),this._setRequestStatus(xe.error);var r=this.error;this.error=e,this._applyOptions(t,"error",r,this.error)},t._setRequestStatus=function(e){var t=this.requestStatus;this.requestStatus=e,this._applyOptions({stateChanges:!0},"requestStatus",t,this.requestStatus)},t._setSuggestionsRequestStatus=function(e){var t=this.suggestionsRequestStatus;this.suggestionsRequestStatus=e,this._applyOptions({stateChanges:!0},"suggestionsRequestStatus",t,this.suggestionsRequestStatus)},t._updateQuery=function(t,r){var n=e.generateQueryOptions({excludeFields:this.excludeFields,includeFields:this.includeFields,size:this.size,from:this.from,sortBy:this.sortBy,sortByField:this.sortByField,sortOptions:this.sortOptions}),i=t||e.defaultQuery(this.value,{dataField:this.dataField,searchOperators:this.searchOperators,queryFormat:this.queryFormat,fuzziness:this.fuzziness,nestedField:this.nestedField})||{match_all:{}},s=this._query;this._query=be({query:i},e.highlightQuery(this.highlight,this.highlightField,this.dataField),{},n,{},r),this._applyOptions({stateChanges:!1},"query",s,this._query)},t._updateSuggestionsQuery=function(t,r){var n=e.generateQueryOptions({size:10}),i=t||e.defaultQuery(this.value,{dataField:this.dataField,searchOperators:this.searchOperators,queryFormat:this.queryFormat,fuzziness:this.fuzziness,nestedField:this.nestedField})||{match_all:{}},s=this._suggestionsQuery;this._suggestionsQuery=be({query:i},e.highlightQuery(this.highlight,this.highlightField,this.dataField),{},n,{},r),this._applyOptions({stateChanges:!1},"suggestionsQuery",s,this._suggestionsQuery)},t._applyOptions=function(e,t,r,n){var i;("micStatus"===t&&this.onMicStatusChange&&this.onMicStatusChange(n,r),"query"===t&&this.onQueryChange&&this.onQueryChange(n,r),"suggestionsQuery"===t&&this.onSuggestionsQueryChange&&this.onSuggestionsQueryChange(n,r),"value"===t&&this.onValueChange&&this.onValueChange(n,r),"error"===t&&this.onError&&this.onError(n),"suggestionsError"===t&&this.onSuggestionsError&&this.onSuggestionsError(n),"results"===t&&this.onResults&&this.onResults(n,r),"suggestions"===t&&this.onSuggestions&&this.onSuggestions(n,r),"requestStatus"===t&&this.onRequestStatusChange&&this.onRequestStatusChange(n,r),"suggestionsRequestStatus"===t&&this.onSuggestionsRequestStatusChange&&this.onSuggestionsRequestStatusChange(n,r),e.triggerQuery&&this.triggerQuery(),e.triggerSuggestionsQuery&&this.triggerSuggestionsQuery(),!1!==e.stateChanges)&&this.stateChanges.next(((i={})[t]={prev:r,next:n},i),t)},ve(e,[{key:"micStatus",get:function(){return this._micStatus}},{key:"micInstance",get:function(){return this._micInstance}},{key:"micActive",get:function(){return this._micStatus===Oe.active}},{key:"micInactive",get:function(){return this._micStatus===Oe.inactive}},{key:"micDenied",get:function(){return this._micStatus===Oe.denied}},{key:"query",get:function(){return this._query}},{key:"suggestionsQuery",get:function(){return this._suggestionsQuery}},{key:"requestPending",get:function(){return this.requestStatus===xe.pending}},{key:"suggestionsRequestPending",get:function(){return this.suggestionsRequestStatus===xe.pending}}]),e}();function Fe(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function Pe(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function Re(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return Pe(r.overflowY,t)||Pe(r.overflowX,t)}return!1}function je(e,t,r,n,i,s,o,a){return s<e&&o>t||s>e&&o<t?0:s<=e&&a<=r||o>=t&&a>=r?s-e-n:o>t&&a<r||s<e&&a>r?o-t+i:0}me(Ee,"defaultQuery",void 0),me(Ee,"shouldQuery",void 0),me(Ee,"highlightQuery",void 0),me(Ee,"generateQueryOptions",void 0),Ee.defaultQuery=function(e,t){var r,n=null;return e&&(r=Array.isArray(t.dataField)?t.dataField:[t.dataField],n=t.searchOperators?{simple_query_string:Ee.shouldQuery(e,r,t)}:{bool:{should:Ee.shouldQuery(e,r,t),minimum_should_match:"1"}}),""===e&&(n=null),n&&t.nestedField&&(n={nested:{path:t.nestedField,query:n}}),n},Ee.shouldQuery=function(e,t,r){void 0===r&&(r={searchOperators:!1,queryFormat:"or",fuzziness:0});var n=t.map((function(e){return"object"==typeof e?e.field+(e.weight?"^"+e.weight:""):e}));return r.searchOperators?{query:e,fields:n,default_operator:r.queryFormat}:"and"===r.queryFormat?[{multi_match:{query:e,fields:n,type:"cross_fields",operator:"and"}},{multi_match:{query:e,fields:n,type:"phrase_prefix",operator:"and"}}]:[{multi_match:{query:e,fields:n,type:"best_fields",operator:"or",fuzziness:r.fuzziness}},{multi_match:{query:e,fields:n,type:"phrase_prefix",operator:"or"}}]},Ee.highlightQuery=function(e,t,r){if(!e)return null;var n={},i=t||r,s="string"==typeof t?[t]:t;return"string"==typeof i?n[i]={}:Array.isArray(i)&&i.forEach((function(e){"object"==typeof e?n[e.field]={}:n[e]={}})),{highlight:be({pre_tags:["<mark>"],post_tags:["</mark>"],fields:n},s&&{require_field_match:!1})}},Ee.generateQueryOptions=function(e){var t,r={};if(void 0!==e.size&&(r.size=e.size),void 0!==e.from&&(r.from=e.from),e.includeFields||e.excludeFields){var n={};e.includeFields&&(n.includes=e.includeFields),e.excludeFields&&(n.excludes=e.excludeFields),r._source=n}if(e.sortOptions)r.sort=[(t={},t[e.sortOptions[0].dataField]={order:e.sortOptions[0].sortBy},t)];else if(e.sortBy&&e.sortByField){var i;r.sort=[(i={},i[e.sortByField]={order:e.sortBy},i)]}return r};var Te=function(e,t){return e&&e[t]||""},De=function(e,t){null!==e&&function(e,t){var r=t.scrollMode,n=t.block,i=t.inline,s=t.boundary,o=t.skipOverflowHiddenElements,a="function"==typeof s?s:function(e){return e!==s};if(!Fe(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,c=[],l=e;Fe(l)&&a(l);){if((l=l.parentNode)===u){c.push(l);break}l===document.body&&Re(l)&&!Re(document.documentElement)||Re(l,o)&&c.push(l)}for(var h=window.visualViewport?visualViewport.width:innerWidth,d=window.visualViewport?visualViewport.height:innerHeight,f=window.scrollX||pageXOffset,p=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,v=g.width,m=g.top,b=g.right,w=g.bottom,S=g.left,C="start"===n||"nearest"===n?m:"end"===n?w:m+y/2,_="center"===i?S+v/2:"end"===i?b:S,k=[],O=0;O<c.length;O++){var x=c[O],I=x.getBoundingClientRect(),A=I.height,E=I.width,F=I.top,P=I.right,R=I.bottom,j=I.left;if("if-needed"===r&&m>=0&&S>=0&&w<=d&&b<=h&&m>=F&&w<=R&&S>=j&&b<=P)return k;var T=getComputedStyle(x),D=parseInt(T.borderLeftWidth,10),B=parseInt(T.borderTopWidth,10),q=parseInt(T.borderRightWidth,10),V=parseInt(T.borderBottomWidth,10),Q=0,z=0,$="offsetWidth"in x?x.offsetWidth-x.clientWidth-D-q:0,M="offsetHeight"in x?x.offsetHeight-x.clientHeight-B-V:0;if(u===x)Q="start"===n?C:"end"===n?C-d:"nearest"===n?je(p,p+d,d,B,V,p+C,p+C+y,y):C-d/2,z="start"===i?_:"center"===i?_-h/2:"end"===i?_-h:je(f,f+h,h,D,q,f+_,f+_+v,v),Q=Math.max(0,Q+p),z=Math.max(0,z+f);else{Q="start"===n?C-F-B:"end"===n?C-R+V+M:"nearest"===n?je(F,R,A,B,V+M,C,C+y,y):C-(F+A/2)+M/2,z="start"===i?_-j-D:"center"===i?_-(j+E/2)+$/2:"end"===i?_-P+q+$:je(j,P,E,D,q+$,_,_+v,v);var N=x.scrollLeft,U=x.scrollTop;C+=U-(Q=Math.max(0,Math.min(U+Q,x.scrollHeight-A+M))),_+=N-(z=Math.max(0,Math.min(N+z,x.scrollWidth-E+$)))}k.push({el:x,top:Q,left:z})}return k}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,r=e.top,n=e.left;t.scrollTop=r,t.scrollLeft=n}))};function Be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var qe=function(e){return!(e&&e.length&&Object.keys(e).length)},Ve={props:["isOpen","inputValue","selectedItem","highlightedIndex","handleChange","itemToString","handleMouseup"],data:function(){return{isMouseDown:!1,internal_isOpen:!1,internal_inputValue:"",internal_selectedItem:null,internal_highlightedIndex:null}},computed:{mergedState:function(){var e=this;return Object.keys(this.$props).reduce((function(t,n){var i;return r({},t,((i={})[n]=e.isControlledProp(n)?e.$props[n]:e["internal_"+n],i))}),{})},internalItemCount:function(){return this.items.length}},mounted:function(){window.addEventListener("mousedown",this.handleWindowMousedown),window.addEventListener("mouseup",this.handleWindowMouseup)},beforeDestroy:function(){window.removeEventListener("mousedown",this.handleWindowMousedown),window.removeEventListener("mouseup",this.handleWindowMouseup)},methods:{handleWindowMousedown:function(){this.isMouseDown=!0},handleWindowMouseup:function(e){this.isMouseDown=!1,e.target!==this.$refs.rootNode&&this.$refs.rootNode.contains(e.target)||!this.mergedState.isOpen||this.isMouseDown||(this.reset(),this.$props.handleMouseup&&this.$props.handleMouseup({isOpen:!1}))},keyDownArrowDown:function(e){e.preventDefault();var t=e.shiftKey?5:1;this.mergedState.isOpen?this.changeHighlightedIndex(t):(this.setState({isOpen:!0}),this.setHighlightedIndex())},keyDownArrowUp:function(e){e.preventDefault();var t=e.shiftKey?-5:-1;this.mergedState.isOpen?this.changeHighlightedIndex(t):(this.setState({isOpen:!0}),this.setHighlightedIndex())},keyDownEnter:function(e){this.mergedState.isOpen&&(e.preventDefault(),this.selectHighlightedItem())},keyDownEscape:function(e){e.preventDefault(),this.reset()},selectHighlightedItem:function(){return this.selectItemAtIndex(this.mergedState.highlightedIndex)},selectItemAtIndex:function(e){var t=this.items[e];null!=t&&this.selectItem(t)},selectItem:function(e){this.$props.handleChange&&this.$props.handleChange(e),this.setState({isOpen:!1,highlightedIndex:null,selectedItem:e,inputValue:this.isControlledProp("selectedItem")?"":e})},changeHighlightedIndex:function(e){if(!(this.internalItemCount<0)){var t=this.mergedState.highlightedIndex;null===t&&(t=e>0?-1:this.internalItemCount+1);var r=t+e;r<0?r=this.internalItemCount:r>this.internalItemCount&&(r=0),this.setHighlightedIndex(r)}},setHighlightedIndex:function(e){void 0===e&&(e=null),this.setState({highlightedIndex:e});var t=document.getElementById("Downshift"+e);De(t,this.rootNode)},reset:function(){var e=this.mergedState.selectedItem;this.setState({isOpen:!1,highlightedIndex:null,inputValue:e})},getItemProps:function(e){var t=e.index,r=e.item,n=t;return void 0===t?(this.$props.itemToString?this.items.push(this.$props.itemToString(r)):this.items.push(r),n=this.items.indexOf(r)):this.items[n]=r,{id:"Downshift"+n}},getItemEvents:function(e){var t=e.index,r=e.item,n=t;void 0===t&&(n=this.items.indexOf(r));var i=this;return{mouseenter:function(){i.setHighlightedIndex(n)},click:function(e){e.stopPropagation(),i.selectItemAtIndex(n)}}},getInputProps:function(e){var t=e.value,r=this.mergedState.inputValue;return t!==r&&this.setState({inputValue:t}),{value:r}},getButtonProps:function(e){var t=this,r=e.onClick,n=e.onKeyDown,i=e.onKeyUp,s=e.onBlur;return{click:function(e){t.setState({isOpen:!0,inputValue:e.target.value}),r&&r(e)},keydown:function(e){e.key&&t["keyDown"+e.key]&&t["keyDown"+e.key].call(t,e),n&&n(e)},keyup:function(e){i&&i(e)},blur:function(e){s&&s(e)}}},getInputEvents:function(e){var t=this,r=e.onInput,n=e.onBlur,i=e.onFocus,s=e.onKeyPress,o=e.onKeyDown,a=e.onKeyUp;return{input:function(e){t.setState({isOpen:!0,inputValue:e.target.value}),r&&r(e)},focus:function(e){i&&i(e)},keydown:function(e){e.key&&t["keyDown"+e.key]&&t["keyDown"+e.key].call(t,e),o&&o(e)},keypress:function(e){s&&s(e)},keyup:function(e){a&&a(e)},blur:function(e){n&&n(e)}}},getHelpersAndState:function(){return r({getItemProps:this.getItemProps,getItemEvents:this.getItemEvents,getInputProps:this.getInputProps,getInputEvents:this.getInputEvents,getButtonProps:this.getButtonProps},this.mergedState)},isControlledProp:function(e){return void 0!==this.$props[e]},setState:function(e){var t=this;Object.keys(e).map((function(r){t.isControlledProp(r)?t.$emit(r+"Change",e[r]):t["internal_"+r]=e[r]})),this.$emit("stateChange",this.mergedState)}},render:function(){var e=arguments[0];return this.items=[],e("div",{ref:"rootNode"},[this.$scopedSlots.default&&this.$scopedSlots.default(r({},this.getHelpersAndState()))])}};function Qe(){var e=n(["\n  position: relative;\n  .cancel-icon {\n    cursor: pointer;\n  }\n  .no-suggestions {\n    border: 1px solid #ccc;\n    border-top: 0;\n    font-size: 0.9rem;\n    padding: 10px;\n  }\n"]);return Qe=function(){return e},e}function ze(){var e=n(["\n  display: block;\n  width: 100%;\n  border: 1px solid #ccc;\n  background-color: #fff;\n  font-size: 0.9rem;\n  z-index: 3;\n  position: absolute;\n  top: 39px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  max-height: 260px;\n  overflow-y: auto;\n  box-sizing: border-box;\n\n  &.small {\n    top: 30px;\n  }\n\n  li {\n    display: flex;\n    justify-content: space-between;\n    cursor: pointer;\n    padding: 10px;\n    user-select: none;\n\n    .trim {\n      overflow: hidden;\n      text-overflow: ellipsis;\n      white-space: nowrap;\n    }\n\n    &:hover,\n    &:focus {\n      background-color: #eee;\n    }\n\n    .highlight-class {\n      font-weight: 600;\n      padding: 0;\n      background-color: transparent;\n      color: inherit;\n    }\n  }\n"]);return ze=function(){return e},e}var $e=W(ze()),Me=W(Qe()),Ne={props:["suggestion","currentValue"],render:function(){var e=arguments[0],t=this.$props,r=t.suggestion,n=t.currentValue,i=r.label,s=r.value,o=n.split(" ").map((function(e){return Be(e)})),a=o.join("|");return i?"string"==typeof i?e("div",{attrs:{className:"trim"},domProps:{innerHTML:i.replace(new RegExp(a,"ig"),(function(e){return'<mark class="highlight-class">'+e+"</mark>"}))}}):i:s}};function Ue(){var e=n(["\n  margin: 0 0 8px;\n  font-size: 1rem;\n  color: #424242;\n"]);return Ue=function(){return e},e}var Le=J("h2")(Ue()),He={functional:!0,render:function(e){return e("svg",{attrs:{alt:"Clear",height:"10",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 212.982 212.982"},class:"cancel-icon"},[e("title",["Clear"]),e("path",{attrs:{d:"M131.804,106.491l75.936-75.936c6.99-6.99,6.99-18.323,0-25.312c-6.99-6.99-18.322-6.99-25.312,0l-75.937,75.937L30.554,5.242c-6.99-6.99-18.322-6.99-25.312,0c-6.989,6.99-6.989,18.323,0,25.312l75.937,75.936L5.242,182.427c-6.989,6.99-6.989,18.323,0,25.312c6.99,6.99,18.322,6.99,25.312,0l75.937-75.937l75.937,75.937c6.989,6.99,18.322,6.99,25.312,0c6.99-6.99,6.99-18.322,0-25.312L131.804,106.491z"}})])}};function We(){var e=n(["\n  position: absolute;\n  top: 13px;\n  cursor: pointer;\n  ",";\n  ",";\n\n  svg.search-icon {\n    fill: #0b6aff;\n  }\n"]);return We=function(){return e},e}function Xe(){var e=n(["\n  padding-right: 32px;\n  right: 0;\n  top: calc(50% - 9px);\n"]);return Xe=function(){return e},e}function Ge(){var e=n(["\n  padding-right: 12px;\n  right: 0;\n"]);return Ge=function(){return e},e}function Ke(){var e=n(["\n  padding-left: 12px;\n  left: 0;\n"]);return Ke=function(){return e},e}var Ye=W(Ke()),Je=W(Ge()),Ze=W(Xe()),et=J("div")(We(),(function(e){var t=e.iconPosition;return"left"===t?Ye:"right"===t?Je:null}),(function(e){return e.clearIcon&&Ze})),tt={functional:!0,render:function(e){return e("svg",{attrs:{alt:"Search",height:"14",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 15"},class:"search-icon"},[e("title",["Search"]),e("path",{attrs:{d:"M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z"}})])}};function rt(){var e=n(["\n      right: 22px;\n    "]);return rt=function(){return e},e}function nt(){var e=n(["\n  height: 40px;\n  position: absolute;\n  top: calc(50% - 20px);\n  cursor: pointer;\n  right: 0;\n  ","\n"]);return nt=function(){return e},e}function it(){var e=n(["\n  right: 42px;\n"]);return it=function(){return e},e}var st=W(it()),ot=J("div")(nt(),(function(e){return"right"===e.iconPosition?st:W(rt())})),at="STOPPED",ut="ACTIVE",ct="DENIED",lt={props:["status","handleMicClick","className"],render:function(){var e,t=arguments[0],r=this.$props,n=r.status,i=r.className,s=r.handleMicClick;switch(window.SpeechRecognition||(e="https://cdn3.iconfinder.com/data/icons/glypho-music-and-sound/64/microphone-off-512.png"),n){case ut:e="https://media.giphy.com/media/ZZr4lCvpuMP58PXzY1/giphy.gif";break;case at:break;case ct:e="https://cdn3.iconfinder.com/data/icons/glypho-music-and-sound/64/microphone-off-512.png";break;default:e="https://cdn3.iconfinder.com/data/icons/glypho-music-and-sound/64/microphone-512.png"}return t("img",{class:i,on:{click:s},attrs:{src:e},style:{width:"24px",marginTop:"7px"}})}},ht={props:["iconPosition","handleMicClick","className","status"],render:function(){var e=arguments[0],t=this.$props,r=t.iconPosition,n=t.className,i=t.handleMicClick,s=t.status;return e(ot,{attrs:{iconPosition:r}},[e(lt,{attrs:{className:n,handleMicClick:i,status:s}})])}},dt={props:["showIcon","icon"],render:function(){var e=arguments[0],t=this.$props,r=t.showIcon,n=t.icon;return r?n||e(tt):null}},ft={props:["clearValue","iconPosition","showClear","clearIcon","currentValue","handleSearchIconClick","showIcon","icon","enableVoiceSearch","innerClass","getMicInstance","micStatus","handleMicClick"],render:function(){var e=arguments[0],t=this.$props,r=t.clearValue,n=t.iconPosition,i=t.showClear,s=t.clearIcon,o=t.currentValue,a=t.handleSearchIconClick,u=t.showIcon,c=t.icon,l=t.enableVoiceSearch,h=t.innerClass,d=t.micStatus,f=t.handleMicClick;return e("div",[o&&i&&e(et,{on:{click:r},attrs:{iconPosition:"right",clearIcon:"right"===n}},[s||e(He)]),l&&e(ht,{attrs:{iconPosition:n,className:Te(h,"mic")||null,status:d,handleMicClick:f}}),e(et,{on:{click:a},attrs:{iconPosition:n}},[e(dt,{attrs:{showIcon:u,icon:c}})])])}},pt={name:"VueSearchbox",props:{app:C.app,url:C.url,credentials:C.credentials,analytics:C.analytics,headers:C.headers,dataField:C.dataField,nestedField:C.nestedField,title:C.title,defaultValue:C.defaultValue,placeholder:C.placeholder,showIcon:C.showIcon,iconPosition:C.iconPosition,icon:C.icon,showClear:C.showClear,clearIcon:C.clearIcon,autosuggest:C.autosuggest,strictSelection:C.strictSelection,defaultSuggestions:C.defaultSuggestions,debounce:C.debounce,highlight:C.highlight,highlightField:C.highlightField,customHighlight:C.customHighlight,queryFormat:C.queryFormat,fuzziness:C.fuzziness,showVoiceSearch:C.showVoiceSearch,searchOperators:C.searchOperators,render:C.render,renderError:C.renderError,renderNoSuggestion:C.renderNoSuggestion,renderAllSuggestions:C.renderAllSuggestions,renderMic:C.renderMic,innerClass:C.innerClass,defaultQuery:C.defaultQuery,beforeValueChange:C.beforeValueChange,className:C.className,loader:C.loader,autoFocus:C.autoFocus,currentURL:C.currentURL,searchTerm:C.searchTerm,URLParams:C.URLParams,analyticsConfig:C.analyticsConfig},data:function(){var e=this.$props,t=e.value,r=e.defaultValue,n=e.defaultSuggestions,i=t||r||"";return this.state={currentValue:i,suggestionsList:n||[],isOpen:!1,error:null,loading:!1,initError:null,micStatus:void 0},this.state},created:function(){this._initSearchBase(),this.triggerSuggestionsQuery=function(e,t){var r=null;return function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var o=this;r&&clearTimeout(r),r=setTimeout((function(){e.apply(o,i)}),t)}}(this.triggerSuggestionsQuery,this.debounce),this.URLParams&&this.setValue({value:this.getSearchTerm(this.currentURL),isOpen:!1})},watch:{dataField:function(e,t){return this._applySetter(t,e,"setDataField")},headers:function(e,t){return this._applySetter(t,e,"setHeaders")},fuzziness:function(e,t){return this._applySetter(t,e,"setFuzziness")},nestedField:function(e,t){return this._applySetter(t,e,"setNestedField")},currentURL:function(e,t){this.$props.URLParams&&t!==e&&this.setValue({value:this.getSearchTerm(e),isOpen:!1})},analyticsConfig:function(e,t){this.analytics&&JSON.stringify(e)!==JSON.stringify(t)&&this.setAnalytics(e)}},beforeDestroy:function(){this.searchBase&&this.searchBase.unsubscribeToStateChanges(this.setStateValue)},methods:{_initSearchBase:function(){var e=this,t=this.$props,r=t.app,n=t.url,i=t.dataField,s=t.credentials,o=t.analytics,a=t.headers,u=t.nestedField,c=t.defaultQuery,l=t.beforeValueChange,h=t.queryFormat,d=t.defaultSuggestions,f=t.fuzziness,p=t.searchOperators;try{this.searchBase=new Ee({index:r,url:n,dataField:i,credentials:s,analytics:o,headers:a,nestedField:u,transformQuery:function(t){return c?c(t,e.$data.currentValue):Promise.resolve(t)},beforeValueChange:l,queryFormat:h,suggestions:d,fuzziness:f,searchOperators:p}),this.searchBase.subscribeToStateChanges(this.setStateValue,["suggestions"]),this.searchBase.onQueryChange=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.$emit.apply(e,["queryChange"].concat(r))},this.searchBase.onSuggestions=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.$emit.apply(e,["suggestions"].concat(r))},this.searchBase.onError=function(t){e.error=t,e.$emit("error",t)},this.searchBase.onSuggestionsRequestStatusChange=function(t){e.loading="PENDING"===t},this.searchBase.onMicStatusChange=function(t){e.micStatus=t,e.isOpen="INACTIVE"===t&&!e.loading},this.searchBase.onValueChange=function(t){e.currentValue=t,e.$emit("valueChange",t)}}catch(e){this.initError=e,console.error(e)}},_applySetter:function(e,t,r){(function e(t,r){if(t===r)return!0;if(!t||!r||"object"!=typeof t&&"object"!=typeof r)return t===r;if(null==t||null==r)return!1;if(t.prototype!==r.prototype)return!1;var n=Object.keys(t);return n.length===Object.keys(r).length&&n.every((function(n){return e(t[n],r[n])}))})(e,t)||this.searchBase&&this.searchBase[r](t)},setAnalytics:function(e){if(this.searchBase){var t=e.emptyQuery,r=e.userId,n=e.customEvents,i=this.searchBase.analyticsInstance;t?i.enableEmptyQuery():i.disableEmptyQuery(),i.setUserID(r).setCustomEvents(n)}},triggerClickAnalytics:function(e,t){void 0===t&&(t=!0);var r=this.$props,n=r.analytics,i=r.analyticsConfig;n&&i.suggestionAnalytics&&this.searchBase&&this.searchBase.analyticsInstance.registerClick(e,t)},setStateValue:function(e){var t,n=e.suggestions,i=void 0===n?{}:n;this.suggestionsList=(void 0===(t=i.next&&i.next.data)&&(t=[]),t.map((function(e,t){return r({},e,{_click_id:t})}))||[])},getSearchTerm:function(e){void 0===e&&(e="");var t=function(e){var t={};return e.replace(/[?&]+([^=&]+)=([^&]*)/gi,(function(e,r,n){r=decodeURIComponent(r),n=decodeURIComponent(n),t[r]=n})),t}(e);return t&&t[this.searchTerm]},onInputChange:function(e){this.setValue({value:e.target.value,event:e})},onSuggestionSelected:function(e){this.setValue({value:e&&e.value,isOpen:!1}),this.triggerClickAnalytics(e&&e._click_id)},setValue:function(e){var t,r=e.value,n=e.isOpen,i=void 0===n||n,s=this.$props,o=s.debounce,a=s.searchTerm,u=s.URLParams;(this.isOpen=i,o>0&&this.searchBase.setValue(r,{triggerQuery:!1}),this.triggerSuggestionsQuery(r),u)&&window.history.replaceState(qe(r)?null:((t={})[a]=r,t),null,qe(r)?window.location.origin:"?"+a+"="+r)},triggerSuggestionsQuery:function(e){this.searchBase&&this.searchBase.setValue(e||"",{triggerSuggestionsQuery:!0})},handleFocus:function(e){this.isOpen=!0,this.$emit("focus",e)},handleStateChange:function(e){var t=e.isOpen;this.isOpen=t},handleKeyDown:function(e,t){"Enter"===e.key&&null===t&&this.setValue({value:e.target.value,isOpen:!1}),this.$emit("keyDown",e)},handleMicClick:function(){this.searchBase&&this.searchBase.onMicClick(null,{triggerSuggestionsQuery:!0})},renderIcons:function(){var e=this.$createElement,t=this.$props,r=t.iconPosition,n=t.showClear,i=t.clearIcon,s=t.innerClass,o=t.showVoiceSearch,a=t.icon,u=t.showIcon,c=this.$data,l=c.currentValue,h=c.micStatus;return e(ft,{attrs:{clearValue:this.clearValue,iconPosition:r,showClear:n,clearIcon:i,currentValue:l,handleSearchIconClick:this.handleSearchIconClick,icon:a,showIcon:u,innerClass:s,enableVoiceSearch:o,micStatus:h,handleMicClick:this.handleMicClick}})},renderNoSuggestionComponent:function(){var e=this.$createElement,t=this.$props,r=t.innerClass,n=t.renderError,i=this.$data,s=i.loading,o=i.error,a=i.isOpen,u=i.currentValue,c=i.suggestionsList,l=this.$scopedSlots.renderNoSuggestion||this.$props.renderNoSuggestion;return!l||!a||c.length||s||!u||n&&o?null:e("div",{class:"no-suggestions "+Te(r,"noSuggestion")},["function"==typeof l?l(u):l])},renderErrorComponent:function(){var e=this.$createElement,t=this.$props.innerClass,r=this.$scopedSlots.renderError||this.$props.renderError,n=this.$data,i=n.error,s=n.loading,o=n.currentValue;return i&&r&&o&&!s?e("div",{class:Te(t,"error")},["function"==typeof r?r(i):r]):null},clearValue:function(){this.setValue({value:"",isOpen:!1})},handleSearchIconClick:function(){var e=this.$data.currentValue;e.trim()&&this.setValue({value:e,isOpen:!1})},getBackgroundColor:function(e,t){return e===t?"#eee":"#fff"}},render:function(){var e=this,t=arguments[0],n=this.$props,i=n.className,s=n.innerClass,o=n.showIcon,a=n.showClear,u=n.iconPosition,c=n.title,l=n.defaultSuggestions,h=n.autosuggest,d=n.placeholder,f=n.autoFocus,p=n.innerRef,g=n.renderError,y=this.$data,v=y.currentValue,m=y.isOpen,b=y.suggestionsList,w=y.initError;if(w)return g?"function"==typeof g?g(w):g:t("div",["Error initializing SearchBase. Please try again."]);var S=this.$scopedSlots.renderAllSuggestions||this.$props.renderAllSuggestions;return t("div",{class:i},[c&&t(Le,{class:Te(s,"title")||""},[c]),l||h?t(Ve,{attrs:{id:"searchbox-downshift",handleChange:this.onSuggestionSelected,handleMouseup:this.handleStateChange,isOpen:m},scopedSlots:{default:function(n){var i=n.getInputEvents,c=n.getInputProps,l=n.getItemProps,h=n.getItemEvents,d=n.isOpen,f=n.highlightedIndex;return t("div",{class:Me},[t(oe,{attrs:{id:"search-box",showIcon:o,showClear:a,iconPosition:u},class:Te(s,"input"),on:r({},i({onInput:e.onInputChange,onBlur:function(t){e.$emit("blur",t)},onFocus:e.handleFocus,onKeyPress:function(t){e.$emit("keyPress",t)},onKeyDown:function(t){return e.handleKeyDown(t,f)},onKeyUp:function(t){e.$emit("keyUp",t)}})),domProps:r({},c({value:v||""}))}),e.renderIcons(),S&&S({currentValue:v,isOpen:d,getItemProps:l,getItemEvents:h,highlightedIndex:f,parsedSuggestions:b}),e.renderErrorComponent(),!S&&d&&b.length?t("ul",{class:$e+" "+Te(s,"list")},[b.slice(0,10).map((function(n,i){return t("li",{domProps:r({},l({item:n})),on:r({},h({item:n})),key:i+1+"-"+n.value,style:{backgroundColor:e.getBackgroundColor(f,i)}},[t(Ne,{attrs:{currentValue:v,suggestion:n}})])}))]):e.renderNoSuggestionComponent()])}}}):t("div",{class:Me},[t(oe,{class:Te(s,"input")||"",attrs:{placeholder:d,iconPosition:u,showIcon:o,showClear:a,innerRef:p},on:r({},{blur:function(t){e.$emit("blur",t)},keypress:function(t){e.$emit("keyPress",t)},input:this.onInputChange,focus:function(t){e.$emit("focus",t)},keydown:function(t){e.$emit("keyDown",t)},keyup:function(t){e.$emit("keyUp",t)}}),domProps:r({},{autofocus:f,value:v||""})}),this.renderIcons()])])}},gt={render:function(){var e=arguments[0];return e(pt,{attrs:r({},this.$attrs,{currentURL:window.location.href})})}};function yt(e){yt.installed||(yt.installed=!0,e.component("VueSearchbox",gt))}var vt={install:yt},mt=null;return"undefined"!=typeof window?mt=window.Vue:void 0!==t&&(mt=t.Vue),mt&&mt.use(vt),gt.install=yt,gt}));
//# sourceMappingURL=vue-searchbox.umd.min.js.map