var __awaiter=this&&this.__awaiter||function(r,a,e,i){function o(r){return r instanceof e?r:new e((function(a){a(r)}))}return new(e||(e=Promise))((function(e,n){function t(r){try{s(i.next(r))}catch(r){n(r)}}function c(r){try{s(i["throw"](r))}catch(r){n(r)}}function s(r){r.done?e(r.value):o(r.value).then(t,c)}s((i=i.apply(r,a||[])).next())}))};var __generator=this&&this.__generator||function(r,a){var e={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,o,n,t;return t={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(t[Symbol.iterator]=function(){return this}),t;function c(r){return function(a){return s([r,a])}}function s(c){if(i)throw new TypeError("Generator is already executing.");while(t&&(t=0,c[0]&&(e=0)),e)try{if(i=1,o&&(n=c[0]&2?o["return"]:c[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,c[1])).done)return n;if(o=0,n)c=[c[0]&2,n.value];switch(c[0]){case 0:case 1:n=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;o=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(n=e.trys,n=n.length>0&&n[n.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!n||c[1]>n[0]&&c[1]0){if(r){i.marginLeft=-o+"px"}else{i.marginRight=-o+"px"}}}}};r.prototype.getValue=function(){return this.value||""};r.prototype.hasValue=function(){return this.getValue()!==""};r.prototype.shouldShowCancelButton=function(){if(this.showCancelButton==="never"||this.showCancelButton==="focus"&&!this.focused){return false}return true};r.prototype.shouldShowClearButton=function(){if(this.showClearButton==="never"||this.showClearButton==="focus"&&!this.focused){return false}return true};r.prototype.render=function(){var r;var a=this;var e=this,i=e.cancelButtonText,t=e.autocapitalize;var c=this.animated&&v.getBoolean("animated",true);var s=y(this);var h=this.clearIcon||(s==="ios"?u:f);var l=this.searchIcon||(s==="ios"?m:g);var b=this.shouldShowCancelButton();var p=this.showCancelButton!=="never"&&o("button",{key:"989f3e84c472ada6e66dd9b249d0d268bf17ce26","aria-label":i,"aria-hidden":b?undefined:"true",type:"button",tabIndex:s==="ios"&&!b?-1:undefined,onMouseDown:this.onCancelSearchbar,onTouchStart:this.onCancelSearchbar,class:"searchbar-cancel-button"},o("div",{key:"7d335d4fde33822dc79d26b748ba2e98db7494bb","aria-hidden":"true"},s==="md"?o("ion-icon",{"aria-hidden":"true",mode:s,icon:this.cancelButtonIcon,lazy:false}):i));return o(n,{key:"d1a1972725e949fb102c91487aaa7b9d10c2d718",role:"search","aria-disabled":this.disabled?"true":null,class:d(this.color,(r={},r[s]=true,r["searchbar-animated"]=c,r["searchbar-disabled"]=this.disabled,r["searchbar-no-animate"]=c&&this.noAnimate,r["searchbar-has-value"]=this.hasValue(),r["searchbar-left-aligned"]=this.shouldAlignLeft,r["searchbar-has-focus"]=this.focused,r["searchbar-should-show-clear"]=this.shouldShowClearButton(),r["searchbar-should-show-cancel"]=this.shouldShowCancelButton(),r))},o("div",{key:"add53640b2994cb6b2bf02792dafe51aba6b1684",class:"searchbar-input-container"},o("input",Object.assign({key:"160cc36459a4a652e7f41ccd14dcdc782278779e","aria-label":"search text",disabled:this.disabled,ref:function(r){return a.nativeInput=r},class:"searchbar-input",inputMode:this.inputmode,enterKeyHint:this.enterkeyhint,name:this.name,onInput:this.onInput,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,minLength:this.minlength,maxLength:this.maxlength,placeholder:this.placeholder,type:this.type,value:this.getValue(),autoCapitalize:t==="default"?undefined:t,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,spellcheck:this.spellcheck},this.inheritedAttributes)),s==="md"&&p,o("ion-icon",{key:"8825fd13af0d2dea451ccc0e00ae7b5021dc01c4","aria-hidden":"true",mode:s,icon:l,lazy:false,class:"searchbar-search-icon"}),o("button",{key:"8a7b56da278b9ca5c4f5a4ee9c01924fd5ae29d8","aria-label":"reset",type:"button","no-blur":true,class:"searchbar-clear-button",onPointerDown:function(r){r.preventDefault()},onClick:function(){return a.onClearInput(true)}},o("ion-icon",{key:"24c55274516ab012d8c25f03525c6cdb9409e52f","aria-hidden":"true",mode:s,icon:h,lazy:false,class:"searchbar-clear-icon"}))),s==="ios"&&p)};Object.defineProperty(r.prototype,"el",{get:function(){return t(this)},enumerable:false,configurable:true});Object.defineProperty(r,"watchers",{get:function(){return{lang:["onLangChanged"],dir:["onDirChanged"],debounce:["debounceChanged"],value:["valueChanged"],showCancelButton:["showCancelButtonChanged"]}},enumerable:false,configurable:true});return r}());var C=0;_.style={ios:w,md:z}}}}));