/** * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. * Original file: /npm/rxjs@7.5.6/dist/esm5/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ import{__values as n,__spreadArray as t,__read as r,__extends as e,__asyncGenerator as u,__generator as i,__await as o,__awaiter as c,__asyncValues as s}from"/npm/tslib@2.6.2/+esm";function f(n){return"function"==typeof n}function l(n){var t=n((function(n){Error.call(n),n.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var a=l((function(n){return function(t){n(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(n,t){return t+1+") "+n.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function v(n,t){if(n){var r=n.indexOf(t);0<=r&&n.splice(r,1)}}var h=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,u,i,o,c;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var l=n(s),v=l.next();!v.done;v=l.next()){v.value.remove(this)}}catch(n){e={error:n}}finally{try{v&&!v.done&&(u=l.return)&&u.call(l)}finally{if(e)throw e.error}}else s.remove(this);var h=this.initialTeardown;if(f(h))try{h()}catch(n){c=n instanceof a?n.errors:[n]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=n(d),y=p.next();!y.done;y=p.next()){var m=y.value;try{b(m)}catch(n){c=null!=c?c:[],n instanceof a?c=t(t([],r(c)),r(n.errors)):c.push(n)}}}catch(n){i={error:n}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}if(c)throw new a(c)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)b(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&v(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&v(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}(),d=h.EMPTY;function p(n){return n instanceof h||n&&"closed"in n&&f(n.remove)&&f(n.add)&&f(n.unsubscribe)}function b(n){f(n)?n():n.unsubscribe()}var y={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},m={setTimeout:function(n,e){for(var u=[],i=2;i0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},r.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},r.prototype._innerSubscribe=function(n){var t=this,r=this,e=r.hasError,u=r.isStopped,i=r.observers;return e||u?d:(this.currentObservers=null,i.push(n),new h((function(){t.currentObservers=null,v(i,n)})))},r.prototype._checkFinalizedStatuses=function(n){var t=this,r=t.hasError,e=t.thrownError,u=t.isStopped;r?n.error(e):u&&n.complete()},r.prototype.asObservable=function(){var n=new L;return n.source=this,n},r.create=function(n,t){return new $(n,t)},r}(L),$=function(n){function t(t,r){var e=n.call(this)||this;return e.destination=t,e.source=r,e}return e(t,n),t.prototype.next=function(n){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,n)},t.prototype.error=function(n){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,n)},t.prototype.complete=function(){var n,t;null===(t=null===(n=this.destination)||void 0===n?void 0:n.complete)||void 0===t||t.call(n)},t.prototype._subscribe=function(n){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(n))&&void 0!==r?r:d},t}(Q),nn=function(n){function t(t){var r=n.call(this)||this;return r._value=t,r}return e(t,n),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=n.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var n=this,t=n.hasError,r=n.thrownError,e=n._value;if(t)throw r;return this._throwIfClosed(),e},t.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},t}(Q),tn={now:function(){return(tn.delegate||Date).now()},delegate:void 0},rn=function(n){function t(t,r,e){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===e&&(e=tn);var u=n.call(this)||this;return u._bufferSize=t,u._windowTime=r,u._timestampProvider=e,u._buffer=[],u._infiniteTimeWindow=!0,u._infiniteTimeWindow=r===1/0,u._bufferSize=Math.max(1,t),u._windowTime=Math.max(1,r),u}return e(t,n),t.prototype.next=function(t){var r=this,e=r.isStopped,u=r._buffer,i=r._infiniteTimeWindow,o=r._timestampProvider,c=r._windowTime;e||(u.push(t),!i&&u.push(o.now()+c)),this._trimBuffer(),n.prototype.next.call(this,t)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(n),r=this._infiniteTimeWindow,e=this._buffer.slice(),u=0;u0?n.prototype.requestAsyncId.call(this,t,r,e):(t.actions.push(this),t._scheduled||(t._scheduled=dn.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,e){if(void 0===e&&(e=0),null!=e&&e>0||null==e&&this.delay>0)return n.prototype.recycleAsyncId.call(this,t,r,e);t.actions.some((function(n){return n.id===r}))||(dn.clearImmediate(r),t._scheduled=void 0)},t}(sn),bn=function(){function n(t,r){void 0===r&&(r=n.now),this.schedulerActionCtor=t,this.now=r}return n.prototype.schedule=function(n,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,n).schedule(r,t)},n.now=tn.now,n}(),yn=function(n){function t(t,r){void 0===r&&(r=bn.now);var e=n.call(this,t,r)||this;return e.actions=[],e._active=!1,e._scheduled=void 0,e}return e(t,n),t.prototype.flush=function(n){var t=this.actions;if(this._active)t.push(n);else{var r;this._active=!0;do{if(r=n.execute(n.state,n.delay))break}while(n=t.shift());if(this._active=!1,r){for(;n=t.shift();)n.unsubscribe();throw r}}},t}(bn),mn=new(function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return e(t,n),t.prototype.flush=function(n){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,e=this.actions;n=n||e.shift();do{if(r=n.execute(n.state,n.delay))break}while((n=e[0])&&n.id===t&&e.shift());if(this._active=!1,r){for(;(n=e[0])&&n.id===t&&e.shift();)n.unsubscribe();throw r}},t}(yn))(pn),wn=mn,xn=new yn(sn),gn=xn,_n=function(n){function t(t,r){var e=n.call(this,t,r)||this;return e.scheduler=t,e.work=r,e}return e(t,n),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?n.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?n.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,e){return void 0===e&&(e=0),null!=e&&e>0||null==e&&this.delay>0?n.prototype.requestAsyncId.call(this,t,r,e):t.flush(this)},t}(sn),En=new(function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return e(t,n),t}(yn))(_n),Sn=En,An=function(n){function t(t,r){var e=n.call(this,t,r)||this;return e.scheduler=t,e.work=r,e}return e(t,n),t.prototype.requestAsyncId=function(t,r,e){return void 0===e&&(e=0),null!==e&&e>0?n.prototype.requestAsyncId.call(this,t,r,e):(t.actions.push(this),t._scheduled||(t._scheduled=B.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,e){if(void 0===e&&(e=0),null!=e&&e>0||null==e&&this.delay>0)return n.prototype.recycleAsyncId.call(this,t,r,e);t.actions.some((function(n){return n.id===r}))||(B.cancelAnimationFrame(r),t._scheduled=void 0)},t}(sn),On=new(function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return e(t,n),t.prototype.flush=function(n){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,e=this.actions;n=n||e.shift();do{if(r=n.execute(n.state,n.delay))break}while((n=e[0])&&n.id===t&&e.shift());if(this._active=!1,r){for(;(n=e[0])&&n.id===t&&e.shift();)n.unsubscribe();throw r}},t}(yn))(An),In=On,Tn=function(n){function t(t,r){void 0===t&&(t=Cn),void 0===r&&(r=1/0);var e=n.call(this,t,(function(){return e.frame}))||this;return e.maxFrames=r,e.frame=0,e.index=-1,e}return e(t,n),t.prototype.flush=function(){for(var n,t,r=this.actions,e=this.maxFrames;(t=r[0])&&t.delay<=e&&(r.shift(),this.frame=t.delay,!(n=t.execute(t.state,t.delay))););if(n){for(;t=r.shift();)t.unsubscribe();throw n}},t.frameTimeFactor=10,t}(yn),Cn=function(n){function t(t,r,e){void 0===e&&(e=t.index+=1);var u=n.call(this,t,r)||this;return u.scheduler=t,u.work=r,u.index=e,u.active=!0,u.index=t.index=e,u}return e(t,n),t.prototype.schedule=function(r,e){if(void 0===e&&(e=0),Number.isFinite(e)){if(!this.id)return n.prototype.schedule.call(this,r,e);this.active=!1;var u=new t(this.scheduler,this.work);return this.add(u),u.schedule(r,e)}return h.EMPTY},t.prototype.requestAsyncId=function(n,r,e){void 0===e&&(e=0),this.delay=n.frame+e;var u=n.actions;return u.push(this),u.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(n,t,r){},t.prototype._execute=function(t,r){if(!0===this.active)return n.prototype._execute.call(this,t,r)},t.sortActions=function(n,t){return n.delay===t.delay?n.index===t.index?0:n.index>t.index?1:-1:n.delay>t.delay?1:-1},t}(sn),kn=new L((function(n){return n.complete()}));function jn(n){return n?function(n){return new L((function(t){return n.schedule((function(){return t.complete()}))}))}(n):kn}function Pn(n){return n&&f(n.schedule)}function Nn(n){return n[n.length-1]}function Fn(n){return f(Nn(n))?n.pop():void 0}function zn(n){return Pn(Nn(n))?n.pop():void 0}function qn(n,t){return"number"==typeof Nn(n)?n.pop():t}var Ln=function(n){return n&&"number"==typeof n.length&&"function"!=typeof n};function Dn(n){return f(null==n?void 0:n.then)}function Vn(n){return f(n[N])}function Rn(n){return Symbol.asyncIterator&&f(null==n?void 0:n[Symbol.asyncIterator])}function Un(n){return new TypeError("You provided "+(null!==n&&"object"==typeof n?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Mn,Yn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Wn(n){return f(null==n?void 0:n[Yn])}function Hn(n){return u(this,arguments,(function(){var t,r,e;return i(this,(function(u){switch(u.label){case 0:t=n.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,o(t.read())];case 3:return r=u.sent(),e=r.value,r.done?[4,o(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,o(e)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Bn(n){return f(null==n?void 0:n.getReader)}function Zn(t){if(t instanceof L)return t;if(null!=t){if(Vn(t))return i=t,new L((function(n){var t=i[N]();if(f(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ln(t))return u=t,new L((function(n){for(var t=0;t0&&a(u)}),void 0,void 0,(function(){(null==i?void 0:i.closed)||null==i||i.unsubscribe(),c=null}))),!f&&a(null!=e?"number"==typeof e?e:+e-s.now():u)}))}function bt(n){throw new dt(n)}function yt(n,t){return R((function(r,e){var u=0;r.subscribe(U(e,(function(r){e.next(n.call(t,r,u++))})))}))}var mt=Array.isArray;function wt(n){return yt((function(e){return function(n,e){return mt(e)?n.apply(void 0,t([],r(e))):n(e)}(n,e)}))}function xt(n,e,u,i){if(u){if(!Pn(u))return function(){for(var t=[],r=0;r0){var n=void 0;try{n=Zn(i.shift())}catch(n){return void o()}var t=U(e,void 0,x,x);n.subscribe(t),t.add(o)}else e.complete()};o()}))}(tr(n))(kn)}function er(n,t){return tt(Object.entries(n),t)}function ur(n,t){return function(r,e){return!n.call(t,r,e)}}function ir(n,t){return R((function(r,e){var u=0;r.subscribe(U(e,(function(r){return n.call(t,r,u++)&&e.next(r)})))}))}function or(n,t,r){return[ir(t,r)(Zn(n)),ir(ur(t,r))(Zn(n))]}function cr(){for(var n=[],t=0;t=0?Gn(e,o,l,c,!0):i=!0,l();var a=U(e,(function(t){var r,e,i=u.slice();try{for(var o=n(i),c=o.next();!c.done;c=o.next()){var l=c.value,a=l.buffer;a.push(t),s<=a.length&&f(l)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(e=o.return)&&e.call(o)}finally{if(r)throw r.error}}}),(function(){for(;null==u?void 0:u.length;)e.next(u.shift().buffer);null==a||a.unsubscribe(),e.complete(),e.unsubscribe()}),void 0,(function(){return u=null}));r.subscribe(a)}))}function yr(t,r){return R((function(e,u){var i=[];Zn(t).subscribe(U(u,(function(n){var t=[];i.push(t);var e=new h;e.add(Zn(r(n)).subscribe(U(u,(function(){v(i,t),u.next(t),e.unsubscribe()}),x)))}),x)),e.subscribe(U(u,(function(t){var r,e;try{for(var u=n(i),o=u.next();!o.done;o=u.next()){o.value.push(t)}}catch(n){r={error:n}}finally{try{o&&!o.done&&(e=u.return)&&e.call(u)}finally{if(r)throw r.error}}}),(function(){for(;i.length>0;)u.next(i.shift());u.complete()})))}))}function mr(n){return R((function(t,r){var e=null,u=null,i=function(){null==u||u.unsubscribe();var t=e;e=[],t&&r.next(t),Zn(n()).subscribe(u=U(r,i,x))};i(),t.subscribe(U(r,(function(n){return null==e?void 0:e.push(n)}),(function(){e&&r.next(e),r.complete()}),void 0,(function(){return e=u=null})))}))}function wr(n){return R((function(t,r){var e,u=null,i=!1;u=t.subscribe(U(r,void 0,void 0,(function(o){e=Zn(n(o,wr(n)(t))),u?(u.unsubscribe(),u=null,e.subscribe(r)):i=!0}))),i&&(u.unsubscribe(),u=null,e.subscribe(r))}))}function xr(n,t,r,e,u){return function(i,o){var c=r,s=t,f=0;i.subscribe(U(o,(function(t){var r=f++;s=c?n(s,t,r):(c=!0,t),e&&o.next(s)}),u&&function(){c&&o.next(s),o.complete()}))}}function gr(n,t){return R(xr(n,t,arguments.length>=2,!1,!0))}var _r=function(n,t){return n.push(t),n};function Er(){return R((function(n,t){gr(_r,[])(n).subscribe(t)}))}function Sr(n,t){return z(Er(),Nt((function(t){return n(t)})),t?wt(t):F)}function Ar(n){return Sr(Ct,n)}var Or=Ar;function Ir(){for(var n=[],e=0;e=2;return function(e){return e.pipe(ir((function(t,r){return r===n})),Vr(1),r?Dr(t):Gr((function(){return new lt})))}}function Qr(){for(var n=[],e=0;e=2;return function(e){return e.pipe(n?ir((function(t,r){return n(t,r,e)})):F,Vr(1),r?Dr(t):Gr((function(){return new ct})))}}function fe(n,t,r,e){return R((function(u,i){var o;t&&"function"!=typeof t?(r=t.duration,o=t.element,e=t.connector):o=t;var c=new Map,s=function(n){c.forEach(n),n(i)},f=function(n){return s((function(t){return t.error(n)}))},l=0,a=!1,v=new M(i,(function(t){try{var u=n(t),s=c.get(u);if(!s){c.set(u,s=e?e():new Q);var h=(p=u,b=s,(y=new L((function(n){l++;var t=b.subscribe(n);return function(){t.unsubscribe(),0==--l&&a&&v.unsubscribe()}}))).key=p,y);if(i.next(h),r){var d=U(s,(function(){s.complete(),null==d||d.unsubscribe()}),void 0,void 0,(function(){return c.delete(u)}));v.add(Zn(r(h)).subscribe(d))}}s.next(o?o(t):t)}catch(n){f(n)}var p,b,y}),(function(){return s((function(n){return n.complete()}))}),f,(function(){return c.clear()}),(function(){return a=!0,0===l}));u.subscribe(v)}))}function le(){return R((function(n,t){n.subscribe(U(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}function ae(t){return t<=0?function(){return kn}:R((function(r,e){var u=[];r.subscribe(U(e,(function(n){u.push(n),t=2;return function(e){return e.pipe(n?ir((function(t,r){return n(t,r,e)})):F,ae(1),r?Dr(t):Gr((function(){return new ct})))}}function he(){return R((function(n,t){n.subscribe(U(t,(function(n){t.next(ut.createNext(n))}),(function(){t.next(ut.createComplete()),t.complete()}),(function(n){t.next(ut.createError(n)),t.complete()})))}))}function de(n){return gr(f(n)?function(t,r){return n(t,r)>0?t:r}:function(n,t){return n>t?n:t})}var pe=Nt;function be(n,t,r){return void 0===r&&(r=1/0),f(t)?Nt((function(){return n}),t,r):("number"==typeof t&&(r=t),Nt((function(){return n}),r))}function ye(n,t,r){return void 0===r&&(r=1/0),R((function(e,u){var i=t;return Pt(e,u,(function(t,r){return n(i,t,r)}),r,(function(n){i=n}),!1,void 0,(function(){return i=null}))}))}function me(){for(var n=[],e=0;e=2,!0))}function qe(n,t){return void 0===t&&(t=function(n,t){return n===t}),R((function(r,e){var u={buffer:[],complete:!1},i={buffer:[],complete:!1},o=function(n){e.next(n),e.complete()},c=function(n,r){var u=U(e,(function(e){var u=r.buffer,i=r.complete;0===u.length?i?o(!1):n.buffer.push(e):!t(e,u.shift())&&o(!1)}),(function(){n.complete=!0;var t=r.complete,e=r.buffer;t&&o(0===e.length),null==u||u.unsubscribe()}));return u};r.subscribe(c(u,i)),n.subscribe(c(i,u))}))}function Le(n){void 0===n&&(n={});var t=n.connector,r=void 0===t?function(){return new Q}:t,e=n.resetOnError,u=void 0===e||e,i=n.resetOnComplete,o=void 0===i||i,c=n.resetOnRefCountZero,s=void 0===c||c;return function(n){var t,e,i,c=0,f=!1,l=!1,a=function(){null==e||e.unsubscribe(),e=void 0},v=function(){a(),t=i=void 0,f=l=!1},h=function(){var n=t;v(),null==n||n.unsubscribe()};return R((function(n,d){c++,l||f||a();var p=i=null!=i?i:r();d.add((function(){0!==--c||l||f||(e=De(h,s))})),p.subscribe(d),!t&&c>0&&(t=new C({next:function(n){return p.next(n)},error:function(n){l=!0,a(),e=De(v,u,n),p.error(n)},complete:function(){f=!0,a(),e=De(v,o),p.complete()}}),Zn(n).subscribe(t))}))(n)}}function De(n,e){for(var u=[],i=2;i0?r:t;return R((function(r,u){var i=[new Q],o=0;u.next(i[0].asObservable()),r.subscribe(U(u,(function(r){var c,s;try{for(var f=n(i),l=f.next();!l.done;l=f.next()){l.value.next(r)}}catch(n){c={error:n}}finally{try{l&&!l.done&&(s=f.return)&&s.call(f)}finally{if(c)throw c.error}}var a=o-t+1;if(a>=0&&a%e==0&&i.shift().complete(),++o%e==0){var v=new Q;i.push(v),u.next(v.asObservable())}}),(function(){for(;i.length>0;)i.shift().complete();u.complete()}),(function(n){for(;i.length>0;)i.shift().error(n);u.error(n)}),(function(){null,i=null})))}))}function su(n){for(var t,r,e=[],u=1;u=0?Gn(r,i,f,o,!0):u=!0,f();var l=function(n){return e.slice().forEach(n)},a=function(n){l((function(t){var r=t.window;return n(r)})),n(r),r.unsubscribe()};return t.subscribe(U(r,(function(n){l((function(t){t.window.next(n),c<=++t.seen&&s(t)}))}),(function(){return a((function(n){return n.complete()}))}),(function(n){return a((function(t){return t.error(n)}))}))),function(){e=null}}))}function fu(t,r){return R((function(e,u){var i=[],o=function(n){for(;0