/* rxjs@7.8.1 */ function e(e){return"function"==typeof e}function t(e){const t=e((e=>{Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}const n=t((e=>function(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map(((e,t)=>`${t+1}) ${e.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t}));function r(e,t){if(e){const n=e.indexOf(t);0<=n&&e.splice(n,1)}}class s{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(const e of r)e.remove(this);else r.remove(this);const{initialTeardown:s}=this;if(e(s))try{s()}catch(e){t=e instanceof n?e.errors:[e]}const{_finalizers:o}=this;if(o){this._finalizers=null;for(const e of o)try{c(e)}catch(e){t=null!=t?t:[],e instanceof n?t=[...t,...e.errors]:t.push(e)}}if(t)throw new n(t)}}add(e){var t;if(e&&e!==this)if(this.closed)c(e);else{if(e instanceof s){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(e)}}_hasParent(e){const{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){const{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){const{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&r(t,e)}remove(e){const{_finalizers:t}=this;t&&r(t,e),e instanceof s&&e._removeParent(this)}}s.EMPTY=(()=>{const e=new s;return e.closed=!0,e})();const o=s.EMPTY;function i(t){return t instanceof s||t&&"closed"in t&&e(t.remove)&&e(t.add)&&e(t.unsubscribe)}function c(t){e(t)?t():t.unsubscribe()}const u={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},l={setTimeout(e,t,...n){const{delegate:r}=l;return(null==r?void 0:r.setTimeout)?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){const{delegate:t}=l;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function a(e){l.setTimeout((()=>{const{onUnhandledError:t}=u;if(!t)throw e;t(e)}))}function h(){}const f=p("C",void 0,void 0);function d(e){return p("E",void 0,e)}function b(e){return p("N",e,void 0)}function p(e,t,n){return{kind:e,value:t,error:n}}let m=null;function v(e){if(u.useDeprecatedSynchronousErrorHandling){const t=!m;if(t&&(m={errorThrown:!1,error:null}),e(),t){const{errorThrown:e,error:t}=m;if(m=null,e)throw t}}else e()}class w extends s{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,i(e)&&e.add(this)):this.destination=O}static create(e,t,n){return new g(e,t,n)}next(e){this.isStopped?E(b(e),this):this._next(e)}error(e){this.isStopped?E(d(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?E(f,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const y=Function.prototype.bind;function x(e,t){return y.call(e,t)}class _{constructor(e){this.partialObserver=e}next(e){const{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(e){S(e)}}error(e){const{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(e){S(e)}else S(e)}complete(){const{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(e){S(e)}}}class g extends w{constructor(t,n,r){let s;if(super(),e(t)||!t)s={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0};else{let e;this&&u.useDeprecatedNextContext?(e=Object.create(t),e.unsubscribe=()=>this.unsubscribe(),s={next:t.next&&x(t.next,e),error:t.error&&x(t.error,e),complete:t.complete&&x(t.complete,e)}):s=t}this.destination=new _(s)}}function S(e){var t;u.useDeprecatedSynchronousErrorHandling?(t=e,u.useDeprecatedSynchronousErrorHandling&&m&&(m.errorThrown=!0,m.error=t)):a(e)}function E(e,t){const{onStoppedNotification:n}=u;n&&l.setTimeout((()=>n(e,t)))}const O={closed:!0,next:h,error:function(e){throw e},complete:h},T="function"==typeof Symbol&&Symbol.observable||"@@observable";function A(e){return e}function I(...e){return k(e)}function k(e){return 0===e.length?A:1===e.length?e[0]:function(t){return e.reduce(((e,t)=>t(e)),t)}}class j{constructor(e){e&&(this._subscribe=e)}lift(e){const t=new j;return t.source=this,t.operator=e,t}subscribe(t,n,r){const s=(o=t)&&o instanceof w||function(t){return t&&e(t.next)&&e(t.error)&&e(t.complete)}(o)&&i(o)?t:new g(t,n,r);var o;return v((()=>{const{operator:e,source:t}=this;s.add(e?e.call(s,t):t?this._subscribe(s):this._trySubscribe(s))})),s}_trySubscribe(e){try{return this._subscribe(e)}catch(t){e.error(t)}}forEach(e,t){return new(t=C(t))(((t,n)=>{const r=new g({next:t=>{try{e(t)}catch(e){n(e),r.unsubscribe()}},error:n,complete:t});this.subscribe(r)}))}_subscribe(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)}[T](){return this}pipe(...e){return k(e)(this)}toPromise(e){return new(e=C(e))(((e,t)=>{let n;this.subscribe((e=>n=e),(e=>t(e)),(()=>e(n)))}))}}function C(e){var t;return null!==(t=null!=e?e:u.Promise)&&void 0!==t?t:Promise}function P(t){return e(null==t?void 0:t.lift)}function N(e){return t=>{if(P(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function F(e,t,n,r,s){return new q(e,t,n,r,s)}j.create=e=>new j(e);class q extends w{constructor(e,t,n,r,s,o){super(e),this.onFinalize=s,this.shouldUnsubscribe=o,this._next=t?function(n){try{t(n)}catch(t){e.error(t)}}:super._next,this._error=r?function(t){try{r(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:t}=this;super.unsubscribe(),!t&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}}}function L(){return N(((e,t)=>{let n=null;e._refCount++;const r=F(t,void 0,void 0,void 0,(()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(n=null);const r=e._connection,s=n;n=null,!r||s&&r!==s||r.unsubscribe(),t.unsubscribe()}));e.subscribe(r),r.closed||(n=e.connect())}))}class R extends j{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,P(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:e}=this;this._subject=this._connection=null,null==e||e.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new s;const t=this.getSubject();e.add(this.source.subscribe(F(t,void 0,(()=>{this._teardown(),t.complete()}),(e=>{this._teardown(),t.error(e)}),(()=>this._teardown())))),e.closed&&(this._connection=null,e=s.EMPTY)}return e}refCount(){return L()(this)}}const z={now:()=>(z.delegate||performance).now(),delegate:void 0},U={schedule(e){let t=requestAnimationFrame,n=cancelAnimationFrame;const{delegate:r}=U;r&&(t=r.requestAnimationFrame,n=r.cancelAnimationFrame);const o=t((t=>{n=void 0,e(t)}));return new s((()=>null==n?void 0:n(o)))},requestAnimationFrame(...e){const{delegate:t}=U;return((null==t?void 0:t.requestAnimationFrame)||requestAnimationFrame)(...e)},cancelAnimationFrame(...e){const{delegate:t}=U;return((null==t?void 0:t.cancelAnimationFrame)||cancelAnimationFrame)(...e)},delegate:void 0};function D(e){return e?H(e):W}function H(e){return new j((t=>{const n=e||z,r=n.now();let s=0;const o=()=>{t.closed||(s=U.requestAnimationFrame((i=>{s=0;const c=n.now();t.next({timestamp:e?c:i,elapsed:c-r}),o()})))};return o(),()=>{s&&U.cancelAnimationFrame(s)}}))}const W=H(),M=t((e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class V extends j{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){const t=new $(this,this);return t.operator=e,t}_throwIfClosed(){if(this.closed)throw new M}next(e){v((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const t of this.currentObservers)t.next(e)}}))}error(e){v((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;const{observers:t}=this;for(;t.length;)t.shift().error(e)}}))}complete(){v((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:e}=this;for(;e.length;)e.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){const{hasError:t,isStopped:n,observers:i}=this;return t||n?o:(this.currentObservers=null,i.push(e),new s((()=>{this.currentObservers=null,r(i,e)})))}_checkFinalizedStatuses(e){const{hasError:t,thrownError:n,isStopped:r}=this;t?e.error(n):r&&e.complete()}asObservable(){const e=new j;return e.source=this,e}}V.create=(e,t)=>new $(e,t);class $ extends V{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)}error(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)}complete(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)}_subscribe(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:o}}class B extends V{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){const{hasError:e,thrownError:t,_value:n}=this;if(e)throw t;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}}const X={now:()=>(X.delegate||Date).now(),delegate:void 0};class Y extends V{constructor(e=1/0,t=1/0,n=X){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=t===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t)}next(e){const{isStopped:t,_buffer:n,_infiniteTimeWindow:r,_timestampProvider:s,_windowTime:o}=this;t||(n.push(e),!r&&n.push(s.now()+o)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();const t=this._innerSubscribe(e),{_infiniteTimeWindow:n,_buffer:r}=this,s=r.slice();for(let t=0;tne(t)&&e())),t},clearImmediate(e){ne(e)}},{setImmediate:se,clearImmediate:oe}=re,ie={setImmediate(...e){const{delegate:t}=ie;return((null==t?void 0:t.setImmediate)||se)(...e)},clearImmediate(e){const{delegate:t}=ie;return((null==t?void 0:t.clearImmediate)||oe)(e)},delegate:void 0};class ce{constructor(e,t=ce.now){this.schedulerActionCtor=e,this.now=t}schedule(e,t=0,n){return new this.schedulerActionCtor(this,e).schedule(n,t)}}ce.now=X.now;class ue extends ce{constructor(e,t=ce.now){super(e,t),this.actions=[],this._active=!1}flush(e){const{actions:t}=this;if(this._active)return void t.push(e);let n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}const le=new class extends ue{flush(e){this._active=!0;const t=this._scheduled;this._scheduled=void 0;const{actions:n}=this;let r;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}}}(class extends K{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,n=0){return null!==n&&n>0?super.requestAsyncId(e,t,n):(e.actions.push(this),e._scheduled||(e._scheduled=ie.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,t,n=0){var r;if(null!=n?n>0:this.delay>0)return super.recycleAsyncId(e,t,n);const{actions:s}=e;null!=t&&(null===(r=s[s.length-1])||void 0===r?void 0:r.id)!==t&&(ie.clearImmediate(t),e._scheduled===t&&(e._scheduled=void 0))}}),ae=le,he=new ue(K),fe=he;const de=new class extends ue{}(class extends K{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,n=0){return null!=n&&n>0||null==n&&this.delay>0?super.requestAsyncId(e,t,n):(e.flush(this),0)}}),be=de;const pe=new class extends ue{flush(e){this._active=!0;const t=this._scheduled;this._scheduled=void 0;const{actions:n}=this;let r;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}}}(class extends K{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,n=0){return null!==n&&n>0?super.requestAsyncId(e,t,n):(e.actions.push(this),e._scheduled||(e._scheduled=U.requestAnimationFrame((()=>e.flush(void 0)))))}recycleAsyncId(e,t,n=0){var r;if(null!=n?n>0:this.delay>0)return super.recycleAsyncId(e,t,n);const{actions:s}=e;null!=t&&(null===(r=s[s.length-1])||void 0===r?void 0:r.id)!==t&&(U.cancelAnimationFrame(t),e._scheduled=void 0)}}),me=pe;class ve extends ue{constructor(e=we,t=1/0){super(e,(()=>this.frame)),this.maxFrames=t,this.frame=0,this.index=-1}flush(){const{actions:e,maxFrames:t}=this;let n,r;for(;(r=e[0])&&r.delay<=t&&(e.shift(),this.frame=r.delay,!(n=r.execute(r.state,r.delay))););if(n){for(;r=e.shift();)r.unsubscribe();throw n}}}ve.frameTimeFactor=10;class we extends K{constructor(e,t,n=(e.index+=1)){super(e,t),this.scheduler=e,this.work=t,this.index=n,this.active=!0,this.index=e.index=n}schedule(e,t=0){if(Number.isFinite(t)){if(!this.id)return super.schedule(e,t);this.active=!1;const n=new we(this.scheduler,this.work);return this.add(n),n.schedule(e,t)}return s.EMPTY}requestAsyncId(e,t,n=0){this.delay=e.frame+n;const{actions:r}=e;return r.push(this),r.sort(we.sortActions),1}recycleAsyncId(e,t,n=0){}_execute(e,t){if(!0===this.active)return super._execute(e,t)}static sortActions(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1}}const ye=new j((e=>e.complete()));function xe(e){return e?function(e){return new j((t=>e.schedule((()=>t.complete()))))}(e):ye}function _e(t){return t&&e(t.schedule)}function ge(e){return e[e.length-1]}function Se(t){return e(ge(t))?t.pop():void 0}function Ee(e){return _e(ge(e))?e.pop():void 0}function Oe(e,t){return"number"==typeof ge(e)?e.pop():t}function Te(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{u(r.next(e))}catch(e){o(e)}}function c(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}u((r=r.apply(e,t||[])).next())}))}function Ae(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ie(e){return this instanceof Ie?(this.v=e,this):new Ie(e)}function ke(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),o=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){s[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||c(e,t)}))})}function c(e,t){try{(n=s[e](t)).value instanceof Ie?Promise.resolve(n.value.v).then(u,l):a(o[0][2],n)}catch(e){a(o[0][3],e)}var n}function u(e){c("next",e)}function l(e){c("throw",e)}function a(e,t){e(t),o.shift(),o.length&&c(o[0][0],o[0][1])}}function je(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Ae(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,s){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,s,(t=e[n](t)).done,t.value)}))}}}const Ce=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function Pe(t){return e(null==t?void 0:t.then)}function Ne(t){return e(t[T])}function Fe(t){return Symbol.asyncIterator&&e(null==t?void 0:t[Symbol.asyncIterator])}function qe(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const Le="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Re(t){return e(null==t?void 0:t[Le])}function ze(e){return ke(this,arguments,(function*(){const t=e.getReader();try{for(;;){const{value:e,done:n}=yield Ie(t.read());if(n)return yield Ie(void 0);yield yield Ie(e)}}finally{t.releaseLock()}}))}function Ue(t){return e(null==t?void 0:t.getReader)}function De(t){if(t instanceof j)return t;if(null!=t){if(Ne(t))return o=t,new j((t=>{const n=o[T]();if(e(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ce(t))return s=t,new j((e=>{for(let t=0;t{r.then((t=>{e.closed||(e.next(t),e.complete())}),(t=>e.error(t))).then(null,a)}));if(Fe(t))return He(t);if(Re(t))return n=t,new j((e=>{for(const t of n)if(e.next(t),e.closed)return;e.complete()}));if(Ue(t))return He(ze(t))}var n,r,s,o;throw qe(t)}function He(e){return new j((t=>{(function(e,t){var n,r,s,o;return Te(this,void 0,void 0,(function*(){try{for(n=je(e);!(r=yield n.next()).done;){const e=r.value;if(t.next(e),t.closed)return}}catch(e){s={error:e}}finally{try{r&&!r.done&&(o=n.return)&&(yield o.call(n))}finally{if(s)throw s.error}}t.complete()}))})(e,t).catch((e=>t.error(e)))}))}function We(e,t,n,r=0,s=!1){const o=t.schedule((function(){n(),s?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(o),!s)return o}function Me(e,t=0){return N(((n,r)=>{n.subscribe(F(r,(n=>We(r,e,(()=>r.next(n)),t)),(()=>We(r,e,(()=>r.complete()),t)),(n=>We(r,e,(()=>r.error(n)),t))))}))}function Ve(e,t=0){return N(((n,r)=>{r.add(e.schedule((()=>n.subscribe(r)),t))}))}function $e(t,n){return new j((r=>{let s;return We(r,n,(()=>{s=t[Le](),We(r,n,(()=>{let e,t;try{({value:e,done:t}=s.next())}catch(e){return void r.error(e)}t?r.complete():r.next(e)}),0,!0)})),()=>e(null==s?void 0:s.return)&&s.return()}))}function Be(e,t){if(!e)throw new Error("Iterable cannot be null");return new j((n=>{We(n,t,(()=>{const r=e[Symbol.asyncIterator]();We(n,t,(()=>{r.next().then((e=>{e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Xe(e,t){if(null!=e){if(Ne(e))return function(e,t){return De(e).pipe(Ve(t),Me(t))}(e,t);if(Ce(e))return function(e,t){return new j((n=>{let r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(Pe(e))return function(e,t){return De(e).pipe(Ve(t),Me(t))}(e,t);if(Fe(e))return Be(e,t);if(Re(e))return $e(e,t);if(Ue(e))return function(e,t){return Be(ze(e),t)}(e,t)}throw qe(e)}function Ye(e,t){return t?Xe(e,t):De(e)}function Je(...e){return Ye(e,Ee(e))}function Ge(t,n){const r=e(t)?t:()=>t,s=e=>e.error(r());return new j(n?e=>n.schedule(s,0,e):s)}var Ze;!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(Ze||(Ze={}));class Ke{constructor(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}observe(e){return Qe(this,e)}do(e,t,n){const{kind:r,value:s,error:o}=this;return"N"===r?null==e?void 0:e(s):"E"===r?null==t?void 0:t(o):null==n?void 0:n()}accept(t,n,r){var s;return e(null===(s=t)||void 0===s?void 0:s.next)?this.observe(t):this.do(t,n,r)}toObservable(){const{kind:e,value:t,error:n}=this,r="N"===e?Je(t):"E"===e?Ge((()=>n)):"C"===e?ye:0;if(!r)throw new TypeError(`Unexpected notification kind ${e}`);return r}static createNext(e){return new Ke("N",e)}static createError(e){return new Ke("E",void 0,e)}static createComplete(){return Ke.completeNotification}}function Qe(e,t){var n,r,s;const{kind:o,value:i,error:c}=e;if("string"!=typeof o)throw new TypeError('Invalid notification, missing "kind"');"N"===o?null===(n=t.next)||void 0===n||n.call(t,i):"E"===o?null===(r=t.error)||void 0===r||r.call(t,c):null===(s=t.complete)||void 0===s||s.call(t)}function et(t){return!!t&&(t instanceof j||e(t.lift)&&e(t.subscribe))}Ke.completeNotification=new Ke("C");const tt=t((e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}));function nt(e,t){const n="object"==typeof t;return new Promise(((r,s)=>{let o,i=!1;e.subscribe({next:e=>{o=e,i=!0},error:s,complete:()=>{i?r(o):n?r(t.defaultValue):s(new tt)}})}))}function rt(e,t){const n="object"==typeof t;return new Promise(((r,s)=>{const o=new g({next:e=>{r(e),o.unsubscribe()},error:s,complete:()=>{n?r(t.defaultValue):s(new tt)}});e.subscribe(o)}))}const st=t((e=>function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"})),ot=t((e=>function(t){e(this),this.name="NotFoundError",this.message=t})),it=t((e=>function(t){e(this),this.name="SequenceError",this.message=t}));function ct(e){return e instanceof Date&&!isNaN(e)}const ut=t((e=>function(t=null){e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}));function lt(e,t){const{first:n,each:r,with:s=at,scheduler:o=(null!=t?t:he),meta:i=null}=ct(e)?{first:e}:"number"==typeof e?{each:e}:e;if(null==n&&null==r)throw new TypeError("No timeout provided.");return N(((e,t)=>{let c,u,l=null,a=0;const h=e=>{u=We(t,o,(()=>{try{c.unsubscribe(),De(s({meta:i,lastValue:l,seen:a})).subscribe(t)}catch(e){t.error(e)}}),e)};c=e.subscribe(F(t,(e=>{null==u||u.unsubscribe(),a++,t.next(l=e),r>0&&h(r)}),void 0,void 0,(()=>{(null==u?void 0:u.closed)||null==u||u.unsubscribe(),l=null}))),!a&&h(null!=n?"number"==typeof n?n:+n-o.now():r)}))}function at(e){throw new ut(e)}function ht(e,t){return N(((n,r)=>{let s=0;n.subscribe(F(r,(n=>{r.next(e.call(t,n,s++))})))}))}const{isArray:ft}=Array;function dt(e){return ht((t=>function(e,t){return ft(t)?e(...t):e(t)}(e,t)))}function bt(e,t,n,r){if(n){if(!_e(n))return function(...s){return bt(e,t,r).apply(this,s).pipe(dt(n))};r=n}return r?function(...n){return bt(e,t).apply(this,n).pipe(Ve(r),Me(r))}:function(...n){const r=new J;let s=!0;return new j((o=>{const i=r.subscribe(o);if(s){s=!1;let o=!1,i=!1;t.apply(this,[...n,(...t)=>{if(e){const e=t.shift();if(null!=e)return void r.error(e)}r.next(1n[e])),keys:e}}}var t;return{args:e,keys:null}}function gt(e,t){return e.reduce(((e,n,r)=>(e[n]=t[r],e)),{})}function St(...e){const t=Ee(e),n=Se(e),{args:r,keys:s}=_t(e);if(0===r.length)return Ye([],t);const o=new j(Et(r,t,s?e=>gt(s,e):A));return n?o.pipe(dt(n)):o}function Et(e,t,n=A){return r=>{Ot(t,(()=>{const{length:s}=e,o=new Array(s);let i=s,c=s;for(let u=0;u{const s=Ye(e[u],t);let l=!1;s.subscribe(F(r,(e=>{o[u]=e,l||(l=!0,c--),c||r.next(n(o.slice()))}),(()=>{--i||r.complete()})))}),r)}),r)}}function Ot(e,t,n){e?We(n,e,t):t()}function Tt(e,t,n,r,s,o,i,c){const u=[];let l=0,a=0,h=!1;const f=()=>{!h||u.length||l||t.complete()},d=e=>l{o&&t.next(e),l++;let c=!1;De(n(e,a++)).subscribe(F(t,(e=>{null==s||s(e),o?d(e):t.next(e)}),(()=>{c=!0}),void 0,(()=>{if(c)try{for(l--;u.length&&lb(e))):b(e)}f()}catch(e){t.error(e)}})))};return e.subscribe(F(t,d,(()=>{h=!0,f()}))),()=>{null==c||c()}}function At(t,n,r=1/0){return e(n)?At(((e,r)=>ht(((t,s)=>n(e,t,r,s)))(De(t(e,r)))),r):("number"==typeof n&&(r=n),N(((e,n)=>Tt(e,n,t,r))))}function It(e=1/0){return At(A,e)}function kt(){return It(1)}function jt(...e){return kt()(Ye(e,Ee(e)))}function Ct(e){return new j((t=>{De(e()).subscribe(t)}))}const Pt={connector:()=>new V,resetOnDisconnect:!0};function Nt(e,t=Pt){let n=null;const{connector:r,resetOnDisconnect:s=!0}=t;let o=r();const i=new j((e=>o.subscribe(e)));return i.connect=()=>(n&&!n.closed||(n=Ct((()=>e)).subscribe(o),s&&n.add((()=>o=r()))),n),i}function Ft(...e){const t=Se(e),{args:n,keys:r}=_t(e),s=new j((e=>{const{length:t}=n;if(!t)return void e.complete();const s=new Array(t);let o=t,i=t;for(let c=0;c{t||(t=!0,i--),s[c]=e}),(()=>o--),void 0,(()=>{o&&t||(i||e.next(r?gt(r,s):s),e.complete())})))}}));return t?s.pipe(dt(t)):s}const qt=["addListener","removeListener"],Lt=["addEventListener","removeEventListener"],Rt=["on","off"];function zt(t,n,r,s){if(e(r)&&(s=r,r=void 0),s)return zt(t,n,r).pipe(dt(s));const[o,i]=function(t){return e(t.addEventListener)&&e(t.removeEventListener)}(t)?Lt.map((e=>s=>t[e](n,s,r))):function(t){return e(t.addListener)&&e(t.removeListener)}(t)?qt.map(Ut(t,n)):function(t){return e(t.on)&&e(t.off)}(t)?Rt.map(Ut(t,n)):[];if(!o&&Ce(t))return At((e=>zt(e,n,r)))(De(t));if(!o)throw new TypeError("Invalid event target");return new j((e=>{const t=(...t)=>e.next(1i(t)}))}function Ut(e,t){return n=>r=>e[n](t,r)}function Dt(t,n,r){return r?Dt(t,n).pipe(dt(r)):new j((r=>{const s=(...e)=>r.next(1===e.length?e[0]:e),o=t(s);return e(n)?()=>n(s,o):void 0}))}function Ht(e,t,n,r,s){let o,i;function*c(){for(let e=i;!t||t(e);e=n(e))yield o(e)}return 1===arguments.length?({initialState:i,condition:t,iterate:n,resultSelector:o=A,scheduler:s}=e):(i=e,!r||_e(r)?(o=A,s=r):o=r),Ct(s?()=>$e(c(),s):c)}function Wt(e,t,n){return Ct((()=>e()?t:n))}function Mt(e=0,t,n=fe){let r=-1;return null!=t&&(_e(t)?n=t:r=t),new j((t=>{let s=ct(e)?+e-n.now():e;s<0&&(s=0);let o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())}),s)}))}function Vt(e=0,t=he){return e<0&&(e=0),Mt(e,e,t)}function $t(...e){const t=Ee(e),n=Oe(e,1/0),r=e;return r.length?1===r.length?De(r[0]):It(n)(Ye(r,t)):ye}const Bt=new j(h);function Xt(){return Bt}const{isArray:Yt}=Array;function Jt(e){return 1===e.length&&Yt(e[0])?e[0]:e}function Gt(...e){const t=Jt(e);return new j((e=>{let n=0;const r=()=>{if(n!e.call(t,n,r)}function Qt(e,t){return N(((n,r)=>{let s=0;n.subscribe(F(r,(n=>e.call(t,n,s++)&&r.next(n))))}))}function en(e,t,n){return[Qt(t,n)(De(e)),Qt(Kt(t,n))(De(e))]}function tn(...e){return 1===(e=Jt(e)).length?De(e[0]):new j(nn(e))}function nn(e){return t=>{let n=[];for(let r=0;n&&!t.closed&&r{if(n){for(let e=0;e{let s=e;return n.schedule((function(){s{let n=e;for(;n{const r=e(),s=t(r);return(s?De(s):ye).subscribe(n),()=>{r&&r.unsubscribe()}}))}function on(...e){const t=Se(e),n=Jt(e);return n.length?new j((e=>{let r=n.map((()=>[])),s=n.map((()=>!1));e.add((()=>{r=s=null}));for(let o=0;!e.closed&&o{if(r[o].push(n),r.every((e=>e.length))){const n=r.map((e=>e.shift()));e.next(t?t(...n):n),r.some(((e,t)=>!e.length&&s[t]))&&e.complete()}}),(()=>{s[o]=!0,!r[o].length&&e.complete()})));return()=>{r=s=null}})):ye}function cn(e){return N(((t,n)=>{let r=!1,s=null,o=null,i=!1;const c=()=>{if(null==o||o.unsubscribe(),o=null,r){r=!1;const e=s;s=null,n.next(e)}i&&n.complete()},u=()=>{o=null,i&&n.complete()};t.subscribe(F(n,(t=>{r=!0,s=t,o||De(e(t)).subscribe(o=F(n,c,u))}),(()=>{i=!0,(!r||!o||o.closed)&&n.complete()})))}))}function un(e,t=he){return cn((()=>Mt(e,t)))}function ln(e){return N(((t,n)=>{let r=[];return t.subscribe(F(n,(e=>r.push(e)),(()=>{n.next(r),n.complete()}))),De(e).subscribe(F(n,(()=>{const e=r;r=[],n.next(e)}),h)),()=>{r=null}}))}function an(e,t=null){return t=null!=t?t:e,N(((n,s)=>{let o=[],i=0;n.subscribe(F(s,(n=>{let c=null;i++%t==0&&o.push([]);for(const t of o)t.push(n),e<=t.length&&(c=null!=c?c:[],c.push(t));if(c)for(const e of c)r(o,e),s.next(e)}),(()=>{for(const e of o)s.next(e);s.complete()}),void 0,(()=>{o=null})))}))}function hn(e,...t){var n,o;const i=null!==(n=Ee(t))&&void 0!==n?n:he,c=null!==(o=t[0])&&void 0!==o?o:null,u=t[1]||1/0;return N(((t,n)=>{let o=[],l=!1;const a=e=>{const{buffer:t,subs:s}=e;s.unsubscribe(),r(o,e),n.next(t),l&&h()},h=()=>{if(o){const t=new s;n.add(t);const r={buffer:[],subs:t};o.push(r),We(t,i,(()=>a(r)),e)}};null!==c&&c>=0?We(n,i,h,c,!0):l=!0,h();const f=F(n,(e=>{const t=o.slice();for(const n of t){const{buffer:t}=n;t.push(e),u<=t.length&&a(n)}}),(()=>{for(;null==o?void 0:o.length;)n.next(o.shift().buffer);null==f||f.unsubscribe(),n.complete(),n.unsubscribe()}),void 0,(()=>o=null));t.subscribe(f)}))}function fn(e,t){return N(((n,o)=>{const i=[];De(e).subscribe(F(o,(e=>{const n=[];i.push(n);const c=new s;c.add(De(t(e)).subscribe(F(o,(()=>{r(i,n),o.next(n),c.unsubscribe()}),h)))}),h)),n.subscribe(F(o,(e=>{for(const t of i)t.push(e)}),(()=>{for(;i.length>0;)o.next(i.shift());o.complete()})))}))}function dn(e){return N(((t,n)=>{let r=null,s=null;const o=()=>{null==s||s.unsubscribe();const t=r;r=[],t&&n.next(t),De(e()).subscribe(s=F(n,o,h))};o(),t.subscribe(F(n,(e=>null==r?void 0:r.push(e)),(()=>{r&&n.next(r),n.complete()}),void 0,(()=>r=s=null)))}))}function bn(e){return N(((t,n)=>{let r,s=null,o=!1;s=t.subscribe(F(n,void 0,void 0,(i=>{r=De(e(i,bn(e)(t))),s?(s.unsubscribe(),s=null,r.subscribe(n)):o=!0}))),o&&(s.unsubscribe(),s=null,r.subscribe(n))}))}function pn(e,t,n,r,s){return(o,i)=>{let c=n,u=t,l=0;o.subscribe(F(i,(t=>{const n=l++;u=c?e(u,t,n):(c=!0,t),r&&i.next(u)}),s&&(()=>{c&&i.next(u),i.complete()})))}}function mn(e,t){return N(pn(e,t,arguments.length>=2,!1,!0))}const vn=(e,t)=>(e.push(t),e);function wn(){return N(((e,t)=>{mn(vn,[])(e).subscribe(t)}))}function yn(e,t){return I(wn(),At((t=>e(t))),t?dt(t):A)}function xn(e){return yn(St,e)}const _n=xn;function gn(...e){const t=Se(e);return t?I(gn(...e),dt(t)):N(((t,n)=>{Et([t,...Jt(e)])(n)}))}function Sn(...e){return gn(...e)}function En(t,n){return e(n)?At(t,n,1):At(t,1)}function On(t,n){return e(n)?En((()=>t),n):En((()=>t))}function Tn(...e){const t=Ee(e);return N(((n,r)=>{kt()(Ye([n,...e],t)).subscribe(r)}))}function An(...e){return Tn(...e)}const In={connector:()=>new V};function kn(e,t=In){const{connector:n}=t;return N(((t,r)=>{const s=n();var o;De(e((o=s,new j((e=>o.subscribe(e)))))).subscribe(r),r.add(t.subscribe(s))}))}function jn(e){return mn(((t,n,r)=>!e||e(n,r)?t+1:t),0)}function Cn(e){return N(((t,n)=>{let r=!1,s=null,o=null;const i=()=>{if(null==o||o.unsubscribe(),o=null,r){r=!1;const e=s;s=null,n.next(e)}};t.subscribe(F(n,(t=>{null==o||o.unsubscribe(),r=!0,s=t,o=F(n,i,h),De(e(t)).subscribe(o)}),(()=>{i(),n.complete()}),void 0,(()=>{s=o=null})))}))}function Pn(e,t=he){return N(((n,r)=>{let s=null,o=null,i=null;const c=()=>{if(s){s.unsubscribe(),s=null;const e=o;o=null,r.next(e)}};function u(){const n=i+e,o=t.now();if(o{o=n,i=t.now(),s||(s=t.schedule(u,e),r.add(s))}),(()=>{c(),r.complete()}),void 0,(()=>{o=s=null})))}))}function Nn(e){return N(((t,n)=>{let r=!1;t.subscribe(F(n,(e=>{r=!0,n.next(e)}),(()=>{r||n.next(e),n.complete()})))}))}function Fn(e){return e<=0?()=>ye:N(((t,n)=>{let r=0;t.subscribe(F(n,(t=>{++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}function qn(){return N(((e,t)=>{e.subscribe(F(t,h))}))}function Ln(e){return ht((()=>e))}function Rn(e,t){return t?n=>jt(t.pipe(Fn(1),qn()),n.pipe(Rn(e))):At(((t,n)=>De(e(t,n)).pipe(Fn(1),Ln(t))))}function zn(e,t=he){const n=Mt(e,t);return Rn((()=>n))}function Un(){return N(((e,t)=>{e.subscribe(F(t,(e=>Qe(e,t))))}))}function Dn(e,t){return N(((n,r)=>{const s=new Set;n.subscribe(F(r,(t=>{const n=e?e(t):t;s.has(n)||(s.add(n),r.next(t))}))),t&&De(t).subscribe(F(r,(()=>s.clear()),h))}))}function Hn(e,t=A){return e=null!=e?e:Wn,N(((n,r)=>{let s,o=!0;n.subscribe(F(r,(n=>{const i=t(n);!o&&e(s,i)||(o=!1,s=i,r.next(n))})))}))}function Wn(e,t){return e===t}function Mn(e,t){return Hn(((n,r)=>t?t(n[e],r[e]):n[e]===r[e]))}function Vn(e=$n){return N(((t,n)=>{let r=!1;t.subscribe(F(n,(e=>{r=!0,n.next(e)}),(()=>r?n.complete():n.error(e()))))}))}function $n(){return new tt}function Bn(e,t){if(e<0)throw new st;const n=arguments.length>=2;return r=>r.pipe(Qt(((t,n)=>n===e)),Fn(1),n?Nn(t):Vn((()=>new st)))}function Xn(...e){return t=>jt(t,Je(...e))}function Yn(e,t){return N(((n,r)=>{let s=0;n.subscribe(F(r,(o=>{e.call(t,o,s++,n)||(r.next(!1),r.complete())}),(()=>{r.next(!0),r.complete()})))}))}function Jn(e,t){return t?n=>n.pipe(Jn(((n,r)=>De(e(n,r)).pipe(ht(((e,s)=>t(n,e,r,s))))))):N(((t,n)=>{let r=0,s=null,o=!1;t.subscribe(F(n,(t=>{s||(s=F(n,void 0,(()=>{s=null,o&&n.complete()})),De(e(t,r++)).subscribe(s))}),(()=>{o=!0,!s&&n.complete()})))}))}function Gn(){return Jn(A)}const Zn=Gn;function Kn(e,t=1/0,n){return t=(t||0)<1?1/0:t,N(((r,s)=>Tt(r,s,e,t,void 0,!0,n)))}function Qn(e){return N(((t,n)=>{try{t.subscribe(n)}finally{n.add(e)}}))}function er(e,t){return N(tr(e,t,"value"))}function tr(e,t,n){const r="index"===n;return(n,s)=>{let o=0;n.subscribe(F(s,(i=>{const c=o++;e.call(t,i,c,n)&&(s.next(r?c:i),s.complete())}),(()=>{s.next(r?-1:void 0),s.complete()})))}}function nr(e,t){return N(tr(e,t,"index"))}function rr(e,t){const n=arguments.length>=2;return r=>r.pipe(e?Qt(((t,n)=>e(t,n,r))):A,Fn(1),n?Nn(t):Vn((()=>new tt)))}function sr(e,t,n,r){return N(((s,o)=>{let i;t&&"function"!=typeof t?({duration:n,element:i,connector:r}=t):i=t;const c=new Map,u=e=>{c.forEach(e),e(o)},l=e=>u((t=>t.error(e)));let a=0,h=!1;const f=new q(o,(t=>{try{const s=e(t);let u=c.get(s);if(!u){c.set(s,u=r?r():new V);const e=function(e,t){const n=new j((e=>{a++;const n=t.subscribe(e);return()=>{n.unsubscribe(),0==--a&&h&&f.unsubscribe()}}));return n.key=e,n}(s,u);if(o.next(e),n){const t=F(u,(()=>{u.complete(),null==t||t.unsubscribe()}),void 0,void 0,(()=>c.delete(s)));f.add(De(n(e)).subscribe(t))}}u.next(i?i(t):t)}catch(e){l(e)}}),(()=>u((e=>e.complete()))),l,(()=>c.clear()),(()=>(h=!0,0===a)));s.subscribe(f)}))}function or(){return N(((e,t)=>{e.subscribe(F(t,(()=>{t.next(!1),t.complete()}),(()=>{t.next(!0),t.complete()})))}))}function ir(e){return e<=0?()=>ye:N(((t,n)=>{let r=[];t.subscribe(F(n,(t=>{r.push(t),e{for(const e of r)n.next(e);n.complete()}),void 0,(()=>{r=null})))}))}function cr(e,t){const n=arguments.length>=2;return r=>r.pipe(e?Qt(((t,n)=>e(t,n,r))):A,ir(1),n?Nn(t):Vn((()=>new tt)))}function ur(){return N(((e,t)=>{e.subscribe(F(t,(e=>{t.next(Ke.createNext(e))}),(()=>{t.next(Ke.createComplete()),t.complete()}),(e=>{t.next(Ke.createError(e)),t.complete()})))}))}function lr(t){return mn(e(t)?(e,n)=>t(e,n)>0?e:n:(e,t)=>e>t?e:t)}const ar=At;function hr(t,n,r=1/0){return e(n)?At((()=>t),n,r):("number"==typeof n&&(r=n),At((()=>t),r))}function fr(e,t,n=1/0){return N(((r,s)=>{let o=t;return Tt(r,s,((t,n)=>e(o,t,n)),n,(e=>{o=e}),!1,void 0,(()=>o=null))}))}function dr(...e){const t=Ee(e),n=Oe(e,1/0);return e=Jt(e),N(((r,s)=>{It(n)(Ye([r,...e],t)).subscribe(s)}))}function br(...e){return dr(...e)}function pr(t){return mn(e(t)?(e,n)=>t(e,n)<0?e:n:(e,t)=>et;return e(n)?kn(n,{connector:r}):e=>new R(e,r)}function vr(...e){const t=Jt(e);return e=>Gt(e,...t)}const wr=vr;function yr(){return N(((e,t)=>{let n,r=!1;e.subscribe(F(t,(e=>{const s=n;n=e,r&&t.next([s,e]),r=!0})))}))}function xr(...e){const t=e.length;if(0===t)throw new Error("list of properties cannot be empty.");return ht((n=>{let r=n;for(let n=0;nkn(e)(t):e=>mr(new V)(e)}function gr(e){return t=>{const n=new B(e);return new R(t,(()=>n))}}function Sr(){return e=>{const t=new J;return new R(e,(()=>t))}}function Er(t,n,r,s){r&&!e(r)&&(s=r);const o=e(r)?r:void 0;return e=>mr(new Y(t,n,s),o)(e)}function Or(...e){return e.length?N(((t,n)=>{nn([t,...e])(n)})):A}function Tr(e){let t,n=1/0;return null!=e&&("object"==typeof e?({count:n=1/0,delay:t}=e):n=e),n<=0?()=>ye:N(((e,r)=>{let s,o=0;const i=()=>{if(null==s||s.unsubscribe(),s=null,null!=t){const e="number"==typeof t?Mt(t):De(t(o)),n=F(r,(()=>{n.unsubscribe(),c()}));e.subscribe(n)}else c()},c=()=>{let t=!1;s=e.subscribe(F(r,void 0,(()=>{++o{let r,s,o=!1,i=!1,c=!1;const u=()=>c&&i&&(n.complete(),!0),l=()=>{c=!1,r=t.subscribe(F(n,void 0,(()=>{c=!0,!u()&&(s||(s=new V,De(e(s)).subscribe(F(n,(()=>{r?l():o=!0}),(()=>{i=!0,u()})))),s).next()}))),o&&(r.unsubscribe(),r=null,o=!1,l())};l()}))}function Ir(e=1/0){let t;t=e&&"object"==typeof e?e:{count:e};const{count:n=1/0,delay:r,resetOnSuccess:s=!1}=t;return n<=0?A:N(((e,t)=>{let o,i=0;const c=()=>{let u=!1;o=e.subscribe(F(t,(e=>{s&&(i=0),t.next(e)}),void 0,(e=>{if(i++{o?(o.unsubscribe(),o=null,c()):u=!0};if(null!=r){const s="number"==typeof r?Mt(r):De(r(e,i)),o=F(t,(()=>{o.unsubscribe(),n()}),(()=>{t.complete()}));s.subscribe(o)}else n()}else t.error(e)}))),u&&(o.unsubscribe(),o=null,c())};c()}))}function kr(e){return N(((t,n)=>{let r,s,o=!1;const i=()=>{r=t.subscribe(F(n,void 0,void 0,(t=>{s||(s=new V,De(e(s)).subscribe(F(n,(()=>r?i():o=!0)))),s&&s.next(t)}))),o&&(r.unsubscribe(),r=null,o=!1,i())};i()}))}function jr(e){return N(((t,n)=>{let r=!1,s=null;t.subscribe(F(n,(e=>{r=!0,s=e}))),De(e).subscribe(F(n,(()=>{if(r){r=!1;const e=s;s=null,n.next(e)}}),h))}))}function Cr(e,t=he){return jr(Vt(e,t))}function Pr(e,t){return N(pn(e,t,arguments.length>=2,!0))}function Nr(e,t=((e,t)=>e===t)){return N(((n,r)=>{const s={buffer:[],complete:!1},o={buffer:[],complete:!1},i=e=>{r.next(e),r.complete()},c=(e,n)=>{const s=F(r,(r=>{const{buffer:s,complete:o}=n;0===s.length?o?i(!1):e.buffer.push(r):!t(r,s.shift())&&i(!1)}),(()=>{e.complete=!0;const{complete:t,buffer:r}=n;t&&i(0===r.length),null==s||s.unsubscribe()}));return s};n.subscribe(c(s,o)),De(e).subscribe(c(o,s))}))}function Fr(e={}){const{connector:t=(()=>new V),resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:s=!0}=e;return e=>{let o,i,c,u=0,l=!1,a=!1;const h=()=>{null==i||i.unsubscribe(),i=void 0},f=()=>{h(),o=c=void 0,l=a=!1},d=()=>{const e=o;f(),null==e||e.unsubscribe()};return N(((e,b)=>{u++,a||l||h();const p=c=null!=c?c:t();b.add((()=>{u--,0!==u||a||l||(i=qr(d,s))})),p.subscribe(b),!o&&u>0&&(o=new g({next:e=>p.next(e),error:e=>{a=!0,h(),i=qr(f,n,e),p.error(e)},complete:()=>{l=!0,h(),i=qr(f,r),p.complete()}}),De(e).subscribe(o))}))(e)}}function qr(e,t,...n){if(!0===t)return void e();if(!1===t)return;const r=new g({next:()=>{r.unsubscribe(),e()}});return De(t(...n)).subscribe(r)}function Lr(e,t,n){let r,s=!1;return e&&"object"==typeof e?({bufferSize:r=1/0,windowTime:t=1/0,refCount:s=!1,scheduler:n}=e):r=null!=e?e:1/0,Fr({connector:()=>new Y(r,t,n),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function Rr(e){return N(((t,n)=>{let r,s=!1,o=!1,i=0;t.subscribe(F(n,(c=>{o=!0,e&&!e(c,i++,t)||(s&&n.error(new it("Too many matching values")),s=!0,r=c)}),(()=>{s?(n.next(r),n.complete()):n.error(o?new ot("No matching values"):new tt)})))}))}function zr(e){return Qt(((t,n)=>e<=n))}function Ur(e){return e<=0?A:N(((t,n)=>{let r=new Array(e),s=0;return t.subscribe(F(n,(t=>{const o=s++;if(o{r=null}}))}function Dr(e){return N(((t,n)=>{let r=!1;const s=F(n,(()=>{null==s||s.unsubscribe(),r=!0}),h);De(e).subscribe(s),t.subscribe(F(n,(e=>r&&n.next(e))))}))}function Hr(e){return N(((t,n)=>{let r=!1,s=0;t.subscribe(F(n,(t=>(r||(r=!e(t,s++)))&&n.next(t))))}))}function Wr(...e){const t=Ee(e);return N(((n,r)=>{(t?jt(e,n,t):jt(e,n)).subscribe(r)}))}function Mr(e,t){return N(((n,r)=>{let s=null,o=0,i=!1;const c=()=>i&&!s&&r.complete();n.subscribe(F(r,(n=>{null==s||s.unsubscribe();let i=0;const u=o++;De(e(n,u)).subscribe(s=F(r,(e=>r.next(t?t(n,e,u,i++):e)),(()=>{s=null,c()})))}),(()=>{i=!0,c()})))}))}function Vr(){return Mr(A)}function $r(t,n){return e(n)?Mr((()=>t),n):Mr((()=>t))}function Br(e,t){return N(((n,r)=>{let s=t;return Mr(((t,n)=>e(s,t,n)),((e,t)=>(s=t,t)))(n).subscribe(r),()=>{s=null}}))}function Xr(e){return N(((t,n)=>{De(e).subscribe(F(n,(()=>n.complete()),h)),!n.closed&&t.subscribe(n)}))}function Yr(e,t=!1){return N(((n,r)=>{let s=0;n.subscribe(F(r,(n=>{const o=e(n,s++);(o||t)&&r.next(n),!o&&r.complete()})))}))}function Jr(t,n,r){const s=e(t)||n||r?{next:t,error:n,complete:r}:t;return s?N(((e,t)=>{var n;null===(n=s.subscribe)||void 0===n||n.call(s);let r=!0;e.subscribe(F(t,(e=>{var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(()=>{var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(e=>{var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(()=>{var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):A}function Gr(e,t){return N(((n,r)=>{const{leading:s=!0,trailing:o=!1}=null!=t?t:{};let i=!1,c=null,u=null,l=!1;const a=()=>{null==u||u.unsubscribe(),u=null,o&&(d(),l&&r.complete())},h=()=>{u=null,l&&r.complete()},f=t=>u=De(e(t)).subscribe(F(r,a,h)),d=()=>{if(i){i=!1;const e=c;c=null,r.next(e),!l&&f(e)}};n.subscribe(F(r,(e=>{i=!0,c=e,(!u||u.closed)&&(s?d():f(e))}),(()=>{l=!0,(!(o&&i&&u)||u.closed)&&r.complete()})))}))}function Zr(e,t=he,n){const r=Mt(e,t);return Gr((()=>r),n)}function Kr(e=he){return N(((t,n)=>{let r=e.now();t.subscribe(F(n,(t=>{const s=e.now(),o=s-r;r=s,n.next(new Qr(t,o))})))}))}class Qr{constructor(e,t){this.value=e,this.interval=t}}function es(e,t,n){let r,s,o;if(n=null!=n?n:fe,ct(e)?r=e:"number"==typeof e&&(s=e),!t)throw new TypeError("No observable provided to switch to");if(o=()=>t,null==r&&null==s)throw new TypeError("No timeout provided.");return lt({first:r,each:s,scheduler:n,with:o})}function ts(e=X){return ht((t=>({value:t,timestamp:e.now()})))}function ns(e){return N(((t,n)=>{let r=new V;n.next(r.asObservable());const s=e=>{r.error(e),n.error(e)};return t.subscribe(F(n,(e=>null==r?void 0:r.next(e)),(()=>{r.complete(),n.complete()}),s)),De(e).subscribe(F(n,(()=>{r.complete(),n.next(r=new V)}),h,s)),()=>{null==r||r.unsubscribe(),r=null}}))}function rs(e,t=0){const n=t>0?t:e;return N(((t,r)=>{let s=[new V],o=[],i=0;r.next(s[0].asObservable()),t.subscribe(F(r,(t=>{for(const e of s)e.next(t);const o=i-e+1;if(o>=0&&o%n==0&&s.shift().complete(),++i%n==0){const e=new V;s.push(e),r.next(e.asObservable())}}),(()=>{for(;s.length>0;)s.shift().complete();r.complete()}),(e=>{for(;s.length>0;)s.shift().error(e);r.error(e)}),(()=>{o=null,s=null})))}))}function ss(e,...t){var n,o;const i=null!==(n=Ee(t))&&void 0!==n?n:he,c=null!==(o=t[0])&&void 0!==o?o:null,u=t[1]||1/0;return N(((t,n)=>{let o=[],l=!1;const a=e=>{const{window:t,subs:n}=e;t.complete(),n.unsubscribe(),r(o,e),l&&h()},h=()=>{if(o){const t=new s;n.add(t);const r=new V,c={window:r,subs:t,seen:0};o.push(c),n.next(r.asObservable()),We(t,i,(()=>a(c)),e)}};null!==c&&c>=0?We(n,i,h,c,!0):l=!0,h();const f=e=>o.slice().forEach(e),d=e=>{f((({window:t})=>e(t))),e(n),n.unsubscribe()};return t.subscribe(F(n,(e=>{f((t=>{t.window.next(e),u<=++t.seen&&a(t)}))}),(()=>d((e=>e.complete()))),(e=>d((t=>t.error(e)))))),()=>{o=null}}))}function os(e,t){return N(((n,o)=>{const i=[],c=e=>{for(;0{const n=new V;i.push(n);const u=new s;let l;try{l=De(t(e))}catch(e){return void c(e)}o.next(n.asObservable()),u.add(l.subscribe(F(o,(()=>{r(i,n),n.complete(),u.unsubscribe()}),h,c)))}),h)),n.subscribe(F(o,(e=>{const t=i.slice();for(const n of t)n.next(e)}),(()=>{for(;0{for(;0{let r,s;const o=e=>{r.error(e),n.error(e)},i=()=>{let t;null==s||s.unsubscribe(),null==r||r.complete(),r=new V,n.next(r.asObservable());try{t=De(e())}catch(e){return void o(e)}t.subscribe(s=F(n,i,i,o))};i(),t.subscribe(F(n,(e=>r.next(e)),(()=>{r.complete(),n.complete()}),o,(()=>{null==s||s.unsubscribe(),r=null})))}))}function cs(...e){const t=Se(e);return N(((n,r)=>{const s=e.length,o=new Array(s);let i=e.map((()=>!1)),c=!1;for(let t=0;t{o[t]=e,c||i[t]||(i[t]=!0,(c=i.every(A))&&(i=null))}),h));n.subscribe(F(r,(e=>{if(c){const n=[e,...o];r.next(t?t(...n):n)}})))}))}function us(e){return yn(on,e)}function ls(...e){return N(((t,n)=>{on(t,...e).subscribe(n)}))}function as(...e){return ls(...e)}function hs(e,t){return n=>[Qt(e,t)(n),Qt(Kt(e,t))(n)]}function fs(...e){return Or(...Jt(e))}function ds(e){switch(e.responseType){case"json":if("response"in e)return e.response;{const t=e;return JSON.parse(t.responseText)}case"document":return e.responseXML;case"text":default:if("response"in e)return e.response;return e.responseText}}class bs{constructor(e,t,n,r="download_load"){this.originalEvent=e,this.xhr=t,this.request=n,this.type=r;const{status:s,responseType:o}=t;this.status=null!=s?s:0,this.responseType=null!=o?o:"";const i=t.getAllResponseHeaders();this.responseHeaders=i?i.split("\n").reduce(((e,t)=>{const n=t.indexOf(": ");return e[t.slice(0,n)]=t.slice(n+2),e}),{}):{},this.response=ds(t);const{loaded:c,total:u}=e;this.loaded=c,this.total=u}}const ps=t((e=>function(e,t,n){let r;this.message=e,this.name="AjaxError",this.xhr=t,this.request=n,this.status=t.status,this.responseType=t.responseType;try{r=ds(t)}catch(e){r=t.responseText}this.response=r})),ms=(()=>{function e(e,t){return ps.call(this,"ajax timeout",e,t),this.name="AjaxTimeoutError",this}return e.prototype=Object.create(ps.prototype),e})();function vs(e,t){return Es({method:"GET",url:e,headers:t})}function ws(e,t,n){return Es({method:"POST",url:e,body:t,headers:n})}function ys(e,t){return Es({method:"DELETE",url:e,headers:t})}function xs(e,t,n){return Es({method:"PUT",url:e,body:t,headers:n})}function _s(e,t,n){return Es({method:"PATCH",url:e,body:t,headers:n})}const gs=ht((e=>e.response));function Ss(e,t){return gs(Es({method:"GET",url:e,headers:t}))}const Es=(()=>{const e=e=>{return t="string"==typeof e?{url:e}:e,new j((e=>{var n,r;const s=Object.assign({async:!0,crossDomain:!1,withCredentials:!1,method:"GET",timeout:0,responseType:"json"},t),{queryParams:o,body:i,headers:c}=s;let u=s.url;if(!u)throw new TypeError("url is required");if(o){let e;if(u.includes("?")){const t=u.split("?");if(2e.set(n,t))),u=t[0]+"?"+e}else e=new URLSearchParams(o),u=u+"?"+e}const l={};if(c)for(const e in c)c.hasOwnProperty(e)&&(l[e.toLowerCase()]=c[e]);const a=s.crossDomain;a||"x-requested-with"in l||(l["x-requested-with"]="XMLHttpRequest");const{withCredentials:h,xsrfCookieName:f,xsrfHeaderName:d}=s;if((h||!a)&&f&&d){const e=null!==(r=null===(n=null===document||void 0===document?void 0:document.cookie.match(new RegExp(`(^|;\\s*)(${f})=([^;]*)`)))||void 0===n?void 0:n.pop())&&void 0!==r?r:"";e&&(l[d]=e)}const b=function(e,t){var n;if(!e||"string"==typeof e||function(e){return"undefined"!=typeof FormData&&e instanceof FormData}(e)||function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}(e)||function(e){return ks(e,"ArrayBuffer")}(e)||function(e){return ks(e,"File")}(e)||function(e){return ks(e,"Blob")}(e)||function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream}(e))return e;if(function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)}(e))return e.buffer;if("object"==typeof e)return t["content-type"]=null!==(n=t["content-type"])&&void 0!==n?n:"application/json;charset=utf-8",JSON.stringify(e);throw new TypeError("Unknown body type")}(i,l),p=Object.assign(Object.assign({},s),{url:u,headers:l,body:b});let m;m=t.createXHR?t.createXHR():new XMLHttpRequest;{const{progressSubscriber:n,includeDownloadProgress:r=!1,includeUploadProgress:s=!1}=t,o=(t,r)=>{m.addEventListener(t,(()=>{var t;const s=r();null===(t=null==n?void 0:n.error)||void 0===t||t.call(n,s),e.error(s)}))};o("timeout",(()=>new ms(m,p))),o("abort",(()=>new ps("aborted",m,p)));const i=(e,t)=>new bs(t,m,p,`${e}_${t.type}`),c=(t,n,r)=>{t.addEventListener(n,(t=>{e.next(i(r,t))}))};s&&[Os,Ts,As].forEach((e=>c(m.upload,e,"upload"))),n&&[Os,Ts].forEach((e=>m.upload.addEventListener(e,(e=>{var t;return null===(t=null==n?void 0:n.next)||void 0===t?void 0:t.call(n,e)})))),r&&[Os,Ts].forEach((e=>c(m,e,"download")));const u=t=>{const n="ajax error"+(t?" "+t:"");e.error(new ps(n,m,p))};m.addEventListener("error",(e=>{var t;null===(t=null==n?void 0:n.error)||void 0===t||t.call(n,e),u()})),m.addEventListener(As,(t=>{var r,s;const{status:o}=m;if(o<400){let s;null===(r=null==n?void 0:n.complete)||void 0===r||r.call(n);try{s=i("download",t)}catch(t){return void e.error(t)}e.next(s),e.complete()}else null===(s=null==n?void 0:n.error)||void 0===s||s.call(n,t),u(o)}))}const{user:v,method:w,async:y}=p;v?m.open(w,u,y,v,p.password):m.open(w,u,y),y&&(m.timeout=p.timeout,m.responseType=p.responseType),"withCredentials"in m&&(m.withCredentials=p.withCredentials);for(const e in l)l.hasOwnProperty(e)&&m.setRequestHeader(e,l[e]);return b?m.send(b):m.send(),()=>{m&&4!==m.readyState&&m.abort()}}));var t};return e.get=vs,e.post=ws,e.delete=ys,e.put=xs,e.patch=_s,e.getJSON=Ss,e})(),Os="loadstart",Ts="progress",As="load";const Is=Object.prototype.toString;function ks(e,t){return Is.call(e)===`[object ${t}]`}function js(e,t={}){const{selector:n}=t,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s{const s=new AbortController,{signal:o}=s;let i=!0;const{signal:c}=r;if(c)if(c.aborted)s.abort();else{const e=()=>{o.aborted||s.abort()};c.addEventListener("abort",e),t.add((()=>c.removeEventListener("abort",e)))}const u=Object.assign(Object.assign({},r),{signal:o}),l=e=>{i=!1,t.error(e)};return fetch(e,u).then((e=>{n?De(n(e)).subscribe(F(t,void 0,(()=>{i=!1,t.complete()}),l)):(i=!1,t.next(e),t.complete())})).catch(l),()=>{i&&s.abort()}}))}const Cs={url:"",deserializer:e=>JSON.parse(e.data),serializer:e=>JSON.stringify(e)};class Ps extends ${constructor(e,t){if(super(),this._socket=null,e instanceof j)this.destination=t,this.source=e;else{const t=this._config=Object.assign({},Cs);if(this._output=new V,"string"==typeof e)t.url=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(!t.WebSocketCtor&&WebSocket)t.WebSocketCtor=WebSocket;else if(!t.WebSocketCtor)throw new Error("no WebSocket constructor can be found");this.destination=new Y}}lift(e){const t=new Ps(this._config,this.destination);return t.operator=e,t.source=this,t}_resetState(){this._socket=null,this.source||(this.destination=new Y),this._output=new V}multiplex(e,t,n){const r=this;return new j((s=>{try{r.next(e())}catch(e){s.error(e)}const o=r.subscribe({next:e=>{try{n(e)&&s.next(e)}catch(e){s.error(e)}},error:e=>s.error(e),complete:()=>s.complete()});return()=>{try{r.next(t())}catch(e){s.error(e)}o.unsubscribe()}}))}_connectSocket(){const{WebSocketCtor:e,protocol:t,url:n,binaryType:r}=this._config,o=this._output;let i=null;try{i=t?new e(n,t):new e(n),this._socket=i,r&&(this._socket.binaryType=r)}catch(e){return void o.error(e)}const c=new s((()=>{this._socket=null,i&&1===i.readyState&&i.close()}));i.onopen=e=>{const{_socket:t}=this;if(!t)return i.close(),void this._resetState();const{openObserver:n}=this._config;n&&n.next(e);const r=this.destination;this.destination=w.create((e=>{if(1===i.readyState)try{const{serializer:t}=this._config;i.send(t(e))}catch(e){this.destination.error(e)}}),(e=>{const{closingObserver:t}=this._config;t&&t.next(void 0),e&&e.code?i.close(e.code,e.reason):o.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }")),this._resetState()}),(()=>{const{closingObserver:e}=this._config;e&&e.next(void 0),i.close(),this._resetState()})),r&&r instanceof Y&&c.add(r.subscribe(this.destination))},i.onerror=e=>{this._resetState(),o.error(e)},i.onclose=e=>{i===this._socket&&this._resetState();const{closeObserver:t}=this._config;t&&t.next(e),e.wasClean?o.complete():o.error(e)},i.onmessage=e=>{try{const{deserializer:t}=this._config;o.next(t(e))}catch(e){o.error(e)}}}_subscribe(e){const{source:t}=this;return t?t.subscribe(e):(this._socket||this._connectSocket(),this._output.subscribe(e),e.add((()=>{const{_socket:e}=this;0===this._output.observers.length&&(!e||1!==e.readyState&&0!==e.readyState||e.close(),this._resetState())})),e)}unsubscribe(){const{_socket:e}=this;!e||1!==e.readyState&&0!==e.readyState||e.close(),this._resetState(),super.unsubscribe()}}function Ns(e){return new Ps(e)}function Fs(e,t){for(let n=0,r=t.length;n