(function(){return function(e,t,r,a,n){var c=[];if(!(e instanceof Array&&e.every(function(e){return e.every(function(e){return e instanceof RegExp})})))throw Error("Expected an Array of Array of RegExp.");if(!(t instanceof Scanner.Span_))throw Error("Expected a Scanner.Span_.");for(var o=0;o<e.length;o++)for(var u=0;u<e[o].length;u++)for(var f=e[o][u],g=t.next(f);g.exists();){for(var i=r(g,f).filter(function(e){return e.exists()&&(0===e.getStart()||e.getStart()-g.getEnd()<256)}),l=0;l<i.length;l++){var h=i[l];if(a(h,g)){var s=0===h.getStart()?0:h.getStart()-g.getEnd();if(n&&(h=n(h)),s<=0)return h;var S={keyRegExp:f,matchedKey:g,matchedValue:h,score:s};c.push(S)}}g=g.next(f)}return 0===c.length?t.getScanner().getNullSpan():(c.sort(function(e,t){return e.score>t.score?1:e.score<t.score?-1:e.matchedValue.getStart()>t.matchedValue.getStart()?1:e.matchedValue.getStart()<t.matchedValue.getStart()?-1:0}),c[0].matchedValue)}}).call();