@invergent/website-widget 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ "use strict";var SurogatesWidget=(()=>{var Qv=Object.create;var mn=Object.defineProperty;var ep=Object.getOwnPropertyDescriptor;var tp=Object.getOwnPropertyNames;var rp=Object.getPrototypeOf,np=Object.prototype.hasOwnProperty;var il=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hn=(t,e)=>{for(var r in e)mn(t,r,{get:e[r],enumerable:!0})},al=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tp(e))!np.call(t,i)&&i!==r&&mn(t,i,{get:()=>e[i],enumerable:!(n=ep(e,i))||n.enumerable});return t};var ls=(t,e,r)=>(r=t!=null?Qv(rp(t)):{},al(e||!t||!t.__esModule?mn(r,"default",{value:t,enumerable:!0}):r,t)),ip=t=>al(mn({},"__esModule",{value:!0}),t);var U=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.isFunction=void 0;function Wh(t){return typeof t=="function"}qn.isFunction=Wh});var ze=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.createErrorClass=void 0;function Bh(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}kn.createErrorClass=Bh});var Es=b(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.UnsubscriptionError=void 0;var Hh=ze();Rn.UnsubscriptionError=Hh.createErrorClass(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
2
+ `+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=r}})});var Re=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.arrRemove=void 0;function $h(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}Mn.arrRemove=$h});var ce=b(oe=>{"use strict";var Nl=oe&&oe.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xl=oe&&oe.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},Cl=oe&&oe.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(oe,"__esModule",{value:!0});oe.isSubscription=oe.EMPTY_SUBSCRIPTION=oe.Subscription=void 0;var Qr=U(),Os=Es(),ql=Re(),Ts=(function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Nl(o),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(_){e={error:_}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(Qr.isFunction(f))try{f()}catch(_){a=_ instanceof Os.UnsubscriptionError?_.errors:[_]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var S=Nl(m),p=S.next();!p.done;p=S.next()){var v=p.value;try{kl(v)}catch(_){a=a??[],_ instanceof Os.UnsubscriptionError?a=Cl(Cl([],xl(a)),xl(_.errors)):a.push(_)}}}catch(_){n={error:_}}finally{try{p&&!p.done&&(i=S.return)&&i.call(S)}finally{if(n)throw n.error}}}if(a)throw new Os.UnsubscriptionError(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)kl(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&ql.arrRemove(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&ql.arrRemove(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})();oe.Subscription=Ts;oe.EMPTY_SUBSCRIPTION=Ts.EMPTY;function zh(t){return t instanceof Ts||t&&"closed"in t&&Qr.isFunction(t.remove)&&Qr.isFunction(t.add)&&Qr.isFunction(t.unsubscribe)}oe.isSubscription=zh;function kl(t){Qr.isFunction(t)?t():t.unsubscribe()}});var nr=b(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.config=void 0;jn.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var As=b(Ee=>{"use strict";var Rl=Ee&&Ee.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},Ml=Ee&&Ee.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.timeoutProvider=void 0;Ee.timeoutProvider={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Ee.timeoutProvider.delegate;return i?.setTimeout?i.setTimeout.apply(i,Ml([t,e],Rl(r))):setTimeout.apply(void 0,Ml([t,e],Rl(r)))},clearTimeout:function(t){var e=Ee.timeoutProvider.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0}});var ws=b(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.reportUnhandledError=void 0;var Kh=nr(),Xh=As();function Zh(t){Xh.timeoutProvider.setTimeout(function(){var e=Kh.config.onUnhandledError;if(e)e(t);else throw t})}Ln.reportUnhandledError=Zh});var ee=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.noop=void 0;function Yh(){}Fn.noop=Yh});var jl=b(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createNotification=Oe.nextNotification=Oe.errorNotification=Oe.COMPLETE_NOTIFICATION=void 0;Oe.COMPLETE_NOTIFICATION=(function(){return Dn("C",void 0,void 0)})();function Jh(t){return Dn("E",void 0,t)}Oe.errorNotification=Jh;function Qh(t){return Dn("N",t,void 0)}Oe.nextNotification=Qh;function Dn(t,e,r){return{kind:t,value:e,error:r}}Oe.createNotification=Dn});var Un=b(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.captureError=ir.errorContext=void 0;var Ll=nr(),jt=null;function e_(t){if(Ll.config.useDeprecatedSynchronousErrorHandling){var e=!jt;if(e&&(jt={errorThrown:!1,error:null}),t(),e){var r=jt,n=r.errorThrown,i=r.error;if(jt=null,n)throw i}}else t()}ir.errorContext=e_;function t_(t){Ll.config.useDeprecatedSynchronousErrorHandling&&jt&&(jt.errorThrown=!0,jt.error=t)}ir.captureError=t_});var ar=b(me=>{"use strict";var Ul=me&&me.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(me,"__esModule",{value:!0});me.EMPTY_OBSERVER=me.SafeSubscriber=me.Subscriber=void 0;var r_=U(),Fl=ce(),xs=nr(),n_=ws(),Dl=ee(),Is=jl(),i_=As(),a_=Un(),Gl=(function(t){Ul(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Fl.isSubscription(r)&&r.add(n)):n.destination=me.EMPTY_OBSERVER,n}return e.create=function(r,n,i){return new Vl(r,n,i)},e.prototype.next=function(r){this.isStopped?Ns(Is.nextNotification(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?Ns(Is.errorNotification(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?Ns(Is.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(Fl.Subscription);me.Subscriber=Gl;var o_=Function.prototype.bind;function Ps(t,e){return o_.call(t,e)}var s_=(function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){Gn(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){Gn(n)}else Gn(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){Gn(r)}},t})(),Vl=(function(t){Ul(e,t);function e(r,n,i){var a=t.call(this)||this,o;if(r_.isFunction(r)||!r)o={next:r??void 0,error:n??void 0,complete:i??void 0};else{var s;a&&xs.config.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return a.unsubscribe()},o={next:r.next&&Ps(r.next,s),error:r.error&&Ps(r.error,s),complete:r.complete&&Ps(r.complete,s)}):o=r}return a.destination=new s_(o),a}return e})(Gl);me.SafeSubscriber=Vl;function Gn(t){xs.config.useDeprecatedSynchronousErrorHandling?a_.captureError(t):n_.reportUnhandledError(t)}function u_(t){throw t}function Ns(t,e){var r=xs.config.onStoppedNotification;r&&i_.timeoutProvider.setTimeout(function(){return r(t,e)})}me.EMPTY_OBSERVER={closed:!0,next:Dl.noop,error:u_,complete:Dl.noop}});var en=b(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.observable=void 0;Vn.observable=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})()});var te=b(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.identity=void 0;function c_(t){return t}Wn.identity=c_});var tn=b(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.pipeFromArray=or.pipe=void 0;var l_=te();function d_(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Wl(t)}or.pipe=d_;function Wl(t){return t.length===0?l_.identity:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}or.pipeFromArray=Wl});var W=b(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Observable=void 0;var qs=ar(),f_=ce(),v_=en(),p_=tn(),m_=nr(),Cs=U(),h_=Un(),__=(function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,a=y_(e)?e:new qs.SafeSubscriber(e,r,n);return h_.errorContext(function(){var o=i,s=o.operator,l=o.source;a.add(s?s.call(a,l):l?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Bl(r),new r(function(i,a){var o=new qs.SafeSubscriber({next:function(s){try{e(s)}catch(l){a(l),o.unsubscribe()}},error:a,complete:i});n.subscribe(o)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[v_.observable]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return p_.pipeFromArray(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Bl(e),new e(function(n,i){var a;r.subscribe(function(o){return a=o},function(o){return i(o)},function(){return n(a)})})},t.create=function(e){return new t(e)},t})();Bn.Observable=__;function Bl(t){var e;return(e=t??m_.config.Promise)!==null&&e!==void 0?e:Promise}function b_(t){return t&&Cs.isFunction(t.next)&&Cs.isFunction(t.error)&&Cs.isFunction(t.complete)}function y_(t){return t&&t instanceof qs.Subscriber||b_(t)&&f_.isSubscription(t)}});var I=b(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.operate=sr.hasLift=void 0;var g_=U();function Hl(t){return g_.isFunction(t?.lift)}sr.hasLift=Hl;function S_(t){return function(e){if(Hl(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}sr.operate=S_});var x=b(Ke=>{"use strict";var E_=Ke&&Ke.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Ke,"__esModule",{value:!0});Ke.OperatorSubscriber=Ke.createOperatorSubscriber=void 0;var O_=ar();function T_(t,e,r,n,i){return new $l(t,e,r,n,i)}Ke.createOperatorSubscriber=T_;var $l=(function(t){E_(e,t);function e(r,n,i,a,o,s){var l=t.call(this,r)||this;return l.onFinalize=o,l.shouldUnsubscribe=s,l._next=n?function(u){try{n(u)}catch(f){r.error(f)}}:t.prototype._next,l._error=a?function(u){try{a(u)}catch(f){r.error(f)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(u){r.error(u)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e})(O_.Subscriber);Ke.OperatorSubscriber=$l});var $n=b(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.refCount=void 0;var A_=I(),w_=x();function I_(){return A_.operate(function(t,e){var r=null;t._refCount++;var n=w_.createOperatorSubscriber(e,void 0,void 0,void 0,function(){if(!t||t._refCount<=0||0<--t._refCount){r=null;return}var i=t._connection,a=r;r=null,i&&(!a||i===a)&&i.unsubscribe(),e.unsubscribe()});t.subscribe(n),n.closed||(r=t.connect())})}Hn.refCount=I_});var rn=b(ur=>{"use strict";var P_=ur&&ur.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(ur,"__esModule",{value:!0});ur.ConnectableObservable=void 0;var N_=W(),zl=ce(),x_=$n(),C_=x(),q_=I(),k_=(function(t){P_(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._subject=null,i._refCount=0,i._connection=null,q_.hasLift(r)&&(i.lift=r.lift),i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var r=this._connection;this._subject=this._connection=null,r?.unsubscribe()},e.prototype.connect=function(){var r=this,n=this._connection;if(!n){n=this._connection=new zl.Subscription;var i=this.getSubject();n.add(this.source.subscribe(C_.createOperatorSubscriber(i,void 0,function(){r._teardown(),i.complete()},function(a){r._teardown(),i.error(a)},function(){return r._teardown()}))),n.closed&&(this._connection=null,n=zl.Subscription.EMPTY)}return n},e.prototype.refCount=function(){return x_.refCount()(this)},e})(N_.Observable);ur.ConnectableObservable=k_});var Kl=b(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.performanceTimestampProvider=void 0;nn.performanceTimestampProvider={now:function(){return(nn.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var ks=b(he=>{"use strict";var Xl=he&&he.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},Zl=he&&he.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(he,"__esModule",{value:!0});he.animationFrameProvider=void 0;var R_=ce();he.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=he.animationFrameProvider.delegate;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);var i=e(function(a){r=void 0,t(a)});return new R_.Subscription(function(){return r?.(i)})},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=he.animationFrameProvider.delegate;return(r?.requestAnimationFrame||requestAnimationFrame).apply(void 0,Zl([],Xl(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=he.animationFrameProvider.delegate;return(r?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,Zl([],Xl(t)))},delegate:void 0}});var Ql=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.animationFrames=void 0;var M_=W(),j_=Kl(),Yl=ks();function L_(t){return t?Jl(t):F_}zn.animationFrames=L_;function Jl(t){return new M_.Observable(function(e){var r=t||j_.performanceTimestampProvider,n=r.now(),i=0,a=function(){e.closed||(i=Yl.animationFrameProvider.requestAnimationFrame(function(o){i=0;var s=r.now();e.next({timestamp:t?s:o,elapsed:s-n}),a()}))};return a(),function(){i&&Yl.animationFrameProvider.cancelAnimationFrame(i)}})}var F_=Jl()});var Rs=b(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.ObjectUnsubscribedError=void 0;var D_=ze();Kn.ObjectUnsubscribedError=D_.createErrorClass(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var re=b(Te=>{"use strict";var td=Te&&Te.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),U_=Te&&Te.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Te,"__esModule",{value:!0});Te.AnonymousSubject=Te.Subject=void 0;var ed=W(),js=ce(),G_=Rs(),V_=Re(),Ms=Un(),rd=(function(t){td(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Ls(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new G_.ObjectUnsubscribedError},e.prototype.next=function(r){var n=this;Ms.errorContext(function(){var i,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=U_(n.currentObservers),s=o.next();!s.done;s=o.next()){var l=s.value;l.next(r)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;Ms.errorContext(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;Ms.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,o=i.isStopped,s=i.observers;return a||o?js.EMPTY_SUBSCRIPTION:(this.currentObservers=null,s.push(r),new js.Subscription(function(){n.currentObservers=null,V_.arrRemove(s,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,o=n.isStopped;i?r.error(a):o&&r.complete()},e.prototype.asObservable=function(){var r=new ed.Observable;return r.source=this,r},e.create=function(r,n){return new Ls(r,n)},e})(ed.Observable);Te.Subject=rd;var Ls=(function(t){td(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:js.EMPTY_SUBSCRIPTION},e})(rd);Te.AnonymousSubject=Ls});var Fs=b(cr=>{"use strict";var W_=cr&&cr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(cr,"__esModule",{value:!0});cr.BehaviorSubject=void 0;var B_=re(),H_=(function(t){W_(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e})(B_.Subject);cr.BehaviorSubject=H_});var Xn=b(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.dateTimestampProvider=void 0;an.dateTimestampProvider={now:function(){return(an.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var Zn=b(lr=>{"use strict";var $_=lr&&lr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(lr,"__esModule",{value:!0});lr.ReplaySubject=void 0;var z_=re(),K_=Xn(),X_=(function(t){$_(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=K_.dateTimestampProvider);var a=t.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return e.prototype.next=function(r){var n=this,i=n.isStopped,a=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,l=n._windowTime;i||(a.push(r),!o&&a.push(s.now()+l)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,a=i._infiniteTimeWindow,o=i._buffer,s=o.slice(),l=0;l<s.length&&!r.closed;l+=a?1:2)r.next(s[l]);return this._checkFinalizedStatuses(r),n},e.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,i=r._timestampProvider,a=r._buffer,o=r._infiniteTimeWindow,s=(o?1:2)*n;if(n<1/0&&s<a.length&&a.splice(0,a.length-s),!o){for(var l=i.now(),u=0,f=1;f<a.length&&a[f]<=l;f+=2)u=f;u&&a.splice(0,u+1)}},e})(z_.Subject);lr.ReplaySubject=X_});var Yn=b(dr=>{"use strict";var Z_=dr&&dr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(dr,"__esModule",{value:!0});dr.AsyncSubject=void 0;var Y_=re(),J_=(function(t){Z_(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._value=null,r._hasValue=!1,r._isComplete=!1,r}return e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n._hasValue,o=n._value,s=n.thrownError,l=n.isStopped,u=n._isComplete;i?r.error(s):(l||u)&&(a&&r.next(o),r.complete())},e.prototype.next=function(r){this.isStopped||(this._value=r,this._hasValue=!0)},e.prototype.complete=function(){var r=this,n=r._hasValue,i=r._value,a=r._isComplete;a||(this._isComplete=!0,n&&t.prototype.next.call(this,i),t.prototype.complete.call(this))},e})(Y_.Subject);dr.AsyncSubject=J_});var nd=b(fr=>{"use strict";var Q_=fr&&fr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(fr,"__esModule",{value:!0});fr.Action=void 0;var eb=ce(),tb=(function(t){Q_(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},e})(eb.Subscription);fr.Action=tb});var od=b(Ae=>{"use strict";var id=Ae&&Ae.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},ad=Ae&&Ae.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.intervalProvider=void 0;Ae.intervalProvider={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Ae.intervalProvider.delegate;return i?.setInterval?i.setInterval.apply(i,ad([t,e],id(r))):setInterval.apply(void 0,ad([t,e],id(r)))},clearInterval:function(t){var e=Ae.intervalProvider.delegate;return(e?.clearInterval||clearInterval)(t)},delegate:void 0}});var pr=b(vr=>{"use strict";var rb=vr&&vr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(vr,"__esModule",{value:!0});vr.AsyncAction=void 0;var nb=nd(),sd=od(),ib=Re(),ab=(function(t){rb(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),sd.intervalProvider.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&sd.intervalProvider.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,a;try{this.work(r)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ib.arrRemove(a,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e})(nb.Action);vr.AsyncAction=ab});var cd=b(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.TestTools=mr.Immediate=void 0;var ob=1,Ds,Jn={};function ud(t){return t in Jn?(delete Jn[t],!0):!1}mr.Immediate={setImmediate:function(t){var e=ob++;return Jn[e]=!0,Ds||(Ds=Promise.resolve()),Ds.then(function(){return ud(e)&&t()}),e},clearImmediate:function(t){ud(t)}};mr.TestTools={pending:function(){return Object.keys(Jn).length}}});var dd=b(we=>{"use strict";var sb=we&&we.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},ub=we&&we.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(we,"__esModule",{value:!0});we.immediateProvider=void 0;var ld=cd(),cb=ld.Immediate.setImmediate,lb=ld.Immediate.clearImmediate;we.immediateProvider={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=we.immediateProvider.delegate;return(r?.setImmediate||cb).apply(void 0,ub([],sb(t)))},clearImmediate:function(t){var e=we.immediateProvider.delegate;return(e?.clearImmediate||lb)(t)},delegate:void 0}});var vd=b(hr=>{"use strict";var db=hr&&hr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(hr,"__esModule",{value:!0});hr.AsapAction=void 0;var fb=pr(),fd=dd(),vb=(function(t){db(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=fd.immediateProvider.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var o=r.actions;n!=null&&((a=o[o.length-1])===null||a===void 0?void 0:a.id)!==n&&(fd.immediateProvider.clearImmediate(n),r._scheduled===n&&(r._scheduled=void 0))},e})(fb.AsyncAction);hr.AsapAction=vb});var Us=b(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.Scheduler=void 0;var pb=Xn(),mb=(function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=pb.dateTimestampProvider.now,t})();Qn.Scheduler=mb});var br=b(_r=>{"use strict";var hb=_r&&_r.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(_r,"__esModule",{value:!0});_r.AsyncScheduler=void 0;var pd=Us(),_b=(function(t){hb(e,t);function e(r,n){n===void 0&&(n=pd.Scheduler.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e})(pd.Scheduler);_r.AsyncScheduler=_b});var md=b(yr=>{"use strict";var bb=yr&&yr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(yr,"__esModule",{value:!0});yr.AsapScheduler=void 0;var yb=br(),gb=(function(t){bb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e})(yb.AsyncScheduler);yr.AsapScheduler=gb});var hd=b(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.asap=Lt.asapScheduler=void 0;var Sb=vd(),Eb=md();Lt.asapScheduler=new Eb.AsapScheduler(Sb.AsapAction);Lt.asap=Lt.asapScheduler});var se=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.async=Ft.asyncScheduler=void 0;var Ob=pr(),Tb=br();Ft.asyncScheduler=new Tb.AsyncScheduler(Ob.AsyncAction);Ft.async=Ft.asyncScheduler});var _d=b(gr=>{"use strict";var Ab=gr&&gr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(gr,"__esModule",{value:!0});gr.QueueAction=void 0;var wb=pr(),Ib=(function(t){Ab(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.flush(this),0)},e})(wb.AsyncAction);gr.QueueAction=Ib});var bd=b(Sr=>{"use strict";var Pb=Sr&&Sr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.QueueScheduler=void 0;var Nb=br(),xb=(function(t){Pb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Nb.AsyncScheduler);Sr.QueueScheduler=xb});var yd=b(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.queue=Dt.queueScheduler=void 0;var Cb=_d(),qb=bd();Dt.queueScheduler=new qb.QueueScheduler(Cb.QueueAction);Dt.queue=Dt.queueScheduler});var Sd=b(Er=>{"use strict";var kb=Er&&Er.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Er,"__esModule",{value:!0});Er.AnimationFrameAction=void 0;var Rb=pr(),gd=ks(),Mb=(function(t){kb(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=gd.animationFrameProvider.requestAnimationFrame(function(){return r.flush(void 0)})))},e.prototype.recycleAsyncId=function(r,n,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var o=r.actions;n!=null&&((a=o[o.length-1])===null||a===void 0?void 0:a.id)!==n&&(gd.animationFrameProvider.cancelAnimationFrame(n),r._scheduled=void 0)},e})(Rb.AsyncAction);Er.AnimationFrameAction=Mb});var Ed=b(Or=>{"use strict";var jb=Or&&Or.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Or,"__esModule",{value:!0});Or.AnimationFrameScheduler=void 0;var Lb=br(),Fb=(function(t){jb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e})(Lb.AsyncScheduler);Or.AnimationFrameScheduler=Fb});var Od=b(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.animationFrame=Ut.animationFrameScheduler=void 0;var Db=Sd(),Ub=Ed();Ut.animationFrameScheduler=new Ub.AnimationFrameScheduler(Db.AnimationFrameAction);Ut.animationFrame=Ut.animationFrameScheduler});var wd=b(Xe=>{"use strict";var Td=Xe&&Xe.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.VirtualAction=Xe.VirtualTimeScheduler=void 0;var Gb=pr(),Vb=ce(),Wb=br(),Bb=(function(t){Td(e,t);function e(r,n){r===void 0&&(r=Ad),n===void 0&&(n=1/0);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,a,o;(o=n[0])&&o.delay<=i&&(n.shift(),this.frame=o.delay,!(a=o.execute(o.state,o.delay))););if(a){for(;o=n.shift();)o.unsubscribe();throw a}},e.frameTimeFactor=10,e})(Wb.AsyncScheduler);Xe.VirtualTimeScheduler=Bb;var Ad=(function(t){Td(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var a=t.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.index=i,a.active=!0,a.index=r.index=i,a}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}else return Vb.Subscription.EMPTY},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var a=r.actions;return a.push(this),a.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(r,n,i){i===void 0&&(i=0)},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e})(Gb.AsyncAction);Xe.VirtualAction=Ad});var _e=b(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.empty=Gt.EMPTY=void 0;var Id=W();Gt.EMPTY=new Id.Observable(function(t){return t.complete()});function Hb(t){return t?$b(t):Gt.EMPTY}Gt.empty=Hb;function $b(t){return new Id.Observable(function(e){return t.schedule(function(){return e.complete()})})}});var on=b(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.isScheduler=void 0;var zb=U();function Kb(t){return t&&zb.isFunction(t.schedule)}ei.isScheduler=Kb});var ue=b(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.popNumber=Ze.popScheduler=Ze.popResultSelector=void 0;var Xb=U(),Zb=on();function Gs(t){return t[t.length-1]}function Yb(t){return Xb.isFunction(Gs(t))?t.pop():void 0}Ze.popResultSelector=Yb;function Jb(t){return Zb.isScheduler(Gs(t))?t.pop():void 0}Ze.popScheduler=Jb;function Qb(t,e){return typeof Gs(t)=="number"?t.pop():e}Ze.popNumber=Qb});var ri=b(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.isArrayLike=void 0;ti.isArrayLike=(function(t){return t&&typeof t.length=="number"&&typeof t!="function"})});var Vs=b(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.isPromise=void 0;var ey=U();function ty(t){return ey.isFunction(t?.then)}ni.isPromise=ty});var Ws=b(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.isInteropObservable=void 0;var ry=en(),ny=U();function iy(t){return ny.isFunction(t[ry.observable])}ii.isInteropObservable=iy});var Bs=b(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.isAsyncIterable=void 0;var ay=U();function oy(t){return Symbol.asyncIterator&&ay.isFunction(t?.[Symbol.asyncIterator])}ai.isAsyncIterable=oy});var Hs=b(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.createInvalidObservableTypeError=void 0;function sy(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}oi.createInvalidObservableTypeError=sy});var $s=b(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.iterator=Tr.getSymbolIterator=void 0;function Pd(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}Tr.getSymbolIterator=Pd;Tr.iterator=Pd()});var zs=b(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.isIterable=void 0;var uy=$s(),cy=U();function ly(t){return cy.isFunction(t?.[uy.iterator])}si.isIterable=ly});var ui=b(ve=>{"use strict";var dy=ve&&ve.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ar=ve&&ve.__await||function(t){return this instanceof Ar?(this.v=t,this):new Ar(t)},fy=ve&&ve.__asyncGenerator||function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(S){n[S]&&(i[S]=function(p){return new Promise(function(v,_){a.push([S,p,v,_])>1||s(S,p)})})}function s(S,p){try{l(n[S](p))}catch(v){m(a[0][3],v)}}function l(S){S.value instanceof Ar?Promise.resolve(S.value.v).then(u,f):m(a[0][2],S)}function u(S){s("next",S)}function f(S){s("throw",S)}function m(S,p){S(p),a.shift(),a.length&&s(a[0][0],a[0][1])}};Object.defineProperty(ve,"__esModule",{value:!0});ve.isReadableStreamLike=ve.readableStreamLikeToAsyncGenerator=void 0;var vy=U();function py(t){return fy(this,arguments,function(){var r,n,i,a;return dy(this,function(o){switch(o.label){case 0:r=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Ar(r.read())];case 3:return n=o.sent(),i=n.value,a=n.done,a?[4,Ar(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ar(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}ve.readableStreamLikeToAsyncGenerator=py;function my(t){return vy.isFunction(t?.getReader)}ve.isReadableStreamLike=my});var M=b(z=>{"use strict";var hy=z&&z.__awaiter||function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(m){o(m)}}function l(f){try{u(n.throw(f))}catch(m){o(m)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(t,e||[])).next())})},_y=z&&z.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},by=z&&z.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ks=="function"?Ks(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(o){return new Promise(function(s,l){o=t[a](o),i(s,l,o.done,o.value)})}}function i(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}},Ks=z&&z.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(z,"__esModule",{value:!0});z.fromReadableStreamLike=z.fromAsyncIterable=z.fromIterable=z.fromPromise=z.fromArrayLike=z.fromInteropObservable=z.innerFrom=void 0;var yy=ri(),gy=Vs(),wr=W(),Sy=Ws(),Ey=Bs(),Oy=Hs(),Ty=zs(),Nd=ui(),Ay=U(),wy=ws(),Iy=en();function Py(t){if(t instanceof wr.Observable)return t;if(t!=null){if(Sy.isInteropObservable(t))return xd(t);if(yy.isArrayLike(t))return Cd(t);if(gy.isPromise(t))return qd(t);if(Ey.isAsyncIterable(t))return Xs(t);if(Ty.isIterable(t))return kd(t);if(Nd.isReadableStreamLike(t))return Rd(t)}throw Oy.createInvalidObservableTypeError(t)}z.innerFrom=Py;function xd(t){return new wr.Observable(function(e){var r=t[Iy.observable]();if(Ay.isFunction(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}z.fromInteropObservable=xd;function Cd(t){return new wr.Observable(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}z.fromArrayLike=Cd;function qd(t){return new wr.Observable(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,wy.reportUnhandledError)})}z.fromPromise=qd;function kd(t){return new wr.Observable(function(e){var r,n;try{for(var i=Ks(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(s){r={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}z.fromIterable=kd;function Xs(t){return new wr.Observable(function(e){Ny(t,e).catch(function(r){return e.error(r)})})}z.fromAsyncIterable=Xs;function Rd(t){return Xs(Nd.readableStreamLikeToAsyncGenerator(t))}z.fromReadableStreamLike=Rd;function Ny(t,e){var r,n,i,a;return hy(this,void 0,void 0,function(){var o,s;return _y(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),r=by(t),l.label=1;case 1:return[4,r.next()];case 2:if(n=l.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}});var Me=b(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.executeSchedule=void 0;function xy(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var a=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(a),!i)return a}ci.executeSchedule=xy});var Ir=b(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.observeOn=void 0;var Zs=Me(),Cy=I(),qy=x();function ky(t,e){return e===void 0&&(e=0),Cy.operate(function(r,n){r.subscribe(qy.createOperatorSubscriber(n,function(i){return Zs.executeSchedule(n,t,function(){return n.next(i)},e)},function(){return Zs.executeSchedule(n,t,function(){return n.complete()},e)},function(i){return Zs.executeSchedule(n,t,function(){return n.error(i)},e)}))})}li.observeOn=ky});var Pr=b(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.subscribeOn=void 0;var Ry=I();function My(t,e){return e===void 0&&(e=0),Ry.operate(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}di.subscribeOn=My});var Md=b(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.scheduleObservable=void 0;var jy=M(),Ly=Ir(),Fy=Pr();function Dy(t,e){return jy.innerFrom(t).pipe(Fy.subscribeOn(e),Ly.observeOn(e))}fi.scheduleObservable=Dy});var jd=b(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.schedulePromise=void 0;var Uy=M(),Gy=Ir(),Vy=Pr();function Wy(t,e){return Uy.innerFrom(t).pipe(Vy.subscribeOn(e),Gy.observeOn(e))}vi.schedulePromise=Wy});var Ld=b(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.scheduleArray=void 0;var By=W();function Hy(t,e){return new By.Observable(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}pi.scheduleArray=Hy});var Ys=b(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.scheduleIterable=void 0;var $y=W(),zy=$s(),Ky=U(),Fd=Me();function Xy(t,e){return new $y.Observable(function(r){var n;return Fd.executeSchedule(r,e,function(){n=t[zy.iterator](),Fd.executeSchedule(r,e,function(){var i,a,o;try{i=n.next(),a=i.value,o=i.done}catch(s){r.error(s);return}o?r.complete():r.next(a)},0,!0)}),function(){return Ky.isFunction(n?.return)&&n.return()}})}mi.scheduleIterable=Xy});var Js=b(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.scheduleAsyncIterable=void 0;var Zy=W(),Dd=Me();function Yy(t,e){if(!t)throw new Error("Iterable cannot be null");return new Zy.Observable(function(r){Dd.executeSchedule(r,e,function(){var n=t[Symbol.asyncIterator]();Dd.executeSchedule(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}hi.scheduleAsyncIterable=Yy});var Ud=b(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.scheduleReadableStreamLike=void 0;var Jy=Js(),Qy=ui();function eg(t,e){return Jy.scheduleAsyncIterable(Qy.readableStreamLikeToAsyncGenerator(t),e)}_i.scheduleReadableStreamLike=eg});var Qs=b(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.scheduled=void 0;var tg=Md(),rg=jd(),ng=Ld(),ig=Ys(),ag=Js(),og=Ws(),sg=Vs(),ug=ri(),cg=zs(),lg=Bs(),dg=Hs(),fg=ui(),vg=Ud();function pg(t,e){if(t!=null){if(og.isInteropObservable(t))return tg.scheduleObservable(t,e);if(ug.isArrayLike(t))return ng.scheduleArray(t,e);if(sg.isPromise(t))return rg.schedulePromise(t,e);if(lg.isAsyncIterable(t))return ag.scheduleAsyncIterable(t,e);if(cg.isIterable(t))return ig.scheduleIterable(t,e);if(fg.isReadableStreamLike(t))return vg.scheduleReadableStreamLike(t,e)}throw dg.createInvalidObservableTypeError(t)}bi.scheduled=pg});var je=b(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.from=void 0;var mg=Qs(),hg=M();function _g(t,e){return e?mg.scheduled(t,e):hg.innerFrom(t)}yi.from=_g});var Si=b(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.of=void 0;var bg=ue(),yg=je();function gg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=bg.popScheduler(t);return yg.from(t,r)}gi.of=gg});var eu=b(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.throwError=void 0;var Sg=W(),Eg=U();function Og(t,e){var r=Eg.isFunction(t)?t:function(){return t},n=function(i){return i.error(r())};return new Sg.Observable(e?function(i){return e.schedule(n,0,i)}:n)}Ei.throwError=Og});var Oi=b(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.observeNotification=Le.Notification=Le.NotificationKind=void 0;var Tg=_e(),Ag=Si(),wg=eu(),Ig=U(),Pg;(function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"})(Pg=Le.NotificationKind||(Le.NotificationKind={}));var Ng=(function(){function t(e,r,n){this.kind=e,this.value=r,this.error=n,this.hasValue=e==="N"}return t.prototype.observe=function(e){return Gd(this,e)},t.prototype.do=function(e,r,n){var i=this,a=i.kind,o=i.value,s=i.error;return a==="N"?e?.(o):a==="E"?r?.(s):n?.()},t.prototype.accept=function(e,r,n){var i;return Ig.isFunction((i=e)===null||i===void 0?void 0:i.next)?this.observe(e):this.do(e,r,n)},t.prototype.toObservable=function(){var e=this,r=e.kind,n=e.value,i=e.error,a=r==="N"?Ag.of(n):r==="E"?wg.throwError(function(){return i}):r==="C"?Tg.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+r);return a},t.createNext=function(e){return new t("N",e)},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t})();Le.Notification=Ng;function Gd(t,e){var r,n,i,a=t,o=a.kind,s=a.value,l=a.error;if(typeof o!="string")throw new TypeError('Invalid notification, missing "kind"');o==="N"?(r=e.next)===null||r===void 0||r.call(e,s):o==="E"?(n=e.error)===null||n===void 0||n.call(e,l):(i=e.complete)===null||i===void 0||i.call(e)}Le.observeNotification=Gd});var Wd=b(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.isObservable=void 0;var xg=W(),Vd=U();function Cg(t){return!!t&&(t instanceof xg.Observable||Vd.isFunction(t.lift)&&Vd.isFunction(t.subscribe))}Ti.isObservable=Cg});var Ye=b(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.EmptyError=void 0;var qg=ze();Ai.EmptyError=qg.createErrorClass(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})});var Bd=b(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.lastValueFrom=void 0;var kg=Ye();function Rg(t,e){var r=typeof e=="object";return new Promise(function(n,i){var a=!1,o;t.subscribe({next:function(s){o=s,a=!0},error:i,complete:function(){a?n(o):r?n(e.defaultValue):i(new kg.EmptyError)}})})}wi.lastValueFrom=Rg});var Hd=b(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.firstValueFrom=void 0;var Mg=Ye(),jg=ar();function Lg(t,e){var r=typeof e=="object";return new Promise(function(n,i){var a=new jg.SafeSubscriber({next:function(o){n(o),a.unsubscribe()},error:i,complete:function(){r?n(e.defaultValue):i(new Mg.EmptyError)}});t.subscribe(a)})}Ii.firstValueFrom=Lg});var tu=b(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.ArgumentOutOfRangeError=void 0;var Fg=ze();Pi.ArgumentOutOfRangeError=Fg.createErrorClass(function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var ru=b(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.NotFoundError=void 0;var Dg=ze();Ni.NotFoundError=Dg.createErrorClass(function(t){return function(r){t(this),this.name="NotFoundError",this.message=r}})});var nu=b(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.SequenceError=void 0;var Ug=ze();xi.SequenceError=Ug.createErrorClass(function(t){return function(r){t(this),this.name="SequenceError",this.message=r}})});var qi=b(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.isValidDate=void 0;function Gg(t){return t instanceof Date&&!isNaN(t)}Ci.isValidDate=Gg});var sn=b(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.timeout=Vt.TimeoutError=void 0;var Vg=se(),Wg=qi(),Bg=I(),Hg=M(),$g=ze(),zg=x(),Kg=Me();Vt.TimeoutError=$g.createErrorClass(function(t){return function(r){r===void 0&&(r=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function Xg(t,e){var r=Wg.isValidDate(t)?{first:t}:typeof t=="number"?{each:t}:t,n=r.first,i=r.each,a=r.with,o=a===void 0?Zg:a,s=r.scheduler,l=s===void 0?e??Vg.asyncScheduler:s,u=r.meta,f=u===void 0?null:u;if(n==null&&i==null)throw new TypeError("No timeout provided.");return Bg.operate(function(m,S){var p,v,_=null,g=0,O=function(E){v=Kg.executeSchedule(S,l,function(){try{p.unsubscribe(),Hg.innerFrom(o({meta:f,lastValue:_,seen:g})).subscribe(S)}catch(k){S.error(k)}},E)};p=m.subscribe(zg.createOperatorSubscriber(S,function(E){v?.unsubscribe(),g++,S.next(_=E),i>0&&O(i)},void 0,void 0,function(){v?.closed||v?.unsubscribe(),_=null})),!g&&O(n!=null?typeof n=="number"?n:+n-l.now():i)})}Vt.timeout=Xg;function Zg(t){throw new Vt.TimeoutError(t)}});var Fe=b(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.map=void 0;var Yg=I(),Jg=x();function Qg(t,e){return Yg.operate(function(r,n){var i=0;r.subscribe(Jg.createOperatorSubscriber(n,function(a){n.next(t.call(e,a,i++))}))})}ki.map=Qg});var Qe=b(Je=>{"use strict";var eS=Je&&Je.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},tS=Je&&Je.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(Je,"__esModule",{value:!0});Je.mapOneOrManyArgs=void 0;var rS=Fe(),nS=Array.isArray;function iS(t,e){return nS(e)?t.apply(void 0,tS([],eS(e))):t(e)}function aS(t){return rS.map(function(e){return iS(t,e)})}Je.mapOneOrManyArgs=aS});var au=b(et=>{"use strict";var oS=et&&et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},$d=et&&et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(et,"__esModule",{value:!0});et.bindCallbackInternals=void 0;var sS=on(),uS=W(),cS=Pr(),lS=Qe(),dS=Ir(),fS=Yn();function iu(t,e,r,n){if(r)if(sS.isScheduler(r))n=r;else return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return iu(t,e,n).apply(this,i).pipe(lS.mapOneOrManyArgs(r))};return n?function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return iu(t,e).apply(this,i).pipe(cS.subscribeOn(n),dS.observeOn(n))}:function(){for(var i=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var s=new fS.AsyncSubject,l=!0;return new uS.Observable(function(u){var f=s.subscribe(u);if(l){l=!1;var m=!1,S=!1;e.apply(i,$d($d([],oS(a)),[function(){for(var p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];if(t){var _=p.shift();if(_!=null){s.error(_);return}}s.next(1<p.length?p:p[0]),S=!0,m&&s.complete()}])),S&&s.complete(),m=!0}return f})}}et.bindCallbackInternals=iu});var zd=b(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.bindCallback=void 0;var vS=au();function pS(t,e,r){return vS.bindCallbackInternals(!1,t,e,r)}Ri.bindCallback=pS});var Kd=b(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.bindNodeCallback=void 0;var mS=au();function hS(t,e,r){return mS.bindCallbackInternals(!0,t,e,r)}Mi.bindNodeCallback=hS});var ou=b(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.argsArgArrayOrObject=void 0;var _S=Array.isArray,bS=Object.getPrototypeOf,yS=Object.prototype,gS=Object.keys;function SS(t){if(t.length===1){var e=t[0];if(_S(e))return{args:e,keys:null};if(ES(e)){var r=gS(e);return{args:r.map(function(n){return e[n]}),keys:r}}}return{args:t,keys:null}}ji.argsArgArrayOrObject=SS;function ES(t){return t&&typeof t=="object"&&bS(t)===yS}});var su=b(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.createObject=void 0;function OS(t,e){return t.reduce(function(r,n,i){return r[n]=e[i],r},{})}Li.createObject=OS});var Fi=b(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.combineLatestInit=Nr.combineLatest=void 0;var TS=W(),AS=ou(),Yd=je(),Jd=te(),wS=Qe(),Xd=ue(),IS=su(),PS=x(),NS=Me();function xS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xd.popScheduler(t),n=Xd.popResultSelector(t),i=AS.argsArgArrayOrObject(t),a=i.args,o=i.keys;if(a.length===0)return Yd.from([],r);var s=new TS.Observable(Qd(a,r,o?function(l){return IS.createObject(o,l)}:Jd.identity));return n?s.pipe(wS.mapOneOrManyArgs(n)):s}Nr.combineLatest=xS;function Qd(t,e,r){return r===void 0&&(r=Jd.identity),function(n){Zd(e,function(){for(var i=t.length,a=new Array(i),o=i,s=i,l=function(f){Zd(e,function(){var m=Yd.from(t[f],e),S=!1;m.subscribe(PS.createOperatorSubscriber(n,function(p){a[f]=p,S||(S=!0,s--),s||n.next(r(a.slice()))},function(){--o||n.complete()}))},n)},u=0;u<i;u++)l(u)},n)}}Nr.combineLatestInit=Qd;function Zd(t,e,r){t?NS.executeSchedule(r,t,e):e()}});var Ui=b(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.mergeInternals=void 0;var CS=M(),qS=Me(),ef=x();function kS(t,e,r,n,i,a,o,s){var l=[],u=0,f=0,m=!1,S=function(){m&&!l.length&&!u&&e.complete()},p=function(_){return u<n?v(_):l.push(_)},v=function(_){a&&e.next(_),u++;var g=!1;CS.innerFrom(r(_,f++)).subscribe(ef.createOperatorSubscriber(e,function(O){i?.(O),a?p(O):e.next(O)},function(){g=!0},void 0,function(){if(g)try{u--;for(var O=function(){var E=l.shift();o?qS.executeSchedule(e,o,function(){return v(E)}):v(E)};l.length&&u<n;)O();S()}catch(E){e.error(E)}}))};return t.subscribe(ef.createOperatorSubscriber(e,p,function(){m=!0,S()})),function(){s?.()}}Di.mergeInternals=kS});var Ie=b(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.mergeMap=void 0;var RS=Fe(),MS=M(),jS=I(),LS=Ui(),FS=U();function tf(t,e,r){return r===void 0&&(r=1/0),FS.isFunction(e)?tf(function(n,i){return RS.map(function(a,o){return e(n,a,i,o)})(MS.innerFrom(t(n,i)))},r):(typeof e=="number"&&(r=e),jS.operate(function(n,i){return LS.mergeInternals(n,i,t,r)}))}Gi.mergeMap=tf});var xr=b(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.mergeAll=void 0;var DS=Ie(),US=te();function GS(t){return t===void 0&&(t=1/0),DS.mergeMap(US.identity,t)}Vi.mergeAll=GS});var un=b(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.concatAll=void 0;var VS=xr();function WS(){return VS.mergeAll(1)}Wi.concatAll=WS});var cn=b(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.concat=void 0;var BS=un(),HS=ue(),$S=je();function zS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return BS.concatAll()($S.from(t,HS.popScheduler(t)))}Bi.concat=zS});var ln=b(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.defer=void 0;var KS=W(),XS=M();function ZS(t){return new KS.Observable(function(e){XS.innerFrom(t()).subscribe(e)})}Hi.defer=ZS});var rf=b($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.connectable=void 0;var YS=re(),JS=W(),QS=ln(),eE={connector:function(){return new YS.Subject},resetOnDisconnect:!0};function tE(t,e){e===void 0&&(e=eE);var r=null,n=e.connector,i=e.resetOnDisconnect,a=i===void 0?!0:i,o=n(),s=new JS.Observable(function(l){return o.subscribe(l)});return s.connect=function(){return(!r||r.closed)&&(r=QS.defer(function(){return t}).subscribe(o),a&&r.add(function(){return o=n()})),r},s}$i.connectable=tE});var nf=b(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.forkJoin=void 0;var rE=W(),nE=ou(),iE=M(),aE=ue(),oE=x(),sE=Qe(),uE=su();function cE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=aE.popResultSelector(t),n=nE.argsArgArrayOrObject(t),i=n.args,a=n.keys,o=new rE.Observable(function(s){var l=i.length;if(!l){s.complete();return}for(var u=new Array(l),f=l,m=l,S=function(v){var _=!1;iE.innerFrom(i[v]).subscribe(oE.createOperatorSubscriber(s,function(g){_||(_=!0,m--),u[v]=g},function(){return f--},void 0,function(){(!f||!_)&&(m||s.next(a?uE.createObject(a,u):u),s.complete())}))},p=0;p<l;p++)S(p)});return r?o.pipe(sE.mapOneOrManyArgs(r)):o}zi.forkJoin=cE});var of=b(Cr=>{"use strict";var lE=Cr&&Cr.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.fromEvent=void 0;var dE=M(),fE=W(),vE=Ie(),pE=ri(),Wt=U(),mE=Qe(),hE=["addListener","removeListener"],_E=["addEventListener","removeEventListener"],bE=["on","off"];function uu(t,e,r,n){if(Wt.isFunction(r)&&(n=r,r=void 0),n)return uu(t,e,r).pipe(mE.mapOneOrManyArgs(n));var i=lE(SE(t)?_E.map(function(s){return function(l){return t[s](e,l,r)}}):yE(t)?hE.map(af(t,e)):gE(t)?bE.map(af(t,e)):[],2),a=i[0],o=i[1];if(!a&&pE.isArrayLike(t))return vE.mergeMap(function(s){return uu(s,e,r)})(dE.innerFrom(t));if(!a)throw new TypeError("Invalid event target");return new fE.Observable(function(s){var l=function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];return s.next(1<u.length?u:u[0])};return a(l),function(){return o(l)}})}Cr.fromEvent=uu;function af(t,e){return function(r){return function(n){return t[r](e,n)}}}function yE(t){return Wt.isFunction(t.addListener)&&Wt.isFunction(t.removeListener)}function gE(t){return Wt.isFunction(t.on)&&Wt.isFunction(t.off)}function SE(t){return Wt.isFunction(t.addEventListener)&&Wt.isFunction(t.removeEventListener)}});var uf=b(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.fromEventPattern=void 0;var EE=W(),OE=U(),TE=Qe();function sf(t,e,r){return r?sf(t,e).pipe(TE.mapOneOrManyArgs(r)):new EE.Observable(function(n){var i=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return n.next(o.length===1?o[0]:o)},a=t(i);return OE.isFunction(e)?function(){return e(i,a)}:void 0})}Ki.fromEventPattern=sf});var lf=b(qr=>{"use strict";var AE=qr&&qr.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(qr,"__esModule",{value:!0});qr.generate=void 0;var cf=te(),wE=on(),IE=ln(),PE=Ys();function NE(t,e,r,n,i){var a,o,s,l;arguments.length===1?(a=t,l=a.initialState,e=a.condition,r=a.iterate,o=a.resultSelector,s=o===void 0?cf.identity:o,i=a.scheduler):(l=t,!n||wE.isScheduler(n)?(s=cf.identity,i=n):s=n);function u(){var f;return AE(this,function(m){switch(m.label){case 0:f=l,m.label=1;case 1:return!e||e(f)?[4,s(f)]:[3,4];case 2:m.sent(),m.label=3;case 3:return f=r(f),[3,1];case 4:return[2]}})}return IE.defer(i?function(){return PE.scheduleIterable(u(),i)}:u)}qr.generate=NE});var df=b(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.iif=void 0;var xE=ln();function CE(t,e,r){return xE.defer(function(){return t()?e:r})}Xi.iif=CE});var tt=b(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.timer=void 0;var qE=W(),kE=se(),RE=on(),ME=qi();function jE(t,e,r){t===void 0&&(t=0),r===void 0&&(r=kE.async);var n=-1;return e!=null&&(RE.isScheduler(e)?r=e:n=e),new qE.Observable(function(i){var a=ME.isValidDate(t)?+t-r.now():t;a<0&&(a=0);var o=0;return r.schedule(function(){i.closed||(i.next(o++),0<=n?this.schedule(void 0,n):i.complete())},a)})}Zi.timer=jE});var cu=b(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.interval=void 0;var LE=se(),FE=tt();function DE(t,e){return t===void 0&&(t=0),e===void 0&&(e=LE.asyncScheduler),t<0&&(t=0),FE.timer(t,t,e)}Yi.interval=DE});var vf=b(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.merge=void 0;var UE=xr(),GE=M(),VE=_e(),ff=ue(),WE=je();function BE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=ff.popScheduler(t),n=ff.popNumber(t,1/0),i=t;return i.length?i.length===1?GE.innerFrom(i[0]):UE.mergeAll(n)(WE.from(i,r)):VE.EMPTY}Ji.merge=BE});var lu=b(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.never=Bt.NEVER=void 0;var HE=W(),$E=ee();Bt.NEVER=new HE.Observable($E.noop);function zE(){return Bt.NEVER}Bt.never=zE});var rt=b(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.argsOrArgArray=void 0;var KE=Array.isArray;function XE(t){return t.length===1&&KE(t[0])?t[0]:t}Qi.argsOrArgArray=XE});var du=b(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.onErrorResumeNext=void 0;var ZE=W(),YE=rt(),JE=x(),pf=ee(),QE=M();function e0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=YE.argsOrArgArray(t);return new ZE.Observable(function(n){var i=0,a=function(){if(i<r.length){var o=void 0;try{o=QE.innerFrom(r[i++])}catch{a();return}var s=new JE.OperatorSubscriber(n,void 0,pf.noop,pf.noop);o.subscribe(s),s.add(a)}else n.complete()};a()})}ea.onErrorResumeNext=e0});var mf=b(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.pairs=void 0;var t0=je();function r0(t,e){return t0.from(Object.entries(t),e)}ta.pairs=r0});var fu=b(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.not=void 0;function n0(t,e){return function(r,n){return!t.call(e,r,n)}}ra.not=n0});var De=b(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.filter=void 0;var i0=I(),a0=x();function o0(t,e){return i0.operate(function(r,n){var i=0;r.subscribe(a0.createOperatorSubscriber(n,function(a){return t.call(e,a,i++)&&n.next(a)}))})}na.filter=o0});var bf=b(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.partition=void 0;var s0=fu(),hf=De(),_f=M();function u0(t,e,r){return[hf.filter(e,r)(_f.innerFrom(t)),hf.filter(s0.not(e,r))(_f.innerFrom(t))]}ia.partition=u0});var vu=b(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.raceInit=kr.race=void 0;var c0=W(),yf=M(),l0=rt(),d0=x();function f0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t=l0.argsOrArgArray(t),t.length===1?yf.innerFrom(t[0]):new c0.Observable(gf(t))}kr.race=f0;function gf(t){return function(e){for(var r=[],n=function(a){r.push(yf.innerFrom(t[a]).subscribe(d0.createOperatorSubscriber(e,function(o){if(r){for(var s=0;s<r.length;s++)s!==a&&r[s].unsubscribe();r=null}e.next(o)})))},i=0;r&&!e.closed&&i<t.length;i++)n(i)}}kr.raceInit=gf});var Sf=b(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.range=void 0;var v0=W(),p0=_e();function m0(t,e,r){if(e==null&&(e=t,t=0),e<=0)return p0.EMPTY;var n=e+t;return new v0.Observable(r?function(i){var a=t;return r.schedule(function(){a<n?(i.next(a++),this.schedule()):i.complete()})}:function(i){for(var a=t;a<n&&!i.closed;)i.next(a++);i.complete()})}aa.range=m0});var Ef=b(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.using=void 0;var h0=W(),_0=M(),b0=_e();function y0(t,e){return new h0.Observable(function(r){var n=t(),i=e(n),a=i?_0.innerFrom(i):b0.EMPTY;return a.subscribe(r),function(){n&&n.unsubscribe()}})}oa.using=y0});var sa=b(nt=>{"use strict";var g0=nt&&nt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},S0=nt&&nt.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(nt,"__esModule",{value:!0});nt.zip=void 0;var E0=W(),O0=M(),T0=rt(),A0=_e(),w0=x(),I0=ue();function P0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=I0.popResultSelector(t),n=T0.argsOrArgArray(t);return n.length?new E0.Observable(function(i){var a=n.map(function(){return[]}),o=n.map(function(){return!1});i.add(function(){a=o=null});for(var s=function(u){O0.innerFrom(n[u]).subscribe(w0.createOperatorSubscriber(i,function(f){if(a[u].push(f),a.every(function(S){return S.length})){var m=a.map(function(S){return S.shift()});i.next(r?r.apply(void 0,S0([],g0(m))):m),a.some(function(S,p){return!S.length&&o[p]})&&i.complete()}},function(){o[u]=!0,!a[u].length&&i.complete()}))},l=0;!i.closed&&l<n.length;l++)s(l);return function(){a=o=null}}):A0.EMPTY}nt.zip=P0});var Tf=b(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0})});var ca=b(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.audit=void 0;var N0=I(),x0=M(),Af=x();function C0(t){return N0.operate(function(e,r){var n=!1,i=null,a=null,o=!1,s=function(){if(a?.unsubscribe(),a=null,n){n=!1;var u=i;i=null,r.next(u)}o&&r.complete()},l=function(){a=null,o&&r.complete()};e.subscribe(Af.createOperatorSubscriber(r,function(u){n=!0,i=u,a||x0.innerFrom(t(u)).subscribe(a=Af.createOperatorSubscriber(r,s,l))},function(){o=!0,(!n||!a||a.closed)&&r.complete()}))})}ua.audit=C0});var pu=b(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.auditTime=void 0;var q0=se(),k0=ca(),R0=tt();function M0(t,e){return e===void 0&&(e=q0.asyncScheduler),k0.audit(function(){return R0.timer(t,e)})}la.auditTime=M0});var mu=b(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.buffer=void 0;var j0=I(),L0=ee(),wf=x(),F0=M();function D0(t){return j0.operate(function(e,r){var n=[];return e.subscribe(wf.createOperatorSubscriber(r,function(i){return n.push(i)},function(){r.next(n),r.complete()})),F0.innerFrom(t).subscribe(wf.createOperatorSubscriber(r,function(){var i=n;n=[],r.next(i)},L0.noop)),function(){n=null}})}da.buffer=D0});var _u=b(Rr=>{"use strict";var hu=Rr&&Rr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.bufferCount=void 0;var U0=I(),G0=x(),V0=Re();function W0(t,e){return e===void 0&&(e=null),e=e??t,U0.operate(function(r,n){var i=[],a=0;r.subscribe(G0.createOperatorSubscriber(n,function(o){var s,l,u,f,m=null;a++%e===0&&i.push([]);try{for(var S=hu(i),p=S.next();!p.done;p=S.next()){var v=p.value;v.push(o),t<=v.length&&(m=m??[],m.push(v))}}catch(O){s={error:O}}finally{try{p&&!p.done&&(l=S.return)&&l.call(S)}finally{if(s)throw s.error}}if(m)try{for(var _=hu(m),g=_.next();!g.done;g=_.next()){var v=g.value;V0.arrRemove(i,v),n.next(v)}}catch(O){u={error:O}}finally{try{g&&!g.done&&(f=_.return)&&f.call(_)}finally{if(u)throw u.error}}},function(){var o,s;try{for(var l=hu(i),u=l.next();!u.done;u=l.next()){var f=u.value;n.next(f)}}catch(m){o={error:m}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}n.complete()},void 0,function(){i=null}))})}Rr.bufferCount=W0});var bu=b(Mr=>{"use strict";var B0=Mr&&Mr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.bufferTime=void 0;var H0=ce(),$0=I(),z0=x(),K0=Re(),X0=se(),Z0=ue(),If=Me();function Y0(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=(e=Z0.popScheduler(n))!==null&&e!==void 0?e:X0.asyncScheduler,o=(r=n[0])!==null&&r!==void 0?r:null,s=n[1]||1/0;return $0.operate(function(l,u){var f=[],m=!1,S=function(_){var g=_.buffer,O=_.subs;O.unsubscribe(),K0.arrRemove(f,_),u.next(g),m&&p()},p=function(){if(f){var _=new H0.Subscription;u.add(_);var g=[],O={buffer:g,subs:_};f.push(O),If.executeSchedule(_,a,function(){return S(O)},t)}};o!==null&&o>=0?If.executeSchedule(u,a,p,o,!0):m=!0,p();var v=z0.createOperatorSubscriber(u,function(_){var g,O,E=f.slice();try{for(var k=B0(E),K=k.next();!K.done;K=k.next()){var Z=K.value,Ne=Z.buffer;Ne.push(_),s<=Ne.length&&S(Z)}}catch(pn){g={error:pn}}finally{try{K&&!K.done&&(O=k.return)&&O.call(k)}finally{if(g)throw g.error}}},function(){for(;f?.length;)u.next(f.shift().buffer);v?.unsubscribe(),u.complete(),u.unsubscribe()},void 0,function(){return f=null});l.subscribe(v)})}Mr.bufferTime=Y0});var gu=b(jr=>{"use strict";var J0=jr&&jr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(jr,"__esModule",{value:!0});jr.bufferToggle=void 0;var Q0=ce(),eO=I(),Pf=M(),yu=x(),Nf=ee(),tO=Re();function rO(t,e){return eO.operate(function(r,n){var i=[];Pf.innerFrom(t).subscribe(yu.createOperatorSubscriber(n,function(a){var o=[];i.push(o);var s=new Q0.Subscription,l=function(){tO.arrRemove(i,o),n.next(o),s.unsubscribe()};s.add(Pf.innerFrom(e(a)).subscribe(yu.createOperatorSubscriber(n,l,Nf.noop)))},Nf.noop)),r.subscribe(yu.createOperatorSubscriber(n,function(a){var o,s;try{for(var l=J0(i),u=l.next();!u.done;u=l.next()){var f=u.value;f.push(a)}}catch(m){o={error:m}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}},function(){for(;i.length>0;)n.next(i.shift());n.complete()}))})}jr.bufferToggle=rO});var Su=b(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.bufferWhen=void 0;var nO=I(),iO=ee(),xf=x(),aO=M();function oO(t){return nO.operate(function(e,r){var n=null,i=null,a=function(){i?.unsubscribe();var o=n;n=[],o&&r.next(o),aO.innerFrom(t()).subscribe(i=xf.createOperatorSubscriber(r,a,iO.noop))};a(),e.subscribe(xf.createOperatorSubscriber(r,function(o){return n?.push(o)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}fa.bufferWhen=oO});var Eu=b(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.catchError=void 0;var sO=M(),uO=x(),cO=I();function Cf(t){return cO.operate(function(e,r){var n=null,i=!1,a;n=e.subscribe(uO.createOperatorSubscriber(r,void 0,void 0,function(o){a=sO.innerFrom(t(o,Cf(t)(e))),n?(n.unsubscribe(),n=null,a.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,a.subscribe(r))})}va.catchError=Cf});var Ou=b(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.scanInternals=void 0;var lO=x();function dO(t,e,r,n,i){return function(a,o){var s=r,l=e,u=0;a.subscribe(lO.createOperatorSubscriber(o,function(f){var m=u++;l=s?t(l,f,m):(s=!0,f),n&&o.next(l)},i&&(function(){s&&o.next(l),o.complete()})))}}pa.scanInternals=dO});var Ht=b(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.reduce=void 0;var fO=Ou(),vO=I();function pO(t,e){return vO.operate(fO.scanInternals(t,e,arguments.length>=2,!1,!0))}ma.reduce=pO});var _a=b(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.toArray=void 0;var mO=Ht(),hO=I(),_O=function(t,e){return t.push(e),t};function bO(){return hO.operate(function(t,e){mO.reduce(_O,[])(t).subscribe(e)})}ha.toArray=bO});var Tu=b(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.joinAllInternals=void 0;var yO=te(),gO=Qe(),SO=tn(),EO=Ie(),OO=_a();function TO(t,e){return SO.pipe(OO.toArray(),EO.mergeMap(function(r){return t(r)}),e?gO.mapOneOrManyArgs(e):yO.identity)}ba.joinAllInternals=TO});var ga=b(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.combineLatestAll=void 0;var AO=Fi(),wO=Tu();function IO(t){return wO.joinAllInternals(AO.combineLatest,t)}ya.combineLatestAll=IO});var Au=b(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.combineAll=void 0;var PO=ga();Sa.combineAll=PO.combineLatestAll});var wu=b(it=>{"use strict";var qf=it&&it.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},kf=it&&it.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(it,"__esModule",{value:!0});it.combineLatest=void 0;var NO=Fi(),xO=I(),CO=rt(),qO=Qe(),kO=tn(),RO=ue();function Rf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=RO.popResultSelector(t);return r?kO.pipe(Rf.apply(void 0,kf([],qf(t))),qO.mapOneOrManyArgs(r)):xO.operate(function(n,i){NO.combineLatestInit(kf([n],qf(CO.argsOrArgArray(t))))(i)})}it.combineLatest=Rf});var Iu=b(at=>{"use strict";var MO=at&&at.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},jO=at&&at.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(at,"__esModule",{value:!0});at.combineLatestWith=void 0;var LO=wu();function FO(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return LO.combineLatest.apply(void 0,jO([],MO(t)))}at.combineLatestWith=FO});var Oa=b(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.concatMap=void 0;var Mf=Ie(),DO=U();function UO(t,e){return DO.isFunction(e)?Mf.mergeMap(t,e,1):Mf.mergeMap(t,1)}Ea.concatMap=UO});var Pu=b(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.concatMapTo=void 0;var jf=Oa(),GO=U();function VO(t,e){return GO.isFunction(e)?jf.concatMap(function(){return t},e):jf.concatMap(function(){return t})}Ta.concatMapTo=VO});var Nu=b(ot=>{"use strict";var WO=ot&&ot.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},BO=ot&&ot.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(ot,"__esModule",{value:!0});ot.concat=void 0;var HO=I(),$O=un(),zO=ue(),KO=je();function XO(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=zO.popScheduler(t);return HO.operate(function(n,i){$O.concatAll()(KO.from(BO([n],WO(t)),r)).subscribe(i)})}ot.concat=XO});var xu=b(st=>{"use strict";var ZO=st&&st.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},YO=st&&st.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(st,"__esModule",{value:!0});st.concatWith=void 0;var JO=Nu();function QO(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return JO.concat.apply(void 0,YO([],ZO(t)))}st.concatWith=QO});var Lf=b(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.fromSubscribable=void 0;var eT=W();function tT(t){return new eT.Observable(function(e){return t.subscribe(e)})}Aa.fromSubscribable=tT});var dn=b(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.connect=void 0;var rT=re(),nT=M(),iT=I(),aT=Lf(),oT={connector:function(){return new rT.Subject}};function sT(t,e){e===void 0&&(e=oT);var r=e.connector;return iT.operate(function(n,i){var a=r();nT.innerFrom(t(aT.fromSubscribable(a))).subscribe(i),i.add(n.subscribe(a))})}wa.connect=sT});var Cu=b(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.count=void 0;var uT=Ht();function cT(t){return uT.reduce(function(e,r,n){return!t||t(r,n)?e+1:e},0)}Ia.count=cT});var qu=b(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.debounce=void 0;var lT=I(),dT=ee(),Ff=x(),fT=M();function vT(t){return lT.operate(function(e,r){var n=!1,i=null,a=null,o=function(){if(a?.unsubscribe(),a=null,n){n=!1;var s=i;i=null,r.next(s)}};e.subscribe(Ff.createOperatorSubscriber(r,function(s){a?.unsubscribe(),n=!0,i=s,a=Ff.createOperatorSubscriber(r,o,dT.noop),fT.innerFrom(t(s)).subscribe(a)},function(){o(),r.complete()},void 0,function(){i=a=null}))})}Pa.debounce=vT});var ku=b(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.debounceTime=void 0;var pT=se(),mT=I(),hT=x();function _T(t,e){return e===void 0&&(e=pT.asyncScheduler),mT.operate(function(r,n){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var u=a;a=null,n.next(u)}};function l(){var u=o+t,f=e.now();if(f<u){i=this.schedule(void 0,u-f),n.add(i);return}s()}r.subscribe(hT.createOperatorSubscriber(n,function(u){a=u,o=e.now(),i||(i=e.schedule(l,t),n.add(i))},function(){s(),n.complete()},void 0,function(){a=i=null}))})}Na.debounceTime=_T});var Lr=b(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.defaultIfEmpty=void 0;var bT=I(),yT=x();function gT(t){return bT.operate(function(e,r){var n=!1;e.subscribe(yT.createOperatorSubscriber(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}))})}xa.defaultIfEmpty=gT});var Fr=b(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.take=void 0;var ST=_e(),ET=I(),OT=x();function TT(t){return t<=0?function(){return ST.EMPTY}:ET.operate(function(e,r){var n=0;e.subscribe(OT.createOperatorSubscriber(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}Ca.take=TT});var ka=b(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.ignoreElements=void 0;var AT=I(),wT=x(),IT=ee();function PT(){return AT.operate(function(t,e){t.subscribe(wT.createOperatorSubscriber(e,IT.noop))})}qa.ignoreElements=PT});var Ma=b(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.mapTo=void 0;var NT=Fe();function xT(t){return NT.map(function(){return t})}Ra.mapTo=xT});var La=b(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.delayWhen=void 0;var CT=cn(),Df=Fr(),qT=ka(),kT=Ma(),RT=Ie(),MT=M();function Uf(t,e){return e?function(r){return CT.concat(e.pipe(Df.take(1),qT.ignoreElements()),r.pipe(Uf(t)))}:RT.mergeMap(function(r,n){return MT.innerFrom(t(r,n)).pipe(Df.take(1),kT.mapTo(r))})}ja.delayWhen=Uf});var Ru=b(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.delay=void 0;var jT=se(),LT=La(),FT=tt();function DT(t,e){e===void 0&&(e=jT.asyncScheduler);var r=FT.timer(t,e);return LT.delayWhen(function(){return r})}Fa.delay=DT});var Mu=b(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.dematerialize=void 0;var UT=Oi(),GT=I(),VT=x();function WT(){return GT.operate(function(t,e){t.subscribe(VT.createOperatorSubscriber(e,function(r){return UT.observeNotification(r,e)}))})}Da.dematerialize=WT});var ju=b(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.distinct=void 0;var BT=I(),Gf=x(),HT=ee(),$T=M();function zT(t,e){return BT.operate(function(r,n){var i=new Set;r.subscribe(Gf.createOperatorSubscriber(n,function(a){var o=t?t(a):a;i.has(o)||(i.add(o),n.next(a))})),e&&$T.innerFrom(e).subscribe(Gf.createOperatorSubscriber(n,function(){return i.clear()},HT.noop))})}Ua.distinct=zT});var Va=b(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.distinctUntilChanged=void 0;var KT=te(),XT=I(),ZT=x();function YT(t,e){return e===void 0&&(e=KT.identity),t=t??JT,XT.operate(function(r,n){var i,a=!0;r.subscribe(ZT.createOperatorSubscriber(n,function(o){var s=e(o);(a||!t(i,s))&&(a=!1,i=s,n.next(o))}))})}Ga.distinctUntilChanged=YT;function JT(t,e){return t===e}});var Lu=b(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.distinctUntilKeyChanged=void 0;var QT=Va();function eA(t,e){return QT.distinctUntilChanged(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}Wa.distinctUntilKeyChanged=eA});var Dr=b(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.throwIfEmpty=void 0;var tA=Ye(),rA=I(),nA=x();function iA(t){return t===void 0&&(t=aA),rA.operate(function(e,r){var n=!1;e.subscribe(nA.createOperatorSubscriber(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}Ba.throwIfEmpty=iA;function aA(){return new tA.EmptyError}});var Fu=b(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.elementAt=void 0;var Vf=tu(),oA=De(),sA=Dr(),uA=Lr(),cA=Fr();function lA(t,e){if(t<0)throw new Vf.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(n){return n.pipe(oA.filter(function(i,a){return a===t}),cA.take(1),r?uA.defaultIfEmpty(e):sA.throwIfEmpty(function(){return new Vf.ArgumentOutOfRangeError}))}}Ha.elementAt=lA});var Du=b(ut=>{"use strict";var dA=ut&&ut.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},fA=ut&&ut.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(ut,"__esModule",{value:!0});ut.endWith=void 0;var vA=cn(),pA=Si();function mA(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return vA.concat(r,pA.of.apply(void 0,fA([],dA(t))))}}ut.endWith=mA});var Uu=b($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.every=void 0;var hA=I(),_A=x();function bA(t,e){return hA.operate(function(r,n){var i=0;r.subscribe(_A.createOperatorSubscriber(n,function(a){t.call(e,a,i++,r)||(n.next(!1),n.complete())},function(){n.next(!0),n.complete()}))})}$a.every=bA});var Ka=b(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.exhaustMap=void 0;var yA=Fe(),Wf=M(),gA=I(),Bf=x();function Hf(t,e){return e?function(r){return r.pipe(Hf(function(n,i){return Wf.innerFrom(t(n,i)).pipe(yA.map(function(a,o){return e(n,a,i,o)}))}))}:gA.operate(function(r,n){var i=0,a=null,o=!1;r.subscribe(Bf.createOperatorSubscriber(n,function(s){a||(a=Bf.createOperatorSubscriber(n,void 0,function(){a=null,o&&n.complete()}),Wf.innerFrom(t(s,i++)).subscribe(a))},function(){o=!0,!a&&n.complete()}))})}za.exhaustMap=Hf});var Za=b(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.exhaustAll=void 0;var SA=Ka(),EA=te();function OA(){return SA.exhaustMap(EA.identity)}Xa.exhaustAll=OA});var Gu=b(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.exhaust=void 0;var TA=Za();Ya.exhaust=TA.exhaustAll});var Vu=b(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.expand=void 0;var AA=I(),wA=Ui();function IA(t,e,r){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,AA.operate(function(n,i){return wA.mergeInternals(n,i,t,e,void 0,!0,r)})}Ja.expand=IA});var Wu=b(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.finalize=void 0;var PA=I();function NA(t){return PA.operate(function(e,r){try{e.subscribe(r)}finally{r.add(t)}})}Qa.finalize=NA});var eo=b(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.createFind=Ur.find=void 0;var xA=I(),CA=x();function qA(t,e){return xA.operate($f(t,e,"value"))}Ur.find=qA;function $f(t,e,r){var n=r==="index";return function(i,a){var o=0;i.subscribe(CA.createOperatorSubscriber(a,function(s){var l=o++;t.call(e,s,l,i)&&(a.next(n?l:s),a.complete())},function(){a.next(n?-1:void 0),a.complete()}))}}Ur.createFind=$f});var Bu=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.findIndex=void 0;var kA=I(),RA=eo();function MA(t,e){return kA.operate(RA.createFind(t,e,"index"))}to.findIndex=MA});var Hu=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.first=void 0;var jA=Ye(),LA=De(),FA=Fr(),DA=Lr(),UA=Dr(),GA=te();function VA(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?LA.filter(function(i,a){return t(i,a,n)}):GA.identity,FA.take(1),r?DA.defaultIfEmpty(e):UA.throwIfEmpty(function(){return new jA.EmptyError}))}}ro.first=VA});var $u=b(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.groupBy=void 0;var WA=W(),BA=M(),HA=re(),$A=I(),zf=x();function zA(t,e,r,n){return $A.operate(function(i,a){var o;!e||typeof e=="function"?o=e:(r=e.duration,o=e.element,n=e.connector);var s=new Map,l=function(v){s.forEach(v),v(a)},u=function(v){return l(function(_){return _.error(v)})},f=0,m=!1,S=new zf.OperatorSubscriber(a,function(v){try{var _=t(v),g=s.get(_);if(!g){s.set(_,g=n?n():new HA.Subject);var O=p(_,g);if(a.next(O),r){var E=zf.createOperatorSubscriber(g,function(){g.complete(),E?.unsubscribe()},void 0,void 0,function(){return s.delete(_)});S.add(BA.innerFrom(r(O)).subscribe(E))}}g.next(o?o(v):v)}catch(k){u(k)}},function(){return l(function(v){return v.complete()})},u,function(){return s.clear()},function(){return m=!0,f===0});i.subscribe(S);function p(v,_){var g=new WA.Observable(function(O){f++;var E=_.subscribe(O);return function(){E.unsubscribe(),--f===0&&m&&S.unsubscribe()}});return g.key=v,g}})}no.groupBy=zA});var zu=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.isEmpty=void 0;var KA=I(),XA=x();function ZA(){return KA.operate(function(t,e){t.subscribe(XA.createOperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}io.isEmpty=ZA});var ao=b(Gr=>{"use strict";var YA=Gr&&Gr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.takeLast=void 0;var JA=_e(),QA=I(),ew=x();function tw(t){return t<=0?function(){return JA.EMPTY}:QA.operate(function(e,r){var n=[];e.subscribe(ew.createOperatorSubscriber(r,function(i){n.push(i),t<n.length&&n.shift()},function(){var i,a;try{for(var o=YA(n),s=o.next();!s.done;s=o.next()){var l=s.value;r.next(l)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}r.complete()},void 0,function(){n=null}))})}Gr.takeLast=tw});var Ku=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.last=void 0;var rw=Ye(),nw=De(),iw=ao(),aw=Dr(),ow=Lr(),sw=te();function uw(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?nw.filter(function(i,a){return t(i,a,n)}):sw.identity,iw.takeLast(1),r?ow.defaultIfEmpty(e):aw.throwIfEmpty(function(){return new rw.EmptyError}))}}oo.last=uw});var Zu=b(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.materialize=void 0;var Xu=Oi(),cw=I(),lw=x();function dw(){return cw.operate(function(t,e){t.subscribe(lw.createOperatorSubscriber(e,function(r){e.next(Xu.Notification.createNext(r))},function(){e.next(Xu.Notification.createComplete()),e.complete()},function(r){e.next(Xu.Notification.createError(r)),e.complete()}))})}so.materialize=dw});var Yu=b(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.max=void 0;var fw=Ht(),vw=U();function pw(t){return fw.reduce(vw.isFunction(t)?function(e,r){return t(e,r)>0?e:r}:function(e,r){return e>r?e:r})}uo.max=pw});var Ju=b(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.flatMap=void 0;var mw=Ie();co.flatMap=mw.mergeMap});var Qu=b(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.mergeMapTo=void 0;var Kf=Ie(),hw=U();function _w(t,e,r){return r===void 0&&(r=1/0),hw.isFunction(e)?Kf.mergeMap(function(){return t},e,r):(typeof e=="number"&&(r=e),Kf.mergeMap(function(){return t},r))}lo.mergeMapTo=_w});var ec=b(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.mergeScan=void 0;var bw=I(),yw=Ui();function gw(t,e,r){return r===void 0&&(r=1/0),bw.operate(function(n,i){var a=e;return yw.mergeInternals(n,i,function(o,s){return t(a,o,s)},r,function(o){a=o},!1,void 0,function(){return a=null})})}fo.mergeScan=gw});var tc=b(ct=>{"use strict";var Sw=ct&&ct.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},Ew=ct&&ct.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(ct,"__esModule",{value:!0});ct.merge=void 0;var Ow=I(),Tw=rt(),Aw=xr(),Xf=ue(),ww=je();function Iw(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xf.popScheduler(t),n=Xf.popNumber(t,1/0);return t=Tw.argsOrArgArray(t),Ow.operate(function(i,a){Aw.mergeAll(n)(ww.from(Ew([i],Sw(t)),r)).subscribe(a)})}ct.merge=Iw});var rc=b(lt=>{"use strict";var Pw=lt&&lt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},Nw=lt&&lt.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(lt,"__esModule",{value:!0});lt.mergeWith=void 0;var xw=tc();function Cw(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return xw.merge.apply(void 0,Nw([],Pw(t)))}lt.mergeWith=Cw});var nc=b(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.min=void 0;var qw=Ht(),kw=U();function Rw(t){return qw.reduce(kw.isFunction(t)?function(e,r){return t(e,r)<0?e:r}:function(e,r){return e<r?e:r})}vo.min=Rw});var fn=b(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.multicast=void 0;var Mw=rn(),Zf=U(),jw=dn();function Lw(t,e){var r=Zf.isFunction(t)?t:function(){return t};return Zf.isFunction(e)?jw.connect(e,{connector:r}):function(n){return new Mw.ConnectableObservable(n,r)}}po.multicast=Lw});var ic=b(Pe=>{"use strict";var Fw=Pe&&Pe.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},Dw=Pe&&Pe.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.onErrorResumeNext=Pe.onErrorResumeNextWith=void 0;var Uw=rt(),Gw=du();function Yf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Uw.argsOrArgArray(t);return function(n){return Gw.onErrorResumeNext.apply(void 0,Dw([n],Fw(r)))}}Pe.onErrorResumeNextWith=Yf;Pe.onErrorResumeNext=Yf});var ac=b(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.pairwise=void 0;var Vw=I(),Ww=x();function Bw(){return Vw.operate(function(t,e){var r,n=!1;t.subscribe(Ww.createOperatorSubscriber(e,function(i){var a=r;r=i,n&&e.next([a,i]),n=!0}))})}mo.pairwise=Bw});var oc=b(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.pluck=void 0;var Hw=Fe();function $w(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(r===0)throw new Error("list of properties cannot be empty.");return Hw.map(function(n){for(var i=n,a=0;a<r;a++){var o=i?.[t[a]];if(typeof o<"u")i=o;else return}return i})}ho.pluck=$w});var sc=b(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.publish=void 0;var zw=re(),Kw=fn(),Xw=dn();function Zw(t){return t?function(e){return Xw.connect(t)(e)}:function(e){return Kw.multicast(new zw.Subject)(e)}}_o.publish=Zw});var uc=b(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.publishBehavior=void 0;var Yw=Fs(),Jw=rn();function Qw(t){return function(e){var r=new Yw.BehaviorSubject(t);return new Jw.ConnectableObservable(e,function(){return r})}}bo.publishBehavior=Qw});var cc=b(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.publishLast=void 0;var e1=Yn(),t1=rn();function r1(){return function(t){var e=new e1.AsyncSubject;return new t1.ConnectableObservable(t,function(){return e})}}yo.publishLast=r1});var lc=b(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.publishReplay=void 0;var n1=Zn(),i1=fn(),Jf=U();function a1(t,e,r,n){r&&!Jf.isFunction(r)&&(n=r);var i=Jf.isFunction(r)?r:void 0;return function(a){return i1.multicast(new n1.ReplaySubject(t,e,n),i)(a)}}go.publishReplay=a1});var So=b(dt=>{"use strict";var o1=dt&&dt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},s1=dt&&dt.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(dt,"__esModule",{value:!0});dt.raceWith=void 0;var u1=vu(),c1=I(),l1=te();function d1(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length?c1.operate(function(r,n){u1.raceInit(s1([r],o1(t)))(n)}):l1.identity}dt.raceWith=d1});var dc=b(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.repeat=void 0;var f1=_e(),v1=I(),Qf=x(),p1=M(),m1=tt();function h1(t){var e,r=1/0,n;return t!=null&&(typeof t=="object"?(e=t.count,r=e===void 0?1/0:e,n=t.delay):r=t),r<=0?function(){return f1.EMPTY}:v1.operate(function(i,a){var o=0,s,l=function(){if(s?.unsubscribe(),s=null,n!=null){var f=typeof n=="number"?m1.timer(n):p1.innerFrom(n(o)),m=Qf.createOperatorSubscriber(a,function(){m.unsubscribe(),u()});f.subscribe(m)}else u()},u=function(){var f=!1;s=i.subscribe(Qf.createOperatorSubscriber(a,void 0,function(){++o<r?s?l():f=!0:a.complete()})),f&&l()};u()})}Eo.repeat=h1});var fc=b(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.repeatWhen=void 0;var _1=M(),b1=re(),y1=I(),ev=x();function g1(t){return y1.operate(function(e,r){var n,i=!1,a,o=!1,s=!1,l=function(){return s&&o&&(r.complete(),!0)},u=function(){return a||(a=new b1.Subject,_1.innerFrom(t(a)).subscribe(ev.createOperatorSubscriber(r,function(){n?f():i=!0},function(){o=!0,l()}))),a},f=function(){s=!1,n=e.subscribe(ev.createOperatorSubscriber(r,void 0,function(){s=!0,!l()&&u().next()})),i&&(n.unsubscribe(),n=null,i=!1,f())};f()})}Oo.repeatWhen=g1});var vc=b(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.retry=void 0;var S1=I(),tv=x(),E1=te(),O1=tt(),T1=M();function A1(t){t===void 0&&(t=1/0);var e;t&&typeof t=="object"?e=t:e={count:t};var r=e.count,n=r===void 0?1/0:r,i=e.delay,a=e.resetOnSuccess,o=a===void 0?!1:a;return n<=0?E1.identity:S1.operate(function(s,l){var u=0,f,m=function(){var S=!1;f=s.subscribe(tv.createOperatorSubscriber(l,function(p){o&&(u=0),l.next(p)},void 0,function(p){if(u++<n){var v=function(){f?(f.unsubscribe(),f=null,m()):S=!0};if(i!=null){var _=typeof i=="number"?O1.timer(i):T1.innerFrom(i(p,u)),g=tv.createOperatorSubscriber(l,function(){g.unsubscribe(),v()},function(){l.complete()});_.subscribe(g)}else v()}else l.error(p)})),S&&(f.unsubscribe(),f=null,m())};m()})}To.retry=A1});var pc=b(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.retryWhen=void 0;var w1=M(),I1=re(),P1=I(),rv=x();function N1(t){return P1.operate(function(e,r){var n,i=!1,a,o=function(){n=e.subscribe(rv.createOperatorSubscriber(r,void 0,void 0,function(s){a||(a=new I1.Subject,w1.innerFrom(t(a)).subscribe(rv.createOperatorSubscriber(r,function(){return n?o():i=!0}))),a&&a.next(s)})),i&&(n.unsubscribe(),n=null,i=!1,o())};o()})}Ao.retryWhen=N1});var Io=b(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.sample=void 0;var x1=M(),C1=I(),q1=ee(),nv=x();function k1(t){return C1.operate(function(e,r){var n=!1,i=null;e.subscribe(nv.createOperatorSubscriber(r,function(a){n=!0,i=a})),x1.innerFrom(t).subscribe(nv.createOperatorSubscriber(r,function(){if(n){n=!1;var a=i;i=null,r.next(a)}},q1.noop))})}wo.sample=k1});var mc=b(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.sampleTime=void 0;var R1=se(),M1=Io(),j1=cu();function L1(t,e){return e===void 0&&(e=R1.asyncScheduler),M1.sample(j1.interval(t,e))}Po.sampleTime=L1});var hc=b(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.scan=void 0;var F1=I(),D1=Ou();function U1(t,e){return F1.operate(D1.scanInternals(t,e,arguments.length>=2,!0))}No.scan=U1});var _c=b(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.sequenceEqual=void 0;var G1=I(),V1=x(),W1=M();function B1(t,e){return e===void 0&&(e=function(r,n){return r===n}),G1.operate(function(r,n){var i=iv(),a=iv(),o=function(l){n.next(l),n.complete()},s=function(l,u){var f=V1.createOperatorSubscriber(n,function(m){var S=u.buffer,p=u.complete;S.length===0?p?o(!1):l.buffer.push(m):!e(m,S.shift())&&o(!1)},function(){l.complete=!0;var m=u.complete,S=u.buffer;m&&o(S.length===0),f?.unsubscribe()});return f};r.subscribe(s(i,a)),W1.innerFrom(t).subscribe(s(a,i))})}xo.sequenceEqual=B1;function iv(){return{buffer:[],complete:!1}}});var Co=b(ft=>{"use strict";var H1=ft&&ft.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},$1=ft&&ft.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(ft,"__esModule",{value:!0});ft.share=void 0;var av=M(),z1=re(),ov=ar(),K1=I();function X1(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new z1.Subject}:e,n=t.resetOnError,i=n===void 0?!0:n,a=t.resetOnComplete,o=a===void 0?!0:a,s=t.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){var f,m,S,p=0,v=!1,_=!1,g=function(){m?.unsubscribe(),m=void 0},O=function(){g(),f=S=void 0,v=_=!1},E=function(){var k=f;O(),k?.unsubscribe()};return K1.operate(function(k,K){p++,!_&&!v&&g();var Z=S=S??r();K.add(function(){p--,p===0&&!_&&!v&&(m=bc(E,l))}),Z.subscribe(K),!f&&p>0&&(f=new ov.SafeSubscriber({next:function(Ne){return Z.next(Ne)},error:function(Ne){_=!0,g(),m=bc(O,i,Ne),Z.error(Ne)},complete:function(){v=!0,g(),m=bc(O,o),Z.complete()}}),av.innerFrom(k).subscribe(f))})(u)}}ft.share=X1;function bc(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(e===!0){t();return}if(e!==!1){var i=new ov.SafeSubscriber({next:function(){i.unsubscribe(),t()}});return av.innerFrom(e.apply(void 0,$1([],H1(r)))).subscribe(i)}}});var yc=b(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.shareReplay=void 0;var Z1=Zn(),Y1=Co();function J1(t,e,r){var n,i,a,o,s=!1;return t&&typeof t=="object"?(n=t.bufferSize,o=n===void 0?1/0:n,i=t.windowTime,e=i===void 0?1/0:i,a=t.refCount,s=a===void 0?!1:a,r=t.scheduler):o=t??1/0,Y1.share({connector:function(){return new Z1.ReplaySubject(o,e,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}qo.shareReplay=J1});var gc=b(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.single=void 0;var Q1=Ye(),eI=nu(),tI=ru(),rI=I(),nI=x();function iI(t){return rI.operate(function(e,r){var n=!1,i,a=!1,o=0;e.subscribe(nI.createOperatorSubscriber(r,function(s){a=!0,(!t||t(s,o++,e))&&(n&&r.error(new eI.SequenceError("Too many matching values")),n=!0,i=s)},function(){n?(r.next(i),r.complete()):r.error(a?new tI.NotFoundError("No matching values"):new Q1.EmptyError)}))})}ko.single=iI});var Sc=b(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.skip=void 0;var aI=De();function oI(t){return aI.filter(function(e,r){return t<=r})}Ro.skip=oI});var Ec=b(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.skipLast=void 0;var sI=te(),uI=I(),cI=x();function lI(t){return t<=0?sI.identity:uI.operate(function(e,r){var n=new Array(t),i=0;return e.subscribe(cI.createOperatorSubscriber(r,function(a){var o=i++;if(o<t)n[o]=a;else{var s=o%t,l=n[s];n[s]=a,r.next(l)}})),function(){n=null}})}Mo.skipLast=lI});var Oc=b(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.skipUntil=void 0;var dI=I(),sv=x(),fI=M(),vI=ee();function pI(t){return dI.operate(function(e,r){var n=!1,i=sv.createOperatorSubscriber(r,function(){i?.unsubscribe(),n=!0},vI.noop);fI.innerFrom(t).subscribe(i),e.subscribe(sv.createOperatorSubscriber(r,function(a){return n&&r.next(a)}))})}jo.skipUntil=pI});var Tc=b(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.skipWhile=void 0;var mI=I(),hI=x();function _I(t){return mI.operate(function(e,r){var n=!1,i=0;e.subscribe(hI.createOperatorSubscriber(r,function(a){return(n||(n=!t(a,i++)))&&r.next(a)}))})}Lo.skipWhile=_I});var Ac=b(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.startWith=void 0;var uv=cn(),bI=ue(),yI=I();function gI(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=bI.popScheduler(t);return yI.operate(function(n,i){(r?uv.concat(t,n,r):uv.concat(t,n)).subscribe(i)})}Fo.startWith=gI});var Vr=b(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.switchMap=void 0;var SI=M(),EI=I(),cv=x();function OI(t,e){return EI.operate(function(r,n){var i=null,a=0,o=!1,s=function(){return o&&!i&&n.complete()};r.subscribe(cv.createOperatorSubscriber(n,function(l){i?.unsubscribe();var u=0,f=a++;SI.innerFrom(t(l,f)).subscribe(i=cv.createOperatorSubscriber(n,function(m){return n.next(e?e(l,m,f,u++):m)},function(){i=null,s()}))},function(){o=!0,s()}))})}Do.switchMap=OI});var wc=b(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.switchAll=void 0;var TI=Vr(),AI=te();function wI(){return TI.switchMap(AI.identity)}Uo.switchAll=wI});var Ic=b(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.switchMapTo=void 0;var lv=Vr(),II=U();function PI(t,e){return II.isFunction(e)?lv.switchMap(function(){return t},e):lv.switchMap(function(){return t})}Go.switchMapTo=PI});var Pc=b(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.switchScan=void 0;var NI=Vr(),xI=I();function CI(t,e){return xI.operate(function(r,n){var i=e;return NI.switchMap(function(a,o){return t(i,a,o)},function(a,o){return i=o,o})(r).subscribe(n),function(){i=null}})}Vo.switchScan=CI});var Nc=b(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.takeUntil=void 0;var qI=I(),kI=x(),RI=M(),MI=ee();function jI(t){return qI.operate(function(e,r){RI.innerFrom(t).subscribe(kI.createOperatorSubscriber(r,function(){return r.complete()},MI.noop)),!r.closed&&e.subscribe(r)})}Wo.takeUntil=jI});var xc=b(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.takeWhile=void 0;var LI=I(),FI=x();function DI(t,e){return e===void 0&&(e=!1),LI.operate(function(r,n){var i=0;r.subscribe(FI.createOperatorSubscriber(n,function(a){var o=t(a,i++);(o||e)&&n.next(a),!o&&n.complete()}))})}Bo.takeWhile=DI});var Cc=b(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.tap=void 0;var UI=U(),GI=I(),VI=x(),WI=te();function BI(t,e,r){var n=UI.isFunction(t)||e||r?{next:t,error:e,complete:r}:t;return n?GI.operate(function(i,a){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var s=!0;i.subscribe(VI.createOperatorSubscriber(a,function(l){var u;(u=n.next)===null||u===void 0||u.call(n,l),a.next(l)},function(){var l;s=!1,(l=n.complete)===null||l===void 0||l.call(n),a.complete()},function(l){var u;s=!1,(u=n.error)===null||u===void 0||u.call(n,l),a.error(l)},function(){var l,u;s&&((l=n.unsubscribe)===null||l===void 0||l.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):WI.identity}Ho.tap=BI});var zo=b($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.throttle=void 0;var HI=I(),dv=x(),$I=M();function zI(t,e){return HI.operate(function(r,n){var i=e??{},a=i.leading,o=a===void 0?!0:a,s=i.trailing,l=s===void 0?!1:s,u=!1,f=null,m=null,S=!1,p=function(){m?.unsubscribe(),m=null,l&&(g(),S&&n.complete())},v=function(){m=null,S&&n.complete()},_=function(O){return m=$I.innerFrom(t(O)).subscribe(dv.createOperatorSubscriber(n,p,v))},g=function(){if(u){u=!1;var O=f;f=null,n.next(O),!S&&_(O)}};r.subscribe(dv.createOperatorSubscriber(n,function(O){u=!0,f=O,!(m&&!m.closed)&&(o?g():_(O))},function(){S=!0,!(l&&u&&m&&!m.closed)&&n.complete()}))})}$o.throttle=zI});var qc=b(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.throttleTime=void 0;var KI=se(),XI=zo(),ZI=tt();function YI(t,e,r){e===void 0&&(e=KI.asyncScheduler);var n=ZI.timer(t,e);return XI.throttle(function(){return n},r)}Ko.throttleTime=YI});var kc=b(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.TimeInterval=Wr.timeInterval=void 0;var JI=se(),QI=I(),eP=x();function tP(t){return t===void 0&&(t=JI.asyncScheduler),QI.operate(function(e,r){var n=t.now();e.subscribe(eP.createOperatorSubscriber(r,function(i){var a=t.now(),o=a-n;n=a,r.next(new fv(i,o))}))})}Wr.timeInterval=tP;var fv=(function(){function t(e,r){this.value=e,this.interval=r}return t})();Wr.TimeInterval=fv});var Rc=b(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.timeoutWith=void 0;var rP=se(),nP=qi(),iP=sn();function aP(t,e,r){var n,i,a;if(r=r??rP.async,nP.isValidDate(t)?n=t:typeof t=="number"&&(i=t),e)a=function(){return e};else throw new TypeError("No observable provided to switch to");if(n==null&&i==null)throw new TypeError("No timeout provided.");return iP.timeout({first:n,each:i,scheduler:r,with:a})}Xo.timeoutWith=aP});var Mc=b(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.timestamp=void 0;var oP=Xn(),sP=Fe();function uP(t){return t===void 0&&(t=oP.dateTimestampProvider),sP.map(function(e){return{value:e,timestamp:t.now()}})}Zo.timestamp=uP});var jc=b(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.window=void 0;var vv=re(),cP=I(),pv=x(),lP=ee(),dP=M();function fP(t){return cP.operate(function(e,r){var n=new vv.Subject;r.next(n.asObservable());var i=function(a){n.error(a),r.error(a)};return e.subscribe(pv.createOperatorSubscriber(r,function(a){return n?.next(a)},function(){n.complete(),r.complete()},i)),dP.innerFrom(t).subscribe(pv.createOperatorSubscriber(r,function(){n.complete(),r.next(n=new vv.Subject)},lP.noop,i)),function(){n?.unsubscribe(),n=null}})}Yo.window=fP});var Lc=b(Br=>{"use strict";var vP=Br&&Br.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Br,"__esModule",{value:!0});Br.windowCount=void 0;var mv=re(),pP=I(),mP=x();function hP(t,e){e===void 0&&(e=0);var r=e>0?e:t;return pP.operate(function(n,i){var a=[new mv.Subject],o=[],s=0;i.next(a[0].asObservable()),n.subscribe(mP.createOperatorSubscriber(i,function(l){var u,f;try{for(var m=vP(a),S=m.next();!S.done;S=m.next()){var p=S.value;p.next(l)}}catch(g){u={error:g}}finally{try{S&&!S.done&&(f=m.return)&&f.call(m)}finally{if(u)throw u.error}}var v=s-t+1;if(v>=0&&v%r===0&&a.shift().complete(),++s%r===0){var _=new mv.Subject;a.push(_),i.next(_.asObservable())}},function(){for(;a.length>0;)a.shift().complete();i.complete()},function(l){for(;a.length>0;)a.shift().error(l);i.error(l)},function(){o=null,a=null}))})}Br.windowCount=hP});var Fc=b(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.windowTime=void 0;var _P=re(),bP=se(),yP=ce(),gP=I(),SP=x(),EP=Re(),OP=ue(),hv=Me();function TP(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=(e=OP.popScheduler(n))!==null&&e!==void 0?e:bP.asyncScheduler,o=(r=n[0])!==null&&r!==void 0?r:null,s=n[1]||1/0;return gP.operate(function(l,u){var f=[],m=!1,S=function(g){var O=g.window,E=g.subs;O.complete(),E.unsubscribe(),EP.arrRemove(f,g),m&&p()},p=function(){if(f){var g=new yP.Subscription;u.add(g);var O=new _P.Subject,E={window:O,subs:g,seen:0};f.push(E),u.next(O.asObservable()),hv.executeSchedule(g,a,function(){return S(E)},t)}};o!==null&&o>=0?hv.executeSchedule(u,a,p,o,!0):m=!0,p();var v=function(g){return f.slice().forEach(g)},_=function(g){v(function(O){var E=O.window;return g(E)}),g(u),u.unsubscribe()};return l.subscribe(SP.createOperatorSubscriber(u,function(g){v(function(O){O.window.next(g),s<=++O.seen&&S(O)})},function(){return _(function(g){return g.complete()})},function(g){return _(function(O){return O.error(g)})})),function(){f=null}})}Jo.windowTime=TP});var Uc=b(Hr=>{"use strict";var AP=Hr&&Hr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.windowToggle=void 0;var wP=re(),IP=ce(),PP=I(),_v=M(),Dc=x(),bv=ee(),NP=Re();function xP(t,e){return PP.operate(function(r,n){var i=[],a=function(o){for(;0<i.length;)i.shift().error(o);n.error(o)};_v.innerFrom(t).subscribe(Dc.createOperatorSubscriber(n,function(o){var s=new wP.Subject;i.push(s);var l=new IP.Subscription,u=function(){NP.arrRemove(i,s),s.complete(),l.unsubscribe()},f;try{f=_v.innerFrom(e(o))}catch(m){a(m);return}n.next(s.asObservable()),l.add(f.subscribe(Dc.createOperatorSubscriber(n,u,bv.noop,a)))},bv.noop)),r.subscribe(Dc.createOperatorSubscriber(n,function(o){var s,l,u=i.slice();try{for(var f=AP(u),m=f.next();!m.done;m=f.next()){var S=m.value;S.next(o)}}catch(p){s={error:p}}finally{try{m&&!m.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}},function(){for(;0<i.length;)i.shift().complete();n.complete()},a,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}Hr.windowToggle=xP});var Gc=b(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.windowWhen=void 0;var CP=re(),qP=I(),yv=x(),kP=M();function RP(t){return qP.operate(function(e,r){var n,i,a=function(s){n.error(s),r.error(s)},o=function(){i?.unsubscribe(),n?.complete(),n=new CP.Subject,r.next(n.asObservable());var s;try{s=kP.innerFrom(t())}catch(l){a(l);return}s.subscribe(i=yv.createOperatorSubscriber(r,o,o,a))};o(),e.subscribe(yv.createOperatorSubscriber(r,function(s){return n.next(s)},function(){n.complete(),r.complete()},a,function(){i?.unsubscribe(),n=null}))})}Qo.windowWhen=RP});var Vc=b(vt=>{"use strict";var gv=vt&&vt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},Sv=vt&&vt.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(vt,"__esModule",{value:!0});vt.withLatestFrom=void 0;var MP=I(),Ev=x(),jP=M(),LP=te(),FP=ee(),DP=ue();function UP(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=DP.popResultSelector(t);return MP.operate(function(n,i){for(var a=t.length,o=new Array(a),s=t.map(function(){return!1}),l=!1,u=function(m){jP.innerFrom(t[m]).subscribe(Ev.createOperatorSubscriber(i,function(S){o[m]=S,!l&&!s[m]&&(s[m]=!0,(l=s.every(LP.identity))&&(s=null))},FP.noop))},f=0;f<a;f++)u(f);n.subscribe(Ev.createOperatorSubscriber(i,function(m){if(l){var S=Sv([m],gv(o));i.next(r?r.apply(void 0,Sv([],gv(S))):S)}}))})}vt.withLatestFrom=UP});var Wc=b(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.zipAll=void 0;var GP=sa(),VP=Tu();function WP(t){return VP.joinAllInternals(GP.zip,t)}es.zipAll=WP});var Bc=b(pt=>{"use strict";var BP=pt&&pt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},HP=pt&&pt.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(pt,"__esModule",{value:!0});pt.zip=void 0;var $P=sa(),zP=I();function KP(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return zP.operate(function(r,n){$P.zip.apply(void 0,HP([r],BP(t))).subscribe(n)})}pt.zip=KP});var Hc=b(mt=>{"use strict";var XP=mt&&mt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},ZP=mt&&mt.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(mt,"__esModule",{value:!0});mt.zipWith=void 0;var YP=Bc();function JP(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return YP.zip.apply(void 0,ZP([],XP(t)))}mt.zipWith=JP});var $c=b(c=>{"use strict";var QP=c&&c.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eN=c&&c.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QP(e,t,r)};Object.defineProperty(c,"__esModule",{value:!0});c.interval=c.iif=c.generate=c.fromEventPattern=c.fromEvent=c.from=c.forkJoin=c.empty=c.defer=c.connectable=c.concat=c.combineLatest=c.bindNodeCallback=c.bindCallback=c.UnsubscriptionError=c.TimeoutError=c.SequenceError=c.ObjectUnsubscribedError=c.NotFoundError=c.EmptyError=c.ArgumentOutOfRangeError=c.firstValueFrom=c.lastValueFrom=c.isObservable=c.identity=c.noop=c.pipe=c.NotificationKind=c.Notification=c.Subscriber=c.Subscription=c.Scheduler=c.VirtualAction=c.VirtualTimeScheduler=c.animationFrameScheduler=c.animationFrame=c.queueScheduler=c.queue=c.asyncScheduler=c.async=c.asapScheduler=c.asap=c.AsyncSubject=c.ReplaySubject=c.BehaviorSubject=c.Subject=c.animationFrames=c.observable=c.ConnectableObservable=c.Observable=void 0;c.filter=c.expand=c.exhaustMap=c.exhaustAll=c.exhaust=c.every=c.endWith=c.elementAt=c.distinctUntilKeyChanged=c.distinctUntilChanged=c.distinct=c.dematerialize=c.delayWhen=c.delay=c.defaultIfEmpty=c.debounceTime=c.debounce=c.count=c.connect=c.concatWith=c.concatMapTo=c.concatMap=c.concatAll=c.combineLatestWith=c.combineLatestAll=c.combineAll=c.catchError=c.bufferWhen=c.bufferToggle=c.bufferTime=c.bufferCount=c.buffer=c.auditTime=c.audit=c.config=c.NEVER=c.EMPTY=c.scheduled=c.zip=c.using=c.timer=c.throwError=c.range=c.race=c.partition=c.pairs=c.onErrorResumeNext=c.of=c.never=c.merge=void 0;c.switchMap=c.switchAll=c.subscribeOn=c.startWith=c.skipWhile=c.skipUntil=c.skipLast=c.skip=c.single=c.shareReplay=c.share=c.sequenceEqual=c.scan=c.sampleTime=c.sample=c.refCount=c.retryWhen=c.retry=c.repeatWhen=c.repeat=c.reduce=c.raceWith=c.publishReplay=c.publishLast=c.publishBehavior=c.publish=c.pluck=c.pairwise=c.onErrorResumeNextWith=c.observeOn=c.multicast=c.min=c.mergeWith=c.mergeScan=c.mergeMapTo=c.mergeMap=c.flatMap=c.mergeAll=c.max=c.materialize=c.mapTo=c.map=c.last=c.isEmpty=c.ignoreElements=c.groupBy=c.first=c.findIndex=c.find=c.finalize=void 0;c.zipWith=c.zipAll=c.withLatestFrom=c.windowWhen=c.windowToggle=c.windowTime=c.windowCount=c.window=c.toArray=c.timestamp=c.timeoutWith=c.timeout=c.timeInterval=c.throwIfEmpty=c.throttleTime=c.throttle=c.tap=c.takeWhile=c.takeUntil=c.takeLast=c.take=c.switchScan=c.switchMapTo=void 0;var tN=W();Object.defineProperty(c,"Observable",{enumerable:!0,get:function(){return tN.Observable}});var rN=rn();Object.defineProperty(c,"ConnectableObservable",{enumerable:!0,get:function(){return rN.ConnectableObservable}});var nN=en();Object.defineProperty(c,"observable",{enumerable:!0,get:function(){return nN.observable}});var iN=Ql();Object.defineProperty(c,"animationFrames",{enumerable:!0,get:function(){return iN.animationFrames}});var aN=re();Object.defineProperty(c,"Subject",{enumerable:!0,get:function(){return aN.Subject}});var oN=Fs();Object.defineProperty(c,"BehaviorSubject",{enumerable:!0,get:function(){return oN.BehaviorSubject}});var sN=Zn();Object.defineProperty(c,"ReplaySubject",{enumerable:!0,get:function(){return sN.ReplaySubject}});var uN=Yn();Object.defineProperty(c,"AsyncSubject",{enumerable:!0,get:function(){return uN.AsyncSubject}});var Ov=hd();Object.defineProperty(c,"asap",{enumerable:!0,get:function(){return Ov.asap}});Object.defineProperty(c,"asapScheduler",{enumerable:!0,get:function(){return Ov.asapScheduler}});var Tv=se();Object.defineProperty(c,"async",{enumerable:!0,get:function(){return Tv.async}});Object.defineProperty(c,"asyncScheduler",{enumerable:!0,get:function(){return Tv.asyncScheduler}});var Av=yd();Object.defineProperty(c,"queue",{enumerable:!0,get:function(){return Av.queue}});Object.defineProperty(c,"queueScheduler",{enumerable:!0,get:function(){return Av.queueScheduler}});var wv=Od();Object.defineProperty(c,"animationFrame",{enumerable:!0,get:function(){return wv.animationFrame}});Object.defineProperty(c,"animationFrameScheduler",{enumerable:!0,get:function(){return wv.animationFrameScheduler}});var Iv=wd();Object.defineProperty(c,"VirtualTimeScheduler",{enumerable:!0,get:function(){return Iv.VirtualTimeScheduler}});Object.defineProperty(c,"VirtualAction",{enumerable:!0,get:function(){return Iv.VirtualAction}});var cN=Us();Object.defineProperty(c,"Scheduler",{enumerable:!0,get:function(){return cN.Scheduler}});var lN=ce();Object.defineProperty(c,"Subscription",{enumerable:!0,get:function(){return lN.Subscription}});var dN=ar();Object.defineProperty(c,"Subscriber",{enumerable:!0,get:function(){return dN.Subscriber}});var Pv=Oi();Object.defineProperty(c,"Notification",{enumerable:!0,get:function(){return Pv.Notification}});Object.defineProperty(c,"NotificationKind",{enumerable:!0,get:function(){return Pv.NotificationKind}});var fN=tn();Object.defineProperty(c,"pipe",{enumerable:!0,get:function(){return fN.pipe}});var vN=ee();Object.defineProperty(c,"noop",{enumerable:!0,get:function(){return vN.noop}});var pN=te();Object.defineProperty(c,"identity",{enumerable:!0,get:function(){return pN.identity}});var mN=Wd();Object.defineProperty(c,"isObservable",{enumerable:!0,get:function(){return mN.isObservable}});var hN=Bd();Object.defineProperty(c,"lastValueFrom",{enumerable:!0,get:function(){return hN.lastValueFrom}});var _N=Hd();Object.defineProperty(c,"firstValueFrom",{enumerable:!0,get:function(){return _N.firstValueFrom}});var bN=tu();Object.defineProperty(c,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return bN.ArgumentOutOfRangeError}});var yN=Ye();Object.defineProperty(c,"EmptyError",{enumerable:!0,get:function(){return yN.EmptyError}});var gN=ru();Object.defineProperty(c,"NotFoundError",{enumerable:!0,get:function(){return gN.NotFoundError}});var SN=Rs();Object.defineProperty(c,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return SN.ObjectUnsubscribedError}});var EN=nu();Object.defineProperty(c,"SequenceError",{enumerable:!0,get:function(){return EN.SequenceError}});var ON=sn();Object.defineProperty(c,"TimeoutError",{enumerable:!0,get:function(){return ON.TimeoutError}});var TN=Es();Object.defineProperty(c,"UnsubscriptionError",{enumerable:!0,get:function(){return TN.UnsubscriptionError}});var AN=zd();Object.defineProperty(c,"bindCallback",{enumerable:!0,get:function(){return AN.bindCallback}});var wN=Kd();Object.defineProperty(c,"bindNodeCallback",{enumerable:!0,get:function(){return wN.bindNodeCallback}});var IN=Fi();Object.defineProperty(c,"combineLatest",{enumerable:!0,get:function(){return IN.combineLatest}});var PN=cn();Object.defineProperty(c,"concat",{enumerable:!0,get:function(){return PN.concat}});var NN=rf();Object.defineProperty(c,"connectable",{enumerable:!0,get:function(){return NN.connectable}});var xN=ln();Object.defineProperty(c,"defer",{enumerable:!0,get:function(){return xN.defer}});var CN=_e();Object.defineProperty(c,"empty",{enumerable:!0,get:function(){return CN.empty}});var qN=nf();Object.defineProperty(c,"forkJoin",{enumerable:!0,get:function(){return qN.forkJoin}});var kN=je();Object.defineProperty(c,"from",{enumerable:!0,get:function(){return kN.from}});var RN=of();Object.defineProperty(c,"fromEvent",{enumerable:!0,get:function(){return RN.fromEvent}});var MN=uf();Object.defineProperty(c,"fromEventPattern",{enumerable:!0,get:function(){return MN.fromEventPattern}});var jN=lf();Object.defineProperty(c,"generate",{enumerable:!0,get:function(){return jN.generate}});var LN=df();Object.defineProperty(c,"iif",{enumerable:!0,get:function(){return LN.iif}});var FN=cu();Object.defineProperty(c,"interval",{enumerable:!0,get:function(){return FN.interval}});var DN=vf();Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return DN.merge}});var UN=lu();Object.defineProperty(c,"never",{enumerable:!0,get:function(){return UN.never}});var GN=Si();Object.defineProperty(c,"of",{enumerable:!0,get:function(){return GN.of}});var VN=du();Object.defineProperty(c,"onErrorResumeNext",{enumerable:!0,get:function(){return VN.onErrorResumeNext}});var WN=mf();Object.defineProperty(c,"pairs",{enumerable:!0,get:function(){return WN.pairs}});var BN=bf();Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return BN.partition}});var HN=vu();Object.defineProperty(c,"race",{enumerable:!0,get:function(){return HN.race}});var $N=Sf();Object.defineProperty(c,"range",{enumerable:!0,get:function(){return $N.range}});var zN=eu();Object.defineProperty(c,"throwError",{enumerable:!0,get:function(){return zN.throwError}});var KN=tt();Object.defineProperty(c,"timer",{enumerable:!0,get:function(){return KN.timer}});var XN=Ef();Object.defineProperty(c,"using",{enumerable:!0,get:function(){return XN.using}});var ZN=sa();Object.defineProperty(c,"zip",{enumerable:!0,get:function(){return ZN.zip}});var YN=Qs();Object.defineProperty(c,"scheduled",{enumerable:!0,get:function(){return YN.scheduled}});var JN=_e();Object.defineProperty(c,"EMPTY",{enumerable:!0,get:function(){return JN.EMPTY}});var QN=lu();Object.defineProperty(c,"NEVER",{enumerable:!0,get:function(){return QN.NEVER}});eN(Tf(),c);var ex=nr();Object.defineProperty(c,"config",{enumerable:!0,get:function(){return ex.config}});var tx=ca();Object.defineProperty(c,"audit",{enumerable:!0,get:function(){return tx.audit}});var rx=pu();Object.defineProperty(c,"auditTime",{enumerable:!0,get:function(){return rx.auditTime}});var nx=mu();Object.defineProperty(c,"buffer",{enumerable:!0,get:function(){return nx.buffer}});var ix=_u();Object.defineProperty(c,"bufferCount",{enumerable:!0,get:function(){return ix.bufferCount}});var ax=bu();Object.defineProperty(c,"bufferTime",{enumerable:!0,get:function(){return ax.bufferTime}});var ox=gu();Object.defineProperty(c,"bufferToggle",{enumerable:!0,get:function(){return ox.bufferToggle}});var sx=Su();Object.defineProperty(c,"bufferWhen",{enumerable:!0,get:function(){return sx.bufferWhen}});var ux=Eu();Object.defineProperty(c,"catchError",{enumerable:!0,get:function(){return ux.catchError}});var cx=Au();Object.defineProperty(c,"combineAll",{enumerable:!0,get:function(){return cx.combineAll}});var lx=ga();Object.defineProperty(c,"combineLatestAll",{enumerable:!0,get:function(){return lx.combineLatestAll}});var dx=Iu();Object.defineProperty(c,"combineLatestWith",{enumerable:!0,get:function(){return dx.combineLatestWith}});var fx=un();Object.defineProperty(c,"concatAll",{enumerable:!0,get:function(){return fx.concatAll}});var vx=Oa();Object.defineProperty(c,"concatMap",{enumerable:!0,get:function(){return vx.concatMap}});var px=Pu();Object.defineProperty(c,"concatMapTo",{enumerable:!0,get:function(){return px.concatMapTo}});var mx=xu();Object.defineProperty(c,"concatWith",{enumerable:!0,get:function(){return mx.concatWith}});var hx=dn();Object.defineProperty(c,"connect",{enumerable:!0,get:function(){return hx.connect}});var _x=Cu();Object.defineProperty(c,"count",{enumerable:!0,get:function(){return _x.count}});var bx=qu();Object.defineProperty(c,"debounce",{enumerable:!0,get:function(){return bx.debounce}});var yx=ku();Object.defineProperty(c,"debounceTime",{enumerable:!0,get:function(){return yx.debounceTime}});var gx=Lr();Object.defineProperty(c,"defaultIfEmpty",{enumerable:!0,get:function(){return gx.defaultIfEmpty}});var Sx=Ru();Object.defineProperty(c,"delay",{enumerable:!0,get:function(){return Sx.delay}});var Ex=La();Object.defineProperty(c,"delayWhen",{enumerable:!0,get:function(){return Ex.delayWhen}});var Ox=Mu();Object.defineProperty(c,"dematerialize",{enumerable:!0,get:function(){return Ox.dematerialize}});var Tx=ju();Object.defineProperty(c,"distinct",{enumerable:!0,get:function(){return Tx.distinct}});var Ax=Va();Object.defineProperty(c,"distinctUntilChanged",{enumerable:!0,get:function(){return Ax.distinctUntilChanged}});var wx=Lu();Object.defineProperty(c,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return wx.distinctUntilKeyChanged}});var Ix=Fu();Object.defineProperty(c,"elementAt",{enumerable:!0,get:function(){return Ix.elementAt}});var Px=Du();Object.defineProperty(c,"endWith",{enumerable:!0,get:function(){return Px.endWith}});var Nx=Uu();Object.defineProperty(c,"every",{enumerable:!0,get:function(){return Nx.every}});var xx=Gu();Object.defineProperty(c,"exhaust",{enumerable:!0,get:function(){return xx.exhaust}});var Cx=Za();Object.defineProperty(c,"exhaustAll",{enumerable:!0,get:function(){return Cx.exhaustAll}});var qx=Ka();Object.defineProperty(c,"exhaustMap",{enumerable:!0,get:function(){return qx.exhaustMap}});var kx=Vu();Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return kx.expand}});var Rx=De();Object.defineProperty(c,"filter",{enumerable:!0,get:function(){return Rx.filter}});var Mx=Wu();Object.defineProperty(c,"finalize",{enumerable:!0,get:function(){return Mx.finalize}});var jx=eo();Object.defineProperty(c,"find",{enumerable:!0,get:function(){return jx.find}});var Lx=Bu();Object.defineProperty(c,"findIndex",{enumerable:!0,get:function(){return Lx.findIndex}});var Fx=Hu();Object.defineProperty(c,"first",{enumerable:!0,get:function(){return Fx.first}});var Dx=$u();Object.defineProperty(c,"groupBy",{enumerable:!0,get:function(){return Dx.groupBy}});var Ux=ka();Object.defineProperty(c,"ignoreElements",{enumerable:!0,get:function(){return Ux.ignoreElements}});var Gx=zu();Object.defineProperty(c,"isEmpty",{enumerable:!0,get:function(){return Gx.isEmpty}});var Vx=Ku();Object.defineProperty(c,"last",{enumerable:!0,get:function(){return Vx.last}});var Wx=Fe();Object.defineProperty(c,"map",{enumerable:!0,get:function(){return Wx.map}});var Bx=Ma();Object.defineProperty(c,"mapTo",{enumerable:!0,get:function(){return Bx.mapTo}});var Hx=Zu();Object.defineProperty(c,"materialize",{enumerable:!0,get:function(){return Hx.materialize}});var $x=Yu();Object.defineProperty(c,"max",{enumerable:!0,get:function(){return $x.max}});var zx=xr();Object.defineProperty(c,"mergeAll",{enumerable:!0,get:function(){return zx.mergeAll}});var Kx=Ju();Object.defineProperty(c,"flatMap",{enumerable:!0,get:function(){return Kx.flatMap}});var Xx=Ie();Object.defineProperty(c,"mergeMap",{enumerable:!0,get:function(){return Xx.mergeMap}});var Zx=Qu();Object.defineProperty(c,"mergeMapTo",{enumerable:!0,get:function(){return Zx.mergeMapTo}});var Yx=ec();Object.defineProperty(c,"mergeScan",{enumerable:!0,get:function(){return Yx.mergeScan}});var Jx=rc();Object.defineProperty(c,"mergeWith",{enumerable:!0,get:function(){return Jx.mergeWith}});var Qx=nc();Object.defineProperty(c,"min",{enumerable:!0,get:function(){return Qx.min}});var eC=fn();Object.defineProperty(c,"multicast",{enumerable:!0,get:function(){return eC.multicast}});var tC=Ir();Object.defineProperty(c,"observeOn",{enumerable:!0,get:function(){return tC.observeOn}});var rC=ic();Object.defineProperty(c,"onErrorResumeNextWith",{enumerable:!0,get:function(){return rC.onErrorResumeNextWith}});var nC=ac();Object.defineProperty(c,"pairwise",{enumerable:!0,get:function(){return nC.pairwise}});var iC=oc();Object.defineProperty(c,"pluck",{enumerable:!0,get:function(){return iC.pluck}});var aC=sc();Object.defineProperty(c,"publish",{enumerable:!0,get:function(){return aC.publish}});var oC=uc();Object.defineProperty(c,"publishBehavior",{enumerable:!0,get:function(){return oC.publishBehavior}});var sC=cc();Object.defineProperty(c,"publishLast",{enumerable:!0,get:function(){return sC.publishLast}});var uC=lc();Object.defineProperty(c,"publishReplay",{enumerable:!0,get:function(){return uC.publishReplay}});var cC=So();Object.defineProperty(c,"raceWith",{enumerable:!0,get:function(){return cC.raceWith}});var lC=Ht();Object.defineProperty(c,"reduce",{enumerable:!0,get:function(){return lC.reduce}});var dC=dc();Object.defineProperty(c,"repeat",{enumerable:!0,get:function(){return dC.repeat}});var fC=fc();Object.defineProperty(c,"repeatWhen",{enumerable:!0,get:function(){return fC.repeatWhen}});var vC=vc();Object.defineProperty(c,"retry",{enumerable:!0,get:function(){return vC.retry}});var pC=pc();Object.defineProperty(c,"retryWhen",{enumerable:!0,get:function(){return pC.retryWhen}});var mC=$n();Object.defineProperty(c,"refCount",{enumerable:!0,get:function(){return mC.refCount}});var hC=Io();Object.defineProperty(c,"sample",{enumerable:!0,get:function(){return hC.sample}});var _C=mc();Object.defineProperty(c,"sampleTime",{enumerable:!0,get:function(){return _C.sampleTime}});var bC=hc();Object.defineProperty(c,"scan",{enumerable:!0,get:function(){return bC.scan}});var yC=_c();Object.defineProperty(c,"sequenceEqual",{enumerable:!0,get:function(){return yC.sequenceEqual}});var gC=Co();Object.defineProperty(c,"share",{enumerable:!0,get:function(){return gC.share}});var SC=yc();Object.defineProperty(c,"shareReplay",{enumerable:!0,get:function(){return SC.shareReplay}});var EC=gc();Object.defineProperty(c,"single",{enumerable:!0,get:function(){return EC.single}});var OC=Sc();Object.defineProperty(c,"skip",{enumerable:!0,get:function(){return OC.skip}});var TC=Ec();Object.defineProperty(c,"skipLast",{enumerable:!0,get:function(){return TC.skipLast}});var AC=Oc();Object.defineProperty(c,"skipUntil",{enumerable:!0,get:function(){return AC.skipUntil}});var wC=Tc();Object.defineProperty(c,"skipWhile",{enumerable:!0,get:function(){return wC.skipWhile}});var IC=Ac();Object.defineProperty(c,"startWith",{enumerable:!0,get:function(){return IC.startWith}});var PC=Pr();Object.defineProperty(c,"subscribeOn",{enumerable:!0,get:function(){return PC.subscribeOn}});var NC=wc();Object.defineProperty(c,"switchAll",{enumerable:!0,get:function(){return NC.switchAll}});var xC=Vr();Object.defineProperty(c,"switchMap",{enumerable:!0,get:function(){return xC.switchMap}});var CC=Ic();Object.defineProperty(c,"switchMapTo",{enumerable:!0,get:function(){return CC.switchMapTo}});var qC=Pc();Object.defineProperty(c,"switchScan",{enumerable:!0,get:function(){return qC.switchScan}});var kC=Fr();Object.defineProperty(c,"take",{enumerable:!0,get:function(){return kC.take}});var RC=ao();Object.defineProperty(c,"takeLast",{enumerable:!0,get:function(){return RC.takeLast}});var MC=Nc();Object.defineProperty(c,"takeUntil",{enumerable:!0,get:function(){return MC.takeUntil}});var jC=xc();Object.defineProperty(c,"takeWhile",{enumerable:!0,get:function(){return jC.takeWhile}});var LC=Cc();Object.defineProperty(c,"tap",{enumerable:!0,get:function(){return LC.tap}});var FC=zo();Object.defineProperty(c,"throttle",{enumerable:!0,get:function(){return FC.throttle}});var DC=qc();Object.defineProperty(c,"throttleTime",{enumerable:!0,get:function(){return DC.throttleTime}});var UC=Dr();Object.defineProperty(c,"throwIfEmpty",{enumerable:!0,get:function(){return UC.throwIfEmpty}});var GC=kc();Object.defineProperty(c,"timeInterval",{enumerable:!0,get:function(){return GC.timeInterval}});var VC=sn();Object.defineProperty(c,"timeout",{enumerable:!0,get:function(){return VC.timeout}});var WC=Rc();Object.defineProperty(c,"timeoutWith",{enumerable:!0,get:function(){return WC.timeoutWith}});var BC=Mc();Object.defineProperty(c,"timestamp",{enumerable:!0,get:function(){return BC.timestamp}});var HC=_a();Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return HC.toArray}});var $C=jc();Object.defineProperty(c,"window",{enumerable:!0,get:function(){return $C.window}});var zC=Lc();Object.defineProperty(c,"windowCount",{enumerable:!0,get:function(){return zC.windowCount}});var KC=Fc();Object.defineProperty(c,"windowTime",{enumerable:!0,get:function(){return KC.windowTime}});var XC=Uc();Object.defineProperty(c,"windowToggle",{enumerable:!0,get:function(){return XC.windowToggle}});var ZC=Gc();Object.defineProperty(c,"windowWhen",{enumerable:!0,get:function(){return ZC.windowWhen}});var YC=Vc();Object.defineProperty(c,"withLatestFrom",{enumerable:!0,get:function(){return YC.withLatestFrom}});var JC=Wc();Object.defineProperty(c,"zipAll",{enumerable:!0,get:function(){return JC.zipAll}});var QC=Hc();Object.defineProperty(c,"zipWith",{enumerable:!0,get:function(){return QC.zipWith}})});var xv=b(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.partition=void 0;var eq=fu(),Nv=De();function tq(t,e){return function(r){return[Nv.filter(t,e)(r),Nv.filter(eq.not(t,e))(r)]}}ts.partition=tq});var Cv=b(ht=>{"use strict";var rq=ht&&ht.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a},nq=ht&&ht.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(ht,"__esModule",{value:!0});ht.race=void 0;var iq=rt(),aq=So();function oq(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return aq.raceWith.apply(void 0,nq([],rq(iq.argsOrArgArray(t))))}ht.race=oq});var qv=b(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.mergeAll=h.merge=h.max=h.materialize=h.mapTo=h.map=h.last=h.isEmpty=h.ignoreElements=h.groupBy=h.first=h.findIndex=h.find=h.finalize=h.filter=h.expand=h.exhaustMap=h.exhaustAll=h.exhaust=h.every=h.endWith=h.elementAt=h.distinctUntilKeyChanged=h.distinctUntilChanged=h.distinct=h.dematerialize=h.delayWhen=h.delay=h.defaultIfEmpty=h.debounceTime=h.debounce=h.count=h.connect=h.concatWith=h.concatMapTo=h.concatMap=h.concatAll=h.concat=h.combineLatestWith=h.combineLatest=h.combineLatestAll=h.combineAll=h.catchError=h.bufferWhen=h.bufferToggle=h.bufferTime=h.bufferCount=h.buffer=h.auditTime=h.audit=void 0;h.timeInterval=h.throwIfEmpty=h.throttleTime=h.throttle=h.tap=h.takeWhile=h.takeUntil=h.takeLast=h.take=h.switchScan=h.switchMapTo=h.switchMap=h.switchAll=h.subscribeOn=h.startWith=h.skipWhile=h.skipUntil=h.skipLast=h.skip=h.single=h.shareReplay=h.share=h.sequenceEqual=h.scan=h.sampleTime=h.sample=h.refCount=h.retryWhen=h.retry=h.repeatWhen=h.repeat=h.reduce=h.raceWith=h.race=h.publishReplay=h.publishLast=h.publishBehavior=h.publish=h.pluck=h.partition=h.pairwise=h.onErrorResumeNext=h.observeOn=h.multicast=h.min=h.mergeWith=h.mergeScan=h.mergeMapTo=h.mergeMap=h.flatMap=void 0;h.zipWith=h.zipAll=h.zip=h.withLatestFrom=h.windowWhen=h.windowToggle=h.windowTime=h.windowCount=h.window=h.toArray=h.timestamp=h.timeoutWith=h.timeout=void 0;var sq=ca();Object.defineProperty(h,"audit",{enumerable:!0,get:function(){return sq.audit}});var uq=pu();Object.defineProperty(h,"auditTime",{enumerable:!0,get:function(){return uq.auditTime}});var cq=mu();Object.defineProperty(h,"buffer",{enumerable:!0,get:function(){return cq.buffer}});var lq=_u();Object.defineProperty(h,"bufferCount",{enumerable:!0,get:function(){return lq.bufferCount}});var dq=bu();Object.defineProperty(h,"bufferTime",{enumerable:!0,get:function(){return dq.bufferTime}});var fq=gu();Object.defineProperty(h,"bufferToggle",{enumerable:!0,get:function(){return fq.bufferToggle}});var vq=Su();Object.defineProperty(h,"bufferWhen",{enumerable:!0,get:function(){return vq.bufferWhen}});var pq=Eu();Object.defineProperty(h,"catchError",{enumerable:!0,get:function(){return pq.catchError}});var mq=Au();Object.defineProperty(h,"combineAll",{enumerable:!0,get:function(){return mq.combineAll}});var hq=ga();Object.defineProperty(h,"combineLatestAll",{enumerable:!0,get:function(){return hq.combineLatestAll}});var _q=wu();Object.defineProperty(h,"combineLatest",{enumerable:!0,get:function(){return _q.combineLatest}});var bq=Iu();Object.defineProperty(h,"combineLatestWith",{enumerable:!0,get:function(){return bq.combineLatestWith}});var yq=Nu();Object.defineProperty(h,"concat",{enumerable:!0,get:function(){return yq.concat}});var gq=un();Object.defineProperty(h,"concatAll",{enumerable:!0,get:function(){return gq.concatAll}});var Sq=Oa();Object.defineProperty(h,"concatMap",{enumerable:!0,get:function(){return Sq.concatMap}});var Eq=Pu();Object.defineProperty(h,"concatMapTo",{enumerable:!0,get:function(){return Eq.concatMapTo}});var Oq=xu();Object.defineProperty(h,"concatWith",{enumerable:!0,get:function(){return Oq.concatWith}});var Tq=dn();Object.defineProperty(h,"connect",{enumerable:!0,get:function(){return Tq.connect}});var Aq=Cu();Object.defineProperty(h,"count",{enumerable:!0,get:function(){return Aq.count}});var wq=qu();Object.defineProperty(h,"debounce",{enumerable:!0,get:function(){return wq.debounce}});var Iq=ku();Object.defineProperty(h,"debounceTime",{enumerable:!0,get:function(){return Iq.debounceTime}});var Pq=Lr();Object.defineProperty(h,"defaultIfEmpty",{enumerable:!0,get:function(){return Pq.defaultIfEmpty}});var Nq=Ru();Object.defineProperty(h,"delay",{enumerable:!0,get:function(){return Nq.delay}});var xq=La();Object.defineProperty(h,"delayWhen",{enumerable:!0,get:function(){return xq.delayWhen}});var Cq=Mu();Object.defineProperty(h,"dematerialize",{enumerable:!0,get:function(){return Cq.dematerialize}});var qq=ju();Object.defineProperty(h,"distinct",{enumerable:!0,get:function(){return qq.distinct}});var kq=Va();Object.defineProperty(h,"distinctUntilChanged",{enumerable:!0,get:function(){return kq.distinctUntilChanged}});var Rq=Lu();Object.defineProperty(h,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Rq.distinctUntilKeyChanged}});var Mq=Fu();Object.defineProperty(h,"elementAt",{enumerable:!0,get:function(){return Mq.elementAt}});var jq=Du();Object.defineProperty(h,"endWith",{enumerable:!0,get:function(){return jq.endWith}});var Lq=Uu();Object.defineProperty(h,"every",{enumerable:!0,get:function(){return Lq.every}});var Fq=Gu();Object.defineProperty(h,"exhaust",{enumerable:!0,get:function(){return Fq.exhaust}});var Dq=Za();Object.defineProperty(h,"exhaustAll",{enumerable:!0,get:function(){return Dq.exhaustAll}});var Uq=Ka();Object.defineProperty(h,"exhaustMap",{enumerable:!0,get:function(){return Uq.exhaustMap}});var Gq=Vu();Object.defineProperty(h,"expand",{enumerable:!0,get:function(){return Gq.expand}});var Vq=De();Object.defineProperty(h,"filter",{enumerable:!0,get:function(){return Vq.filter}});var Wq=Wu();Object.defineProperty(h,"finalize",{enumerable:!0,get:function(){return Wq.finalize}});var Bq=eo();Object.defineProperty(h,"find",{enumerable:!0,get:function(){return Bq.find}});var Hq=Bu();Object.defineProperty(h,"findIndex",{enumerable:!0,get:function(){return Hq.findIndex}});var $q=Hu();Object.defineProperty(h,"first",{enumerable:!0,get:function(){return $q.first}});var zq=$u();Object.defineProperty(h,"groupBy",{enumerable:!0,get:function(){return zq.groupBy}});var Kq=ka();Object.defineProperty(h,"ignoreElements",{enumerable:!0,get:function(){return Kq.ignoreElements}});var Xq=zu();Object.defineProperty(h,"isEmpty",{enumerable:!0,get:function(){return Xq.isEmpty}});var Zq=Ku();Object.defineProperty(h,"last",{enumerable:!0,get:function(){return Zq.last}});var Yq=Fe();Object.defineProperty(h,"map",{enumerable:!0,get:function(){return Yq.map}});var Jq=Ma();Object.defineProperty(h,"mapTo",{enumerable:!0,get:function(){return Jq.mapTo}});var Qq=Zu();Object.defineProperty(h,"materialize",{enumerable:!0,get:function(){return Qq.materialize}});var ek=Yu();Object.defineProperty(h,"max",{enumerable:!0,get:function(){return ek.max}});var tk=tc();Object.defineProperty(h,"merge",{enumerable:!0,get:function(){return tk.merge}});var rk=xr();Object.defineProperty(h,"mergeAll",{enumerable:!0,get:function(){return rk.mergeAll}});var nk=Ju();Object.defineProperty(h,"flatMap",{enumerable:!0,get:function(){return nk.flatMap}});var ik=Ie();Object.defineProperty(h,"mergeMap",{enumerable:!0,get:function(){return ik.mergeMap}});var ak=Qu();Object.defineProperty(h,"mergeMapTo",{enumerable:!0,get:function(){return ak.mergeMapTo}});var ok=ec();Object.defineProperty(h,"mergeScan",{enumerable:!0,get:function(){return ok.mergeScan}});var sk=rc();Object.defineProperty(h,"mergeWith",{enumerable:!0,get:function(){return sk.mergeWith}});var uk=nc();Object.defineProperty(h,"min",{enumerable:!0,get:function(){return uk.min}});var ck=fn();Object.defineProperty(h,"multicast",{enumerable:!0,get:function(){return ck.multicast}});var lk=Ir();Object.defineProperty(h,"observeOn",{enumerable:!0,get:function(){return lk.observeOn}});var dk=ic();Object.defineProperty(h,"onErrorResumeNext",{enumerable:!0,get:function(){return dk.onErrorResumeNext}});var fk=ac();Object.defineProperty(h,"pairwise",{enumerable:!0,get:function(){return fk.pairwise}});var vk=xv();Object.defineProperty(h,"partition",{enumerable:!0,get:function(){return vk.partition}});var pk=oc();Object.defineProperty(h,"pluck",{enumerable:!0,get:function(){return pk.pluck}});var mk=sc();Object.defineProperty(h,"publish",{enumerable:!0,get:function(){return mk.publish}});var hk=uc();Object.defineProperty(h,"publishBehavior",{enumerable:!0,get:function(){return hk.publishBehavior}});var _k=cc();Object.defineProperty(h,"publishLast",{enumerable:!0,get:function(){return _k.publishLast}});var bk=lc();Object.defineProperty(h,"publishReplay",{enumerable:!0,get:function(){return bk.publishReplay}});var yk=Cv();Object.defineProperty(h,"race",{enumerable:!0,get:function(){return yk.race}});var gk=So();Object.defineProperty(h,"raceWith",{enumerable:!0,get:function(){return gk.raceWith}});var Sk=Ht();Object.defineProperty(h,"reduce",{enumerable:!0,get:function(){return Sk.reduce}});var Ek=dc();Object.defineProperty(h,"repeat",{enumerable:!0,get:function(){return Ek.repeat}});var Ok=fc();Object.defineProperty(h,"repeatWhen",{enumerable:!0,get:function(){return Ok.repeatWhen}});var Tk=vc();Object.defineProperty(h,"retry",{enumerable:!0,get:function(){return Tk.retry}});var Ak=pc();Object.defineProperty(h,"retryWhen",{enumerable:!0,get:function(){return Ak.retryWhen}});var wk=$n();Object.defineProperty(h,"refCount",{enumerable:!0,get:function(){return wk.refCount}});var Ik=Io();Object.defineProperty(h,"sample",{enumerable:!0,get:function(){return Ik.sample}});var Pk=mc();Object.defineProperty(h,"sampleTime",{enumerable:!0,get:function(){return Pk.sampleTime}});var Nk=hc();Object.defineProperty(h,"scan",{enumerable:!0,get:function(){return Nk.scan}});var xk=_c();Object.defineProperty(h,"sequenceEqual",{enumerable:!0,get:function(){return xk.sequenceEqual}});var Ck=Co();Object.defineProperty(h,"share",{enumerable:!0,get:function(){return Ck.share}});var qk=yc();Object.defineProperty(h,"shareReplay",{enumerable:!0,get:function(){return qk.shareReplay}});var kk=gc();Object.defineProperty(h,"single",{enumerable:!0,get:function(){return kk.single}});var Rk=Sc();Object.defineProperty(h,"skip",{enumerable:!0,get:function(){return Rk.skip}});var Mk=Ec();Object.defineProperty(h,"skipLast",{enumerable:!0,get:function(){return Mk.skipLast}});var jk=Oc();Object.defineProperty(h,"skipUntil",{enumerable:!0,get:function(){return jk.skipUntil}});var Lk=Tc();Object.defineProperty(h,"skipWhile",{enumerable:!0,get:function(){return Lk.skipWhile}});var Fk=Ac();Object.defineProperty(h,"startWith",{enumerable:!0,get:function(){return Fk.startWith}});var Dk=Pr();Object.defineProperty(h,"subscribeOn",{enumerable:!0,get:function(){return Dk.subscribeOn}});var Uk=wc();Object.defineProperty(h,"switchAll",{enumerable:!0,get:function(){return Uk.switchAll}});var Gk=Vr();Object.defineProperty(h,"switchMap",{enumerable:!0,get:function(){return Gk.switchMap}});var Vk=Ic();Object.defineProperty(h,"switchMapTo",{enumerable:!0,get:function(){return Vk.switchMapTo}});var Wk=Pc();Object.defineProperty(h,"switchScan",{enumerable:!0,get:function(){return Wk.switchScan}});var Bk=Fr();Object.defineProperty(h,"take",{enumerable:!0,get:function(){return Bk.take}});var Hk=ao();Object.defineProperty(h,"takeLast",{enumerable:!0,get:function(){return Hk.takeLast}});var $k=Nc();Object.defineProperty(h,"takeUntil",{enumerable:!0,get:function(){return $k.takeUntil}});var zk=xc();Object.defineProperty(h,"takeWhile",{enumerable:!0,get:function(){return zk.takeWhile}});var Kk=Cc();Object.defineProperty(h,"tap",{enumerable:!0,get:function(){return Kk.tap}});var Xk=zo();Object.defineProperty(h,"throttle",{enumerable:!0,get:function(){return Xk.throttle}});var Zk=qc();Object.defineProperty(h,"throttleTime",{enumerable:!0,get:function(){return Zk.throttleTime}});var Yk=Dr();Object.defineProperty(h,"throwIfEmpty",{enumerable:!0,get:function(){return Yk.throwIfEmpty}});var Jk=kc();Object.defineProperty(h,"timeInterval",{enumerable:!0,get:function(){return Jk.timeInterval}});var Qk=sn();Object.defineProperty(h,"timeout",{enumerable:!0,get:function(){return Qk.timeout}});var eR=Rc();Object.defineProperty(h,"timeoutWith",{enumerable:!0,get:function(){return eR.timeoutWith}});var tR=Mc();Object.defineProperty(h,"timestamp",{enumerable:!0,get:function(){return tR.timestamp}});var rR=_a();Object.defineProperty(h,"toArray",{enumerable:!0,get:function(){return rR.toArray}});var nR=jc();Object.defineProperty(h,"window",{enumerable:!0,get:function(){return nR.window}});var iR=Lc();Object.defineProperty(h,"windowCount",{enumerable:!0,get:function(){return iR.windowCount}});var aR=Fc();Object.defineProperty(h,"windowTime",{enumerable:!0,get:function(){return aR.windowTime}});var oR=Uc();Object.defineProperty(h,"windowToggle",{enumerable:!0,get:function(){return oR.windowToggle}});var sR=Gc();Object.defineProperty(h,"windowWhen",{enumerable:!0,get:function(){return sR.windowWhen}});var uR=Vc();Object.defineProperty(h,"withLatestFrom",{enumerable:!0,get:function(){return uR.withLatestFrom}});var cR=Bc();Object.defineProperty(h,"zip",{enumerable:!0,get:function(){return cR.zip}});var lR=Wc();Object.defineProperty(h,"zipAll",{enumerable:!0,get:function(){return lR.zipAll}});var dR=Hc();Object.defineProperty(h,"zipWith",{enumerable:!0,get:function(){return dR.zipWith}})});var GR={};hn(GR,{AbstractAgent:()=>os,EventType:()=>y,PROTOCOL_VERSION:()=>Vv,SDK_VERSION:()=>ss,SURG_EVENT:()=>V,SurogatesAuthError:()=>Ue,SurogatesError:()=>_t,SurogatesNetworkError:()=>$t,SurogatesProtocolError:()=>bt,SurogatesRateLimitError:()=>$r,Translator:()=>zt,WebsiteAgent:()=>cs});var Y=[];for(let t=0;t<256;++t)Y.push((t+256).toString(16).slice(1));function ol(t,e=0){return(Y[t[e+0]]+Y[t[e+1]]+Y[t[e+2]]+Y[t[e+3]]+"-"+Y[t[e+4]]+Y[t[e+5]]+"-"+Y[t[e+6]]+Y[t[e+7]]+"-"+Y[t[e+8]]+Y[t[e+9]]+"-"+Y[t[e+10]]+Y[t[e+11]]+Y[t[e+12]]+Y[t[e+13]]+Y[t[e+14]]+Y[t[e+15]]).toLowerCase()}var sl=il("crypto"),bn=new Uint8Array(256),_n=bn.length;function ds(){return _n>bn.length-16&&((0,sl.randomFillSync)(bn),_n=0),bn.slice(_n,_n+=16)}var ul=il("crypto"),fs={randomUUID:ul.randomUUID};function ap(t,e,r){if(fs.randomUUID&&!e&&!t)return fs.randomUUID();t=t||{};let n=t.random??t.rng?.()??ds();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return ol(n)}var Ge=ap;var d={};hn(d,{BRAND:()=>Cp,DIRTY:()=>yt,EMPTY_PATH:()=>cp,INVALID:()=>C,NEVER:()=>mm,OK:()=>ne,ParseStatus:()=>J,Schema:()=>j,ZodAny:()=>Be,ZodArray:()=>ke,ZodBigInt:()=>St,ZodBoolean:()=>Et,ZodBranded:()=>Kr,ZodCatch:()=>kt,ZodDate:()=>Ot,ZodDefault:()=>qt,ZodDiscriminatedUnion:()=>Sn,ZodEffects:()=>fe,ZodEnum:()=>xt,ZodError:()=>ie,ZodFirstPartyTypeKind:()=>q,ZodFunction:()=>On,ZodIntersection:()=>It,ZodIssueCode:()=>T,ZodLazy:()=>Pt,ZodLiteral:()=>Nt,ZodMap:()=>Qt,ZodNaN:()=>tr,ZodNativeEnum:()=>Ct,ZodNever:()=>pe,ZodNull:()=>At,ZodNullable:()=>ge,ZodNumber:()=>gt,ZodObject:()=>ae,ZodOptional:()=>le,ZodParsedType:()=>w,ZodPipeline:()=>Xr,ZodPromise:()=>He,ZodReadonly:()=>Rt,ZodRecord:()=>En,ZodSchema:()=>j,ZodSet:()=>er,ZodString:()=>We,ZodSymbol:()=>Yt,ZodTransformer:()=>fe,ZodTuple:()=>ye,ZodType:()=>j,ZodUndefined:()=>Tt,ZodUnion:()=>wt,ZodUnknown:()=>qe,ZodVoid:()=>Jt,addIssueToContext:()=>A,any:()=>Up,array:()=>Bp,bigint:()=>Mp,boolean:()=>yl,coerce:()=>pm,custom:()=>hl,date:()=>jp,datetimeRegex:()=>pl,defaultErrorMap:()=>xe,discriminatedUnion:()=>Kp,effect:()=>om,enum:()=>nm,function:()=>em,getErrorMap:()=>Kt,getParsedType:()=>be,instanceof:()=>kp,intersection:()=>Xp,isAborted:()=>yn,isAsync:()=>Xt,isDirty:()=>gn,isValid:()=>Ve,late:()=>qp,lazy:()=>tm,literal:()=>rm,makeIssue:()=>zr,map:()=>Jp,nan:()=>Rp,nativeEnum:()=>im,never:()=>Vp,null:()=>Dp,nullable:()=>um,number:()=>bl,object:()=>Hp,objectUtil:()=>vs,oboolean:()=>vm,onumber:()=>fm,optional:()=>sm,ostring:()=>dm,pipeline:()=>lm,preprocess:()=>cm,promise:()=>am,quotelessJson:()=>op,record:()=>Yp,set:()=>Qp,setErrorMap:()=>up,strictObject:()=>$p,string:()=>_l,symbol:()=>Lp,transformer:()=>om,tuple:()=>Zp,undefined:()=>Fp,union:()=>zp,unknown:()=>Gp,util:()=>L,void:()=>Wp});var L;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let o of i)a[o]=o;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(let s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(let o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(L||(L={}));var vs;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(vs||(vs={}));var w=L.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),be=t=>{switch(typeof t){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(t)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(t)?w.array:t===null?w.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?w.promise:typeof Map<"u"&&t instanceof Map?w.map:typeof Set<"u"&&t instanceof Set?w.set:typeof Date<"u"&&t instanceof Date?w.date:w.object;default:return w.unknown}};var T=L.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),op=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ie=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;l<o.path.length;){let u=o.path[l];l===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(o))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,L.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ie.create=t=>new ie(t);var sp=(t,e)=>{let r;switch(t.code){case T.invalid_type:t.received===w.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case T.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,L.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:r=`Unrecognized key(s) in object: ${L.joinValues(t.keys,", ")}`;break;case T.invalid_union:r="Invalid input";break;case T.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${L.joinValues(t.options)}`;break;case T.invalid_enum_value:r=`Invalid enum value. Expected ${L.joinValues(t.options)}, received '${t.received}'`;break;case T.invalid_arguments:r="Invalid function arguments";break;case T.invalid_return_type:r="Invalid function return type";break;case T.invalid_date:r="Invalid date";break;case T.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:L.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case T.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case T.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case T.custom:r="Invalid input";break;case T.invalid_intersection_types:r="Intersection results could not be merged";break;case T.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case T.not_finite:r="Number must be finite";break;default:r=e.defaultError,L.assertNever(t)}return{message:r}},xe=sp;var cl=xe;function up(t){cl=t}function Kt(){return cl}var zr=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)s=u(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}},cp=[];function A(t,e){let r=Kt(),n=zr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===xe?void 0:xe].filter(i=>!!i)});t.common.issues.push(n)}var J=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return C;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let a=await i.key,o=await i.value;n.push({key:a,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return C;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}},C=Object.freeze({status:"aborted"}),yt=t=>({status:"dirty",value:t}),ne=t=>({status:"valid",value:t}),yn=t=>t.status==="aborted",gn=t=>t.status==="dirty",Ve=t=>t.status==="valid",Xt=t=>typeof Promise<"u"&&t instanceof Promise;var N;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(N||(N={}));var de=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ll=(t,e)=>{if(Ve(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ie(t.common.issues);return this._error=r,this._error}}};function R(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{let{message:l}=t;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:i}}var j=class{get description(){return this._def.description}_getType(e){return be(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new J,ctx:{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Xt(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},i=this._parseSync({data:e,path:n.path,parent:n});return ll(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Ve(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Ve(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Xt(i)?i:Promise.resolve(i));return ll(n,a)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let o=e(i),s=()=>a.addIssue({code:T.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new fe({schema:this,typeName:q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return le.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ke.create(this)}promise(){return He.create(this,this._def)}or(e){return wt.create([this,e],this._def)}and(e){return It.create(this,e,this._def)}transform(e){return new fe({...R(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new qt({...R(this._def),innerType:this,defaultValue:r,typeName:q.ZodDefault})}brand(){return new Kr({typeName:q.ZodBranded,type:this,...R(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new kt({...R(this._def),innerType:this,catchValue:r,typeName:q.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Xr.create(this,e)}readonly(){return Rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},lp=/^c[^\s-]{8,}$/i,dp=/^[0-9a-z]+$/,fp=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,pp=/^[a-z0-9_-]{21}$/i,mp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_p=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ps,yp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Sp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ep=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Op=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Tp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fl="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ap=new RegExp(`^${fl}$`);function vl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function wp(t){return new RegExp(`^${vl(t)}$`)}function pl(t){let e=`${fl}T${vl(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Ip(t,e){return!!((e==="v4"||!e)&&yp.test(t)||(e==="v6"||!e)&&Sp.test(t))}function Pp(t,e){if(!mp.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Np(t,e){return!!((e==="v4"||!e)&&gp.test(t)||(e==="v6"||!e)&&Ep.test(t))}var We=class t extends j{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let a=this._getOrReturnCtx(e);return A(a,{code:T.invalid_type,expected:w.string,received:a.parsedType}),C}let n=new J,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),A(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),A(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?A(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&A(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")_p.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"email",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")ps||(ps=new RegExp(bp,"u")),ps.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"emoji",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")vp.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"uuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")pp.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"nanoid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")lp.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"cuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")dp.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"cuid2",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")fp.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"ulid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),A(i,{validation:"url",code:T.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"regex",code:T.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),A(i,{code:T.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),A(i,{code:T.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),A(i,{code:T.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?pl(a).test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{code:T.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Ap.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{code:T.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?wp(a).test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{code:T.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?hp.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"duration",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Ip(e.data,a.version)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"ip",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Pp(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"jwt",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Np(e.data,a.version)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"cidr",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Op.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"base64",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Tp.test(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{validation:"base64url",code:T.invalid_string,message:a.message}),n.dirty()):L.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:T.invalid_string,...N.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...N.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...N.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...N.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...N.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...N.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...N.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...N.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...N.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...N.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...N.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...N.errToObj(r)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};We.create=t=>new We({checks:[],typeName:q.ZodString,coerce:t?.coerce??!1,...R(t)});function xp(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}var gt=class t extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){let a=this._getOrReturnCtx(e);return A(a,{code:T.invalid_type,expected:w.number,received:a.parsedType}),C}let n,i=new J;for(let a of this._def.checks)a.kind==="int"?L.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:T.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),A(n,{code:T.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),A(n,{code:T.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?xp(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),A(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:T.not_finite,message:a.message}),i.dirty()):L.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&L.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};gt.create=t=>new gt({checks:[],typeName:q.ZodNumber,coerce:t?.coerce||!1,...R(t)});var St=class t extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n,i=new J;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),A(n,{code:T.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),A(n,{code:T.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),A(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):L.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:w.bigint,received:r.parsedType}),C}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};St.create=t=>new St({checks:[],typeName:q.ZodBigInt,coerce:t?.coerce??!1,...R(t)});var Et=class extends j{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let n=this._getOrReturnCtx(e);return A(n,{code:T.invalid_type,expected:w.boolean,received:n.parsedType}),C}return ne(e.data)}};Et.create=t=>new Et({typeName:q.ZodBoolean,coerce:t?.coerce||!1,...R(t)});var Ot=class t extends j{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let a=this._getOrReturnCtx(e);return A(a,{code:T.invalid_type,expected:w.date,received:a.parsedType}),C}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return A(a,{code:T.invalid_date}),C}let n=new J,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),A(i,{code:T.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),A(i,{code:T.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):L.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:N.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Ot.create=t=>new Ot({checks:[],coerce:t?.coerce||!1,typeName:q.ZodDate,...R(t)});var Yt=class extends j{_parse(e){if(this._getType(e)!==w.symbol){let n=this._getOrReturnCtx(e);return A(n,{code:T.invalid_type,expected:w.symbol,received:n.parsedType}),C}return ne(e.data)}};Yt.create=t=>new Yt({typeName:q.ZodSymbol,...R(t)});var Tt=class extends j{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return A(n,{code:T.invalid_type,expected:w.undefined,received:n.parsedType}),C}return ne(e.data)}};Tt.create=t=>new Tt({typeName:q.ZodUndefined,...R(t)});var At=class extends j{_parse(e){if(this._getType(e)!==w.null){let n=this._getOrReturnCtx(e);return A(n,{code:T.invalid_type,expected:w.null,received:n.parsedType}),C}return ne(e.data)}};At.create=t=>new At({typeName:q.ZodNull,...R(t)});var Be=class extends j{constructor(){super(...arguments),this._any=!0}_parse(e){return ne(e.data)}};Be.create=t=>new Be({typeName:q.ZodAny,...R(t)});var qe=class extends j{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ne(e.data)}};qe.create=t=>new qe({typeName:q.ZodUnknown,...R(t)});var pe=class extends j{_parse(e){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:w.never,received:r.parsedType}),C}};pe.create=t=>new pe({typeName:q.ZodNever,...R(t)});var Jt=class extends j{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return A(n,{code:T.invalid_type,expected:w.void,received:n.parsedType}),C}return ne(e.data)}};Jt.create=t=>new Jt({typeName:q.ZodVoid,...R(t)});var ke=class t extends j{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==w.array)return A(r,{code:T.invalid_type,expected:w.array,received:r.parsedType}),C;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(A(r,{code:o?T.too_big:T.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(A(r,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(A(r,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new de(r,o,r.path,s)))).then(o=>J.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new de(r,o,r.path,s)));return J.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:N.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:N.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:N.toString(r)}})}nonempty(e){return this.min(1,e)}};ke.create=(t,e)=>new ke({type:t,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...R(e)});function Zt(t){if(t instanceof ae){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=le.create(Zt(n))}return new ae({...t._def,shape:()=>e})}else return t instanceof ke?new ke({...t._def,type:Zt(t.element)}):t instanceof le?le.create(Zt(t.unwrap())):t instanceof ge?ge.create(Zt(t.unwrap())):t instanceof ye?ye.create(t.items.map(e=>Zt(e))):t}var ae=class t extends j{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=L.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==w.object){let u=this._getOrReturnCtx(e);return A(u,{code:T.invalid_type,expected:w.object,received:u.parsedType}),C}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof pe&&this._def.unknownKeys==="strip"))for(let u in i.data)o.includes(u)||s.push(u);let l=[];for(let u of o){let f=a[u],m=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new de(i,m,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof pe){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")s.length>0&&(A(i,{code:T.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of s){let m=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new de(i,m,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of l){let m=await f.key,S=await f.value;u.push({key:m,value:S,alwaysSet:f.alwaysSet})}return u}).then(u=>J.mergeObjectSync(n,u)):J.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:N.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:q.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of L.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of L.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Zt(this)}partial(e){let r={};for(let n of L.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of L.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof le;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return ml(L.objectKeys(this.shape))}};ae.create=(t,e)=>new ae({shape:()=>t,unknownKeys:"strip",catchall:pe.create(),typeName:q.ZodObject,...R(e)});ae.strictCreate=(t,e)=>new ae({shape:()=>t,unknownKeys:"strict",catchall:pe.create(),typeName:q.ZodObject,...R(e)});ae.lazycreate=(t,e)=>new ae({shape:t,unknownKeys:"strip",catchall:pe.create(),typeName:q.ZodObject,...R(e)});var wt=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new ie(s.ctx.common.issues));return A(r,{code:T.invalid_union,unionErrors:o}),C}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a,o=[];for(let l of n){let u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(l=>new ie(l));return A(r,{code:T.invalid_union,unionErrors:s}),C}}get options(){return this._def.options}};wt.create=(t,e)=>new wt({options:t,typeName:q.ZodUnion,...R(e)});var Ce=t=>t instanceof Pt?Ce(t.schema):t instanceof fe?Ce(t.innerType()):t instanceof Nt?[t.value]:t instanceof xt?t.options:t instanceof Ct?L.objectValues(t.enum):t instanceof qt?Ce(t._def.innerType):t instanceof Tt?[void 0]:t instanceof At?[null]:t instanceof le?[void 0,...Ce(t.unwrap())]:t instanceof ge?[null,...Ce(t.unwrap())]:t instanceof Kr||t instanceof Rt?Ce(t.unwrap()):t instanceof kt?Ce(t._def.innerType):[],Sn=class t extends j{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.object)return A(r,{code:T.invalid_type,expected:w.object,received:r.parsedType}),C;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(A(r,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),C)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let a of r){let o=Ce(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new t({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...R(n)})}};function ms(t,e){let r=be(t),n=be(e);if(t===e)return{valid:!0,data:t};if(r===w.object&&n===w.object){let i=L.objectKeys(e),a=L.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let l=ms(t[s],e[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===w.array&&n===w.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let o=t[a],s=e[a],l=ms(o,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return r===w.date&&n===w.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var It=class extends j{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(yn(a)||yn(o))return C;let s=ms(a.value,o.value);return s.valid?((gn(a)||gn(o))&&r.dirty(),{status:r.value,value:s.data}):(A(n,{code:T.invalid_intersection_types}),C)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};It.create=(t,e,r)=>new It({left:t,right:e,typeName:q.ZodIntersection,...R(r)});var ye=class t extends j{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return A(n,{code:T.invalid_type,expected:w.array,received:n.parsedType}),C;if(n.data.length<this._def.items.length)return A(n,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),C;!this._def.rest&&n.data.length>this._def.items.length&&(A(n,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new de(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>J.mergeArray(r,o)):J.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ye.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:t,typeName:q.ZodTuple,rest:null,...R(e)})};var En=class t extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.object)return A(n,{code:T.invalid_type,expected:w.object,received:n.parsedType}),C;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new de(n,s,n.path,s)),value:o._parse(new de(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?J.mergeObjectAsync(r,i):J.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof j?new t({keyType:e,valueType:r,typeName:q.ZodRecord,...R(n)}):new t({keyType:We.create(),valueType:e,typeName:q.ZodRecord,...R(r)})}},Qt=class extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.map)return A(n,{code:T.invalid_type,expected:w.map,received:n.parsedType}),C;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,l],u)=>({key:i._parse(new de(n,s,n.path,[u,"key"])),value:a._parse(new de(n,l,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of o){let u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return C;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let l of o){let u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return C;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}};Qt.create=(t,e,r)=>new Qt({valueType:e,keyType:t,typeName:q.ZodMap,...R(r)});var er=class t extends j{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return A(n,{code:T.invalid_type,expected:w.set,received:n.parsedType}),C;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(A(n,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(A(n,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function o(l){let u=new Set;for(let f of l){if(f.status==="aborted")return C;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((l,u)=>a._parse(new de(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:N.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:N.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};er.create=(t,e)=>new er({valueType:t,minSize:null,maxSize:null,typeName:q.ZodSet,...R(e)});var On=class t extends j{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.function)return A(r,{code:T.invalid_type,expected:w.function,received:r.parsedType}),C;function n(s,l){return zr({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Kt(),xe].filter(u=>!!u),issueData:{code:T.invalid_arguments,argumentsError:l}})}function i(s,l){return zr({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Kt(),xe].filter(u=>!!u),issueData:{code:T.invalid_return_type,returnTypeError:l}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof He){let s=this;return ne(async function(...l){let u=new ie([]),f=await s._def.args.parseAsync(l,a).catch(p=>{throw u.addIssue(n(l,p)),u}),m=await Reflect.apply(o,this,f);return await s._def.returns._def.type.parseAsync(m,a).catch(p=>{throw u.addIssue(i(m,p)),u})})}else{let s=this;return ne(function(...l){let u=s._def.args.safeParse(l,a);if(!u.success)throw new ie([n(l,u.error)]);let f=Reflect.apply(o,this,u.data),m=s._def.returns.safeParse(f,a);if(!m.success)throw new ie([i(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ye.create(e).rest(qe.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||ye.create([]).rest(qe.create()),returns:r||qe.create(),typeName:q.ZodFunction,...R(n)})}},Pt=class extends j{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Pt.create=(t,e)=>new Pt({getter:t,typeName:q.ZodLazy,...R(e)});var Nt=class extends j{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return A(r,{received:r.data,code:T.invalid_literal,expected:this._def.value}),C}return{status:"valid",value:e.data}}get value(){return this._def.value}};Nt.create=(t,e)=>new Nt({value:t,typeName:q.ZodLiteral,...R(e)});function ml(t,e){return new xt({values:t,typeName:q.ZodEnum,...R(e)})}var xt=class t extends j{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return A(r,{expected:L.joinValues(n),received:r.parsedType,code:T.invalid_type}),C}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return A(r,{received:r.data,code:T.invalid_enum_value,options:n}),C}return ne(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};xt.create=ml;var Ct=class extends j{_parse(e){let r=L.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){let i=L.objectValues(r);return A(n,{expected:L.joinValues(i),received:n.parsedType,code:T.invalid_type}),C}if(this._cache||(this._cache=new Set(L.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=L.objectValues(r);return A(n,{received:n.data,code:T.invalid_enum_value,options:i}),C}return ne(e.data)}get enum(){return this._def.values}};Ct.create=(t,e)=>new Ct({values:t,typeName:q.ZodNativeEnum,...R(e)});var He=class extends j{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.promise&&r.common.async===!1)return A(r,{code:T.invalid_type,expected:w.promise,received:r.parsedType}),C;let n=r.parsedType===w.promise?r.data:Promise.resolve(r.data);return ne(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};He.create=(t,e)=>new He({type:t,typeName:q.ZodPromise,...R(e)});var fe=class extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{A(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return C;let l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?C:l.status==="dirty"?yt(l.value):r.value==="dirty"?yt(l.value):l});{if(r.value==="aborted")return C;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?C:s.status==="dirty"?yt(s.value):r.value==="dirty"?yt(s.value):s}}if(i.type==="refinement"){let o=s=>{let l=i.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?C:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?C:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ve(o))return C;let s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ve(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):C);L.assertNever(i)}};fe.create=(t,e,r)=>new fe({schema:t,typeName:q.ZodEffects,effect:e,...R(r)});fe.createWithPreprocess=(t,e,r)=>new fe({schema:e,effect:{type:"preprocess",transform:t},typeName:q.ZodEffects,...R(r)});var le=class extends j{_parse(e){return this._getType(e)===w.undefined?ne(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};le.create=(t,e)=>new le({innerType:t,typeName:q.ZodOptional,...R(e)});var ge=class extends j{_parse(e){return this._getType(e)===w.null?ne(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ge.create=(t,e)=>new ge({innerType:t,typeName:q.ZodNullable,...R(e)});var qt=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};qt.create=(t,e)=>new qt({innerType:t,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});var kt=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Xt(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ie(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ie(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};kt.create=(t,e)=>new kt({innerType:t,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});var tr=class extends j{_parse(e){if(this._getType(e)!==w.nan){let n=this._getOrReturnCtx(e);return A(n,{code:T.invalid_type,expected:w.nan,received:n.parsedType}),C}return{status:"valid",value:e.data}}};tr.create=t=>new tr({typeName:q.ZodNaN,...R(t)});var Cp=Symbol("zod_brand"),Kr=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Xr=class t extends j{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?C:a.status==="dirty"?(r.dirty(),yt(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?C:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:q.ZodPipeline})}},Rt=class extends j{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Ve(i)&&(i.value=Object.freeze(i.value)),i);return Xt(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};Rt.create=(t,e)=>new Rt({innerType:t,typeName:q.ZodReadonly,...R(e)});function dl(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function hl(t,e={},r){return t?Be.create().superRefine((n,i)=>{let a=t(n);if(a instanceof Promise)return a.then(o=>{if(!o){let s=dl(e,n),l=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:l})}});if(!a){let o=dl(e,n),s=o.fatal??r??!0;i.addIssue({code:"custom",...o,fatal:s})}}):Be.create()}var qp={object:ae.lazycreate},q;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(q||(q={}));var kp=(t,e={message:`Input not instance of ${t.name}`})=>hl(r=>r instanceof t,e),_l=We.create,bl=gt.create,Rp=tr.create,Mp=St.create,yl=Et.create,jp=Ot.create,Lp=Yt.create,Fp=Tt.create,Dp=At.create,Up=Be.create,Gp=qe.create,Vp=pe.create,Wp=Jt.create,Bp=ke.create,Hp=ae.create,$p=ae.strictCreate,zp=wt.create,Kp=Sn.create,Xp=It.create,Zp=ye.create,Yp=En.create,Jp=Qt.create,Qp=er.create,em=On.create,tm=Pt.create,rm=Nt.create,nm=xt.create,im=Ct.create,am=He.create,om=fe.create,sm=le.create,um=ge.create,cm=fe.createWithPreprocess,lm=Xr.create,dm=()=>_l().optional(),fm=()=>bl().optional(),vm=()=>yl().optional(),pm={string:(t=>We.create({...t,coerce:!0})),number:(t=>gt.create({...t,coerce:!0})),boolean:(t=>Et.create({...t,coerce:!0})),bigint:(t=>St.create({...t,coerce:!0})),date:(t=>Ot.create({...t,coerce:!0}))};var mm=C;var hm=d.object({name:d.string(),arguments:d.string()}),_m=d.object({id:d.string(),type:d.literal("function"),function:hm,encryptedValue:d.string().optional()}),Tn=d.object({id:d.string(),role:d.string(),content:d.string().optional(),name:d.string().optional(),encryptedValue:d.string().optional()}),bm=d.object({type:d.literal("text"),text:d.string()}),ym=d.object({type:d.literal("data"),value:d.string(),mimeType:d.string()}),gm=d.object({type:d.literal("url"),value:d.string(),mimeType:d.string().optional()}),An=d.discriminatedUnion("type",[ym,gm]),Sm=d.object({type:d.literal("image"),source:An,metadata:d.unknown().optional()}),Em=d.object({type:d.literal("audio"),source:An,metadata:d.unknown().optional()}),Om=d.object({type:d.literal("video"),source:An,metadata:d.unknown().optional()}),Tm=d.object({type:d.literal("document"),source:An,metadata:d.unknown().optional()});var gl=d.object({type:d.literal("binary"),mimeType:d.string(),id:d.string().optional(),url:d.string().optional(),data:d.string().optional(),filename:d.string().optional()}),Sl=(t,e)=>{!t.id&&!t.url&&!t.data&&e.addIssue({code:d.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},AM=gl.superRefine((t,e)=>{Sl(t,e)}),Am=d.discriminatedUnion("type",[bm,Sm,Em,Om,Tm,gl]),wm=Am.superRefine((t,e)=>{t.type==="binary"&&Sl(t,e)}),Im=Tn.extend({role:d.literal("developer"),content:d.string()}),Pm=Tn.extend({role:d.literal("system"),content:d.string()}),Nm=Tn.extend({role:d.literal("assistant"),content:d.string().optional(),toolCalls:d.array(_m).optional()}),xm=Tn.extend({role:d.literal("user"),content:d.union([d.string(),d.array(wm)])}),Cm=d.object({id:d.string(),content:d.string(),role:d.literal("tool"),toolCallId:d.string(),error:d.string().optional(),encryptedValue:d.string().optional()}),qm=d.object({id:d.string(),role:d.literal("activity"),activityType:d.string(),content:d.record(d.any())}),km=d.object({id:d.string(),role:d.literal("reasoning"),content:d.string(),encryptedValue:d.string().optional()}),El=d.discriminatedUnion("role",[Im,Pm,Nm,xm,Cm,qm,km]),wM=d.union([d.literal("developer"),d.literal("system"),d.literal("assistant"),d.literal("user"),d.literal("tool"),d.literal("activity"),d.literal("reasoning")]),Rm=d.object({description:d.string(),value:d.string()}),Ol=d.object({name:d.string(),description:d.string(),parameters:d.any(),metadata:d.record(d.any()).optional()}),Mm=d.object({threadId:d.string(),runId:d.string(),parentRunId:d.string().optional(),state:d.any(),messages:d.array(El),tools:d.array(Ol),context:d.array(Rm),forwardedProps:d.any()}),jm=d.any(),B=class extends Error{constructor(t){super(t)}},hs=class extends B{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},Lm=d.object({name:d.string(),description:d.string().optional()}),Fm=d.object({name:d.string().optional(),type:d.string().optional(),description:d.string().optional(),version:d.string().optional(),provider:d.string().optional(),documentationUrl:d.string().optional(),metadata:d.record(d.unknown()).optional()}),Dm=d.object({streaming:d.boolean().optional(),websocket:d.boolean().optional(),httpBinary:d.boolean().optional(),pushNotifications:d.boolean().optional(),resumable:d.boolean().optional()}),Um=d.object({supported:d.boolean().optional(),items:d.array(Ol).optional(),parallelCalls:d.boolean().optional(),clientProvided:d.boolean().optional()}),Gm=d.object({structuredOutput:d.boolean().optional(),supportedMimeTypes:d.array(d.string()).optional()}),Vm=d.object({snapshots:d.boolean().optional(),deltas:d.boolean().optional(),memory:d.boolean().optional(),persistentState:d.boolean().optional()}),Wm=d.object({supported:d.boolean().optional(),delegation:d.boolean().optional(),handoffs:d.boolean().optional(),subAgents:d.array(Lm).optional()}),Bm=d.object({supported:d.boolean().optional(),streaming:d.boolean().optional(),encrypted:d.boolean().optional()}),Hm=d.object({image:d.boolean().optional(),audio:d.boolean().optional(),video:d.boolean().optional(),pdf:d.boolean().optional(),file:d.boolean().optional()}),$m=d.object({image:d.boolean().optional(),audio:d.boolean().optional()}),zm=d.object({input:Hm.optional(),output:$m.optional()}),Km=d.object({codeExecution:d.boolean().optional(),sandboxed:d.boolean().optional(),maxIterations:d.number().optional(),maxExecutionTime:d.number().optional()}),Xm=d.object({supported:d.boolean().optional(),approvals:d.boolean().optional(),interventions:d.boolean().optional(),feedback:d.boolean().optional()}),IM=d.object({identity:Fm.optional(),transport:Dm.optional(),tools:Um.optional(),output:Gm.optional(),state:Vm.optional(),multiAgent:Wm.optional(),reasoning:Bm.optional(),multimodal:zm.optional(),execution:Km.optional(),humanInTheLoop:Xm.optional(),custom:d.record(d.unknown()).optional()}),Tl=d.union([d.literal("developer"),d.literal("system"),d.literal("assistant"),d.literal("user")]),y=(function(t){return t.TEXT_MESSAGE_START="TEXT_MESSAGE_START",t.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",t.TEXT_MESSAGE_END="TEXT_MESSAGE_END",t.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",t.TOOL_CALL_START="TOOL_CALL_START",t.TOOL_CALL_ARGS="TOOL_CALL_ARGS",t.TOOL_CALL_END="TOOL_CALL_END",t.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",t.TOOL_CALL_RESULT="TOOL_CALL_RESULT",t.THINKING_START="THINKING_START",t.THINKING_END="THINKING_END",t.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",t.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",t.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",t.STATE_SNAPSHOT="STATE_SNAPSHOT",t.STATE_DELTA="STATE_DELTA",t.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",t.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",t.ACTIVITY_DELTA="ACTIVITY_DELTA",t.RAW="RAW",t.CUSTOM="CUSTOM",t.RUN_STARTED="RUN_STARTED",t.RUN_FINISHED="RUN_FINISHED",t.RUN_ERROR="RUN_ERROR",t.STEP_STARTED="STEP_STARTED",t.STEP_FINISHED="STEP_FINISHED",t.REASONING_START="REASONING_START",t.REASONING_MESSAGE_START="REASONING_MESSAGE_START",t.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",t.REASONING_MESSAGE_END="REASONING_MESSAGE_END",t.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",t.REASONING_END="REASONING_END",t.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",t})({}),F=d.object({type:d.nativeEnum(y),timestamp:d.number().optional(),rawEvent:d.any().optional()}).passthrough(),Zm=F.extend({type:d.literal(y.TEXT_MESSAGE_START),messageId:d.string(),role:Tl.default("assistant"),name:d.string().optional()}),Al=F.extend({type:d.literal(y.TEXT_MESSAGE_CONTENT),messageId:d.string(),delta:d.string()}),Ym=F.extend({type:d.literal(y.TEXT_MESSAGE_END),messageId:d.string()}),Jm=F.extend({type:d.literal(y.TEXT_MESSAGE_CHUNK),messageId:d.string().optional(),role:Tl.optional(),delta:d.string().optional(),name:d.string().optional()}),Qm=F.extend({type:d.literal(y.THINKING_TEXT_MESSAGE_START)}),eh=Al.omit({messageId:!0,type:!0}).extend({type:d.literal(y.THINKING_TEXT_MESSAGE_CONTENT)}),th=F.extend({type:d.literal(y.THINKING_TEXT_MESSAGE_END)}),rh=F.extend({type:d.literal(y.TOOL_CALL_START),toolCallId:d.string(),toolCallName:d.string(),parentMessageId:d.string().optional()}),nh=F.extend({type:d.literal(y.TOOL_CALL_ARGS),toolCallId:d.string(),delta:d.string()}),ih=F.extend({type:d.literal(y.TOOL_CALL_END),toolCallId:d.string()}),ah=F.extend({messageId:d.string(),type:d.literal(y.TOOL_CALL_RESULT),toolCallId:d.string(),content:d.string(),role:d.literal("tool").optional()}),oh=F.extend({type:d.literal(y.TOOL_CALL_CHUNK),toolCallId:d.string().optional(),toolCallName:d.string().optional(),parentMessageId:d.string().optional(),delta:d.string().optional()}),sh=F.extend({type:d.literal(y.THINKING_START),title:d.string().optional()}),uh=F.extend({type:d.literal(y.THINKING_END)}),ch=F.extend({type:d.literal(y.STATE_SNAPSHOT),snapshot:jm}),lh=F.extend({type:d.literal(y.STATE_DELTA),delta:d.array(d.any())}),dh=F.extend({type:d.literal(y.MESSAGES_SNAPSHOT),messages:d.array(El)}),fh=F.extend({type:d.literal(y.ACTIVITY_SNAPSHOT),messageId:d.string(),activityType:d.string(),content:d.record(d.any()),replace:d.boolean().optional().default(!0)}),vh=F.extend({type:d.literal(y.ACTIVITY_DELTA),messageId:d.string(),activityType:d.string(),patch:d.array(d.any())}),ph=F.extend({type:d.literal(y.RAW),event:d.any(),source:d.string().optional()}),mh=F.extend({type:d.literal(y.CUSTOM),name:d.string(),value:d.any()}),hh=F.extend({type:d.literal(y.RUN_STARTED),threadId:d.string(),runId:d.string(),parentRunId:d.string().optional(),input:Mm.optional()}),_h=F.extend({type:d.literal(y.RUN_FINISHED),threadId:d.string(),runId:d.string(),result:d.any().optional()}),bh=F.extend({type:d.literal(y.RUN_ERROR),message:d.string(),code:d.string().optional()}),yh=F.extend({type:d.literal(y.STEP_STARTED),stepName:d.string()}),gh=F.extend({type:d.literal(y.STEP_FINISHED),stepName:d.string()}),Sh=d.union([d.literal("tool-call"),d.literal("message")]),Eh=F.extend({type:d.literal(y.REASONING_START),messageId:d.string()}),Oh=F.extend({type:d.literal(y.REASONING_MESSAGE_START),messageId:d.string(),role:d.literal("reasoning")}),Th=F.extend({type:d.literal(y.REASONING_MESSAGE_CONTENT),messageId:d.string(),delta:d.string()}),Ah=F.extend({type:d.literal(y.REASONING_MESSAGE_END),messageId:d.string()}),wh=F.extend({type:d.literal(y.REASONING_MESSAGE_CHUNK),messageId:d.string().optional(),delta:d.string().optional()}),Ih=F.extend({type:d.literal(y.REASONING_END),messageId:d.string()}),Ph=F.extend({type:d.literal(y.REASONING_ENCRYPTED_VALUE),subtype:Sh,entityId:d.string(),encryptedValue:d.string()}),wl=d.discriminatedUnion("type",[Zm,Al,Ym,Jm,sh,uh,Qm,eh,th,rh,nh,ih,oh,ah,ch,lh,dh,fh,vh,ph,mh,hh,_h,bh,yh,gh,Eh,Oh,Th,Ah,wh,Ih,Ph]);var _s={};hn(_s,{JsonPatchError:()=>X,_areEquals:()=>Jr,applyOperation:()=>Mt,applyPatch:()=>$e,applyReducer:()=>kh,deepClone:()=>Ch,getValueByPointer:()=>xn,validate:()=>Pl,validator:()=>Cn});var Nh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),xh=Object.prototype.hasOwnProperty;function In(t,e){return xh.call(t,e)}function Pn(t){if(Array.isArray(t)){for(var e=new Array(t.length),r=0;r<e.length;r++)e[r]=""+r;return e}if(Object.keys)return Object.keys(t);var n=[];for(var i in t)In(t,i)&&n.push(i);return n}function Q(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function Nn(t){for(var e=0,r=t.length,n;e<r;){if(n=t.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}function Se(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Zr(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function wn(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)if(wn(t[e]))return!0}else if(typeof t=="object"){for(var n=Pn(t),i=n.length,a=0;a<i;a++)if(wn(t[n[a]]))return!0}}return!1}function Il(t,e){var r=[t];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i<"u"&&r.push(n+": "+i)}return r.join(`
4
+ `)}var Yr=(function(t){Nh(e,t);function e(r,n,i,a,o){var s=this.constructor,l=t.call(this,Il(r,{name:n,index:i,operation:a,tree:o}))||this;return l.name=n,l.index=i,l.operation=a,l.tree=o,Object.setPrototypeOf(l,s.prototype),l.message=Il(r,{name:n,index:i,operation:a,tree:o}),l}return e})(Error);var X=Yr,Ch=Q,rr={add:function(t,e,r){return t[e]=this.value,{newDocument:r}},remove:function(t,e,r){var n=t[e];return delete t[e],{newDocument:r,removed:n}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:function(t,e,r){var n=xn(r,this.path);n&&(n=Q(n));var i=Mt(r,{op:"remove",path:this.from}).removed;return Mt(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(t,e,r){var n=xn(r,this.from);return Mt(r,{op:"add",path:this.path,value:Q(n)}),{newDocument:r}},test:function(t,e,r){return{newDocument:r,test:Jr(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},qh={add:function(t,e,r){return Nn(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:r,index:e}},remove:function(t,e,r){var n=t.splice(e,1);return{newDocument:r,removed:n[0]}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:rr.move,copy:rr.copy,test:rr.test,_get:rr._get};function xn(t,e){if(e=="")return t;var r={op:"_get",path:e};return Mt(t,r),r.value}function Mt(t,e,r,n,i,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(e,0,t,e.path):Cn(e,0)),e.path===""){var o={newDocument:t};if(e.op==="add")return o.newDocument=e.value,o;if(e.op==="replace")return o.newDocument=e.value,o.removed=t,o;if(e.op==="move"||e.op==="copy")return o.newDocument=xn(t,e.from),e.op==="move"&&(o.removed=t),o;if(e.op==="test"){if(o.test=Jr(t,e.value),o.test===!1)throw new X("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return o.newDocument=t,o}else{if(e.op==="remove")return o.removed=t,o.newDocument=null,o;if(e.op==="_get")return e.value=t,o;if(r)throw new X("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,e,t);return o}}else{n||(t=Q(t));var s=e.path||"",l=s.split("/"),u=t,f=1,m=l.length,S=void 0,p=void 0,v=void 0;for(typeof r=="function"?v=r:v=Cn;;){if(p=l[f],p&&p.indexOf("~")!=-1&&(p=Zr(p)),i&&(p=="__proto__"||p=="prototype"&&f>0&&l[f-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&S===void 0&&(u[p]===void 0?S=l.slice(0,f).join("/"):f==m-1&&(S=e.path),S!==void 0&&v(e,0,t,S)),f++,Array.isArray(u)){if(p==="-")p=u.length;else{if(r&&!Nn(p))throw new X("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,e,t);Nn(p)&&(p=~~p)}if(f>=m){if(r&&e.op==="add"&&p>u.length)throw new X("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,e,t);var o=qh[e.op].call(e,u,p,t);if(o.test===!1)throw new X("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return o}}else if(f>=m){var o=rr[e.op].call(e,u,p,t);if(o.test===!1)throw new X("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return o}if(u=u[p],r&&f<m&&(!u||typeof u!="object"))throw new X("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,e,t)}}}function $e(t,e,r,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),r&&!Array.isArray(e))throw new X("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(t=Q(t));for(var a=new Array(e.length),o=0,s=e.length;o<s;o++)a[o]=Mt(t,e[o],r,!0,i,o),t=a[o].newDocument;return a.newDocument=t,a}function kh(t,e,r){var n=Mt(t,e);if(n.test===!1)throw new X("Test operation failed","TEST_OPERATION_FAILED",r,e,t);return n.newDocument}function Cn(t,e,r,n){if(typeof t!="object"||t===null||Array.isArray(t))throw new X("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,r);if(rr[t.op]){if(typeof t.path!="string")throw new X("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,r);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new X('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,r);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new X("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new X("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&wn(t.value))throw new X("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,r);if(r){if(t.op=="add"){var i=t.path.split("/").length,a=n.split("/").length;if(i!==a+1&&i!==a)throw new X("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,r)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==n)throw new X("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,r)}else if(t.op==="move"||t.op==="copy"){var o={op:"_get",path:t.from,value:void 0},s=Pl([o],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new X("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,r)}}}else throw new X("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,r)}function Pl(t,e,r){try{if(!Array.isArray(t))throw new X("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)$e(Q(e),Q(t),r||!0);else{r=r||Cn;for(var n=0;n<t.length;n++)r(t[n],n,e,void 0)}}catch(i){if(i instanceof X)return i;throw i}}function Jr(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var r=Array.isArray(t),n=Array.isArray(e),i,a,o;if(r&&n){if(a=t.length,a!=e.length)return!1;for(i=a;i--!==0;)if(!Jr(t[i],e[i]))return!1;return!0}if(r!=n)return!1;var s=Object.keys(t);if(a=s.length,a!==Object.keys(e).length)return!1;for(i=a;i--!==0;)if(!e.hasOwnProperty(s[i]))return!1;for(i=a;i--!==0;)if(o=s[i],!Jr(t[o],e[o]))return!1;return!0}return t!==t&&e!==e}var Ss={};hn(Ss,{compare:()=>Gh,generate:()=>bs,observe:()=>Uh,unobserve:()=>Dh});var ys=new WeakMap,Rh=(function(){function t(e){this.observers=new Map,this.obj=e}return t})(),Mh=(function(){function t(e,r){this.callback=e,this.observer=r}return t})();function jh(t){return ys.get(t)}function Lh(t,e){return t.observers.get(e)}function Fh(t,e){t.observers.delete(e.callback)}function Dh(t,e){e.unobserve()}function Uh(t,e){var r=[],n,i=jh(t);if(!i)i=new Rh(t),ys.set(t,i);else{var a=Lh(i,e);n=a&&a.observer}if(n)return n;if(n={},i.value=Q(t),e){n.callback=e,n.next=null;var o=function(){bs(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=t,n.unobserve=function(){bs(n),clearTimeout(n.next),Fh(i,n),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},i.observers.set(e,new Mh(e,n)),n}function bs(t,e){e===void 0&&(e=!1);var r=ys.get(t.object);gs(r.value,t.object,t.patches,"",e),t.patches.length&&$e(r.value,t.patches);var n=t.patches;return n.length>0&&(t.patches=[],t.callback&&t.callback(n)),n}function gs(t,e,r,n,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var a=Pn(e),o=Pn(t),s=!1,l=!1,u=o.length-1;u>=0;u--){var f=o[u],m=t[f];if(In(e,f)&&!(e[f]===void 0&&m!==void 0&&Array.isArray(e)===!1)){var S=e[f];typeof m=="object"&&m!=null&&typeof S=="object"&&S!=null&&Array.isArray(m)===Array.isArray(S)?gs(m,S,r,n+"/"+Se(f),i):m!==S&&(s=!0,i&&r.push({op:"test",path:n+"/"+Se(f),value:Q(m)}),r.push({op:"replace",path:n+"/"+Se(f),value:Q(S)}))}else Array.isArray(t)===Array.isArray(e)?(i&&r.push({op:"test",path:n+"/"+Se(f),value:Q(m)}),r.push({op:"remove",path:n+"/"+Se(f)}),l=!0):(i&&r.push({op:"test",path:n,value:t}),r.push({op:"replace",path:n,value:e}),s=!0)}if(!(!l&&a.length==o.length))for(var u=0;u<a.length;u++){var f=a[u];!In(t,f)&&e[f]!==void 0&&r.push({op:"add",path:n+"/"+Se(f),value:Q(e[f])})}}}function Gh(t,e,r){r===void 0&&(r=!1);var n=[];return gs(t,e,n,"",r),n}var jM=Object.assign({},_s,Ss,{JsonPatchError:Yr,deepClone:Q,escapePathComponent:Se,unescapePathComponent:Zr});var P=ls($c(),1),H=ls(qv(),1);function kv(t){return` \r
5
+ `.indexOf(t)>=0}function rs(t){for(var e=["topLevel"],r=0,n,i,a,o=function(E){return e.push(E)},s=function(E){return e[e.length-1]=E},l=function(E){n==null&&(n=r,i=e.length,a=E)},u=function(E){E===a&&(n=void 0,i=void 0,a=void 0)},f=function(){return e.pop()},m=function(){return r--},S=function(E){if("0"<=E&&E<="9"){o("number");return}switch(E){case'"':o("string");return;case"-":o("numberNeedsDigit");return;case"t":o("true");return;case"f":o("false");return;case"n":o("null");return;case"[":o("arrayNeedsValue");return;case"{":o("objectNeedsKey");return}},p=t.length;r<p;r++){var v=t[r];switch(e[e.length-1]){case"topLevel":S(v);break;case"string":switch(v){case'"':f();break;case"\\":l("stringEscape"),o("stringEscaped");break}break;case"stringEscaped":v==="u"?o("stringUnicode"):(u("stringEscape"),f());break;case"stringUnicode":r-t.lastIndexOf("u",r)===4&&(u("stringEscape"),f());break;case"number":v==="."?s("numberNeedsDigit"):v==="e"||v==="E"?s("numberNeedsExponent"):(v<"0"||v>"9")&&(m(),f());break;case"numberNeedsDigit":s("number");break;case"numberNeedsExponent":s(v==="+"||v==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(v<"a"||v>"z")&&(m(),f());break;case"arrayNeedsValue":v==="]"?f():kv(v)||(u("collectionItem"),s("arrayNeedsComma"),S(v));break;case"arrayNeedsComma":v==="]"?f():v===","&&(l("collectionItem"),s("arrayNeedsValue"));break;case"objectNeedsKey":v==="}"?f():v==='"'&&(l("collectionItem"),s("objectNeedsColon"),o("string"));break;case"objectNeedsColon":v===":"&&s("objectNeedsValue");break;case"objectNeedsValue":kv(v)||(u("collectionItem"),s("objectNeedsComma"),S(v));break;case"objectNeedsComma":v==="}"?f():v===","&&(l("collectionItem"),s("objectNeedsKey"));break}}i!=null&&(e.length=i);for(var _=[n!=null?t.slice(0,n):t],g=function(E){return _.push(E.slice(t.length-t.lastIndexOf(E[0])))},O=e.length-1;O>=0;O--)switch(e[O]){case"string":_.push('"');break;case"numberNeedsDigit":case"numberNeedsExponent":_.push("0");break;case"true":g("true");break;case"false":g("false");break;case"null":g("null");break;case"arrayNeedsValue":case"arrayNeedsComma":_.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":_.push("}");break}return _.join("")}var vR=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,zc=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");let e=t.match(vR);if(!e)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return e.shift(),e},Rv=t=>t==="*"||t==="x"||t==="X",Mv=t=>{let e=parseInt(t,10);return isNaN(e)?t:e},pR=(t,e)=>typeof t!=typeof e?[String(t),String(e)]:[t,e],mR=(t,e)=>{if(Rv(t)||Rv(e))return 0;let[r,n]=pR(Mv(t),Mv(e));return r>n?1:r<n?-1:0},Kc=(t,e)=>{for(let r=0;r<Math.max(t.length,e.length);r++){let n=mR(t[r]||"0",e[r]||"0");if(n!==0)return n}return 0};var ns=(t,e)=>{let r=zc(t),n=zc(e),i=r.pop(),a=n.pop(),o=Kc(r,n);return o!==0?o:i&&a?Kc(i.split("."),a.split(".")):i||a?i?-1:1:0};var D=t=>{if(typeof structuredClone=="function")return structuredClone(t);try{return JSON.parse(JSON.stringify(t))}catch{return Array.isArray(t)?[...t]:{...t}}};function vn(){return Ge()}function Yc(t){if(Object.freeze(t),typeof t=="object"&&t)for(let e of Object.values(t))typeof e=="object"&&e&&!Object.isFrozen(e)&&Yc(e);return t}async function G(t,e,r,n){let i=typeof process<"u"&&process.env!==void 0,a=i&&(process.env.NODE_ENV==="test"||!!process.env.VITEST_WORKER_ID),o=i&&(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||!!process.env.VITEST_WORKER_ID),s=D(e),l=D(r),u=s,f=l,m;for(let S of t)try{o&&(Yc(u),Yc(f));let p=await n(S,u,f);if(p===void 0)continue;if(p.messages!==void 0&&p.messages!==u&&(u=D(p.messages)),p.state!==void 0&&p.state!==f&&(f=D(p.state)),m=p.stopPropagation,m===!0)break}catch(p){if(o&&p instanceof TypeError){if(a)throw p;console.error("AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.",p)}else a||console.error("Subscriber error:",p);continue}return{...u===s?{}:{messages:o&&Object.isFrozen(u)?D(u):u},...f===l?{}:{state:o&&Object.isFrozen(f)?D(f):f},...m===void 0?{}:{stopPropagation:m}}}function is(t){if(!t)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(t===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let e=t.events??!0,r=t.lifecycle??!0,n=t.verbose??!1;return{enabled:e||r,events:e,lifecycle:r,verbose:n}}function Qc(t){if(t instanceof Jc)return t;if(t===!0)return new Jc(is(!0))}var Jc=class{constructor(t){this.config=t}event(t,e,r,n){this.config.events&&(this.config.verbose?console.debug(`[${t}] ${e}`,typeof r=="string"?r:JSON.stringify(r)):console.debug(`[${t}] ${e}`,n??r))}lifecycle(t,e,r){this.config.lifecycle&&(r?console.debug(`[${t}] ${e}`,r):console.debug(`[${t}] ${e}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function Xc(t){return t.enabled?new Jc(t):void 0}function hR(t,e,r){if(e){let i=t.find(o=>o.id===e);if(i?.role==="assistant")return i;i&&console.warn(`TOOL_CALL_START: parentMessageId '${e}' matches a '${i.role}' message, not assistant \u2014 falling back to toolCallId`);let a={id:i?r:e,role:"assistant",toolCalls:[]};return t.push(a),a}let n={id:r,role:"assistant",toolCalls:[]};return t.push(n),n}var Gv=(t,e,r,n,i)=>{let a=Qc(i),o=D(r.messages),s=D(t.state),l={},u=m=>{m.messages!==void 0&&(o=m.messages,l.messages=m.messages),m.state!==void 0&&(s=m.state,l.state=m.state)},f=()=>{let m=D(l);return l={},m.messages!==void 0||m.state!==void 0?(0,P.of)(m):P.EMPTY};return e.pipe((0,H.concatMap)(async m=>{let S=await G(n,o,s,(p,v,_)=>p.onEvent?.({event:m,agent:r,input:t,messages:v,state:_}));if(u(S),S.stopPropagation===!0?a?.event("APPLY","Event dropped:",m,{type:m.type,reason:"stopPropagation by subscriber"}):a?.event("APPLY","Event applied:",m,{type:m.type,subscribers:n.length}),S.stopPropagation===!0)return f();switch(m.type){case y.TEXT_MESSAGE_START:{let p=await G(n,o,s,(v,_,g)=>v.onTextMessageStartEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let{messageId:v,role:_="assistant",name:g}=m;if(!o.find(O=>O.id===v)){let O={id:v,role:_,content:"",...g!==void 0&&{name:g}};o.push(O),u({messages:o})}}return f()}case y.TEXT_MESSAGE_CONTENT:{let{messageId:p,delta:v}=m,_=o.find(O=>O.id===p);if(!_)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${p}'`),f();let g=await G(n,o,s,(O,E,k)=>O.onTextMessageContentEvent?.({event:m,messages:E,state:k,agent:r,input:t,textMessageBuffer:typeof _.content=="string"?_.content:""}));return u(g),g.stopPropagation!==!0&&(_.content=`${typeof _.content=="string"?_.content:""}${v}`,u({messages:o})),f()}case y.TEXT_MESSAGE_END:{let{messageId:p}=m,v=o.find(_=>_.id===p);return v?(u(await G(n,o,s,(_,g,O)=>_.onTextMessageEndEvent?.({event:m,messages:g,state:O,agent:r,input:t,textMessageBuffer:typeof v.content=="string"?v.content:""}))),await Promise.all(n.map(_=>{_.onNewMessage?.({message:v,messages:o,state:s,agent:r,input:t})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${p}'`),f())}case y.TOOL_CALL_START:{let p=await G(n,o,s,(v,_,g)=>v.onToolCallStartEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let{toolCallId:v,toolCallName:_,parentMessageId:g}=m,O=hR(o,g,v);O.toolCalls??(O.toolCalls=[]),O.toolCalls.push({id:v,type:"function",function:{name:_,arguments:""}}),u({messages:o})}return f()}case y.TOOL_CALL_ARGS:{let{toolCallId:p,delta:v}=m,_=o.find(E=>E.toolCalls?.some(k=>k.id===p));if(!_)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${p}'`),f();let g=_.toolCalls?.find(E=>E.id===p);if(!g)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${p}'`),f();let O=await G(n,o,s,(E,k,K)=>{let Z=g.function.arguments,Ne=g.function.name,pn={};try{pn=rs(Z)}catch{}return E.onToolCallArgsEvent?.({event:m,messages:k,state:K,agent:r,input:t,toolCallBuffer:Z,toolCallName:Ne,partialToolCallArgs:pn})});return u(O),O.stopPropagation!==!0&&(g.function.arguments+=v,u({messages:o})),f()}case y.TOOL_CALL_END:{let{toolCallId:p}=m,v=o.find(g=>g.toolCalls?.some(O=>O.id===p));if(!v)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${p}'`),f();let _=v.toolCalls?.find(g=>g.id===p);return _?(u(await G(n,o,s,(g,O,E)=>{let k=_.function.arguments,K=_.function.name,Z={};try{Z=JSON.parse(k)}catch{}return g.onToolCallEndEvent?.({event:m,messages:O,state:E,agent:r,input:t,toolCallName:K,toolCallArgs:Z})})),await Promise.all(n.map(g=>{g.onNewToolCall?.({toolCall:_,messages:o,state:s,agent:r,input:t})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${p}'`),f())}case y.TOOL_CALL_RESULT:{let p=await G(n,o,s,(v,_,g)=>v.onToolCallResultEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let{messageId:v,toolCallId:_,content:g,role:O}=m,E={id:v,toolCallId:_,role:O||"tool",content:g};o.push(E),await Promise.all(n.map(k=>{k.onNewMessage?.({message:E,messages:o,state:s,agent:r,input:t})})),u({messages:o})}return f()}case y.STATE_SNAPSHOT:{let p=await G(n,o,s,(v,_,g)=>v.onStateSnapshotEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let{snapshot:v}=m;s=v,u({state:s})}return f()}case y.STATE_DELTA:{let p=await G(n,o,s,(v,_,g)=>v.onStateDeltaEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let{delta:v}=m;try{s=$e(s,v,!0,!1).newDocument,u({state:s})}catch(_){let g=_ instanceof Error?_.message:String(_);console.warn(`Failed to apply state patch:
6
+ Current state: ${JSON.stringify(s,null,2)}
7
+ Patch operations: ${JSON.stringify(v,null,2)}
8
+ Error: ${g}`)}}return f()}case y.MESSAGES_SNAPSHOT:{let p=await G(n,o,s,(v,_,g)=>v.onMessagesSnapshotEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let{messages:v}=m,_=new Map(v.map(E=>[E.id,E])),g=E=>E==="activity"||E==="reasoning";o=o.filter(E=>g(E.role)||_.has(E.id)).map(E=>g(E.role)?E:_.get(E.id));let O=new Set(o.map(E=>E.id));for(let E of v)O.has(E.id)||o.push(E);u({messages:o})}return f()}case y.ACTIVITY_SNAPSHOT:{let p=m,v=o.findIndex(k=>k.id===p.messageId),_=v>=0?o[v]:void 0,g=_?.role==="activity"?_:void 0,O=p.replace??!0,E=await G(n,o,s,(k,K,Z)=>k.onActivitySnapshotEvent?.({event:p,messages:K,state:Z,agent:r,input:t,activityMessage:g,existingMessage:_}));if(u(E),E.stopPropagation!==!0){let k={id:p.messageId,role:"activity",activityType:p.activityType,content:D(p.content)},K;v===-1?(o.push(k),K=k):g?O&&(o[v]={...g,activityType:p.activityType,content:D(p.content)}):O&&(o[v]=k,K=k),u({messages:o}),K&&await Promise.all(n.map(Z=>Z.onNewMessage?.({message:K,messages:o,state:s,agent:r,input:t})))}return f()}case y.ACTIVITY_DELTA:{let p=m,v=o.findIndex(E=>E.id===p.messageId);if(v===-1)return f();let _=o[v];if(_.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${p.messageId}' is not an activity message`),f();let g=_,O=await G(n,o,s,(E,k,K)=>E.onActivityDeltaEvent?.({event:p,messages:k,state:K,agent:r,input:t,activityMessage:g}));if(u(O),O.stopPropagation!==!0)try{let E=D(g.content??{}),k=$e(E,p.patch??[],!0,!1).newDocument;o[v]={...g,content:D(k),activityType:p.activityType},u({messages:o})}catch(E){let k=E instanceof Error?E.message:String(E);console.warn(`Failed to apply activity patch for '${p.messageId}': ${k}`)}return f()}case y.RAW:return u(await G(n,o,s,(p,v,_)=>p.onRawEvent?.({event:m,messages:v,state:_,agent:r,input:t}))),f();case y.CUSTOM:return u(await G(n,o,s,(p,v,_)=>p.onCustomEvent?.({event:m,messages:v,state:_,agent:r,input:t}))),f();case y.RUN_STARTED:{let p=await G(n,o,s,(v,_,g)=>v.onRunStartedEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let v=m;if(v.input?.messages){for(let _ of v.input.messages)o.find(g=>g.id===_.id)||o.push(_);u({messages:o})}}return f()}case y.RUN_FINISHED:return u(await G(n,o,s,(p,v,_)=>p.onRunFinishedEvent?.({event:m,messages:v,state:_,agent:r,input:t,result:m.result}))),f();case y.RUN_ERROR:return u(await G(n,o,s,(p,v,_)=>p.onRunErrorEvent?.({event:m,messages:v,state:_,agent:r,input:t}))),f();case y.STEP_STARTED:return u(await G(n,o,s,(p,v,_)=>p.onStepStartedEvent?.({event:m,messages:v,state:_,agent:r,input:t}))),f();case y.STEP_FINISHED:return u(await G(n,o,s,(p,v,_)=>p.onStepFinishedEvent?.({event:m,messages:v,state:_,agent:r,input:t}))),f();case y.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case y.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case y.THINKING_START:return f();case y.THINKING_END:return f();case y.THINKING_TEXT_MESSAGE_START:return f();case y.THINKING_TEXT_MESSAGE_CONTENT:return f();case y.THINKING_TEXT_MESSAGE_END:return f();case y.REASONING_START:return u(await G(n,o,s,(p,v,_)=>p.onReasoningStartEvent?.({event:m,messages:v,state:_,agent:r,input:t}))),f();case y.REASONING_MESSAGE_START:{let p=await G(n,o,s,(v,_,g)=>v.onReasoningMessageStartEvent?.({event:m,messages:_,state:g,agent:r,input:t}));if(u(p),p.stopPropagation!==!0){let{messageId:v}=m;if(!o.find(_=>_.id===v)){let _={id:v,role:"reasoning",content:""};o.push(_),u({messages:o})}}return f()}case y.REASONING_MESSAGE_CONTENT:{let{messageId:p,delta:v}=m,_=o.find(O=>O.id===p);if(!_)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${p}'`),f();let g=await G(n,o,s,(O,E,k)=>O.onReasoningMessageContentEvent?.({event:m,messages:E,state:k,agent:r,input:t,reasoningMessageBuffer:typeof _.content=="string"?_.content:""}));return u(g),g.stopPropagation!==!0&&(_.content=`${typeof _.content=="string"?_.content:""}${v}`,u({messages:o})),f()}case y.REASONING_MESSAGE_END:{let{messageId:p}=m,v=o.find(_=>_.id===p);return v?(u(await G(n,o,s,(_,g,O)=>_.onReasoningMessageEndEvent?.({event:m,messages:g,state:O,agent:r,input:t,reasoningMessageBuffer:typeof v.content=="string"?v.content:""}))),await Promise.all(n.map(_=>{_.onNewMessage?.({message:v,messages:o,state:s,agent:r,input:t})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${p}'`),f())}case y.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case y.REASONING_END:return u(await G(n,o,s,(p,v,_)=>p.onReasoningEndEvent?.({event:m,messages:v,state:_,agent:r,input:t}))),f();case y.REASONING_ENCRYPTED_VALUE:{let{subtype:p,entityId:v,encryptedValue:_}=m,g=await G(n,o,s,(O,E,k)=>O.onReasoningEncryptedValueEvent?.({event:m,messages:E,state:k,agent:r,input:t}));if(u(g),g.stopPropagation!==!0){let O=!1;if(p==="tool-call"){for(let E of o)if(E.role==="assistant"&&E.toolCalls){let k=E.toolCalls.find(K=>K.id===v);if(k){k.encryptedValue=_,O=!0;break}}}else{let E=o.find(k=>k.id===v);E?.role!=="activity"&&E&&(E.encryptedValue=_,O=!0)}O&&(l.messages=o)}return f()}}return m.type,f()}),(0,H.mergeAll)(),n.length>0?(0,H.defaultIfEmpty)({}):m=>m)},Zc=t=>e=>{let r=Qc(t),n=new Map,i=new Map,a=!1,o=!1,s=!1,l=new Map,u=!1,f=!1,m=!1,S=()=>{n.clear(),i.clear(),l.clear(),u=!1,f=!1,a=!1,o=!1,m=!0};return e.pipe((0,H.mergeMap)(p=>{let v=p.type;if(r?.event("VERIFY","Event:",p,{type:p.type}),o)return(0,P.throwError)(()=>new B(`Cannot send event type '${v}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&v!==y.RUN_ERROR&&v!==y.RUN_STARTED)return(0,P.throwError)(()=>new B(`Cannot send event type '${v}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(s){if(v===y.RUN_STARTED){if(m&&!a)return(0,P.throwError)(()=>new B("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));a&&S()}}else if(s=!0,v!==y.RUN_STARTED&&v!==y.RUN_ERROR)return(0,P.throwError)(()=>new B("First event must be 'RUN_STARTED'"));switch(v){case y.TEXT_MESSAGE_START:{let _=p.messageId;return n.has(_)?(0,P.throwError)(()=>new B(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${_}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(n.set(_,!0),(0,P.of)(p))}case y.TEXT_MESSAGE_CONTENT:{let _=p.messageId;return n.has(_)?(0,P.of)(p):(0,P.throwError)(()=>new B(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${_}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case y.TEXT_MESSAGE_END:{let _=p.messageId;return n.has(_)?(n.delete(_),(0,P.of)(p)):(0,P.throwError)(()=>new B(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${_}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case y.TOOL_CALL_START:{let _=p.toolCallId;return i.has(_)?(0,P.throwError)(()=>new B(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${_}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(i.set(_,!0),(0,P.of)(p))}case y.TOOL_CALL_ARGS:{let _=p.toolCallId;return i.has(_)?(0,P.of)(p):(0,P.throwError)(()=>new B(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${_}'. Start a tool call with 'TOOL_CALL_START' first.`))}case y.TOOL_CALL_END:{let _=p.toolCallId;return i.has(_)?(i.delete(_),(0,P.of)(p)):(0,P.throwError)(()=>new B(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${_}'. A 'TOOL_CALL_START' event must be sent first.`))}case y.STEP_STARTED:{let _=p.stepName;return l.has(_)?(0,P.throwError)(()=>new B(`Step "${_}" is already active for 'STEP_STARTED'`)):(l.set(_,!0),(0,P.of)(p))}case y.STEP_FINISHED:{let _=p.stepName;return l.has(_)?(l.delete(_),(0,P.of)(p)):(0,P.throwError)(()=>new B(`Cannot send 'STEP_FINISHED' for step "${_}" that was not started`))}case y.RUN_STARTED:return m=!0,(0,P.of)(p);case y.RUN_FINISHED:if(l.size>0){let _=Array.from(l.keys()).join(", ");return(0,P.throwError)(()=>new B(`Cannot send 'RUN_FINISHED' while steps are still active: ${_}`))}if(n.size>0){let _=Array.from(n.keys()).join(", ");return(0,P.throwError)(()=>new B(`Cannot send 'RUN_FINISHED' while text messages are still active: ${_}`))}if(i.size>0){let _=Array.from(i.keys()).join(", ");return(0,P.throwError)(()=>new B(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${_}`))}return a=!0,(0,P.of)(p);case y.RUN_ERROR:return o=!0,(0,P.of)(p);case y.CUSTOM:return(0,P.of)(p);case y.THINKING_TEXT_MESSAGE_START:return u?f?(0,P.throwError)(()=>new B("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(f=!0,(0,P.of)(p)):(0,P.throwError)(()=>new B("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case y.THINKING_TEXT_MESSAGE_CONTENT:return f?(0,P.of)(p):(0,P.throwError)(()=>new B("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case y.THINKING_TEXT_MESSAGE_END:return f?(f=!1,(0,P.of)(p)):(0,P.throwError)(()=>new B("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case y.THINKING_START:return u?(0,P.throwError)(()=>new B("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(u=!0,(0,P.of)(p));case y.THINKING_END:return u?(u=!1,(0,P.of)(p)):(0,P.throwError)(()=>new B("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return(0,P.of)(p)}}))},lD=(function(t){return t.HEADERS="headers",t.DATA="data",t})({});var $=d.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),_R=d.enum(["LangGraphInterruptEvent","PredictState","Exit"]),bR=d.object({type:d.literal($.enum.TextMessageStart),messageId:d.string(),parentMessageId:d.string().optional(),role:d.string().optional()}),yR=d.object({type:d.literal($.enum.TextMessageContent),messageId:d.string(),content:d.string()}),gR=d.object({type:d.literal($.enum.TextMessageEnd),messageId:d.string()}),SR=d.object({type:d.literal($.enum.ActionExecutionStart),actionExecutionId:d.string(),actionName:d.string(),parentMessageId:d.string().optional()}),ER=d.object({type:d.literal($.enum.ActionExecutionArgs),actionExecutionId:d.string(),args:d.string()}),OR=d.object({type:d.literal($.enum.ActionExecutionEnd),actionExecutionId:d.string()}),TR=d.object({type:d.literal($.enum.ActionExecutionResult),actionName:d.string(),actionExecutionId:d.string(),result:d.string()}),AR=d.object({type:d.literal($.enum.AgentStateMessage),threadId:d.string(),agentName:d.string(),nodeName:d.string(),runId:d.string(),active:d.boolean(),role:d.string(),state:d.string(),running:d.boolean()}),wR=d.object({type:d.literal($.enum.MetaEvent),name:_R,value:d.any()}),IR=d.object({type:d.literal($.enum.RunError),message:d.string(),code:d.string().optional()});d.discriminatedUnion("type",[bR,yR,gR,SR,ER,OR,TR,AR,wR,IR]),d.object({id:d.string(),role:d.string(),content:d.string(),parentMessageId:d.string().optional()}),d.object({id:d.string(),name:d.string(),arguments:d.any(),parentMessageId:d.string().optional()}),d.object({id:d.string(),result:d.any(),actionExecutionId:d.string(),actionName:d.string()});var PR=t=>{if(typeof t=="string")return t;if(!Array.isArray(t))return;let e=t.filter(r=>r.type==="text").map(r=>r.text).filter(r=>r.length>0);if(e.length!==0)return e.join(`
9
+ `)},NR=(t,e,r)=>n=>{let i={},a=!0,o=!0,s="",l=null,u=null,f=[],m={},S=p=>{typeof p=="object"&&p&&("messages"in p&&delete p.messages,i=p)};return n.pipe((0,H.mergeMap)(p=>{switch(p.type){case y.TEXT_MESSAGE_START:{let v=p;return[{type:$.enum.TextMessageStart,messageId:v.messageId,role:v.role}]}case y.TEXT_MESSAGE_CONTENT:{let v=p;return[{type:$.enum.TextMessageContent,messageId:v.messageId,content:v.delta}]}case y.TEXT_MESSAGE_END:{let v=p;return[{type:$.enum.TextMessageEnd,messageId:v.messageId}]}case y.TOOL_CALL_START:{let v=p;return f.push({id:v.toolCallId,type:"function",function:{name:v.toolCallName,arguments:""}}),o=!0,m[v.toolCallId]=v.toolCallName,[{type:$.enum.ActionExecutionStart,actionExecutionId:v.toolCallId,actionName:v.toolCallName,parentMessageId:v.parentMessageId}]}case y.TOOL_CALL_ARGS:{let v=p,_=f.find(O=>O.id===v.toolCallId);if(!_)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${v.toolCallId}'`),[];_.function.arguments+=v.delta;let g=!1;if(u){let O=u.find(E=>E.tool==_.function.name);if(O)try{let E=JSON.parse(rs(_.function.arguments));O.tool_argument&&O.tool_argument in E?(S({...i,[O.state_key]:E[O.tool_argument]}),g=!0):O.tool_argument||(S({...i,[O.state_key]:E}),g=!0)}catch{}}return[{type:$.enum.ActionExecutionArgs,actionExecutionId:v.toolCallId,args:v.delta},...g?[{type:$.enum.AgentStateMessage,threadId:t,agentName:r,nodeName:s,runId:e,running:a,role:"assistant",state:JSON.stringify(i),active:o}]:[]]}case y.TOOL_CALL_END:{let v=p;return[{type:$.enum.ActionExecutionEnd,actionExecutionId:v.toolCallId}]}case y.TOOL_CALL_RESULT:{let v=p;return[{type:$.enum.ActionExecutionResult,actionExecutionId:v.toolCallId,result:v.content,actionName:m[v.toolCallId]||"unknown"}]}case y.RAW:return[];case y.CUSTOM:{let v=p;switch(v.name){case"Exit":a=!1;break;case"PredictState":u=v.value;break}return[{type:$.enum.MetaEvent,name:v.name,value:v.value}]}case y.STATE_SNAPSHOT:return S(p.snapshot),[{type:$.enum.AgentStateMessage,threadId:t,agentName:r,nodeName:s,runId:e,running:a,role:"assistant",state:JSON.stringify(i),active:o}];case y.STATE_DELTA:{let v=p,_=$e(i,v.delta,!0,!1);return _?(S(_.newDocument),[{type:$.enum.AgentStateMessage,threadId:t,agentName:r,nodeName:s,runId:e,running:a,role:"assistant",state:JSON.stringify(i),active:o}]):[]}case y.MESSAGES_SNAPSHOT:return l=p.messages,[{type:$.enum.AgentStateMessage,threadId:t,agentName:r,nodeName:s,runId:e,running:a,role:"assistant",state:JSON.stringify({...i,...l?{messages:l}:{}}),active:!0}];case y.RUN_STARTED:return[];case y.RUN_FINISHED:return l&&(i.messages=l),Object.keys(i).length===0?[]:[{type:$.enum.AgentStateMessage,threadId:t,agentName:r,nodeName:s,runId:e,running:a,role:"assistant",state:JSON.stringify({...i,...l?{messages:xR(l)}:{}}),active:!1}];case y.RUN_ERROR:{let v=p;return[{type:$.enum.RunError,message:v.message,code:v.code}]}case y.STEP_STARTED:return s=p.stepName,f=[],u=null,[{type:$.enum.AgentStateMessage,threadId:t,agentName:r,nodeName:s,runId:e,running:a,role:"assistant",state:JSON.stringify(i),active:!0}];case y.STEP_FINISHED:return f=[],u=null,[{type:$.enum.AgentStateMessage,threadId:t,agentName:r,nodeName:s,runId:e,running:a,role:"assistant",state:JSON.stringify(i),active:!1}];default:return[]}}))};function xR(t){let e=[];for(let r of t)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=PR(r.content);if(n){let i={id:r.id,role:r.role,content:n};e.push(i)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let i of r.toolCalls){let a={id:i.id,name:i.function.name,arguments:JSON.parse(i.function.arguments),parentMessageId:r.id};e.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of t)if(a.role==="assistant"&&a.toolCalls?.length){for(let o of a.toolCalls)if(o.id===r.toolCallId){n=o.function.name;break}}let i={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};e.push(i)}return e}var as=t=>e=>{let r=Qc(t),n,i,a,o,s=()=>{if(!n||o!=="text")throw Error("No text message to close");let m={type:y.TEXT_MESSAGE_END,messageId:n.messageId};return o=void 0,n=void 0,r?.event("TRANSFORM","TEXT_MESSAGE_END",m,{messageId:m.messageId}),m},l=()=>{if(!i||o!=="tool")throw Error("No tool call to close");let m={type:y.TOOL_CALL_END,toolCallId:i.toolCallId};return o=void 0,i=void 0,r?.event("TRANSFORM","TOOL_CALL_END",m,{toolCallId:m.toolCallId}),m},u=()=>{if(!a||o!=="reasoning")throw Error("No reasoning message to close");let m={type:y.REASONING_MESSAGE_END,messageId:a.messageId};return o=void 0,a=void 0,r?.event("TRANSFORM","REASONING_MESSAGE_END",m,{messageId:m.messageId}),m},f=()=>o==="text"?[s()]:o==="tool"?[l()]:o==="reasoning"?[u()]:[];return e.pipe((0,P.mergeMap)(m=>{switch(m.type){case y.TEXT_MESSAGE_START:case y.TEXT_MESSAGE_CONTENT:case y.TEXT_MESSAGE_END:case y.TOOL_CALL_START:case y.TOOL_CALL_ARGS:case y.TOOL_CALL_END:case y.TOOL_CALL_RESULT:case y.STATE_SNAPSHOT:case y.STATE_DELTA:case y.MESSAGES_SNAPSHOT:case y.CUSTOM:case y.RUN_STARTED:case y.RUN_FINISHED:case y.RUN_ERROR:case y.STEP_STARTED:case y.STEP_FINISHED:case y.THINKING_START:case y.THINKING_END:case y.THINKING_TEXT_MESSAGE_START:case y.THINKING_TEXT_MESSAGE_CONTENT:case y.THINKING_TEXT_MESSAGE_END:case y.REASONING_START:case y.REASONING_MESSAGE_START:case y.REASONING_MESSAGE_CONTENT:case y.REASONING_MESSAGE_END:case y.REASONING_END:return[...f(),m];case y.RAW:case y.ACTIVITY_SNAPSHOT:case y.ACTIVITY_DELTA:case y.REASONING_ENCRYPTED_VALUE:return[m];case y.TEXT_MESSAGE_CHUNK:let S=m,p=[];if((o!=="text"||S.messageId!==void 0&&S.messageId!==n?.messageId)&&p.push(...f()),o!=="text"){if(S.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:S.messageId,name:S.name},o="text";let E={type:y.TEXT_MESSAGE_START,messageId:S.messageId,role:S.role||"assistant",...S.name!==void 0&&{name:S.name}};p.push(E),r?.event("TRANSFORM","TEXT_MESSAGE_START",E,{messageId:S.messageId})}if(S.delta!==void 0){let E={type:y.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:S.delta};p.push(E),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",E,{messageId:n.messageId})}return p;case y.TOOL_CALL_CHUNK:let v=m,_=[];if((o!=="tool"||v.toolCallId!==void 0&&v.toolCallId!==i?.toolCallId)&&_.push(...f()),o!=="tool"){if(v.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(v.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");i={toolCallId:v.toolCallId,toolCallName:v.toolCallName,parentMessageId:v.parentMessageId},o="tool";let E={type:y.TOOL_CALL_START,toolCallId:v.toolCallId,toolCallName:v.toolCallName,parentMessageId:v.parentMessageId};_.push(E),r?.event("TRANSFORM","TOOL_CALL_START",E,{toolCallId:v.toolCallId,toolCallName:v.toolCallName})}if(v.delta!==void 0){let E={type:y.TOOL_CALL_ARGS,toolCallId:i.toolCallId,delta:v.delta};_.push(E),r?.event("TRANSFORM","TOOL_CALL_ARGS",E,{toolCallId:i.toolCallId})}return _;case y.REASONING_MESSAGE_CHUNK:let g=m,O=[];if((o!=="reasoning"||g.messageId&&g.messageId!==a?.messageId)&&O.push(...f()),o!=="reasoning"){if(g.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");a={messageId:g.messageId},o="reasoning";let E={type:y.REASONING_MESSAGE_START,messageId:g.messageId};O.push(E),r?.event("TRANSFORM","REASONING_MESSAGE_START",E,{messageId:g.messageId})}if(g.delta!==void 0){let E={type:y.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:g.delta};O.push(E),r?.event("TRANSFORM","REASONING_MESSAGE_CONTENT",E,{messageId:a.messageId})}return O}return m.type,[]}),(0,P.finalize)(()=>{f()}))},el=class{runNext(t,e){return e.run(t).pipe(as(!1))}runNextWithState(t,e){let r=D(t.messages||[]),n=D(t.state||{}),i=new P.ReplaySubject;return Gv(t,i,e,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(t,e).pipe((0,H.concatMap)(async a=>(i.next(a),await new Promise(o=>setTimeout(o,0)),{event:a,messages:D(r),state:D(n)})))}},CR=class extends el{constructor(t){super(),this.fn=t}run(t,e){return this.fn(t,e)}};function qR(t){let e=t.content;if(Array.isArray(e)){let r=e.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...t,content:r}}return typeof e=="string"?t:{...t,content:""}}var kR=class extends el{run(t,e){let{parentRunId:r,...n}=t,i={...n,messages:n.messages.map(qR)};return this.runNext(i,e)}},jv="THINKING_START",Lv="THINKING_END",Fv="THINKING_TEXT_MESSAGE_START",Dv="THINKING_TEXT_MESSAGE_CONTENT",Uv="THINKING_TEXT_MESSAGE_END",RR=class extends el{constructor(...t){super(...t),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(t,e){typeof process<"u"&&process.env!==void 0&&process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${t} to ${e}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(t,e){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(t,e).pipe((0,H.map)(r=>this.transformEvent(r)))}transformEvent(t){switch(t.type){case jv:{this.currentReasoningId=vn();let{title:e,...r}=t;return this.warnAboutTransformation(jv,y.REASONING_START),{...r,type:y.REASONING_START,messageId:this.currentReasoningId}}case Fv:return this.currentMessageId=vn(),this.warnAboutTransformation(Fv,y.REASONING_MESSAGE_START),{...t,type:y.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case Dv:{let{delta:e,...r}=t;return this.warnAboutTransformation(Dv,y.REASONING_MESSAGE_CONTENT),{...r,type:y.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??vn(),delta:e}}case Uv:{let e=this.currentMessageId??vn();return this.warnAboutTransformation(Uv,y.REASONING_MESSAGE_END),{...t,type:y.REASONING_MESSAGE_END,messageId:e}}case Lv:{let e=this.currentReasoningId??vn();return this.warnAboutTransformation(Lv,y.REASONING_END),{...t,type:y.REASONING_END,messageId:e}}default:return t}}},MR="0.0.52",os=class{get maxVersion(){return MR}get debug(){return this._debug}set debug(t){this._debug=is(t),this._debugLogger=Xc(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(t){typeof t=="boolean"?this._debugLogger=t?Xc(is(!0)):void 0:this._debugLogger=t}constructor({agentId:t,description:e,threadId:r,initialMessages:n,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=t,this.description=e??"",this.threadId=r??Ge(),this.messages=D(n??[]),this.state=D(i??{}),this._debug=is(a),this._debugLogger=Xc(this._debug),ns(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new kR),ns(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new RR)}subscribe(t){return this.subscribers.push(t),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(e=>e!==t)}}}use(...t){let e=t.map(r=>typeof r=="function"?new CR(r):r);return this.middlewares.push(...e),this}async runAgent(t,e){try{this.isRunning=!0,this.agentId=this.agentId??Ge();let r=this.prepareRunAgentInput(t);this.debugLogger?.lifecycle("LIFECYCLE","Run started:",{agentId:this.agentId,threadId:this.threadId});let n,i=new Set(this.messages.map(l=>l.id)),a=[{onRunFinishedEvent:l=>{n=l.result}},...this.subscribers,e??{}];await this.onInitialize(r,a),this.activeRunDetach$=new P.Subject;let o;this.activeRunCompletionPromise=new Promise(l=>{o=l}),await(0,P.lastValueFrom)((0,P.pipe)(()=>this.middlewares.length===0?this.run(r):this.middlewares.reduceRight((l,u)=>({run:f=>u.run(f,l),get messages(){return l.messages},get state(){return l.state}}),this).run(r),as(this.debugLogger),Zc(this.debugLogger),l=>l.pipe((0,H.takeUntil)(this.activeRunDetach$)),l=>this.apply(r,l,a),l=>this.processApplyEvents(r,l,a),(0,H.catchError)(l=>(this.debugLogger?.lifecycle("LIFECYCLE","Run errored:",{agentId:this.agentId,error:l instanceof Error?l.message:String(l)}),this.isRunning=!1,this.onError(r,l,a))),(0,H.finalize)(()=>{this.debugLogger?.lifecycle("LIFECYCLE","Run finished:",{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(r,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))((0,P.of)(null)));let s=D(this.messages).filter(l=>!i.has(l.id));return{result:n,newMessages:s}}finally{this.isRunning=!1}}connect(t){throw new hs}async connectAgent(t,e){try{this.isRunning=!0,this.agentId=this.agentId??Ge();let r=this.prepareRunAgentInput(t),n,i=new Set(this.messages.map(l=>l.id)),a=[{onRunFinishedEvent:l=>{n=l.result}},...this.subscribers,e??{}];await this.onInitialize(r,a),this.activeRunDetach$=new P.Subject;let o;this.activeRunCompletionPromise=new Promise(l=>{o=l}),await(0,P.lastValueFrom)((0,P.pipe)(()=>(0,P.defer)(()=>this.connect(r)),as(this.debugLogger),Zc(this.debugLogger),l=>l.pipe((0,H.takeUntil)(this.activeRunDetach$)),l=>this.apply(r,l,a),l=>this.processApplyEvents(r,l,a),(0,H.catchError)(l=>(this.isRunning=!1,l instanceof hs?P.EMPTY:this.onError(r,l,a))),(0,H.finalize)(()=>{this.isRunning=!1,this.onFinalize(r,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))((0,P.of)(null)),{defaultValue:void 0});let s=D(this.messages).filter(l=>!i.has(l.id));return{result:n,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let t=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await t}apply(t,e,r){return Gv(t,e,this,r,this.debugLogger)}processApplyEvents(t,e,r){return e.pipe((0,H.tap)(n=>{n.messages&&(this.messages=n.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:t})})),n.state&&(this.state=n.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:t})}))}))}prepareRunAgentInput(t){let e=D(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:t?.runId||Ge(),tools:D(t?.tools??[]),context:D(t?.context??[]),forwardedProps:D(t?.forwardedProps??{}),state:D(this.state),messages:e}}async onInitialize(t,e){let r=await G(e,this.messages,this.state,(n,i,a)=>n.onRunInitialized?.({messages:i,state:a,agent:this,input:t}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(this.messages=r.messages,t.messages=r.messages,e.forEach(n=>{n.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:t})})),r.state&&(this.state=r.state,t.state=r.state,e.forEach(n=>{n.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:t})})))}onError(t,e,r){return(0,P.from)(G(r,this.messages,this.state,(n,i,a)=>n.onRunFailed?.({error:e,messages:i,state:a,agent:this,input:t}))).pipe((0,H.map)(n=>{let i=n;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:t})})),i.state!==void 0&&(this.state=i.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:t})}))),i.stopPropagation!==!0){let a=String(e);if(!(e.name==="AbortError"||e.message==="Fetch is aborted"||e.message==="signal is aborted without reason"||e.message==="component unmounted"||a==="component unmounted"))throw console.error("Agent execution failed:",e),e}return{}}))}async onFinalize(t,e){let r=await G(e,this.messages,this.state,(n,i,a)=>n.onRunFinalized?.({messages:i,state:a,agent:this,input:t}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(this.messages=r.messages,e.forEach(n=>{n.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:t})})),r.state!==void 0&&(this.state=r.state,e.forEach(n=>{n.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:t})})))}clone(){let t=Object.create(Object.getPrototypeOf(this));return t.agentId=this.agentId,t.description=this.description,t.threadId=this.threadId,t.messages=D(this.messages),t.state=D(this.state),t._debug=this._debug,t._debugLogger=this._debugLogger,t.isRunning=this.isRunning,t.subscribers=[...this.subscribers],t.middlewares=[...this.middlewares],t}addMessage(t){this.messages.push(t),(async()=>{for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role==="assistant"&&t.toolCalls)for(let e of t.toolCalls)for(let r of this.subscribers)await r.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(t){this.messages.push(...t),(async()=>{for(let e of t){for(let r of this.subscribers)await r.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role==="assistant"&&e.toolCalls)for(let r of e.toolCalls)for(let n of this.subscribers)await n.onNewToolCall?.({toolCall:r,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(t){this.messages=D(t),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(t){this.state=D(t),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(t){this.agentId=this.agentId??Ge();let e=this.prepareRunAgentInput(t);return(this.middlewares.length===0?this.run(e):this.middlewares.reduceRight((r,n)=>({run:i=>n.run(i,r),get messages(){return r.messages},get state(){return r.state}}),this).run(e)).pipe(as(this.debugLogger),Zc(this.debugLogger),NR(this.threadId,e.runId,this.agentId),r=>r.pipe((0,H.map)(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}};var Jv=ls($c(),1);var Vv=1,ss="0.1.0",tl="X-CSRF-Token",Wv="X-Surogates-Widget-Version",Bv="/v1/website/sessions",Hv=t=>`/v1/website/sessions/${t}/messages`,$v=(t,e)=>`/v1/website/sessions/${t}/events?after=${e}`,zv=t=>`/v1/website/sessions/${t}/end`,V={USER_MESSAGE:"user.message",LLM_REQUEST:"llm.request",LLM_RESPONSE:"llm.response",LLM_THINKING:"llm.thinking",LLM_DELTA:"llm.delta",TOOL_CALL:"tool.call",TOOL_RESULT:"tool.result",SANDBOX_PROVISION:"sandbox.provision",SANDBOX_EXECUTE:"sandbox.execute",SANDBOX_RESULT:"sandbox.result",SANDBOX_DESTROY:"sandbox.destroy",SESSION_START:"session.start",SESSION_PAUSE:"session.pause",SESSION_RESUME:"session.resume",SESSION_COMPLETE:"session.complete",SESSION_FAIL:"session.fail",SESSION_DONE:"session.done",CONTEXT_COMPACT:"context.compact",MEMORY_UPDATE:"memory.update",EXPERT_DELEGATION:"expert.delegation",EXPERT_RESULT:"expert.result",EXPERT_FAILURE:"expert.failure",POLICY_DENIED:"policy.denied",POLICY_ALLOWED:"policy.allowed",HARNESS_CRASH:"harness.crash"};var _t=class extends Error{constructor(e,r){super(e),this.name="SurogatesError",r?.status!==void 0&&(this.status=r.status),r?.detail!==void 0&&(this.detail=r.detail),r?.cause!==void 0&&(this.cause=r.cause)}},Ue=class extends _t{constructor(e,r){super(e,r),this.name="SurogatesAuthError"}},$r=class extends _t{constructor(e,r){super(e,r),this.name="SurogatesRateLimitError",r?.retryAfter!==void 0&&(this.retryAfter=r.retryAfter)}},bt=class extends _t{constructor(e,r){super(e,r),this.name="SurogatesProtocolError"}},$t=class extends _t{constructor(e,r){super(e,r),this.name="SurogatesNetworkError"}};async function rl(t,e){let r;try{r=await fetch(t,{...e,credentials:"include",headers:{...e.headers,[Wv]:ss}})}catch(n){throw new $t("Network request failed",{cause:n})}return r}async function jR(t){try{let e=await t.json();return typeof e.detail=="string"?e.detail:void 0}catch{return}}async function Kv(t,e){let r=await jR(t);if(t.status===401||t.status===403)throw new Ue(`${e} rejected (${t.status})`,{status:t.status,...r!==void 0&&{detail:r}});if(t.status===429){let n=t.headers.get("Retry-After"),i=n?Number(n):void 0;throw new $r(`${e} rate-limited`,{status:t.status,...i!==void 0&&Number.isFinite(i)&&{retryAfter:i},...r!==void 0&&{detail:r}})}throw t.status>=500?new $t(`${e} failed (${t.status}${r?`: ${r}`:""})`):new bt(`${e} failed (${t.status})`,{status:t.status,...r!==void 0&&{detail:r}})}async function Xv(t,e){let r=await rl(t+Bv,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});r.ok||await Kv(r,"Bootstrap");let n;try{n=await r.json()}catch(i){throw new bt("Bootstrap returned non-JSON body",{cause:i})}if(!n||typeof n.session_id!="string"||typeof n.csrf_token!="string")throw new bt("Bootstrap response missing required fields");return{sessionId:n.session_id,csrfToken:n.csrf_token,expiresAt:Number(n.expires_at)||0,agentName:n.agent_name??""}}async function nl(t,e,r,n){let i=await rl(t+Hv(e),{method:"POST",headers:{"Content-Type":"application/json",[tl]:r},body:JSON.stringify({content:n})});i.ok||await Kv(i,"Send message");let a=await i.json().catch(()=>({}));return{eventId:Number(a.event_id??0)}}async function Zv(t,e,r){try{await rl(t+zv(e),{method:"POST",headers:{[tl]:r}})}catch{}}function Yv(t,e,r){let n=t+$v(e,r);return new EventSource(n,{withCredentials:!0})}var LR=new Set(["stop","end_turn","length"]),FR=new Set(["tool_calls","function_call","tool_use"]),zt=class{constructor(){this.pendingToolCalls=new Set;this._turnComplete=!1}get isTurnComplete(){return this._turnComplete}translate(e){switch(e.type){case V.LLM_DELTA:return this.handleLlmDelta(e);case V.LLM_RESPONSE:return this.handleLlmResponse(e);case V.LLM_THINKING:return this.handleLlmThinking(e);case V.TOOL_CALL:return this.handleToolCall(e);case V.TOOL_RESULT:return this.handleToolResult(e);case V.POLICY_DENIED:return this.handlePolicyDenied(e);case V.EXPERT_DELEGATION:return this.handleExpertDelegation(e);case V.EXPERT_RESULT:return this.handleExpertResult(e);case V.EXPERT_FAILURE:return this.asCustom(e);case V.SESSION_FAIL:case V.HARNESS_CRASH:return this.handleTerminalFailure(e);case V.SESSION_DONE:case V.SESSION_COMPLETE:return this._turnComplete=!0,[];case V.USER_MESSAGE:case V.LLM_REQUEST:case V.SESSION_START:case V.SESSION_PAUSE:case V.SESSION_RESUME:case V.SANDBOX_PROVISION:case V.SANDBOX_EXECUTE:case V.SANDBOX_RESULT:case V.SANDBOX_DESTROY:case V.POLICY_ALLOWED:return[];default:return this.asCustom(e)}}handleLlmDelta(e){let r=e.data??{},n=r.delta??r.content??"";if(!n)return[];let i=this.currentMessageId??r.message_id??this.mintMessageId(e.id);return this.currentMessageId=i,[{type:y.TEXT_MESSAGE_CHUNK,messageId:i,role:"assistant",delta:n}]}handleLlmResponse(e){let r=e.data??{},n=[];if(!this.currentMessageId&&r.content){let s=r.message_id??r.id??this.mintMessageId(e.id);n.push({type:y.TEXT_MESSAGE_CHUNK,messageId:s,role:"assistant",delta:r.content})}this.currentMessageId=void 0;let i=Array.isArray(r.tool_calls)?r.tool_calls:[],a=r.finish_reason??r.stop_reason??"";return FR.has(a)||i.length===0&&(a===""||LR.has(a))&&this.pendingToolCalls.size===0&&(this._turnComplete=!0),n}handleLlmThinking(e){let r=e.data??{},n=r.delta??r.content??"";if(!n)return[];let i=this.currentReasoningId??r.message_id??this.mintMessageId(e.id),a=this.currentReasoningId!==i;this.currentReasoningId=i;let o=[];return a&&(o.push({type:y.REASONING_START,messageId:i}),o.push({type:y.REASONING_MESSAGE_START,messageId:i,role:"reasoning"})),o.push({type:y.REASONING_MESSAGE_CONTENT,messageId:i,delta:n}),o}handleToolCall(e){let r=e.data??{},n=r.tool_call_id??`tc-${e.id}`,i=r.name??"unknown_tool";this.currentMessageId=void 0,this.currentReasoningId=void 0,this.pendingToolCalls.add(n);let a=typeof r.arguments=="string"?r.arguments:JSON.stringify(r.arguments??{});return[{type:y.TOOL_CALL_CHUNK,toolCallId:n,toolCallName:i,delta:a}]}handleToolResult(e){let r=e.data??{},n=r.tool_call_id??`tc-${e.id}`,i=r.content??"";return this.pendingToolCalls.delete(n),[{type:y.TOOL_CALL_RESULT,messageId:`tr-${e.id}`,toolCallId:n,content:i,role:"tool"}]}handlePolicyDenied(e){let r=e.data??{};return[{type:y.CUSTOM,name:V.POLICY_DENIED,value:{tool:r.tool,reason:r.reason}}]}handleExpertDelegation(e){let n=(e.data??{}).expert_name??"expert";return[{type:y.STEP_STARTED,stepName:`expert:${n}`}]}handleExpertResult(e){let n=(e.data??{}).expert_name??"expert";return[{type:y.STEP_FINISHED,stepName:`expert:${n}`}]}handleTerminalFailure(e){this._turnComplete=!0;let r=e.data??{},n=r.error??r.message??`${e.type} fired`;return[{type:y.RUN_ERROR,message:n,code:e.type}]}asCustom(e){return[{type:y.CUSTOM,name:e.type,value:e.data}]}mintMessageId(e){return`msg-${e}`}};var DR=Object.values(V),UR=250,cs=class extends os{constructor(r){super(r);this.cursor=0;if(!r.apiUrl)throw new B('WebsiteAgent: "apiUrl" is required.');if(!r.publishableKey)throw new B('WebsiteAgent: "publishableKey" is required.');this.apiUrl=r.apiUrl.replace(/\/+$/,""),this.publishableKey=r.publishableKey}async ensureBootstrapped(){return this.bootstrapResult?this.bootstrapResult:(this.bootstrapResult=await Xv(this.apiUrl,this.publishableKey),this.bootstrapResult)}async end(){let r=this.bootstrapResult;r&&(this.bootstrapResult=void 0,this.cursor=0,await Zv(this.apiUrl,r.sessionId,r.csrfToken))}run(r){return new Jv.Observable(n=>{let i={terminated:!1,source:void 0,drainTimer:void 0};return this.driveRun(r,n,i).catch(a=>{i.terminated||(i.terminated=!0,n.error(a))}),()=>{i.terminated=!0,i.drainTimer===void 0&&(us(i.source),i.source=void 0)}})}async driveRun(r,n,i){if(!i.terminated){n.next({type:y.RUN_STARTED,threadId:r.threadId,runId:r.runId});try{let a=this.extractUserText(r.messages),o=await this.ensureBootstrapped();this.replaceStreamSource(i,o.sessionId,this.cursor,new zt,n,r),await this.sendWithCookieRecovery(o,a,s=>{this.replaceStreamSource(i,s.sessionId,0,new zt,n,r)})}catch(a){if(i.terminated)return;i.terminated=!0;let o=a instanceof Error?a.message:String(a),s=a instanceof Ue?"auth":"error";n.next({type:y.RUN_ERROR,message:o,code:s}),us(i.source),i.source=void 0,n.complete()}}}replaceStreamSource(r,n,i,a,o,s){us(r.source);let l=Yv(this.apiUrl,n,i);r.source=l,this.attachStreamListeners(l,a,o,s,r)}async sendWithCookieRecovery(r,n,i){try{await nl(this.apiUrl,r.sessionId,r.csrfToken,n);return}catch(a){if(!(a instanceof Ue))throw a;this.bootstrapResult=void 0,this.cursor=0;let o=await this.ensureBootstrapped();i(o),await nl(this.apiUrl,o.sessionId,o.csrfToken,n)}}attachStreamListeners(r,n,i,a,o){let s=()=>{o.drainTimer!==void 0&&globalThis.clearTimeout(o.drainTimer),o.drainTimer=globalThis.setTimeout(()=>{o.drainTimer=void 0,us(r)},UR)},l=()=>{o.terminated||(o.terminated=!0,i.next({type:y.RUN_FINISHED,threadId:a.threadId,runId:a.runId}),s(),i.complete())},u=(f,m,S)=>{let p;try{p=JSON.parse(m)}catch{p=m}let v={id:Number(S)||0,type:f,data:p};if(v.id>this.cursor&&(this.cursor=v.id),o.terminated)return;let _=n.translate(v);for(let g of _)i.next(g);n.isTurnComplete&&l()};for(let f of DR)r.addEventListener(f,m=>{u(f,m.data,m.lastEventId)});r.onerror=()=>{r.readyState===2&&(o.terminated||(o.terminated=!0,i.next({type:y.RUN_ERROR,message:"SSE connection closed",code:"sse_closed"}),i.complete()))}}extractUserText(r){for(let n=r.length-1;n>=0;n--){let i=r[n];if(!i||i.role!=="user")continue;let a=i.content;if(typeof a=="string"&&a.trim().length>0)return a}throw new B("WebsiteAgent: no user message with string content found in input.messages.")}};function us(t){if(t){try{t.onerror=null}catch{}t.close()}}return ip(GR);})();
10
+ /*! Bundled license information:
11
+
12
+ fast-json-patch/module/helpers.mjs:
13
+ (*!
14
+ * https://github.com/Starcounter-Jack/JSON-Patch
15
+ * (c) 2017-2022 Joachim Wester
16
+ * MIT licensed
17
+ *)
18
+
19
+ fast-json-patch/module/duplex.mjs:
20
+ (*!
21
+ * https://github.com/Starcounter-Jack/JSON-Patch
22
+ * (c) 2017-2021 Joachim Wester
23
+ * MIT license
24
+ *)
25
+ */
26
+ //# sourceMappingURL=surogates-widget.global.js.map