/** * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. * Original file: /npm/rxjs@7.5.6/dist/esm5/operators/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){return f(null==n?void 0:n.lift)}function a(n){return function(t){if(l(t))return t.lift((function(t){try{return n(t,this)}catch(n){this.error(n)}}));throw new TypeError("Unable to lift unknown Observable type")}}var v=function(n){return n&&"number"==typeof n.length&&"function"!=typeof n};function b(n){return f(null==n?void 0:n.then)}function h(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 p=h((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 d(n,t){if(n){var r=n.indexOf(t);0<=r&&n.splice(r,1)}}var y=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var u;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),a=l.next();!a.done;a=l.next()){a.value.remove(this)}}catch(n){e={error:n}}finally{try{a&&!a.done&&(u=l.return)&&u.call(l)}finally{if(e)throw e.error}}else s.remove(this);var v=this.initialTeardown;if(f(v))try{v()}catch(n){c=n instanceof p?n.errors:[n]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var h=n(b),d=h.next();!d.done;d=h.next()){var y=d.value;try{x(y)}catch(n){c=null!=c?c:[],n instanceof p?c=t(t([],r(c)),r(n.errors)):c.push(n)}}}catch(n){i={error:n}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}if(c)throw new p(c)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)x(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)&&d(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&d(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=((u=new e).closed=!0,u),e}(),m=y.EMPTY;function w(n){return n instanceof y||n&&"closed"in n&&f(n.remove)&&f(n.add)&&f(n.unsubscribe)}function x(n){f(n)?n():n.unsubscribe()}var g={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},_={setTimeout:function(n,e){for(var u=[],i=2;i=0?pn(e,o,l,c,!0):i=!0,l();var a=X(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 yn(t,r){return a((function(e,u){var i=[];Z(t).subscribe(X(u,(function(n){var t=[];i.push(t);var e=new y;e.add(Z(r(n)).subscribe(X(u,(function(){d(i,t),u.next(t),e.unsubscribe()}),S)))}),S)),e.subscribe(X(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 mn(n){return a((function(t,r){var e=null,u=null,i=function(){null==u||u.unsubscribe();var t=e;e=[],t&&r.next(t),Z(n()).subscribe(u=X(r,i,S))};i(),t.subscribe(X(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 wn(n){return a((function(t,r){var e,u=null,i=!1;u=t.subscribe(X(r,void 0,void 0,(function(o){e=Z(n(o,wn(n)(t))),u?(u.unsubscribe(),u=null,e.subscribe(r)):i=!0}))),i&&(u.unsubscribe(),u=null,e.subscribe(r))}))}var xn=Array.isArray,gn=Object.getPrototypeOf,_n=Object.prototype,En=Object.keys;function Sn(n){if(1===n.length){var t=n[0];if(xn(t))return{args:t,keys:null};if((e=t)&&"object"==typeof e&&gn(e)===_n){var r=En(t);return{args:r.map((function(n){return t[n]})),keys:r}}}var e;return{args:n,keys:null}}function On(n,t){return void 0===t&&(t=0),a((function(r,e){r.subscribe(X(e,(function(r){return pn(e,n,(function(){return e.next(r)}),t)}),(function(){return pn(e,n,(function(){return e.complete()}),t)}),(function(r){return pn(e,n,(function(){return e.error(r)}),t)})))}))}function Cn(n,t){return void 0===t&&(t=0),a((function(r,e){e.add(n.schedule((function(){return r.subscribe(e)}),t))}))}function Tn(n,t){if(!n)throw new Error("Iterable cannot be null");return new U((function(r){pn(r,t,(function(){var e=n[Symbol.asyncIterator]();pn(r,t,(function(){e.next().then((function(n){n.done?r.complete():r.next(n.value)}))}),0,!0)}))}))}function An(n,t){if(null!=n){if(M(n))return function(n,t){return Z(n).pipe(Cn(t),On(t))}(n,t);if(v(n))return function(n,t){return new U((function(r){var e=0;return t.schedule((function(){e===n.length?r.complete():(r.next(n[e++]),r.closed||this.schedule())}))}))}(n,t);if(b(n))return function(n,t){return Z(n).pipe(Cn(t),On(t))}(n,t);if(D(n))return Tn(n,t);if(q(n))return function(n,t){return new U((function(r){var e;return pn(r,t,(function(){e=n[Y](),pn(r,t,(function(){var n,t,u;try{t=(n=e.next()).value,u=n.done}catch(n){return void r.error(n)}u?r.complete():r.next(t)}),0,!0)})),function(){return f(null==e?void 0:e.return)&&e.return()}}))}(n,t);if(L(n))return function(n,t){return Tn(B(n),t)}(n,t)}throw W(n)}function jn(n,t){return t?An(n,t):Z(n)}function kn(n,t){return a((function(r,e){var u=0;r.subscribe(X(e,(function(r){e.next(n.call(t,r,u++))})))}))}var In=Array.isArray;function Pn(n){return kn((function(e){return function(n,e){return In(e)?n.apply(void 0,t([],r(e))):n(e)}(n,e)}))}function Nn(){for(var n=[],t=0;t=2,!1,!0))}var Dn=function(n,t){return n.push(t),n};function Wn(){return a((function(n,t){Mn(Dn,[])(n).subscribe(t)}))}function Yn(n,t){return F(Wn(),Un((function(t){return n(t)})),t?Pn(t):z)}function qn(n){return Yn(Nn,n)}var Bn=qn,Ln=Array.isArray;function Zn(n){return 1===n.length&&Ln(n[0])?n[0]:n}function Hn(){for(var n=[],e=0;e0},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?m:(this.currentObservers=null,i.push(n),new y((function(){t.currentObservers=null,d(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 U;return n.source=this,n},r.create=function(n,t){return new et(n,t)},r}(U),et=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:m},t}(rt);var ut={connector:function(){return new rt}};function it(n,t){void 0===t&&(t=ut);var r=t.connector;return a((function(t,e){var u,i=r();Z(n((u=i,new U((function(n){return u.subscribe(n)}))))).subscribe(e),e.add(t.subscribe(i))}))}function ot(n){return Mn((function(t,r,e){return!n||n(r,e)?t+1:t}),0)}function ct(n){return a((function(t,r){var e=!1,u=null,i=null,o=function(){if(null==i||i.unsubscribe(),i=null,e){e=!1;var n=u;u=null,r.next(n)}};t.subscribe(X(r,(function(t){null==i||i.unsubscribe(),e=!0,u=t,i=X(r,o,S),Z(n(t)).subscribe(i)}),(function(){o(),r.complete()}),void 0,(function(){u=i=null})))}))}function st(n,t){return void 0===t&&(t=en),a((function(r,e){var u=null,i=null,o=null,c=function(){if(u){u.unsubscribe(),u=null;var n=i;i=null,e.next(n)}};function s(){var r=o+n,i=t.now();if(i=2;return function(e){return e.pipe(Tt((function(t,r){return r===n})),bt(1),r?ft(t):jt((function(){return new Ct})))}}function Pt(){for(var n=[],e=0;e=2;return function(e){return e.pipe(n?Tt((function(t,r){return n(t,r,e)})):z,bt(1),r?ft(t):jt((function(){return new At})))}}function qt(n,t,r,e){return a((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 G(i,(function(t){try{var u=n(t),s=c.get(u);if(!s){c.set(u,s=e?e():new rt);var b=(p=u,d=s,(y=new U((function(n){l++;var t=d.subscribe(n);return function(){t.unsubscribe(),0==--l&&a&&v.unsubscribe()}}))).key=p,y);if(i.next(b),r){var h=X(s,(function(){s.complete(),null==h||h.unsubscribe()}),void 0,void 0,(function(){return c.delete(u)}));v.add(Z(r(b)).subscribe(h))}}s.next(o?o(t):t)}catch(n){f(n)}var p,d,y}),(function(){return s((function(n){return n.complete()}))}),f,(function(){return c.clear()}),(function(){return a=!0,0===l}));u.subscribe(v)}))}function Bt(){return a((function(n,t){n.subscribe(X(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}function Lt(t){return t<=0?function(){return vt}:a((function(r,e){var u=[];r.subscribe(X(e,(function(n){u.push(n),t=2;return function(e){return e.pipe(n?Tt((function(t,r){return n(t,r,e)})):z,Lt(1),r?ft(t):jt((function(){return new At})))}}function Ht(){return a((function(n,t){n.subscribe(X(t,(function(n){t.next(wt.createNext(n))}),(function(){t.next(wt.createComplete()),t.complete()}),(function(n){t.next(wt.createError(n)),t.complete()})))}))}function Xt(n){return Mn(f(n)?function(t,r){return n(t,r)>0?t:r}:function(n,t){return n>t?n:t})}function Gt(){for(var n=[],e=0;e0){var n=void 0;try{n=Z(i.shift())}catch(n){return void o()}var t=X(e,void 0,S,S);n.subscribe(t),t.add(o)}else e.complete()};o()}))}function ir(){return a((function(n,t){var r,e=!1;n.subscribe(X(t,(function(n){var u=r;r=n,e&&t.next([u,n]),e=!0})))}))}function or(n,t){return function(r,e){return!n.call(t,r,e)}}function cr(n,t){return function(r){return[Tt(n,t)(r),Tt(or(n,t))(r)]}}function sr(){for(var n=[],t=0;t=2,!0))}function Or(n,t){return void 0===t&&(t=function(n,t){return n===t}),a((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=X(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 Cr(n){void 0===n&&(n={});var t=n.connector,r=void 0===t?function(){return new rt}: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,v=function(){null==e||e.unsubscribe(),e=void 0},b=function(){v(),t=i=void 0,f=l=!1},h=function(){var n=t;b(),null==n||n.unsubscribe()};return a((function(n,a){c++,l||f||v();var p=i=null!=i?i:r();a.add((function(){0!==--c||l||f||(e=Tr(h,s))})),p.subscribe(a),!t&&c>0&&(t=new k({next:function(n){return p.next(n)},error:function(n){l=!0,v(),e=Tr(b,u,n),p.error(n)},complete:function(){f=!0,v(),e=Tr(b,o),p.complete()}}),Z(n).subscribe(t))}))(n)}}function Tr(n,e){for(var u=[],i=2;i0&&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 Kr(n){throw new Gr(n)}function Qr(n,t,r){var e,u,i;if(r=null!=r?r:un,cn(n)?e=n:"number"==typeof n&&(u=n),!t)throw new TypeError("No observable provided to switch to");if(i=function(){return t},null==e&&null==u)throw new TypeError("No timeout provided.");return Jr({first:e,each:u,scheduler:r,with:i})}function $r(n){return void 0===n&&(n=tn),kn((function(t){return{value:t,timestamp:n.now()}}))}function ne(n){return a((function(t,r){var e=new rt;r.next(e.asObservable());var u=function(n){e.error(n),r.error(n)};return t.subscribe(X(r,(function(n){return null==e?void 0:e.next(n)}),(function(){e.complete(),r.complete()}),u)),n.subscribe(X(r,(function(){e.complete(),r.next(e=new rt)}),S,u)),function(){null==e||e.unsubscribe(),e=null}}))}function te(t,r){void 0===r&&(r=0);var e=r>0?r:t;return a((function(r,u){var i=[new rt],o=0;u.next(i[0].asObservable()),r.subscribe(X(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 rt;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 re(n){for(var t,r,e=[],u=1;u=0?pn(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(X(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 ee(t,r){return a((function(e,u){var i=[],o=function(n){for(;0