Socket
Socket
Sign inDemoInstall

rx

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx - npm Package Compare versions

Comparing version 2.3.17 to 2.3.18

2

bower.json
{
"name": "rxjs",
"version": "2.3.17",
"version": "2.3.18",
"main": [

@@ -5,0 +5,0 @@ "dist/rx.all.js",

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(U)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&h(a)&&(a=ub.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===mb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==nb){var g=a.constructor,i=-1,j=qb.length;if(a===(g&&g.prototype))var k=a===stringProto?ib:a===mb?db:jb.call(a),l=rb[k];for(;++i<j;)f=qb[i],l&&l[f]||!kb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?jb.call(a)==_:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=jb.call(a),l=jb.call(b);if(k==_&&(k=gb),l==_&&(l=gb),k!=l)return!1;switch(k){case bb:case cb:return+a==+b;case fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case hb:case ib:return a==String(b)}var m=k==ab;if(!m){if(k!=gb||!sb.nodeClass&&(g(a)||g(b)))return!1;var n=!sb.argsObject&&h(a)?Object:a.constructor,o=!sb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||kb.call(a,"constructor")&&kb.call(b,"constructor")||S(n)&&n instanceof n&&S(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return kb.call(f,e)?(q++,r=kb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return kb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ub.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(){this._s=s}function o(){this._s=s,this._l=s.length,this._i=0}function p(a){this._a=a}function q(a){this._a=a,this._l=v(a),this._i=0}function r(a){return"number"==typeof a&&E.isFinite(a)}function t(b){var c,d=b[V];if(!d&&"string"==typeof b)return c=new n(b),c[V]();if(!d&&b.length!==a)return c=new p(b),c[V]();if(!d)throw new TypeError("Object is not iterable");return b[V]()}function u(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function v(a){var b=+a.length;return isNaN(b)?0:0!==b&&r(b)?(b=u(b)*Math.floor(Math.abs(b)),0>=b?0:b>nc?nc:b):b}function w(a,b){return L(a)||(a=Pb),new yc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function x(a,b){return new yc(function(c){var d=new Hb,e=new Ib;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}R(f)&&(f=kc(f)),d=new Hb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function y(a,b){var c=this;return new yc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=kc(f)),(Y(f)||X(f))&&(f=oc(f)),f}).concatAll()}function A(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function B(a){this.comparer=a,this.set=[]}function C(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=kc(f)),(Y(f)||X(f))&&(f=oc(f)),f}).mergeAll()}var D={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},E=D[typeof window]&&window||this,F=D[typeof exports]&&exports&&!exports.nodeType&&exports,G=D[typeof module]&&module&&!module.nodeType&&module,H=G&&G.exports===F&&F,I=D[typeof global]&&global;!I||I.global!==I&&I.window!==I||(E=I);var J={internals:{},config:{Promise:E.Promise},helpers:{}},K=J.helpers.noop=function(){},L=(J.helpers.notDefined=function(a){return"undefined"==typeof a},J.helpers.isScheduler=function(a){return a instanceof J.Scheduler}),M=J.helpers.identity=function(a){return a},N=(J.helpers.pluck=function(a){return function(b){return b[a]}},J.helpers.just=function(a){return function(){return a}},J.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),O=J.helpers.defaultComparer=function(a,b){return tb(a,b)},P=J.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Q=(J.helpers.defaultKeySerializer=function(a){return a.toString()},J.helpers.defaultError=function(a){throw a}),R=J.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},S=(J.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},J.helpers.not=function(a){return!a},J.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==jb.call(a)}),a}()),T="Argument out of range",U="Object has been disposed",V="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(V="@@iterator");var W=J.doneEnumerator={done:!0,value:a},X=J.helpers.isIterable=function(b){return b[V]!==a},Y=J.helpers.isArrayLike=function(b){return b&&b.length!==a};J.helpers.iterator=V;var Z,$=J.helpers.deprecate=function(a,b){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(a+" is deprecated, use "+b+" instead.",new Error("").stack)},_="[object Arguments]",ab="[object Array]",bb="[object Boolean]",cb="[object Date]",db="[object Error]",eb="[object Function]",fb="[object Number]",gb="[object Object]",hb="[object RegExp]",ib="[object String]",jb=Object.prototype.toString,kb=Object.prototype.hasOwnProperty,lb=jb.call(arguments)==_,mb=Error.prototype,nb=Object.prototype,ob=nb.propertyIsEnumerable;try{Z=!(jb.call(document)==gb&&!({toString:0}+""))}catch(pb){Z=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[ab]=rb[cb]=rb[fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[bb]=rb[ib]={constructor:!0,toString:!0,valueOf:!0},rb[db]=rb[eb]=rb[hb]={constructor:!0,toString:!0},rb[gb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(mb,"message")||ob.call(mb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1),lb||(h=function(a){return a&&"object"==typeof a?kb.call(a,"callee"):!1});var tb=J.internals.isEqual=function(a,b){return i(a,b,[],[])},ub=Array.prototype.slice,vb=({}.hasOwnProperty,this.inherits=J.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),wb=J.internals.addProperties=function(a){for(var b=ub.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},xb=J.internals.addRef=function(a,b){return new yc(function(c){return new Cb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=ub.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(ub.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(ub.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var yb=Object("a"),zb="a"!=yb[0]||!(0 in yb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=zb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=eb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=zb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=eb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==ab}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Ab=J.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Bb=Ab.prototype;Bb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Bb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Bb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Bb.peek=function(){return this.items[0].value},Bb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Bb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Bb.enqueue=function(a){var b=this.length++;this.items[b]=new l(Ab.count++,a),this.percolate(b)},Bb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Ab.count=0;var Cb=J.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Db=Cb.prototype;Db.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Db.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Db.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Db.toArray=function(){return this.disposables.slice(0)};var Eb=J.Disposable=function(a){this.isDisposed=!1,this.action=a||K};Eb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Fb=Eb.create=function(a){return new Eb(a)},Gb=Eb.empty={dispose:K},Hb=J.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Ib=J.SerialDisposable=Hb,Jb=J.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Gb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Kb=J.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||P,this.disposable=new Hb};Kb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Kb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Kb.prototype.isCancelled=function(){return this.disposable.isDisposed},Kb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Lb=J.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Gb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=N,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Mb=Lb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Cb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Gb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Cb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Gb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Lb.prototype),function(){Lb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Lb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof E.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=E.setInterval(function(){d=c(d)},b);return Fb(function(){E.clearInterval(e)})}}(Lb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Ub(this,a)}}(Lb.prototype);var Nb,Ob=(J.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Hb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Lb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Mb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Lb(N,a,b,c)}()),Pb=Lb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Lb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Lb.normalize(c),g=new Kb(this,b,d,f);if(e)e.enqueue(g);else{e=new Ab(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Lb(N,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Qb=K,Rb=function(){var a,b=K;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!E.setTimeout)throw new Error("No concurrency detected!");a=E.setTimeout,b=E.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Sb=Rb.setTimeout,Tb=Rb.clearTimeout;!function(){function a(){if(!E.postMessage||E.importScripts)return!1;var a=!1,b=E.onmessage;return E.onmessage=function(){a=!0},E.postMessage("","*"),E.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=I&&H&&I.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=I&&H&&I.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Nb=d,Qb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Nb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;E.addEventListener?E.addEventListener("message",b,!1):E.attachEvent("onmessage",b,!1),Nb=function(a){var b=h++;g[b]=a,E.postMessage(f+b,"*")}}else if(E.MessageChannel){var i=new E.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Nb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in E&&"onreadystatechange"in E.document.createElement("script")?Nb=function(a){var b=E.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},E.document.documentElement.appendChild(b)}:(Nb=function(a){return Sb(a,0)},Qb=Tb)}();var Ub=(Lb.timeout=function(){function a(a,b){var c=this,d=new Hb,e=Nb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Cb(d,Fb(function(){Qb(e)}))}function b(a,b,c){var d=this,e=Lb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Hb,g=Sb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Cb(f,Fb(function(){Tb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Lb(N,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return vb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Gb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Hb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Lb)),Vb=J.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return L(a)||(a=Ob),new yc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Wb=Vb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Vb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Xb=Vb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Vb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Yb=Vb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Vb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Zb=J.internals.Enumerator=function(a){this._next=a};Zb.prototype.next=function(){return this._next()},Zb.prototype[V]=function(){return this};var $b=J.internals.Enumerable=function(a){this._iterator=a};$b.prototype[V]=function(){return this._iterator()},$b.prototype.concat=function(){var a=this;return new yc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f=new Ib,g=Ob.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;R(h)&&(h=kc(h));var i=new Hb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Cb(f,g,Fb(function(){e=!0}))})},$b.prototype.catchError=function(){var a=this;return new yc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f,g=new Ib,h=Ob.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;R(i)&&(i=kc(i));var j=new Hb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Cb(g,h,Fb(function(){e=!0}))})};var _b=$b.repeat=function(a,b){return null==b&&(b=-1),new $b(function(){var c=b;return new Zb(function(){return 0===c?W:(c>0&&c--,{done:!1,value:a})})})},ac=$b.of=function(a,b,c){return b||(b=M),new $b(function(){var d=-1;return new Zb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:W})})},bc=J.Observer=function(){};bc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},bc.prototype.asObserver=function(){return new fc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},bc.prototype.checked=function(){return new gc(this)};var cc=bc.create=function(a,b,c){return a||(a=K),b||(b=Q),c||(c=K),new fc(a,b,c)};bc.fromNotifier=function(a,b){return new fc(function(c){return a.call(b,Wb(c))},function(c){return a.call(b,Xb(c))},function(){return a.call(b,Yb())})},bc.notifyOn=function(a){return new ic(a,this)};var dc,ec=J.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return vb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(bc),fc=J.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return vb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(ec),gc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}vb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(bc),hc=J.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Ib}return vb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(ec),ic=function(a){function b(){a.apply(this,arguments)}return vb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(hc),jc=J.Observable=function(){function a(a){this._subscribe=a}return dc=a.prototype,dc.subscribe=dc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:cc(a,b,c))},dc.subscribeOnNext=function(a,b){return this._subscribe(cc(2===arguments.length?function(c){a.call(b,c)}:a))},dc.subscribeOnError=function(a,b){return this._subscribe(cc(null,2===arguments.length?function(c){a.call(b,c)}:a))},dc.subscribeOnCompleted=function(a,b){return this._subscribe(cc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();dc.observeOn=function(a){var b=this;return new yc(function(c){return b.subscribe(new ic(a,c))})},dc.subscribeOn=function(a){var b=this;return new yc(function(c){var d=new Hb,e=new Ib;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var kc=jc.fromPromise=function(a){return lc(function(){var b=new J.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};dc.toPromise=function(a){if(a||(a=J.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},dc.toArray=function(){var a=this;return new yc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},jc.create=jc.createWithDisposable=function(a){return new yc(a)};var lc=jc.defer=function(a){return new yc(function(b){var c;try{c=a()}catch(d){return sc(d).subscribe(b)}return R(c)&&(c=kc(c)),c.subscribe(b)})},mc=jc.empty=function(a){return L(a)||(a=Ob),new yc(function(b){return a.schedule(function(){b.onCompleted()})})},nc=Math.pow(2,53)-1;n.prototype[V]=function(){return new o(this._s)},o.prototype[V]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return W},p.prototype[V]=function(){return new q(this._a)},q.prototype[V]=function(){return this},q.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return W};var oc=jc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!S(b))throw new Error("mapFn when provided must be a function");L(d)||(d=Pb);var e=Object(a),f=t(e);return new yc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&S(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},pc=jc.fromArray=function(a,b){return L(b)||(b=Pb),new yc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};jc.generate=function(a,b,c,d,e){return L(e)||(e=Pb),new yc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var qc=jc.never=function(){return new yc(function(){return Gb})};jc.of=function(){return w(null,arguments)},jc.ofWithScheduler=function(a){return w(a,ub.call(arguments,1))},jc.range=function(a,b,c){return L(c)||(c=Pb),new yc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},jc.repeat=function(a,b,c){return L(c)||(c=Pb),rc(a,c).repeat(null==b?-1:b)};var rc=jc["return"]=jc.just=function(a,b){return L(b)||(b=Ob),new yc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};jc.returnValue=function(){return $("returnValue","return or just"),rc.apply(null,arguments)};var sc=jc["throw"]=jc.throwException=jc.throwError=function(a,b){return L(b)||(b=Ob),new yc(function(c){return b.schedule(function(){c.onError(a)})})};jc.using=function(a,b){return new yc(function(c){var d,e,f=Gb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Cb(sc(g).subscribe(c),f)}return new Cb(e.subscribe(c),f)})},dc.amb=function(a){var b=this;return new yc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Hb,j=new Hb;return R(a)&&(a=kc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Cb(i,j)})},jc.amb=function(){function a(a,b){return a.amb(b)}for(var b=qc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},dc["catch"]=dc.catchError=function(a){return"function"==typeof a?x(this,a):tc([this,a])},dc.catchException=function(a){return $("catchException","catch or catchError"),this.catchError(a)};var tc=jc.catchError=jc["catch"]=function(){return ac(j(arguments,0)).catchError()};jc.catchException=function(){return $("catchException","catch or catchError"),tc.apply(null,arguments)},dc.combineLatest=function(){var a=ub.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),uc.apply(this,a)};var uc=jc.combineLatest=function(){var a=ub.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new yc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(M))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(M)&&c.onCompleted()}function e(a){j[a]=!0,j.every(M)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Hb;R(f)&&(f=kc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Cb(m)})};dc.concat=function(){var a=ub.call(arguments,0);return a.unshift(this),vc.apply(this,a)};var vc=jc.concat=function(){return ac(j(arguments,0)).concat()};dc.concatAll=function(){return this.merge(1)},dc.concatObservable=function(){return $("concatObservable","concatAll"),this.merge(1)},dc.merge=function(a){if("number"!=typeof a)return wc(this,a);var b=this;return new yc(function(c){function d(a){var b=new Hb;
f.add(b),R(a)&&(a=kc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Cb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var wc=jc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ub.call(arguments,1)):(a=Ob,b=ub.call(arguments,0)):(a=Ob,b=ub.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),w(a,b).mergeAll()};dc.mergeAll=function(){var a=this;return new yc(function(b){var c=new Cb,d=!1,e=new Hb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Hb;c.add(e),R(a)&&(a=kc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},dc.mergeObservable=function(){return $("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},dc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return xc([this,a])};var xc=jc.onErrorResumeNext=function(){var a=j(arguments,0);return new yc(function(b){var c=0,d=new Ib,e=Ob.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],R(f)&&(f=kc(f)),g=new Hb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Cb(d,e)})};dc.skipUntil=function(a){var b=this;return new yc(function(c){var d=!1,e=new Cb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));R(a)&&(a=kc(a));var f=new Hb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},dc["switch"]=dc.switchLatest=function(){var a=this;return new yc(function(b){var c=!1,d=new Ib,e=!1,f=0,g=a.subscribe(function(a){var g=new Hb,h=++f;c=!0,d.setDisposable(g),R(a)&&(a=kc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Cb(g,d)})},dc.takeUntil=function(a){var b=this;return new yc(function(c){return R(a)&&(a=kc(a)),new Cb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),K))})},dc.zip=function(){if(Array.isArray(arguments[0]))return y.apply(this,arguments);var a=this,b=ub.call(arguments),c=b.pop();return b.unshift(a),new yc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(M)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Hb;R(c)&&(c=kc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Cb(j)})},jc.zip=function(){var a=ub.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},jc.zipArray=function(){var a=j(arguments,0);return new yc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(M))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(M)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Hb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Cb(h);return j.add(Fb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},dc.asObservable=function(){return new yc(this.subscribe.bind(this))},dc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},dc.dematerialize=function(){var a=this;return new yc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},dc.distinctUntilChanged=function(a,b){var c=this;return a||(a=M),b||(b=O),new yc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},dc["do"]=dc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new yc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},dc.doAction=function(){return $("doAction","do or tap"),this.tap.apply(this,arguments)},dc.doOnNext=dc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},dc.doOnError=dc.tapOnError=function(a,b){return this.tap(K,2===arguments.length?function(c){a.call(b,c)}:a)},dc.doOnCompleted=dc.tapOnCompleted=function(a,b){return this.tap(K,null,2===arguments.length?function(){a.call(b)}:a)},dc["finally"]=dc.ensure=function(a){var b=this;return new yc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Fb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},dc.finallyAction=function(a){return $("finallyAction","finally or ensure"),this.ensure(a)},dc.ignoreElements=function(){var a=this;return new yc(function(b){return a.subscribe(K,b.onError.bind(b),b.onCompleted.bind(b))})},dc.materialize=function(){var a=this;return new yc(function(b){return a.subscribe(function(a){b.onNext(Wb(a))},function(a){b.onNext(Xb(a)),b.onCompleted()},function(){b.onNext(Yb()),b.onCompleted()})})},dc.repeat=function(a){return _b(this,a).concat()},dc.retry=function(a){return _b(this,a).catchError()},dc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new yc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},dc.skipLast=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},dc.startWith=function(){var a,b,c=0;return arguments.length&&L(arguments[0])?(b=arguments[0],c=1):b=Ob,a=ub.call(arguments,c),ac([pc(a,b),this]).concat()},dc.takeLast=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},dc.takeLastBuffer=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},dc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(T);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(T);return new yc(function(d){function e(){var a=new Bc;i.push(a),d.onNext(xb(a,g))}var f=new Hb,g=new Jb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},dc.selectConcat=dc.concatMap=function(a,b,c){return S(a)&&S(b)?this.concatMap(function(c,d){var e=a(c,d);return R(e)&&(e=kc(e)),(Y(e)||X(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})}):S(a)?z(this,a,c):z(this,function(){return a})},dc.concatMapObserver=dc.selectConcatObserver=function(a,b,c,d){var e=this;return new yc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=kc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},dc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new yc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},B.prototype.push=function(a){var b=-1===A(this.set,a,this.comparer);return b&&this.set.push(a),b},dc.distinct=function(a,b){var c=this;return b||(b=O),new yc(function(d){var e=new B(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.select=dc.map=function(a,b){var c=S(a)?a:function(){return a},d=this;return new yc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},dc.pluck=function(a){return this.map(function(b){return b[a]})},dc.selectMany=dc.flatMap=function(a,b,c){return S(a)&&S(b)?this.flatMap(function(c,d){var e=a(c,d);return R(e)&&(e=kc(e)),(Y(e)||X(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):S(a)?C(this,a,c):C(this,function(){return a})},dc.flatMapObserver=dc.selectManyObserver=function(a,b,c,d){var e=this;return new yc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=kc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},dc.selectSwitch=dc.flatMapLatest=dc.switchMap=function(a,b){return this.select(a,b).switchLatest()},dc.skip=function(a){if(0>a)throw new Error(T);var b=this;return new yc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},dc.skipWhile=function(a,b){var c=this;return new yc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.take=function(a,b){if(0>a)throw new RangeError(T);if(0===a)return mc(b);var c=this;return new yc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},dc.takeWhile=function(a,b){var c=this;return new yc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},dc.where=dc.filter=function(a,b){var c=this;return new yc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new yc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var yc=J.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Fb(a):Gb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new zc(a);return Pb.scheduleRequired()?Pb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return vb(c,a),c}(jc),zc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Hb}vb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(ec),Ac=function(a,b){this.subject=a,this.observer=b};Ac.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Bc=J.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Gb):(a.onCompleted(),Gb):(this.observers.push(a),new Ac(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return vb(d,a),wb(d.prototype,bc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Cc(a,b)},d}(jc),Cc=(J.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Ac(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Gb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return vb(d,a),wb(d.prototype,bc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(jc),J.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return vb(b,a),wb(b.prototype,bc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(jc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(E.Rx=J,define(function(){return J})):F&&G?H?(G.exports=J).Rx=J:F.Rx=J:E.Rx=J}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(U)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&h(a)&&(a=ub.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===mb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==nb){var g=a.constructor,i=-1,j=qb.length;if(a===(g&&g.prototype))var k=a===stringProto?ib:a===mb?db:jb.call(a),l=rb[k];for(;++i<j;)f=qb[i],l&&l[f]||!kb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?jb.call(a)==_:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=jb.call(a),l=jb.call(b);if(k==_&&(k=gb),l==_&&(l=gb),k!=l)return!1;switch(k){case bb:case cb:return+a==+b;case fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case hb:case ib:return a==String(b)}var m=k==ab;if(!m){if(k!=gb||!sb.nodeClass&&(g(a)||g(b)))return!1;var n=!sb.argsObject&&h(a)?Object:a.constructor,o=!sb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||kb.call(a,"constructor")&&kb.call(b,"constructor")||S(n)&&n instanceof n&&S(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return kb.call(f,e)?(q++,r=kb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return kb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ub.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(){this._s=s}function o(){this._s=s,this._l=s.length,this._i=0}function p(a){this._a=a}function q(a){this._a=a,this._l=v(a),this._i=0}function r(a){return"number"==typeof a&&E.isFinite(a)}function t(b){var c,d=b[V];if(!d&&"string"==typeof b)return c=new n(b),c[V]();if(!d&&b.length!==a)return c=new p(b),c[V]();if(!d)throw new TypeError("Object is not iterable");return b[V]()}function u(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function v(a){var b=+a.length;return isNaN(b)?0:0!==b&&r(b)?(b=u(b)*Math.floor(Math.abs(b)),0>=b?0:b>nc?nc:b):b}function w(a,b){return L(a)||(a=Pb),new yc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function x(a,b){return new yc(function(c){var d=new Hb,e=new Ib;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}R(f)&&(f=kc(f)),d=new Hb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function y(a,b){var c=this;return new yc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=kc(f)),(Y(f)||X(f))&&(f=oc(f)),f}).concatAll()}function A(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function B(a){this.comparer=a,this.set=[]}function C(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=kc(f)),(Y(f)||X(f))&&(f=oc(f)),f}).mergeAll()}var D={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},E=D[typeof window]&&window||this,F=D[typeof exports]&&exports&&!exports.nodeType&&exports,G=D[typeof module]&&module&&!module.nodeType&&module,H=G&&G.exports===F&&F,I=D[typeof global]&&global;!I||I.global!==I&&I.window!==I||(E=I);var J={internals:{},config:{Promise:E.Promise},helpers:{}},K=J.helpers.noop=function(){},L=(J.helpers.notDefined=function(a){return"undefined"==typeof a},J.helpers.isScheduler=function(a){return a instanceof J.Scheduler}),M=J.helpers.identity=function(a){return a},N=(J.helpers.pluck=function(a){return function(b){return b[a]}},J.helpers.just=function(a){return function(){return a}},J.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),O=J.helpers.defaultComparer=function(a,b){return tb(a,b)},P=J.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Q=(J.helpers.defaultKeySerializer=function(a){return a.toString()},J.helpers.defaultError=function(a){throw a}),R=J.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},S=(J.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},J.helpers.not=function(a){return!a},J.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==jb.call(a)}),a}()),T="Argument out of range",U="Object has been disposed",V="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(V="@@iterator");var W=J.doneEnumerator={done:!0,value:a},X=J.helpers.isIterable=function(b){return b[V]!==a},Y=J.helpers.isArrayLike=function(b){return b&&b.length!==a};J.helpers.iterator=V;var Z,$=J.helpers.deprecate=function(){},_="[object Arguments]",ab="[object Array]",bb="[object Boolean]",cb="[object Date]",db="[object Error]",eb="[object Function]",fb="[object Number]",gb="[object Object]",hb="[object RegExp]",ib="[object String]",jb=Object.prototype.toString,kb=Object.prototype.hasOwnProperty,lb=jb.call(arguments)==_,mb=Error.prototype,nb=Object.prototype,ob=nb.propertyIsEnumerable;try{Z=!(jb.call(document)==gb&&!({toString:0}+""))}catch(pb){Z=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[ab]=rb[cb]=rb[fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[bb]=rb[ib]={constructor:!0,toString:!0,valueOf:!0},rb[db]=rb[eb]=rb[hb]={constructor:!0,toString:!0},rb[gb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(mb,"message")||ob.call(mb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1),lb||(h=function(a){return a&&"object"==typeof a?kb.call(a,"callee"):!1});var tb=J.internals.isEqual=function(a,b){return i(a,b,[],[])},ub=Array.prototype.slice,vb=({}.hasOwnProperty,this.inherits=J.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),wb=J.internals.addProperties=function(a){for(var b=ub.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},xb=J.internals.addRef=function(a,b){return new yc(function(c){return new Cb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=ub.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(ub.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(ub.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var yb=Object("a"),zb="a"!=yb[0]||!(0 in yb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=zb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=eb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=zb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=eb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==ab}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Ab=J.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Bb=Ab.prototype;Bb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Bb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Bb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Bb.peek=function(){return this.items[0].value},Bb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Bb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Bb.enqueue=function(a){var b=this.length++;this.items[b]=new l(Ab.count++,a),this.percolate(b)},Bb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Ab.count=0;var Cb=J.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Db=Cb.prototype;Db.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Db.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Db.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Db.toArray=function(){return this.disposables.slice(0)};var Eb=J.Disposable=function(a){this.isDisposed=!1,this.action=a||K};Eb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Fb=Eb.create=function(a){return new Eb(a)},Gb=Eb.empty={dispose:K},Hb=J.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Ib=J.SerialDisposable=Hb,Jb=J.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Gb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Kb=J.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||P,this.disposable=new Hb};Kb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Kb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Kb.prototype.isCancelled=function(){return this.disposable.isDisposed},Kb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Lb=J.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Gb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=N,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Mb=Lb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Cb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Gb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Cb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Gb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Lb.prototype),function(){Lb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Lb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof E.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=E.setInterval(function(){d=c(d)},b);return Fb(function(){E.clearInterval(e)})}}(Lb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Ub(this,a)}}(Lb.prototype);var Nb,Ob=(J.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Hb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Lb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Mb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Lb(N,a,b,c)}()),Pb=Lb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Lb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Lb.normalize(c),g=new Kb(this,b,d,f);if(e)e.enqueue(g);else{e=new Ab(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Lb(N,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Qb=K,Rb=function(){var a,b=K;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!E.setTimeout)throw new Error("No concurrency detected!");a=E.setTimeout,b=E.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Sb=Rb.setTimeout,Tb=Rb.clearTimeout;!function(){function a(){if(!E.postMessage||E.importScripts)return!1;var a=!1,b=E.onmessage;return E.onmessage=function(){a=!0},E.postMessage("","*"),E.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=I&&H&&I.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=I&&H&&I.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Nb=d,Qb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Nb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;E.addEventListener?E.addEventListener("message",b,!1):E.attachEvent("onmessage",b,!1),Nb=function(a){var b=h++;g[b]=a,E.postMessage(f+b,"*")}}else if(E.MessageChannel){var i=new E.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Nb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in E&&"onreadystatechange"in E.document.createElement("script")?Nb=function(a){var b=E.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},E.document.documentElement.appendChild(b)}:(Nb=function(a){return Sb(a,0)},Qb=Tb)}();var Ub=(Lb.timeout=function(){function a(a,b){var c=this,d=new Hb,e=Nb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Cb(d,Fb(function(){Qb(e)}))}function b(a,b,c){var d=this,e=Lb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Hb,g=Sb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Cb(f,Fb(function(){Tb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Lb(N,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return vb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Gb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Hb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Lb)),Vb=J.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return L(a)||(a=Ob),new yc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Wb=Vb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Vb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Xb=Vb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Vb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Yb=Vb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Vb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Zb=J.internals.Enumerator=function(a){this._next=a};Zb.prototype.next=function(){return this._next()},Zb.prototype[V]=function(){return this};var $b=J.internals.Enumerable=function(a){this._iterator=a};$b.prototype[V]=function(){return this._iterator()},$b.prototype.concat=function(){var a=this;return new yc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f=new Ib,g=Ob.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;R(h)&&(h=kc(h));var i=new Hb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Cb(f,g,Fb(function(){e=!0}))})},$b.prototype.catchError=function(){var a=this;return new yc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f,g=new Ib,h=Ob.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;R(i)&&(i=kc(i));var j=new Hb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Cb(g,h,Fb(function(){e=!0}))})};var _b=$b.repeat=function(a,b){return null==b&&(b=-1),new $b(function(){var c=b;return new Zb(function(){return 0===c?W:(c>0&&c--,{done:!1,value:a})})})},ac=$b.of=function(a,b,c){return b||(b=M),new $b(function(){var d=-1;return new Zb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:W})})},bc=J.Observer=function(){};bc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},bc.prototype.asObserver=function(){return new fc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},bc.prototype.checked=function(){return new gc(this)};var cc=bc.create=function(a,b,c){return a||(a=K),b||(b=Q),c||(c=K),new fc(a,b,c)};bc.fromNotifier=function(a,b){return new fc(function(c){return a.call(b,Wb(c))},function(c){return a.call(b,Xb(c))},function(){return a.call(b,Yb())})},bc.notifyOn=function(a){return new ic(a,this)};var dc,ec=J.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return vb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(bc),fc=J.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return vb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(ec),gc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}vb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(bc),hc=J.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Ib}return vb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(ec),ic=function(a){function b(){a.apply(this,arguments)}return vb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(hc),jc=J.Observable=function(){function a(a){this._subscribe=a}return dc=a.prototype,dc.subscribe=dc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:cc(a,b,c))},dc.subscribeOnNext=function(a,b){return this._subscribe(cc(2===arguments.length?function(c){a.call(b,c)}:a))},dc.subscribeOnError=function(a,b){return this._subscribe(cc(null,2===arguments.length?function(c){a.call(b,c)}:a))},dc.subscribeOnCompleted=function(a,b){return this._subscribe(cc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();dc.observeOn=function(a){var b=this;return new yc(function(c){return b.subscribe(new ic(a,c))})},dc.subscribeOn=function(a){var b=this;return new yc(function(c){var d=new Hb,e=new Ib;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var kc=jc.fromPromise=function(a){return lc(function(){var b=new J.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};dc.toPromise=function(a){if(a||(a=J.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},dc.toArray=function(){var a=this;return new yc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},jc.create=jc.createWithDisposable=function(a){return new yc(a)};var lc=jc.defer=function(a){return new yc(function(b){var c;try{c=a()}catch(d){return sc(d).subscribe(b)}return R(c)&&(c=kc(c)),c.subscribe(b)})},mc=jc.empty=function(a){return L(a)||(a=Ob),new yc(function(b){return a.schedule(function(){b.onCompleted()})})},nc=Math.pow(2,53)-1;n.prototype[V]=function(){return new o(this._s)},o.prototype[V]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return W},p.prototype[V]=function(){return new q(this._a)},q.prototype[V]=function(){return this},q.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return W};var oc=jc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!S(b))throw new Error("mapFn when provided must be a function");L(d)||(d=Pb);var e=Object(a),f=t(e);return new yc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&S(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},pc=jc.fromArray=function(a,b){return $("fromArray","from"),L(b)||(b=Pb),new yc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};jc.generate=function(a,b,c,d,e){return L(e)||(e=Pb),new yc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var qc=jc.never=function(){return new yc(function(){return Gb})};jc.of=function(){return w(null,arguments)},jc.ofWithScheduler=function(a){return w(a,ub.call(arguments,1))},jc.range=function(a,b,c){return L(c)||(c=Pb),new yc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},jc.repeat=function(a,b,c){return L(c)||(c=Pb),rc(a,c).repeat(null==b?-1:b)};var rc=jc["return"]=jc.just=function(a,b){return L(b)||(b=Ob),new yc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};jc.returnValue=function(){return $("returnValue","return or just"),rc.apply(null,arguments)};var sc=jc["throw"]=jc.throwException=jc.throwError=function(a,b){return L(b)||(b=Ob),new yc(function(c){return b.schedule(function(){c.onError(a)})})};jc.using=function(a,b){return new yc(function(c){var d,e,f=Gb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Cb(sc(g).subscribe(c),f)}return new Cb(e.subscribe(c),f)})},dc.amb=function(a){var b=this;return new yc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Hb,j=new Hb;return R(a)&&(a=kc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Cb(i,j)})},jc.amb=function(){function a(a,b){return a.amb(b)}for(var b=qc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},dc["catch"]=dc.catchError=function(a){return"function"==typeof a?x(this,a):tc([this,a])},dc.catchException=function(a){return $("catchException","catch or catchError"),this.catchError(a)};var tc=jc.catchError=jc["catch"]=function(){return ac(j(arguments,0)).catchError()};jc.catchException=function(){return $("catchException","catch or catchError"),tc.apply(null,arguments)},dc.combineLatest=function(){var a=ub.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),uc.apply(this,a)};var uc=jc.combineLatest=function(){var a=ub.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new yc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(M))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(M)&&c.onCompleted()}function e(a){j[a]=!0,j.every(M)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Hb;R(f)&&(f=kc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Cb(m)})};dc.concat=function(){var a=ub.call(arguments,0);return a.unshift(this),vc.apply(this,a)};var vc=jc.concat=function(){return ac(j(arguments,0)).concat()};dc.concatAll=function(){return this.merge(1)},dc.concatObservable=function(){return $("concatObservable","concatAll"),this.merge(1)},dc.merge=function(a){if("number"!=typeof a)return wc(this,a);var b=this;return new yc(function(c){function d(a){var b=new Hb;f.add(b),R(a)&&(a=kc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())
}))}var e=0,f=new Cb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var wc=jc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ub.call(arguments,1)):(a=Ob,b=ub.call(arguments,0)):(a=Ob,b=ub.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),w(a,b).mergeAll()};dc.mergeAll=function(){var a=this;return new yc(function(b){var c=new Cb,d=!1,e=new Hb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Hb;c.add(e),R(a)&&(a=kc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},dc.mergeObservable=function(){return $("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},dc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return xc([this,a])};var xc=jc.onErrorResumeNext=function(){var a=j(arguments,0);return new yc(function(b){var c=0,d=new Ib,e=Ob.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],R(f)&&(f=kc(f)),g=new Hb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Cb(d,e)})};dc.skipUntil=function(a){var b=this;return new yc(function(c){var d=!1,e=new Cb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));R(a)&&(a=kc(a));var f=new Hb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},dc["switch"]=dc.switchLatest=function(){var a=this;return new yc(function(b){var c=!1,d=new Ib,e=!1,f=0,g=a.subscribe(function(a){var g=new Hb,h=++f;c=!0,d.setDisposable(g),R(a)&&(a=kc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Cb(g,d)})},dc.takeUntil=function(a){var b=this;return new yc(function(c){return R(a)&&(a=kc(a)),new Cb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),K))})},dc.zip=function(){if(Array.isArray(arguments[0]))return y.apply(this,arguments);var a=this,b=ub.call(arguments),c=b.pop();return b.unshift(a),new yc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(M)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Hb;R(c)&&(c=kc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Cb(j)})},jc.zip=function(){var a=ub.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},jc.zipArray=function(){var a=j(arguments,0);return new yc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(M))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(M)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Hb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Cb(h);return j.add(Fb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},dc.asObservable=function(){return new yc(this.subscribe.bind(this))},dc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},dc.dematerialize=function(){var a=this;return new yc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},dc.distinctUntilChanged=function(a,b){var c=this;return a||(a=M),b||(b=O),new yc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},dc["do"]=dc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new yc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},dc.doAction=function(){return $("doAction","do or tap"),this.tap.apply(this,arguments)},dc.doOnNext=dc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},dc.doOnError=dc.tapOnError=function(a,b){return this.tap(K,2===arguments.length?function(c){a.call(b,c)}:a)},dc.doOnCompleted=dc.tapOnCompleted=function(a,b){return this.tap(K,null,2===arguments.length?function(){a.call(b)}:a)},dc["finally"]=dc.ensure=function(a){var b=this;return new yc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Fb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},dc.finallyAction=function(a){return $("finallyAction","finally or ensure"),this.ensure(a)},dc.ignoreElements=function(){var a=this;return new yc(function(b){return a.subscribe(K,b.onError.bind(b),b.onCompleted.bind(b))})},dc.materialize=function(){var a=this;return new yc(function(b){return a.subscribe(function(a){b.onNext(Wb(a))},function(a){b.onNext(Xb(a)),b.onCompleted()},function(){b.onNext(Yb()),b.onCompleted()})})},dc.repeat=function(a){return _b(this,a).concat()},dc.retry=function(a){return _b(this,a).catchError()},dc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new yc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},dc.skipLast=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},dc.startWith=function(){var a,b,c=0;return arguments.length&&L(arguments[0])?(b=arguments[0],c=1):b=Ob,a=ub.call(arguments,c),ac([pc(a,b),this]).concat()},dc.takeLast=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},dc.takeLastBuffer=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},dc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(T);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(T);return new yc(function(d){function e(){var a=new Bc;i.push(a),d.onNext(xb(a,g))}var f=new Hb,g=new Jb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},dc.selectConcat=dc.concatMap=function(a,b,c){return S(a)&&S(b)?this.concatMap(function(c,d){var e=a(c,d);return R(e)&&(e=kc(e)),(Y(e)||X(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})}):S(a)?z(this,a,c):z(this,function(){return a})},dc.concatMapObserver=dc.selectConcatObserver=function(a,b,c,d){var e=this;return new yc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=kc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},dc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new yc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},B.prototype.push=function(a){var b=-1===A(this.set,a,this.comparer);return b&&this.set.push(a),b},dc.distinct=function(a,b){var c=this;return b||(b=O),new yc(function(d){var e=new B(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.select=dc.map=function(a,b){var c=S(a)?a:function(){return a},d=this;return new yc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},dc.pluck=function(a){return this.map(function(b){return b[a]})},dc.selectMany=dc.flatMap=function(a,b,c){return S(a)&&S(b)?this.flatMap(function(c,d){var e=a(c,d);return R(e)&&(e=kc(e)),(Y(e)||X(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):S(a)?C(this,a,c):C(this,function(){return a})},dc.flatMapObserver=dc.selectManyObserver=function(a,b,c,d){var e=this;return new yc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=kc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},dc.selectSwitch=dc.flatMapLatest=dc.switchMap=function(a,b){return this.select(a,b).switchLatest()},dc.skip=function(a){if(0>a)throw new Error(T);var b=this;return new yc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},dc.skipWhile=function(a,b){var c=this;return new yc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.take=function(a,b){if(0>a)throw new RangeError(T);if(0===a)return mc(b);var c=this;return new yc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},dc.takeWhile=function(a,b){var c=this;return new yc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},dc.where=dc.filter=function(a,b){var c=this;return new yc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new yc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var yc=J.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Fb(a):Gb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new zc(a);return Pb.scheduleRequired()?Pb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return vb(c,a),c}(jc),zc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Hb}vb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(ec),Ac=function(a,b){this.subject=a,this.observer=b};Ac.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Bc=J.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Gb):(a.onCompleted(),Gb):(this.observers.push(a),new Ac(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return vb(d,a),wb(d.prototype,bc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Cc(a,b)},d}(jc),Cc=(J.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Ac(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Gb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return vb(d,a),wb(d.prototype,bc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(jc),J.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return vb(b,a),wb(b.prototype,bc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(jc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(E.Rx=J,define(function(){return J})):F&&G?H?(G.exports=J).Rx=J:F.Rx=J:E.Rx=J}).call(this);
//# sourceMappingURL=rx.compat.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(ab)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;Ab.nonEnumArgs&&a.length&&h(a)&&(a=Cb.call(a));var d=Ab.enumPrototypes&&"function"==typeof a,e=Ab.enumErrorProps&&(a===ub||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(Ab.nonEnumShadows&&a!==vb){var g=a.constructor,i=-1,j=yb.length;if(a===(g&&g.prototype))var k=a===stringProto?qb:a===ub?lb:rb.call(a),l=zb[k];for(;++i<j;)f=yb[i],l&&l[f]||!sb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?rb.call(a)==hb:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=rb.call(a),l=rb.call(b);if(k==hb&&(k=ob),l==hb&&(l=ob),k!=l)return!1;switch(k){case jb:case kb:return+a==+b;case nb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case pb:case qb:return a==String(b)}var m=k==ib;if(!m){if(k!=ob||!Ab.nodeClass&&(g(a)||g(b)))return!1;var n=!Ab.argsObject&&h(a)?Object:a.constructor,o=!Ab.argsObject&&h(b)?Object:b.constructor;if(!(n==o||sb.call(a,"constructor")&&sb.call(b,"constructor")||$(n)&&n instanceof n&&$(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return sb.call(f,e)?(q++,r=sb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return sb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Cb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&M.isFinite(a)}function r(b){var c,d=b[bb];if(!d&&"string"==typeof b)return c=new m(b),c[bb]();if(!d&&b.length!==a)return c=new o(b),c[bb]();if(!d)throw new TypeError("Object is not iterable");return b[bb]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>qc?qc:b):b}function v(a,b){return T(a)||(a=Vb),new Kc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new Kc(function(c){var d=new Ob,e=new Pb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Z(f)&&(f=Dc(f)),d=new Ob,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new Kc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Z(f)&&(f=Dc(f)),(eb(f)||db(f))&&(f=rc(f)),f}).concatAll()}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Z(f)&&(f=Dc(f)),(eb(f)||db(f))&&(f=rc(f)),f}).mergeAll()}function A(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=M.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function B(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Mb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(A(a))};return a.attachEvent("on"+b,d),Mb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Mb(function(){a["on"+b]=null})}function C(a,b,c){var d=new Jb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(C(a.item(e),b,c));else a&&d.add(B(a,b,c));return d}function D(a,b){return new Kc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function E(a,b,c){return new Kc(function(d){var e=0,f=a,g=Sb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function F(a,b){return new Kc(function(c){return b.scheduleWithRelative(Sb(a),function(){c.onNext(0),c.onCompleted()})})}function G(a,b,c){return a===b?new Kc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):oc(function(){return E(c.now()+a,b,c)})}function H(a,b,c){return new Kc(function(d){var e,f=!1,g=new Pb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Ob,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Jb(e,g)})}function I(a,b,c){return oc(function(){return H(a,b-c.now(),c)})}function J(a,b){return new Kc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Jb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function K(a,b,c){return new Kc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(U))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Jb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var L={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},M=L[typeof window]&&window||this,N=L[typeof exports]&&exports&&!exports.nodeType&&exports,O=L[typeof module]&&module&&!module.nodeType&&module,P=O&&O.exports===N&&N,Q=L[typeof global]&&global;!Q||Q.global!==Q&&Q.window!==Q||(M=Q);var R={internals:{},config:{Promise:M.Promise},helpers:{}},S=R.helpers.noop=function(){},T=(R.helpers.notDefined=function(a){return"undefined"==typeof a},R.helpers.isScheduler=function(a){return a instanceof R.Scheduler}),U=R.helpers.identity=function(a){return a},V=(R.helpers.pluck=function(a){return function(b){return b[a]}},R.helpers.just=function(a){return function(){return a}},R.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),W=R.helpers.defaultComparer=function(a,b){return Bb(a,b)},X=R.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Y=(R.helpers.defaultKeySerializer=function(a){return a.toString()},R.helpers.defaultError=function(a){throw a}),Z=R.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},$=(R.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},R.helpers.not=function(a){return!a},R.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==rb.call(a)}),a}()),_="Argument out of range",ab="Object has been disposed",bb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";M.Set&&"function"==typeof(new M.Set)["@@iterator"]&&(bb="@@iterator");var cb=R.doneEnumerator={done:!0,value:a},db=R.helpers.isIterable=function(b){return b[bb]!==a},eb=R.helpers.isArrayLike=function(b){return b&&b.length!==a};R.helpers.iterator=bb;var fb,gb=R.helpers.deprecate=function(a,b){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(a+" is deprecated, use "+b+" instead.",new Error("").stack)},hb="[object Arguments]",ib="[object Array]",jb="[object Boolean]",kb="[object Date]",lb="[object Error]",mb="[object Function]",nb="[object Number]",ob="[object Object]",pb="[object RegExp]",qb="[object String]",rb=Object.prototype.toString,sb=Object.prototype.hasOwnProperty,tb=rb.call(arguments)==hb,ub=Error.prototype,vb=Object.prototype,wb=vb.propertyIsEnumerable;try{fb=!(rb.call(document)==ob&&!({toString:0}+""))}catch(xb){fb=!0}var yb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],zb={};zb[ib]=zb[kb]=zb[nb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},zb[jb]=zb[qb]={constructor:!0,toString:!0,valueOf:!0},zb[lb]=zb[mb]=zb[pb]={constructor:!0,toString:!0},zb[ob]={constructor:!0};var Ab={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Ab.enumErrorProps=wb.call(ub,"message")||wb.call(ub,"name"),Ab.enumPrototypes=wb.call(a,"prototype"),Ab.nonEnumArgs=0!=c,Ab.nonEnumShadows=!/valueOf/.test(b)}(1),tb||(h=function(a){return a&&"object"==typeof a?sb.call(a,"callee"):!1});{var Bb=R.internals.isEqual=function(a,b){return i(a,b,[],[])},Cb=Array.prototype.slice,Db=({}.hasOwnProperty,this.inherits=R.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Eb=R.internals.addProperties=function(a){for(var b=Cb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};R.internals.addRef=function(a,b){return new Kc(function(c){return new Jb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Cb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Cb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Cb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Fb=Object("a"),Gb="a"!=Fb[0]||!(0 in Fb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Gb&&{}.toString.call(this)==qb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=mb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Gb&&{}.toString.call(this)==qb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=mb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==ib}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Hb=R.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ib=Hb.prototype;Ib.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ib.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Ib.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Ib.peek=function(){return this.items[0].value},Ib.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ib.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ib.enqueue=function(a){var b=this.length++;this.items[b]=new l(Hb.count++,a),this.percolate(b)},Ib.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Hb.count=0;var Jb=R.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Kb=Jb.prototype;Kb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Kb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Kb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Kb.toArray=function(){return this.disposables.slice(0)};var Lb=R.Disposable=function(a){this.isDisposed=!1,this.action=a||S};Lb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Mb=Lb.create=function(a){return new Lb(a)},Nb=Lb.empty={dispose:S},Ob=R.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Pb=R.SerialDisposable=Ob,Qb=(R.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Nb:new a(this)},b}(),R.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||X,this.disposable=new Ob});Qb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Qb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Qb.prototype.isCancelled=function(){return this.disposable.isDisposed},Qb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Rb=R.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Nb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=V,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Sb=Rb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Jb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Nb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Jb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Nb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Rb.prototype),function(){Rb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Rb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof M.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=M.setInterval(function(){d=c(d)},b);return Mb(function(){M.clearInterval(e)})}}(Rb.prototype);var Tb,Ub=Rb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Sb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Rb(V,a,b,c)}(),Vb=Rb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Rb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Rb.normalize(c),g=new Qb(this,b,d,f);if(e)e.enqueue(g);else{e=new Hb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Rb(V,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Wb=(R.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Ob;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),S),Xb=function(){var a,b=S;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!M.setTimeout)throw new Error("No concurrency detected!");a=M.setTimeout,b=M.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Yb=Xb.setTimeout,Zb=Xb.clearTimeout;!function(){function a(){if(!M.postMessage||M.importScripts)return!1;var a=!1,b=M.onmessage;return M.onmessage=function(){a=!0},M.postMessage("","*"),M.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(rb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=Q&&P&&Q.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=Q&&P&&Q.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Tb=d,Wb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Tb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;M.addEventListener?M.addEventListener("message",b,!1):M.attachEvent("onmessage",b,!1),Tb=function(a){var b=h++;g[b]=a,M.postMessage(f+b,"*")}}else if(M.MessageChannel){var i=new M.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Tb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in M&&"onreadystatechange"in M.document.createElement("script")?Tb=function(a){var b=M.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},M.document.documentElement.appendChild(b)}:(Tb=function(a){return Yb(a,0)},Wb=Zb)}();var $b=Rb.timeout=function(){function a(a,b){var c=this,d=new Ob,e=Tb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Jb(d,Mb(function(){Wb(e)}))}function b(a,b,c){var d=this,e=Rb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Ob,g=Yb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Jb(f,Mb(function(){Zb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Rb(V,a,b,c)}(),_b=R.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return T(a)||(a=Ub),new Kc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ac=_b.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new _b("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),bc=_b.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new _b("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),cc=_b.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new _b("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),dc=R.internals.Enumerator=function(a){this._next=a};dc.prototype.next=function(){return this._next()},dc.prototype[bb]=function(){return this};var ec=R.internals.Enumerable=function(a){this._iterator=a};ec.prototype[bb]=function(){return this._iterator()},ec.prototype.concat=function(){var a=this;return new Kc(function(b){var c;try{c=a[bb]()}catch(d){return void b.onError()}var e,f=new Pb,g=Ub.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Z(h)&&(h=Dc(h));var i=new Ob;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Jb(f,g,Mb(function(){e=!0}))})},ec.prototype.catchError=function(){var a=this;return new Kc(function(b){var c;try{c=a[bb]()}catch(d){return void b.onError()}var e,f,g=new Pb,h=Ub.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Z(i)&&(i=Dc(i));var j=new Ob;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Jb(g,h,Mb(function(){e=!0}))})};var fc=ec.repeat=function(a,b){return null==b&&(b=-1),new ec(function(){var c=b;return new dc(function(){return 0===c?cb:(c>0&&c--,{done:!1,value:a})})})},gc=ec.of=function(a,b,c){return b||(b=U),new ec(function(){var d=-1;return new dc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:cb})})},hc=R.Observer=function(){};hc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},hc.prototype.asObserver=function(){return new lc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var ic=hc.create=function(a,b,c){return a||(a=S),b||(b=Y),c||(c=S),new lc(a,b,c)};hc.fromNotifier=function(a,b){return new lc(function(c){return a.call(b,ac(c))},function(c){return a.call(b,bc(c))},function(){return a.call(b,cc())})};var jc,kc=R.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Db(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(hc),lc=R.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Db(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(kc),mc=R.Observable=function(){function a(a){this._subscribe=a}return jc=a.prototype,jc.subscribe=jc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ic(a,b,c))},jc.subscribeOnNext=function(a,b){return this._subscribe(ic(2===arguments.length?function(c){a.call(b,c)}:a))},jc.subscribeOnError=function(a,b){return this._subscribe(ic(null,2===arguments.length?function(c){a.call(b,c)}:a))},jc.subscribeOnCompleted=function(a,b){return this._subscribe(ic(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),nc=R.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Pb}return Db(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(kc);jc.toArray=function(){var a=this;return new Kc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},mc.create=mc.createWithDisposable=function(a){return new Kc(a)};var oc=mc.defer=function(a){return new Kc(function(b){var c;try{c=a()}catch(d){return uc(d).subscribe(b)}return Z(c)&&(c=Dc(c)),c.subscribe(b)})},pc=mc.empty=function(a){return T(a)||(a=Ub),new Kc(function(b){return a.schedule(function(){b.onCompleted()})})},qc=Math.pow(2,53)-1;m.prototype[bb]=function(){return new n(this._s)},n.prototype[bb]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return cb},o.prototype[bb]=function(){return new p(this._a)},p.prototype[bb]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return cb};{var rc=mc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!$(b))throw new Error("mapFn when provided must be a function");T(d)||(d=Vb);var e=Object(a),f=r(e);return new Kc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&$(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},sc=mc.fromArray=function(a,b){return T(b)||(b=Vb),new Kc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};mc.never=function(){return new Kc(function(){return Nb})}}mc.of=function(){return v(null,arguments)},mc.ofWithScheduler=function(a){return v(a,Cb.call(arguments,1))},mc.range=function(a,b,c){return T(c)||(c=Vb),new Kc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},mc.repeat=function(a,b,c){return T(c)||(c=Vb),tc(a,c).repeat(null==b?-1:b)};var tc=mc["return"]=mc.just=function(a,b){return T(b)||(b=Ub),new Kc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};mc.returnValue=function(){return gb("returnValue","return or just"),tc.apply(null,arguments)};var uc=mc["throw"]=mc.throwException=mc.throwError=function(a,b){return T(b)||(b=Ub),new Kc(function(c){return b.schedule(function(){c.onError(a)})})};jc["catch"]=jc.catchError=function(a){return"function"==typeof a?w(this,a):vc([this,a])},jc.catchException=function(a){return gb("catchException","catch or catchError"),this.catchError(a)};var vc=mc.catchError=mc["catch"]=function(){return gc(j(arguments,0)).catchError()};mc.catchException=function(){return gb("catchException","catch or catchError"),vc.apply(null,arguments)},jc.combineLatest=function(){var a=Cb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),wc.apply(this,a)};var wc=mc.combineLatest=function(){var a=Cb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Kc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(U))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(U)&&c.onCompleted()}function e(a){j[a]=!0,j.every(U)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Ob;Z(f)&&(f=Dc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Jb(m)})};jc.concat=function(){var a=Cb.call(arguments,0);return a.unshift(this),xc.apply(this,a)};var xc=mc.concat=function(){return gc(j(arguments,0)).concat()};jc.concatAll=function(){return this.merge(1)},jc.concatObservable=function(){return gb("concatObservable","concatAll"),this.merge(1)},jc.merge=function(a){if("number"!=typeof a)return yc(this,a);var b=this;return new Kc(function(c){function d(a){var b=new Ob;f.add(b),Z(a)&&(a=Dc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Jb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var yc=mc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Cb.call(arguments,1)):(a=Ub,b=Cb.call(arguments,0)):(a=Ub,b=Cb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};jc.mergeAll=function(){var a=this;return new Kc(function(b){var c=new Jb,d=!1,e=new Ob;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Ob;c.add(e),Z(a)&&(a=Dc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},jc.mergeObservable=function(){return gb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},jc.skipUntil=function(a){var b=this;return new Kc(function(c){var d=!1,e=new Jb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()
}));Z(a)&&(a=Dc(a));var f=new Ob;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},jc["switch"]=jc.switchLatest=function(){var a=this;return new Kc(function(b){var c=!1,d=new Pb,e=!1,f=0,g=a.subscribe(function(a){var g=new Ob,h=++f;c=!0,d.setDisposable(g),Z(a)&&(a=Dc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Jb(g,d)})},jc.takeUntil=function(a){var b=this;return new Kc(function(c){return Z(a)&&(a=Dc(a)),new Jb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),S))})},jc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=Cb.call(arguments),c=b.pop();return b.unshift(a),new Kc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(U)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Ob;Z(c)&&(c=Dc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Jb(j)})},mc.zip=function(){var a=Cb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},mc.zipArray=function(){var a=j(arguments,0);return new Kc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(U))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(U)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Ob,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Jb(h);return j.add(Mb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},jc.asObservable=function(){return new Kc(this.subscribe.bind(this))},jc.dematerialize=function(){var a=this;return new Kc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},jc.distinctUntilChanged=function(a,b){var c=this;return a||(a=U),b||(b=W),new Kc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},jc["do"]=jc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Kc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},jc.doAction=function(){return gb("doAction","do or tap"),this.tap.apply(this,arguments)},jc.doOnNext=jc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},jc.doOnError=jc.tapOnError=function(a,b){return this.tap(S,2===arguments.length?function(c){a.call(b,c)}:a)},jc.doOnCompleted=jc.tapOnCompleted=function(a,b){return this.tap(S,null,2===arguments.length?function(){a.call(b)}:a)},jc["finally"]=jc.ensure=function(a){var b=this;return new Kc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Mb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},jc.finallyAction=function(a){return gb("finallyAction","finally or ensure"),this.ensure(a)},jc.ignoreElements=function(){var a=this;return new Kc(function(b){return a.subscribe(S,b.onError.bind(b),b.onCompleted.bind(b))})},jc.materialize=function(){var a=this;return new Kc(function(b){return a.subscribe(function(a){b.onNext(ac(a))},function(a){b.onNext(bc(a)),b.onCompleted()},function(){b.onNext(cc()),b.onCompleted()})})},jc.repeat=function(a){return fc(this,a).concat()},jc.retry=function(a){return fc(this,a).catchError()},jc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Kc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},jc.skipLast=function(a){var b=this;return new Kc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},jc.startWith=function(){var a,b,c=0;return arguments.length&&T(arguments[0])?(b=arguments[0],c=1):b=Ub,a=Cb.call(arguments,c),gc([sc(a,b),this]).concat()},jc.takeLast=function(a){var b=this;return new Kc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},jc.selectConcat=jc.concatMap=function(a,b,c){return $(a)&&$(b)?this.concatMap(function(c,d){var e=a(c,d);return Z(e)&&(e=Dc(e)),(eb(e)||db(e))&&(e=rc(e)),e.map(function(a,e){return b(c,a,d,e)})}):$(a)?y(this,a,c):y(this,function(){return a})},jc.select=jc.map=function(a,b){var c=$(a)?a:function(){return a},d=this;return new Kc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},jc.pluck=function(a){return this.map(function(b){return b[a]})},jc.selectMany=jc.flatMap=function(a,b,c){return $(a)&&$(b)?this.flatMap(function(c,d){var e=a(c,d);return Z(e)&&(e=Dc(e)),(eb(e)||db(e))&&(e=rc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):$(a)?z(this,a,c):z(this,function(){return a})},jc.selectSwitch=jc.flatMapLatest=jc.switchMap=function(a,b){return this.select(a,b).switchLatest()},jc.skip=function(a){if(0>a)throw new Error(_);var b=this;return new Kc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},jc.skipWhile=function(a,b){var c=this;return new Kc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},jc.take=function(a,b){if(0>a)throw new RangeError(_);if(0===a)return pc(b);var c=this;return new Kc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},jc.takeWhile=function(a,b){var c=this;return new Kc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},jc.where=jc.filter=function(a,b){var c=this;return new Kc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},mc.fromCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Kc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},mc.fromNodeCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Kc(function(e){function f(a){if(a)return void e.onError(a);var b=Cb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},R.config.useNativeEvents=!1;var zc=M.angular&&angular.element?angular.element:M.jQuery?M.jQuery:M.Zepto?M.Zepto:null,Ac=!!M.Ember&&"function"==typeof M.Ember.addListener,Bc=!!M.Backbone&&!!M.Backbone.Marionette;mc.fromEvent=function(a,b,c){if(a.addListener)return Cc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!R.config.useNativeEvents){if(Bc)return Cc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Ac)return Cc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(zc){var d=zc(a);return Cc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Kc(function(d){return C(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Cc=mc.fromEventPattern=function(a,b,c){return new Kc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Mb(function(){b&&b(e,f)})}).publish().refCount()},Dc=mc.fromPromise=function(a){return oc(function(){var b=new R.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};jc.toPromise=function(a){if(a||(a=R.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},mc.startAsync=function(a){var b;try{b=a()}catch(c){return uc(c)}return Dc(b)},jc.multicast=function(a,b){var c=this;return"function"==typeof a?new Kc(function(d){var e=c.multicast(a());return new Jb(b(e).subscribe(d),e.connect())}):new Ec(c,a)},jc.publish=function(a){return a&&$(a)?this.multicast(function(){return new Nc},a):this.multicast(new Nc)},jc.share=function(){return this.publish().refCount()},jc.publishLast=function(a){return a&&$(a)?this.multicast(function(){return new Oc},a):this.multicast(new Oc)},jc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Qc(b)},a):this.multicast(new Qc(a))},jc.shareValue=function(a){return this.publishValue(a).refCount()},jc.replay=function(a,b,c,d){return a&&$(a)?this.multicast(function(){return new Rc(b,c,d)},a):this.multicast(new Rc(b,c,d))},jc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Ec=R.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Jb(f.subscribe(c),Mb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Db(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Kc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(mc),Fc=mc.interval=function(a,b){return G(a,a,T(b)?b:$b)};mc.timer=function(b,c,d){var e;return T(d)||(d=$b),c!==a&&"number"==typeof c?e=c:T(c)&&(d=c),b instanceof Date&&e===a?D(b.getTime(),d):b instanceof Date&&e!==a?(e=c,E(b.getTime(),e,d)):e===a?F(b,d):G(b,e,d)}}jc.delay=function(a,b){return T(b)||(b=$b),a instanceof Date?I(this,a.getTime(),b):H(this,a,b)},jc.debounce=jc.throttleWithTimeout=function(a,b){T(b)||(b=$b);var c=this;return new Kc(function(d){var e,f=new Pb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Ob;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Jb(i,f)})},jc.throttle=function(a,b){return gb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},jc.timestamp=function(a){return T(a)||(a=$b),this.map(function(b){return{value:b,timestamp:a.now()}})},jc.sample=jc.throttleLatest=function(a,b){return T(b)||(b=$b),"number"==typeof a?J(this,Fc(a,b)):J(this,a)},jc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=uc(new Error(b||"Timeout"))),T(c)||(c=$b);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Kc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Z(b)&&(b=Dc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Ob,j=new Pb,k=!1,l=new Pb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Jb(j,l)})},jc.throttleFirst=function(a,b){T(b)||(b=$b);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Kc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Gc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Nb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Nb)});return new Jb(c,d,e)}function c(c,d){this.source=c,this.controller=new Nc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Db(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(mc);jc.pausable=function(a){return new Gc(this,a)};var Hc=function(b){function c(b){var c,d=[],e=K(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Nc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Db(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(mc);jc.pausableBuffered=function(a){return new Hc(this,a)},jc.controlled=function(a){return null==a&&(a=!0),new Ic(this,a)};var Ic=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Jc(d),this.source=c.multicast(this.subject).refCount()}return Db(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(mc),Jc=R.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Nc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Nb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Nb}return Db(d,a),Eb(d.prototype,hc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Nb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Nb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Nb:(this.requestedCount=a,this.requestedDisposable=Mb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Nb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(mc);jc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Kc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Kc=R.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Mb(a):Nb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Lc(a);return Vb.scheduleRequired()?Vb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Db(c,a),c}(mc),Lc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Ob}Db(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(kc),Mc=function(a,b){this.subject=a,this.observer=b};Mc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Nc=R.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Nb):(a.onCompleted(),Nb):(this.observers.push(a),new Mc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Pc(a,b)},d}(mc),Oc=R.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Mc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Nb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(mc),Pc=R.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Db(b,a),Eb(b.prototype,hc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(mc),Qc=R.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Mc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Nb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(mc),Rc=R.ReplaySubject=function(a){function c(a,b){return Mb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new nc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Vb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Db(e,a),Eb(e.prototype,hc,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(mc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(M.Rx=R,define(function(){return R})):N&&O?P?(O.exports=R).Rx=R:N.Rx=R:M.Rx=R}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(ab)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;Ab.nonEnumArgs&&a.length&&h(a)&&(a=Cb.call(a));var d=Ab.enumPrototypes&&"function"==typeof a,e=Ab.enumErrorProps&&(a===ub||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(Ab.nonEnumShadows&&a!==vb){var g=a.constructor,i=-1,j=yb.length;if(a===(g&&g.prototype))var k=a===stringProto?qb:a===ub?lb:rb.call(a),l=zb[k];for(;++i<j;)f=yb[i],l&&l[f]||!sb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?rb.call(a)==hb:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=rb.call(a),l=rb.call(b);if(k==hb&&(k=ob),l==hb&&(l=ob),k!=l)return!1;switch(k){case jb:case kb:return+a==+b;case nb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case pb:case qb:return a==String(b)}var m=k==ib;if(!m){if(k!=ob||!Ab.nodeClass&&(g(a)||g(b)))return!1;var n=!Ab.argsObject&&h(a)?Object:a.constructor,o=!Ab.argsObject&&h(b)?Object:b.constructor;if(!(n==o||sb.call(a,"constructor")&&sb.call(b,"constructor")||$(n)&&n instanceof n&&$(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return sb.call(f,e)?(q++,r=sb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return sb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Cb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&M.isFinite(a)}function r(b){var c,d=b[bb];if(!d&&"string"==typeof b)return c=new m(b),c[bb]();if(!d&&b.length!==a)return c=new o(b),c[bb]();if(!d)throw new TypeError("Object is not iterable");return b[bb]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>qc?qc:b):b}function v(a,b){return T(a)||(a=Vb),new Kc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new Kc(function(c){var d=new Ob,e=new Pb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Z(f)&&(f=Dc(f)),d=new Ob,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new Kc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Z(f)&&(f=Dc(f)),(eb(f)||db(f))&&(f=rc(f)),f}).concatAll()}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Z(f)&&(f=Dc(f)),(eb(f)||db(f))&&(f=rc(f)),f}).mergeAll()}function A(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=M.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function B(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Mb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(A(a))};return a.attachEvent("on"+b,d),Mb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Mb(function(){a["on"+b]=null})}function C(a,b,c){var d=new Jb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(C(a.item(e),b,c));else a&&d.add(B(a,b,c));return d}function D(a,b){return new Kc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function E(a,b,c){return new Kc(function(d){var e=0,f=a,g=Sb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function F(a,b){return new Kc(function(c){return b.scheduleWithRelative(Sb(a),function(){c.onNext(0),c.onCompleted()})})}function G(a,b,c){return a===b?new Kc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):oc(function(){return E(c.now()+a,b,c)})}function H(a,b,c){return new Kc(function(d){var e,f=!1,g=new Pb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Ob,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Jb(e,g)})}function I(a,b,c){return oc(function(){return H(a,b-c.now(),c)})}function J(a,b){return new Kc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Jb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function K(a,b,c){return new Kc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(U))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Jb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var L={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},M=L[typeof window]&&window||this,N=L[typeof exports]&&exports&&!exports.nodeType&&exports,O=L[typeof module]&&module&&!module.nodeType&&module,P=O&&O.exports===N&&N,Q=L[typeof global]&&global;!Q||Q.global!==Q&&Q.window!==Q||(M=Q);var R={internals:{},config:{Promise:M.Promise},helpers:{}},S=R.helpers.noop=function(){},T=(R.helpers.notDefined=function(a){return"undefined"==typeof a},R.helpers.isScheduler=function(a){return a instanceof R.Scheduler}),U=R.helpers.identity=function(a){return a},V=(R.helpers.pluck=function(a){return function(b){return b[a]}},R.helpers.just=function(a){return function(){return a}},R.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),W=R.helpers.defaultComparer=function(a,b){return Bb(a,b)},X=R.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Y=(R.helpers.defaultKeySerializer=function(a){return a.toString()},R.helpers.defaultError=function(a){throw a}),Z=R.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},$=(R.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},R.helpers.not=function(a){return!a},R.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==rb.call(a)}),a}()),_="Argument out of range",ab="Object has been disposed",bb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";M.Set&&"function"==typeof(new M.Set)["@@iterator"]&&(bb="@@iterator");var cb=R.doneEnumerator={done:!0,value:a},db=R.helpers.isIterable=function(b){return b[bb]!==a},eb=R.helpers.isArrayLike=function(b){return b&&b.length!==a};R.helpers.iterator=bb;var fb,gb=R.helpers.deprecate=function(){},hb="[object Arguments]",ib="[object Array]",jb="[object Boolean]",kb="[object Date]",lb="[object Error]",mb="[object Function]",nb="[object Number]",ob="[object Object]",pb="[object RegExp]",qb="[object String]",rb=Object.prototype.toString,sb=Object.prototype.hasOwnProperty,tb=rb.call(arguments)==hb,ub=Error.prototype,vb=Object.prototype,wb=vb.propertyIsEnumerable;try{fb=!(rb.call(document)==ob&&!({toString:0}+""))}catch(xb){fb=!0}var yb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],zb={};zb[ib]=zb[kb]=zb[nb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},zb[jb]=zb[qb]={constructor:!0,toString:!0,valueOf:!0},zb[lb]=zb[mb]=zb[pb]={constructor:!0,toString:!0},zb[ob]={constructor:!0};var Ab={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Ab.enumErrorProps=wb.call(ub,"message")||wb.call(ub,"name"),Ab.enumPrototypes=wb.call(a,"prototype"),Ab.nonEnumArgs=0!=c,Ab.nonEnumShadows=!/valueOf/.test(b)}(1),tb||(h=function(a){return a&&"object"==typeof a?sb.call(a,"callee"):!1});{var Bb=R.internals.isEqual=function(a,b){return i(a,b,[],[])},Cb=Array.prototype.slice,Db=({}.hasOwnProperty,this.inherits=R.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Eb=R.internals.addProperties=function(a){for(var b=Cb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};R.internals.addRef=function(a,b){return new Kc(function(c){return new Jb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Cb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Cb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Cb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Fb=Object("a"),Gb="a"!=Fb[0]||!(0 in Fb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Gb&&{}.toString.call(this)==qb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=mb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Gb&&{}.toString.call(this)==qb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=mb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==ib}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Hb=R.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ib=Hb.prototype;Ib.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ib.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Ib.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Ib.peek=function(){return this.items[0].value},Ib.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ib.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ib.enqueue=function(a){var b=this.length++;this.items[b]=new l(Hb.count++,a),this.percolate(b)},Ib.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Hb.count=0;var Jb=R.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Kb=Jb.prototype;Kb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Kb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Kb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Kb.toArray=function(){return this.disposables.slice(0)};var Lb=R.Disposable=function(a){this.isDisposed=!1,this.action=a||S};Lb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Mb=Lb.create=function(a){return new Lb(a)},Nb=Lb.empty={dispose:S},Ob=R.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Pb=R.SerialDisposable=Ob,Qb=(R.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Nb:new a(this)},b}(),R.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||X,this.disposable=new Ob});Qb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Qb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Qb.prototype.isCancelled=function(){return this.disposable.isDisposed},Qb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Rb=R.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Nb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=V,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Sb=Rb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Jb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Nb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Jb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Nb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Rb.prototype),function(){Rb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Rb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof M.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=M.setInterval(function(){d=c(d)},b);return Mb(function(){M.clearInterval(e)})}}(Rb.prototype);var Tb,Ub=Rb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Sb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Rb(V,a,b,c)}(),Vb=Rb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Rb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Rb.normalize(c),g=new Qb(this,b,d,f);if(e)e.enqueue(g);else{e=new Hb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Rb(V,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Wb=(R.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Ob;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),S),Xb=function(){var a,b=S;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!M.setTimeout)throw new Error("No concurrency detected!");a=M.setTimeout,b=M.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Yb=Xb.setTimeout,Zb=Xb.clearTimeout;!function(){function a(){if(!M.postMessage||M.importScripts)return!1;var a=!1,b=M.onmessage;return M.onmessage=function(){a=!0},M.postMessage("","*"),M.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(rb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=Q&&P&&Q.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=Q&&P&&Q.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Tb=d,Wb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Tb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;M.addEventListener?M.addEventListener("message",b,!1):M.attachEvent("onmessage",b,!1),Tb=function(a){var b=h++;g[b]=a,M.postMessage(f+b,"*")}}else if(M.MessageChannel){var i=new M.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Tb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in M&&"onreadystatechange"in M.document.createElement("script")?Tb=function(a){var b=M.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},M.document.documentElement.appendChild(b)}:(Tb=function(a){return Yb(a,0)},Wb=Zb)}();var $b=Rb.timeout=function(){function a(a,b){var c=this,d=new Ob,e=Tb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Jb(d,Mb(function(){Wb(e)}))}function b(a,b,c){var d=this,e=Rb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Ob,g=Yb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Jb(f,Mb(function(){Zb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Rb(V,a,b,c)}(),_b=R.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return T(a)||(a=Ub),new Kc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ac=_b.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new _b("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),bc=_b.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new _b("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),cc=_b.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new _b("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),dc=R.internals.Enumerator=function(a){this._next=a};dc.prototype.next=function(){return this._next()},dc.prototype[bb]=function(){return this};var ec=R.internals.Enumerable=function(a){this._iterator=a};ec.prototype[bb]=function(){return this._iterator()},ec.prototype.concat=function(){var a=this;return new Kc(function(b){var c;try{c=a[bb]()}catch(d){return void b.onError()}var e,f=new Pb,g=Ub.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Z(h)&&(h=Dc(h));var i=new Ob;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Jb(f,g,Mb(function(){e=!0}))})},ec.prototype.catchError=function(){var a=this;return new Kc(function(b){var c;try{c=a[bb]()}catch(d){return void b.onError()}var e,f,g=new Pb,h=Ub.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Z(i)&&(i=Dc(i));var j=new Ob;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Jb(g,h,Mb(function(){e=!0}))})};var fc=ec.repeat=function(a,b){return null==b&&(b=-1),new ec(function(){var c=b;return new dc(function(){return 0===c?cb:(c>0&&c--,{done:!1,value:a})})})},gc=ec.of=function(a,b,c){return b||(b=U),new ec(function(){var d=-1;return new dc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:cb})})},hc=R.Observer=function(){};hc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},hc.prototype.asObserver=function(){return new lc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var ic=hc.create=function(a,b,c){return a||(a=S),b||(b=Y),c||(c=S),new lc(a,b,c)};hc.fromNotifier=function(a,b){return new lc(function(c){return a.call(b,ac(c))},function(c){return a.call(b,bc(c))},function(){return a.call(b,cc())})};var jc,kc=R.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Db(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(hc),lc=R.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Db(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(kc),mc=R.Observable=function(){function a(a){this._subscribe=a}return jc=a.prototype,jc.subscribe=jc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ic(a,b,c))},jc.subscribeOnNext=function(a,b){return this._subscribe(ic(2===arguments.length?function(c){a.call(b,c)}:a))},jc.subscribeOnError=function(a,b){return this._subscribe(ic(null,2===arguments.length?function(c){a.call(b,c)}:a))},jc.subscribeOnCompleted=function(a,b){return this._subscribe(ic(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),nc=R.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Pb}return Db(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(kc);jc.toArray=function(){var a=this;return new Kc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},mc.create=mc.createWithDisposable=function(a){return new Kc(a)};var oc=mc.defer=function(a){return new Kc(function(b){var c;try{c=a()}catch(d){return uc(d).subscribe(b)}return Z(c)&&(c=Dc(c)),c.subscribe(b)})},pc=mc.empty=function(a){return T(a)||(a=Ub),new Kc(function(b){return a.schedule(function(){b.onCompleted()})})},qc=Math.pow(2,53)-1;m.prototype[bb]=function(){return new n(this._s)},n.prototype[bb]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return cb},o.prototype[bb]=function(){return new p(this._a)},p.prototype[bb]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return cb};{var rc=mc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!$(b))throw new Error("mapFn when provided must be a function");T(d)||(d=Vb);var e=Object(a),f=r(e);return new Kc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&$(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},sc=mc.fromArray=function(a,b){return gb("fromArray","from"),T(b)||(b=Vb),new Kc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};mc.never=function(){return new Kc(function(){return Nb})}}mc.of=function(){return v(null,arguments)},mc.ofWithScheduler=function(a){return v(a,Cb.call(arguments,1))},mc.range=function(a,b,c){return T(c)||(c=Vb),new Kc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},mc.repeat=function(a,b,c){return T(c)||(c=Vb),tc(a,c).repeat(null==b?-1:b)};var tc=mc["return"]=mc.just=function(a,b){return T(b)||(b=Ub),new Kc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};mc.returnValue=function(){return gb("returnValue","return or just"),tc.apply(null,arguments)};var uc=mc["throw"]=mc.throwException=mc.throwError=function(a,b){return T(b)||(b=Ub),new Kc(function(c){return b.schedule(function(){c.onError(a)})})};jc["catch"]=jc.catchError=function(a){return"function"==typeof a?w(this,a):vc([this,a])},jc.catchException=function(a){return gb("catchException","catch or catchError"),this.catchError(a)};var vc=mc.catchError=mc["catch"]=function(){return gc(j(arguments,0)).catchError()};mc.catchException=function(){return gb("catchException","catch or catchError"),vc.apply(null,arguments)},jc.combineLatest=function(){var a=Cb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),wc.apply(this,a)};var wc=mc.combineLatest=function(){var a=Cb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Kc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(U))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(U)&&c.onCompleted()}function e(a){j[a]=!0,j.every(U)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Ob;Z(f)&&(f=Dc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Jb(m)})};jc.concat=function(){var a=Cb.call(arguments,0);return a.unshift(this),xc.apply(this,a)};var xc=mc.concat=function(){return gc(j(arguments,0)).concat()};jc.concatAll=function(){return this.merge(1)},jc.concatObservable=function(){return gb("concatObservable","concatAll"),this.merge(1)},jc.merge=function(a){if("number"!=typeof a)return yc(this,a);var b=this;return new Kc(function(c){function d(a){var b=new Ob;f.add(b),Z(a)&&(a=Dc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Jb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var yc=mc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Cb.call(arguments,1)):(a=Ub,b=Cb.call(arguments,0)):(a=Ub,b=Cb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};jc.mergeAll=function(){var a=this;return new Kc(function(b){var c=new Jb,d=!1,e=new Ob;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Ob;c.add(e),Z(a)&&(a=Dc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},jc.mergeObservable=function(){return gb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},jc.skipUntil=function(a){var b=this;return new Kc(function(c){var d=!1,e=new Jb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Z(a)&&(a=Dc(a));var f=new Ob;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()
})),e})},jc["switch"]=jc.switchLatest=function(){var a=this;return new Kc(function(b){var c=!1,d=new Pb,e=!1,f=0,g=a.subscribe(function(a){var g=new Ob,h=++f;c=!0,d.setDisposable(g),Z(a)&&(a=Dc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Jb(g,d)})},jc.takeUntil=function(a){var b=this;return new Kc(function(c){return Z(a)&&(a=Dc(a)),new Jb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),S))})},jc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=Cb.call(arguments),c=b.pop();return b.unshift(a),new Kc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(U)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Ob;Z(c)&&(c=Dc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Jb(j)})},mc.zip=function(){var a=Cb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},mc.zipArray=function(){var a=j(arguments,0);return new Kc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(U))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(U)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Ob,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Jb(h);return j.add(Mb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},jc.asObservable=function(){return new Kc(this.subscribe.bind(this))},jc.dematerialize=function(){var a=this;return new Kc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},jc.distinctUntilChanged=function(a,b){var c=this;return a||(a=U),b||(b=W),new Kc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},jc["do"]=jc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Kc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},jc.doAction=function(){return gb("doAction","do or tap"),this.tap.apply(this,arguments)},jc.doOnNext=jc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},jc.doOnError=jc.tapOnError=function(a,b){return this.tap(S,2===arguments.length?function(c){a.call(b,c)}:a)},jc.doOnCompleted=jc.tapOnCompleted=function(a,b){return this.tap(S,null,2===arguments.length?function(){a.call(b)}:a)},jc["finally"]=jc.ensure=function(a){var b=this;return new Kc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Mb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},jc.finallyAction=function(a){return gb("finallyAction","finally or ensure"),this.ensure(a)},jc.ignoreElements=function(){var a=this;return new Kc(function(b){return a.subscribe(S,b.onError.bind(b),b.onCompleted.bind(b))})},jc.materialize=function(){var a=this;return new Kc(function(b){return a.subscribe(function(a){b.onNext(ac(a))},function(a){b.onNext(bc(a)),b.onCompleted()},function(){b.onNext(cc()),b.onCompleted()})})},jc.repeat=function(a){return fc(this,a).concat()},jc.retry=function(a){return fc(this,a).catchError()},jc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Kc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},jc.skipLast=function(a){var b=this;return new Kc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},jc.startWith=function(){var a,b,c=0;return arguments.length&&T(arguments[0])?(b=arguments[0],c=1):b=Ub,a=Cb.call(arguments,c),gc([sc(a,b),this]).concat()},jc.takeLast=function(a){var b=this;return new Kc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},jc.selectConcat=jc.concatMap=function(a,b,c){return $(a)&&$(b)?this.concatMap(function(c,d){var e=a(c,d);return Z(e)&&(e=Dc(e)),(eb(e)||db(e))&&(e=rc(e)),e.map(function(a,e){return b(c,a,d,e)})}):$(a)?y(this,a,c):y(this,function(){return a})},jc.select=jc.map=function(a,b){var c=$(a)?a:function(){return a},d=this;return new Kc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},jc.pluck=function(a){return this.map(function(b){return b[a]})},jc.selectMany=jc.flatMap=function(a,b,c){return $(a)&&$(b)?this.flatMap(function(c,d){var e=a(c,d);return Z(e)&&(e=Dc(e)),(eb(e)||db(e))&&(e=rc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):$(a)?z(this,a,c):z(this,function(){return a})},jc.selectSwitch=jc.flatMapLatest=jc.switchMap=function(a,b){return this.select(a,b).switchLatest()},jc.skip=function(a){if(0>a)throw new Error(_);var b=this;return new Kc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},jc.skipWhile=function(a,b){var c=this;return new Kc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},jc.take=function(a,b){if(0>a)throw new RangeError(_);if(0===a)return pc(b);var c=this;return new Kc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},jc.takeWhile=function(a,b){var c=this;return new Kc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},jc.where=jc.filter=function(a,b){var c=this;return new Kc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},mc.fromCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Kc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},mc.fromNodeCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Kc(function(e){function f(a){if(a)return void e.onError(a);var b=Cb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},R.config.useNativeEvents=!1;var zc=M.angular&&angular.element?angular.element:M.jQuery?M.jQuery:M.Zepto?M.Zepto:null,Ac=!!M.Ember&&"function"==typeof M.Ember.addListener,Bc=!!M.Backbone&&!!M.Backbone.Marionette;mc.fromEvent=function(a,b,c){if(a.addListener)return Cc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!R.config.useNativeEvents){if(Bc)return Cc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Ac)return Cc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(zc){var d=zc(a);return Cc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Kc(function(d){return C(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Cc=mc.fromEventPattern=function(a,b,c){return new Kc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Mb(function(){b&&b(e,f)})}).publish().refCount()},Dc=mc.fromPromise=function(a){return oc(function(){var b=new R.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};jc.toPromise=function(a){if(a||(a=R.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},mc.startAsync=function(a){var b;try{b=a()}catch(c){return uc(c)}return Dc(b)},jc.multicast=function(a,b){var c=this;return"function"==typeof a?new Kc(function(d){var e=c.multicast(a());return new Jb(b(e).subscribe(d),e.connect())}):new Ec(c,a)},jc.publish=function(a){return a&&$(a)?this.multicast(function(){return new Nc},a):this.multicast(new Nc)},jc.share=function(){return this.publish().refCount()},jc.publishLast=function(a){return a&&$(a)?this.multicast(function(){return new Oc},a):this.multicast(new Oc)},jc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Qc(b)},a):this.multicast(new Qc(a))},jc.shareValue=function(a){return this.publishValue(a).refCount()},jc.replay=function(a,b,c,d){return a&&$(a)?this.multicast(function(){return new Rc(b,c,d)},a):this.multicast(new Rc(b,c,d))},jc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Ec=R.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Jb(f.subscribe(c),Mb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Db(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Kc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(mc),Fc=mc.interval=function(a,b){return G(a,a,T(b)?b:$b)};mc.timer=function(b,c,d){var e;return T(d)||(d=$b),c!==a&&"number"==typeof c?e=c:T(c)&&(d=c),b instanceof Date&&e===a?D(b.getTime(),d):b instanceof Date&&e!==a?(e=c,E(b.getTime(),e,d)):e===a?F(b,d):G(b,e,d)}}jc.delay=function(a,b){return T(b)||(b=$b),a instanceof Date?I(this,a.getTime(),b):H(this,a,b)},jc.debounce=jc.throttleWithTimeout=function(a,b){T(b)||(b=$b);var c=this;return new Kc(function(d){var e,f=new Pb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Ob;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Jb(i,f)})},jc.throttle=function(a,b){return gb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},jc.timestamp=function(a){return T(a)||(a=$b),this.map(function(b){return{value:b,timestamp:a.now()}})},jc.sample=jc.throttleLatest=function(a,b){return T(b)||(b=$b),"number"==typeof a?J(this,Fc(a,b)):J(this,a)},jc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=uc(new Error(b||"Timeout"))),T(c)||(c=$b);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Kc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Z(b)&&(b=Dc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Ob,j=new Pb,k=!1,l=new Pb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Jb(j,l)})},jc.throttleFirst=function(a,b){T(b)||(b=$b);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Kc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Gc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Nb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Nb)});return new Jb(c,d,e)}function c(c,d){this.source=c,this.controller=new Nc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Db(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(mc);jc.pausable=function(a){return new Gc(this,a)};var Hc=function(b){function c(b){var c,d=[],e=K(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Nc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Db(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(mc);jc.pausableBuffered=function(a){return new Hc(this,a)},jc.controlled=function(a){return null==a&&(a=!0),new Ic(this,a)};var Ic=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Jc(d),this.source=c.multicast(this.subject).refCount()}return Db(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(mc),Jc=R.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Nc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Nb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Nb}return Db(d,a),Eb(d.prototype,hc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Nb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Nb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Nb:(this.requestedCount=a,this.requestedDisposable=Mb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Nb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(mc);jc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Kc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Kc=R.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Mb(a):Nb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Lc(a);return Vb.scheduleRequired()?Vb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Db(c,a),c}(mc),Lc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Ob}Db(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(kc),Mc=function(a,b){this.subject=a,this.observer=b};Mc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Nc=R.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Nb):(a.onCompleted(),Nb):(this.observers.push(a),new Mc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Pc(a,b)},d}(mc),Oc=R.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Mc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Nb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(mc),Pc=R.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Db(b,a),Eb(b.prototype,hc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(mc),Qc=R.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Mc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Nb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(mc),Rc=R.ReplaySubject=function(a){function c(a,b){return Mb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new nc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Vb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Db(e,a),Eb(e.prototype,hc,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(mc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(M.Rx=R,define(function(){return R})):N&&O?P?(O.exports=R).Rx=R:N.Rx=R:M.Rx=R}).call(this);
//# sourceMappingURL=rx.lite.compat.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(_)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;zb.nonEnumArgs&&a.length&&h(a)&&(a=Bb.call(a));var d=zb.enumPrototypes&&"function"==typeof a,e=zb.enumErrorProps&&(a===tb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(zb.nonEnumShadows&&a!==ub){var g=a.constructor,i=-1,j=xb.length;if(a===(g&&g.prototype))var k=a===stringProto?pb:a===tb?kb:qb.call(a),l=yb[k];for(;++i<j;)f=xb[i],l&&l[f]||!rb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?qb.call(a)==gb:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=qb.call(a),l=qb.call(b);if(k==gb&&(k=nb),l==gb&&(l=nb),k!=l)return!1;switch(k){case ib:case jb:return+a==+b;case mb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ob:case pb:return a==String(b)}var m=k==hb;if(!m){if(k!=nb||!zb.nodeClass&&(g(a)||g(b)))return!1;var n=!zb.argsObject&&h(a)?Object:a.constructor,o=!zb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||rb.call(a,"constructor")&&rb.call(b,"constructor")||Z(n)&&n instanceof n&&Z(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return rb.call(f,e)?(q++,r=rb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return rb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Bb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&L.isFinite(a)}function r(b){var c,d=b[ab];if(!d&&"string"==typeof b)return c=new m(b),c[ab]();if(!d&&b.length!==a)return c=new o(b),c[ab]();if(!d)throw new TypeError("Object is not iterable");return b[ab]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>nc?nc:b):b}function v(a,b){return S(a)||(a=Sb),new Hc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new Hc(function(c){var d=new Lb,e=new Mb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Y(f)&&(f=Ac(f)),d=new Lb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new Hc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ac(f)),(db(f)||cb(f))&&(f=oc(f)),f}).concatAll()}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ac(f)),(db(f)||cb(f))&&(f=oc(f)),f}).mergeAll()}function A(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Jb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function B(a,b,c){var d=new Gb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(B(a.item(e),b,c));else a&&d.add(A(a,b,c));return d}function C(a,b){return new Hc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function D(a,b,c){return new Hc(function(d){var e=0,f=a,g=Pb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function E(a,b){return new Hc(function(c){return b.scheduleWithRelative(Pb(a),function(){c.onNext(0),c.onCompleted()})})}function F(a,b,c){return a===b?new Hc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):lc(function(){return D(c.now()+a,b,c)})}function G(a,b,c){return new Hc(function(d){var e,f=!1,g=new Mb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Lb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Gb(e,g)})}function H(a,b,c){return lc(function(){return G(a,b-c.now(),c)})}function I(a,b){return new Hc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Gb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function J(a,b,c){return new Hc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(T))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Gb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var K={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},L=K[typeof window]&&window||this,M=K[typeof exports]&&exports&&!exports.nodeType&&exports,N=K[typeof module]&&module&&!module.nodeType&&module,O=N&&N.exports===M&&M,P=K[typeof global]&&global;!P||P.global!==P&&P.window!==P||(L=P);var Q={internals:{},config:{Promise:L.Promise},helpers:{}},R=Q.helpers.noop=function(){},S=(Q.helpers.notDefined=function(a){return"undefined"==typeof a},Q.helpers.isScheduler=function(a){return a instanceof Q.Scheduler}),T=Q.helpers.identity=function(a){return a},U=(Q.helpers.pluck=function(a){return function(b){return b[a]}},Q.helpers.just=function(a){return function(){return a}},Q.helpers.defaultNow=Date.now),V=Q.helpers.defaultComparer=function(a,b){return Ab(a,b)},W=Q.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},X=(Q.helpers.defaultKeySerializer=function(a){return a.toString()},Q.helpers.defaultError=function(a){throw a}),Y=Q.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Z=(Q.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Q.helpers.not=function(a){return!a},Q.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==qb.call(a)}),a}()),$="Argument out of range",_="Object has been disposed",ab="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";L.Set&&"function"==typeof(new L.Set)["@@iterator"]&&(ab="@@iterator");var bb=Q.doneEnumerator={done:!0,value:a},cb=Q.helpers.isIterable=function(b){return b[ab]!==a},db=Q.helpers.isArrayLike=function(b){return b&&b.length!==a};Q.helpers.iterator=ab;var eb,fb=Q.helpers.deprecate=function(a,b){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(a+" is deprecated, use "+b+" instead.",new Error("").stack)},gb="[object Arguments]",hb="[object Array]",ib="[object Boolean]",jb="[object Date]",kb="[object Error]",lb="[object Function]",mb="[object Number]",nb="[object Object]",ob="[object RegExp]",pb="[object String]",qb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,sb=qb.call(arguments)==gb,tb=Error.prototype,ub=Object.prototype,vb=ub.propertyIsEnumerable;try{eb=!(qb.call(document)==nb&&!({toString:0}+""))}catch(wb){eb=!0}var xb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yb={};yb[hb]=yb[jb]=yb[mb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},yb[ib]=yb[pb]={constructor:!0,toString:!0,valueOf:!0},yb[kb]=yb[lb]=yb[ob]={constructor:!0,toString:!0},yb[nb]={constructor:!0};var zb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);zb.enumErrorProps=vb.call(tb,"message")||vb.call(tb,"name"),zb.enumPrototypes=vb.call(a,"prototype"),zb.nonEnumArgs=0!=c,zb.nonEnumShadows=!/valueOf/.test(b)}(1),sb||(h=function(a){return a&&"object"==typeof a?rb.call(a,"callee"):!1});{var Ab=Q.internals.isEqual=function(a,b){return i(a,b,[],[])},Bb=Array.prototype.slice,Cb=({}.hasOwnProperty,this.inherits=Q.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Db=Q.internals.addProperties=function(a){for(var b=Bb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};Q.internals.addRef=function(a,b){return new Hc(function(c){return new Gb(b.getDisposable(),a.subscribe(c))})}}l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Eb=Q.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Fb=Eb.prototype;Fb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Fb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Fb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Fb.peek=function(){return this.items[0].value},Fb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Fb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Fb.enqueue=function(a){var b=this.length++;this.items[b]=new l(Eb.count++,a),this.percolate(b)},Fb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Eb.count=0;var Gb=Q.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Hb=Gb.prototype;Hb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Hb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Hb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Hb.toArray=function(){return this.disposables.slice(0)};var Ib=Q.Disposable=function(a){this.isDisposed=!1,this.action=a||R};Ib.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Jb=Ib.create=function(a){return new Ib(a)},Kb=Ib.empty={dispose:R},Lb=Q.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Mb=Q.SerialDisposable=Lb,Nb=(Q.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Kb:new a(this)},b}(),Q.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||W,this.disposable=new Lb});Nb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Nb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Nb.prototype.isCancelled=function(){return this.disposable.isDisposed},Nb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Ob=Q.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Kb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=U,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Pb=Ob.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Gb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Kb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Gb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Kb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Ob.prototype),function(){Ob.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Ob.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof L.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=L.setInterval(function(){d=c(d)},b);return Jb(function(){L.clearInterval(e)})}}(Ob.prototype);var Qb,Rb=Ob.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Pb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ob(U,a,b,c)}(),Sb=Ob.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Ob.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Ob.normalize(c),g=new Nb(this,b,d,f);if(e)e.enqueue(g);else{e=new Eb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Ob(U,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Tb=(Q.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Lb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),R),Ub=function(){var a,b=R;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!L.setTimeout)throw new Error("No concurrency detected!");a=L.setTimeout,b=L.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Vb=Ub.setTimeout,Wb=Ub.clearTimeout;!function(){function a(){if(!L.postMessage||L.importScripts)return!1;var a=!1,b=L.onmessage;return L.onmessage=function(){a=!0},L.postMessage("","*"),L.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(qb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=P&&O&&P.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=P&&O&&P.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Qb=d,Tb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Qb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;L.addEventListener?L.addEventListener("message",b,!1):L.attachEvent("onmessage",b,!1),Qb=function(a){var b=h++;g[b]=a,L.postMessage(f+b,"*")}}else if(L.MessageChannel){var i=new L.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Qb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in L&&"onreadystatechange"in L.document.createElement("script")?Qb=function(a){var b=L.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},L.document.documentElement.appendChild(b)}:(Qb=function(a){return Vb(a,0)},Tb=Wb)}();var Xb=Ob.timeout=function(){function a(a,b){var c=this,d=new Lb,e=Qb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Gb(d,Jb(function(){Tb(e)}))}function b(a,b,c){var d=this,e=Ob.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Lb,g=Vb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Gb(f,Jb(function(){Wb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ob(U,a,b,c)}(),Yb=Q.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return S(a)||(a=Rb),new Hc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Zb=Yb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Yb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),$b=Yb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Yb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),_b=Yb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Yb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),ac=Q.internals.Enumerator=function(a){this._next=a};ac.prototype.next=function(){return this._next()},ac.prototype[ab]=function(){return this};var bc=Q.internals.Enumerable=function(a){this._iterator=a};bc.prototype[ab]=function(){return this._iterator()},bc.prototype.concat=function(){var a=this;return new Hc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError()}var e,f=new Mb,g=Rb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Y(h)&&(h=Ac(h));var i=new Lb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Gb(f,g,Jb(function(){e=!0}))})},bc.prototype.catchError=function(){var a=this;return new Hc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError()}var e,f,g=new Mb,h=Rb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Y(i)&&(i=Ac(i));var j=new Lb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Gb(g,h,Jb(function(){e=!0}))})};var cc=bc.repeat=function(a,b){return null==b&&(b=-1),new bc(function(){var c=b;return new ac(function(){return 0===c?bb:(c>0&&c--,{done:!1,value:a})})})},dc=bc.of=function(a,b,c){return b||(b=T),new bc(function(){var d=-1;return new ac(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:bb})})},ec=Q.Observer=function(){};ec.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ec.prototype.asObserver=function(){return new ic(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var fc=ec.create=function(a,b,c){return a||(a=R),b||(b=X),c||(c=R),new ic(a,b,c)};ec.fromNotifier=function(a,b){return new ic(function(c){return a.call(b,Zb(c))},function(c){return a.call(b,$b(c))},function(){return a.call(b,_b())})};var gc,hc=Q.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Cb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ec),ic=Q.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Cb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(hc),jc=Q.Observable=function(){function a(a){this._subscribe=a}return gc=a.prototype,gc.subscribe=gc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:fc(a,b,c))},gc.subscribeOnNext=function(a,b){return this._subscribe(fc(2===arguments.length?function(c){a.call(b,c)}:a))},gc.subscribeOnError=function(a,b){return this._subscribe(fc(null,2===arguments.length?function(c){a.call(b,c)}:a))},gc.subscribeOnCompleted=function(a,b){return this._subscribe(fc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),kc=Q.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Mb}return Cb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(hc);gc.toArray=function(){var a=this;return new Hc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},jc.create=jc.createWithDisposable=function(a){return new Hc(a)};var lc=jc.defer=function(a){return new Hc(function(b){var c;try{c=a()}catch(d){return rc(d).subscribe(b)}return Y(c)&&(c=Ac(c)),c.subscribe(b)})},mc=jc.empty=function(a){return S(a)||(a=Rb),new Hc(function(b){return a.schedule(function(){b.onCompleted()})})},nc=Math.pow(2,53)-1;m.prototype[ab]=function(){return new n(this._s)},n.prototype[ab]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return bb},o.prototype[ab]=function(){return new p(this._a)},p.prototype[ab]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return bb};{var oc=jc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Z(b))throw new Error("mapFn when provided must be a function");S(d)||(d=Sb);var e=Object(a),f=r(e);return new Hc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Z(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},pc=jc.fromArray=function(a,b){return S(b)||(b=Sb),new Hc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};jc.never=function(){return new Hc(function(){return Kb})}}jc.of=function(){return v(null,arguments)},jc.ofWithScheduler=function(a){return v(a,Bb.call(arguments,1))},jc.range=function(a,b,c){return S(c)||(c=Sb),new Hc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},jc.repeat=function(a,b,c){return S(c)||(c=Sb),qc(a,c).repeat(null==b?-1:b)};var qc=jc["return"]=jc.just=function(a,b){return S(b)||(b=Rb),new Hc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};jc.returnValue=function(){return fb("returnValue","return or just"),qc.apply(null,arguments)};var rc=jc["throw"]=jc.throwException=jc.throwError=function(a,b){return S(b)||(b=Rb),new Hc(function(c){return b.schedule(function(){c.onError(a)})})};gc["catch"]=gc.catchError=function(a){return"function"==typeof a?w(this,a):sc([this,a])},gc.catchException=function(a){return fb("catchException","catch or catchError"),this.catchError(a)};var sc=jc.catchError=jc["catch"]=function(){return dc(j(arguments,0)).catchError()};jc.catchException=function(){return fb("catchException","catch or catchError"),sc.apply(null,arguments)},gc.combineLatest=function(){var a=Bb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),tc.apply(this,a)};var tc=jc.combineLatest=function(){var a=Bb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Hc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(T))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(T)&&c.onCompleted()}function e(a){j[a]=!0,j.every(T)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Lb;Y(f)&&(f=Ac(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Gb(m)})};gc.concat=function(){var a=Bb.call(arguments,0);return a.unshift(this),uc.apply(this,a)};var uc=jc.concat=function(){return dc(j(arguments,0)).concat()};gc.concatAll=function(){return this.merge(1)},gc.concatObservable=function(){return fb("concatObservable","concatAll"),this.merge(1)},gc.merge=function(a){if("number"!=typeof a)return vc(this,a);var b=this;return new Hc(function(c){function d(a){var b=new Lb;f.add(b),Y(a)&&(a=Ac(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Gb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var vc=jc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Bb.call(arguments,1)):(a=Rb,b=Bb.call(arguments,0)):(a=Rb,b=Bb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};gc.mergeAll=function(){var a=this;return new Hc(function(b){var c=new Gb,d=!1,e=new Lb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Lb;c.add(e),Y(a)&&(a=Ac(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},gc.mergeObservable=function(){return fb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},gc.skipUntil=function(a){var b=this;return new Hc(function(c){var d=!1,e=new Gb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Y(a)&&(a=Ac(a));var f=new Lb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},gc["switch"]=gc.switchLatest=function(){var a=this;return new Hc(function(b){var c=!1,d=new Mb,e=!1,f=0,g=a.subscribe(function(a){var g=new Lb,h=++f;c=!0,d.setDisposable(g),Y(a)&&(a=Ac(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Gb(g,d)})},gc.takeUntil=function(a){var b=this;return new Hc(function(c){return Y(a)&&(a=Ac(a)),new Gb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),R))})},gc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=Bb.call(arguments),c=b.pop();return b.unshift(a),new Hc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(T)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Lb;Y(c)&&(c=Ac(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Gb(j)})},jc.zip=function(){var a=Bb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},jc.zipArray=function(){var a=j(arguments,0);return new Hc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(T))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(T)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Lb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Gb(h);return j.add(Jb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},gc.asObservable=function(){return new Hc(this.subscribe.bind(this))},gc.dematerialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},gc.distinctUntilChanged=function(a,b){var c=this;return a||(a=T),b||(b=V),new Hc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))
},d.onError.bind(d),d.onCompleted.bind(d))})},gc["do"]=gc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Hc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},gc.doAction=function(){return fb("doAction","do or tap"),this.tap.apply(this,arguments)},gc.doOnNext=gc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},gc.doOnError=gc.tapOnError=function(a,b){return this.tap(R,2===arguments.length?function(c){a.call(b,c)}:a)},gc.doOnCompleted=gc.tapOnCompleted=function(a,b){return this.tap(R,null,2===arguments.length?function(){a.call(b)}:a)},gc["finally"]=gc.ensure=function(a){var b=this;return new Hc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Jb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},gc.finallyAction=function(a){return fb("finallyAction","finally or ensure"),this.ensure(a)},gc.ignoreElements=function(){var a=this;return new Hc(function(b){return a.subscribe(R,b.onError.bind(b),b.onCompleted.bind(b))})},gc.materialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){b.onNext(Zb(a))},function(a){b.onNext($b(a)),b.onCompleted()},function(){b.onNext(_b()),b.onCompleted()})})},gc.repeat=function(a){return cc(this,a).concat()},gc.retry=function(a){return cc(this,a).catchError()},gc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Hc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},gc.skipLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},gc.startWith=function(){var a,b,c=0;return arguments.length&&S(arguments[0])?(b=arguments[0],c=1):b=Rb,a=Bb.call(arguments,c),dc([pc(a,b),this]).concat()},gc.takeLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},gc.selectConcat=gc.concatMap=function(a,b,c){return Z(a)&&Z(b)?this.concatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ac(e)),(db(e)||cb(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Z(a)?y(this,a,c):y(this,function(){return a})},gc.select=gc.map=function(a,b){var c=Z(a)?a:function(){return a},d=this;return new Hc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},gc.pluck=function(a){return this.map(function(b){return b[a]})},gc.selectMany=gc.flatMap=function(a,b,c){return Z(a)&&Z(b)?this.flatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ac(e)),(db(e)||cb(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Z(a)?z(this,a,c):z(this,function(){return a})},gc.selectSwitch=gc.flatMapLatest=gc.switchMap=function(a,b){return this.select(a,b).switchLatest()},gc.skip=function(a){if(0>a)throw new Error($);var b=this;return new Hc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},gc.skipWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},gc.take=function(a,b){if(0>a)throw new RangeError($);if(0===a)return mc(b);var c=this;return new Hc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},gc.takeWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},gc.where=gc.filter=function(a,b){var c=this;return new Hc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},jc.fromCallback=function(a,b,c){return function(){var d=Bb.call(arguments,0);return new Hc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},jc.fromNodeCallback=function(a,b,c){return function(){var d=Bb.call(arguments,0);return new Hc(function(e){function f(a){if(a)return void e.onError(a);var b=Bb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},Q.config.useNativeEvents=!1;var wc=L.angular&&angular.element?angular.element:L.jQuery?L.jQuery:L.Zepto?L.Zepto:null,xc=!!L.Ember&&"function"==typeof L.Ember.addListener,yc=!!L.Backbone&&!!L.Backbone.Marionette;jc.fromEvent=function(a,b,c){if(a.addListener)return zc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!Q.config.useNativeEvents){if(yc)return zc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(xc)return zc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(wc){var d=wc(a);return zc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Hc(function(d){return B(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var zc=jc.fromEventPattern=function(a,b,c){return new Hc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Jb(function(){b&&b(e,f)})}).publish().refCount()},Ac=jc.fromPromise=function(a){return lc(function(){var b=new Q.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};gc.toPromise=function(a){if(a||(a=Q.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},jc.startAsync=function(a){var b;try{b=a()}catch(c){return rc(c)}return Ac(b)},gc.multicast=function(a,b){var c=this;return"function"==typeof a?new Hc(function(d){var e=c.multicast(a());return new Gb(b(e).subscribe(d),e.connect())}):new Bc(c,a)},gc.publish=function(a){return a&&Z(a)?this.multicast(function(){return new Kc},a):this.multicast(new Kc)},gc.share=function(){return this.publish().refCount()},gc.publishLast=function(a){return a&&Z(a)?this.multicast(function(){return new Lc},a):this.multicast(new Lc)},gc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Nc(b)},a):this.multicast(new Nc(a))},gc.shareValue=function(a){return this.publishValue(a).refCount()},gc.replay=function(a,b,c,d){return a&&Z(a)?this.multicast(function(){return new Oc(b,c,d)},a):this.multicast(new Oc(b,c,d))},gc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Bc=Q.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Gb(f.subscribe(c),Jb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Cb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Hc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(jc),Cc=jc.interval=function(a,b){return F(a,a,S(b)?b:Xb)};jc.timer=function(b,c,d){var e;return S(d)||(d=Xb),c!==a&&"number"==typeof c?e=c:S(c)&&(d=c),b instanceof Date&&e===a?C(b.getTime(),d):b instanceof Date&&e!==a?(e=c,D(b.getTime(),e,d)):e===a?E(b,d):F(b,e,d)}}gc.delay=function(a,b){return S(b)||(b=Xb),a instanceof Date?H(this,a.getTime(),b):G(this,a,b)},gc.debounce=gc.throttleWithTimeout=function(a,b){S(b)||(b=Xb);var c=this;return new Hc(function(d){var e,f=new Mb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Lb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Gb(i,f)})},gc.throttle=function(a,b){return fb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},gc.timestamp=function(a){return S(a)||(a=Xb),this.map(function(b){return{value:b,timestamp:a.now()}})},gc.sample=gc.throttleLatest=function(a,b){return S(b)||(b=Xb),"number"==typeof a?I(this,Cc(a,b)):I(this,a)},gc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=rc(new Error(b||"Timeout"))),S(c)||(c=Xb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Hc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Y(b)&&(b=Ac(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Lb,j=new Mb,k=!1,l=new Mb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Gb(j,l)})},gc.throttleFirst=function(a,b){S(b)||(b=Xb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Hc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Dc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Kb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Kb)});return new Gb(c,d,e)}function c(c,d){this.source=c,this.controller=new Kc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Cb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(jc);gc.pausable=function(a){return new Dc(this,a)};var Ec=function(b){function c(b){var c,d=[],e=J(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Kc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Cb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(jc);gc.pausableBuffered=function(a){return new Ec(this,a)},gc.controlled=function(a){return null==a&&(a=!0),new Fc(this,a)};var Fc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Gc(d),this.source=c.multicast(this.subject).refCount()}return Cb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(jc),Gc=Q.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Kc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Kb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Kb}return Cb(d,a),Db(d.prototype,ec,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Kb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Kb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Kb:(this.requestedCount=a,this.requestedDisposable=Jb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Kb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(jc);gc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Hc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Hc=Q.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Jb(a):Kb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Ic(a);return Sb.scheduleRequired()?Sb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Cb(c,a),c}(jc),Ic=function(a){function b(b){a.call(this),this.observer=b,this.m=new Lb}Cb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(hc),Jc=function(a,b){this.subject=a,this.observer=b};Jc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Kc=Q.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Kb):(a.onCompleted(),Kb):(this.observers.push(a),new Jc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Mc(a,b)},d}(jc),Lc=Q.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Jc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Kb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(jc),Mc=Q.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Cb(b,a),Db(b.prototype,ec,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(jc),Nc=Q.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Jc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Kb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(jc),Oc=Q.ReplaySubject=function(a){function c(a,b){return Jb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new kc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Sb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Cb(e,a),Db(e.prototype,ec,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(jc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(L.Rx=Q,define(function(){return Q})):M&&N?O?(N.exports=Q).Rx=Q:M.Rx=Q:L.Rx=Q}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(_)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;zb.nonEnumArgs&&a.length&&h(a)&&(a=Bb.call(a));var d=zb.enumPrototypes&&"function"==typeof a,e=zb.enumErrorProps&&(a===tb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(zb.nonEnumShadows&&a!==ub){var g=a.constructor,i=-1,j=xb.length;if(a===(g&&g.prototype))var k=a===stringProto?pb:a===tb?kb:qb.call(a),l=yb[k];for(;++i<j;)f=xb[i],l&&l[f]||!rb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?qb.call(a)==gb:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=qb.call(a),l=qb.call(b);if(k==gb&&(k=nb),l==gb&&(l=nb),k!=l)return!1;switch(k){case ib:case jb:return+a==+b;case mb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ob:case pb:return a==String(b)}var m=k==hb;if(!m){if(k!=nb||!zb.nodeClass&&(g(a)||g(b)))return!1;var n=!zb.argsObject&&h(a)?Object:a.constructor,o=!zb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||rb.call(a,"constructor")&&rb.call(b,"constructor")||Z(n)&&n instanceof n&&Z(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return rb.call(f,e)?(q++,r=rb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return rb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Bb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&L.isFinite(a)}function r(b){var c,d=b[ab];if(!d&&"string"==typeof b)return c=new m(b),c[ab]();if(!d&&b.length!==a)return c=new o(b),c[ab]();if(!d)throw new TypeError("Object is not iterable");return b[ab]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>nc?nc:b):b}function v(a,b){return S(a)||(a=Sb),new Hc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new Hc(function(c){var d=new Lb,e=new Mb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Y(f)&&(f=Ac(f)),d=new Lb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new Hc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ac(f)),(db(f)||cb(f))&&(f=oc(f)),f}).concatAll()}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ac(f)),(db(f)||cb(f))&&(f=oc(f)),f}).mergeAll()}function A(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Jb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function B(a,b,c){var d=new Gb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(B(a.item(e),b,c));else a&&d.add(A(a,b,c));return d}function C(a,b){return new Hc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function D(a,b,c){return new Hc(function(d){var e=0,f=a,g=Pb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function E(a,b){return new Hc(function(c){return b.scheduleWithRelative(Pb(a),function(){c.onNext(0),c.onCompleted()})})}function F(a,b,c){return a===b?new Hc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):lc(function(){return D(c.now()+a,b,c)})}function G(a,b,c){return new Hc(function(d){var e,f=!1,g=new Mb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Lb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Gb(e,g)})}function H(a,b,c){return lc(function(){return G(a,b-c.now(),c)})}function I(a,b){return new Hc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Gb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function J(a,b,c){return new Hc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(T))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Gb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var K={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},L=K[typeof window]&&window||this,M=K[typeof exports]&&exports&&!exports.nodeType&&exports,N=K[typeof module]&&module&&!module.nodeType&&module,O=N&&N.exports===M&&M,P=K[typeof global]&&global;!P||P.global!==P&&P.window!==P||(L=P);var Q={internals:{},config:{Promise:L.Promise},helpers:{}},R=Q.helpers.noop=function(){},S=(Q.helpers.notDefined=function(a){return"undefined"==typeof a},Q.helpers.isScheduler=function(a){return a instanceof Q.Scheduler}),T=Q.helpers.identity=function(a){return a},U=(Q.helpers.pluck=function(a){return function(b){return b[a]}},Q.helpers.just=function(a){return function(){return a}},Q.helpers.defaultNow=Date.now),V=Q.helpers.defaultComparer=function(a,b){return Ab(a,b)},W=Q.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},X=(Q.helpers.defaultKeySerializer=function(a){return a.toString()},Q.helpers.defaultError=function(a){throw a}),Y=Q.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Z=(Q.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Q.helpers.not=function(a){return!a},Q.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==qb.call(a)}),a}()),$="Argument out of range",_="Object has been disposed",ab="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";L.Set&&"function"==typeof(new L.Set)["@@iterator"]&&(ab="@@iterator");var bb=Q.doneEnumerator={done:!0,value:a},cb=Q.helpers.isIterable=function(b){return b[ab]!==a},db=Q.helpers.isArrayLike=function(b){return b&&b.length!==a};Q.helpers.iterator=ab;var eb,fb=Q.helpers.deprecate=function(){},gb="[object Arguments]",hb="[object Array]",ib="[object Boolean]",jb="[object Date]",kb="[object Error]",lb="[object Function]",mb="[object Number]",nb="[object Object]",ob="[object RegExp]",pb="[object String]",qb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,sb=qb.call(arguments)==gb,tb=Error.prototype,ub=Object.prototype,vb=ub.propertyIsEnumerable;try{eb=!(qb.call(document)==nb&&!({toString:0}+""))}catch(wb){eb=!0}var xb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yb={};yb[hb]=yb[jb]=yb[mb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},yb[ib]=yb[pb]={constructor:!0,toString:!0,valueOf:!0},yb[kb]=yb[lb]=yb[ob]={constructor:!0,toString:!0},yb[nb]={constructor:!0};var zb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);zb.enumErrorProps=vb.call(tb,"message")||vb.call(tb,"name"),zb.enumPrototypes=vb.call(a,"prototype"),zb.nonEnumArgs=0!=c,zb.nonEnumShadows=!/valueOf/.test(b)}(1),sb||(h=function(a){return a&&"object"==typeof a?rb.call(a,"callee"):!1});{var Ab=Q.internals.isEqual=function(a,b){return i(a,b,[],[])},Bb=Array.prototype.slice,Cb=({}.hasOwnProperty,this.inherits=Q.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Db=Q.internals.addProperties=function(a){for(var b=Bb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};Q.internals.addRef=function(a,b){return new Hc(function(c){return new Gb(b.getDisposable(),a.subscribe(c))})}}l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Eb=Q.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Fb=Eb.prototype;Fb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Fb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Fb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Fb.peek=function(){return this.items[0].value},Fb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Fb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Fb.enqueue=function(a){var b=this.length++;this.items[b]=new l(Eb.count++,a),this.percolate(b)},Fb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Eb.count=0;var Gb=Q.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Hb=Gb.prototype;Hb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Hb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Hb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Hb.toArray=function(){return this.disposables.slice(0)};var Ib=Q.Disposable=function(a){this.isDisposed=!1,this.action=a||R};Ib.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Jb=Ib.create=function(a){return new Ib(a)},Kb=Ib.empty={dispose:R},Lb=Q.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Mb=Q.SerialDisposable=Lb,Nb=(Q.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Kb:new a(this)},b}(),Q.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||W,this.disposable=new Lb});Nb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Nb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Nb.prototype.isCancelled=function(){return this.disposable.isDisposed},Nb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Ob=Q.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Kb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=U,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Pb=Ob.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Gb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Kb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Gb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Kb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Ob.prototype),function(){Ob.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Ob.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof L.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=L.setInterval(function(){d=c(d)},b);return Jb(function(){L.clearInterval(e)})}}(Ob.prototype);var Qb,Rb=Ob.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Pb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ob(U,a,b,c)}(),Sb=Ob.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Ob.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Ob.normalize(c),g=new Nb(this,b,d,f);if(e)e.enqueue(g);else{e=new Eb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Ob(U,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Tb=(Q.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Lb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),R),Ub=function(){var a,b=R;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!L.setTimeout)throw new Error("No concurrency detected!");a=L.setTimeout,b=L.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Vb=Ub.setTimeout,Wb=Ub.clearTimeout;!function(){function a(){if(!L.postMessage||L.importScripts)return!1;var a=!1,b=L.onmessage;return L.onmessage=function(){a=!0},L.postMessage("","*"),L.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(qb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=P&&O&&P.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=P&&O&&P.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Qb=d,Tb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Qb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;L.addEventListener?L.addEventListener("message",b,!1):L.attachEvent("onmessage",b,!1),Qb=function(a){var b=h++;g[b]=a,L.postMessage(f+b,"*")}}else if(L.MessageChannel){var i=new L.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Qb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in L&&"onreadystatechange"in L.document.createElement("script")?Qb=function(a){var b=L.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},L.document.documentElement.appendChild(b)}:(Qb=function(a){return Vb(a,0)},Tb=Wb)}();var Xb=Ob.timeout=function(){function a(a,b){var c=this,d=new Lb,e=Qb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Gb(d,Jb(function(){Tb(e)}))}function b(a,b,c){var d=this,e=Ob.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Lb,g=Vb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Gb(f,Jb(function(){Wb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ob(U,a,b,c)}(),Yb=Q.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return S(a)||(a=Rb),new Hc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Zb=Yb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Yb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),$b=Yb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Yb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),_b=Yb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Yb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),ac=Q.internals.Enumerator=function(a){this._next=a};ac.prototype.next=function(){return this._next()},ac.prototype[ab]=function(){return this};var bc=Q.internals.Enumerable=function(a){this._iterator=a};bc.prototype[ab]=function(){return this._iterator()},bc.prototype.concat=function(){var a=this;return new Hc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError()}var e,f=new Mb,g=Rb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Y(h)&&(h=Ac(h));var i=new Lb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Gb(f,g,Jb(function(){e=!0}))})},bc.prototype.catchError=function(){var a=this;return new Hc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError()}var e,f,g=new Mb,h=Rb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Y(i)&&(i=Ac(i));var j=new Lb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Gb(g,h,Jb(function(){e=!0}))})};var cc=bc.repeat=function(a,b){return null==b&&(b=-1),new bc(function(){var c=b;return new ac(function(){return 0===c?bb:(c>0&&c--,{done:!1,value:a})})})},dc=bc.of=function(a,b,c){return b||(b=T),new bc(function(){var d=-1;return new ac(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:bb})})},ec=Q.Observer=function(){};ec.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ec.prototype.asObserver=function(){return new ic(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var fc=ec.create=function(a,b,c){return a||(a=R),b||(b=X),c||(c=R),new ic(a,b,c)};ec.fromNotifier=function(a,b){return new ic(function(c){return a.call(b,Zb(c))},function(c){return a.call(b,$b(c))},function(){return a.call(b,_b())})};var gc,hc=Q.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Cb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ec),ic=Q.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Cb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(hc),jc=Q.Observable=function(){function a(a){this._subscribe=a}return gc=a.prototype,gc.subscribe=gc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:fc(a,b,c))},gc.subscribeOnNext=function(a,b){return this._subscribe(fc(2===arguments.length?function(c){a.call(b,c)}:a))},gc.subscribeOnError=function(a,b){return this._subscribe(fc(null,2===arguments.length?function(c){a.call(b,c)}:a))},gc.subscribeOnCompleted=function(a,b){return this._subscribe(fc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),kc=Q.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Mb}return Cb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(hc);gc.toArray=function(){var a=this;return new Hc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},jc.create=jc.createWithDisposable=function(a){return new Hc(a)};var lc=jc.defer=function(a){return new Hc(function(b){var c;try{c=a()}catch(d){return rc(d).subscribe(b)}return Y(c)&&(c=Ac(c)),c.subscribe(b)})},mc=jc.empty=function(a){return S(a)||(a=Rb),new Hc(function(b){return a.schedule(function(){b.onCompleted()})})},nc=Math.pow(2,53)-1;m.prototype[ab]=function(){return new n(this._s)},n.prototype[ab]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return bb},o.prototype[ab]=function(){return new p(this._a)},p.prototype[ab]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return bb};{var oc=jc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Z(b))throw new Error("mapFn when provided must be a function");S(d)||(d=Sb);var e=Object(a),f=r(e);return new Hc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Z(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},pc=jc.fromArray=function(a,b){return fb("fromArray","from"),S(b)||(b=Sb),new Hc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};jc.never=function(){return new Hc(function(){return Kb})}}jc.of=function(){return v(null,arguments)},jc.ofWithScheduler=function(a){return v(a,Bb.call(arguments,1))},jc.range=function(a,b,c){return S(c)||(c=Sb),new Hc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},jc.repeat=function(a,b,c){return S(c)||(c=Sb),qc(a,c).repeat(null==b?-1:b)};var qc=jc["return"]=jc.just=function(a,b){return S(b)||(b=Rb),new Hc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};jc.returnValue=function(){return fb("returnValue","return or just"),qc.apply(null,arguments)};var rc=jc["throw"]=jc.throwException=jc.throwError=function(a,b){return S(b)||(b=Rb),new Hc(function(c){return b.schedule(function(){c.onError(a)})})};gc["catch"]=gc.catchError=function(a){return"function"==typeof a?w(this,a):sc([this,a])},gc.catchException=function(a){return fb("catchException","catch or catchError"),this.catchError(a)};var sc=jc.catchError=jc["catch"]=function(){return dc(j(arguments,0)).catchError()};jc.catchException=function(){return fb("catchException","catch or catchError"),sc.apply(null,arguments)},gc.combineLatest=function(){var a=Bb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),tc.apply(this,a)};var tc=jc.combineLatest=function(){var a=Bb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Hc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(T))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(T)&&c.onCompleted()}function e(a){j[a]=!0,j.every(T)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Lb;Y(f)&&(f=Ac(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Gb(m)})};gc.concat=function(){var a=Bb.call(arguments,0);return a.unshift(this),uc.apply(this,a)};var uc=jc.concat=function(){return dc(j(arguments,0)).concat()};gc.concatAll=function(){return this.merge(1)},gc.concatObservable=function(){return fb("concatObservable","concatAll"),this.merge(1)},gc.merge=function(a){if("number"!=typeof a)return vc(this,a);var b=this;return new Hc(function(c){function d(a){var b=new Lb;f.add(b),Y(a)&&(a=Ac(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Gb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var vc=jc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Bb.call(arguments,1)):(a=Rb,b=Bb.call(arguments,0)):(a=Rb,b=Bb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};gc.mergeAll=function(){var a=this;return new Hc(function(b){var c=new Gb,d=!1,e=new Lb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Lb;c.add(e),Y(a)&&(a=Ac(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},gc.mergeObservable=function(){return fb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},gc.skipUntil=function(a){var b=this;return new Hc(function(c){var d=!1,e=new Gb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Y(a)&&(a=Ac(a));var f=new Lb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},gc["switch"]=gc.switchLatest=function(){var a=this;return new Hc(function(b){var c=!1,d=new Mb,e=!1,f=0,g=a.subscribe(function(a){var g=new Lb,h=++f;c=!0,d.setDisposable(g),Y(a)&&(a=Ac(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Gb(g,d)})},gc.takeUntil=function(a){var b=this;return new Hc(function(c){return Y(a)&&(a=Ac(a)),new Gb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),R))})},gc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=Bb.call(arguments),c=b.pop();return b.unshift(a),new Hc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(T)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Lb;Y(c)&&(c=Ac(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Gb(j)})},jc.zip=function(){var a=Bb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},jc.zipArray=function(){var a=j(arguments,0);return new Hc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(T))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(T)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Lb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Gb(h);return j.add(Jb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},gc.asObservable=function(){return new Hc(this.subscribe.bind(this))},gc.dematerialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},gc.distinctUntilChanged=function(a,b){var c=this;return a||(a=T),b||(b=V),new Hc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},gc["do"]=gc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Hc(function(a){return e.subscribe(function(b){try{d(b)
}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},gc.doAction=function(){return fb("doAction","do or tap"),this.tap.apply(this,arguments)},gc.doOnNext=gc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},gc.doOnError=gc.tapOnError=function(a,b){return this.tap(R,2===arguments.length?function(c){a.call(b,c)}:a)},gc.doOnCompleted=gc.tapOnCompleted=function(a,b){return this.tap(R,null,2===arguments.length?function(){a.call(b)}:a)},gc["finally"]=gc.ensure=function(a){var b=this;return new Hc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Jb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},gc.finallyAction=function(a){return fb("finallyAction","finally or ensure"),this.ensure(a)},gc.ignoreElements=function(){var a=this;return new Hc(function(b){return a.subscribe(R,b.onError.bind(b),b.onCompleted.bind(b))})},gc.materialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){b.onNext(Zb(a))},function(a){b.onNext($b(a)),b.onCompleted()},function(){b.onNext(_b()),b.onCompleted()})})},gc.repeat=function(a){return cc(this,a).concat()},gc.retry=function(a){return cc(this,a).catchError()},gc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Hc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},gc.skipLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},gc.startWith=function(){var a,b,c=0;return arguments.length&&S(arguments[0])?(b=arguments[0],c=1):b=Rb,a=Bb.call(arguments,c),dc([pc(a,b),this]).concat()},gc.takeLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},gc.selectConcat=gc.concatMap=function(a,b,c){return Z(a)&&Z(b)?this.concatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ac(e)),(db(e)||cb(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Z(a)?y(this,a,c):y(this,function(){return a})},gc.select=gc.map=function(a,b){var c=Z(a)?a:function(){return a},d=this;return new Hc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},gc.pluck=function(a){return this.map(function(b){return b[a]})},gc.selectMany=gc.flatMap=function(a,b,c){return Z(a)&&Z(b)?this.flatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ac(e)),(db(e)||cb(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Z(a)?z(this,a,c):z(this,function(){return a})},gc.selectSwitch=gc.flatMapLatest=gc.switchMap=function(a,b){return this.select(a,b).switchLatest()},gc.skip=function(a){if(0>a)throw new Error($);var b=this;return new Hc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},gc.skipWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},gc.take=function(a,b){if(0>a)throw new RangeError($);if(0===a)return mc(b);var c=this;return new Hc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},gc.takeWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},gc.where=gc.filter=function(a,b){var c=this;return new Hc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},jc.fromCallback=function(a,b,c){return function(){var d=Bb.call(arguments,0);return new Hc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},jc.fromNodeCallback=function(a,b,c){return function(){var d=Bb.call(arguments,0);return new Hc(function(e){function f(a){if(a)return void e.onError(a);var b=Bb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},Q.config.useNativeEvents=!1;var wc=L.angular&&angular.element?angular.element:L.jQuery?L.jQuery:L.Zepto?L.Zepto:null,xc=!!L.Ember&&"function"==typeof L.Ember.addListener,yc=!!L.Backbone&&!!L.Backbone.Marionette;jc.fromEvent=function(a,b,c){if(a.addListener)return zc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!Q.config.useNativeEvents){if(yc)return zc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(xc)return zc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(wc){var d=wc(a);return zc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Hc(function(d){return B(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var zc=jc.fromEventPattern=function(a,b,c){return new Hc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Jb(function(){b&&b(e,f)})}).publish().refCount()},Ac=jc.fromPromise=function(a){return lc(function(){var b=new Q.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};gc.toPromise=function(a){if(a||(a=Q.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},jc.startAsync=function(a){var b;try{b=a()}catch(c){return rc(c)}return Ac(b)},gc.multicast=function(a,b){var c=this;return"function"==typeof a?new Hc(function(d){var e=c.multicast(a());return new Gb(b(e).subscribe(d),e.connect())}):new Bc(c,a)},gc.publish=function(a){return a&&Z(a)?this.multicast(function(){return new Kc},a):this.multicast(new Kc)},gc.share=function(){return this.publish().refCount()},gc.publishLast=function(a){return a&&Z(a)?this.multicast(function(){return new Lc},a):this.multicast(new Lc)},gc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Nc(b)},a):this.multicast(new Nc(a))},gc.shareValue=function(a){return this.publishValue(a).refCount()},gc.replay=function(a,b,c,d){return a&&Z(a)?this.multicast(function(){return new Oc(b,c,d)},a):this.multicast(new Oc(b,c,d))},gc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Bc=Q.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Gb(f.subscribe(c),Jb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Cb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Hc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(jc),Cc=jc.interval=function(a,b){return F(a,a,S(b)?b:Xb)};jc.timer=function(b,c,d){var e;return S(d)||(d=Xb),c!==a&&"number"==typeof c?e=c:S(c)&&(d=c),b instanceof Date&&e===a?C(b.getTime(),d):b instanceof Date&&e!==a?(e=c,D(b.getTime(),e,d)):e===a?E(b,d):F(b,e,d)}}gc.delay=function(a,b){return S(b)||(b=Xb),a instanceof Date?H(this,a.getTime(),b):G(this,a,b)},gc.debounce=gc.throttleWithTimeout=function(a,b){S(b)||(b=Xb);var c=this;return new Hc(function(d){var e,f=new Mb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Lb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Gb(i,f)})},gc.throttle=function(a,b){return fb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},gc.timestamp=function(a){return S(a)||(a=Xb),this.map(function(b){return{value:b,timestamp:a.now()}})},gc.sample=gc.throttleLatest=function(a,b){return S(b)||(b=Xb),"number"==typeof a?I(this,Cc(a,b)):I(this,a)},gc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=rc(new Error(b||"Timeout"))),S(c)||(c=Xb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Hc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Y(b)&&(b=Ac(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Lb,j=new Mb,k=!1,l=new Mb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Gb(j,l)})},gc.throttleFirst=function(a,b){S(b)||(b=Xb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Hc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Dc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Kb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Kb)});return new Gb(c,d,e)}function c(c,d){this.source=c,this.controller=new Kc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Cb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(jc);gc.pausable=function(a){return new Dc(this,a)};var Ec=function(b){function c(b){var c,d=[],e=J(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Kc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Cb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(jc);gc.pausableBuffered=function(a){return new Ec(this,a)},gc.controlled=function(a){return null==a&&(a=!0),new Fc(this,a)};var Fc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Gc(d),this.source=c.multicast(this.subject).refCount()}return Cb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(jc),Gc=Q.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Kc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Kb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Kb}return Cb(d,a),Db(d.prototype,ec,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Kb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Kb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Kb:(this.requestedCount=a,this.requestedDisposable=Jb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Kb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(jc);gc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Hc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Hc=Q.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Jb(a):Kb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Ic(a);return Sb.scheduleRequired()?Sb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Cb(c,a),c}(jc),Ic=function(a){function b(b){a.call(this),this.observer=b,this.m=new Lb}Cb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(hc),Jc=function(a,b){this.subject=a,this.observer=b};Jc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Kc=Q.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Kb):(a.onCompleted(),Kb):(this.observers.push(a),new Jc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Mc(a,b)},d}(jc),Lc=Q.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Jc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Kb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(jc),Mc=Q.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Cb(b,a),Db(b.prototype,ec,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(jc),Nc=Q.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Jc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Kb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(jc),Oc=Q.ReplaySubject=function(a){function c(a,b){return Jb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new kc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Sb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Cb(e,a),Db(e.prototype,ec,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(jc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(L.Rx=Q,define(function(){return Q})):M&&N?O?(N.exports=Q).Rx=Q:M.Rx=Q:L.Rx=Q}).call(this);
//# sourceMappingURL=rx.lite.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(U)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&h(a)&&(a=ub.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===mb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==nb){var g=a.constructor,i=-1,j=qb.length;if(a===(g&&g.prototype))var k=a===stringProto?ib:a===mb?db:jb.call(a),l=rb[k];for(;++i<j;)f=qb[i],l&&l[f]||!kb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?jb.call(a)==_:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=jb.call(a),l=jb.call(b);if(k==_&&(k=gb),l==_&&(l=gb),k!=l)return!1;switch(k){case bb:case cb:return+a==+b;case fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case hb:case ib:return a==String(b)}var m=k==ab;if(!m){if(k!=gb||!sb.nodeClass&&(g(a)||g(b)))return!1;var n=!sb.argsObject&&h(a)?Object:a.constructor,o=!sb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||kb.call(a,"constructor")&&kb.call(b,"constructor")||S(n)&&n instanceof n&&S(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return kb.call(f,e)?(q++,r=kb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return kb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ub.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(){this._s=s}function o(){this._s=s,this._l=s.length,this._i=0}function p(a){this._a=a}function q(a){this._a=a,this._l=v(a),this._i=0}function r(a){return"number"==typeof a&&E.isFinite(a)}function t(b){var c,d=b[V];if(!d&&"string"==typeof b)return c=new n(b),c[V]();if(!d&&b.length!==a)return c=new p(b),c[V]();if(!d)throw new TypeError("Object is not iterable");return b[V]()}function u(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function v(a){var b=+a.length;return isNaN(b)?0:0!==b&&r(b)?(b=u(b)*Math.floor(Math.abs(b)),0>=b?0:b>lc?lc:b):b}function w(a,b){return L(a)||(a=Nb),new wc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function x(a,b){return new wc(function(c){var d=new Fb,e=new Gb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}R(f)&&(f=ic(f)),d=new Fb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function y(a,b){var c=this;return new wc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=ic(f)),(Y(f)||X(f))&&(f=mc(f)),f}).concatAll()}function A(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function B(a){this.comparer=a,this.set=[]}function C(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=ic(f)),(Y(f)||X(f))&&(f=mc(f)),f}).mergeAll()}var D={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},E=D[typeof window]&&window||this,F=D[typeof exports]&&exports&&!exports.nodeType&&exports,G=D[typeof module]&&module&&!module.nodeType&&module,H=G&&G.exports===F&&F,I=D[typeof global]&&global;!I||I.global!==I&&I.window!==I||(E=I);var J={internals:{},config:{Promise:E.Promise},helpers:{}},K=J.helpers.noop=function(){},L=(J.helpers.notDefined=function(a){return"undefined"==typeof a},J.helpers.isScheduler=function(a){return a instanceof J.Scheduler}),M=J.helpers.identity=function(a){return a},N=(J.helpers.pluck=function(a){return function(b){return b[a]}},J.helpers.just=function(a){return function(){return a}},J.helpers.defaultNow=Date.now),O=J.helpers.defaultComparer=function(a,b){return tb(a,b)},P=J.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Q=(J.helpers.defaultKeySerializer=function(a){return a.toString()},J.helpers.defaultError=function(a){throw a}),R=J.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},S=(J.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},J.helpers.not=function(a){return!a},J.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==jb.call(a)}),a}()),T="Argument out of range",U="Object has been disposed",V="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(V="@@iterator");var W=J.doneEnumerator={done:!0,value:a},X=J.helpers.isIterable=function(b){return b[V]!==a},Y=J.helpers.isArrayLike=function(b){return b&&b.length!==a};J.helpers.iterator=V;var Z,$=J.helpers.deprecate=function(a,b){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(a+" is deprecated, use "+b+" instead.",new Error("").stack)},_="[object Arguments]",ab="[object Array]",bb="[object Boolean]",cb="[object Date]",db="[object Error]",eb="[object Function]",fb="[object Number]",gb="[object Object]",hb="[object RegExp]",ib="[object String]",jb=Object.prototype.toString,kb=Object.prototype.hasOwnProperty,lb=jb.call(arguments)==_,mb=Error.prototype,nb=Object.prototype,ob=nb.propertyIsEnumerable;try{Z=!(jb.call(document)==gb&&!({toString:0}+""))}catch(pb){Z=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[ab]=rb[cb]=rb[fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[bb]=rb[ib]={constructor:!0,toString:!0,valueOf:!0},rb[db]=rb[eb]=rb[hb]={constructor:!0,toString:!0},rb[gb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(mb,"message")||ob.call(mb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1),lb||(h=function(a){return a&&"object"==typeof a?kb.call(a,"callee"):!1});var tb=J.internals.isEqual=function(a,b){return i(a,b,[],[])},ub=Array.prototype.slice,vb=({}.hasOwnProperty,this.inherits=J.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),wb=J.internals.addProperties=function(a){for(var b=ub.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},xb=J.internals.addRef=function(a,b){return new wc(function(c){return new Ab(b.getDisposable(),a.subscribe(c))})};l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var yb=J.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},zb=yb.prototype;zb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},zb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},zb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},zb.peek=function(){return this.items[0].value},zb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},zb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},zb.enqueue=function(a){var b=this.length++;this.items[b]=new l(yb.count++,a),this.percolate(b)},zb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},yb.count=0;var Ab=J.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Bb=Ab.prototype;Bb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Bb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Bb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Bb.toArray=function(){return this.disposables.slice(0)};var Cb=J.Disposable=function(a){this.isDisposed=!1,this.action=a||K};Cb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Db=Cb.create=function(a){return new Cb(a)},Eb=Cb.empty={dispose:K},Fb=J.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Gb=J.SerialDisposable=Fb,Hb=J.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Eb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Ib=J.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||P,this.disposable=new Fb};Ib.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Ib.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Ib.prototype.isCancelled=function(){return this.disposable.isDisposed},Ib.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Jb=J.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Eb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=N,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Kb=Jb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Ab,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Eb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Ab,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Eb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Jb.prototype),function(){Jb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Jb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof E.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=E.setInterval(function(){d=c(d)},b);return Db(function(){E.clearInterval(e)})}}(Jb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Sb(this,a)}}(Jb.prototype);var Lb,Mb=(J.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Fb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Jb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Kb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(N,a,b,c)}()),Nb=Jb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Jb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Jb.normalize(c),g=new Ib(this,b,d,f);if(e)e.enqueue(g);else{e=new yb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Jb(N,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ob=K,Pb=function(){var a,b=K;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!E.setTimeout)throw new Error("No concurrency detected!");a=E.setTimeout,b=E.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Qb=Pb.setTimeout,Rb=Pb.clearTimeout;!function(){function a(){if(!E.postMessage||E.importScripts)return!1;var a=!1,b=E.onmessage;return E.onmessage=function(){a=!0},E.postMessage("","*"),E.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=I&&H&&I.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=I&&H&&I.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Lb=d,Ob=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Lb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;E.addEventListener?E.addEventListener("message",b,!1):E.attachEvent("onmessage",b,!1),Lb=function(a){var b=h++;g[b]=a,E.postMessage(f+b,"*")}}else if(E.MessageChannel){var i=new E.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Lb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in E&&"onreadystatechange"in E.document.createElement("script")?Lb=function(a){var b=E.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},E.document.documentElement.appendChild(b)}:(Lb=function(a){return Qb(a,0)},Ob=Rb)}();var Sb=(Jb.timeout=function(){function a(a,b){var c=this,d=new Fb,e=Lb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Ab(d,Db(function(){Ob(e)}))}function b(a,b,c){var d=this,e=Jb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Fb,g=Qb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Ab(f,Db(function(){Rb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(N,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return vb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Eb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Fb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Jb)),Tb=J.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return L(a)||(a=Mb),new wc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ub=Tb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Tb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Vb=Tb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Tb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Wb=Tb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Tb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Xb=J.internals.Enumerator=function(a){this._next=a};Xb.prototype.next=function(){return this._next()},Xb.prototype[V]=function(){return this};var Yb=J.internals.Enumerable=function(a){this._iterator=a};Yb.prototype[V]=function(){return this._iterator()},Yb.prototype.concat=function(){var a=this;return new wc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f=new Gb,g=Mb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;R(h)&&(h=ic(h));var i=new Fb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Ab(f,g,Db(function(){e=!0}))})},Yb.prototype.catchError=function(){var a=this;return new wc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f,g=new Gb,h=Mb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;R(i)&&(i=ic(i));var j=new Fb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Ab(g,h,Db(function(){e=!0}))})};var Zb=Yb.repeat=function(a,b){return null==b&&(b=-1),new Yb(function(){var c=b;return new Xb(function(){return 0===c?W:(c>0&&c--,{done:!1,value:a})})})},$b=Yb.of=function(a,b,c){return b||(b=M),new Yb(function(){var d=-1;return new Xb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:W})})},_b=J.Observer=function(){};_b.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},_b.prototype.asObserver=function(){return new dc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},_b.prototype.checked=function(){return new ec(this)};var ac=_b.create=function(a,b,c){return a||(a=K),b||(b=Q),c||(c=K),new dc(a,b,c)};_b.fromNotifier=function(a,b){return new dc(function(c){return a.call(b,Ub(c))},function(c){return a.call(b,Vb(c))},function(){return a.call(b,Wb())})},_b.notifyOn=function(a){return new gc(a,this)};var bc,cc=J.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return vb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(_b),dc=J.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return vb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(cc),ec=function(a){function b(b){a.call(this),this._observer=b,this._state=0}vb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(_b),fc=J.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Gb}return vb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(cc),gc=function(a){function b(){a.apply(this,arguments)}return vb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(fc),hc=J.Observable=function(){function a(a){this._subscribe=a}return bc=a.prototype,bc.subscribe=bc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ac(a,b,c))},bc.subscribeOnNext=function(a,b){return this._subscribe(ac(2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnError=function(a,b){return this._subscribe(ac(null,2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnCompleted=function(a,b){return this._subscribe(ac(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();bc.observeOn=function(a){var b=this;return new wc(function(c){return b.subscribe(new gc(a,c))})},bc.subscribeOn=function(a){var b=this;return new wc(function(c){var d=new Fb,e=new Gb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var ic=hc.fromPromise=function(a){return jc(function(){var b=new J.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};bc.toPromise=function(a){if(a||(a=J.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},bc.toArray=function(){var a=this;return new wc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},hc.create=hc.createWithDisposable=function(a){return new wc(a)};var jc=hc.defer=function(a){return new wc(function(b){var c;try{c=a()}catch(d){return qc(d).subscribe(b)}return R(c)&&(c=ic(c)),c.subscribe(b)})},kc=hc.empty=function(a){return L(a)||(a=Mb),new wc(function(b){return a.schedule(function(){b.onCompleted()})})},lc=Math.pow(2,53)-1;n.prototype[V]=function(){return new o(this._s)},o.prototype[V]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return W},p.prototype[V]=function(){return new q(this._a)},q.prototype[V]=function(){return this},q.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return W};var mc=hc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!S(b))throw new Error("mapFn when provided must be a function");L(d)||(d=Nb);var e=Object(a),f=t(e);return new wc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&S(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},nc=hc.fromArray=function(a,b){return L(b)||(b=Nb),new wc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};hc.generate=function(a,b,c,d,e){return L(e)||(e=Nb),new wc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var oc=hc.never=function(){return new wc(function(){return Eb})};hc.of=function(){return w(null,arguments)},hc.ofWithScheduler=function(a){return w(a,ub.call(arguments,1))},hc.range=function(a,b,c){return L(c)||(c=Nb),new wc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},hc.repeat=function(a,b,c){return L(c)||(c=Nb),pc(a,c).repeat(null==b?-1:b)};var pc=hc["return"]=hc.just=function(a,b){return L(b)||(b=Mb),new wc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};hc.returnValue=function(){return $("returnValue","return or just"),pc.apply(null,arguments)};var qc=hc["throw"]=hc.throwException=hc.throwError=function(a,b){return L(b)||(b=Mb),new wc(function(c){return b.schedule(function(){c.onError(a)})})};hc.using=function(a,b){return new wc(function(c){var d,e,f=Eb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Ab(qc(g).subscribe(c),f)}return new Ab(e.subscribe(c),f)})},bc.amb=function(a){var b=this;return new wc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Fb,j=new Fb;return R(a)&&(a=ic(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Ab(i,j)})},hc.amb=function(){function a(a,b){return a.amb(b)}for(var b=oc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},bc["catch"]=bc.catchError=function(a){return"function"==typeof a?x(this,a):rc([this,a])},bc.catchException=function(a){return $("catchException","catch or catchError"),this.catchError(a)};var rc=hc.catchError=hc["catch"]=function(){return $b(j(arguments,0)).catchError()};hc.catchException=function(){return $("catchException","catch or catchError"),rc.apply(null,arguments)},bc.combineLatest=function(){var a=ub.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),sc.apply(this,a)};var sc=hc.combineLatest=function(){var a=ub.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new wc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(M))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(M)&&c.onCompleted()}function e(a){j[a]=!0,j.every(M)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Fb;R(f)&&(f=ic(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Ab(m)})};bc.concat=function(){var a=ub.call(arguments,0);return a.unshift(this),tc.apply(this,a)};var tc=hc.concat=function(){return $b(j(arguments,0)).concat()};bc.concatAll=function(){return this.merge(1)},bc.concatObservable=function(){return $("concatObservable","concatAll"),this.merge(1)},bc.merge=function(a){if("number"!=typeof a)return uc(this,a);var b=this;return new wc(function(c){function d(a){var b=new Fb;f.add(b),R(a)&&(a=ic(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Ab,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var uc=hc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ub.call(arguments,1)):(a=Mb,b=ub.call(arguments,0)):(a=Mb,b=ub.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),w(a,b).mergeAll()};bc.mergeAll=function(){var a=this;return new wc(function(b){var c=new Ab,d=!1,e=new Fb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Fb;c.add(e),R(a)&&(a=ic(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},bc.mergeObservable=function(){return $("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},bc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return vc([this,a])};var vc=hc.onErrorResumeNext=function(){var a=j(arguments,0);return new wc(function(b){var c=0,d=new Gb,e=Mb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],R(f)&&(f=ic(f)),g=new Fb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Ab(d,e)})};bc.skipUntil=function(a){var b=this;return new wc(function(c){var d=!1,e=new Ab(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));R(a)&&(a=ic(a));var f=new Fb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},bc["switch"]=bc.switchLatest=function(){var a=this;return new wc(function(b){var c=!1,d=new Gb,e=!1,f=0,g=a.subscribe(function(a){var g=new Fb,h=++f;
c=!0,d.setDisposable(g),R(a)&&(a=ic(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Ab(g,d)})},bc.takeUntil=function(a){var b=this;return new wc(function(c){return R(a)&&(a=ic(a)),new Ab(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),K))})},bc.zip=function(){if(Array.isArray(arguments[0]))return y.apply(this,arguments);var a=this,b=ub.call(arguments),c=b.pop();return b.unshift(a),new wc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(M)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Fb;R(c)&&(c=ic(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Ab(j)})},hc.zip=function(){var a=ub.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},hc.zipArray=function(){var a=j(arguments,0);return new wc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(M))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(M)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Fb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Ab(h);return j.add(Db(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},bc.asObservable=function(){return new wc(this.subscribe.bind(this))},bc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},bc.dematerialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},bc.distinctUntilChanged=function(a,b){var c=this;return a||(a=M),b||(b=O),new wc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},bc["do"]=bc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new wc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},bc.doAction=function(){return $("doAction","do or tap"),this.tap.apply(this,arguments)},bc.doOnNext=bc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnError=bc.tapOnError=function(a,b){return this.tap(K,2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnCompleted=bc.tapOnCompleted=function(a,b){return this.tap(K,null,2===arguments.length?function(){a.call(b)}:a)},bc["finally"]=bc.ensure=function(a){var b=this;return new wc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Db(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},bc.finallyAction=function(a){return $("finallyAction","finally or ensure"),this.ensure(a)},bc.ignoreElements=function(){var a=this;return new wc(function(b){return a.subscribe(K,b.onError.bind(b),b.onCompleted.bind(b))})},bc.materialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){b.onNext(Ub(a))},function(a){b.onNext(Vb(a)),b.onCompleted()},function(){b.onNext(Wb()),b.onCompleted()})})},bc.repeat=function(a){return Zb(this,a).concat()},bc.retry=function(a){return Zb(this,a).catchError()},bc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new wc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},bc.skipLast=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},bc.startWith=function(){var a,b,c=0;return arguments.length&&L(arguments[0])?(b=arguments[0],c=1):b=Mb,a=ub.call(arguments,c),$b([nc(a,b),this]).concat()},bc.takeLast=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},bc.takeLastBuffer=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},bc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(T);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(T);return new wc(function(d){function e(){var a=new zc;i.push(a),d.onNext(xb(a,g))}var f=new Fb,g=new Hb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},bc.selectConcat=bc.concatMap=function(a,b,c){return S(a)&&S(b)?this.concatMap(function(c,d){var e=a(c,d);return R(e)&&(e=ic(e)),(Y(e)||X(e))&&(e=mc(e)),e.map(function(a,e){return b(c,a,d,e)})}):S(a)?z(this,a,c):z(this,function(){return a})},bc.concatMapObserver=bc.selectConcatObserver=function(a,b,c,d){var e=this;return new wc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=ic(a)),f.onNext(a),f.onCompleted()})}).concatAll()},bc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new wc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},B.prototype.push=function(a){var b=-1===A(this.set,a,this.comparer);return b&&this.set.push(a),b},bc.distinct=function(a,b){var c=this;return b||(b=O),new wc(function(d){var e=new B(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.select=bc.map=function(a,b){var c=S(a)?a:function(){return a},d=this;return new wc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},bc.pluck=function(a){return this.map(function(b){return b[a]})},bc.flatMapObserver=bc.selectManyObserver=function(a,b,c,d){var e=this;return new wc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=ic(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},bc.selectMany=bc.flatMap=function(a,b,c){return S(a)&&S(b)?this.flatMap(function(c,d){var e=a(c,d);return R(e)&&(e=ic(e)),(Y(e)||X(e))&&(e=mc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):S(a)?C(this,a,c):C(this,function(){return a})},bc.selectSwitch=bc.flatMapLatest=bc.switchMap=function(a,b){return this.select(a,b).switchLatest()},bc.skip=function(a){if(0>a)throw new Error(T);var b=this;return new wc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},bc.skipWhile=function(a,b){var c=this;return new wc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.take=function(a,b){if(0>a)throw new RangeError(T);if(0===a)return kc(b);var c=this;return new wc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},bc.takeWhile=function(a,b){var c=this;return new wc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},bc.where=bc.filter=function(a,b){var c=this;return new wc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new wc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var wc=J.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Db(a):Eb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new xc(a);return Nb.scheduleRequired()?Nb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return vb(c,a),c}(hc),xc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Fb}vb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(cc),yc=function(a,b){this.subject=a,this.observer=b};yc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var zc=J.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Eb):(a.onCompleted(),Eb):(this.observers.push(a),new yc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return vb(d,a),wb(d.prototype,_b,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Ac(a,b)},d}(hc),Ac=(J.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new yc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Eb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return vb(d,a),wb(d.prototype,_b,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(hc),J.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return vb(b,a),wb(b.prototype,_b,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(hc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(E.Rx=J,define(function(){return J})):F&&G?H?(G.exports=J).Rx=J:F.Rx=J:E.Rx=J}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(U)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&h(a)&&(a=ub.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===mb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==nb){var g=a.constructor,i=-1,j=qb.length;if(a===(g&&g.prototype))var k=a===stringProto?ib:a===mb?db:jb.call(a),l=rb[k];for(;++i<j;)f=qb[i],l&&l[f]||!kb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?jb.call(a)==_:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=jb.call(a),l=jb.call(b);if(k==_&&(k=gb),l==_&&(l=gb),k!=l)return!1;switch(k){case bb:case cb:return+a==+b;case fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case hb:case ib:return a==String(b)}var m=k==ab;if(!m){if(k!=gb||!sb.nodeClass&&(g(a)||g(b)))return!1;var n=!sb.argsObject&&h(a)?Object:a.constructor,o=!sb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||kb.call(a,"constructor")&&kb.call(b,"constructor")||S(n)&&n instanceof n&&S(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return kb.call(f,e)?(q++,r=kb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return kb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ub.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(){this._s=s}function o(){this._s=s,this._l=s.length,this._i=0}function p(a){this._a=a}function q(a){this._a=a,this._l=v(a),this._i=0}function r(a){return"number"==typeof a&&E.isFinite(a)}function t(b){var c,d=b[V];if(!d&&"string"==typeof b)return c=new n(b),c[V]();if(!d&&b.length!==a)return c=new p(b),c[V]();if(!d)throw new TypeError("Object is not iterable");return b[V]()}function u(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function v(a){var b=+a.length;return isNaN(b)?0:0!==b&&r(b)?(b=u(b)*Math.floor(Math.abs(b)),0>=b?0:b>lc?lc:b):b}function w(a,b){return L(a)||(a=Nb),new wc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function x(a,b){return new wc(function(c){var d=new Fb,e=new Gb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}R(f)&&(f=ic(f)),d=new Fb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function y(a,b){var c=this;return new wc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=ic(f)),(Y(f)||X(f))&&(f=mc(f)),f}).concatAll()}function A(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function B(a){this.comparer=a,this.set=[]}function C(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=ic(f)),(Y(f)||X(f))&&(f=mc(f)),f}).mergeAll()}var D={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},E=D[typeof window]&&window||this,F=D[typeof exports]&&exports&&!exports.nodeType&&exports,G=D[typeof module]&&module&&!module.nodeType&&module,H=G&&G.exports===F&&F,I=D[typeof global]&&global;!I||I.global!==I&&I.window!==I||(E=I);var J={internals:{},config:{Promise:E.Promise},helpers:{}},K=J.helpers.noop=function(){},L=(J.helpers.notDefined=function(a){return"undefined"==typeof a},J.helpers.isScheduler=function(a){return a instanceof J.Scheduler}),M=J.helpers.identity=function(a){return a},N=(J.helpers.pluck=function(a){return function(b){return b[a]}},J.helpers.just=function(a){return function(){return a}},J.helpers.defaultNow=Date.now),O=J.helpers.defaultComparer=function(a,b){return tb(a,b)},P=J.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Q=(J.helpers.defaultKeySerializer=function(a){return a.toString()},J.helpers.defaultError=function(a){throw a}),R=J.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},S=(J.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},J.helpers.not=function(a){return!a},J.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==jb.call(a)}),a}()),T="Argument out of range",U="Object has been disposed",V="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(V="@@iterator");var W=J.doneEnumerator={done:!0,value:a},X=J.helpers.isIterable=function(b){return b[V]!==a},Y=J.helpers.isArrayLike=function(b){return b&&b.length!==a};J.helpers.iterator=V;var Z,$=J.helpers.deprecate=function(){},_="[object Arguments]",ab="[object Array]",bb="[object Boolean]",cb="[object Date]",db="[object Error]",eb="[object Function]",fb="[object Number]",gb="[object Object]",hb="[object RegExp]",ib="[object String]",jb=Object.prototype.toString,kb=Object.prototype.hasOwnProperty,lb=jb.call(arguments)==_,mb=Error.prototype,nb=Object.prototype,ob=nb.propertyIsEnumerable;try{Z=!(jb.call(document)==gb&&!({toString:0}+""))}catch(pb){Z=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[ab]=rb[cb]=rb[fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[bb]=rb[ib]={constructor:!0,toString:!0,valueOf:!0},rb[db]=rb[eb]=rb[hb]={constructor:!0,toString:!0},rb[gb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(mb,"message")||ob.call(mb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1),lb||(h=function(a){return a&&"object"==typeof a?kb.call(a,"callee"):!1});var tb=J.internals.isEqual=function(a,b){return i(a,b,[],[])},ub=Array.prototype.slice,vb=({}.hasOwnProperty,this.inherits=J.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),wb=J.internals.addProperties=function(a){for(var b=ub.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},xb=J.internals.addRef=function(a,b){return new wc(function(c){return new Ab(b.getDisposable(),a.subscribe(c))})};l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var yb=J.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},zb=yb.prototype;zb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},zb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},zb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},zb.peek=function(){return this.items[0].value},zb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},zb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},zb.enqueue=function(a){var b=this.length++;this.items[b]=new l(yb.count++,a),this.percolate(b)},zb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},yb.count=0;var Ab=J.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Bb=Ab.prototype;Bb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Bb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Bb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Bb.toArray=function(){return this.disposables.slice(0)};var Cb=J.Disposable=function(a){this.isDisposed=!1,this.action=a||K};Cb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Db=Cb.create=function(a){return new Cb(a)},Eb=Cb.empty={dispose:K},Fb=J.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Gb=J.SerialDisposable=Fb,Hb=J.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Eb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Ib=J.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||P,this.disposable=new Fb};Ib.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Ib.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Ib.prototype.isCancelled=function(){return this.disposable.isDisposed},Ib.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Jb=J.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Eb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=N,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Kb=Jb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Ab,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Eb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Ab,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Eb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Jb.prototype),function(){Jb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Jb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof E.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=E.setInterval(function(){d=c(d)},b);return Db(function(){E.clearInterval(e)})}}(Jb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Sb(this,a)}}(Jb.prototype);var Lb,Mb=(J.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Fb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Jb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Kb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(N,a,b,c)}()),Nb=Jb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Jb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Jb.normalize(c),g=new Ib(this,b,d,f);if(e)e.enqueue(g);else{e=new yb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Jb(N,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ob=K,Pb=function(){var a,b=K;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!E.setTimeout)throw new Error("No concurrency detected!");a=E.setTimeout,b=E.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Qb=Pb.setTimeout,Rb=Pb.clearTimeout;!function(){function a(){if(!E.postMessage||E.importScripts)return!1;var a=!1,b=E.onmessage;return E.onmessage=function(){a=!0},E.postMessage("","*"),E.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=I&&H&&I.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=I&&H&&I.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Lb=d,Ob=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Lb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;E.addEventListener?E.addEventListener("message",b,!1):E.attachEvent("onmessage",b,!1),Lb=function(a){var b=h++;g[b]=a,E.postMessage(f+b,"*")}}else if(E.MessageChannel){var i=new E.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Lb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in E&&"onreadystatechange"in E.document.createElement("script")?Lb=function(a){var b=E.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},E.document.documentElement.appendChild(b)}:(Lb=function(a){return Qb(a,0)},Ob=Rb)}();var Sb=(Jb.timeout=function(){function a(a,b){var c=this,d=new Fb,e=Lb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Ab(d,Db(function(){Ob(e)}))}function b(a,b,c){var d=this,e=Jb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Fb,g=Qb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Ab(f,Db(function(){Rb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(N,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return vb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Eb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Fb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Jb)),Tb=J.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return L(a)||(a=Mb),new wc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ub=Tb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Tb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Vb=Tb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Tb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Wb=Tb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Tb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Xb=J.internals.Enumerator=function(a){this._next=a};Xb.prototype.next=function(){return this._next()},Xb.prototype[V]=function(){return this};var Yb=J.internals.Enumerable=function(a){this._iterator=a};Yb.prototype[V]=function(){return this._iterator()},Yb.prototype.concat=function(){var a=this;return new wc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f=new Gb,g=Mb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;R(h)&&(h=ic(h));var i=new Fb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Ab(f,g,Db(function(){e=!0}))})},Yb.prototype.catchError=function(){var a=this;return new wc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f,g=new Gb,h=Mb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;R(i)&&(i=ic(i));var j=new Fb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Ab(g,h,Db(function(){e=!0}))})};var Zb=Yb.repeat=function(a,b){return null==b&&(b=-1),new Yb(function(){var c=b;return new Xb(function(){return 0===c?W:(c>0&&c--,{done:!1,value:a})})})},$b=Yb.of=function(a,b,c){return b||(b=M),new Yb(function(){var d=-1;return new Xb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:W})})},_b=J.Observer=function(){};_b.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},_b.prototype.asObserver=function(){return new dc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},_b.prototype.checked=function(){return new ec(this)};var ac=_b.create=function(a,b,c){return a||(a=K),b||(b=Q),c||(c=K),new dc(a,b,c)};_b.fromNotifier=function(a,b){return new dc(function(c){return a.call(b,Ub(c))},function(c){return a.call(b,Vb(c))},function(){return a.call(b,Wb())})},_b.notifyOn=function(a){return new gc(a,this)};var bc,cc=J.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return vb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(_b),dc=J.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return vb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(cc),ec=function(a){function b(b){a.call(this),this._observer=b,this._state=0}vb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(_b),fc=J.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Gb}return vb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(cc),gc=function(a){function b(){a.apply(this,arguments)}return vb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(fc),hc=J.Observable=function(){function a(a){this._subscribe=a}return bc=a.prototype,bc.subscribe=bc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ac(a,b,c))},bc.subscribeOnNext=function(a,b){return this._subscribe(ac(2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnError=function(a,b){return this._subscribe(ac(null,2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnCompleted=function(a,b){return this._subscribe(ac(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();bc.observeOn=function(a){var b=this;return new wc(function(c){return b.subscribe(new gc(a,c))})},bc.subscribeOn=function(a){var b=this;return new wc(function(c){var d=new Fb,e=new Gb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var ic=hc.fromPromise=function(a){return jc(function(){var b=new J.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};bc.toPromise=function(a){if(a||(a=J.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},bc.toArray=function(){var a=this;return new wc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},hc.create=hc.createWithDisposable=function(a){return new wc(a)};var jc=hc.defer=function(a){return new wc(function(b){var c;try{c=a()}catch(d){return qc(d).subscribe(b)}return R(c)&&(c=ic(c)),c.subscribe(b)})},kc=hc.empty=function(a){return L(a)||(a=Mb),new wc(function(b){return a.schedule(function(){b.onCompleted()})})},lc=Math.pow(2,53)-1;n.prototype[V]=function(){return new o(this._s)},o.prototype[V]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return W},p.prototype[V]=function(){return new q(this._a)},q.prototype[V]=function(){return this},q.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return W};var mc=hc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!S(b))throw new Error("mapFn when provided must be a function");L(d)||(d=Nb);var e=Object(a),f=t(e);return new wc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&S(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},nc=hc.fromArray=function(a,b){return $("fromArray","from"),L(b)||(b=Nb),new wc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};hc.generate=function(a,b,c,d,e){return L(e)||(e=Nb),new wc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var oc=hc.never=function(){return new wc(function(){return Eb})};hc.of=function(){return w(null,arguments)},hc.ofWithScheduler=function(a){return w(a,ub.call(arguments,1))},hc.range=function(a,b,c){return L(c)||(c=Nb),new wc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},hc.repeat=function(a,b,c){return L(c)||(c=Nb),pc(a,c).repeat(null==b?-1:b)};var pc=hc["return"]=hc.just=function(a,b){return L(b)||(b=Mb),new wc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};hc.returnValue=function(){return $("returnValue","return or just"),pc.apply(null,arguments)};var qc=hc["throw"]=hc.throwException=hc.throwError=function(a,b){return L(b)||(b=Mb),new wc(function(c){return b.schedule(function(){c.onError(a)})})};hc.using=function(a,b){return new wc(function(c){var d,e,f=Eb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Ab(qc(g).subscribe(c),f)}return new Ab(e.subscribe(c),f)})},bc.amb=function(a){var b=this;return new wc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Fb,j=new Fb;return R(a)&&(a=ic(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Ab(i,j)})},hc.amb=function(){function a(a,b){return a.amb(b)}for(var b=oc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},bc["catch"]=bc.catchError=function(a){return"function"==typeof a?x(this,a):rc([this,a])},bc.catchException=function(a){return $("catchException","catch or catchError"),this.catchError(a)};var rc=hc.catchError=hc["catch"]=function(){return $b(j(arguments,0)).catchError()};hc.catchException=function(){return $("catchException","catch or catchError"),rc.apply(null,arguments)},bc.combineLatest=function(){var a=ub.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),sc.apply(this,a)};var sc=hc.combineLatest=function(){var a=ub.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new wc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(M))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(M)&&c.onCompleted()}function e(a){j[a]=!0,j.every(M)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Fb;R(f)&&(f=ic(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Ab(m)})};bc.concat=function(){var a=ub.call(arguments,0);return a.unshift(this),tc.apply(this,a)};var tc=hc.concat=function(){return $b(j(arguments,0)).concat()};bc.concatAll=function(){return this.merge(1)},bc.concatObservable=function(){return $("concatObservable","concatAll"),this.merge(1)},bc.merge=function(a){if("number"!=typeof a)return uc(this,a);var b=this;return new wc(function(c){function d(a){var b=new Fb;f.add(b),R(a)&&(a=ic(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Ab,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var uc=hc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ub.call(arguments,1)):(a=Mb,b=ub.call(arguments,0)):(a=Mb,b=ub.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),w(a,b).mergeAll()};bc.mergeAll=function(){var a=this;return new wc(function(b){var c=new Ab,d=!1,e=new Fb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Fb;c.add(e),R(a)&&(a=ic(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},bc.mergeObservable=function(){return $("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},bc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return vc([this,a])};var vc=hc.onErrorResumeNext=function(){var a=j(arguments,0);return new wc(function(b){var c=0,d=new Gb,e=Mb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],R(f)&&(f=ic(f)),g=new Fb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Ab(d,e)})};bc.skipUntil=function(a){var b=this;return new wc(function(c){var d=!1,e=new Ab(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));R(a)&&(a=ic(a));var f=new Fb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},bc["switch"]=bc.switchLatest=function(){var a=this;return new wc(function(b){var c=!1,d=new Gb,e=!1,f=0,g=a.subscribe(function(a){var g=new Fb,h=++f;c=!0,d.setDisposable(g),R(a)&&(a=ic(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)
},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Ab(g,d)})},bc.takeUntil=function(a){var b=this;return new wc(function(c){return R(a)&&(a=ic(a)),new Ab(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),K))})},bc.zip=function(){if(Array.isArray(arguments[0]))return y.apply(this,arguments);var a=this,b=ub.call(arguments),c=b.pop();return b.unshift(a),new wc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(M)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Fb;R(c)&&(c=ic(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Ab(j)})},hc.zip=function(){var a=ub.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},hc.zipArray=function(){var a=j(arguments,0);return new wc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(M))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(M)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Fb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Ab(h);return j.add(Db(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},bc.asObservable=function(){return new wc(this.subscribe.bind(this))},bc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},bc.dematerialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},bc.distinctUntilChanged=function(a,b){var c=this;return a||(a=M),b||(b=O),new wc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},bc["do"]=bc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new wc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},bc.doAction=function(){return $("doAction","do or tap"),this.tap.apply(this,arguments)},bc.doOnNext=bc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnError=bc.tapOnError=function(a,b){return this.tap(K,2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnCompleted=bc.tapOnCompleted=function(a,b){return this.tap(K,null,2===arguments.length?function(){a.call(b)}:a)},bc["finally"]=bc.ensure=function(a){var b=this;return new wc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Db(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},bc.finallyAction=function(a){return $("finallyAction","finally or ensure"),this.ensure(a)},bc.ignoreElements=function(){var a=this;return new wc(function(b){return a.subscribe(K,b.onError.bind(b),b.onCompleted.bind(b))})},bc.materialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){b.onNext(Ub(a))},function(a){b.onNext(Vb(a)),b.onCompleted()},function(){b.onNext(Wb()),b.onCompleted()})})},bc.repeat=function(a){return Zb(this,a).concat()},bc.retry=function(a){return Zb(this,a).catchError()},bc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new wc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},bc.skipLast=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},bc.startWith=function(){var a,b,c=0;return arguments.length&&L(arguments[0])?(b=arguments[0],c=1):b=Mb,a=ub.call(arguments,c),$b([nc(a,b),this]).concat()},bc.takeLast=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},bc.takeLastBuffer=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},bc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(T);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(T);return new wc(function(d){function e(){var a=new zc;i.push(a),d.onNext(xb(a,g))}var f=new Fb,g=new Hb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},bc.selectConcat=bc.concatMap=function(a,b,c){return S(a)&&S(b)?this.concatMap(function(c,d){var e=a(c,d);return R(e)&&(e=ic(e)),(Y(e)||X(e))&&(e=mc(e)),e.map(function(a,e){return b(c,a,d,e)})}):S(a)?z(this,a,c):z(this,function(){return a})},bc.concatMapObserver=bc.selectConcatObserver=function(a,b,c,d){var e=this;return new wc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=ic(a)),f.onNext(a),f.onCompleted()})}).concatAll()},bc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new wc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},B.prototype.push=function(a){var b=-1===A(this.set,a,this.comparer);return b&&this.set.push(a),b},bc.distinct=function(a,b){var c=this;return b||(b=O),new wc(function(d){var e=new B(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.select=bc.map=function(a,b){var c=S(a)?a:function(){return a},d=this;return new wc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},bc.pluck=function(a){return this.map(function(b){return b[a]})},bc.flatMapObserver=bc.selectManyObserver=function(a,b,c,d){var e=this;return new wc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=ic(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},bc.selectMany=bc.flatMap=function(a,b,c){return S(a)&&S(b)?this.flatMap(function(c,d){var e=a(c,d);return R(e)&&(e=ic(e)),(Y(e)||X(e))&&(e=mc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):S(a)?C(this,a,c):C(this,function(){return a})},bc.selectSwitch=bc.flatMapLatest=bc.switchMap=function(a,b){return this.select(a,b).switchLatest()},bc.skip=function(a){if(0>a)throw new Error(T);var b=this;return new wc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},bc.skipWhile=function(a,b){var c=this;return new wc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.take=function(a,b){if(0>a)throw new RangeError(T);if(0===a)return kc(b);var c=this;return new wc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},bc.takeWhile=function(a,b){var c=this;return new wc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},bc.where=bc.filter=function(a,b){var c=this;return new wc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new wc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var wc=J.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Db(a):Eb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new xc(a);return Nb.scheduleRequired()?Nb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return vb(c,a),c}(hc),xc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Fb}vb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(cc),yc=function(a,b){this.subject=a,this.observer=b};yc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var zc=J.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Eb):(a.onCompleted(),Eb):(this.observers.push(a),new yc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return vb(d,a),wb(d.prototype,_b,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Ac(a,b)},d}(hc),Ac=(J.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new yc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Eb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return vb(d,a),wb(d.prototype,_b,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(hc),J.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return vb(b,a),wb(b.prototype,_b,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(hc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(E.Rx=J,define(function(){return J})):F&&G?H?(G.exports=J).Rx=J:F.Rx=J:E.Rx=J}).call(this);
//# sourceMappingURL=rx.map

@@ -5,3 +5,3 @@ {

"description": "Library for composing asynchronous and event-based operations in JavaScript",
"version": "2.3.17",
"version": "2.3.18",
"homepage": "https://github.com/Reactive-Extensions/RxJS",

@@ -8,0 +8,0 @@ "author": {

var deprecate = Rx.helpers.deprecate = function (name, alternative) {
if (typeof console !== "undefined" && typeof console.warn === "function") {
/*if (typeof console !== "undefined" && typeof console.warn === "function") {
console.warn(name + ' is deprecated, use ' + alternative + ' instead.', new Error('').stack);
}
}*/
}

@@ -8,3 +8,3 @@ /**

var observableFromArray = Observable.fromArray = function (array, scheduler) {
//deprecate('fromArray', 'from');
deprecate('fromArray', 'from');
isScheduler(scheduler) || (scheduler = currentThreadScheduler);

@@ -11,0 +11,0 @@ return new AnonymousObservable(function (observer) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc