!function(t,s){function l(t,e,n){var r=new v,o=a;this.current=r.current,this.moveNext=function(){try{switch(o){case a:o=c,t();case c:return!!e.apply(r)||(this.dispose(),!1);case f:return!1}}catch(t){throw this.dispose(),t}},this.dispose=function(){if(o==c)try{n()}finally{o=f}}}function p(t){this.getEnumerator=t}var h={Identity:function(t){return t},True:function(){return!0},Blank:function(){}},o=typeof!0,u="number",y="string",e=typeof{},r=typeof s,i="function",d={"":h.Identity},m={createLambda:function(t){if(null==t)return h.Identity;if(typeof t!==y)return t;if(null!=(s=d[t]))return s;if(-1===t.indexOf("=>")){for(var e,n=new RegExp("[$]+","g"),r=0;null!=(e=n.exec(t));){var o=e[0].length;r(.*)/);return s=new Function(l[1],l[2].match(/\breturn\b/)?l[2]:"return "+l[2]),d[t]=s},isIEnumerable:function(t){if(typeof Enumerator!==r)try{return new Enumerator(t),!0}catch(t){}return!1},defineProperty:null!=Object.defineProperties?function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}:function(t,e,n){t[e]=n},compare:function(t,e){return t===e?0:e=e.length&&(t=0),this.yieldReturn(e[t++])},h.Blank)})},p.empty=function(){return new p(function(){return new l(h.Blank,function(){return!1},h.Blank)})},p.from=function(r){if(null==r)return p.empty();if(r instanceof p)return r;if(typeof r==u||typeof r==o)return p.repeat(r,1);if(typeof r==y)return new p(function(){var t=0;return new l(h.Blank,function(){return t=e.length-1?0:n+1;var t=e[n];if(t.moveNext())return this.yieldReturn(t.current());t.dispose(),e.splice(n--,1)}return this.yieldBreak()},function(){p.from(e).forEach(m.dispose)})})},p.prototype.join=function(t,i,e,a,c){i=m.createLambda(i),e=m.createLambda(e),a=m.createLambda(a),c=m.createLambda(c);var f=this;return new p(function(){var n,r,o=null,u=0;return new l(function(){n=f.getEnumerator(),r=p.from(t).toLookup(e,h.Identity,c)},function(){for(;;){if(null!=o){var t=o[u++];if(t!==s)return this.yieldReturn(a(n.current(),t));t=null,u=0}if(!n.moveNext())return!1;var e=i(n.current());o=r.get(e).toArray()}},function(){m.dispose(n)})})},p.prototype.groupJoin=function(t,r,o,u,i){r=m.createLambda(r),o=m.createLambda(o),u=m.createLambda(u),i=m.createLambda(i);var a=this;return new p(function(){var e=a.getEnumerator(),n=null;return new l(function(){e=a.getEnumerator(),n=p.from(t).toLookup(o,h.Identity,i)},function(){if(e.moveNext()){var t=n.get(r(e.current()));return this.yieldReturn(u(e.current(),t))}return!1},function(){m.dispose(e)})})},p.prototype.all=function(e){e=m.createLambda(e);var n=!0;return this.forEach(function(t){if(!e(t))return n=!1}),n},p.prototype.any=function(t){t=m.createLambda(t);var e=this.getEnumerator();try{if(0==arguments.length)return e.moveNext();for(;e.moveNext();)if(t(e.current()))return!0;return!1}finally{m.dispose(e)}},p.prototype.isEmpty=function(){return!this.any()},p.prototype.concat=function(){var n=this;if(1==arguments.length){var r=arguments[0];return new p(function(){var t,e;return new l(function(){t=n.getEnumerator()},function(){if(null==e){if(t.moveNext())return this.yieldReturn(t.current());e=p.from(r).getEnumerator()}return!!e.moveNext()&&this.yieldReturn(e.current())},function(){try{m.dispose(t)}finally{m.dispose(e)}})})}var t=arguments;return new p(function(){var e;return new l(function(){e=p.make(n).concat(p.from(t).select(p.from)).select(function(t){return t.getEnumerator()}).toArray()},function(){for(;0=t?n=r:e=r}return this.yieldReturn(o[n].value)}return this.yieldBreak()},h.Blank)})},p.prototype.groupBy=function(e,n,r,o){var u=this;return e=m.createLambda(e),n=m.createLambda(n),null!=r&&(r=m.createLambda(r)),o=m.createLambda(o),new p(function(){var t;return new l(function(){t=u.toLookup(e,n,o).toEnumerable().getEnumerator()},function(){return!!t.moveNext()&&(null==r?this.yieldReturn(t.current()):this.yieldReturn(r(t.current().key(),t.current())))},function(){m.dispose(t)})})},p.prototype.partitionBy=function(i,a,c,f){var s,t=this;return i=m.createLambda(i),a=m.createLambda(a),f=m.createLambda(f),c=null==c?(s=!1,function(t,e){return new N(t,e)}):(s=!0,m.createLambda(c)),new p(function(){var n,r,o,u=[];return new l(function(){(n=t.getEnumerator()).moveNext()&&(r=i(n.current()),o=f(r),u.push(a(n.current())))},function(){for(var t;1==(t=n.moveNext())&&o===f(i(n.current()));)u.push(a(n.current()));if(0=r)return this.yieldReturn(t);return 0n(e)?t:e})},p.prototype.minBy=function(n){return n=m.createLambda(n),this.aggregate(function(t,e){return n(t)")})},p.prototype.force=function(){var t=this.getEnumerator();try{for(;t.moveNext(););}finally{m.dispose(t)}},p.prototype.letBind=function(e){e=m.createLambda(e);var n=this;return new p(function(){var t;return new l(function(){t=p.from(e(n)).getEnumerator()},function(){return!!t.moveNext()&&this.yieldReturn(t.current())},function(){m.dispose(t)})})},p.prototype.share=function(){var t,e=this,n=!1;return new E(function(){return new l(function(){null==t&&(t=e.getEnumerator())},function(){if(n)throw new Error("enumerator is disposed");return!!t.moveNext()&&this.yieldReturn(t.current())},h.Blank)},function(){n=!0,m.dispose(t)})},p.prototype.memoize=function(){var e,n,r=this,o=!1;return new E(function(){var t=-1;return new l(function(){null==n&&(n=r.getEnumerator(),e=[])},function(){if(o)throw new Error("enumerator is disposed");return t++,e.length<=t?!!n.moveNext()&&this.yieldReturn(e[t]=n.current()):this.yieldReturn(e[t])},h.Blank)},function(){o=!0,m.dispose(n),e=null})},m.hasNativeIteratorSupport()&&(p.prototype[Symbol.iterator]=function(){return{enumerator:this.getEnumerator(),next:function(){return this.enumerator.moveNext()?{done:!1,value:this.enumerator.current()}:{done:!0}}}}),p.prototype.catchError=function(e){e=m.createLambda(e);var n=this;return new p(function(){var t;return new l(function(){t=n.getEnumerator()},function(){try{return!!t.moveNext()&&this.yieldReturn(t.current())}catch(t){return e(t),!1}},function(){m.dispose(t)})})},p.prototype.finallyAction=function(e){e=m.createLambda(e);var n=this;return new p(function(){var t;return new l(function(){t=n.getEnumerator()},function(){return!!t.moveNext()&&this.yieldReturn(t.current())},function(){try{m.dispose(t)}finally{e()}})})},p.prototype.log=function(e){return e=m.createLambda(e),this.doAction(function(t){typeof console!==r&&console.log(e(t))})},p.prototype.trace=function(e,n){return null==e&&(e="Trace"),n=m.createLambda(n),this.doAction(function(t){typeof console!==r&&console.log(e,n(t))})};var w=function(t,e,n,r,o){this.source=t,this.keySelector=m.createLambda(e),this.descending=r,this.parent=o,n&&(this.comparer=m.createLambda(n))};w.prototype=new p,w.prototype.createOrderedEnumerable=function(t,e,n){return new w(this.source,t,e,n,this)},w.prototype.thenBy=function(t,e){return this.createOrderedEnumerable(t,e,!1)},w.prototype.thenByDescending=function(t,e){return this.createOrderedEnumerable(t,e,!0)},w.prototype.getEnumerator=function(){var r,o,t=this,e=0;return new l(function(){r=[],o=[],t.source.forEach(function(t,e){r.push(t),o.push(e)});var n=g.create(t,null);n.GenerateKeys(r),o.sort(function(t,e){return n.compare(t,e)})},function(){return e