function fg(a){this.Init(a)}m("AdfInputSearchMruCache",fg);r.v(fg);fg.ga=function(){this.nga=0;this.WR=1;m("AdfInputSearchMruCache.SUGGESTIONS",fg.WR);this.j0=2;m("AdfInputSearchMruCache.IS_COMPREHENSIVE",fg.j0);this.V5a=new RegExp(/\s\s*/)};m("AdfInputSearchMruCache.InitClass",fg.ga);fg.prototype.Init=function(a){fg.h.Init.call(this);this.Qr=a;this.Of=Array(a);this.NW=0;this.ela=!0};r.a("AdfInputSearchMruCache.prototype.Init",{Init:fg.prototype.Init});
fg.prototype.get=function(a){if(void 0===a)return this.Of[gg(this)];a=fg.e3(a);a=kg(this,a);if(void 0!==a){var b=this.Of[a];lg(this,a);return b}};r.a("AdfInputSearchMruCache.prototype.get",{get:fg.prototype.get});fg.prototype.pra=function(a){a=fg.e3(a);for(var b=0,d=0,e=-1,f=gg(this),g=0,h=this.Qr;g<h;g++,f=mg(this,f)){var l=this.Of[f];if(!l)break;l=fg.FKa(l[fg.nga],a);b==l.count?d<l.Kta&&(e=f,d=l.Kta):b<l.count&&(b=l.count,e=f,d=l.Kta)}if(1<=b)return a=this.Of[e],lg(this,e),a};
r.a("AdfInputSearchMruCache.prototype.getBestMatch",{pra:fg.prototype.pra});fg.prototype.put=function(a,b,d){a=fg.e3(a);var e=kg(this,a);if(void 0===e){a:{if(this.ela){for(e=0;e<this.Qr;e++)if(!this.Of[e]){this.Of[e]=Array(3);break a}this.ela=!1}e=this.NW;this.NW=(this.NW+1)%this.Qr}this.Of[e][fg.nga]=a;this.Of[e][fg.WR]=b;this.Of[e][fg.j0]=d}else this.Of[e][fg.WR]=b,this.Of[e][fg.j0]=d,lg(this,e)};r.a("AdfInputSearchMruCache.prototype.put",{put:fg.prototype.put});
fg.e3=function(a){return Array.isArray(a)?a:a.trim().split(fg.V5a).sort()};fg.FKa=function(a,b){var d=a.length,e=b.length;if(e<d)return 0;for(var f=0,g=0,h=0,l=0;g<d;g++)for(var n=f;n<e;n++)if(0===b[n].indexOf(a[g])){f=n+1;l+=a[g].length;h++;break}d={};d.count=h;d.Kta=l;return d};fg.Vhb=function(a,b){var d=a.length;if(d!=b.length)return!1;for(var e=0;e<d;e++)if(a[e]!=b[e])return!1;return!0};fg.rib=function(a,b){return a.length==fg.FKa(a,b).count};function mg(a,b){--b;return-1==b?a.Qr-1:b}
function gg(a){if(a.ela){for(var b=0;b<a.Qr&&a.Of[b];b++);return 0==b?0:b-1}return mg(a,a.NW)}function kg(a,b){for(var d=0;d<a.Qr;d++){var e=a.Of[d];if(!e)break;var f=e[fg.nga];if(e[fg.j0]){if(fg.rib(f,b))return d}else if(fg.Vhb(f,b))return d}}function lg(a,b){for(var d=a.Of[b],e=mg(a,a.NW),f=b,g=(b+1)%a.Qr;f!=e;g=(g+1)%a.Qr){if(!a.Of[g]){e=f;break}a.Of[f]=a.Of[g];f=g}a.Of[e]=d};