Bones/node_modules/rx/dist/rx.lite.compat.min.js
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

4 lines
57 KiB
JavaScript

/* 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(eb)}function c(a,b){if(fb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(jb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+jb+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===hb&&d>=ib&&_c>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(fb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return hb=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Lb(a))return b;Kb.nonEnumArgs&&a.length&&Mb(a)&&(a=Ob.call(a));var c=Kb.enumPrototypes&&"function"==typeof a,d=Kb.enumErrorProps&&(a===Fb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Kb.nonEnumShadows&&a!==Gb){var f=a.constructor,g=-1,h=rb;if(a===(f&&f.prototype))var i=a===Hb?Bb:a===Fb?wb:Cb.call(a),j=Jb[i];for(;++g<h;)e=qb[g],j&&j[e]||!Db.call(a,e)||b.push(e)}return b}function j(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 k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Cb.call(a),h=Cb.call(b);if(g==sb&&(g=zb),h==sb&&(h=zb),g!=h)return!1;switch(g){case ub:case vb:return+a==+b;case yb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ab:case Bb:return a==String(b)}var i=g==tb;if(!i){if(g!=zb||!Kb.nodeClass&&(l(a)||l(b)))return!1;var j=!Kb.argsObject&&Mb(a)?Object:a.constructor,n=!Kb.argsObject&&Mb(b)?Object:b.constructor;if(!(j==n||Db.call(a,"constructor")&&Db.call(b,"constructor")||cb(j)&&j instanceof j&&cb(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Db.call(f,e)?(p++,q=Db.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Db.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Ob.call(a)}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a,b){this.id=a,this.value=b}function q(){this._s=s}function r(){this._s=s,this._l=s.length,this._i=0}function t(a){this._a=a}function u(a){this._a=a,this._l=y(a),this._i=0}function v(a){return"number"==typeof a&&Q.isFinite(a)}function w(b){var c,d=b[kb];if(!d&&"string"==typeof b)return c=new q(b),c[kb]();if(!d&&b.length!==a)return c=new t(b),c[kb]();if(!d)throw new TypeError("Object is not iterable");return b[kb]()}function x(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function y(a){var b=+a.length;return isNaN(b)?0:0!==b&&v(b)?(b=x(b)*Math.floor(Math.abs(b)),0>=b?0:b>Cc?Cc:b):b}function z(a,b){return X(a)||(a=fc),new Tc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function A(a,b){return new Tc(function(c){var d=new $b,e=new _b;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)}bb(f)&&(f=Mc(f)),d=new $b,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e},a)}function B(a,b){var c=this;return new Tc(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()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function C(a,b,c){var d=pb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return bb(e)&&(e=Mc(e)),(nb(e)||mb(e))&&(e=Dc(e)),e}).concatAll()}function D(a,b,c){var d=pb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return bb(e)&&(e=Mc(e)),(nb(e)||mb(e))&&(e=Dc(e)),e}).mergeAll()}function E(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=Q.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 F(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Yb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(E(a))};return a.attachEvent("on"+b,d),Yb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Yb(function(){a["on"+b]=null})}function G(a,b,c){var d=new Vb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(G(a.item(e),b,c));else a&&d.add(F(a,b,c));return d}function H(a,b){return new Tc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function I(a,b,c){return new Tc(function(d){var e=0,f=a,g=cc(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 J(a,b){return new Tc(function(c){return b.scheduleWithRelative(cc(a),function(){c.onNext(0),c.onCompleted()})})}function K(a,b,c){return a===b?new Tc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Ac(function(){return I(c.now()+a,b,c)})}function L(a,b,c){return new Tc(function(d){var e,f=!1,g=new _b,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 $b,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 Vb(e,g)},a)}function M(a,b,c){return Ac(function(){return L(a,b-c.now(),c)})}function N(a,b){return new Tc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Vb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))},a)}function O(a,b,c){return new Tc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(Y))){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 Vb(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)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q=P[typeof window]&&window||this,R=P[typeof exports]&&exports&&!exports.nodeType&&exports,S=P[typeof module]&&module&&!module.nodeType&&module,T=S&&S.exports===R&&R,U=P[typeof global]&&global;!U||U.global!==U&&U.window!==U||(Q=U);var V={internals:{},config:{Promise:Q.Promise},helpers:{}},W=V.helpers.noop=function(){},X=(V.helpers.notDefined=function(a){return"undefined"==typeof a},V.helpers.isScheduler=function(a){return a instanceof V.Scheduler}),Y=V.helpers.identity=function(a){return a},Z=(V.helpers.pluck=function(a){return function(b){return b[a]}},V.helpers.just=function(a){return function(){return a}},V.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),$=V.helpers.defaultComparer=function(a,b){return Nb(a,b)},_=V.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ab=(V.helpers.defaultKeySerializer=function(a){return a.toString()},V.helpers.defaultError=function(a){throw a}),bb=V.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},cb=(V.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},V.helpers.not=function(a){return!a},V.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Cb.call(a)}),a}()),db="Argument out of range",eb="Object has been disposed";V.config.longStackSupport=!1;var fb=!1;try{throw new Error}catch(gb){fb=!!gb.stack}var hb,ib=g(),jb="From previous event:",kb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Q.Set&&"function"==typeof(new Q.Set)["@@iterator"]&&(kb="@@iterator");var lb=V.doneEnumerator={done:!0,value:a},mb=V.helpers.isIterable=function(b){return b[kb]!==a},nb=V.helpers.isArrayLike=function(b){return b&&b.length!==a};V.helpers.iterator=kb;var ob,pb=V.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},qb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],rb=qb.length,sb="[object Arguments]",tb="[object Array]",ub="[object Boolean]",vb="[object Date]",wb="[object Error]",xb="[object Function]",yb="[object Number]",zb="[object Object]",Ab="[object RegExp]",Bb="[object String]",Cb=Object.prototype.toString,Db=Object.prototype.hasOwnProperty,Eb=Cb.call(arguments)==sb,Fb=Error.prototype,Gb=Object.prototype,Hb=String.prototype,Ib=Gb.propertyIsEnumerable;try{ob=!(Cb.call(document)==zb&&!({toString:0}+""))}catch(gb){ob=!0}var Jb={};Jb[tb]=Jb[vb]=Jb[yb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Jb[ub]=Jb[Bb]={constructor:!0,toString:!0,valueOf:!0},Jb[wb]=Jb[xb]=Jb[Ab]={constructor:!0,toString:!0},Jb[zb]={constructor:!0};var Kb={};!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);Kb.enumErrorProps=Ib.call(Fb,"message")||Ib.call(Fb,"name"),Kb.enumPrototypes=Ib.call(a,"prototype"),Kb.nonEnumArgs=0!=c,Kb.nonEnumShadows=!/valueOf/.test(b)}(1);var Lb=V.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Mb=function(a){return a&&"object"==typeof a?Cb.call(a)==sb:!1};Eb||(Mb=function(a){return a&&"object"==typeof a?Db.call(a,"callee"):!1});{var Nb=V.internals.isEqual=function(a,b){return m(a,b,[],[])},Ob=Array.prototype.slice,Pb=({}.hasOwnProperty,this.inherits=V.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Qb=V.internals.addProperties=function(a){for(var b=Ob.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};V.internals.addRef=function(a,b){return new Tc(function(c){return new Vb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Ob.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(Ob.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Ob.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 Rb=Object("a"),Sb="a"!=Rb[0]||!(0 in Rb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Sb&&{}.toString.call(this)==Bb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=xb)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=Sb&&{}.toString.call(this)==Bb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=xb)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)==tb}),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}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;rb>e;e++)a.call(c,qb[e])&&f.push(qb[e]);return f}}()),p.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Tb=V.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ub=Tb.prototype;Ub.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ub.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)}}},Ub.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)}}},Ub.peek=function(){return this.items[0].value},Ub.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ub.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ub.enqueue=function(a){var b=this.length++;this.items[b]=new p(Tb.count++,a),this.percolate(b)},Ub.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Tb.count=0;var Vb=V.CompositeDisposable=function(){this.disposables=n(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Wb=Vb.prototype;Wb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Wb.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},Wb.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()}},Wb.toArray=function(){return this.disposables.slice(0)};var Xb=V.Disposable=function(a){this.isDisposed=!1,this.action=a||W};Xb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Yb=Xb.create=function(a){return new Xb(a)},Zb=Xb.empty={dispose:W},$b=V.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}(),_b=V.SerialDisposable=$b,ac=(V.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?Zb:new a(this)},b}(),V.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||_,this.disposable=new $b});ac.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ac.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ac.prototype.isCancelled=function(){return this.disposable.isDisposed},ac.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var bc=V.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(),Zb}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=Z,a.normalize=function(a){return 0>a&&(a=0),a},a}(),cc=bc.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Vb,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),Zb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Vb,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),Zb});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")})}}(bc.prototype),function(){bc.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},bc.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Q.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=Q.setInterval(function(){d=c(d)},b);return Yb(function(){Q.clearInterval(e)})}}(bc.prototype);var dc,ec=bc.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=this.now()+cc(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new bc(Z,a,b,c)}(),fc=bc.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-bc.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()+bc.normalize(c),g=new ac(this,b,d,f);if(e)e.enqueue(g);else{e=new Tb(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 bc(Z,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),gc=(V.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 $b;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),W),hc=function(){var a,b=W;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!Q.setTimeout)throw new Error("No concurrency detected!");a=Q.setTimeout,b=Q.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),ic=hc.setTimeout,jc=hc.clearTimeout;!function(){function a(){if(!Q.postMessage||Q.importScripts)return!1;var a=!1,b=Q.onmessage;return Q.onmessage=function(){a=!0},Q.postMessage("","*"),Q.onmessage=b,a}var b=RegExp("^"+String(Cb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=U&&T&&U.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=U&&T&&U.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)dc=c,gc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))dc=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};Q.addEventListener?Q.addEventListener("message",h,!1):Q.attachEvent("onmessage",h,!1),dc=function(a){var b=g++;f[b]=a,Q.postMessage(e+b,"*")}}else if(Q.MessageChannel){var i=new Q.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},dc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in Q&&"onreadystatechange"in Q.document.createElement("script")?dc=function(a){var b=Q.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},Q.document.documentElement.appendChild(b)}:(dc=function(a){return ic(a,0)},gc=jc)}();var kc=bc.timeout=function(){function a(a,b){var c=this,d=new $b,e=dc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Vb(d,Yb(function(){gc(e)}))}function b(a,b,c){var d=this,e=bc.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new $b,g=ic(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Vb(f,Yb(function(){jc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new bc(Z,a,b,c)}(),lc=V.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 X(a)||(a=ec),new Tc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),mc=lc.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 lc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),nc=lc.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 lc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),oc=lc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new lc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),pc=V.internals.Enumerator=function(a){this._next=a};pc.prototype.next=function(){return this._next()},pc.prototype[kb]=function(){return this};var qc=V.internals.Enumerable=function(a){this._iterator=a};qc.prototype[kb]=function(){return this._iterator()},qc.prototype.concat=function(){var a=this;return new Tc(function(b){var c;try{c=a[kb]()}catch(d){return void b.onError(d)}var e,f=new _b,g=ec.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;bb(h)&&(h=Mc(h));var i=new $b;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Vb(f,g,Yb(function(){e=!0}))})},qc.prototype.catchError=function(){var a=this;return new Tc(function(b){var c;try{c=a[kb]()}catch(d){return void b.onError(d)}var e,f,g=new _b,h=ec.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;bb(i)&&(i=Mc(i));var j=new $b;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Vb(g,h,Yb(function(){e=!0}))})},qc.prototype.catchErrorWhen=function(a){var b=this;return new Tc(function(c){var d,e=new Wc,f=a(e),g=new Wc,h=f.subscribe(g);try{d=b[kb]()}catch(i){return void c.onError(i)}var j,k,l=new _b,m=ec.scheduleRecursive(function(a){if(!j){var b;try{b=d.next()}catch(f){return void c.onError(f)}if(b.done)return void(k?c.onError(k):c.onCompleted());var h=b.value;bb(h)&&(h=Mc(h));var i=new $b,m=new $b;l.setDisposable(new Vb(m,i)),i.setDisposable(h.subscribe(c.onNext.bind(c),function(b){m.setDisposable(g.subscribe(function(){a()},function(a){c.onError(a)},function(){c.onCompleted()})),e.onNext(b)},c.onCompleted.bind(c)))}});return new Vb(h,l,m,Yb(function(){j=!0}))})};var rc,sc=qc.repeat=function(a,b){return null==b&&(b=-1),new qc(function(){var c=b;return new pc(function(){return 0===c?lb:(c>0&&c--,{done:!1,value:a})})})},tc=qc.of=function(a,b,c){return b||(b=Y),new qc(function(){var d=-1;return new pc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:lb})})},uc=V.Observer=function(){},vc=uc.create=function(a,b,c){return a||(a=W),b||(b=ab),c||(c=W),new xc(a,b,c)},wc=V.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Pb(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}(uc),xc=V.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Pb(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}(wc),yc=V.Observable=function(){function a(a){if(V.config.longStackSupport&&fb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return rc=a.prototype,rc.subscribe=rc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:vc(a,b,c))},rc.subscribeOnNext=function(a,b){return this._subscribe(vc(2===arguments.length?function(c){a.call(b,c)}:a))},rc.subscribeOnError=function(a,b){return this._subscribe(vc(null,2===arguments.length?function(c){a.call(b,c)}:a))},rc.subscribeOnCompleted=function(a,b){return this._subscribe(vc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),zc=V.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 _b}return Pb(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}(wc);rc.toArray=function(){var a=this;return new Tc(function(b){var c=[];return a.subscribe(function(a){c.push(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},yc.create=yc.createWithDisposable=function(a,b){return new Tc(a,b)};var Ac=yc.defer=function(a){return new Tc(function(b){var c;try{c=a()}catch(d){return Gc(d).subscribe(b)}return bb(c)&&(c=Mc(c)),c.subscribe(b)})},Bc=yc.empty=function(a){return X(a)||(a=ec),new Tc(function(b){return a.schedule(function(){b.onCompleted()})})},Cc=Math.pow(2,53)-1;q.prototype[kb]=function(){return new r(this._s)},r.prototype[kb]=function(){return this},r.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return lb},t.prototype[kb]=function(){return new u(this._a)},u.prototype[kb]=function(){return this},u.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return lb};{var Dc=yc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!cb(b))throw new Error("mapFn when provided must be a function");if(b)var e=pb(b,c,2);X(d)||(d=fc);var f=Object(a),g=w(f);return new Tc(function(a){var b=0;return d.scheduleRecursive(function(c){var d;try{d=g.next()}catch(f){return void a.onError(f)}if(d.done)return void a.onCompleted();var h=d.value;if(e)try{h=e(h,b)}catch(f){return void a.onError(f)}a.onNext(h),b++,c()})})},Ec=yc.fromArray=function(a,b){return X(b)||(b=fc),new Tc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};yc.never=function(){return new Tc(function(){return Zb})}}yc.of=function(){return z(null,arguments)},yc.ofWithScheduler=function(a){return z(a,Ob.call(arguments,1))},yc.pairs=function(a,b){return b||(b=V.Scheduler.currentThread),new Tc(function(c){var d=0,e=Object.keys(a),f=e.length;return b.scheduleRecursive(function(b){if(f>d){var g=e[d++];c.onNext([g,a[g]]),b()}else c.onCompleted()})})},yc.range=function(a,b,c){return X(c)||(c=fc),new Tc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},yc.repeat=function(a,b,c){return X(c)||(c=fc),Fc(a,c).repeat(null==b?-1:b)};var Fc=yc["return"]=yc.just=function(a,b){return X(b)||(b=ec),new Tc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};yc.returnValue=function(){return Fc.apply(null,arguments)};var Gc=yc["throw"]=yc.throwError=function(a,b){return X(b)||(b=ec),new Tc(function(c){return b.schedule(function(){c.onError(a)})})};yc.throwException=function(){return yc.throwError.apply(null,arguments)},rc["catch"]=rc.catchError=function(a){return"function"==typeof a?A(this,a):Hc([this,a])},rc.catchException=function(a){return this.catchError(a)
};var Hc=yc.catchError=yc["catch"]=function(){return tc(n(arguments,0)).catchError()};yc.catchException=function(){return Hc.apply(null,arguments)},rc.combineLatest=function(){var a=Ob.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Ic.apply(this,a)};var Ic=yc.combineLatest=function(){var a=Ob.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Tc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(Y))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(Y)&&c.onCompleted()}function e(a){j[a]=!0,j.every(Y)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=o(g,f),i=!1,j=o(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new $b;bb(f)&&(f=Mc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},function(a){c.onError(a)},function(){e(b)})),l[b]=g}(m);return new Vb(l)},this)};rc.concat=function(){var a=Ob.call(arguments,0);return a.unshift(this),Jc.apply(this,a)};var Jc=yc.concat=function(){return tc(n(arguments,0)).concat()};rc.concatAll=function(){return this.merge(1)},rc.concatObservable=function(){return this.merge(1)},rc.merge=function(a){if("number"!=typeof a)return Kc(this,a);var b=this;return new Tc(function(c){function d(a){var b=new $b;f.add(b),bb(a)&&(a=Mc(a)),b.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){c.onError(a)},function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Vb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},function(a){c.onError(a)},function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Kc=yc.merge=function(){var a,b;return arguments[0]?X(arguments[0])?(a=arguments[0],b=Ob.call(arguments,1)):(a=ec,b=Ob.call(arguments,0)):(a=ec,b=Ob.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),z(a,b).mergeAll()};rc.mergeAll=function(){var a=this;return new Tc(function(b){var c=new Vb,d=!1,e=new $b;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new $b;c.add(e),bb(a)&&(a=Mc(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},function(a){b.onError(a)},function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},rc.mergeObservable=function(){return this.mergeAll.apply(this,arguments)},rc.skipUntil=function(a){var b=this;return new Tc(function(c){var d=!1,e=new Vb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));bb(a)&&(a=Mc(a));var f=new $b;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},rc["switch"]=rc.switchLatest=function(){var a=this;return new Tc(function(b){var c=!1,d=new _b,e=!1,f=0,g=a.subscribe(function(a){var g=new $b,h=++f;c=!0,d.setDisposable(g),bb(a)&&(a=Mc(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 Vb(g,d)},a)},rc.takeUntil=function(a){var b=this;return new Tc(function(c){return bb(a)&&(a=Mc(a)),new Vb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},W))},b)},rc.withLatestFrom=function(){var a=this,b=Ob.call(arguments),c=b.pop();if("undefined"==typeof a)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof c)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new Tc(function(d){for(var e=function(){return!1},f=b.length,g=o(f,e),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(a){var c=b[a],e=new $b;bb(c)&&(c=Mc(c)),e.setDisposable(c.subscribe(function(b){i[a]=b,g[a]=!0,h=g.every(Y)},d.onError.bind(d),function(){})),j[a]=e}(k);var l=new $b;return l.setDisposable(a.subscribe(function(a){var b,e=[a].concat(i);if(h){try{b=c.apply(null,e)}catch(f){return void d.onError(f)}d.onNext(b)}},d.onError.bind(d),function(){d.onCompleted()})),j[f]=l,new Vb(j)},this)},rc.zip=function(){if(Array.isArray(arguments[0]))return B.apply(this,arguments);var a=this,b=Ob.call(arguments),c=b.pop();return b.unshift(a),new Tc(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(Y)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=o(g,function(){return[]}),i=o(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new $b;bb(c)&&(c=Mc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},function(a){d.onError(a)},function(){f(a)})),j[a]=g}(k);return new Vb(j)},a)},yc.zip=function(){var a=Ob.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},yc.zipArray=function(){var a=n(arguments,0);return new Tc(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(Y))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Y)?void b.onCompleted():void 0}for(var e=a.length,f=o(e,function(){return[]}),g=o(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new $b,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new Vb(h)})},rc.asObservable=function(){var a=this;return new Tc(function(b){return a.subscribe(b)},this)},rc.dematerialize=function(){var a=this;return new Tc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},rc.distinctUntilChanged=function(a,b){var c=this;return a||(a=Y),b||(b=$),new Tc(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))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},rc["do"]=rc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=function(b){a.onNext(b)},b=function(b){a.onError(b)},c=function(){a.onCompleted()}),new Tc(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()})},this)},rc.doAction=function(){return this.tap.apply(this,arguments)},rc.doOnNext=rc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},rc.doOnError=rc.tapOnError=function(a,b){return this.tap(W,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},rc.doOnCompleted=rc.tapOnCompleted=function(a,b){return this.tap(W,null,"undefined"!=typeof b?function(){a.call(b)}:a)},rc["finally"]=rc.ensure=function(a){var b=this;return new Tc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Yb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},rc.finallyAction=function(a){return this.ensure(a)},rc.ignoreElements=function(){var a=this;return new Tc(function(b){return a.subscribe(W,function(a){b.onError(a)},function(){b.onCompleted()})},a)},rc.materialize=function(){var a=this;return new Tc(function(b){return a.subscribe(function(a){b.onNext(mc(a))},function(a){b.onNext(nc(a)),b.onCompleted()},function(){b.onNext(oc()),b.onCompleted()})},a)},rc.repeat=function(a){return sc(this,a).concat()},rc.retry=function(a){return sc(this,a).catchError()},rc.retryWhen=function(a){return sc(this).catchErrorWhen(a)},rc.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 Tc(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)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},rc.skipLast=function(a){var b=this;return new Tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},rc.startWith=function(){var a,b,c=0;return arguments.length&&X(arguments[0])?(b=arguments[0],c=1):b=ec,a=Ob.call(arguments,c),tc([Ec(a,b),this]).concat()},rc.takeLast=function(a){var b=this;return new Tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},rc.selectConcat=rc.concatMap=function(a,b,c){return cb(a)&&cb(b)?this.concatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Mc(e)),(nb(e)||mb(e))&&(e=Dc(e)),e.map(function(a,e){return b(c,a,d,e)})}):cb(a)?C(this,a,c):C(this,function(){return a})},rc.select=rc.map=function(a,b){var c=cb(a)?pb(a,b,3):function(){return a},d=this;return new Tc(function(a){var b=0;return d.subscribe(function(e){try{var f=c(e,b++,d)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},d)},rc.pluck=function(a){return this.map(function(b){return b[a]})},rc.selectMany=rc.flatMap=function(a,b,c){return cb(a)&&cb(b)?this.flatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Mc(e)),(nb(e)||mb(e))&&(e=Dc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):cb(a)?D(this,a,c):D(this,function(){return a})},rc.selectSwitch=rc.flatMapLatest=rc.switchMap=function(a,b){return this.select(a,b).switchLatest()},rc.skip=function(a){if(0>a)throw new Error(db);var b=this;return new Tc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},rc.skipWhile=function(a,b){var c=this,d=pb(a,b,3);return new Tc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},rc.take=function(a,b){if(0>a)throw new RangeError(db);if(0===a)return Bc(b);var c=this;return new Tc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},rc.takeWhile=function(a,b){var c=this,d=pb(a,b,3);return new Tc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)},rc.where=rc.filter=function(a,b){var c=this;return a=pb(a,b,3),new Tc(function(b){var d=0;return c.subscribe(function(e){try{var f=a(e,d++,c)}catch(g){return void b.onError(g)}f&&b.onNext(e)},function(a){b.onError(a)},function(){b.onCompleted()})},c)},yc.fromCallback=function(a,b,c){return function(){var d=Ob.call(arguments,0);return new Tc(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return void e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},yc.fromNodeCallback=function(a,b,c){return function(){var d=Ob.call(arguments,0);return new Tc(function(e){function f(a){if(a)return void e.onError(a);var b=Ob.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()}},V.config.useNativeEvents=!1,yc.fromEvent=function(a,b,c){if(a.addListener)return Lc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!V.config.useNativeEvents){if("function"==typeof a.on&&"function"==typeof a.off)return Lc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Q.Ember&&"function"==typeof Q.Ember.addListener)return Lc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c)}return new Tc(function(d){return G(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 Lc=yc.fromEventPattern=function(a,b,c){return new Tc(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 Yb(function(){b&&b(e,f)})}).publish().refCount()},Mc=yc.fromPromise=function(a){return Ac(function(){var b=new V.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};rc.toPromise=function(a){if(a||(a=V.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)})})},yc.startAsync=function(a){var b;try{b=a()}catch(c){return Gc(c)}return Mc(b)},rc.multicast=function(a,b){var c=this;return"function"==typeof a?new Tc(function(d){var e=c.multicast(a());return new Vb(b(e).subscribe(d),e.connect())},c):new Nc(c,a)},rc.publish=function(a){return a&&cb(a)?this.multicast(function(){return new Wc},a):this.multicast(new Wc)},rc.share=function(){return this.publish().refCount()},rc.publishLast=function(a){return a&&cb(a)?this.multicast(function(){return new Xc},a):this.multicast(new Xc)},rc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Zc(b)},a):this.multicast(new Zc(a))},rc.shareValue=function(a){return this.publishValue(a).refCount()},rc.replay=function(a,b,c,d){return a&&cb(a)?this.multicast(function(){return new $c(b,c,d)},a):this.multicast(new $c(b,c,d))},rc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Nc=V.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Vb(f.subscribe(c),Yb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Pb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Tc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(yc),Oc=yc.interval=function(a,b){return K(a,a,X(b)?b:kc)};yc.timer=function(b,c,d){var e;return X(d)||(d=kc),c!==a&&"number"==typeof c?e=c:X(c)&&(d=c),b instanceof Date&&e===a?H(b.getTime(),d):b instanceof Date&&e!==a?(e=c,I(b.getTime(),e,d)):e===a?J(b,d):K(b,e,d)}}rc.delay=function(a,b){return X(b)||(b=kc),a instanceof Date?M(this,a.getTime(),b):L(this,a,b)},rc.debounce=rc.throttleWithTimeout=function(a,b){X(b)||(b=kc);var c=this;return new Tc(function(d){var e,f=new _b,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new $b;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 Vb(i,f)},this)},rc.throttle=function(a,b){return this.debounce(a,b)},rc.timestamp=function(a){return X(a)||(a=kc),this.map(function(b){return{value:b,timestamp:a.now()}})},rc.sample=rc.throttleLatest=function(a,b){return X(b)||(b=kc),"number"==typeof a?N(this,Oc(a,b)):N(this,a)},rc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Gc(new Error(b||"Timeout"))),X(c)||(c=kc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Tc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(bb(b)&&(b=Mc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new $b,j=new _b,k=!1,l=new _b;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 Vb(j,l)},d)},rc.throttleFirst=function(a,b){X(b)||(b=kc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Tc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var Pc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Zb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Zb)});return new Vb(c,d,e)}function c(c,d){this.source=c,this.controller=new Wc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return Pb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(yc);rc.pausable=function(a){return new Pc(this,a)};var Qc=function(b){function c(b){var c,d=[],e=O(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 Wc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return Pb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(yc);rc.pausableBuffered=function(a){return new Qc(this,a)};var Rc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new Sc(d),this.source=c.multicast(this.subject).refCount()}return Pb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(yc),Sc=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new Wc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=Zb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Zb}return Pb(c,a),Qb(c.prototype,uc,{onCompleted:function(){this.hasCompleted=!0,(!this.enableQueue||0===this.queue.length)&&this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,(!this.enableQueue||0===this.queue.length)&&this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&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=Zb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Zb),{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?Zb:(this.requestedCount=a,this.requestedDisposable=Yb(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Zb}}),c}(yc);rc.controlled=function(a){return null==a&&(a=!0),new Rc(this,a)},rc.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 Tc(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)})},c)};var Tc=V.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Yb(a):Zb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Uc(a);return fc.scheduleRequired()?fc.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Pb(c,a),c}(yc),Uc=function(a){function b(b){a.call(this),this.observer=b,this.m=new $b}Pb(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.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(wc),Vc=function(a,b){this.subject=a,this.observer=b};Vc.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 Wc=V.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.hasError?(a.onError(this.error),Zb):(a.onCompleted(),Zb):(this.observers.push(a),new Vc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Pb(d,a),Qb(d.prototype,uc.prototype,{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.length=0}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.error=a,this.hasError=!0;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers.length=0}},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 Yc(a,b)},d}(yc),Xc=V.AsyncSubject=function(a){function c(a){return b.call(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Zb):(this.observers.push(a),new Vc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Pb(d,a),Qb(d.prototype,uc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c;if(b.call(this),!this.isStopped){this.isStopped=!0;var d=this.observers.slice(0),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers.length=0}},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}(yc),Yc=V.AnonymousSubject=function(a){function b(a){this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Pb(c,a),Qb(c.prototype,uc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(yc),Zc=V.BehaviorSubject=function(a){function c(a){return b.call(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Zb):(this.observers.push(a),a.onNext(this.value),new Vc(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Pb(d,a),Qb(d.prototype,uc,{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.length=0}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},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}(yc),$c=V.ReplaySubject=function(a){function c(a,b){return Yb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new zc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),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||fc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Pb(e,a),Qb(e.prototype,uc.prototype,{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}(yc);V.Pauser=function(a){function b(){a.call(this)}return Pb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Wc),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Q.Rx=V,define(function(){return V})):R&&S?T?(S.exports=V).Rx=V:R.Rx=V:Q.Rx=V;var _c=g()}).call(this);
//# sourceMappingURL=rx.lite.compat.map