@dahawa/hawa-code 1.10.0 → 1.10.2

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.
Files changed (3) hide show
  1. package/cli.js +483 -488
  2. package/hawa.js +10 -10
  3. package/package.json +1 -1
package/hawa.js CHANGED
@@ -22,7 +22,7 @@ var qS=Object.create;var ah=Object.defineProperty;var MS=Object.getOwnPropertyDe
22
22
  `+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
23
23
  `):"",this.name="UnsubscriptionError",this.errors=r}})});var St=d(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.arrRemove=void 0;function N8(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}Ia.arrRemove=N8});var Pe=d(we=>{"use strict";var lv=we&&we.__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.")},fv=we&&we.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},dv=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.isSubscription=we.EMPTY_SUBSCRIPTION=we.Subscription=void 0;var eo=$(),id=nd(),pv=St(),od=(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,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=lv(a),u=s.next();!u.done;u=s.next()){var c=u.value;c.remove(this)}}catch(b){e={error:b}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}else a.remove(this);var l=this.initialTeardown;if(eo.isFunction(l))try{l()}catch(b){o=b instanceof id.UnsubscriptionError?b.errors:[b]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var x=lv(p),h=x.next();!h.done;h=x.next()){var g=h.value;try{xv(g)}catch(b){o=o??[],b instanceof id.UnsubscriptionError?o=dv(dv([],fv(o)),fv(b.errors)):o.push(b)}}}catch(b){n={error:b}}finally{try{h&&!h.done&&(i=x.return)&&i.call(x)}finally{if(n)throw n.error}}}if(o)throw new id.UnsubscriptionError(o)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)xv(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)&&pv.arrRemove(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&pv.arrRemove(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})();we.Subscription=od;we.EMPTY_SUBSCRIPTION=od.EMPTY;function U8(t){return t instanceof od||t&&"closed"in t&&eo.isFunction(t.remove)&&eo.isFunction(t.add)&&eo.isFunction(t.unsubscribe)}we.isSubscription=U8;function xv(t){eo.isFunction(t)?t():t.unsubscribe()}});var pn=d(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.config=void 0;Pa.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var ad=d(ut=>{"use strict";var hv=ut&&ut.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},mv=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.timeoutProvider=void 0;ut.timeoutProvider={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=ut.timeoutProvider.delegate;return i?.setTimeout?i.setTimeout.apply(i,mv([t,e],hv(r))):setTimeout.apply(void 0,mv([t,e],hv(r)))},clearTimeout:function(t){var e=ut.timeoutProvider.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0}});var sd=d(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.reportUnhandledError=void 0;var G8=pn(),$8=ad();function V8(t){$8.timeoutProvider.setTimeout(function(){var e=G8.config.onUnhandledError;if(e)e(t);else throw t})}ja.reportUnhandledError=V8});var he=d(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.noop=void 0;function K8(){}qa.noop=K8});var vv=d(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.createNotification=ct.nextNotification=ct.errorNotification=ct.COMPLETE_NOTIFICATION=void 0;ct.COMPLETE_NOTIFICATION=(function(){return Ma("C",void 0,void 0)})();function W8(t){return Ma("E",void 0,t)}ct.errorNotification=W8;function z8(t){return Ma("N",t,void 0)}ct.nextNotification=z8;function Ma(t,e,r){return{kind:t,value:e,error:r}}ct.createNotification=Ma});var ka=d(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.captureError=xn.errorContext=void 0;var gv=pn(),Mr=null;function H8(t){if(gv.config.useDeprecatedSynchronousErrorHandling){var e=!Mr;if(e&&(Mr={errorThrown:!1,error:null}),t(),e){var r=Mr,n=r.errorThrown,i=r.error;if(Mr=null,n)throw i}}else t()}xn.errorContext=H8;function Y8(t){gv.config.useDeprecatedSynchronousErrorHandling&&Mr&&(Mr.errorThrown=!0,Mr.error=t)}xn.captureError=Y8});var hn=d($e=>{"use strict";var yv=$e&&$e.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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($e,"__esModule",{value:!0});$e.EMPTY_OBSERVER=$e.SafeSubscriber=$e.Subscriber=void 0;var J8=$(),bv=Pe(),fd=pn(),X8=sd(),_v=he(),ud=vv(),Q8=ad(),Z8=ka(),Dv=(function(t){yv(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,bv.isSubscription(r)&&r.add(n)):n.destination=$e.EMPTY_OBSERVER,n}return e.create=function(r,n,i){return new Sv(r,n,i)},e.prototype.next=function(r){this.isStopped?ld(ud.nextNotification(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?ld(ud.errorNotification(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?ld(ud.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})(bv.Subscription);$e.Subscriber=Dv;var e5=Function.prototype.bind;function cd(t,e){return e5.call(t,e)}var t5=(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){La(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){La(n)}else La(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){La(r)}},t})(),Sv=(function(t){yv(e,t);function e(r,n,i){var o=t.call(this)||this,a;if(J8.isFunction(r)||!r)a={next:r??void 0,error:n??void 0,complete:i??void 0};else{var s;o&&fd.config.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return o.unsubscribe()},a={next:r.next&&cd(r.next,s),error:r.error&&cd(r.error,s),complete:r.complete&&cd(r.complete,s)}):a=r}return o.destination=new t5(a),o}return e})(Dv);$e.SafeSubscriber=Sv;function La(t){fd.config.useDeprecatedSynchronousErrorHandling?Z8.captureError(t):X8.reportUnhandledError(t)}function r5(t){throw t}function ld(t,e){var r=fd.config.onStoppedNotification;r&&Q8.timeoutProvider.setTimeout(function(){return r(t,e)})}$e.EMPTY_OBSERVER={closed:!0,next:_v.noop,error:r5,complete:_v.noop}});var to=d(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.observable=void 0;Ra.observable=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})()});var me=d(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.identity=void 0;function n5(t){return t}Ba.identity=n5});var ro=d(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.pipeFromArray=mn.pipe=void 0;var i5=me();function o5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ev(t)}mn.pipe=o5;function Ev(t){return t.length===0?i5.identity:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}mn.pipeFromArray=Ev});var V=d(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.Observable=void 0;var pd=hn(),a5=Pe(),s5=to(),u5=ro(),c5=pn(),dd=$(),l5=ka(),f5=(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,o=p5(e)?e:new pd.SafeSubscriber(e,r,n);return l5.errorContext(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},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=wv(r),new r(function(i,o){var a=new pd.SafeSubscriber({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});n.subscribe(a)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[s5.observable]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return u5.pipeFromArray(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=wv(e),new e(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},t.create=function(e){return new t(e)},t})();Na.Observable=f5;function wv(t){var e;return(e=t??c5.config.Promise)!==null&&e!==void 0?e:Promise}function d5(t){return t&&dd.isFunction(t.next)&&dd.isFunction(t.error)&&dd.isFunction(t.complete)}function p5(t){return t&&t instanceof pd.Subscriber||d5(t)&&a5.isSubscription(t)}});var D=d(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.operate=vn.hasLift=void 0;var x5=$();function Ov(t){return x5.isFunction(t?.lift)}vn.hasLift=Ov;function h5(t){return function(e){if(Ov(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")}}vn.operate=h5});var O=d($t=>{"use strict";var m5=$t&&$t.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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($t,"__esModule",{value:!0});$t.OperatorSubscriber=$t.createOperatorSubscriber=void 0;var v5=hn();function g5(t,e,r,n,i){return new Cv(t,e,r,n,i)}$t.createOperatorSubscriber=g5;var Cv=(function(t){m5(e,t);function e(r,n,i,o,a,s){var u=t.call(this,r)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=n?function(c){try{n(c)}catch(l){r.error(l)}}:t.prototype._next,u._error=o?function(c){try{o(c)}catch(l){r.error(l)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:t.prototype._complete,u}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})(v5.Subscriber);$t.OperatorSubscriber=Cv});var xd=d(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.refCount=void 0;var b5=D(),_5=O();function y5(){return b5.operate(function(t,e){var r=null;t._refCount++;var n=_5.createOperatorSubscriber(e,void 0,void 0,void 0,function(){if(!t||t._refCount<=0||0<--t._refCount){r=null;return}var i=t._connection,o=r;r=null,i&&(!o||i===o)&&i.unsubscribe(),e.unsubscribe()});t.subscribe(n),n.closed||(r=t.connect())})}Ua.refCount=y5});var no=d(gn=>{"use strict";var D5=gn&&gn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(gn,"__esModule",{value:!0});gn.ConnectableObservable=void 0;var S5=V(),Av=Pe(),E5=xd(),w5=O(),O5=D(),C5=(function(t){D5(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,O5.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 Av.Subscription;var i=this.getSubject();n.add(this.source.subscribe(w5.createOperatorSubscriber(i,void 0,function(){r._teardown(),i.complete()},function(o){r._teardown(),i.error(o)},function(){return r._teardown()}))),n.closed&&(this._connection=null,n=Av.Subscription.EMPTY)}return n},e.prototype.refCount=function(){return E5.refCount()(this)},e})(S5.Observable);gn.ConnectableObservable=C5});var Fv=d(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.performanceTimestampProvider=void 0;io.performanceTimestampProvider={now:function(){return(io.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var hd=d(Ve=>{"use strict";var Tv=Ve&&Ve.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Iv=Ve&&Ve.__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(Ve,"__esModule",{value:!0});Ve.animationFrameProvider=void 0;var A5=Pe();Ve.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=Ve.animationFrameProvider.delegate;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);var i=e(function(o){r=void 0,t(o)});return new A5.Subscription(function(){return r?.(i)})},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ve.animationFrameProvider.delegate;return(r?.requestAnimationFrame||requestAnimationFrame).apply(void 0,Iv([],Tv(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ve.animationFrameProvider.delegate;return(r?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,Iv([],Tv(t)))},delegate:void 0}});var qv=d(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.animationFrames=void 0;var F5=V(),T5=Fv(),Pv=hd();function I5(t){return t?jv(t):P5}Ga.animationFrames=I5;function jv(t){return new F5.Observable(function(e){var r=t||T5.performanceTimestampProvider,n=r.now(),i=0,o=function(){e.closed||(i=Pv.animationFrameProvider.requestAnimationFrame(function(a){i=0;var s=r.now();e.next({timestamp:t?s:a,elapsed:s-n}),o()}))};return o(),function(){i&&Pv.animationFrameProvider.cancelAnimationFrame(i)}})}var P5=jv()});var md=d($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.ObjectUnsubscribedError=void 0;var j5=Gt();$a.ObjectUnsubscribedError=j5.createErrorClass(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var ve=d(lt=>{"use strict";var kv=lt&&lt.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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)}})(),q5=lt&&lt.__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(lt,"__esModule",{value:!0});lt.AnonymousSubject=lt.Subject=void 0;var Mv=V(),gd=Pe(),M5=md(),k5=St(),vd=ka(),Lv=(function(t){kv(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 bd(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new M5.ObjectUnsubscribedError},e.prototype.next=function(r){var n=this;vd.errorContext(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=q5(n.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;vd.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;vd.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,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?gd.EMPTY_SUBSCRIPTION:(this.currentObservers=null,s.push(r),new gd.Subscription(function(){n.currentObservers=null,k5.arrRemove(s,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,a=n.isStopped;i?r.error(o):a&&r.complete()},e.prototype.asObservable=function(){var r=new Mv.Observable;return r.source=this,r},e.create=function(r,n){return new bd(r,n)},e})(Mv.Observable);lt.Subject=Lv;var bd=(function(t){kv(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:gd.EMPTY_SUBSCRIPTION},e})(Lv);lt.AnonymousSubject=bd});var _d=d(bn=>{"use strict";var L5=bn&&bn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(bn,"__esModule",{value:!0});bn.BehaviorSubject=void 0;var R5=ve(),B5=(function(t){L5(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,o=r._value;if(n)throw i;return this._throwIfClosed(),o},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e})(R5.Subject);bn.BehaviorSubject=B5});var Va=d(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.dateTimestampProvider=void 0;oo.dateTimestampProvider={now:function(){return(oo.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var Ka=d(_n=>{"use strict";var N5=_n&&_n.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(_n,"__esModule",{value:!0});_n.ReplaySubject=void 0;var U5=ve(),G5=Va(),$5=(function(t){N5(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=G5.dateTimestampProvider);var o=t.call(this)||this;return o._bufferSize=r,o._windowTime=n,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,r),o._windowTime=Math.max(1,n),o}return e.prototype.next=function(r){var n=this,i=n.isStopped,o=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,u=n._windowTime;i||(o.push(r),!a&&o.push(s.now()+u)),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,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!r.closed;u+=o?1:2)r.next(s[u]);return this._checkFinalizedStatuses(r),n},e.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,i=r._timestampProvider,o=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),c=0,l=1;l<o.length&&o[l]<=u;l+=2)c=l;c&&o.splice(0,c+1)}},e})(U5.Subject);_n.ReplaySubject=$5});var Wa=d(yn=>{"use strict";var V5=yn&&yn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(yn,"__esModule",{value:!0});yn.AsyncSubject=void 0;var K5=ve(),W5=(function(t){V5(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,o=n._hasValue,a=n._value,s=n.thrownError,u=n.isStopped,c=n._isComplete;i?r.error(s):(u||c)&&(o&&r.next(a),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,o=r._isComplete;o||(this._isComplete=!0,n&&t.prototype.next.call(this,i),t.prototype.complete.call(this))},e})(K5.Subject);yn.AsyncSubject=W5});var Rv=d(Dn=>{"use strict";var z5=Dn&&Dn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(Dn,"__esModule",{value:!0});Dn.Action=void 0;var H5=Pe(),Y5=(function(t){z5(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})(H5.Subscription);Dn.Action=Y5});var Uv=d(ft=>{"use strict";var Bv=ft&&ft.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Nv=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.intervalProvider=void 0;ft.intervalProvider={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=ft.intervalProvider.delegate;return i?.setInterval?i.setInterval.apply(i,Nv([t,e],Bv(r))):setInterval.apply(void 0,Nv([t,e],Bv(r)))},clearInterval:function(t){var e=ft.intervalProvider.delegate;return(e?.clearInterval||clearInterval)(t)},delegate:void 0}});var En=d(Sn=>{"use strict";var J5=Sn&&Sn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(Sn,"__esModule",{value:!0});Sn.AsyncAction=void 0;var X5=Rv(),Gv=Uv(),Q5=St(),Z5=(function(t){J5(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 o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Gv.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&&Gv.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,o;try{this.work(r)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Q5.arrRemove(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e})(X5.Action);Sn.AsyncAction=Z5});var Vv=d(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.TestTools=wn.Immediate=void 0;var e4=1,yd,za={};function $v(t){return t in za?(delete za[t],!0):!1}wn.Immediate={setImmediate:function(t){var e=e4++;return za[e]=!0,yd||(yd=Promise.resolve()),yd.then(function(){return $v(e)&&t()}),e},clearImmediate:function(t){$v(t)}};wn.TestTools={pending:function(){return Object.keys(za).length}}});var Wv=d(dt=>{"use strict";var t4=dt&&dt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},r4=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.immediateProvider=void 0;var Kv=Vv(),n4=Kv.Immediate.setImmediate,i4=Kv.Immediate.clearImmediate;dt.immediateProvider={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=dt.immediateProvider.delegate;return(r?.setImmediate||n4).apply(void 0,r4([],t4(t)))},clearImmediate:function(t){var e=dt.immediateProvider.delegate;return(e?.clearImmediate||i4)(t)},delegate:void 0}});var Hv=d(On=>{"use strict";var o4=On&&On.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(On,"__esModule",{value:!0});On.AsapAction=void 0;var a4=En(),zv=Wv(),s4=(function(t){o4(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=zv.immediateProvider.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){var o;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var a=r.actions;n!=null&&((o=a[a.length-1])===null||o===void 0?void 0:o.id)!==n&&(zv.immediateProvider.clearImmediate(n),r._scheduled===n&&(r._scheduled=void 0))},e})(a4.AsyncAction);On.AsapAction=s4});var Dd=d(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.Scheduler=void 0;var u4=Va(),c4=(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=u4.dateTimestampProvider.now,t})();Ha.Scheduler=c4});var An=d(Cn=>{"use strict";var l4=Cn&&Cn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(Cn,"__esModule",{value:!0});Cn.AsyncScheduler=void 0;var Yv=Dd(),f4=(function(t){l4(e,t);function e(r,n){n===void 0&&(n=Yv.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})(Yv.Scheduler);Cn.AsyncScheduler=f4});var Jv=d(Fn=>{"use strict";var d4=Fn&&Fn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(Fn,"__esModule",{value:!0});Fn.AsapScheduler=void 0;var p4=An(),x4=(function(t){d4(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,o;r=r||i.shift();do if(o=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,o){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw o}},e})(p4.AsyncScheduler);Fn.AsapScheduler=x4});var Xv=d(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.asap=kr.asapScheduler=void 0;var h4=Hv(),m4=Jv();kr.asapScheduler=new m4.AsapScheduler(h4.AsapAction);kr.asap=kr.asapScheduler});var Oe=d(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.async=Lr.asyncScheduler=void 0;var v4=En(),g4=An();Lr.asyncScheduler=new g4.AsyncScheduler(v4.AsyncAction);Lr.async=Lr.asyncScheduler});var Qv=d(Tn=>{"use strict";var b4=Tn&&Tn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(Tn,"__esModule",{value:!0});Tn.QueueAction=void 0;var _4=En(),y4=(function(t){b4(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})(_4.AsyncAction);Tn.QueueAction=y4});var Zv=d(In=>{"use strict";var D4=In&&In.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(In,"__esModule",{value:!0});In.QueueScheduler=void 0;var S4=An(),E4=(function(t){D4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(S4.AsyncScheduler);In.QueueScheduler=E4});var eg=d(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.queue=Rr.queueScheduler=void 0;var w4=Qv(),O4=Zv();Rr.queueScheduler=new O4.QueueScheduler(w4.QueueAction);Rr.queue=Rr.queueScheduler});var rg=d(Pn=>{"use strict";var C4=Pn&&Pn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(Pn,"__esModule",{value:!0});Pn.AnimationFrameAction=void 0;var A4=En(),tg=hd(),F4=(function(t){C4(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=tg.animationFrameProvider.requestAnimationFrame(function(){return r.flush(void 0)})))},e.prototype.recycleAsyncId=function(r,n,i){var o;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var a=r.actions;n!=null&&n===r._scheduled&&((o=a[a.length-1])===null||o===void 0?void 0:o.id)!==n&&(tg.animationFrameProvider.cancelAnimationFrame(n),r._scheduled=void 0)},e})(A4.AsyncAction);Pn.AnimationFrameAction=F4});var ng=d(jn=>{"use strict";var T4=jn&&jn.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(jn,"__esModule",{value:!0});jn.AnimationFrameScheduler=void 0;var I4=An(),P4=(function(t){T4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n;r?n=r.id:(n=this._scheduled,this._scheduled=void 0);var i=this.actions,o;r=r||i.shift();do if(o=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,o){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw o}},e})(I4.AsyncScheduler);jn.AnimationFrameScheduler=P4});var ig=d(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.animationFrame=Br.animationFrameScheduler=void 0;var j4=rg(),q4=ng();Br.animationFrameScheduler=new q4.AnimationFrameScheduler(j4.AnimationFrameAction);Br.animationFrame=Br.animationFrameScheduler});var sg=d(Vt=>{"use strict";var og=Vt&&Vt.__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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},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(Vt,"__esModule",{value:!0});Vt.VirtualAction=Vt.VirtualTimeScheduler=void 0;var M4=En(),k4=Pe(),L4=An(),R4=(function(t){og(e,t);function e(r,n){r===void 0&&(r=ag),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,o,a;(a=n[0])&&a.delay<=i&&(n.shift(),this.frame=a.delay,!(o=a.execute(a.state,a.delay))););if(o){for(;a=n.shift();)a.unsubscribe();throw o}},e.frameTimeFactor=10,e})(L4.AsyncScheduler);Vt.VirtualTimeScheduler=R4;var ag=(function(t){og(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var o=t.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.index=i,o.active=!0,o.index=r.index=i,o}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 k4.Subscription.EMPTY},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var o=r.actions;return o.push(this),o.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})(M4.AsyncAction);Vt.VirtualAction=ag});var Ke=d(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.empty=Nr.EMPTY=void 0;var ug=V();Nr.EMPTY=new ug.Observable(function(t){return t.complete()});function B4(t){return t?N4(t):Nr.EMPTY}Nr.empty=B4;function N4(t){return new ug.Observable(function(e){return t.schedule(function(){return e.complete()})})}});var ao=d(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.isScheduler=void 0;var U4=$();function G4(t){return t&&U4.isFunction(t.schedule)}Ya.isScheduler=G4});var Ce=d(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.popNumber=Kt.popScheduler=Kt.popResultSelector=void 0;var $4=$(),V4=ao();function Sd(t){return t[t.length-1]}function K4(t){return $4.isFunction(Sd(t))?t.pop():void 0}Kt.popResultSelector=K4;function W4(t){return V4.isScheduler(Sd(t))?t.pop():void 0}Kt.popScheduler=W4;function z4(t,e){return typeof Sd(t)=="number"?t.pop():e}Kt.popNumber=z4});var Xa=d(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.isArrayLike=void 0;Ja.isArrayLike=(function(t){return t&&typeof t.length=="number"&&typeof t!="function"})});var Ed=d(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.isPromise=void 0;var H4=$();function Y4(t){return H4.isFunction(t?.then)}Qa.isPromise=Y4});var wd=d(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.isInteropObservable=void 0;var J4=to(),X4=$();function Q4(t){return X4.isFunction(t[J4.observable])}Za.isInteropObservable=Q4});var Od=d(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.isAsyncIterable=void 0;var Z4=$();function ew(t){return Symbol.asyncIterator&&Z4.isFunction(t?.[Symbol.asyncIterator])}es.isAsyncIterable=ew});var Cd=d(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.createInvalidObservableTypeError=void 0;function tw(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.")}ts.createInvalidObservableTypeError=tw});var Ad=d(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.iterator=qn.getSymbolIterator=void 0;function cg(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}qn.getSymbolIterator=cg;qn.iterator=cg()});var Fd=d(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.isIterable=void 0;var rw=Ad(),nw=$();function iw(t){return nw.isFunction(t?.[rw.iterator])}rs.isIterable=iw});var ns=d(Ne=>{"use strict";var ow=Ne&&Ne.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Mn=Ne&&Ne.__await||function(t){return this instanceof Mn?(this.v=t,this):new Mn(t)},aw=Ne&&Ne.__asyncGenerator||function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(x){n[x]&&(i[x]=function(h){return new Promise(function(g,b){o.push([x,h,g,b])>1||s(x,h)})})}function s(x,h){try{u(n[x](h))}catch(g){p(o[0][3],g)}}function u(x){x.value instanceof Mn?Promise.resolve(x.value.v).then(c,l):p(o[0][2],x)}function c(x){s("next",x)}function l(x){s("throw",x)}function p(x,h){x(h),o.shift(),o.length&&s(o[0][0],o[0][1])}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.isReadableStreamLike=Ne.readableStreamLikeToAsyncGenerator=void 0;var sw=$();function uw(t){return aw(this,arguments,function(){var r,n,i,o;return ow(this,function(a){switch(a.label){case 0:r=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Mn(r.read())];case 3:return n=a.sent(),i=n.value,o=n.done,o?[4,Mn(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Mn(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}Ne.readableStreamLikeToAsyncGenerator=uw;function cw(t){return sw.isFunction(t?.getReader)}Ne.isReadableStreamLike=cw});var k=d(Z=>{"use strict";var lw=Z&&Z.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})},fw=Z&&Z.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},dw=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 Td=="function"?Td(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(c){o({value:c,done:s})},a)}},Td=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 pw=Xa(),xw=Ed(),kn=V(),hw=wd(),mw=Od(),vw=Cd(),gw=Fd(),lg=ns(),bw=$(),_w=sd(),yw=to();function Dw(t){if(t instanceof kn.Observable)return t;if(t!=null){if(hw.isInteropObservable(t))return fg(t);if(pw.isArrayLike(t))return dg(t);if(xw.isPromise(t))return pg(t);if(mw.isAsyncIterable(t))return Id(t);if(gw.isIterable(t))return xg(t);if(lg.isReadableStreamLike(t))return hg(t)}throw vw.createInvalidObservableTypeError(t)}Z.innerFrom=Dw;function fg(t){return new kn.Observable(function(e){var r=t[yw.observable]();if(bw.isFunction(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}Z.fromInteropObservable=fg;function dg(t){return new kn.Observable(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}Z.fromArrayLike=dg;function pg(t){return new kn.Observable(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,_w.reportUnhandledError)})}Z.fromPromise=pg;function xg(t){return new kn.Observable(function(e){var r,n;try{for(var i=Td(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}Z.fromIterable=xg;function Id(t){return new kn.Observable(function(e){Sw(t,e).catch(function(r){return e.error(r)})})}Z.fromAsyncIterable=Id;function hg(t){return Id(lg.readableStreamLikeToAsyncGenerator(t))}Z.fromReadableStreamLike=hg;function Sw(t,e){var r,n,i,o;return lw(this,void 0,void 0,function(){var a,s;return fw(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=dw(t),u.label=1;case 1:return[4,r.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:u.sent(),u.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 Et=d(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.executeSchedule=void 0;function Ew(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(o),!i)return o}is.executeSchedule=Ew});var so=d(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.observeOn=void 0;var Pd=Et(),ww=D(),Ow=O();function Cw(t,e){return e===void 0&&(e=0),ww.operate(function(r,n){r.subscribe(Ow.createOperatorSubscriber(n,function(i){return Pd.executeSchedule(n,t,function(){return n.next(i)},e)},function(){return Pd.executeSchedule(n,t,function(){return n.complete()},e)},function(i){return Pd.executeSchedule(n,t,function(){return n.error(i)},e)}))})}os.observeOn=Cw});var uo=d(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.subscribeOn=void 0;var Aw=D();function Fw(t,e){return e===void 0&&(e=0),Aw.operate(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}as.subscribeOn=Fw});var mg=d(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.scheduleObservable=void 0;var Tw=k(),Iw=so(),Pw=uo();function jw(t,e){return Tw.innerFrom(t).pipe(Pw.subscribeOn(e),Iw.observeOn(e))}ss.scheduleObservable=jw});var vg=d(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.schedulePromise=void 0;var qw=k(),Mw=so(),kw=uo();function Lw(t,e){return qw.innerFrom(t).pipe(kw.subscribeOn(e),Mw.observeOn(e))}us.schedulePromise=Lw});var gg=d(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.scheduleArray=void 0;var Rw=V();function Bw(t,e){return new Rw.Observable(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}cs.scheduleArray=Bw});var jd=d(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.scheduleIterable=void 0;var Nw=V(),Uw=Ad(),Gw=$(),bg=Et();function $w(t,e){return new Nw.Observable(function(r){var n;return bg.executeSchedule(r,e,function(){n=t[Uw.iterator](),bg.executeSchedule(r,e,function(){var i,o,a;try{i=n.next(),o=i.value,a=i.done}catch(s){r.error(s);return}a?r.complete():r.next(o)},0,!0)}),function(){return Gw.isFunction(n?.return)&&n.return()}})}ls.scheduleIterable=$w});var qd=d(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.scheduleAsyncIterable=void 0;var Vw=V(),_g=Et();function Kw(t,e){if(!t)throw new Error("Iterable cannot be null");return new Vw.Observable(function(r){_g.executeSchedule(r,e,function(){var n=t[Symbol.asyncIterator]();_g.executeSchedule(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}fs.scheduleAsyncIterable=Kw});var yg=d(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.scheduleReadableStreamLike=void 0;var Ww=qd(),zw=ns();function Hw(t,e){return Ww.scheduleAsyncIterable(zw.readableStreamLikeToAsyncGenerator(t),e)}ds.scheduleReadableStreamLike=Hw});var Md=d(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.scheduled=void 0;var Yw=mg(),Jw=vg(),Xw=gg(),Qw=jd(),Zw=qd(),eO=wd(),tO=Ed(),rO=Xa(),nO=Fd(),iO=Od(),oO=Cd(),aO=ns(),sO=yg();function uO(t,e){if(t!=null){if(eO.isInteropObservable(t))return Yw.scheduleObservable(t,e);if(rO.isArrayLike(t))return Xw.scheduleArray(t,e);if(tO.isPromise(t))return Jw.schedulePromise(t,e);if(iO.isAsyncIterable(t))return Zw.scheduleAsyncIterable(t,e);if(nO.isIterable(t))return Qw.scheduleIterable(t,e);if(aO.isReadableStreamLike(t))return sO.scheduleReadableStreamLike(t,e)}throw oO.createInvalidObservableTypeError(t)}ps.scheduled=uO});var wt=d(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.from=void 0;var cO=Md(),lO=k();function fO(t,e){return e?cO.scheduled(t,e):lO.innerFrom(t)}xs.from=fO});var ms=d(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.of=void 0;var dO=Ce(),pO=wt();function xO(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=dO.popScheduler(t);return pO.from(t,r)}hs.of=xO});var kd=d(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.throwError=void 0;var hO=V(),mO=$();function vO(t,e){var r=mO.isFunction(t)?t:function(){return t},n=function(i){return i.error(r())};return new hO.Observable(e?function(i){return e.schedule(n,0,i)}:n)}vs.throwError=vO});var gs=d(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.observeNotification=Ot.Notification=Ot.NotificationKind=void 0;var gO=Ke(),bO=ms(),_O=kd(),yO=$(),DO;(function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"})(DO=Ot.NotificationKind||(Ot.NotificationKind={}));var SO=(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 Dg(this,e)},t.prototype.do=function(e,r,n){var i=this,o=i.kind,a=i.value,s=i.error;return o==="N"?e?.(a):o==="E"?r?.(s):n?.()},t.prototype.accept=function(e,r,n){var i;return yO.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,o=r==="N"?bO.of(n):r==="E"?_O.throwError(function(){return i}):r==="C"?gO.EMPTY:0;if(!o)throw new TypeError("Unexpected notification kind "+r);return o},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})();Ot.Notification=SO;function Dg(t,e){var r,n,i,o=t,a=o.kind,s=o.value,u=o.error;if(typeof a!="string")throw new TypeError('Invalid notification, missing "kind"');a==="N"?(r=e.next)===null||r===void 0||r.call(e,s):a==="E"?(n=e.error)===null||n===void 0||n.call(e,u):(i=e.complete)===null||i===void 0||i.call(e)}Ot.observeNotification=Dg});var Eg=d(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.isObservable=void 0;var EO=V(),Sg=$();function wO(t){return!!t&&(t instanceof EO.Observable||Sg.isFunction(t.lift)&&Sg.isFunction(t.subscribe))}bs.isObservable=wO});var Wt=d(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.EmptyError=void 0;var OO=Gt();_s.EmptyError=OO.createErrorClass(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})});var wg=d(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.lastValueFrom=void 0;var CO=Wt();function AO(t,e){var r=typeof e=="object";return new Promise(function(n,i){var o=!1,a;t.subscribe({next:function(s){a=s,o=!0},error:i,complete:function(){o?n(a):r?n(e.defaultValue):i(new CO.EmptyError)}})})}ys.lastValueFrom=AO});var Og=d(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.firstValueFrom=void 0;var FO=Wt(),TO=hn();function IO(t,e){var r=typeof e=="object";return new Promise(function(n,i){var o=new TO.SafeSubscriber({next:function(a){n(a),o.unsubscribe()},error:i,complete:function(){r?n(e.defaultValue):i(new FO.EmptyError)}});t.subscribe(o)})}Ds.firstValueFrom=IO});var Ld=d(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.ArgumentOutOfRangeError=void 0;var PO=Gt();Ss.ArgumentOutOfRangeError=PO.createErrorClass(function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var Rd=d(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.NotFoundError=void 0;var jO=Gt();Es.NotFoundError=jO.createErrorClass(function(t){return function(r){t(this),this.name="NotFoundError",this.message=r}})});var Bd=d(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.SequenceError=void 0;var qO=Gt();ws.SequenceError=qO.createErrorClass(function(t){return function(r){t(this),this.name="SequenceError",this.message=r}})});var Cs=d(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.isValidDate=void 0;function MO(t){return t instanceof Date&&!isNaN(t)}Os.isValidDate=MO});var As=d(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.timeout=Ur.TimeoutError=void 0;var kO=Oe(),LO=Cs(),RO=D(),BO=k(),NO=Gt(),UO=O(),GO=Et();Ur.TimeoutError=NO.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 $O(t,e){var r=LO.isValidDate(t)?{first:t}:typeof t=="number"?{each:t}:t,n=r.first,i=r.each,o=r.with,a=o===void 0?VO:o,s=r.scheduler,u=s===void 0?e??kO.asyncScheduler:s,c=r.meta,l=c===void 0?null:c;if(n==null&&i==null)throw new TypeError("No timeout provided.");return RO.operate(function(p,x){var h,g,b=null,m=0,v=function(_){g=GO.executeSchedule(x,u,function(){try{h.unsubscribe(),BO.innerFrom(a({meta:l,lastValue:b,seen:m})).subscribe(x)}catch(y){x.error(y)}},_)};h=p.subscribe(UO.createOperatorSubscriber(x,function(_){g?.unsubscribe(),m++,x.next(b=_),i>0&&v(i)},void 0,void 0,function(){g?.closed||g?.unsubscribe(),b=null})),!m&&v(n!=null?typeof n=="number"?n:+n-u.now():i)})}Ur.timeout=$O;function VO(t){throw new Ur.TimeoutError(t)}});var zt=d(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.map=void 0;var KO=D(),WO=O();function zO(t,e){return KO.operate(function(r,n){var i=0;r.subscribe(WO.createOperatorSubscriber(n,function(o){n.next(t.call(e,o,i++))}))})}Fs.map=zO});var Yt=d(Ht=>{"use strict";var HO=Ht&&Ht.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},YO=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.mapOneOrManyArgs=void 0;var JO=zt(),XO=Array.isArray;function QO(t,e){return XO(e)?t.apply(void 0,YO([],HO(e))):t(e)}function ZO(t){return JO.map(function(e){return QO(t,e)})}Ht.mapOneOrManyArgs=ZO});var Ud=d(Jt=>{"use strict";var e7=Jt&&Jt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Cg=Jt&&Jt.__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(Jt,"__esModule",{value:!0});Jt.bindCallbackInternals=void 0;var t7=ao(),r7=V(),n7=uo(),i7=Yt(),o7=so(),a7=Wa();function Nd(t,e,r,n){if(r)if(t7.isScheduler(r))n=r;else return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return Nd(t,e,n).apply(this,i).pipe(i7.mapOneOrManyArgs(r))};return n?function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return Nd(t,e).apply(this,i).pipe(n7.subscribeOn(n),o7.observeOn(n))}:function(){for(var i=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=new a7.AsyncSubject,u=!0;return new r7.Observable(function(c){var l=s.subscribe(c);if(u){u=!1;var p=!1,x=!1;e.apply(i,Cg(Cg([],e7(o)),[function(){for(var h=[],g=0;g<arguments.length;g++)h[g]=arguments[g];if(t){var b=h.shift();if(b!=null){s.error(b);return}}s.next(1<h.length?h:h[0]),x=!0,p&&s.complete()}])),x&&s.complete(),p=!0}return l})}}Jt.bindCallbackInternals=Nd});var Ag=d(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.bindCallback=void 0;var s7=Ud();function u7(t,e,r){return s7.bindCallbackInternals(!1,t,e,r)}Ts.bindCallback=u7});var Fg=d(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.bindNodeCallback=void 0;var c7=Ud();function l7(t,e,r){return c7.bindCallbackInternals(!0,t,e,r)}Is.bindNodeCallback=l7});var Gd=d(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.argsArgArrayOrObject=void 0;var f7=Array.isArray,d7=Object.getPrototypeOf,p7=Object.prototype,x7=Object.keys;function h7(t){if(t.length===1){var e=t[0];if(f7(e))return{args:e,keys:null};if(m7(e)){var r=x7(e);return{args:r.map(function(n){return e[n]}),keys:r}}}return{args:t,keys:null}}Ps.argsArgArrayOrObject=h7;function m7(t){return t&&typeof t=="object"&&d7(t)===p7}});var $d=d(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.createObject=void 0;function v7(t,e){return t.reduce(function(r,n,i){return r[n]=e[i],r},{})}js.createObject=v7});var qs=d(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.combineLatestInit=Ln.combineLatest=void 0;var g7=V(),b7=Gd(),Pg=wt(),jg=me(),_7=Yt(),Tg=Ce(),y7=$d(),D7=O(),S7=Et();function E7(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Tg.popScheduler(t),n=Tg.popResultSelector(t),i=b7.argsArgArrayOrObject(t),o=i.args,a=i.keys;if(o.length===0)return Pg.from([],r);var s=new g7.Observable(qg(o,r,a?function(u){return y7.createObject(a,u)}:jg.identity));return n?s.pipe(_7.mapOneOrManyArgs(n)):s}Ln.combineLatest=E7;function qg(t,e,r){return r===void 0&&(r=jg.identity),function(n){Ig(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(l){Ig(e,function(){var p=Pg.from(t[l],e),x=!1;p.subscribe(D7.createOperatorSubscriber(n,function(h){o[l]=h,x||(x=!0,s--),s||n.next(r(o.slice()))},function(){--a||n.complete()}))},n)},c=0;c<i;c++)u(c)},n)}}Ln.combineLatestInit=qg;function Ig(t,e,r){t?S7.executeSchedule(r,t,e):e()}});var ks=d(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.mergeInternals=void 0;var w7=k(),O7=Et(),Mg=O();function C7(t,e,r,n,i,o,a,s){var u=[],c=0,l=0,p=!1,x=function(){p&&!u.length&&!c&&e.complete()},h=function(b){return c<n?g(b):u.push(b)},g=function(b){o&&e.next(b),c++;var m=!1;w7.innerFrom(r(b,l++)).subscribe(Mg.createOperatorSubscriber(e,function(v){i?.(v),o?h(v):e.next(v)},function(){m=!0},void 0,function(){if(m)try{c--;for(var v=function(){var _=u.shift();a?O7.executeSchedule(e,a,function(){return g(_)}):g(_)};u.length&&c<n;)v();x()}catch(_){e.error(_)}}))};return t.subscribe(Mg.createOperatorSubscriber(e,h,function(){p=!0,x()})),function(){s?.()}}Ms.mergeInternals=C7});var Ct=d(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.mergeMap=void 0;var A7=zt(),F7=k(),T7=D(),I7=ks(),P7=$();function kg(t,e,r){return r===void 0&&(r=1/0),P7.isFunction(e)?kg(function(n,i){return A7.map(function(o,a){return e(n,o,i,a)})(F7.innerFrom(t(n,i)))},r):(typeof e=="number"&&(r=e),T7.operate(function(n,i){return I7.mergeInternals(n,i,t,r)}))}Ls.mergeMap=kg});var co=d(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.mergeAll=void 0;var j7=Ct(),q7=me();function M7(t){return t===void 0&&(t=1/0),j7.mergeMap(q7.identity,t)}Rs.mergeAll=M7});var Ns=d(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.concatAll=void 0;var k7=co();function L7(){return k7.mergeAll(1)}Bs.concatAll=L7});var lo=d(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.concat=void 0;var R7=Ns(),B7=Ce(),N7=wt();function U7(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return R7.concatAll()(N7.from(t,B7.popScheduler(t)))}Us.concat=U7});var fo=d(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.defer=void 0;var G7=V(),$7=k();function V7(t){return new G7.Observable(function(e){$7.innerFrom(t()).subscribe(e)})}Gs.defer=V7});var Lg=d($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.connectable=void 0;var K7=ve(),W7=V(),z7=fo(),H7={connector:function(){return new K7.Subject},resetOnDisconnect:!0};function Y7(t,e){e===void 0&&(e=H7);var r=null,n=e.connector,i=e.resetOnDisconnect,o=i===void 0?!0:i,a=n(),s=new W7.Observable(function(u){return a.subscribe(u)});return s.connect=function(){return(!r||r.closed)&&(r=z7.defer(function(){return t}).subscribe(a),o&&r.add(function(){return a=n()})),r},s}$s.connectable=Y7});var Rg=d(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.forkJoin=void 0;var J7=V(),X7=Gd(),Q7=k(),Z7=Ce(),eC=O(),tC=Yt(),rC=$d();function nC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Z7.popResultSelector(t),n=X7.argsArgArrayOrObject(t),i=n.args,o=n.keys,a=new J7.Observable(function(s){var u=i.length;if(!u){s.complete();return}for(var c=new Array(u),l=u,p=u,x=function(g){var b=!1;Q7.innerFrom(i[g]).subscribe(eC.createOperatorSubscriber(s,function(m){b||(b=!0,p--),c[g]=m},function(){return l--},void 0,function(){(!l||!b)&&(p||s.next(o?rC.createObject(o,c):c),s.complete())}))},h=0;h<u;h++)x(h)});return r?a.pipe(tC.mapOneOrManyArgs(r)):a}Vs.forkJoin=nC});var Ng=d(Rn=>{"use strict";var iC=Rn&&Rn.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.fromEvent=void 0;var oC=k(),aC=V(),sC=Ct(),uC=Xa(),Gr=$(),cC=Yt(),lC=["addListener","removeListener"],fC=["addEventListener","removeEventListener"],dC=["on","off"];function Vd(t,e,r,n){if(Gr.isFunction(r)&&(n=r,r=void 0),n)return Vd(t,e,r).pipe(cC.mapOneOrManyArgs(n));var i=iC(hC(t)?fC.map(function(s){return function(u){return t[s](e,u,r)}}):pC(t)?lC.map(Bg(t,e)):xC(t)?dC.map(Bg(t,e)):[],2),o=i[0],a=i[1];if(!o&&uC.isArrayLike(t))return sC.mergeMap(function(s){return Vd(s,e,r)})(oC.innerFrom(t));if(!o)throw new TypeError("Invalid event target");return new aC.Observable(function(s){var u=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return s.next(1<c.length?c:c[0])};return o(u),function(){return a(u)}})}Rn.fromEvent=Vd;function Bg(t,e){return function(r){return function(n){return t[r](e,n)}}}function pC(t){return Gr.isFunction(t.addListener)&&Gr.isFunction(t.removeListener)}function xC(t){return Gr.isFunction(t.on)&&Gr.isFunction(t.off)}function hC(t){return Gr.isFunction(t.addEventListener)&&Gr.isFunction(t.removeEventListener)}});var Gg=d(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.fromEventPattern=void 0;var mC=V(),vC=$(),gC=Yt();function Ug(t,e,r){return r?Ug(t,e).pipe(gC.mapOneOrManyArgs(r)):new mC.Observable(function(n){var i=function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return n.next(a.length===1?a[0]:a)},o=t(i);return vC.isFunction(e)?function(){return e(i,o)}:void 0})}Ks.fromEventPattern=Ug});var Vg=d(Bn=>{"use strict";var bC=Bn&&Bn.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.generate=void 0;var $g=me(),_C=ao(),yC=fo(),DC=jd();function SC(t,e,r,n,i){var o,a,s,u;arguments.length===1?(o=t,u=o.initialState,e=o.condition,r=o.iterate,a=o.resultSelector,s=a===void 0?$g.identity:a,i=o.scheduler):(u=t,!n||_C.isScheduler(n)?(s=$g.identity,i=n):s=n);function c(){var l;return bC(this,function(p){switch(p.label){case 0:l=u,p.label=1;case 1:return!e||e(l)?[4,s(l)]:[3,4];case 2:p.sent(),p.label=3;case 3:return l=r(l),[3,1];case 4:return[2]}})}return yC.defer(i?function(){return DC.scheduleIterable(c(),i)}:c)}Bn.generate=SC});var Kg=d(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.iif=void 0;var EC=fo();function wC(t,e,r){return EC.defer(function(){return t()?e:r})}Ws.iif=wC});var Xt=d(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.timer=void 0;var OC=V(),CC=Oe(),AC=ao(),FC=Cs();function TC(t,e,r){t===void 0&&(t=0),r===void 0&&(r=CC.async);var n=-1;return e!=null&&(AC.isScheduler(e)?r=e:n=e),new OC.Observable(function(i){var o=FC.isValidDate(t)?+t-r.now():t;o<0&&(o=0);var a=0;return r.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},o)})}zs.timer=TC});var Kd=d(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.interval=void 0;var IC=Oe(),PC=Xt();function jC(t,e){return t===void 0&&(t=0),e===void 0&&(e=IC.asyncScheduler),t<0&&(t=0),PC.timer(t,t,e)}Hs.interval=jC});var zg=d(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.merge=void 0;var qC=co(),MC=k(),kC=Ke(),Wg=Ce(),LC=wt();function RC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Wg.popScheduler(t),n=Wg.popNumber(t,1/0),i=t;return i.length?i.length===1?MC.innerFrom(i[0]):qC.mergeAll(n)(LC.from(i,r)):kC.EMPTY}Ys.merge=RC});var Wd=d($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.never=$r.NEVER=void 0;var BC=V(),NC=he();$r.NEVER=new BC.Observable(NC.noop);function UC(){return $r.NEVER}$r.never=UC});var Nn=d(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.argsOrArgArray=void 0;var GC=Array.isArray;function $C(t){return t.length===1&&GC(t[0])?t[0]:t}Js.argsOrArgArray=$C});var zd=d(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.onErrorResumeNext=void 0;var VC=V(),KC=Nn(),WC=O(),Hg=he(),zC=k();function HC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=KC.argsOrArgArray(t);return new VC.Observable(function(n){var i=0,o=function(){if(i<r.length){var a=void 0;try{a=zC.innerFrom(r[i++])}catch{o();return}var s=new WC.OperatorSubscriber(n,void 0,Hg.noop,Hg.noop);a.subscribe(s),s.add(o)}else n.complete()};o()})}Xs.onErrorResumeNext=HC});var Yg=d(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.pairs=void 0;var YC=wt();function JC(t,e){return YC.from(Object.entries(t),e)}Qs.pairs=JC});var Jg=d(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.not=void 0;function XC(t,e){return function(r,n){return!t.call(e,r,n)}}Zs.not=XC});var Vr=d(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.filter=void 0;var QC=D(),ZC=O();function e3(t,e){return QC.operate(function(r,n){var i=0;r.subscribe(ZC.createOperatorSubscriber(n,function(o){return t.call(e,o,i++)&&n.next(o)}))})}eu.filter=e3});var Zg=d(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.partition=void 0;var t3=Jg(),Xg=Vr(),Qg=k();function r3(t,e,r){return[Xg.filter(e,r)(Qg.innerFrom(t)),Xg.filter(t3.not(e,r))(Qg.innerFrom(t))]}tu.partition=r3});var Hd=d(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.raceInit=Un.race=void 0;var n3=V(),eb=k(),i3=Nn(),o3=O();function a3(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t=i3.argsOrArgArray(t),t.length===1?eb.innerFrom(t[0]):new n3.Observable(tb(t))}Un.race=a3;function tb(t){return function(e){for(var r=[],n=function(o){r.push(eb.innerFrom(t[o]).subscribe(o3.createOperatorSubscriber(e,function(a){if(r){for(var s=0;s<r.length;s++)s!==o&&r[s].unsubscribe();r=null}e.next(a)})))},i=0;r&&!e.closed&&i<t.length;i++)n(i)}}Un.raceInit=tb});var rb=d(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.range=void 0;var s3=V(),u3=Ke();function c3(t,e,r){if(e==null&&(e=t,t=0),e<=0)return u3.EMPTY;var n=e+t;return new s3.Observable(r?function(i){var o=t;return r.schedule(function(){o<n?(i.next(o++),this.schedule()):i.complete()})}:function(i){for(var o=t;o<n&&!i.closed;)i.next(o++);i.complete()})}ru.range=c3});var nb=d(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.using=void 0;var l3=V(),f3=k(),d3=Ke();function p3(t,e){return new l3.Observable(function(r){var n=t(),i=e(n),o=i?f3.innerFrom(i):d3.EMPTY;return o.subscribe(r),function(){n&&n.unsubscribe()}})}nu.using=p3});var iu=d(Qt=>{"use strict";var x3=Qt&&Qt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},h3=Qt&&Qt.__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(Qt,"__esModule",{value:!0});Qt.zip=void 0;var m3=V(),v3=k(),g3=Nn(),b3=Ke(),_3=O(),y3=Ce();function D3(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=y3.popResultSelector(t),n=g3.argsOrArgArray(t);return n.length?new m3.Observable(function(i){var o=n.map(function(){return[]}),a=n.map(function(){return!1});i.add(function(){o=a=null});for(var s=function(c){v3.innerFrom(n[c]).subscribe(_3.createOperatorSubscriber(i,function(l){if(o[c].push(l),o.every(function(x){return x.length})){var p=o.map(function(x){return x.shift()});i.next(r?r.apply(void 0,h3([],x3(p))):p),o.some(function(x,h){return!x.length&&a[h]})&&i.complete()}},function(){a[c]=!0,!o[c].length&&i.complete()}))},u=0;!i.closed&&u<n.length;u++)s(u);return function(){o=a=null}}):b3.EMPTY}Qt.zip=D3});var ob=d(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0})});var Yd=d(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.audit=void 0;var S3=D(),E3=k(),ab=O();function w3(t){return S3.operate(function(e,r){var n=!1,i=null,o=null,a=!1,s=function(){if(o?.unsubscribe(),o=null,n){n=!1;var c=i;i=null,r.next(c)}a&&r.complete()},u=function(){o=null,a&&r.complete()};e.subscribe(ab.createOperatorSubscriber(r,function(c){n=!0,i=c,o||E3.innerFrom(t(c)).subscribe(o=ab.createOperatorSubscriber(r,s,u))},function(){a=!0,(!n||!o||o.closed)&&r.complete()}))})}ou.audit=w3});var sb=d(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.auditTime=void 0;var O3=Oe(),C3=Yd(),A3=Xt();function F3(t,e){return e===void 0&&(e=O3.asyncScheduler),C3.audit(function(){return A3.timer(t,e)})}au.auditTime=F3});var cb=d(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.buffer=void 0;var T3=D(),I3=he(),ub=O(),P3=k();function j3(t){return T3.operate(function(e,r){var n=[];return e.subscribe(ub.createOperatorSubscriber(r,function(i){return n.push(i)},function(){r.next(n),r.complete()})),P3.innerFrom(t).subscribe(ub.createOperatorSubscriber(r,function(){var i=n;n=[],r.next(i)},I3.noop)),function(){n=null}})}su.buffer=j3});var lb=d(Gn=>{"use strict";var Jd=Gn&&Gn.__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(Gn,"__esModule",{value:!0});Gn.bufferCount=void 0;var q3=D(),M3=O(),k3=St();function L3(t,e){return e===void 0&&(e=null),e=e??t,q3.operate(function(r,n){var i=[],o=0;r.subscribe(M3.createOperatorSubscriber(n,function(a){var s,u,c,l,p=null;o++%e===0&&i.push([]);try{for(var x=Jd(i),h=x.next();!h.done;h=x.next()){var g=h.value;g.push(a),t<=g.length&&(p=p??[],p.push(g))}}catch(v){s={error:v}}finally{try{h&&!h.done&&(u=x.return)&&u.call(x)}finally{if(s)throw s.error}}if(p)try{for(var b=Jd(p),m=b.next();!m.done;m=b.next()){var g=m.value;k3.arrRemove(i,g),n.next(g)}}catch(v){c={error:v}}finally{try{m&&!m.done&&(l=b.return)&&l.call(b)}finally{if(c)throw c.error}}},function(){var a,s;try{for(var u=Jd(i),c=u.next();!c.done;c=u.next()){var l=c.value;n.next(l)}}catch(p){a={error:p}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}n.complete()},void 0,function(){i=null}))})}Gn.bufferCount=L3});var db=d($n=>{"use strict";var R3=$n&&$n.__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($n,"__esModule",{value:!0});$n.bufferTime=void 0;var B3=Pe(),N3=D(),U3=O(),G3=St(),$3=Oe(),V3=Ce(),fb=Et();function K3(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=(e=V3.popScheduler(n))!==null&&e!==void 0?e:$3.asyncScheduler,a=(r=n[0])!==null&&r!==void 0?r:null,s=n[1]||1/0;return N3.operate(function(u,c){var l=[],p=!1,x=function(b){var m=b.buffer,v=b.subs;v.unsubscribe(),G3.arrRemove(l,b),c.next(m),p&&h()},h=function(){if(l){var b=new B3.Subscription;c.add(b);var m=[],v={buffer:m,subs:b};l.push(v),fb.executeSchedule(b,o,function(){return x(v)},t)}};a!==null&&a>=0?fb.executeSchedule(c,o,h,a,!0):p=!0,h();var g=U3.createOperatorSubscriber(c,function(b){var m,v,_=l.slice();try{for(var y=R3(_),A=y.next();!A.done;A=y.next()){var w=A.value,B=w.buffer;B.push(b),s<=B.length&&x(w)}}catch(I){m={error:I}}finally{try{A&&!A.done&&(v=y.return)&&v.call(y)}finally{if(m)throw m.error}}},function(){for(;l?.length;)c.next(l.shift().buffer);g?.unsubscribe(),c.complete(),c.unsubscribe()},void 0,function(){return l=null});u.subscribe(g)})}$n.bufferTime=K3});var hb=d(Vn=>{"use strict";var W3=Vn&&Vn.__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(Vn,"__esModule",{value:!0});Vn.bufferToggle=void 0;var z3=Pe(),H3=D(),pb=k(),Xd=O(),xb=he(),Y3=St();function J3(t,e){return H3.operate(function(r,n){var i=[];pb.innerFrom(t).subscribe(Xd.createOperatorSubscriber(n,function(o){var a=[];i.push(a);var s=new z3.Subscription,u=function(){Y3.arrRemove(i,a),n.next(a),s.unsubscribe()};s.add(pb.innerFrom(e(o)).subscribe(Xd.createOperatorSubscriber(n,u,xb.noop)))},xb.noop)),r.subscribe(Xd.createOperatorSubscriber(n,function(o){var a,s;try{for(var u=W3(i),c=u.next();!c.done;c=u.next()){var l=c.value;l.push(o)}}catch(p){a={error:p}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}},function(){for(;i.length>0;)n.next(i.shift());n.complete()}))})}Vn.bufferToggle=J3});var vb=d(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.bufferWhen=void 0;var X3=D(),Q3=he(),mb=O(),Z3=k();function e9(t){return X3.operate(function(e,r){var n=null,i=null,o=function(){i?.unsubscribe();var a=n;n=[],a&&r.next(a),Z3.innerFrom(t()).subscribe(i=mb.createOperatorSubscriber(r,o,Q3.noop))};o(),e.subscribe(mb.createOperatorSubscriber(r,function(a){return n?.push(a)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}uu.bufferWhen=e9});var bb=d(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.catchError=void 0;var t9=k(),r9=O(),n9=D();function gb(t){return n9.operate(function(e,r){var n=null,i=!1,o;n=e.subscribe(r9.createOperatorSubscriber(r,void 0,void 0,function(a){o=t9.innerFrom(t(a,gb(t)(e))),n?(n.unsubscribe(),n=null,o.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,o.subscribe(r))})}cu.catchError=gb});var Qd=d(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.scanInternals=void 0;var i9=O();function o9(t,e,r,n,i){return function(o,a){var s=r,u=e,c=0;o.subscribe(i9.createOperatorSubscriber(a,function(l){var p=c++;u=s?t(u,l,p):(s=!0,l),n&&a.next(u)},i&&(function(){s&&a.next(u),a.complete()})))}}lu.scanInternals=o9});var Kn=d(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.reduce=void 0;var a9=Qd(),s9=D();function u9(t,e){return s9.operate(a9.scanInternals(t,e,arguments.length>=2,!1,!0))}fu.reduce=u9});var Zd=d(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.toArray=void 0;var c9=Kn(),l9=D(),f9=function(t,e){return t.push(e),t};function d9(){return l9.operate(function(t,e){c9.reduce(f9,[])(t).subscribe(e)})}du.toArray=d9});var ep=d(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.joinAllInternals=void 0;var p9=me(),x9=Yt(),h9=ro(),m9=Ct(),v9=Zd();function g9(t,e){return h9.pipe(v9.toArray(),m9.mergeMap(function(r){return t(r)}),e?x9.mapOneOrManyArgs(e):p9.identity)}pu.joinAllInternals=g9});var tp=d(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.combineLatestAll=void 0;var b9=qs(),_9=ep();function y9(t){return _9.joinAllInternals(b9.combineLatest,t)}xu.combineLatestAll=y9});var _b=d(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.combineAll=void 0;var D9=tp();hu.combineAll=D9.combineLatestAll});var Eb=d(Zt=>{"use strict";var yb=Zt&&Zt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Db=Zt&&Zt.__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(Zt,"__esModule",{value:!0});Zt.combineLatest=void 0;var S9=qs(),E9=D(),w9=Nn(),O9=Yt(),C9=ro(),A9=Ce();function Sb(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=A9.popResultSelector(t);return r?C9.pipe(Sb.apply(void 0,Db([],yb(t))),O9.mapOneOrManyArgs(r)):E9.operate(function(n,i){S9.combineLatestInit(Db([n],yb(w9.argsOrArgArray(t))))(i)})}Zt.combineLatest=Sb});var wb=d(er=>{"use strict";var F9=er&&er.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},T9=er&&er.__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(er,"__esModule",{value:!0});er.combineLatestWith=void 0;var I9=Eb();function P9(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return I9.combineLatest.apply(void 0,T9([],F9(t)))}er.combineLatestWith=P9});var rp=d(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.concatMap=void 0;var Ob=Ct(),j9=$();function q9(t,e){return j9.isFunction(e)?Ob.mergeMap(t,e,1):Ob.mergeMap(t,1)}mu.concatMap=q9});var Ab=d(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.concatMapTo=void 0;var Cb=rp(),M9=$();function k9(t,e){return M9.isFunction(e)?Cb.concatMap(function(){return t},e):Cb.concatMap(function(){return t})}vu.concatMapTo=k9});var Fb=d(tr=>{"use strict";var L9=tr&&tr.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},R9=tr&&tr.__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(tr,"__esModule",{value:!0});tr.concat=void 0;var B9=D(),N9=Ns(),U9=Ce(),G9=wt();function $9(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=U9.popScheduler(t);return B9.operate(function(n,i){N9.concatAll()(G9.from(R9([n],L9(t)),r)).subscribe(i)})}tr.concat=$9});var Tb=d(rr=>{"use strict";var V9=rr&&rr.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},K9=rr&&rr.__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(rr,"__esModule",{value:!0});rr.concatWith=void 0;var W9=Fb();function z9(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return W9.concat.apply(void 0,K9([],V9(t)))}rr.concatWith=z9});var Ib=d(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.fromSubscribable=void 0;var H9=V();function Y9(t){return new H9.Observable(function(e){return t.subscribe(e)})}gu.fromSubscribable=Y9});var _u=d(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.connect=void 0;var J9=ve(),X9=k(),Q9=D(),Z9=Ib(),eA={connector:function(){return new J9.Subject}};function tA(t,e){e===void 0&&(e=eA);var r=e.connector;return Q9.operate(function(n,i){var o=r();X9.innerFrom(t(Z9.fromSubscribable(o))).subscribe(i),i.add(n.subscribe(o))})}bu.connect=tA});var Pb=d(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.count=void 0;var rA=Kn();function nA(t){return rA.reduce(function(e,r,n){return!t||t(r,n)?e+1:e},0)}yu.count=nA});var qb=d(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.debounce=void 0;var iA=D(),oA=he(),jb=O(),aA=k();function sA(t){return iA.operate(function(e,r){var n=!1,i=null,o=null,a=function(){if(o?.unsubscribe(),o=null,n){n=!1;var s=i;i=null,r.next(s)}};e.subscribe(jb.createOperatorSubscriber(r,function(s){o?.unsubscribe(),n=!0,i=s,o=jb.createOperatorSubscriber(r,a,oA.noop),aA.innerFrom(t(s)).subscribe(o)},function(){a(),r.complete()},void 0,function(){i=o=null}))})}Du.debounce=sA});var Mb=d(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.debounceTime=void 0;var uA=Oe(),cA=D(),lA=O();function fA(t,e){return e===void 0&&(e=uA.asyncScheduler),cA.operate(function(r,n){var i=null,o=null,a=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,n.next(c)}};function u(){var c=a+t,l=e.now();if(l<c){i=this.schedule(void 0,c-l),n.add(i);return}s()}r.subscribe(lA.createOperatorSubscriber(n,function(c){o=c,a=e.now(),i||(i=e.schedule(u,t),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}Su.debounceTime=fA});var po=d(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.defaultIfEmpty=void 0;var dA=D(),pA=O();function xA(t){return dA.operate(function(e,r){var n=!1;e.subscribe(pA.createOperatorSubscriber(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}))})}Eu.defaultIfEmpty=xA});var xo=d(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.take=void 0;var hA=Ke(),mA=D(),vA=O();function gA(t){return t<=0?function(){return hA.EMPTY}:mA.operate(function(e,r){var n=0;e.subscribe(vA.createOperatorSubscriber(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}wu.take=gA});var np=d(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.ignoreElements=void 0;var bA=D(),_A=O(),yA=he();function DA(){return bA.operate(function(t,e){t.subscribe(_A.createOperatorSubscriber(e,yA.noop))})}Ou.ignoreElements=DA});var ip=d(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.mapTo=void 0;var SA=zt();function EA(t){return SA.map(function(){return t})}Cu.mapTo=EA});var op=d(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.delayWhen=void 0;var wA=lo(),kb=xo(),OA=np(),CA=ip(),AA=Ct(),FA=k();function Lb(t,e){return e?function(r){return wA.concat(e.pipe(kb.take(1),OA.ignoreElements()),r.pipe(Lb(t)))}:AA.mergeMap(function(r,n){return FA.innerFrom(t(r,n)).pipe(kb.take(1),CA.mapTo(r))})}Au.delayWhen=Lb});var Rb=d(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.delay=void 0;var TA=Oe(),IA=op(),PA=Xt();function jA(t,e){e===void 0&&(e=TA.asyncScheduler);var r=PA.timer(t,e);return IA.delayWhen(function(){return r})}Fu.delay=jA});var Bb=d(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.dematerialize=void 0;var qA=gs(),MA=D(),kA=O();function LA(){return MA.operate(function(t,e){t.subscribe(kA.createOperatorSubscriber(e,function(r){return qA.observeNotification(r,e)}))})}Tu.dematerialize=LA});var Ub=d(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.distinct=void 0;var RA=D(),Nb=O(),BA=he(),NA=k();function UA(t,e){return RA.operate(function(r,n){var i=new Set;r.subscribe(Nb.createOperatorSubscriber(n,function(o){var a=t?t(o):o;i.has(a)||(i.add(a),n.next(o))})),e&&NA.innerFrom(e).subscribe(Nb.createOperatorSubscriber(n,function(){return i.clear()},BA.noop))})}Iu.distinct=UA});var ap=d(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.distinctUntilChanged=void 0;var GA=me(),$A=D(),VA=O();function KA(t,e){return e===void 0&&(e=GA.identity),t=t??WA,$A.operate(function(r,n){var i,o=!0;r.subscribe(VA.createOperatorSubscriber(n,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,n.next(a))}))})}Pu.distinctUntilChanged=KA;function WA(t,e){return t===e}});var Gb=d(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.distinctUntilKeyChanged=void 0;var zA=ap();function HA(t,e){return zA.distinctUntilChanged(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}ju.distinctUntilKeyChanged=HA});var ho=d(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.throwIfEmpty=void 0;var YA=Wt(),JA=D(),XA=O();function QA(t){return t===void 0&&(t=ZA),JA.operate(function(e,r){var n=!1;e.subscribe(XA.createOperatorSubscriber(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}qu.throwIfEmpty=QA;function ZA(){return new YA.EmptyError}});var Vb=d(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.elementAt=void 0;var $b=Ld(),eF=Vr(),tF=ho(),rF=po(),nF=xo();function iF(t,e){if(t<0)throw new $b.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(n){return n.pipe(eF.filter(function(i,o){return o===t}),nF.take(1),r?rF.defaultIfEmpty(e):tF.throwIfEmpty(function(){return new $b.ArgumentOutOfRangeError}))}}Mu.elementAt=iF});var Kb=d(nr=>{"use strict";var oF=nr&&nr.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},aF=nr&&nr.__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(nr,"__esModule",{value:!0});nr.endWith=void 0;var sF=lo(),uF=ms();function cF(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return sF.concat(r,uF.of.apply(void 0,aF([],oF(t))))}}nr.endWith=cF});var Wb=d(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.every=void 0;var lF=D(),fF=O();function dF(t,e){return lF.operate(function(r,n){var i=0;r.subscribe(fF.createOperatorSubscriber(n,function(o){t.call(e,o,i++,r)||(n.next(!1),n.complete())},function(){n.next(!0),n.complete()}))})}ku.every=dF});var sp=d(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.exhaustMap=void 0;var pF=zt(),zb=k(),xF=D(),Hb=O();function Yb(t,e){return e?function(r){return r.pipe(Yb(function(n,i){return zb.innerFrom(t(n,i)).pipe(pF.map(function(o,a){return e(n,o,i,a)}))}))}:xF.operate(function(r,n){var i=0,o=null,a=!1;r.subscribe(Hb.createOperatorSubscriber(n,function(s){o||(o=Hb.createOperatorSubscriber(n,void 0,function(){o=null,a&&n.complete()}),zb.innerFrom(t(s,i++)).subscribe(o))},function(){a=!0,!o&&n.complete()}))})}Lu.exhaustMap=Yb});var up=d(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.exhaustAll=void 0;var hF=sp(),mF=me();function vF(){return hF.exhaustMap(mF.identity)}Ru.exhaustAll=vF});var Jb=d(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.exhaust=void 0;var gF=up();Bu.exhaust=gF.exhaustAll});var Xb=d(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.expand=void 0;var bF=D(),_F=ks();function yF(t,e,r){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,bF.operate(function(n,i){return _F.mergeInternals(n,i,t,e,void 0,!0,r)})}Nu.expand=yF});var Qb=d(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.finalize=void 0;var DF=D();function SF(t){return DF.operate(function(e,r){try{e.subscribe(r)}finally{r.add(t)}})}Uu.finalize=SF});var cp=d(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.createFind=Wn.find=void 0;var EF=D(),wF=O();function OF(t,e){return EF.operate(Zb(t,e,"value"))}Wn.find=OF;function Zb(t,e,r){var n=r==="index";return function(i,o){var a=0;i.subscribe(wF.createOperatorSubscriber(o,function(s){var u=a++;t.call(e,s,u,i)&&(o.next(n?u:s),o.complete())},function(){o.next(n?-1:void 0),o.complete()}))}}Wn.createFind=Zb});var e2=d(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.findIndex=void 0;var CF=D(),AF=cp();function FF(t,e){return CF.operate(AF.createFind(t,e,"index"))}Gu.findIndex=FF});var t2=d($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.first=void 0;var TF=Wt(),IF=Vr(),PF=xo(),jF=po(),qF=ho(),MF=me();function kF(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?IF.filter(function(i,o){return t(i,o,n)}):MF.identity,PF.take(1),r?jF.defaultIfEmpty(e):qF.throwIfEmpty(function(){return new TF.EmptyError}))}}$u.first=kF});var n2=d(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.groupBy=void 0;var LF=V(),RF=k(),BF=ve(),NF=D(),r2=O();function UF(t,e,r,n){return NF.operate(function(i,o){var a;!e||typeof e=="function"?a=e:(r=e.duration,a=e.element,n=e.connector);var s=new Map,u=function(g){s.forEach(g),g(o)},c=function(g){return u(function(b){return b.error(g)})},l=0,p=!1,x=new r2.OperatorSubscriber(o,function(g){try{var b=t(g),m=s.get(b);if(!m){s.set(b,m=n?n():new BF.Subject);var v=h(b,m);if(o.next(v),r){var _=r2.createOperatorSubscriber(m,function(){m.complete(),_?.unsubscribe()},void 0,void 0,function(){return s.delete(b)});x.add(RF.innerFrom(r(v)).subscribe(_))}}m.next(a?a(g):g)}catch(y){c(y)}},function(){return u(function(g){return g.complete()})},c,function(){return s.clear()},function(){return p=!0,l===0});i.subscribe(x);function h(g,b){var m=new LF.Observable(function(v){l++;var _=b.subscribe(v);return function(){_.unsubscribe(),--l===0&&p&&x.unsubscribe()}});return m.key=g,m}})}Vu.groupBy=UF});var i2=d(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.isEmpty=void 0;var GF=D(),$F=O();function VF(){return GF.operate(function(t,e){t.subscribe($F.createOperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}Ku.isEmpty=VF});var lp=d(zn=>{"use strict";var KF=zn&&zn.__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(zn,"__esModule",{value:!0});zn.takeLast=void 0;var WF=Ke(),zF=D(),HF=O();function YF(t){return t<=0?function(){return WF.EMPTY}:zF.operate(function(e,r){var n=[];e.subscribe(HF.createOperatorSubscriber(r,function(i){n.push(i),t<n.length&&n.shift()},function(){var i,o;try{for(var a=KF(n),s=a.next();!s.done;s=a.next()){var u=s.value;r.next(u)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}r.complete()},void 0,function(){n=null}))})}zn.takeLast=YF});var o2=d(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.last=void 0;var JF=Wt(),XF=Vr(),QF=lp(),ZF=ho(),eT=po(),tT=me();function rT(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?XF.filter(function(i,o){return t(i,o,n)}):tT.identity,QF.takeLast(1),r?eT.defaultIfEmpty(e):ZF.throwIfEmpty(function(){return new JF.EmptyError}))}}Wu.last=rT});var a2=d(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.materialize=void 0;var fp=gs(),nT=D(),iT=O();function oT(){return nT.operate(function(t,e){t.subscribe(iT.createOperatorSubscriber(e,function(r){e.next(fp.Notification.createNext(r))},function(){e.next(fp.Notification.createComplete()),e.complete()},function(r){e.next(fp.Notification.createError(r)),e.complete()}))})}zu.materialize=oT});var s2=d(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.max=void 0;var aT=Kn(),sT=$();function uT(t){return aT.reduce(sT.isFunction(t)?function(e,r){return t(e,r)>0?e:r}:function(e,r){return e>r?e:r})}Hu.max=uT});var u2=d(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.flatMap=void 0;var cT=Ct();Yu.flatMap=cT.mergeMap});var l2=d(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.mergeMapTo=void 0;var c2=Ct(),lT=$();function fT(t,e,r){return r===void 0&&(r=1/0),lT.isFunction(e)?c2.mergeMap(function(){return t},e,r):(typeof e=="number"&&(r=e),c2.mergeMap(function(){return t},r))}Ju.mergeMapTo=fT});var f2=d(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.mergeScan=void 0;var dT=D(),pT=ks();function xT(t,e,r){return r===void 0&&(r=1/0),dT.operate(function(n,i){var o=e;return pT.mergeInternals(n,i,function(a,s){return t(o,a,s)},r,function(a){o=a},!1,void 0,function(){return o=null})})}Xu.mergeScan=xT});var p2=d(ir=>{"use strict";var hT=ir&&ir.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},mT=ir&&ir.__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(ir,"__esModule",{value:!0});ir.merge=void 0;var vT=D(),gT=co(),d2=Ce(),bT=wt();function _T(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=d2.popScheduler(t),n=d2.popNumber(t,1/0);return vT.operate(function(i,o){gT.mergeAll(n)(bT.from(mT([i],hT(t)),r)).subscribe(o)})}ir.merge=_T});var x2=d(or=>{"use strict";var yT=or&&or.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},DT=or&&or.__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(or,"__esModule",{value:!0});or.mergeWith=void 0;var ST=p2();function ET(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ST.merge.apply(void 0,DT([],yT(t)))}or.mergeWith=ET});var h2=d(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.min=void 0;var wT=Kn(),OT=$();function CT(t){return wT.reduce(OT.isFunction(t)?function(e,r){return t(e,r)<0?e:r}:function(e,r){return e<r?e:r})}Qu.min=CT});var ec=d(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.multicast=void 0;var AT=no(),m2=$(),FT=_u();function TT(t,e){var r=m2.isFunction(t)?t:function(){return t};return m2.isFunction(e)?FT.connect(e,{connector:r}):function(n){return new AT.ConnectableObservable(n,r)}}Zu.multicast=TT});var g2=d(pt=>{"use strict";var IT=pt&&pt.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},PT=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.onErrorResumeNext=pt.onErrorResumeNextWith=void 0;var jT=Nn(),qT=zd();function v2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=jT.argsOrArgArray(t);return function(n){return qT.onErrorResumeNext.apply(void 0,PT([n],IT(r)))}}pt.onErrorResumeNextWith=v2;pt.onErrorResumeNext=v2});var b2=d(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.pairwise=void 0;var MT=D(),kT=O();function LT(){return MT.operate(function(t,e){var r,n=!1;t.subscribe(kT.createOperatorSubscriber(e,function(i){var o=r;r=i,n&&e.next([o,i]),n=!0}))})}tc.pairwise=LT});var _2=d(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.pluck=void 0;var RT=zt();function BT(){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 RT.map(function(n){for(var i=n,o=0;o<r;o++){var a=i?.[t[o]];if(typeof a<"u")i=a;else return}return i})}rc.pluck=BT});var y2=d(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.publish=void 0;var NT=ve(),UT=ec(),GT=_u();function $T(t){return t?function(e){return GT.connect(t)(e)}:function(e){return UT.multicast(new NT.Subject)(e)}}nc.publish=$T});var D2=d(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.publishBehavior=void 0;var VT=_d(),KT=no();function WT(t){return function(e){var r=new VT.BehaviorSubject(t);return new KT.ConnectableObservable(e,function(){return r})}}ic.publishBehavior=WT});var S2=d(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.publishLast=void 0;var zT=Wa(),HT=no();function YT(){return function(t){var e=new zT.AsyncSubject;return new HT.ConnectableObservable(t,function(){return e})}}oc.publishLast=YT});var w2=d(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.publishReplay=void 0;var JT=Ka(),XT=ec(),E2=$();function QT(t,e,r,n){r&&!E2.isFunction(r)&&(n=r);var i=E2.isFunction(r)?r:void 0;return function(o){return XT.multicast(new JT.ReplaySubject(t,e,n),i)(o)}}ac.publishReplay=QT});var O2=d(ar=>{"use strict";var ZT=ar&&ar.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},eI=ar&&ar.__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(ar,"__esModule",{value:!0});ar.raceWith=void 0;var tI=Hd(),rI=D(),nI=me();function iI(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length?rI.operate(function(r,n){tI.raceInit(eI([r],ZT(t)))(n)}):nI.identity}ar.raceWith=iI});var A2=d(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.repeat=void 0;var oI=Ke(),aI=D(),C2=O(),sI=k(),uI=Xt();function cI(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 oI.EMPTY}:aI.operate(function(i,o){var a=0,s,u=function(){if(s?.unsubscribe(),s=null,n!=null){var l=typeof n=="number"?uI.timer(n):sI.innerFrom(n(a)),p=C2.createOperatorSubscriber(o,function(){p.unsubscribe(),c()});l.subscribe(p)}else c()},c=function(){var l=!1;s=i.subscribe(C2.createOperatorSubscriber(o,void 0,function(){++a<r?s?u():l=!0:o.complete()})),l&&u()};c()})}sc.repeat=cI});var T2=d(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.repeatWhen=void 0;var lI=k(),fI=ve(),dI=D(),F2=O();function pI(t){return dI.operate(function(e,r){var n,i=!1,o,a=!1,s=!1,u=function(){return s&&a&&(r.complete(),!0)},c=function(){return o||(o=new fI.Subject,lI.innerFrom(t(o)).subscribe(F2.createOperatorSubscriber(r,function(){n?l():i=!0},function(){a=!0,u()}))),o},l=function(){s=!1,n=e.subscribe(F2.createOperatorSubscriber(r,void 0,function(){s=!0,!u()&&c().next()})),i&&(n.unsubscribe(),n=null,i=!1,l())};l()})}uc.repeatWhen=pI});var P2=d(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.retry=void 0;var xI=D(),I2=O(),hI=me(),mI=Xt(),vI=k();function gI(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,o=e.resetOnSuccess,a=o===void 0?!1:o;return n<=0?hI.identity:xI.operate(function(s,u){var c=0,l,p=function(){var x=!1;l=s.subscribe(I2.createOperatorSubscriber(u,function(h){a&&(c=0),u.next(h)},void 0,function(h){if(c++<n){var g=function(){l?(l.unsubscribe(),l=null,p()):x=!0};if(i!=null){var b=typeof i=="number"?mI.timer(i):vI.innerFrom(i(h,c)),m=I2.createOperatorSubscriber(u,function(){m.unsubscribe(),g()},function(){u.complete()});b.subscribe(m)}else g()}else u.error(h)})),x&&(l.unsubscribe(),l=null,p())};p()})}cc.retry=gI});var q2=d(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.retryWhen=void 0;var bI=k(),_I=ve(),yI=D(),j2=O();function DI(t){return yI.operate(function(e,r){var n,i=!1,o,a=function(){n=e.subscribe(j2.createOperatorSubscriber(r,void 0,void 0,function(s){o||(o=new _I.Subject,bI.innerFrom(t(o)).subscribe(j2.createOperatorSubscriber(r,function(){return n?a():i=!0}))),o&&o.next(s)})),i&&(n.unsubscribe(),n=null,i=!1,a())};a()})}lc.retryWhen=DI});var dp=d(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.sample=void 0;var SI=k(),EI=D(),wI=he(),M2=O();function OI(t){return EI.operate(function(e,r){var n=!1,i=null;e.subscribe(M2.createOperatorSubscriber(r,function(o){n=!0,i=o})),SI.innerFrom(t).subscribe(M2.createOperatorSubscriber(r,function(){if(n){n=!1;var o=i;i=null,r.next(o)}},wI.noop))})}fc.sample=OI});var k2=d(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.sampleTime=void 0;var CI=Oe(),AI=dp(),FI=Kd();function TI(t,e){return e===void 0&&(e=CI.asyncScheduler),AI.sample(FI.interval(t,e))}dc.sampleTime=TI});var L2=d(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.scan=void 0;var II=D(),PI=Qd();function jI(t,e){return II.operate(PI.scanInternals(t,e,arguments.length>=2,!0))}pc.scan=jI});var B2=d(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.sequenceEqual=void 0;var qI=D(),MI=O(),kI=k();function LI(t,e){return e===void 0&&(e=function(r,n){return r===n}),qI.operate(function(r,n){var i=R2(),o=R2(),a=function(u){n.next(u),n.complete()},s=function(u,c){var l=MI.createOperatorSubscriber(n,function(p){var x=c.buffer,h=c.complete;x.length===0?h?a(!1):u.buffer.push(p):!e(p,x.shift())&&a(!1)},function(){u.complete=!0;var p=c.complete,x=c.buffer;p&&a(x.length===0),l?.unsubscribe()});return l};r.subscribe(s(i,o)),kI.innerFrom(t).subscribe(s(o,i))})}xc.sequenceEqual=LI;function R2(){return{buffer:[],complete:!1}}});var xp=d(sr=>{"use strict";var RI=sr&&sr.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},BI=sr&&sr.__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(sr,"__esModule",{value:!0});sr.share=void 0;var N2=k(),NI=ve(),U2=hn(),UI=D();function GI(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new NI.Subject}:e,n=t.resetOnError,i=n===void 0?!0:n,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(c){var l,p,x,h=0,g=!1,b=!1,m=function(){p?.unsubscribe(),p=void 0},v=function(){m(),l=x=void 0,g=b=!1},_=function(){var y=l;v(),y?.unsubscribe()};return UI.operate(function(y,A){h++,!b&&!g&&m();var w=x=x??r();A.add(function(){h--,h===0&&!b&&!g&&(p=pp(_,u))}),w.subscribe(A),!l&&h>0&&(l=new U2.SafeSubscriber({next:function(B){return w.next(B)},error:function(B){b=!0,m(),p=pp(v,i,B),w.error(B)},complete:function(){g=!0,m(),p=pp(v,a),w.complete()}}),N2.innerFrom(y).subscribe(l))})(c)}}sr.share=GI;function pp(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 U2.SafeSubscriber({next:function(){i.unsubscribe(),t()}});return N2.innerFrom(e.apply(void 0,BI([],RI(r)))).subscribe(i)}}});var G2=d(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.shareReplay=void 0;var $I=Ka(),VI=xp();function KI(t,e,r){var n,i,o,a,s=!1;return t&&typeof t=="object"?(n=t.bufferSize,a=n===void 0?1/0:n,i=t.windowTime,e=i===void 0?1/0:i,o=t.refCount,s=o===void 0?!1:o,r=t.scheduler):a=t??1/0,VI.share({connector:function(){return new $I.ReplaySubject(a,e,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}hc.shareReplay=KI});var $2=d(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.single=void 0;var WI=Wt(),zI=Bd(),HI=Rd(),YI=D(),JI=O();function XI(t){return YI.operate(function(e,r){var n=!1,i,o=!1,a=0;e.subscribe(JI.createOperatorSubscriber(r,function(s){o=!0,(!t||t(s,a++,e))&&(n&&r.error(new zI.SequenceError("Too many matching values")),n=!0,i=s)},function(){n?(r.next(i),r.complete()):r.error(o?new HI.NotFoundError("No matching values"):new WI.EmptyError)}))})}mc.single=XI});var V2=d(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.skip=void 0;var QI=Vr();function ZI(t){return QI.filter(function(e,r){return t<=r})}vc.skip=ZI});var K2=d(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.skipLast=void 0;var eP=me(),tP=D(),rP=O();function nP(t){return t<=0?eP.identity:tP.operate(function(e,r){var n=new Array(t),i=0;return e.subscribe(rP.createOperatorSubscriber(r,function(o){var a=i++;if(a<t)n[a]=o;else{var s=a%t,u=n[s];n[s]=o,r.next(u)}})),function(){n=null}})}gc.skipLast=nP});var z2=d(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.skipUntil=void 0;var iP=D(),W2=O(),oP=k(),aP=he();function sP(t){return iP.operate(function(e,r){var n=!1,i=W2.createOperatorSubscriber(r,function(){i?.unsubscribe(),n=!0},aP.noop);oP.innerFrom(t).subscribe(i),e.subscribe(W2.createOperatorSubscriber(r,function(o){return n&&r.next(o)}))})}bc.skipUntil=sP});var H2=d(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.skipWhile=void 0;var uP=D(),cP=O();function lP(t){return uP.operate(function(e,r){var n=!1,i=0;e.subscribe(cP.createOperatorSubscriber(r,function(o){return(n||(n=!t(o,i++)))&&r.next(o)}))})}_c.skipWhile=lP});var J2=d(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.startWith=void 0;var Y2=lo(),fP=Ce(),dP=D();function pP(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=fP.popScheduler(t);return dP.operate(function(n,i){(r?Y2.concat(t,n,r):Y2.concat(t,n)).subscribe(i)})}yc.startWith=pP});var mo=d(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.switchMap=void 0;var xP=k(),hP=D(),X2=O();function mP(t,e){return hP.operate(function(r,n){var i=null,o=0,a=!1,s=function(){return a&&!i&&n.complete()};r.subscribe(X2.createOperatorSubscriber(n,function(u){i?.unsubscribe();var c=0,l=o++;xP.innerFrom(t(u,l)).subscribe(i=X2.createOperatorSubscriber(n,function(p){return n.next(e?e(u,p,l,c++):p)},function(){i=null,s()}))},function(){a=!0,s()}))})}Dc.switchMap=mP});var Q2=d(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.switchAll=void 0;var vP=mo(),gP=me();function bP(){return vP.switchMap(gP.identity)}Sc.switchAll=bP});var e_=d(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.switchMapTo=void 0;var Z2=mo(),_P=$();function yP(t,e){return _P.isFunction(e)?Z2.switchMap(function(){return t},e):Z2.switchMap(function(){return t})}Ec.switchMapTo=yP});var t_=d(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.switchScan=void 0;var DP=mo(),SP=D();function EP(t,e){return SP.operate(function(r,n){var i=e;return DP.switchMap(function(o,a){return t(i,o,a)},function(o,a){return i=a,a})(r).subscribe(n),function(){i=null}})}wc.switchScan=EP});var r_=d(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.takeUntil=void 0;var wP=D(),OP=O(),CP=k(),AP=he();function FP(t){return wP.operate(function(e,r){CP.innerFrom(t).subscribe(OP.createOperatorSubscriber(r,function(){return r.complete()},AP.noop)),!r.closed&&e.subscribe(r)})}Oc.takeUntil=FP});var n_=d(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.takeWhile=void 0;var TP=D(),IP=O();function PP(t,e){return e===void 0&&(e=!1),TP.operate(function(r,n){var i=0;r.subscribe(IP.createOperatorSubscriber(n,function(o){var a=t(o,i++);(a||e)&&n.next(o),!a&&n.complete()}))})}Cc.takeWhile=PP});var i_=d(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.tap=void 0;var jP=$(),qP=D(),MP=O(),kP=me();function LP(t,e,r){var n=jP.isFunction(t)||e||r?{next:t,error:e,complete:r}:t;return n?qP.operate(function(i,o){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;i.subscribe(MP.createOperatorSubscriber(o,function(u){var c;(c=n.next)===null||c===void 0||c.call(n,u),o.next(u)},function(){var u;s=!1,(u=n.complete)===null||u===void 0||u.call(n),o.complete()},function(u){var c;s=!1,(c=n.error)===null||c===void 0||c.call(n,u),o.error(u)},function(){var u,c;s&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):kP.identity}Ac.tap=LP});var hp=d(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.throttle=void 0;var RP=D(),o_=O(),BP=k();function NP(t,e){return RP.operate(function(r,n){var i=e??{},o=i.leading,a=o===void 0?!0:o,s=i.trailing,u=s===void 0?!1:s,c=!1,l=null,p=null,x=!1,h=function(){p?.unsubscribe(),p=null,u&&(m(),x&&n.complete())},g=function(){p=null,x&&n.complete()},b=function(v){return p=BP.innerFrom(t(v)).subscribe(o_.createOperatorSubscriber(n,h,g))},m=function(){if(c){c=!1;var v=l;l=null,n.next(v),!x&&b(v)}};r.subscribe(o_.createOperatorSubscriber(n,function(v){c=!0,l=v,!(p&&!p.closed)&&(a?m():b(v))},function(){x=!0,!(u&&c&&p&&!p.closed)&&n.complete()}))})}Fc.throttle=NP});var a_=d(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.throttleTime=void 0;var UP=Oe(),GP=hp(),$P=Xt();function VP(t,e,r){e===void 0&&(e=UP.asyncScheduler);var n=$P.timer(t,e);return GP.throttle(function(){return n},r)}Tc.throttleTime=VP});var u_=d(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.TimeInterval=Hn.timeInterval=void 0;var KP=Oe(),WP=D(),zP=O();function HP(t){return t===void 0&&(t=KP.asyncScheduler),WP.operate(function(e,r){var n=t.now();e.subscribe(zP.createOperatorSubscriber(r,function(i){var o=t.now(),a=o-n;n=o,r.next(new s_(i,a))}))})}Hn.timeInterval=HP;var s_=(function(){function t(e,r){this.value=e,this.interval=r}return t})();Hn.TimeInterval=s_});var c_=d(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.timeoutWith=void 0;var YP=Oe(),JP=Cs(),XP=As();function QP(t,e,r){var n,i,o;if(r=r??YP.async,JP.isValidDate(t)?n=t:typeof t=="number"&&(i=t),e)o=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 XP.timeout({first:n,each:i,scheduler:r,with:o})}Ic.timeoutWith=QP});var l_=d(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.timestamp=void 0;var ZP=Va(),ej=zt();function tj(t){return t===void 0&&(t=ZP.dateTimestampProvider),ej.map(function(e){return{value:e,timestamp:t.now()}})}Pc.timestamp=tj});var p_=d(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.window=void 0;var f_=ve(),rj=D(),d_=O(),nj=he(),ij=k();function oj(t){return rj.operate(function(e,r){var n=new f_.Subject;r.next(n.asObservable());var i=function(o){n.error(o),r.error(o)};return e.subscribe(d_.createOperatorSubscriber(r,function(o){return n?.next(o)},function(){n.complete(),r.complete()},i)),ij.innerFrom(t).subscribe(d_.createOperatorSubscriber(r,function(){n.complete(),r.next(n=new f_.Subject)},nj.noop,i)),function(){n?.unsubscribe(),n=null}})}jc.window=oj});var h_=d(Yn=>{"use strict";var aj=Yn&&Yn.__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(Yn,"__esModule",{value:!0});Yn.windowCount=void 0;var x_=ve(),sj=D(),uj=O();function cj(t,e){e===void 0&&(e=0);var r=e>0?e:t;return sj.operate(function(n,i){var o=[new x_.Subject],a=[],s=0;i.next(o[0].asObservable()),n.subscribe(uj.createOperatorSubscriber(i,function(u){var c,l;try{for(var p=aj(o),x=p.next();!x.done;x=p.next()){var h=x.value;h.next(u)}}catch(m){c={error:m}}finally{try{x&&!x.done&&(l=p.return)&&l.call(p)}finally{if(c)throw c.error}}var g=s-t+1;if(g>=0&&g%r===0&&o.shift().complete(),++s%r===0){var b=new x_.Subject;o.push(b),i.next(b.asObservable())}},function(){for(;o.length>0;)o.shift().complete();i.complete()},function(u){for(;o.length>0;)o.shift().error(u);i.error(u)},function(){a=null,o=null}))})}Yn.windowCount=cj});var v_=d(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.windowTime=void 0;var lj=ve(),fj=Oe(),dj=Pe(),pj=D(),xj=O(),hj=St(),mj=Ce(),m_=Et();function vj(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=(e=mj.popScheduler(n))!==null&&e!==void 0?e:fj.asyncScheduler,a=(r=n[0])!==null&&r!==void 0?r:null,s=n[1]||1/0;return pj.operate(function(u,c){var l=[],p=!1,x=function(m){var v=m.window,_=m.subs;v.complete(),_.unsubscribe(),hj.arrRemove(l,m),p&&h()},h=function(){if(l){var m=new dj.Subscription;c.add(m);var v=new lj.Subject,_={window:v,subs:m,seen:0};l.push(_),c.next(v.asObservable()),m_.executeSchedule(m,o,function(){return x(_)},t)}};a!==null&&a>=0?m_.executeSchedule(c,o,h,a,!0):p=!0,h();var g=function(m){return l.slice().forEach(m)},b=function(m){g(function(v){var _=v.window;return m(_)}),m(c),c.unsubscribe()};return u.subscribe(xj.createOperatorSubscriber(c,function(m){g(function(v){v.window.next(m),s<=++v.seen&&x(v)})},function(){return b(function(m){return m.complete()})},function(m){return b(function(v){return v.error(m)})})),function(){l=null}})}qc.windowTime=vj});var __=d(Jn=>{"use strict";var gj=Jn&&Jn.__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(Jn,"__esModule",{value:!0});Jn.windowToggle=void 0;var bj=ve(),_j=Pe(),yj=D(),g_=k(),mp=O(),b_=he(),Dj=St();function Sj(t,e){return yj.operate(function(r,n){var i=[],o=function(a){for(;0<i.length;)i.shift().error(a);n.error(a)};g_.innerFrom(t).subscribe(mp.createOperatorSubscriber(n,function(a){var s=new bj.Subject;i.push(s);var u=new _j.Subscription,c=function(){Dj.arrRemove(i,s),s.complete(),u.unsubscribe()},l;try{l=g_.innerFrom(e(a))}catch(p){o(p);return}n.next(s.asObservable()),u.add(l.subscribe(mp.createOperatorSubscriber(n,c,b_.noop,o)))},b_.noop)),r.subscribe(mp.createOperatorSubscriber(n,function(a){var s,u,c=i.slice();try{for(var l=gj(c),p=l.next();!p.done;p=l.next()){var x=p.value;x.next(a)}}catch(h){s={error:h}}finally{try{p&&!p.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}},function(){for(;0<i.length;)i.shift().complete();n.complete()},o,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}Jn.windowToggle=Sj});var D_=d(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.windowWhen=void 0;var Ej=ve(),wj=D(),y_=O(),Oj=k();function Cj(t){return wj.operate(function(e,r){var n,i,o=function(s){n.error(s),r.error(s)},a=function(){i?.unsubscribe(),n?.complete(),n=new Ej.Subject,r.next(n.asObservable());var s;try{s=Oj.innerFrom(t())}catch(u){o(u);return}s.subscribe(i=y_.createOperatorSubscriber(r,a,a,o))};a(),e.subscribe(y_.createOperatorSubscriber(r,function(s){return n.next(s)},function(){n.complete(),r.complete()},o,function(){i?.unsubscribe(),n=null}))})}Mc.windowWhen=Cj});var O_=d(ur=>{"use strict";var S_=ur&&ur.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},E_=ur&&ur.__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(ur,"__esModule",{value:!0});ur.withLatestFrom=void 0;var Aj=D(),w_=O(),Fj=k(),Tj=me(),Ij=he(),Pj=Ce();function jj(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Pj.popResultSelector(t);return Aj.operate(function(n,i){for(var o=t.length,a=new Array(o),s=t.map(function(){return!1}),u=!1,c=function(p){Fj.innerFrom(t[p]).subscribe(w_.createOperatorSubscriber(i,function(x){a[p]=x,!u&&!s[p]&&(s[p]=!0,(u=s.every(Tj.identity))&&(s=null))},Ij.noop))},l=0;l<o;l++)c(l);n.subscribe(w_.createOperatorSubscriber(i,function(p){if(u){var x=E_([p],S_(a));i.next(r?r.apply(void 0,E_([],S_(x))):x)}}))})}ur.withLatestFrom=jj});var C_=d(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.zipAll=void 0;var qj=iu(),Mj=ep();function kj(t){return Mj.joinAllInternals(qj.zip,t)}kc.zipAll=kj});var A_=d(cr=>{"use strict";var Lj=cr&&cr.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Rj=cr&&cr.__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(cr,"__esModule",{value:!0});cr.zip=void 0;var Bj=iu(),Nj=D();function Uj(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Nj.operate(function(r,n){Bj.zip.apply(void 0,Rj([r],Lj(t))).subscribe(n)})}cr.zip=Uj});var F_=d(lr=>{"use strict";var Gj=lr&&lr.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},$j=lr&&lr.__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(lr,"__esModule",{value:!0});lr.zipWith=void 0;var Vj=A_();function Kj(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Vj.zip.apply(void 0,$j([],Gj(t)))}lr.zipWith=Kj});var k_=d(f=>{"use strict";var Wj=f&&f.__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]})),zj=f&&f.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wj(e,t,r)};Object.defineProperty(f,"__esModule",{value:!0});f.interval=f.iif=f.generate=f.fromEventPattern=f.fromEvent=f.from=f.forkJoin=f.empty=f.defer=f.connectable=f.concat=f.combineLatest=f.bindNodeCallback=f.bindCallback=f.UnsubscriptionError=f.TimeoutError=f.SequenceError=f.ObjectUnsubscribedError=f.NotFoundError=f.EmptyError=f.ArgumentOutOfRangeError=f.firstValueFrom=f.lastValueFrom=f.isObservable=f.identity=f.noop=f.pipe=f.NotificationKind=f.Notification=f.Subscriber=f.Subscription=f.Scheduler=f.VirtualAction=f.VirtualTimeScheduler=f.animationFrameScheduler=f.animationFrame=f.queueScheduler=f.queue=f.asyncScheduler=f.async=f.asapScheduler=f.asap=f.AsyncSubject=f.ReplaySubject=f.BehaviorSubject=f.Subject=f.animationFrames=f.observable=f.ConnectableObservable=f.Observable=void 0;f.filter=f.expand=f.exhaustMap=f.exhaustAll=f.exhaust=f.every=f.endWith=f.elementAt=f.distinctUntilKeyChanged=f.distinctUntilChanged=f.distinct=f.dematerialize=f.delayWhen=f.delay=f.defaultIfEmpty=f.debounceTime=f.debounce=f.count=f.connect=f.concatWith=f.concatMapTo=f.concatMap=f.concatAll=f.combineLatestWith=f.combineLatestAll=f.combineAll=f.catchError=f.bufferWhen=f.bufferToggle=f.bufferTime=f.bufferCount=f.buffer=f.auditTime=f.audit=f.config=f.NEVER=f.EMPTY=f.scheduled=f.zip=f.using=f.timer=f.throwError=f.range=f.race=f.partition=f.pairs=f.onErrorResumeNext=f.of=f.never=f.merge=void 0;f.switchMap=f.switchAll=f.subscribeOn=f.startWith=f.skipWhile=f.skipUntil=f.skipLast=f.skip=f.single=f.shareReplay=f.share=f.sequenceEqual=f.scan=f.sampleTime=f.sample=f.refCount=f.retryWhen=f.retry=f.repeatWhen=f.repeat=f.reduce=f.raceWith=f.publishReplay=f.publishLast=f.publishBehavior=f.publish=f.pluck=f.pairwise=f.onErrorResumeNextWith=f.observeOn=f.multicast=f.min=f.mergeWith=f.mergeScan=f.mergeMapTo=f.mergeMap=f.flatMap=f.mergeAll=f.max=f.materialize=f.mapTo=f.map=f.last=f.isEmpty=f.ignoreElements=f.groupBy=f.first=f.findIndex=f.find=f.finalize=void 0;f.zipWith=f.zipAll=f.withLatestFrom=f.windowWhen=f.windowToggle=f.windowTime=f.windowCount=f.window=f.toArray=f.timestamp=f.timeoutWith=f.timeout=f.timeInterval=f.throwIfEmpty=f.throttleTime=f.throttle=f.tap=f.takeWhile=f.takeUntil=f.takeLast=f.take=f.switchScan=f.switchMapTo=void 0;var Hj=V();Object.defineProperty(f,"Observable",{enumerable:!0,get:function(){return Hj.Observable}});var Yj=no();Object.defineProperty(f,"ConnectableObservable",{enumerable:!0,get:function(){return Yj.ConnectableObservable}});var Jj=to();Object.defineProperty(f,"observable",{enumerable:!0,get:function(){return Jj.observable}});var Xj=qv();Object.defineProperty(f,"animationFrames",{enumerable:!0,get:function(){return Xj.animationFrames}});var Qj=ve();Object.defineProperty(f,"Subject",{enumerable:!0,get:function(){return Qj.Subject}});var Zj=_d();Object.defineProperty(f,"BehaviorSubject",{enumerable:!0,get:function(){return Zj.BehaviorSubject}});var eq=Ka();Object.defineProperty(f,"ReplaySubject",{enumerable:!0,get:function(){return eq.ReplaySubject}});var tq=Wa();Object.defineProperty(f,"AsyncSubject",{enumerable:!0,get:function(){return tq.AsyncSubject}});var T_=Xv();Object.defineProperty(f,"asap",{enumerable:!0,get:function(){return T_.asap}});Object.defineProperty(f,"asapScheduler",{enumerable:!0,get:function(){return T_.asapScheduler}});var I_=Oe();Object.defineProperty(f,"async",{enumerable:!0,get:function(){return I_.async}});Object.defineProperty(f,"asyncScheduler",{enumerable:!0,get:function(){return I_.asyncScheduler}});var P_=eg();Object.defineProperty(f,"queue",{enumerable:!0,get:function(){return P_.queue}});Object.defineProperty(f,"queueScheduler",{enumerable:!0,get:function(){return P_.queueScheduler}});var j_=ig();Object.defineProperty(f,"animationFrame",{enumerable:!0,get:function(){return j_.animationFrame}});Object.defineProperty(f,"animationFrameScheduler",{enumerable:!0,get:function(){return j_.animationFrameScheduler}});var q_=sg();Object.defineProperty(f,"VirtualTimeScheduler",{enumerable:!0,get:function(){return q_.VirtualTimeScheduler}});Object.defineProperty(f,"VirtualAction",{enumerable:!0,get:function(){return q_.VirtualAction}});var rq=Dd();Object.defineProperty(f,"Scheduler",{enumerable:!0,get:function(){return rq.Scheduler}});var nq=Pe();Object.defineProperty(f,"Subscription",{enumerable:!0,get:function(){return nq.Subscription}});var iq=hn();Object.defineProperty(f,"Subscriber",{enumerable:!0,get:function(){return iq.Subscriber}});var M_=gs();Object.defineProperty(f,"Notification",{enumerable:!0,get:function(){return M_.Notification}});Object.defineProperty(f,"NotificationKind",{enumerable:!0,get:function(){return M_.NotificationKind}});var oq=ro();Object.defineProperty(f,"pipe",{enumerable:!0,get:function(){return oq.pipe}});var aq=he();Object.defineProperty(f,"noop",{enumerable:!0,get:function(){return aq.noop}});var sq=me();Object.defineProperty(f,"identity",{enumerable:!0,get:function(){return sq.identity}});var uq=Eg();Object.defineProperty(f,"isObservable",{enumerable:!0,get:function(){return uq.isObservable}});var cq=wg();Object.defineProperty(f,"lastValueFrom",{enumerable:!0,get:function(){return cq.lastValueFrom}});var lq=Og();Object.defineProperty(f,"firstValueFrom",{enumerable:!0,get:function(){return lq.firstValueFrom}});var fq=Ld();Object.defineProperty(f,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return fq.ArgumentOutOfRangeError}});var dq=Wt();Object.defineProperty(f,"EmptyError",{enumerable:!0,get:function(){return dq.EmptyError}});var pq=Rd();Object.defineProperty(f,"NotFoundError",{enumerable:!0,get:function(){return pq.NotFoundError}});var xq=md();Object.defineProperty(f,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return xq.ObjectUnsubscribedError}});var hq=Bd();Object.defineProperty(f,"SequenceError",{enumerable:!0,get:function(){return hq.SequenceError}});var mq=As();Object.defineProperty(f,"TimeoutError",{enumerable:!0,get:function(){return mq.TimeoutError}});var vq=nd();Object.defineProperty(f,"UnsubscriptionError",{enumerable:!0,get:function(){return vq.UnsubscriptionError}});var gq=Ag();Object.defineProperty(f,"bindCallback",{enumerable:!0,get:function(){return gq.bindCallback}});var bq=Fg();Object.defineProperty(f,"bindNodeCallback",{enumerable:!0,get:function(){return bq.bindNodeCallback}});var _q=qs();Object.defineProperty(f,"combineLatest",{enumerable:!0,get:function(){return _q.combineLatest}});var yq=lo();Object.defineProperty(f,"concat",{enumerable:!0,get:function(){return yq.concat}});var Dq=Lg();Object.defineProperty(f,"connectable",{enumerable:!0,get:function(){return Dq.connectable}});var Sq=fo();Object.defineProperty(f,"defer",{enumerable:!0,get:function(){return Sq.defer}});var Eq=Ke();Object.defineProperty(f,"empty",{enumerable:!0,get:function(){return Eq.empty}});var wq=Rg();Object.defineProperty(f,"forkJoin",{enumerable:!0,get:function(){return wq.forkJoin}});var Oq=wt();Object.defineProperty(f,"from",{enumerable:!0,get:function(){return Oq.from}});var Cq=Ng();Object.defineProperty(f,"fromEvent",{enumerable:!0,get:function(){return Cq.fromEvent}});var Aq=Gg();Object.defineProperty(f,"fromEventPattern",{enumerable:!0,get:function(){return Aq.fromEventPattern}});var Fq=Vg();Object.defineProperty(f,"generate",{enumerable:!0,get:function(){return Fq.generate}});var Tq=Kg();Object.defineProperty(f,"iif",{enumerable:!0,get:function(){return Tq.iif}});var Iq=Kd();Object.defineProperty(f,"interval",{enumerable:!0,get:function(){return Iq.interval}});var Pq=zg();Object.defineProperty(f,"merge",{enumerable:!0,get:function(){return Pq.merge}});var jq=Wd();Object.defineProperty(f,"never",{enumerable:!0,get:function(){return jq.never}});var qq=ms();Object.defineProperty(f,"of",{enumerable:!0,get:function(){return qq.of}});var Mq=zd();Object.defineProperty(f,"onErrorResumeNext",{enumerable:!0,get:function(){return Mq.onErrorResumeNext}});var kq=Yg();Object.defineProperty(f,"pairs",{enumerable:!0,get:function(){return kq.pairs}});var Lq=Zg();Object.defineProperty(f,"partition",{enumerable:!0,get:function(){return Lq.partition}});var Rq=Hd();Object.defineProperty(f,"race",{enumerable:!0,get:function(){return Rq.race}});var Bq=rb();Object.defineProperty(f,"range",{enumerable:!0,get:function(){return Bq.range}});var Nq=kd();Object.defineProperty(f,"throwError",{enumerable:!0,get:function(){return Nq.throwError}});var Uq=Xt();Object.defineProperty(f,"timer",{enumerable:!0,get:function(){return Uq.timer}});var Gq=nb();Object.defineProperty(f,"using",{enumerable:!0,get:function(){return Gq.using}});var $q=iu();Object.defineProperty(f,"zip",{enumerable:!0,get:function(){return $q.zip}});var Vq=Md();Object.defineProperty(f,"scheduled",{enumerable:!0,get:function(){return Vq.scheduled}});var Kq=Ke();Object.defineProperty(f,"EMPTY",{enumerable:!0,get:function(){return Kq.EMPTY}});var Wq=Wd();Object.defineProperty(f,"NEVER",{enumerable:!0,get:function(){return Wq.NEVER}});zj(ob(),f);var zq=pn();Object.defineProperty(f,"config",{enumerable:!0,get:function(){return zq.config}});var Hq=Yd();Object.defineProperty(f,"audit",{enumerable:!0,get:function(){return Hq.audit}});var Yq=sb();Object.defineProperty(f,"auditTime",{enumerable:!0,get:function(){return Yq.auditTime}});var Jq=cb();Object.defineProperty(f,"buffer",{enumerable:!0,get:function(){return Jq.buffer}});var Xq=lb();Object.defineProperty(f,"bufferCount",{enumerable:!0,get:function(){return Xq.bufferCount}});var Qq=db();Object.defineProperty(f,"bufferTime",{enumerable:!0,get:function(){return Qq.bufferTime}});var Zq=hb();Object.defineProperty(f,"bufferToggle",{enumerable:!0,get:function(){return Zq.bufferToggle}});var eM=vb();Object.defineProperty(f,"bufferWhen",{enumerable:!0,get:function(){return eM.bufferWhen}});var tM=bb();Object.defineProperty(f,"catchError",{enumerable:!0,get:function(){return tM.catchError}});var rM=_b();Object.defineProperty(f,"combineAll",{enumerable:!0,get:function(){return rM.combineAll}});var nM=tp();Object.defineProperty(f,"combineLatestAll",{enumerable:!0,get:function(){return nM.combineLatestAll}});var iM=wb();Object.defineProperty(f,"combineLatestWith",{enumerable:!0,get:function(){return iM.combineLatestWith}});var oM=Ns();Object.defineProperty(f,"concatAll",{enumerable:!0,get:function(){return oM.concatAll}});var aM=rp();Object.defineProperty(f,"concatMap",{enumerable:!0,get:function(){return aM.concatMap}});var sM=Ab();Object.defineProperty(f,"concatMapTo",{enumerable:!0,get:function(){return sM.concatMapTo}});var uM=Tb();Object.defineProperty(f,"concatWith",{enumerable:!0,get:function(){return uM.concatWith}});var cM=_u();Object.defineProperty(f,"connect",{enumerable:!0,get:function(){return cM.connect}});var lM=Pb();Object.defineProperty(f,"count",{enumerable:!0,get:function(){return lM.count}});var fM=qb();Object.defineProperty(f,"debounce",{enumerable:!0,get:function(){return fM.debounce}});var dM=Mb();Object.defineProperty(f,"debounceTime",{enumerable:!0,get:function(){return dM.debounceTime}});var pM=po();Object.defineProperty(f,"defaultIfEmpty",{enumerable:!0,get:function(){return pM.defaultIfEmpty}});var xM=Rb();Object.defineProperty(f,"delay",{enumerable:!0,get:function(){return xM.delay}});var hM=op();Object.defineProperty(f,"delayWhen",{enumerable:!0,get:function(){return hM.delayWhen}});var mM=Bb();Object.defineProperty(f,"dematerialize",{enumerable:!0,get:function(){return mM.dematerialize}});var vM=Ub();Object.defineProperty(f,"distinct",{enumerable:!0,get:function(){return vM.distinct}});var gM=ap();Object.defineProperty(f,"distinctUntilChanged",{enumerable:!0,get:function(){return gM.distinctUntilChanged}});var bM=Gb();Object.defineProperty(f,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return bM.distinctUntilKeyChanged}});var _M=Vb();Object.defineProperty(f,"elementAt",{enumerable:!0,get:function(){return _M.elementAt}});var yM=Kb();Object.defineProperty(f,"endWith",{enumerable:!0,get:function(){return yM.endWith}});var DM=Wb();Object.defineProperty(f,"every",{enumerable:!0,get:function(){return DM.every}});var SM=Jb();Object.defineProperty(f,"exhaust",{enumerable:!0,get:function(){return SM.exhaust}});var EM=up();Object.defineProperty(f,"exhaustAll",{enumerable:!0,get:function(){return EM.exhaustAll}});var wM=sp();Object.defineProperty(f,"exhaustMap",{enumerable:!0,get:function(){return wM.exhaustMap}});var OM=Xb();Object.defineProperty(f,"expand",{enumerable:!0,get:function(){return OM.expand}});var CM=Vr();Object.defineProperty(f,"filter",{enumerable:!0,get:function(){return CM.filter}});var AM=Qb();Object.defineProperty(f,"finalize",{enumerable:!0,get:function(){return AM.finalize}});var FM=cp();Object.defineProperty(f,"find",{enumerable:!0,get:function(){return FM.find}});var TM=e2();Object.defineProperty(f,"findIndex",{enumerable:!0,get:function(){return TM.findIndex}});var IM=t2();Object.defineProperty(f,"first",{enumerable:!0,get:function(){return IM.first}});var PM=n2();Object.defineProperty(f,"groupBy",{enumerable:!0,get:function(){return PM.groupBy}});var jM=np();Object.defineProperty(f,"ignoreElements",{enumerable:!0,get:function(){return jM.ignoreElements}});var qM=i2();Object.defineProperty(f,"isEmpty",{enumerable:!0,get:function(){return qM.isEmpty}});var MM=o2();Object.defineProperty(f,"last",{enumerable:!0,get:function(){return MM.last}});var kM=zt();Object.defineProperty(f,"map",{enumerable:!0,get:function(){return kM.map}});var LM=ip();Object.defineProperty(f,"mapTo",{enumerable:!0,get:function(){return LM.mapTo}});var RM=a2();Object.defineProperty(f,"materialize",{enumerable:!0,get:function(){return RM.materialize}});var BM=s2();Object.defineProperty(f,"max",{enumerable:!0,get:function(){return BM.max}});var NM=co();Object.defineProperty(f,"mergeAll",{enumerable:!0,get:function(){return NM.mergeAll}});var UM=u2();Object.defineProperty(f,"flatMap",{enumerable:!0,get:function(){return UM.flatMap}});var GM=Ct();Object.defineProperty(f,"mergeMap",{enumerable:!0,get:function(){return GM.mergeMap}});var $M=l2();Object.defineProperty(f,"mergeMapTo",{enumerable:!0,get:function(){return $M.mergeMapTo}});var VM=f2();Object.defineProperty(f,"mergeScan",{enumerable:!0,get:function(){return VM.mergeScan}});var KM=x2();Object.defineProperty(f,"mergeWith",{enumerable:!0,get:function(){return KM.mergeWith}});var WM=h2();Object.defineProperty(f,"min",{enumerable:!0,get:function(){return WM.min}});var zM=ec();Object.defineProperty(f,"multicast",{enumerable:!0,get:function(){return zM.multicast}});var HM=so();Object.defineProperty(f,"observeOn",{enumerable:!0,get:function(){return HM.observeOn}});var YM=g2();Object.defineProperty(f,"onErrorResumeNextWith",{enumerable:!0,get:function(){return YM.onErrorResumeNextWith}});var JM=b2();Object.defineProperty(f,"pairwise",{enumerable:!0,get:function(){return JM.pairwise}});var XM=_2();Object.defineProperty(f,"pluck",{enumerable:!0,get:function(){return XM.pluck}});var QM=y2();Object.defineProperty(f,"publish",{enumerable:!0,get:function(){return QM.publish}});var ZM=D2();Object.defineProperty(f,"publishBehavior",{enumerable:!0,get:function(){return ZM.publishBehavior}});var ek=S2();Object.defineProperty(f,"publishLast",{enumerable:!0,get:function(){return ek.publishLast}});var tk=w2();Object.defineProperty(f,"publishReplay",{enumerable:!0,get:function(){return tk.publishReplay}});var rk=O2();Object.defineProperty(f,"raceWith",{enumerable:!0,get:function(){return rk.raceWith}});var nk=Kn();Object.defineProperty(f,"reduce",{enumerable:!0,get:function(){return nk.reduce}});var ik=A2();Object.defineProperty(f,"repeat",{enumerable:!0,get:function(){return ik.repeat}});var ok=T2();Object.defineProperty(f,"repeatWhen",{enumerable:!0,get:function(){return ok.repeatWhen}});var ak=P2();Object.defineProperty(f,"retry",{enumerable:!0,get:function(){return ak.retry}});var sk=q2();Object.defineProperty(f,"retryWhen",{enumerable:!0,get:function(){return sk.retryWhen}});var uk=xd();Object.defineProperty(f,"refCount",{enumerable:!0,get:function(){return uk.refCount}});var ck=dp();Object.defineProperty(f,"sample",{enumerable:!0,get:function(){return ck.sample}});var lk=k2();Object.defineProperty(f,"sampleTime",{enumerable:!0,get:function(){return lk.sampleTime}});var fk=L2();Object.defineProperty(f,"scan",{enumerable:!0,get:function(){return fk.scan}});var dk=B2();Object.defineProperty(f,"sequenceEqual",{enumerable:!0,get:function(){return dk.sequenceEqual}});var pk=xp();Object.defineProperty(f,"share",{enumerable:!0,get:function(){return pk.share}});var xk=G2();Object.defineProperty(f,"shareReplay",{enumerable:!0,get:function(){return xk.shareReplay}});var hk=$2();Object.defineProperty(f,"single",{enumerable:!0,get:function(){return hk.single}});var mk=V2();Object.defineProperty(f,"skip",{enumerable:!0,get:function(){return mk.skip}});var vk=K2();Object.defineProperty(f,"skipLast",{enumerable:!0,get:function(){return vk.skipLast}});var gk=z2();Object.defineProperty(f,"skipUntil",{enumerable:!0,get:function(){return gk.skipUntil}});var bk=H2();Object.defineProperty(f,"skipWhile",{enumerable:!0,get:function(){return bk.skipWhile}});var _k=J2();Object.defineProperty(f,"startWith",{enumerable:!0,get:function(){return _k.startWith}});var yk=uo();Object.defineProperty(f,"subscribeOn",{enumerable:!0,get:function(){return yk.subscribeOn}});var Dk=Q2();Object.defineProperty(f,"switchAll",{enumerable:!0,get:function(){return Dk.switchAll}});var Sk=mo();Object.defineProperty(f,"switchMap",{enumerable:!0,get:function(){return Sk.switchMap}});var Ek=e_();Object.defineProperty(f,"switchMapTo",{enumerable:!0,get:function(){return Ek.switchMapTo}});var wk=t_();Object.defineProperty(f,"switchScan",{enumerable:!0,get:function(){return wk.switchScan}});var Ok=xo();Object.defineProperty(f,"take",{enumerable:!0,get:function(){return Ok.take}});var Ck=lp();Object.defineProperty(f,"takeLast",{enumerable:!0,get:function(){return Ck.takeLast}});var Ak=r_();Object.defineProperty(f,"takeUntil",{enumerable:!0,get:function(){return Ak.takeUntil}});var Fk=n_();Object.defineProperty(f,"takeWhile",{enumerable:!0,get:function(){return Fk.takeWhile}});var Tk=i_();Object.defineProperty(f,"tap",{enumerable:!0,get:function(){return Tk.tap}});var Ik=hp();Object.defineProperty(f,"throttle",{enumerable:!0,get:function(){return Ik.throttle}});var Pk=a_();Object.defineProperty(f,"throttleTime",{enumerable:!0,get:function(){return Pk.throttleTime}});var jk=ho();Object.defineProperty(f,"throwIfEmpty",{enumerable:!0,get:function(){return jk.throwIfEmpty}});var qk=u_();Object.defineProperty(f,"timeInterval",{enumerable:!0,get:function(){return qk.timeInterval}});var Mk=As();Object.defineProperty(f,"timeout",{enumerable:!0,get:function(){return Mk.timeout}});var kk=c_();Object.defineProperty(f,"timeoutWith",{enumerable:!0,get:function(){return kk.timeoutWith}});var Lk=l_();Object.defineProperty(f,"timestamp",{enumerable:!0,get:function(){return Lk.timestamp}});var Rk=Zd();Object.defineProperty(f,"toArray",{enumerable:!0,get:function(){return Rk.toArray}});var Bk=p_();Object.defineProperty(f,"window",{enumerable:!0,get:function(){return Bk.window}});var Nk=h_();Object.defineProperty(f,"windowCount",{enumerable:!0,get:function(){return Nk.windowCount}});var Uk=v_();Object.defineProperty(f,"windowTime",{enumerable:!0,get:function(){return Uk.windowTime}});var Gk=__();Object.defineProperty(f,"windowToggle",{enumerable:!0,get:function(){return Gk.windowToggle}});var $k=D_();Object.defineProperty(f,"windowWhen",{enumerable:!0,get:function(){return $k.windowWhen}});var Vk=O_();Object.defineProperty(f,"withLatestFrom",{enumerable:!0,get:function(){return Vk.withLatestFrom}});var Kk=C_();Object.defineProperty(f,"zipAll",{enumerable:!0,get:function(){return Kk.zipAll}});var Wk=F_();Object.defineProperty(f,"zipWith",{enumerable:!0,get:function(){return Wk.zipWith}})});var N_=d((aee,B_)=>{function L_(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}var R_=B_.exports=function(t,e,r="async"){return typeof e=="string"&&(r=e,e=void 0),e=e||function(){},function(){var n=arguments,i=this,o=new Promise(function(a,s){var u=!1;let c=function(_){u&&console.warn("Run-async promise already resolved."),u=!0,a(_)};var l=!1;let p=function(_){l&&console.warn("Run-async promise already rejected."),l=!0,s(_)};var x=!1,h=!1,g=!1,b=function(){return g?(console.warn("Run-async async() called outside a valid run-async context, callback will be ignored."),function(){}):(h&&console.warn(`Run-async wrapped function (async) returned a promise.
24
24
  Calls to async() callback can have unexpected results.`),x=!0,function(_,y){_?p(_):c(y)})},m;i&&r&&Proxy?m=new Proxy(i,{get(_,y){return y===r?(y in _&&console.warn(`${r} property is been shadowed by run-sync`),b):Reflect.get(...arguments)}}):m={[r]:b};var v=t.apply(m,Array.prototype.slice.call(n));x?L_(v)&&console.warn("Run-async wrapped function (sync) returned a promise but async() callback must be executed to resolve."):L_(v)?(h=!0,v.then(c,p)):c(v),g=!0});return o.then(e.bind(null,null),e),o}};R_.cb=function(t,e){return R_(function(){var r=Array.prototype.slice.call(arguments);return r.length===t.length-1&&r.push(this.async()),t.apply(this,r)},e)}});var u0=d((Ny,Uy)=>{var oG=_e("stream");Ny=Uy.exports=Bp;Bp.through=Bp;function Bp(t,e,r){t=t||function(l){this.queue(l)},e=e||function(){this.queue(null)};var n=!1,i=!1,o=[],a=!1,s=new oG;s.readable=s.writable=!0,s.paused=!1,s.autoDestroy=!(r&&r.autoDestroy===!1),s.write=function(l){return t.call(this,l),!s.paused};function u(){for(;o.length&&!s.paused;){var l=o.shift();if(l===null)return s.emit("end");s.emit("data",l)}}s.queue=s.push=function(l){return a||(l===null&&(a=!0),o.push(l),u()),s},s.on("end",function(){s.readable=!1,!s.writable&&s.autoDestroy&&process.nextTick(function(){s.destroy()})});function c(){s.writable=!1,e.call(s),!s.readable&&s.autoDestroy&&s.destroy()}return s.end=function(l){if(!n)return n=!0,arguments.length&&s.write(l),c(),s},s.destroy=function(){if(!i)return i=!0,n=!0,o.length=0,s.writable=s.readable=!1,s.emit("close"),s},s.pause=function(){if(!s.paused)return s.paused=!0,s},s.resume=function(){return s.paused&&(s.paused=!1,s.emit("resume")),u(),s.paused||s.emit("drain"),s},s}});var $y=d((Yse,Gy)=>{"use strict";var aG=_e("stream");Gy.exports=function t(e){if(Array.isArray(e)){var r=0,n=e.length;return t(function(s){return r<n?this.emit("data",e[r++]):this.emit("end"),!0})}var i=new aG,o=0;i.ended=!1,i.started=!1,i.readable=!0,i.writable=!1,i.paused=!1,i.ended=!1,i.pause=function(){i.started=!0,i.paused=!0};function a(){if(i.started=!0,!i.ended)for(;!i.ended&&!i.paused&&e.call(i,o++,function(){!i.ended&&!i.paused&&process.nextTick(a)}););}return i.resume=function(){i.started=!0,i.paused=!1,a()},i.on("end",function(){i.ended=!0,i.readable=!1,process.nextTick(i.destroy)}),i.destroy=function(){i.ended=!0,i.emit("close")},process.nextTick(function(){i.started||i.resume()}),i}});var Up=d((Jse,Ky)=>{var sG=_e("stream"),uG=["write","end","destroy"],cG=["resume","pause"],lG=["data","close"],Vy=Array.prototype.slice;Ky.exports=fG;function Np(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r)}function fG(t,e){var r=new sG,n=!1;return Np(uG,i),Np(cG,o),Np(lG,a),e.on("end",s),t.on("drain",function(){r.emit("drain")}),t.on("error",u),e.on("error",u),r.writable=t.writable,r.readable=e.readable,r;function i(c){r[c]=l;function l(){return t[c].apply(t,arguments)}}function o(c){r[c]=l;function l(){r.emit(c);var p=e[c];if(p)return p.apply(e,arguments);e.emit(c)}}function a(c){e.on(c,l);function l(){var p=Vy.call(arguments);p.unshift(c),r.emit.apply(r,p)}}function s(){if(!n){n=!0;var c=Vy.call(arguments);c.unshift("end"),r.emit.apply(r,c)}}function u(c){r.emit("error",c)}}});var zy=d((Xse,Wy)=>{var dG=_e("stream").Stream;Wy.exports=function(t,e){var r=new dG,n=this,i=0,o=0,a=!1,s=!1,u=!1,c=0,l=!1;this.opts=e||{};var p=this.opts.failures?"failure":"error",x={};r.writable=!0,r.readable=!0;function h(v,_){var y=c+1;if(_===y?(v!==void 0&&r.emit.apply(r,["data",v]),c++,y++):x[_]=v,x.hasOwnProperty(y)){var A=x[y];return delete x[y],h(A,y)}o++,i===o&&(s&&(s=!1,r.emit("drain")),a&&m())}function g(v,_,y){u||(l=!0,(!v||n.opts.failures)&&h(_,y),v&&r.emit.apply(r,[p,v]),l=!1)}function b(v,_,y){return t.call(null,v,function(A,w){y(A,w,_)})}r.write=function(v){if(a)throw new Error("map stream is not writable");l=!1,i++;try{var _=b(v,i,g);return s=_===!1,!s}catch(y){if(l)throw y;return g(y),!s}};function m(v){if(a=!0,r.writable=!1,v!==void 0)return h(v,i);i==o&&(r.readable=!1,r.emit("end"),r.destroy())}return r.end=function(v){a||m()},r.destroy=function(){a=u=!0,r.writable=r.readable=s=!1,process.nextTick(function(){r.emit("close")})},r.pause=function(){s=!0},r.resume=function(){s=!1},r}});var Yy=d((Qse,Hy)=>{Hy.exports=u0()});var Xy=d((Zse,Jy)=>{var pG=u0(),xG=_e("string_decoder").StringDecoder;Jy.exports=hG;function hG(t,e,r){var n=new xG,i="",o=r&&r.maxLength;typeof t=="function"&&(e=t,t=null),t||(t=/\r?\n/);function a(u,c){if(e){try{c=e(c)}catch(l){return u.emit("error",l)}typeof c<"u"&&u.queue(c)}else u.queue(c)}function s(u,c){var l=((i??"")+c).split(t);i=l.pop(),o&&i.length>o&&u.emit("error",new Error("maximum buffer reached"));for(var p=0;p<l.length;p++){var x=l[p];a(u,x)}}return pG(function(u){s(this,n.write(u))},function(){n.end&&s(this,n.end()),i!=null&&a(this,i),this.queue(null)})}});var Zy=d((eue,Qy)=>{var mG=Up();Qy.exports=function(){var t=[].slice.call(arguments),e=t[0],r=t[t.length-1],n=mG(e,r);if(t.length==1)return t[0];if(!t.length)throw new Error("connect called with empty args");function i(s){s.length<2||(s[0].pipe(s[1]),i(s.slice(1)))}i(t);function o(){var s=[].slice.call(arguments);s.unshift("error"),n.emit.apply(n,s)}for(var a=1;a<t.length-1;a++)t[a].on("error",o);return n}});var t6=d(e6=>{var Do=_e("stream").Stream,G=e6,vG=u0(),gG=$y(),bG=Up(),_G=zy(),yG=Yy(),DG=Xy(),SG=Zy(),EG=global.setImmediate||process.nextTick;G.Stream=Do;G.through=vG;G.from=gG;G.duplex=bG;G.map=_G;G.pause=yG;G.split=DG;G.pipeline=G.connect=G.pipe=SG;G.concat=G.merge=function(){var t=[].slice.call(arguments);t.length===1&&t[0]instanceof Array&&(t=t[0]);var e=new Do;e.setMaxListeners(0);var r=0;return e.writable=e.readable=!0,t.length?t.forEach(function(n){n.pipe(e,{end:!1});var i=!1;n.on("end",function(){i||(i=!0,r++,r==t.length&&e.emit("end"))})}):process.nextTick(function(){e.emit("end")}),e.write=function(n){this.emit("data",n)},e.destroy=function(){t.forEach(function(n){n.destroy&&n.destroy()})},e};G.writeArray=function(t){if(typeof t!="function")throw new Error("function writeArray (done): done must be function");var e=new Do,r=[],n=!1;return e.write=function(i){r.push(i)},e.end=function(){n=!0,t(null,r)},e.writable=!0,e.readable=!1,e.destroy=function(){e.writable=e.readable=!1,!n&&t(new Error("destroyed before end"),r)},e};G.readArray=function(t){var e=new Do,r=0,n=!1,i=!1;if(e.readable=!0,e.writable=!1,!Array.isArray(t))throw new Error("event-stream.read expects an array");return e.resume=function(){if(!i){n=!1;for(var o=t.length;r<o&&!n&&!i;)e.emit("data",t[r++]);r==o&&!i&&(i=!0,e.readable=!1,e.emit("end"))}},process.nextTick(e.resume),e.pause=function(){n=!0},e.destroy=function(){i=!0,e.emit("close")},e};G.readable=function(t,e){var r=new Do,n=0,i=!1,o=!1,a=!1;if(r.readable=!0,r.writable=!1,typeof t!="function")throw new Error("event-stream.readable expects async function");r.on("end",function(){o=!0});function s(u,c){u?(r.emit("error",u),e||r.emit("end")):arguments.length>1&&r.emit("data",c),EG(function(){if(!(o||i||a))try{a=!0,t.call(r,n++,function(){a=!1,s.apply(null,arguments)})}catch(l){r.emit("error",l)}})}return r.resume=function(){i=!1,s()},process.nextTick(s),r.pause=function(){i=!0},r.destroy=function(){r.emit("end"),r.emit("close"),o=!0},r};G.mapSync=function(t){return G.through(function(r){var n;try{n=t(r)}catch(i){return this.emit("error",i)}n!==void 0&&this.emit("data",n)})};G.log=function(t){return G.through(function(e){var r=[].slice.call(arguments);t?console.error(t,e):console.error(e),this.emit("data",e)})};G.child=function(t){return G.duplex(t.stdin,t.stdout)};G.parse=function(t){var e=!!(t&&t.error);return G.through(function(r){var n;try{r&&(n=JSON.parse(r.toString()))}catch(i){return e?this.emit("error",i):console.error(i,"attempting to parse:",r)}n!==void 0&&this.emit("data",n)})};G.stringify=function(){var t=_e("buffer").Buffer;return G.mapSync(function(e){return JSON.stringify(t.isBuffer(e)?e.toString():e)+`
25
- `})};G.replace=function(t,e){return G.pipeline(G.split(t),G.join(e))};G.join=function(t){if(typeof t=="function")return G.wait(t);var e=!0;return G.through(function(r){return e||this.emit("data",t),e=!1,this.emit("data",r),!0})};G.wait=function(t){var e=[];return G.through(function(r){e.push(r)},function(){var r=Buffer.isBuffer(e[0])?Buffer.concat(e):e.join("");this.emit("data",r),this.emit("end"),t&&t(null,r)})};G.pipeable=function(){throw new Error("[EVENT-STREAM] es.pipeable is deprecated")}});var i6=d((rue,n6)=>{"use strict";var r6=_e("child_process").spawn,c0=t6();n6.exports=function(e,r){var n=null;if(typeof r!="function")throw new Error("childrenOfPid(pid, callback) expects callback");typeof e=="number"&&(e=e.toString());var i;process.platform==="win32"?i=r6("wmic.exe",["PROCESS","GET","Name,ProcessId,ParentProcessId,Status"]):i=r6("ps",["-A","-o","ppid,pid,stat,comm"]),c0.connect(i.stdout,c0.split(),c0.map(function(o,a){var s=o.trim().split(/\s+/);if(!n)return n=s,n=n.map(wG),a();for(var u={},c=n.slice();c.length;)u[c.shift()]=c.length?s.shift():s.join(" ");return a(null,u)}),c0.writeArray(function(o,a){var s={},u=[];s[e]=!0,a.forEach(function(c){s[c.PPID]&&(s[c.PID]=!0,u.push(c))}),r(null,u)})).on("error",r)};function wG(t){if(process.platform!=="win32")return t;switch(t){case"Name":return"COMMAND";case"ParentProcessId":return"PPID";case"ProcessId":return"PID";case"Status":return"STAT";default:throw new Error("Unknown process listing header: "+t)}}});var F6=d(q=>{"use strict";var Kp=Symbol.for("react.transitional.element"),NG=Symbol.for("react.portal"),UG=Symbol.for("react.fragment"),GG=Symbol.for("react.strict_mode"),$G=Symbol.for("react.profiler"),VG=Symbol.for("react.consumer"),KG=Symbol.for("react.context"),WG=Symbol.for("react.forward_ref"),zG=Symbol.for("react.suspense"),HG=Symbol.for("react.memo"),S6=Symbol.for("react.lazy"),YG=Symbol.for("react.activity"),b6=Symbol.iterator;function JG(t){return t===null||typeof t!="object"?null:(t=b6&&t[b6]||t["@@iterator"],typeof t=="function"?t:null)}var E6={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w6=Object.assign,O6={};function gi(t,e,r){this.props=t,this.context=e,this.refs=O6,this.updater=r||E6}gi.prototype.isReactComponent={};gi.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};gi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function C6(){}C6.prototype=gi.prototype;function Wp(t,e,r){this.props=t,this.context=e,this.refs=O6,this.updater=r||E6}var zp=Wp.prototype=new C6;zp.constructor=Wp;w6(zp,gi.prototype);zp.isPureReactComponent=!0;var _6=Array.isArray;function Vp(){}var J={H:null,A:null,T:null,S:null},A6=Object.prototype.hasOwnProperty;function Hp(t,e,r){var n=r.ref;return{$$typeof:Kp,type:t,key:e,ref:n!==void 0?n:null,props:r}}function XG(t,e){return Hp(t.type,e,t.props)}function Yp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Kp}function QG(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var y6=/\/+/g;function $p(t,e){return typeof t=="object"&&t!==null&&t.key!=null?QG(""+t.key):e.toString(36)}function ZG(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Vp,Vp):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function vi(t,e,r,n,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Kp:case NG:a=!0;break;case S6:return a=t._init,vi(a(t._payload),e,r,n,i)}}if(a)return i=i(t),a=n===""?"."+$p(t,0):n,_6(i)?(r="",a!=null&&(r=a.replace(y6,"$&/")+"/"),vi(i,e,r,"",function(c){return c})):i!=null&&(Yp(i)&&(i=XG(i,r+(i.key==null||t&&t.key===i.key?"":(""+i.key).replace(y6,"$&/")+"/")+a)),e.push(i)),1;a=0;var s=n===""?".":n+":";if(_6(t))for(var u=0;u<t.length;u++)n=t[u],o=s+$p(n,u),a+=vi(n,e,r,o,i);else if(u=JG(t),typeof u=="function")for(t=u.call(t),u=0;!(n=t.next()).done;)n=n.value,o=s+$p(n,u++),a+=vi(n,e,r,o,i);else if(o==="object"){if(typeof t.then=="function")return vi(ZG(t),e,r,n,i);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function p0(t,e,r){if(t==null)return t;var n=[],i=0;return vi(t,n,"","",function(o){return e.call(r,o,i++)}),n}function e$(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var D6=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},t$={map:p0,forEach:function(t,e,r){p0(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return p0(t,function(){e++}),e},toArray:function(t){return p0(t,function(e){return e})||[]},only:function(t){if(!Yp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};q.Activity=YG;q.Children=t$;q.Component=gi;q.Fragment=UG;q.Profiler=$G;q.PureComponent=Wp;q.StrictMode=GG;q.Suspense=zG;q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J;q.__COMPILER_RUNTIME={__proto__:null,c:function(t){return J.H.useMemoCache(t)}};q.cache=function(t){return function(){return t.apply(null,arguments)}};q.cacheSignal=function(){return null};q.cloneElement=function(t,e,r){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var n=w6({},t.props),i=t.key;if(e!=null)for(o in e.key!==void 0&&(i=""+e.key),e)!A6.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(n[o]=e[o]);var o=arguments.length-2;if(o===1)n.children=r;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];n.children=a}return Hp(t.type,i,n)};q.createContext=function(t){return t={$$typeof:KG,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:VG,_context:t},t};q.createElement=function(t,e,r){var n,i={},o=null;if(e!=null)for(n in e.key!==void 0&&(o=""+e.key),e)A6.call(e,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var s=Array(a),u=0;u<a;u++)s[u]=arguments[u+2];i.children=s}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return Hp(t,o,i)};q.createRef=function(){return{current:null}};q.forwardRef=function(t){return{$$typeof:WG,render:t}};q.isValidElement=Yp;q.lazy=function(t){return{$$typeof:S6,_payload:{_status:-1,_result:t},_init:e$}};q.memo=function(t,e){return{$$typeof:HG,type:t,compare:e===void 0?null:e}};q.startTransition=function(t){var e=J.T,r={};J.T=r;try{var n=t(),i=J.S;i!==null&&i(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Vp,D6)}catch(o){D6(o)}finally{e!==null&&r.types!==null&&(e.types=r.types),J.T=e}};q.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()};q.use=function(t){return J.H.use(t)};q.useActionState=function(t,e,r){return J.H.useActionState(t,e,r)};q.useCallback=function(t,e){return J.H.useCallback(t,e)};q.useContext=function(t){return J.H.useContext(t)};q.useDebugValue=function(){};q.useDeferredValue=function(t,e){return J.H.useDeferredValue(t,e)};q.useEffect=function(t,e){return J.H.useEffect(t,e)};q.useEffectEvent=function(t){return J.H.useEffectEvent(t)};q.useId=function(){return J.H.useId()};q.useImperativeHandle=function(t,e,r){return J.H.useImperativeHandle(t,e,r)};q.useInsertionEffect=function(t,e){return J.H.useInsertionEffect(t,e)};q.useLayoutEffect=function(t,e){return J.H.useLayoutEffect(t,e)};q.useMemo=function(t,e){return J.H.useMemo(t,e)};q.useOptimistic=function(t,e){return J.H.useOptimistic(t,e)};q.useReducer=function(t,e,r){return J.H.useReducer(t,e,r)};q.useRef=function(t){return J.H.useRef(t)};q.useState=function(t){return J.H.useState(t)};q.useSyncExternalStore=function(t,e,r){return J.H.useSyncExternalStore(t,e,r)};q.useTransition=function(){return J.H.useTransition()};q.version="19.2.3"});var I6=d((Iue,T6)=>{"use strict";T6.exports=F6()});var be=d(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.Log=ze.LogLevel=void 0;var r$=" DEBUG ",n$=" INFO ",i$=" WARN ",o$=" ERROR ";function x0(t){return t.unshift("[Statsig]"),t}ze.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};var h0=class t{static info(...e){t.level>=ze.LogLevel.Info&&console.info(n$,...x0(e))}static debug(...e){t.level>=ze.LogLevel.Debug&&console.debug(r$,...x0(e))}static warn(...e){t.level>=ze.LogLevel.Warn&&console.warn(i$,...x0(e))}static error(...e){t.level>=ze.LogLevel.Error&&console.error(o$,...x0(e))}};ze.Log=h0;h0.level=ze.LogLevel.Warn});var Mt=d(He=>{"use strict";var Jp,Xp,Qp;Object.defineProperty(He,"__esModule",{value:!0});He._getInstance=He._getStatsigGlobalFlag=He._getStatsigGlobal=void 0;var a$=be(),s$=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Oo}catch{return Oo}};He._getStatsigGlobal=s$;var u$=t=>(0,He._getStatsigGlobal)()[t];He._getStatsigGlobalFlag=u$;var c$=t=>{let e=(0,He._getStatsigGlobal)();return t?e.instances&&e.instances[t]:(e.instances&&Object.keys(e.instances).length>1&&a$.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};He._getInstance=c$;var bi="__STATSIG__",P6=typeof window<"u"?window:{},j6=typeof global<"u"?global:{},q6=typeof globalThis<"u"?globalThis:{},Oo=(Qp=(Xp=(Jp=P6[bi])!==null&&Jp!==void 0?Jp:j6[bi])!==null&&Xp!==void 0?Xp:q6[bi])!==null&&Qp!==void 0?Qp:{instance:He._getInstance};P6[bi]=Oo;j6[bi]=Oo;q6[bi]=Oo});var v0=d(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.Diagnostics=void 0;var m0=new Map,Zp="start",ex="end",l$="statsig::diagnostics";Yr.Diagnostics={_getMarkers:t=>m0.get(t),_markInitOverallStart:t=>{yi(t,_i({},Zp,"overall"))},_markInitOverallEnd:(t,e,r)=>{yi(t,_i({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:r},ex,"overall"))},_markInitNetworkReqStart:(t,e)=>{yi(t,_i(e,Zp,"initialize","network_request"))},_markInitNetworkReqEnd:(t,e)=>{yi(t,_i(e,ex,"initialize","network_request"))},_markInitProcessStart:t=>{yi(t,_i({},Zp,"initialize","process"))},_markInitProcessEnd:(t,e)=>{yi(t,_i(e,ex,"initialize","process"))},_clearMarkers:t=>{m0.delete(t)},_formatError(t){if(t&&typeof t=="object")return{code:tx(t,"code"),name:tx(t,"name"),message:tx(t,"message")}},_getDiagnosticsData(t,e,r,n){var i;return{success:t?.ok===!0,statusCode:t?.status,sdkRegion:(i=t?.headers)===null||i===void 0?void 0:i.get("x-statsig-region"),isDelta:r.includes('"is_delta":true')===!0?!0:void 0,attempt:e,error:Yr.Diagnostics._formatError(n)}},_enqueueDiagnosticsEvent(t,e,r,n){let i=Yr.Diagnostics._getMarkers(r);if(i==null||i.length<=0)return-1;let o=i[i.length-1].timestamp-i[0].timestamp;Yr.Diagnostics._clearMarkers(r);let a=f$(t,{context:"initialize",markers:i.slice(),statsigOptions:n});return e.enqueue(a),o}};function _i(t,e,r,n){return Object.assign({key:r,action:e,step:n,timestamp:Date.now()},t)}function f$(t,e){return{eventName:l$,user:t,value:null,metadata:e,time:Date.now()}}function yi(t,e){var r;let n=(r=m0.get(t))!==null&&r!==void 0?r:[];n.push(e),m0.set(t,n)}function tx(t,e){if(e in t)return t[e]}});var g0=d(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di._isTypeMatch=Di._typeOf=void 0;function d$(t){return Array.isArray(t)?"array":typeof t}Di._typeOf=d$;function p$(t,e){let r=n=>Array.isArray(n)?"array":n===null?"null":typeof n;return r(t)===r(e)}Di._isTypeMatch=p$});var Jr=d(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye._getSortedObject=Ye._DJB2Object=Ye._DJB2=void 0;var x$=g0(),h$=t=>{let e=0;for(let r=0;r<t.length;r++){let n=t.charCodeAt(r);e=(e<<5)-e+n,e=e&e}return String(e>>>0)};Ye._DJB2=h$;var m$=(t,e)=>(0,Ye._DJB2)(JSON.stringify((0,Ye._getSortedObject)(t,e)));Ye._DJB2Object=m$;var v$=(t,e)=>{if(t==null)return null;let r=Object.keys(t).sort(),n={};return r.forEach(i=>{let o=t[i];if(e===0||(0,x$._typeOf)(o)!=="object"){n[i]=o;return}n[i]=(0,Ye._getSortedObject)(o,e!=null?e-1:e)}),n};Ye._getSortedObject=v$});var Co=d(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si._getStorageKey=Si._getUserStorageKey=void 0;var M6=Jr();function k6(t,e,r){var n;if(r)return r(t,e);let i=e&&e.customIDs?e.customIDs:{},o=[`uid:${(n=e?.userID)!==null&&n!==void 0?n:""}`,`cids:${Object.keys(i).sort((a,s)=>a.localeCompare(s)).map(a=>`${a}-${i[a]}`).join(",")}`,`k:${t}`];return(0,M6._DJB2)(o.join("|"))}Si._getUserStorageKey=k6;function g$(t,e,r){return e?k6(t,e,r):(0,M6._DJB2)(`k:${t}`)}Si._getStorageKey=g$});var Ao=d(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.NetworkParam=Je.NetworkDefault=Je.Endpoint=void 0;Je.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"};Je.NetworkDefault={[Je.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Je.Endpoint._initialize]:"https://featureassets.org/v1",[Je.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"};Je.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}});var kt=d(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te._cloneObject=te._getUnloadEvent=te._getCurrentPageUrlSafe=te._addDocumentEventListenerSafe=te._addWindowEventListenerSafe=te._isServerEnv=te._getDocumentSafe=te._getWindowSafe=void 0;var b$=be(),_$=()=>typeof window<"u"?window:null;te._getWindowSafe=_$;var y$=()=>{var t;let e=(0,te._getWindowSafe)();return(t=e?.document)!==null&&t!==void 0?t:null};te._getDocumentSafe=y$;var D$=()=>{if((0,te._getDocumentSafe)()!==null)return!1;let t=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||t};te._isServerEnv=D$;var S$=(t,e)=>{let r=(0,te._getWindowSafe)();typeof r?.addEventListener=="function"&&r.addEventListener(t,e)};te._addWindowEventListenerSafe=S$;var E$=(t,e)=>{let r=(0,te._getDocumentSafe)();typeof r?.addEventListener=="function"&&r.addEventListener(t,e)};te._addDocumentEventListenerSafe=E$;var w$=()=>{var t;try{return(t=(0,te._getWindowSafe)())===null||t===void 0?void 0:t.location.href.split(/[?#]/)[0]}catch{return}};te._getCurrentPageUrlSafe=w$;var O$=()=>{let t=(0,te._getWindowSafe)();return t&&"onpagehide"in t?"pagehide":"beforeunload"};te._getUnloadEvent=O$;var C$=(t,e)=>{try{return JSON.parse(JSON.stringify(e))}catch{return b$.Log.error(`Failed to clone object ${t}`),null}};te._cloneObject=C$});var nx=d(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge._createLayerParameterExposure=Ge._createConfigExposure=Ge._mapExposures=Ge._createGateExposure=Ge._isExposureEvent=void 0;var L6="statsig::config_exposure",R6="statsig::gate_exposure",B6="statsig::layer_exposure",rx=(t,e,r,n,i)=>(r.bootstrapMetadata&&(n.bootstrapMetadata=r.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:P$(r,n),secondaryExposures:i,time:Date.now()}),A$=({eventName:t})=>t===R6||t===L6||t===B6;Ge._isExposureEvent=A$;var F$=(t,e,r)=>{var n,i,o;let a={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return((n=e.__evaluation)===null||n===void 0?void 0:n.version)!=null&&(a.configVersion=e.__evaluation.version),rx(R6,t,e.details,a,b0((o=(i=e.__evaluation)===null||i===void 0?void 0:i.secondary_exposures)!==null&&o!==void 0?o:[],r))};Ge._createGateExposure=F$;function b0(t,e){return t.map(r=>typeof r=="string"?(e??{})[r]:r).filter(r=>r!=null)}Ge._mapExposures=b0;var T$=(t,e,r)=>{var n,i,o,a;let s={config:e.name,ruleID:e.ruleID};return((n=e.__evaluation)===null||n===void 0?void 0:n.version)!=null&&(s.configVersion=e.__evaluation.version),((i=e.__evaluation)===null||i===void 0?void 0:i.passed)!=null&&(s.rulePassed=String(e.__evaluation.passed)),rx(L6,t,e.details,s,b0((a=(o=e.__evaluation)===null||o===void 0?void 0:o.secondary_exposures)!==null&&a!==void 0?a:[],r))};Ge._createConfigExposure=T$;var I$=(t,e,r,n)=>{var i,o,a,s,u,c,l;let p=e.__evaluation,x=((i=p?.explicit_parameters)===null||i===void 0?void 0:i.includes(r))===!0,h="",g=(o=p?.undelegated_secondary_exposures)!==null&&o!==void 0?o:[];x&&(h=(a=p.allocated_experiment_name)!==null&&a!==void 0?a:"",g=(s=p.secondary_exposures)!==null&&s!==void 0?s:[]);let b=(u=e.__evaluation)===null||u===void 0?void 0:u.parameter_rule_ids,m={config:e.name,parameterName:r,ruleID:(c=b?.[r])!==null&&c!==void 0?c:e.ruleID,allocatedExperiment:h,isExplicitParameter:String(x)};return((l=e.__evaluation)===null||l===void 0?void 0:l.version)!=null&&(m.configVersion=e.__evaluation.version),rx(B6,t,e.details,m,b0(g,n))};Ge._createLayerParameterExposure=I$;var P$=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)});var Fo=d(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.LoggingEnabledOption=Ei.LogEventCompressionMode=void 0;Ei.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"};Ei.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}});var Lt=d(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe._setObjectInStorage=Xe._getObjectFromStorage=Xe.Storage=void 0;var U6=be(),j$=kt(),To={},ox={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>To[t]?To[t]:null,setItem:(t,e)=>{To[t]=e},removeItem:t=>{delete To[t]},getAllKeys:()=>Object.keys(To)},_0=null;try{let t=(0,j$._getWindowSafe)();t&&t.localStorage&&typeof t.localStorage.getItem=="function"&&(_0={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:e=>t.localStorage.getItem(e),setItem:(e,r)=>t.localStorage.setItem(e,r),removeItem:e=>t.localStorage.removeItem(e),getAllKeys:()=>Object.keys(t.localStorage)})}catch{U6.Log.warn("Failed to setup localStorageProvider.")}var ix=_0??ox,mt=ix;function N6(t){try{return t()}catch(e){if(e instanceof Error&&e.name==="SecurityError")return Xe.Storage._setProvider(ox),null;throw e}}Xe.Storage={isReady:()=>mt.isReady(),isReadyResolver:()=>mt.isReadyResolver(),getProviderName:()=>mt.getProviderName(),getItem:t=>N6(()=>mt.getItem(t)),setItem:(t,e)=>N6(()=>mt.setItem(t,e)),removeItem:t=>mt.removeItem(t),getAllKeys:()=>mt.getAllKeys(),_setProvider:t=>{ix=t,mt=t},_setDisabled:t=>{t?mt=ox:mt=ix}};function q$(t){let e=Xe.Storage.getItem(t);try{return JSON.parse(e??"null")}catch{return U6.Log.error(`Failed to parse value for key "${t}"`),null}}Xe._getObjectFromStorage=q$;function M$(t,e){Xe.Storage.setItem(t,JSON.stringify(e))}Xe._setObjectInStorage=M$});var sx=d(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});D0.UrlConfiguration=void 0;var k$=Jr(),y0=Ao(),L$={[y0.Endpoint._initialize]:"i",[y0.Endpoint._rgstr]:"e",[y0.Endpoint._download_config_specs]:"d"},ax=class{constructor(e,r,n,i){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=L$[e],r&&(this.customUrl=r),!r&&n&&(this.customUrl=n.endsWith("/")?`${n}${e}`:`${n}/${e}`),i&&(this.fallbackUrls=i);let o=y0.NetworkDefault[e];this.defaultUrl=`${o}/${e}`}getUrl(){var e;return(e=this.customUrl)!==null&&e!==void 0?e:this.defaultUrl}getChecksum(){var e;let r=((e=this.fallbackUrls)!==null&&e!==void 0?e:[]).sort().join(",");return(0,k$._DJB2)(this.customUrl+r)}};D0.UrlConfiguration=ax});var E0=d(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe._notifyVisibilityChanged=Fe._subscribeToVisiblityChanged=Fe._isUnloading=Fe._isCurrentlyVisible=void 0;var Io=kt(),S0="foreground",cx="background",G6=[],ux=S0,lx=!1,R$=()=>ux===S0;Fe._isCurrentlyVisible=R$;var B$=()=>lx;Fe._isUnloading=B$;var N$=t=>{G6.unshift(t)};Fe._subscribeToVisiblityChanged=N$;var U$=t=>{t!==ux&&(ux=t,G6.forEach(e=>e(t)))};Fe._notifyVisibilityChanged=U$;(0,Io._addWindowEventListenerSafe)("focus",()=>{lx=!1,(0,Fe._notifyVisibilityChanged)(S0)});(0,Io._addWindowEventListenerSafe)("blur",()=>(0,Fe._notifyVisibilityChanged)(cx));(0,Io._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Fe._notifyVisibilityChanged)(document.visibilityState==="visible"?S0:cx)});(0,Io._addWindowEventListenerSafe)((0,Io._getUnloadEvent)(),()=>{lx=!0,(0,Fe._notifyVisibilityChanged)(cx)})});var px=d(Oi=>{"use strict";var Po=Oi&&Oi.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.EventLogger=void 0;var G$=Co(),$$=Jr(),wi=be(),$6=Ao(),fx=kt(),V$=nx(),V6=Fo(),gr=Lt(),K$=sx(),K6=E0(),W$=100,z$=1e4,H$=1e3,Y$=6e5,J$=500,W6=200,jo={},dx=class t{static _safeFlushAndForget(e){var r;(r=jo[e])===null||r===void 0||r.flush().catch(()=>{})}static _safeRetryFailedLogs(e){var r;(r=jo[e])===null||r===void 0||r._retryFailedLogs()}constructor(e,r,n,i){var o,a;this._sdkKey=e,this._emitter=r,this._network=n,this._options=i,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(o=i?.loggingEnabled)!==null&&o!==void 0?o:i?.disableLogging===!0?V6.LoggingEnabledOption.disabled:V6.LoggingEnabledOption.browserOnly,i?.loggingEnabled&&i.disableLogging!==void 0&&wi.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(a=i?.loggingBufferMaxSize)!==null&&a!==void 0?a:W$;let s=i?.networkConfig;this._logEventUrlConfig=new K$.UrlConfiguration($6.Endpoint._rgstr,s?.logEventUrl,s?.api,s?.logEventFallbackUrls)}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}setLoggingEnabled(e){if(this._loggingEnabled==="disabled"&&e!=="disabled"){let r=this._getStorageKey(),n=(0,gr._getObjectFromStorage)(r);n&&this._queue.push(...n),gr.Storage.removeItem(r)}this._loggingEnabled=e}enqueue(e){this._shouldLogEvent(e)&&(this._normalizeAndAppendEvent(e),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&t._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(e){var r;let n=(r=this._nonExposedChecks[e])!==null&&r!==void 0?r:0;this._nonExposedChecks[e]=n+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e;let r=(0,fx._isServerEnv)();r&&((e=this._options)===null||e===void 0?void 0:e.loggingEnabled)!=="always"||(jo[this._sdkKey]=this,r||(0,K6._subscribeToVisiblityChanged)(n=>{n==="background"?t._safeFlushAndForget(this._sdkKey):n==="foreground"&&t._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(),this._startBackgroundFlushInterval())}stop(){return Po(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete jo[this._sdkKey],yield this.flush()})}flush(){return Po(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;let e=this._queue;this._queue=[],yield this._sendEvents(e)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>W6)&&setTimeout(()=>t._safeFlushAndForget(this._sdkKey),W6))}_shouldLogEvent(e){var r;if(((r=this._options)===null||r===void 0?void 0:r.loggingEnabled)!=="always"&&(0,fx._isServerEnv)())return!1;if(!(0,V$._isExposureEvent)(e))return!0;let n=e.user?e.user:{statsigEnvironment:void 0},i=(0,G$._getUserStorageKey)(this._sdkKey,n),o=e.metadata?e.metadata:{},a=[e.eventName,i,o.gate,o.config,o.ruleID,o.allocatedExperiment,o.parameterName,String(o.isExplicitParameter),o.reason].join("|"),s=this._lastExposureTimeMap[a],u=Date.now();return s&&u-s<Y$?!1:(Object.keys(this._lastExposureTimeMap).length>H$&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[a]=u,!0)}_sendEvents(e){return Po(this,void 0,void 0,function*(){var r,n;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(e),!1;try{let o=(0,K6._isUnloading)()&&this._network.isBeaconSupported()&&((n=(r=this._options)===null||r===void 0?void 0:r.networkConfig)===null||n===void 0?void 0:n.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:e}),(o?this._sendEventsViaBeacon(e):yield this._sendEventsViaPost(e)).success?(this._emitter({name:"logs_flushed",events:e}),!0):(wi.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(e),!1)}catch{return wi.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(e){return Po(this,void 0,void 0,function*(){var r;let n=yield this._network.post(this._getRequestData(e)),i=(r=n?.code)!==null&&r!==void 0?r:-1;return{success:i>=200&&i<300}})}_sendEventsViaBeacon(e){return{success:this._network.beacon(this._getRequestData(e))}}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[$6.NetworkParam.EventCount]:String(e.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(e){for(;e.length>J$;)e.shift();let r=this._getStorageKey();try{let n=this._getFailedLogsFromStorage(r);(0,gr._setObjectInStorage)(r,[...n,...e])}catch{wi.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(e){let r=[];try{let n=(0,gr._getObjectFromStorage)(e);return Array.isArray(n)&&(r=n),r}catch{return[]}}_retryFailedLogs(){let e=this._getStorageKey();Po(this,void 0,void 0,function*(){gr.Storage.isReady()||(yield gr.Storage.isReadyResolver());let r=(0,gr._getObjectFromStorage)(e);r&&(gr.Storage.removeItem(e),yield this._sendEvents(r))}).catch(()=>{wi.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,$$._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let r={},n=this._getCurrentPageUrl();n&&(r.statsigMetadata={currentPage:n});let i=Object.assign(Object.assign({},e),r);wi.Log.debug("Enqueued Event:",i),this._queue.push(i)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var e;if(((e=this._options)===null||e===void 0?void 0:e.includeCurrentPageUrlWithEvents)!==!1)return(0,fx._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var e,r;let n=(r=(e=this._options)===null||e===void 0?void 0:e.loggingIntervalMs)!==null&&r!==void 0?r:z$,i=setInterval(()=>{let o=jo[this._sdkKey];!o||o._flushIntervalId!==i?clearInterval(i):t._safeFlushAndForget(this._sdkKey)},n);this._flushIntervalId=i}};Oi.EventLogger=dx});var qo=d(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.StatsigMetadataProvider=Xr.SDK_VERSION=void 0;Xr.SDK_VERSION="3.31.0";var xx={sdkVersion:Xr.SDK_VERSION,sdkType:"js-mono"};Xr.StatsigMetadataProvider={get:()=>xx,add:t=>{xx=Object.assign(Object.assign({},xx),t)}}});var H6=d(z6=>{"use strict";Object.defineProperty(z6,"__esModule",{value:!0})});var O0=d(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.getUUID=void 0;function X$(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let t=new Date().getTime(),e=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,n=>{let i=Math.random()*16;return t>0?(i=(t+i)%16|0,t=Math.floor(t/16)):(i=(e+i)%16|0,e=Math.floor(e/16)),(n==="x"?i:i&7|8).toString(16)})}w0.getUUID=X$});var ko=d(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.getCookieName=Ci.StableID=void 0;var X6=Co(),Q$=be(),Q6=kt(),Z6=Lt(),Z$=O0(),Mo={},mx={},Y6={};Ci.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:t=>{if(Y6[t])return null;if(Mo[t]!=null)return Mo[t];let e=null;return e=tV(t),e!=null?(Mo[t]=e,hx(e,t),e):(e=eV(t),e==null&&(e=(0,Z$.getUUID)()),hx(e,t),J6(e,t),Mo[t]=e,e)},setOverride:(t,e)=>{Mo[e]=t,hx(t,e),J6(t,e)},_setCookiesEnabled:(t,e)=>{mx[t]=e},_setDisabled:(t,e)=>{Y6[t]=e}};function eD(t){return`statsig.stable_id.${(0,X6._getStorageKey)(t)}`}function hx(t,e){let r=eD(e);try{(0,Z6._setObjectInStorage)(r,t)}catch{Q$.Log.warn("Failed to save StableID to storage")}}function eV(t){let e=eD(t);return(0,Z6._getObjectFromStorage)(e)}function tV(t){if(!mx[t]||(0,Q6._getDocumentSafe)()==null)return null;let e=document.cookie.split(";");for(let r of e){let[n,i]=r.trim().split("=");if(n===vx(t))return decodeURIComponent(i)}return null}function J6(t,e){if(!mx[e]||(0,Q6._getDocumentSafe)()==null)return;let r=new Date;r.setFullYear(r.getFullYear()+1),document.cookie=`${vx(e)}=${encodeURIComponent(t)}; expires=${r.toUTCString()}; path=/`}function vx(t){return`statsig.stable_id.${(0,X6._getStorageKey)(t)}`}Ci.getCookieName=vx});var gx=d(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai._getFullUserHash=Ai._normalizeUser=void 0;var rV=Jr(),nV=be(),iV=kt();function oV(t,e,r){let n=(0,iV._cloneObject)("StatsigUser",t);return n==null?(nV.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(e!=null&&e.environment!=null?n.statsigEnvironment=e.environment:r!=null&&(n.statsigEnvironment={tier:r}),n)}Ai._normalizeUser=oV;function aV(t){return t?(0,rV._DJB2Object)(t):null}Ai._getFullUserHash=aV});var bx=d(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});C0._typedJsonParse=void 0;var sV=be();function uV(t,e,r){try{let n=JSON.parse(t);if(n&&typeof n=="object"&&e in n)return n}catch{}return sV.Log.error(`Failed to parse ${r}`),null}C0._typedJsonParse=uV});var iD=d(_r=>{"use strict";var _x=_r&&_r.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(_r,"__esModule",{value:!0});_r._makeDataAdapterResult=_r.DataAdapterCore=void 0;var A0=be(),tD=ko(),F0=gx(),br=Lt(),rD=bx(),cV=10,lV=8,yx=class{constructor(e,r){this._adapterName=e,this._cacheSuffix=r,this._options=null,this._sdkKey=null,this._cacheLimit=cV,this._lastModifiedStoreKey=`statsig.last_modified_time.${r}`,this._inMemoryCache=new Dx}attach(e,r,n){this._sdkKey=e,this._options=r}getDataSync(e){let r=e&&(0,F0._normalizeUser)(e,this._options),n=this._getCacheKey(r),i=this._inMemoryCache.get(n,r);if(i&&this._getIsCacheValueValid(i))return i;let o=this._loadFromCache(n);return o&&this._getIsCacheValueValid(o)?(this._inMemoryCache.add(n,o,this._cacheLimit),this._inMemoryCache.get(n,r)):null}setData(e,r){let n=r&&(0,F0._normalizeUser)(r,this._options),i=this._getCacheKey(n);this._inMemoryCache.add(i,T0("Bootstrap",e,null,n),this._cacheLimit)}_getIsCacheValueValid(e){return e.stableID==null||e.stableID===tD.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,r,n){return _x(this,void 0,void 0,function*(){br.Storage.isReady()||(yield br.Storage.isReadyResolver());let i=e??this.getDataSync(r),o=[this._fetchAndPrepFromNetwork(i,r,n)];return n?.timeoutMs&&o.push(new Promise(a=>setTimeout(a,n.timeoutMs)).then(()=>(A0.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(o)})}_prefetchDataImpl(e,r){return _x(this,void 0,void 0,function*(){let n=e&&(0,F0._normalizeUser)(e,this._options),i=this._getCacheKey(n),o=yield this._getDataAsyncImpl(null,n,r);o&&this._inMemoryCache.add(i,Object.assign(Object.assign({},o),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(e,r,n){return _x(this,void 0,void 0,function*(){var i;let o=(i=e?.data)!==null&&i!==void 0?i:null,a=e!=null&&this._isCachedResultValidFor204(e,r),s=yield this._fetchFromNetwork(o,r,n,a);if(!s)return A0.Log.debug("No response returned for latest value"),null;let u=(0,rD._typedJsonParse)(s,"has_updates","Response"),c=this._getSdkKey(),l=tD.StableID.get(c),p=null;if(u?.has_updates===!0)p=T0("Network",s,l,r);else if(o&&u?.has_updates===!1)p=T0("NetworkNotModified",o,l,r);else return null;let x=this._getCacheKey(r);return this._inMemoryCache.add(x,p,this._cacheLimit),this._writeToCache(x,p),p})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(A0.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(e){var r;let n=(r=br.Storage.getItem)===null||r===void 0?void 0:r.call(br.Storage,e);if(n==null)return null;let i=(0,rD._typedJsonParse)(n,"source","Cached Result");return i?Object.assign(Object.assign({},i),{source:"Cache"}):null}_writeToCache(e,r){let n=JSON.stringify(r);for(let i=0;i<lV;i++)try{br.Storage.setItem(e,n);break}catch(o){if(!(o instanceof Error)||!(o.toString().includes("QuotaExceededError")||o.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw o;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(e,this._cacheLimit-1)}this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e,r=this._cacheLimit){var n;let i=(n=(0,br._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&n!==void 0?n:{};i[e]=Date.now();let o=nD(i,r);for(let a of o)delete i[a],br.Storage.removeItem(a);(0,br._setObjectInStorage)(this._lastModifiedStoreKey,i)}};_r.DataAdapterCore=yx;function T0(t,e,r,n){return{source:t,data:e,receivedAt:Date.now(),stableID:r,fullUserHash:(0,F0._getFullUserHash)(n)}}_r._makeDataAdapterResult=T0;var Dx=class{constructor(){this._data={}}get(e,r){var n;let i=this._data[e],o=i?.stableID,a=(n=r?.customIDs)===null||n===void 0?void 0:n.stableID;return a&&o&&a!==o?(A0.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):i}add(e,r,n){let i=nD(this._data,n-1);for(let o of i)delete this._data[o];this._data[e]=r}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}};function nD(t,e){let r=Object.keys(t);return r.length<=e?[]:e===0?r:r.sort((n,i)=>{let o=t[n],a=t[i];return typeof o=="object"&&typeof a=="object"?o.receivedAt-a.receivedAt:o-a}).slice(0,r.length-e)}});var aD=d(oD=>{"use strict";Object.defineProperty(oD,"__esModule",{value:!0})});var P0=d(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.SDKType=void 0;var sD={},Fi;I0.SDKType={_get:t=>{var e;return((e=sD[t])!==null&&e!==void 0?e:"js-mono")+(Fi??"")},_setClientType(t,e){sD[t]=e},_setBindingType(t){(!Fi||Fi==="-react")&&(Fi="-"+t)}}});var Ex=d(Rt=>{"use strict";var fV=Rt&&Rt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.ErrorBoundary=Rt.EXCEPTION_ENDPOINT=void 0;var dV=be(),pV=P0(),xV=qo();Rt.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";var cD="[Statsig] UnknownError",Sx=class{constructor(e,r,n,i){this._sdkKey=e,this._options=r,this._emitter=n,this._lastSeenError=i,this._seen=new Set}wrap(e,r){try{let n=e;mV(n).forEach(i=>{let o=n[i];"$EB"in o||(n[i]=(...a)=>this._capture(r?`${r}:${i}`:i,()=>o.apply(e,a)),n[i].$EB=!0)})}catch(n){this._onError("eb:wrap",n)}}logError(e,r){this._onError(e,r)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,e??null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=uD(e))}_capture(e,r){try{let n=r();return n&&n instanceof Promise?n.catch(i=>this._onError(e,i)):n}catch(n){return this._onError(e,n),null}}_onError(e,r){try{dV.Log.warn(`Caught error in ${e}`,{error:r}),fV(this,void 0,void 0,function*(){var i,o,a,s,u,c,l;let p=r||Error(cD),x=p instanceof Error,h=x?p.name:"No Name",g=uD(p);if(this._lastSeenError=g,this._seen.has(h))return;if(this._seen.add(h),!((o=(i=this._options)===null||i===void 0?void 0:i.networkConfig)===null||o===void 0)&&o.preventAllNetworkTraffic){(a=this._emitter)===null||a===void 0||a.call(this,{name:"error",error:r,tag:e});return}let b=pV.SDKType._get(this._sdkKey),m=xV.StatsigMetadataProvider.get(),v=x?p.stack:hV(p),_=Object.assign({tag:e,exception:h,info:v,statsigOptions:vV(this._options)},Object.assign(Object.assign({},m),{sdkType:b}));yield((c=(u=(s=this._options)===null||s===void 0?void 0:s.networkConfig)===null||u===void 0?void 0:u.networkOverrideFunc)!==null&&c!==void 0?c:fetch)(Rt.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(b),"STATSIG-SDK-VERSION":String(m.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(_)}),(l=this._emitter)===null||l===void 0||l.call(this,{name:"error",error:r,tag:e})}).then(()=>{}).catch(()=>{})}catch{}}};Rt.ErrorBoundary=Sx;function uD(t){return t instanceof Error?t:typeof t=="string"?new Error(t):new Error("An unknown error occurred.")}function hV(t){try{return JSON.stringify(t)}catch{return cD}}function mV(t){let e=new Set,r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).filter(n=>typeof r?.[n]=="function").forEach(n=>e.add(n)),r=Object.getPrototypeOf(r);return Array.from(e)}function vV(t){if(!t)return{};let e={};return Object.keys(t).forEach(r=>{let n=r,i=t[n];switch(typeof i){case"number":case"bigint":case"boolean":e[String(n)]=i;break;case"string":i.length<50?e[String(n)]=i:e[String(n)]="set";break;case"object":n==="environment"?e.environment=i:n==="networkConfig"?e.networkConfig=i:e[String(n)]=i!=null?"set":"unset";break;default:}}),e}});var fD=d(lD=>{"use strict";Object.defineProperty(lD,"__esModule",{value:!0})});var pD=d(dD=>{"use strict";Object.defineProperty(dD,"__esModule",{value:!0})});var hD=d(xD=>{"use strict";Object.defineProperty(xD,"__esModule",{value:!0})});var wx=d(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.createMemoKey=Ti.MemoPrefix=void 0;Ti.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};var gV=new Set([]),bV=new Set(["userPersistedValues"]);function _V(t,e,r){let n=`${t}|${e}`;if(!r)return n;for(let i of Object.keys(r)){if(bV.has(i))return;gV.has(i)?n+=`|${i}=true`:n+=`|${i}=${r[i]}`}return n}Ti.createMemoKey=_V});var mD=d(Ii=>{"use strict";var yV=Ii&&Ii.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ii,"__esModule",{value:!0});Ii._fetchTxtRecords=void 0;var DV=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),SV="https://cloudflare-dns.com/dns-query",EV=["i","e","d"],wV=200;function OV(t){return yV(this,void 0,void 0,function*(){let e=yield t(SV,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:DV});if(!e.ok){let i=new Error("Failed to fetch TXT records from DNS");throw i.name="DnsTxtFetchError",i}let r=yield e.arrayBuffer(),n=new Uint8Array(r);return CV(n)})}Ii._fetchTxtRecords=OV;function CV(t){let e=t.findIndex((n,i)=>i<wV&&String.fromCharCode(n)==="="&&EV.includes(String.fromCharCode(t[i-1])));if(e===-1){let n=new Error("Failed to parse TXT records from DNS");throw n.name="DnsTxtParseError",n}let r="";for(let n=e-1;n<t.length;n++)r+=String.fromCharCode(t[n]);return r.split(",")}});var yD=d(yr=>{"use strict";var vD=yr&&yr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(yr,"__esModule",{value:!0});yr._isDomainFailure=yr.NetworkFallbackResolver=void 0;var AV=mD(),FV=Jr(),TV=be(),Cx=Lt(),gD=10080*60*1e3,IV=14400*1e3,Ax=class{constructor(e){var r;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(r=e.networkConfig)===null||r===void 0?void 0:r.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,r){var n;let i=(n=this._fallbackInfo)===null||n===void 0?void 0:n[r.endpoint];i&&(i.expiryTime=Date.now()+gD,Ox(e,Object.assign(Object.assign({},this._fallbackInfo),{[r.endpoint]:i})))}getActiveFallbackUrl(e,r){var n,i;if(r.customUrl!=null&&r.fallbackUrls!=null)return null;let o=this._fallbackInfo;o==null&&(o=(n=PV(e))!==null&&n!==void 0?n:{},this._fallbackInfo=o);let a=o[r.endpoint];return!a||Date.now()>((i=a.expiryTime)!==null&&i!==void 0?i:0)||r.getChecksum()!==a.urlConfigChecksum?(delete o[r.endpoint],this._fallbackInfo=o,Ox(e,this._fallbackInfo),null):a.url?a.url:null}tryFetchUpdatedFallbackInfo(e,r,n,i){return vD(this,void 0,void 0,function*(){var o,a;try{if(!bD(n,i))return!1;let u=r.customUrl==null&&r.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(r):r.fallbackUrls,c=this._pickNewFallbackUrl((o=this._fallbackInfo)===null||o===void 0?void 0:o[r.endpoint],u);return c?(this._updateFallbackInfoWithNewUrl(e,r,c),!0):!1}catch(s){return(a=this._errorBoundary)===null||a===void 0||a.logError("tryFetchUpdatedFallbackInfo",s),!1}})}_updateFallbackInfoWithNewUrl(e,r,n){var i,o,a;let s={urlConfigChecksum:r.getChecksum(),url:n,expiryTime:Date.now()+gD,previous:[]},u=r.endpoint,c=(i=this._fallbackInfo)===null||i===void 0?void 0:i[u];c&&s.previous.push(...c.previous),s.previous.length>10&&(s.previous=[]);let l=(a=(o=this._fallbackInfo)===null||o===void 0?void 0:o[u])===null||a===void 0?void 0:a.url;l!=null&&s.previous.push(l),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[u]:s}),Ox(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return vD(this,void 0,void 0,function*(){var r;let n=this._dnsQueryCooldowns[e.endpoint];if(n&&Date.now()<n)return null;this._dnsQueryCooldowns[e.endpoint]=Date.now()+IV;let i=[],o=yield(0,AV._fetchTxtRecords)((r=this._networkOverrideFunc)!==null&&r!==void 0?r:fetch),a=jV(e.defaultUrl);for(let s of o){if(!s.startsWith(e.endpointDnsKey+"="))continue;let u=s.split("=");if(u.length>1){let c=u[1];c.endsWith("/")&&(c=c.slice(0,-1)),i.push(`https://${c}${a}`)}}return i})}_pickNewFallbackUrl(e,r){var n;if(r==null)return null;let i=new Set((n=e?.previous)!==null&&n!==void 0?n:[]),o=e?.url,a=null;for(let s of r){let u=s.endsWith("/")?s.slice(0,-1):s;if(!i.has(s)&&u!==o){a=u;break}}return a}};yr.NetworkFallbackResolver=Ax;function bD(t,e){var r;let n=(r=t?.toLowerCase())!==null&&r!==void 0?r:"";return e||n.includes("uncaught exception")||n.includes("failed to fetch")||n.includes("networkerror when attempting to fetch resource")}yr._isDomainFailure=bD;function _D(t){return`statsig.network_fallback.${(0,FV._DJB2)(t)}`}function Ox(t,e){let r=_D(t);if(!e||Object.keys(e).length===0){Cx.Storage.removeItem(r);return}Cx.Storage.setItem(r,JSON.stringify(e))}function PV(t){let e=_D(t),r=Cx.Storage.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return TV.Log.error("Failed to parse FallbackInfo"),null}}function jV(t){try{return new URL(t).pathname}catch{return null}}});var Fx=d(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});j0.SDKFlags=void 0;var DD={};j0.SDKFlags={setFlags:(t,e)=>{DD[t]=e},get:(t,e)=>{var r,n;return(n=(r=DD[t])===null||r===void 0?void 0:r[e])!==null&&n!==void 0?n:!1}}});var M0=d(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.StatsigSession=Qr.SessionID=void 0;var qV=Mt(),MV=Co(),kV=be(),ED=Lt(),wD=O0(),OD=1800*1e3,CD=14400*1e3,q0={};Qr.SessionID={get:t=>Qr.StatsigSession.get(t).data.sessionID};Qr.StatsigSession={get:t=>{q0[t]==null&&(q0[t]=LV(t));let e=q0[t];return BV(e)},overrideInitialSessionID:(t,e)=>{q0[e]=RV(t,e)}};function LV(t){let e=$V(t),r=Date.now();return e||(e={sessionID:(0,wD.getUUID)(),startTime:r,lastUpdate:r}),{data:e,sdkKey:t}}function RV(t,e){let r=Date.now();return{data:{sessionID:t,startTime:r,lastUpdate:r},sdkKey:e}}function BV(t){let e=Date.now(),r=t.data,n=t.sdkKey;if(NV(r)||UV(r)){r.sessionID=(0,wD.getUUID)(),r.startTime=e;let o=__STATSIG__==null?void 0:__STATSIG__.instance(n);o&&o.$emt({name:"session_expired"})}r.lastUpdate=e,GV(r,t.sdkKey),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID);let i=e-r.startTime;return t.idleTimeoutID=SD(n,OD),t.ageTimeoutID=SD(n,CD-i),t}function SD(t,e){return setTimeout(()=>{var r;let n=(r=(0,qV._getStatsigGlobal)())===null||r===void 0?void 0:r.instance(t);n&&n.$emt({name:"session_expired"})},e)}function NV({lastUpdate:t}){return Date.now()-t>OD}function UV({startTime:t}){return Date.now()-t>CD}function AD(t){return`statsig.session_id.${(0,MV._getStorageKey)(t)}`}function GV(t,e){let r=AD(e);try{(0,ED._setObjectInStorage)(r,t)}catch{kV.Log.warn("Failed to save SessionID")}}function $V(t){let e=AD(t);return(0,ED._getObjectFromStorage)(e)}});var Tx=d(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});k0.ErrorTag=void 0;k0.ErrorTag={NetworkError:"NetworkError"}});var kD=d(Pi=>{"use strict";var L0=Pi&&Pi.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.NetworkCore=void 0;Mt();var ID=Mt(),Ix=v0(),Zr=be(),Qe=Ao(),VV=yD(),KV=Fx(),PD=P0(),WV=kt(),jD=M0(),zV=ko(),HV=Tx(),qD=qo(),Lo=Fo(),YV=E0(),JV=1e4,XV=500,QV=3e4,ZV=1e3,MD=50,eK=MD/ZV,tK=new Set([408,500,502,503,504,522,524,599]),Px=class{constructor(e,r){this._emitter=r,this._errorBoundary=null,this._timeout=JV,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new VV.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e){if(!FD(e))return!1;let r=this._getInternalRequestArgs("POST",e),n=this._getPopulatedURL(r),i=navigator;return i.sendBeacon.bind(i)(n,r.body)}post(e){return L0(this,void 0,void 0,function*(){let r=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(r),yield this._tryToCompressBody(r),this._sendRequest(r)})}get(e){let r=this._getInternalRequestArgs("GET",e);return this._sendRequest(r)}_sendRequest(e){return L0(this,void 0,void 0,function*(){var r,n,i,o;if(!FD(e)||this._netConfig.preventAllNetworkTraffic)return null;let{method:a,body:s,retries:u,attempt:c}=e,l=e.urlConfig.endpoint;if(this._isRateLimited(l))return Zr.Log.warn(`Request to ${l} was blocked because you are making requests too frequently.`),null;let p=c??1,x=!1,h=this._getPopulatedURL(e),g=null,b=(0,YV._isUnloading)();try{let m={method:a,body:s,headers:Object.assign({},e.headers),priority:e.priority,keepalive:b};aK(e,p);let v=this._leakyBucket[l];v&&(v.lastRequestTime=Date.now(),this._leakyBucket[l]=v);let _=(r=this._netConfig.networkOverrideFunc)!==null&&r!==void 0?r:fetch,y;if(g=yield Promise.race([_(h,m).finally(()=>clearTimeout(y)),new Promise((w,B)=>{y=setTimeout(()=>{x=!0,B(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!g.ok){let w=yield g.text().catch(()=>"No Text"),B=new Error(`NetworkError: ${h} ${w}`);throw B.name="NetworkError",B}let A=yield g.text();return TD(e,g,p,A),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:A,code:g.status}}catch(m){let v=iK(m),_=oK(v??"",x);if(TD(e,g,p,"",m),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,v,_))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!u||p>u||!tK.has((n=g?.status)!==null&&n!==void 0?n:500)){(i=this._emitter)===null||i===void 0||i.call(this,{name:"error",error:m,tag:HV.ErrorTag.NetworkError,requestArgs:e});let A=`A networking error occurred during ${a} request to ${h}.`;return Zr.Log.error(A,v,m),(o=this._errorBoundary)===null||o===void 0||o.attachErrorIfNoneExists(A),null}return yield sK(p),this._sendRequest(Object.assign(Object.assign({},e),{retries:u,attempt:p+1}))}})}_getLogEventCompressionMode(e){let r=e?.logEventCompressionMode;return!r&&e?.disableCompression===!0&&(r=Lo.LogEventCompressionMode.Disabled),r||(r=Lo.LogEventCompressionMode.Enabled),r}_isRateLimited(e){var r;let n=Date.now(),i=(r=this._leakyBucket[e])!==null&&r!==void 0?r:{count:0,lastRequestTime:n},o=n-i.lastRequestTime,a=Math.floor(o*eK);return i.count=Math.max(0,i.count-a),i.count>=MD?!0:(i.count+=1,i.lastRequestTime=n,this._leakyBucket[e]=i,!1)}_getPopulatedURL(e){var r;let n=(r=e.fallbackUrl)!==null&&r!==void 0?r:e.urlConfig.getUrl();(e.urlConfig.endpoint===Qe.Endpoint._initialize||e.urlConfig.endpoint===Qe.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=n);let i=Object.assign({[Qe.NetworkParam.SdkKey]:e.sdkKey,[Qe.NetworkParam.SdkType]:PD.SDKType._get(e.sdkKey),[Qe.NetworkParam.SdkVersion]:qD.SDK_VERSION,[Qe.NetworkParam.Time]:String(Date.now()),[Qe.NetworkParam.SessionID]:jD.SessionID.get(e.sdkKey)},e.params),o=Object.keys(i).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(i[a])}`).join("&");return`${n}${o?`?${o}`:""}`}_tryEncodeBody(e){var r;let n=(0,WV._getWindowSafe)(),i=e.body;if(!(!e.isStatsigEncodable||this._options.disableStatsigEncoding||typeof i!="string"||(0,ID._getStatsigGlobalFlag)("no-encode")!=null||!n?.btoa))try{e.body=n.btoa(i).split("").reverse().join(""),e.params=Object.assign(Object.assign({},(r=e.params)!==null&&r!==void 0?r:{}),{[Qe.NetworkParam.StatsigEncoded]:"1"})}catch(o){Zr.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,o)}}_tryToCompressBody(e){return L0(this,void 0,void 0,function*(){var r;let n=e.body;if(!(typeof n!="string"||!nK(e,this._options)))try{let i=new TextEncoder().encode(n),o=new CompressionStream("gzip"),a=o.writable.getWriter();a.write(i).catch(Zr.Log.error),a.close().catch(Zr.Log.error);let s=o.readable.getReader(),u=[],c;for(;!(c=yield s.read()).done;)u.push(c.value);let l=u.reduce((h,g)=>h+g.length,0),p=new Uint8Array(l),x=0;for(let h of u)p.set(h,x),x+=h.length;e.body=p,e.params=Object.assign(Object.assign({},(r=e.params)!==null&&r!==void 0?r:{}),{[Qe.NetworkParam.IsGzipped]:"1"})}catch(i){Zr.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,i)}})}_getInternalRequestArgs(e,r){let n=this._fallbackResolver.getActiveFallbackUrl(r.sdkKey,r.urlConfig),i=Object.assign(Object.assign({},r),{method:e,fallbackUrl:n});return"data"in r&&rK(i,r.data),i}};Pi.NetworkCore=Px;var FD=t=>t.sdkKey?!0:(Zr.Log.warn("Unable to make request without an SDK key"),!1),rK=(t,e)=>{let{sdkKey:r,fallbackUrl:n}=t,i=zV.StableID.get(r),o=jD.SessionID.get(r),a=PD.SDKType._get(r);t.body=JSON.stringify(Object.assign(Object.assign({},e),{statsigMetadata:Object.assign(Object.assign({},qD.StatsigMetadataProvider.get()),{stableID:i,sessionID:o,sdkType:a,fallbackUrl:n})}))};function nK(t,e){if(!t.isCompressable||(0,ID._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;let r=t.urlConfig.customUrl!=null||t.urlConfig.fallbackUrls!=null,n=KV.SDKFlags.get(t.sdkKey,"enable_log_event_compression")===!0;switch(e.logEventCompressionMode){case Lo.LogEventCompressionMode.Disabled:return!1;case Lo.LogEventCompressionMode.Enabled:return!(r&&!n);case Lo.LogEventCompressionMode.Forced:return!0;default:return!1}}function iK(t){return typeof t=="string"?t:t instanceof Error?`${t.name}: ${t.message}`:"Unknown Error"}function oK(t,e){return t.includes("Timeout")||e}function aK(t,e){t.urlConfig.endpoint===Qe.Endpoint._initialize&&Ix.Diagnostics._markInitNetworkReqStart(t.sdkKey,{attempt:e})}function TD(t,e,r,n,i){t.urlConfig.endpoint===Qe.Endpoint._initialize&&Ix.Diagnostics._markInitNetworkReqEnd(t.sdkKey,Ix.Diagnostics._getDiagnosticsData(e,r,n,i))}function sK(t){return L0(this,void 0,void 0,function*(){yield new Promise(e=>setTimeout(e,Math.min(XV*(t*t),QV)))})}});var RD=d(LD=>{"use strict";Object.defineProperty(LD,"__esModule",{value:!0})});var ND=d(BD=>{"use strict";Object.defineProperty(BD,"__esModule",{value:!0})});var UD=d(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro._fastApproxSizeOf=void 0;var uK=2,cK=1,lK=(t,e)=>{let r=0,n=Object.keys(t);for(let i=0;i<n.length;i++){let o=n[i],a=t[o];if(r+=o.length,typeof a=="object"&&a!==null?r+=(0,Ro._fastApproxSizeOf)(a,e)+uK:r+=String(a).length+cK,r>=e)return r}return r};Ro._fastApproxSizeOf=lK});var GD=d(ji=>{"use strict";var fK=ji&&ji.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ji,"__esModule",{value:!0});ji.StatsigClientBase=void 0;Mt();var dK=Mt(),pK=Ex(),xK=px(),qx=be(),hK=wx(),mK=kt(),vK=M0(),jx=ko(),gK=Fo(),R0=Lt(),bK=3e3,Mx=class{constructor(e,r,n,i){var o,a,s,u;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};let c=this.$emt.bind(this);i?.logLevel!=null&&(qx.Log.level=i.logLevel),i?.disableStorage&&R0.Storage._setDisabled(!0),i?.initialSessionID&&vK.StatsigSession.overrideInitialSessionID(i.initialSessionID,e),i?.storageProvider&&R0.Storage._setProvider(i.storageProvider),i?.enableCookies&&jx.StableID._setCookiesEnabled(e,i.enableCookies),i?.disableStableID&&jx.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=i??{},this._memoCache={},this.overrideAdapter=(o=i?.overrideAdapter)!==null&&o!==void 0?o:null,this._logger=new xK.EventLogger(e,c,n,i),this._errorBoundary=new pK.ErrorBoundary(e,i,c),this._errorBoundary.wrap(this),this._errorBoundary.wrap(r),this._errorBoundary.wrap(this._logger),n.setErrorBoundary(this._errorBoundary),this.dataAdapter=r,this.dataAdapter.attach(e,i,n),this.storageProvider=R0.Storage,(u=(s=(a=this.overrideAdapter)===null||a===void 0?void 0:a.loadFromStorage)===null||s===void 0?void 0:s.call(a))===null||u===void 0||u.catch(l=>this._errorBoundary.logError("OA::loadFromStorage",l)),this._primeReadyRipcord(),_K(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):e.disableLogging!=null&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),e.disableStorage!=null&&(this._options.disableStorage=e.disableStorage,R0.Storage._setDisabled(e.disableStorage)),e.enableCookies!=null&&(this._options.enableCookies=e.enableCookies,jx.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(gK.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return fK(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,r){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(r)}off(e,r){if(this._listeners[e]){let n=this._listeners[e].indexOf(r);n!==-1&&this._listeners[e].splice(n,1)}}$on(e,r){r.__isInternal=!0,this.on(e,r)}$emt(e){var r;let n=i=>{try{i(e)}catch(o){if(i.__isInternal===!0){this._errorBoundary.logError(`__emit:${e.name}`,o);return}qx.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(i=>n(i)),(r=this._listeners["*"])===null||r===void 0||r.forEach(n)}_setStatus(e,r){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:r})}_enqueueExposure(e,r,n){if(n?.disableExposureLog===!0){this._logger.incrementNonExposureCount(e);return}this._logger.enqueue(r)}_memoize(e,r){return(n,i)=>{if(this._options.disableEvaluationMemoization)return r(n,i);let o=(0,hK.createMemoKey)(e,n,i);return o?(o in this._memoCache||(Object.keys(this._memoCache).length>=bK&&(this._memoCache={}),this._memoCache[o]=r(n,i)),this._memoCache[o]):r(n,i)}}};ji.StatsigClientBase=Mx;function _K(t,e){var r;if((0,mK._isServerEnv)())return;let n=(0,dK._getStatsigGlobal)(),i=(r=n.instances)!==null&&r!==void 0?r:{},o=e;i[t]!=null&&qx.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),i[t]=o,n.firstInstance||(n.firstInstance=o),n.instances=i,__STATSIG__=n}});var $D=d(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.DataAdapterCachePrefix=void 0;B0.DataAdapterCachePrefix="statsig.cached"});var KD=d(VD=>{"use strict";Object.defineProperty(VD,"__esModule",{value:!0})});var zD=d(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te._makeTypedGet=Te._mergeOverride=Te._makeLayer=Te._makeExperiment=Te._makeDynamicConfig=Te._makeFeatureGate=void 0;var yK=be(),DK=g0();function kx(t,e,r,n){var i;return{name:t,details:e,ruleID:(i=r?.rule_id)!==null&&i!==void 0?i:"",__evaluation:r,value:n}}function SK(t,e,r){var n;return Object.assign(Object.assign({},kx(t,e,r,r?.value===!0)),{idType:(n=r?.id_type)!==null&&n!==void 0?n:null})}Te._makeFeatureGate=SK;function WD(t,e,r){var n,i;let o=(n=r?.value)!==null&&n!==void 0?n:{};return Object.assign(Object.assign({},kx(t,e,r,o)),{idType:(i=r?.id_type)!==null&&i!==void 0?i:null,get:N0(t,r?.value)})}Te._makeDynamicConfig=WD;function EK(t,e,r){var n;let i=WD(t,e,r);return Object.assign(Object.assign({},i),{groupName:(n=r?.group_name)!==null&&n!==void 0?n:null})}Te._makeExperiment=EK;function wK(t,e,r,n){var i,o;return Object.assign(Object.assign({},kx(t,e,r,void 0)),{get:N0(t,r?.value,n),groupName:(i=r?.group_name)!==null&&i!==void 0?i:null,__value:(o=r?.value)!==null&&o!==void 0?o:{}})}Te._makeLayer=wK;function OK(t,e,r,n){return Object.assign(Object.assign(Object.assign({},t),e),{get:N0(t.name,r,n)})}Te._mergeOverride=OK;function N0(t,e,r){return(n,i)=>{var o;let a=(o=e?.[n])!==null&&o!==void 0?o:null;return a==null?i??null:i!=null&&!(0,DK._isTypeMatch)(a,i)?(yK.Log.warn(`Parameter type mismatch. '${t}.${n}' was found to be type '${typeof a}' but fallback/return type is '${typeof i}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),i??null):(r?.(n),a)}}Te._makeTypedGet=N0});var YD=d(HD=>{"use strict";Object.defineProperty(HD,"__esModule",{value:!0})});var JD=d(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.UPDATE_DETAIL_ERROR_MESSAGES=qi.createUpdateDetails=void 0;var CK=(t,e,r,n,i,o)=>({duration:r,source:e,success:t,error:n,sourceUrl:i,warnings:o});qi.createUpdateDetails=CK;qi.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}});var Ze=d(C=>{"use strict";var AK=C&&C.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N=C&&C.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AK(e,t,r)};Object.defineProperty(C,"__esModule",{value:!0});C.Storage=C.Log=C.EventLogger=C.Diagnostics=void 0;Mt();var FK=Mt(),TK=v0();Object.defineProperty(C,"Diagnostics",{enumerable:!0,get:function(){return TK.Diagnostics}});var IK=px();Object.defineProperty(C,"EventLogger",{enumerable:!0,get:function(){return IK.EventLogger}});var XD=be();Object.defineProperty(C,"Log",{enumerable:!0,get:function(){return XD.Log}});var PK=qo(),jK=Lt();Object.defineProperty(C,"Storage",{enumerable:!0,get:function(){return jK.Storage}});N(Mt(),C);N(Co(),C);N(H6(),C);N(iD(),C);N(v0(),C);N(aD(),C);N(Ex(),C);N(fD(),C);N(pD(),C);N(Jr(),C);N(hD(),C);N(be(),C);N(wx(),C);N(Ao(),C);N(kD(),C);N(RD(),C);N(ND(),C);N(kt(),C);N(P0(),C);N(M0(),C);N(UD(),C);N(ko(),C);N(GD(),C);N(Tx(),C);N($D(),C);N(nx(),C);N(qo(),C);N(Fo(),C);N(KD(),C);N(zD(),C);N(YD(),C);N(gx(),C);N(Lt(),C);N(bx(),C);N(g0(),C);N(sx(),C);N(O0(),C);N(E0(),C);N(JD(),C);N(Fx(),C);Object.assign((0,FK._getStatsigGlobal)(),{Log:XD.Log,SDK_VERSION:PK.SDK_VERSION})});var QD=d(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.V1InitializeContainer=void 0;var qK=Ze(),Lx=class{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,r){var n,i;return e&&(i=(n=e[r])!==null&&n!==void 0?n:e[(0,qK._DJB2)(r)])!==null&&i!==void 0?i:null}};U0.V1InitializeContainer=Lx});var ZD=d(G0=>{"use strict";Object.defineProperty(G0,"__esModule",{value:!0});G0.V2InitializeContainer=void 0;var MK=Ze(),Rx=class{constructor(e){this._values=e}getGate(e){var r,n,i;let o=this._getResultFromLookup(this._values.feature_gates,e);return o?{name:e,value:o.v===!0,rule_id:(r=o.r)!==null&&r!==void 0?r:"default",secondary_exposures:(n=o.s)!==null&&n!==void 0?n:[],id_type:(i=o.i)!==null&&i!==void 0?i:""}:null}getConfig(e){var r,n,i,o;let a=this._getResultFromLookup(this._values.dynamic_configs,e);return a?{name:e,value:(r=this._values.values[a.v])!==null&&r!==void 0?r:{},rule_id:a.r,secondary_exposures:(n=a.s)!==null&&n!==void 0?n:[],id_type:(i=a.i)!==null&&i!==void 0?i:"",is_user_in_experiment:a.ue===!0,passed:a.p===!0,group_name:(o=a.gn)!==null&&o!==void 0?o:void 0,is_experiment_active:a.ea===!0,group:a.r,is_device_based:a.i==="stableID"}:null}getLayer(e){var r,n,i,o,a,s;let u=this._getResultFromLookup(this._values.layer_configs,e);return u?{name:e,value:(r=this._values.values[u.v])!==null&&r!==void 0?r:{},rule_id:u.r,secondary_exposures:(n=u.s)!==null&&n!==void 0?n:[],is_user_in_experiment:u.ue===!0,group_name:(i=u.gn)!==null&&i!==void 0?i:void 0,is_experiment_active:u.ea===!0,group:u.r,is_device_based:u.i==="stableID",allocated_experiment_name:(o=u.ae)!==null&&o!==void 0?o:"",explicit_parameters:(a=u.ep)!==null&&a!==void 0?a:[],undelegated_secondary_exposures:(s=u.us)!==null&&s!==void 0?s:[],parameter_rule_ids:u.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,r){var n,i;return e&&(i=(n=e[r])!==null&&n!==void 0?n:e[(0,MK._DJB2)(r)])!==null&&i!==void 0?i:null}};G0.V2InitializeContainer=Rx});var eS=d(Nx=>{"use strict";Object.defineProperty(Nx,"__esModule",{value:!0});var Mi=Ze(),kK=QD(),LK=ZD(),Bx=class{constructor(e){this._sdkKey=e,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(e,r){var n,i;if(!e)return!1;let o=(0,Mi._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return o==null?!1:(this._source=e.source,o?.has_updates!==!0||((n=o.time)!==null&&n!==void 0?n:0)<this._lcut||(this._valuesForExternalUse=(0,Mi._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=o.time,this._receivedAt=e.receivedAt,o.response_format==="init-v2"?this._values=new LK.V2InitializeContainer(o):this._values=new kK.V1InitializeContainer(o),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,o),e.source&&o.user&&this._setWarningState(r,o),Mi.SDKFlags.setFlags(this._sdkKey,(i=o.sdk_flags)!==null&&i!==void 0?i:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(e){let r=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(r)}getConfig(e){let r=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(r)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){let r=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(r)}getParamStore(e){let r=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(r)}getSource(){return this._source}getExposureMapping(){var e;return(e=this._values)===null||e===void 0?void 0:e.getExposureMapping()}_extractBootstrapMetadata(e,r){if(e!=="Bootstrap")return null;let n={};return r.user&&(n.user=r.user),r.sdkInfo&&(n.generatorSDKInfo=r.sdkInfo),n.lcut=r.time,n}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(e==null)}}_setWarningState(e,r){var n,i;let o=Mi.StableID.get(this._sdkKey);if(((n=e.customIDs)===null||n===void 0?void 0:n.stableID)!==o&&(!((i=e.customIDs)===null||i===void 0)&&i.stableID||o)){this._warnings.add("StableIDMismatch");return}if("user"in r){let a=r.user,s=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,Mi._getFullUserHash)(s)!==(0,Mi._getFullUserHash)(a)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){var r,n;let i=this.getCurrentSourceDetails(),o=i.reason,a=(r=i.warnings)!==null&&r!==void 0?r:[];this._source==="Bootstrap"&&a.length>0&&(o=o+a[0]),o!=="Uninitialized"&&o!=="NoValues"&&(o=`${o}:${e?"Unrecognized":"Recognized"}`);let s=this._source==="Bootstrap"&&(n=this._bootstrapMetadata)!==null&&n!==void 0?n:void 0;return s&&(i.bootstrapMetadata=s),Object.assign(Object.assign({},i),{reason:o})}};Nx.default=Bx});var rS=d($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0._resolveDeltasResponse=void 0;var tS=Ze(),RK=2;function BK(t,e){let r=(0,tS._typedJsonParse)(e,"checksum","DeltasEvaluationResponse");if(!r)return{hadBadDeltaChecksum:!0};let n=NK(t,r),i=UK(n),o=(0,tS._DJB2Object)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},RK);return o===r.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:o,badMergedConfigs:i,badFullResponse:r.deltas_full_response}}$0._resolveDeltasResponse=BK;function NK(t,e){return Object.assign(Object.assign(Object.assign({},t),e),{feature_gates:Object.assign(Object.assign({},t.feature_gates),e.feature_gates),layer_configs:Object.assign(Object.assign({},t.layer_configs),e.layer_configs),dynamic_configs:Object.assign(Object.assign({},t.dynamic_configs),e.dynamic_configs)})}function UK(t){let e=t;return Ux(t.deleted_gates,e.feature_gates),delete e.deleted_gates,Ux(t.deleted_configs,e.dynamic_configs),delete e.deleted_configs,Ux(t.deleted_layers,e.layer_configs),delete e.deleted_layers,e}function Ux(t,e){t?.forEach(r=>{delete e[r]})}});var $x=d(Bo=>{"use strict";var nS=Bo&&Bo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Bo,"__esModule",{value:!0});var V0=Ze(),GK=rS(),Gx=class extends V0.NetworkCore{constructor(e,r){super(e,r);let n=e?.networkConfig;this._option=e,this._initializeUrlConfig=new V0.UrlConfiguration(V0.Endpoint._initialize,n?.initializeUrl,n?.api,n?.initializeFallbackUrls)}fetchEvaluations(e,r,n,i,o){return nS(this,void 0,void 0,function*(){var a,s,u,c,l,p;let x=r?(0,V0._typedJsonParse)(r,"has_updates","InitializeResponse"):null,h={user:i,hash:(u=(s=(a=this._option)===null||a===void 0?void 0:a.networkConfig)===null||s===void 0?void 0:s.initializeHashAlgorithm)!==null&&u!==void 0?u:"djb2",deltasResponseRequested:!1,full_checksum:null};if(x?.has_updates){let g=x?.hash_used!==((p=(l=(c=this._option)===null||c===void 0?void 0:c.networkConfig)===null||l===void 0?void 0:l.initializeHashAlgorithm)!==null&&p!==void 0?p:"djb2");h=Object.assign(Object.assign({},h),{sinceTime:o&&!g?x.time:0,previousDerivedFields:"derived_fields"in x&&o?x.derived_fields:{},deltasResponseRequested:!0,full_checksum:x.full_checksum,partialUserMatchSinceTime:g?0:x.time})}return this._fetchEvaluations(e,x,h,n)})}_fetchEvaluations(e,r,n,i){return nS(this,void 0,void 0,function*(){var o,a;let s=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:i});if(s?.code===204)return'{"has_updates": false}';if(s?.code!==200)return(o=s?.body)!==null&&o!==void 0?o:null;if(r?.has_updates!==!0||((a=s.body)===null||a===void 0?void 0:a.includes('"is_delta":true'))!==!0||n.deltasResponseRequested!==!0)return s.body;let u=(0,GK._resolveDeltasResponse)(r,s.body);return typeof u=="string"?u:this._fetchEvaluations(e,r,Object.assign(Object.assign(Object.assign({},n),u),{deltasResponseRequested:!1}),i)})}};Bo.default=Gx});var oS=d(z0=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});z0._makeParamStoreGetter=void 0;var iS=Ze(),K0={disableExposureLog:!0};function W0(t){return t==null||t.disableExposureLog===!1}function Vx(t,e){return e!=null&&!(0,iS._isTypeMatch)(t,e)}function $K(t,e){return t.value}function VK(t,e,r){return t.getFeatureGate(e.gate_name,W0(r)?void 0:K0).value?e.pass_value:e.fail_value}function KK(t,e,r,n){let o=t.getDynamicConfig(e.config_name,W0(n)?void 0:K0).get(e.param_name);return Vx(o,r)?r:o}function WK(t,e,r,n){let o=t.getExperiment(e.experiment_name,W0(n)?void 0:K0).get(e.param_name);return Vx(o,r)?r:o}function zK(t,e,r,n){let o=t.getLayer(e.layer_name,W0(n)?void 0:K0).get(e.param_name);return Vx(o,r)?r:o}function HK(t,e,r){return(n,i)=>{if(e==null)return i;let o=e[n];if(o==null||i!=null&&(0,iS._typeOf)(i)!==o.param_type)return i;switch(o.ref_type){case"static":return $K(o,r);case"gate":return VK(t,o,r);case"dynamic_config":return KK(t,o,i,r);case"experiment":return WK(t,o,i,r);case"layer":return zK(t,o,i,r);default:return i}}}z0._makeParamStoreGetter=HK});var sS=d(ki=>{"use strict";var YK=ki&&ki.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ki,"__esModule",{value:!0});ki.StatsigEvaluationsDataAdapter=void 0;var en=Ze(),aS=$x(),Kx=class extends en.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,r,n){super.attach(e,r,n),n!==null&&n instanceof aS.default?this._network=n:this._network=new aS.default(r??{})}getDataAsync(e,r,n){return this._getDataAsyncImpl(e,(0,en._normalizeUser)(r,this._options),n)}prefetchData(e,r){return this._prefetchDataImpl(e,r)}setData(e){let r=(0,en._typedJsonParse)(e,"has_updates","data");r&&"user"in r?super.setData(e,r.user):en.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,r){super.setData(e,r)}_fetchFromNetwork(e,r,n,i){return YK(this,void 0,void 0,function*(){var o;let a=yield(o=this._network)===null||o===void 0?void 0:o.fetchEvaluations(this._getSdkKey(),e,n?.priority,r,i);return a??null})}_getCacheKey(e){var r;let n=(0,en._getStorageKey)(this._getSdkKey(),e,(r=this._options)===null||r===void 0?void 0:r.customUserCacheKeyFunc);return`${en.DataAdapterCachePrefix}.${this._cacheSuffix}.${n}`}_isCachedResultValidFor204(e,r){return e.fullUserHash!=null&&e.fullUserHash===(0,en._getFullUserHash)(r)}};ki.StatsigEvaluationsDataAdapter=Kx});var cS=d(No=>{"use strict";var H0=No&&No.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(No,"__esModule",{value:!0});var P=Ze(),JK=eS(),XK=$x(),uS=oS(),QK=sS(),Wx=class t extends P.StatsigClientBase{static instance(e){let r=(0,P._getStatsigGlobal)().instance(e);return r instanceof t?r:(P.Log.warn((0,P._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new t(e??"",{}))}constructor(e,r,n=null){var i,o;P.SDKType._setClientType(e,"javascript-client");let a=new XK.default(n,u=>{this.$emt(u)});super(e,(i=n?.dataAdapter)!==null&&i!==void 0?i:new QK.StatsigEvaluationsDataAdapter,a,n),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(P.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(P.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(P.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(P.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(P.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(P.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new JK.default(e),this._network=a,this._user=this._configureUser(r,n),this._sdkInstanceID=(0,P.getUUID)();let s=(o=n?.plugins)!==null&&o!==void 0?o:[];for(let u of s)u.bind(this)}initializeSync(e){var r;return this.loadingStatus!=="Uninitialized"?(0,P.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(r=this._store.getWarnings())!==null&&r!==void 0?r:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return H0(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(e),this._initializePromise)})}updateUserSync(e,r){let n=performance.now();try{return this._updateUserSyncImpl(e,r,n)}catch(i){let o=i instanceof Error?i:new Error(String(i));return this._createErrorUpdateDetails(o,n)}}_updateUserSyncImpl(e,r,n){var i;let o=[...(i=this._store.getWarnings())!==null&&i!==void 0?i:[]];this._resetForUser(e);let a=this.dataAdapter.getDataSync(this._user);a==null&&o.push("NoCachedValues"),this._store.setValues(a,this._user),this._finalizeUpdate(a);let s=r?.disableBackgroundCacheRefresh;return s===!0||s==null&&a?.source==="Bootstrap"?(0,P.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),o):(this._runPostUpdate(a??null,this._user),(0,P.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),o))}updateUserAsync(e,r){return H0(this,void 0,void 0,function*(){let n=performance.now();try{return yield this._updateUserAsyncImpl(e,r)}catch(i){let o=i instanceof Error?i:new Error(String(i));return this._createErrorUpdateDetails(o,n)}})}_updateUserAsyncImpl(e,r){return H0(this,void 0,void 0,function*(){this._resetForUser(e);let n=this._user;P.Diagnostics._markInitOverallStart(this._sdkKey);let i=this.dataAdapter.getDataSync(n);if(this._store.setValues(i,this._user),this._setStatus("Loading",i),i=yield this.dataAdapter.getDataAsync(i,n,r),n!==this._user)return(0,P.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let o=!1;i!=null&&(P.Diagnostics._markInitProcessStart(this._sdkKey),o=this._store.setValues(i,this._user),P.Diagnostics._markInitProcessEnd(this._sdkKey,{success:o})),this._finalizeUpdate(i),o||(this._errorBoundary.attachErrorIfNoneExists(P.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),P.Diagnostics._markInitOverallEnd(this._sdkKey,o,this._store.getCurrentSourceDetails());let a=P.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,P.createUpdateDetails)(o,this._store.getSource(),a,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,P._cloneObject)("StatsigUser",this._user);return e==null&&(P.Log.error("Failed to clone user"),e={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:P.StatsigSession.get(this._sdkKey),stableID:P.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(e,r){return this.getFeatureGate(e,r).value}logEvent(e,r,n){let i=typeof e=="string"?{eventName:e,value:r,metadata:n}:e;this.$emt({name:"log_event_called",event:i}),this._logger.enqueue(Object.assign(Object.assign({},i),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return H0(this,void 0,void 0,function*(){return P.Storage.isReady()||(yield P.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,r){var n;return(0,P.createUpdateDetails)(!1,this._store.getSource(),performance.now()-r,e,null,[...(n=this._store.getWarnings())!==null&&n!==void 0?n:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,r){this.dataAdapter.getDataAsync(e,r,{priority:"low"}).catch(n=>{P.Log.error("An error occurred after update.",n)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,r){var n,i,o;let a=(0,P._normalizeUser)(e,r),s=(n=a.customIDs)===null||n===void 0?void 0:n.stableID;if(s){let u=(o=(i=this.storageProvider).isReadyResolver)===null||o===void 0?void 0:o.call(i);u?u.then(()=>P.StableID.setOverride(s,this._sdkKey),()=>P.StableID.setOverride(s,this._sdkKey)):P.StableID.setOverride(s,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(a.analyticsOnlyMetadata=Object.assign(Object.assign({},a.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),a}_getFeatureGateImpl(e,r){var n,i;let{result:o,details:a}=this._store.getGate(e),s=(0,P._makeFeatureGate)(e,a,o),u=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getGateOverride)===null||i===void 0?void 0:i.call(n,s,this._user,r),c=u??s;return this._enqueueExposure(e,(0,P._createGateExposure)(this._user,c,this._store.getExposureMapping()),r),this.$emt({name:"gate_evaluation",gate:c}),c}_getDynamicConfigImpl(e,r){var n,i;let{result:o,details:a}=this._store.getConfig(e),s=(0,P._makeDynamicConfig)(e,a,o),u=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getDynamicConfigOverride)===null||i===void 0?void 0:i.call(n,s,this._user,r),c=u??s;return this._enqueueExposure(e,(0,P._createConfigExposure)(this._user,c,this._store.getExposureMapping()),r),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:c}),c}_getExperimentImpl(e,r){var n,i,o,a;let{result:s,details:u}=this._store.getConfig(e),c=(0,P._makeExperiment)(e,u,s);c.__evaluation!=null&&(c.__evaluation.secondary_exposures=(0,P._mapExposures)((i=(n=c.__evaluation)===null||n===void 0?void 0:n.secondary_exposures)!==null&&i!==void 0?i:[],this._store.getExposureMapping()));let l=(a=(o=this.overrideAdapter)===null||o===void 0?void 0:o.getExperimentOverride)===null||a===void 0?void 0:a.call(o,c,this._user,r),p=l??c;return this._enqueueExposure(e,(0,P._createConfigExposure)(this._user,p,this._store.getExposureMapping()),r),this.$emt({name:"experiment_evaluation",experiment:p}),p}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,r){var n,i,o;let{result:a,details:s}=this._store.getLayer(e),u=(0,P._makeLayer)(e,s,a),c=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getLayerOverride)===null||i===void 0?void 0:i.call(n,u,this._user,r);r?.disableExposureLog&&this._logger.incrementNonExposureCount(e);let l=(0,P._mergeOverride)(u,c,(o=c?.__value)!==null&&o!==void 0?o:u.__value,p=>{r?.disableExposureLog||this._enqueueExposure(e,(0,P._createLayerParameterExposure)(this._user,l,p,this._store.getExposureMapping()),r)});return this.$emt({name:"layer_evaluation",layer:l}),l}_getParameterStoreImpl(e,r){var n,i;let{result:o,details:a}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let s={name:e,details:a,__configuration:o,get:(0,uS._makeParamStoreGetter)(this,o,r)},u=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getParamStoreOverride)===null||i===void 0?void 0:i.call(n,s,r);return u!=null&&(s.__configuration=u.config,s.details=u.details,s.get=(0,uS._makeParamStoreGetter)(this,u.config,r)),s}};No.default=Wx});var fS=d(vt=>{"use strict";var ZK=vt&&vt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eW=vt&&vt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZK(e,t,r)};Object.defineProperty(vt,"__esModule",{value:!0});vt.StatsigClient=void 0;var tW=Ze(),lS=cS();vt.StatsigClient=lS.default;eW(Ze(),vt);var rW=Object.assign((0,tW._getStatsigGlobal)(),{StatsigClient:lS.default});vt.default=rW});import NS from"os";import sh from"path";import Yo from"fs";var zo="hcode",rt=".hcode",Ho="HCODE_GIT_BASH_PATH";var US={"qwen3-coder-plus":{enable:!1,env:{BASE_URL:"https://dashscope.aliyuncs.com/apps/anthropic",AUTH_TOKEN:"sk-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"qwen3-coder-plus",SMALL_FAST_MODEL:"qwen3-coder-plus"}},"kimi-k2":{enable:!1,env:{BASE_URL:"https://api.moonshot.cn/anthropic",AUTH_TOKEN:"sk-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"kimi-k2-0905-preview",SMALL_FAST_MODEL:"kimi-k2-0905-preview"}},deepseek:{enable:!1,env:{BASE_URL:"https://api.deepseek.com/anthropic",AUTH_TOKEN:"sk-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",API_TIMEOUT_MS:"600000",MODEL:"deepseek-chat",SMALL_FAST_MODEL:"deepseek-chat",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"}},openrouter:{enable:!1,env:{BASE_URL:"https://openrouter.ai/api/v1",AUTH_TOKEN:"sk-or-v1-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"anthropic/claude-sonnet-4",SMALL_FAST_MODEL:"anthropic/claude-sonnet-4",API_TYPE:"openai"}},gemini:{enable:!1,env:{BASE_URL:"https://generativelanguage.googleapis.com",AUTH_TOKEN:"AI{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"gemini-2.5-pro",SMALL_FAST_MODEL:"gemini-2.5-pro",API_TYPE:"gemini"}}};function uh(){let t=NS.homedir();return sh.join(t,rt,"config.json")}function ch(){let t=uh();Yo.existsSync(t)||(Yo.mkdirSync(sh.dirname(t),{recursive:!0}),Yo.writeFileSync(t,JSON.stringify(US,null,2)))}function lh(){let t=Yo.readFileSync(uh(),"utf-8");return JSON.parse(t)}import{spawn as PS}from"child_process";var pe=(t,e=[])=>t.name==="up"||e.includes("vim")&&t.name==="k"||e.includes("emacs")&&t.ctrl&&t.name==="p",De=(t,e=[])=>t.name==="down"||e.includes("vim")&&t.name==="j"||e.includes("emacs")&&t.ctrl&&t.name==="n",nl=t=>t.name==="space",Dr=t=>t.name==="backspace",bt=t=>t.name==="tab",Ui=t=>"1234567890".includes(t.name),oe=t=>t.name==="enter"||t.name==="return";var Sr=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}},Jo=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Gi=class extends Error{name="ExitPromptError"},Xo=class extends Error{name="HookError"},nt=class extends Error{name="ValidationError"};import{AsyncResource as KS}from"node:async_hooks";import{AsyncLocalStorage as GS,AsyncResource as $S}from"node:async_hooks";var fh=new GS;function VS(t){return{rl:t,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function dh(t,e){let r=VS(t);return fh.run(r,()=>{function n(i){r.handleChange=()=>{r.index=0,i()},r.handleChange()}return e(n)})}function Er(){let t=fh.getStore();if(!t)throw new Xo("[Inquirer] Hook functions can only be called from within a prompt");return t}function il(){return Er().rl}function ol(t){let e=(...r)=>{let n=Er(),i=!1,o=n.handleChange;n.handleChange=()=>{i=!0};let a=t(...r);return i&&o(),n.handleChange=o,a};return $S.bind(e)}function rn(t){let e=Er(),{index:r}=e,n={get(){return e.hooks[r]},set(o){e.hooks[r]=o},initialized:r in e.hooks},i=t(n);return e.index++,i}function ph(){Er().handleChange()}var wr={queue(t){let e=Er(),{index:r}=e;e.hooksEffect.push(()=>{e.hooksCleanup[r]?.();let n=t(il());if(n!=null&&typeof n!="function")throw new nt("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[r]=n})},run(){let t=Er();ol(()=>{t.hooksEffect.forEach(e=>{e()}),t.hooksEffect.length=0})()},clearAll(){let t=Er();t.hooksCleanup.forEach(e=>{e?.()}),t.hooksEffect.length=0,t.hooksCleanup.length=0}};function T(t){return rn(e=>{let r=KS.bind(function(o){e.get()!==o&&(e.set(o),ph())});if(e.initialized)return[e.get(),r];let n=typeof t=="function"?t():t;return e.set(n),[n,r]})}function Ie(t,e){rn(r=>{let n=r.get();(!Array.isArray(n)||e.some((o,a)=>!Object.is(o,n[a])))&&wr.queue(t),r.set(e)})}var qe=le(Bt(),1);import it from"node:process";function HS(){return it.platform!=="win32"?it.env.TERM!=="linux":!!it.env.WT_SESSION||!!it.env.TERMINUS_SUBLIME||it.env.ConEmuTask==="{cmd::Cmder}"||it.env.TERM_PROGRAM==="Terminus-Sublime"||it.env.TERM_PROGRAM==="vscode"||it.env.TERM==="xterm-256color"||it.env.TERM==="alacritty"||it.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var hh={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},mh={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},YS={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},JS={...hh,...mh},XS={...hh,...YS},QS=HS(),ZS=QS?JS:XS,je=ZS,iz=Object.entries(mh);var vh={prefix:{idle:qe.default.blue("?"),done:qe.default.green(je.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(t=>qe.default.yellow(t))},style:{answer:qe.default.cyan,message:qe.default.bold,error:t=>qe.default.red(`> ${t}`),defaultAnswer:t=>qe.default.dim(`(${t})`),help:qe.default.dim,highlight:qe.default.cyan,key:t=>qe.default.cyan(qe.default.bold(`<${t}>`))}};function gh(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function bh(...t){let e={};for(let r of t)for(let[n,i]of Object.entries(r)){let o=e[n];e[n]=gh(o)&&gh(i)?bh(o,i):i}return e}function ne(...t){let e=[vh,...t.filter(r=>r!=null)];return bh(...e)}function ae({status:t="idle",theme:e}){let[r,n]=T(!1),[i,o]=T(0),{prefix:a,spinner:s}=ne(e);return Ie(()=>{if(t==="loading"){let c,l=-1,p=setTimeout(()=>{n(!0),c=setInterval(()=>{l=l+1,o(l%s.frames.length)},s.interval)},300);return()=>{clearTimeout(p),clearInterval(c)}}else n(!1)},[t]),r?s.frames[i]:typeof a=="string"?a:a[t==="loading"?"idle":t]??a.idle}function Se(t,e){return rn(r=>{let n=r.get();if(!n||n.dependencies.length!==e.length||n.dependencies.some((i,o)=>i!==e[o])){let i=t();return r.set({value:i,dependencies:e}),i}return n.value})}function Or(t){return T({current:t})[0]}function se(t){let e=Or(t);e.current=t,Ie(r=>{let n=!1,i=ol((o,a)=>{n||e.current(a,r)});return r.input.on("keypress",i),()=>{n=!0,r.input.removeListener("keypress",i)}},[])}var Hh=le(yh(),1),Yh=le(zh(),1);function Ki(t,e){return t.split(`
25
+ `})};G.replace=function(t,e){return G.pipeline(G.split(t),G.join(e))};G.join=function(t){if(typeof t=="function")return G.wait(t);var e=!0;return G.through(function(r){return e||this.emit("data",t),e=!1,this.emit("data",r),!0})};G.wait=function(t){var e=[];return G.through(function(r){e.push(r)},function(){var r=Buffer.isBuffer(e[0])?Buffer.concat(e):e.join("");this.emit("data",r),this.emit("end"),t&&t(null,r)})};G.pipeable=function(){throw new Error("[EVENT-STREAM] es.pipeable is deprecated")}});var i6=d((rue,n6)=>{"use strict";var r6=_e("child_process").spawn,c0=t6();n6.exports=function(e,r){var n=null;if(typeof r!="function")throw new Error("childrenOfPid(pid, callback) expects callback");typeof e=="number"&&(e=e.toString());var i;process.platform==="win32"?i=r6("wmic.exe",["PROCESS","GET","Name,ProcessId,ParentProcessId,Status"]):i=r6("ps",["-A","-o","ppid,pid,stat,comm"]),c0.connect(i.stdout,c0.split(),c0.map(function(o,a){var s=o.trim().split(/\s+/);if(!n)return n=s,n=n.map(wG),a();for(var u={},c=n.slice();c.length;)u[c.shift()]=c.length?s.shift():s.join(" ");return a(null,u)}),c0.writeArray(function(o,a){var s={},u=[];s[e]=!0,a.forEach(function(c){s[c.PPID]&&(s[c.PID]=!0,u.push(c))}),r(null,u)})).on("error",r)};function wG(t){if(process.platform!=="win32")return t;switch(t){case"Name":return"COMMAND";case"ParentProcessId":return"PPID";case"ProcessId":return"PID";case"Status":return"STAT";default:throw new Error("Unknown process listing header: "+t)}}});var F6=d(q=>{"use strict";var Kp=Symbol.for("react.transitional.element"),NG=Symbol.for("react.portal"),UG=Symbol.for("react.fragment"),GG=Symbol.for("react.strict_mode"),$G=Symbol.for("react.profiler"),VG=Symbol.for("react.consumer"),KG=Symbol.for("react.context"),WG=Symbol.for("react.forward_ref"),zG=Symbol.for("react.suspense"),HG=Symbol.for("react.memo"),S6=Symbol.for("react.lazy"),YG=Symbol.for("react.activity"),b6=Symbol.iterator;function JG(t){return t===null||typeof t!="object"?null:(t=b6&&t[b6]||t["@@iterator"],typeof t=="function"?t:null)}var E6={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w6=Object.assign,O6={};function gi(t,e,r){this.props=t,this.context=e,this.refs=O6,this.updater=r||E6}gi.prototype.isReactComponent={};gi.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};gi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function C6(){}C6.prototype=gi.prototype;function Wp(t,e,r){this.props=t,this.context=e,this.refs=O6,this.updater=r||E6}var zp=Wp.prototype=new C6;zp.constructor=Wp;w6(zp,gi.prototype);zp.isPureReactComponent=!0;var _6=Array.isArray;function Vp(){}var J={H:null,A:null,T:null,S:null},A6=Object.prototype.hasOwnProperty;function Hp(t,e,r){var n=r.ref;return{$$typeof:Kp,type:t,key:e,ref:n!==void 0?n:null,props:r}}function XG(t,e){return Hp(t.type,e,t.props)}function Yp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Kp}function QG(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var y6=/\/+/g;function $p(t,e){return typeof t=="object"&&t!==null&&t.key!=null?QG(""+t.key):e.toString(36)}function ZG(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Vp,Vp):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function vi(t,e,r,n,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Kp:case NG:a=!0;break;case S6:return a=t._init,vi(a(t._payload),e,r,n,i)}}if(a)return i=i(t),a=n===""?"."+$p(t,0):n,_6(i)?(r="",a!=null&&(r=a.replace(y6,"$&/")+"/"),vi(i,e,r,"",function(c){return c})):i!=null&&(Yp(i)&&(i=XG(i,r+(i.key==null||t&&t.key===i.key?"":(""+i.key).replace(y6,"$&/")+"/")+a)),e.push(i)),1;a=0;var s=n===""?".":n+":";if(_6(t))for(var u=0;u<t.length;u++)n=t[u],o=s+$p(n,u),a+=vi(n,e,r,o,i);else if(u=JG(t),typeof u=="function")for(t=u.call(t),u=0;!(n=t.next()).done;)n=n.value,o=s+$p(n,u++),a+=vi(n,e,r,o,i);else if(o==="object"){if(typeof t.then=="function")return vi(ZG(t),e,r,n,i);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function p0(t,e,r){if(t==null)return t;var n=[],i=0;return vi(t,n,"","",function(o){return e.call(r,o,i++)}),n}function e$(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var D6=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},t$={map:p0,forEach:function(t,e,r){p0(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return p0(t,function(){e++}),e},toArray:function(t){return p0(t,function(e){return e})||[]},only:function(t){if(!Yp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};q.Activity=YG;q.Children=t$;q.Component=gi;q.Fragment=UG;q.Profiler=$G;q.PureComponent=Wp;q.StrictMode=GG;q.Suspense=zG;q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J;q.__COMPILER_RUNTIME={__proto__:null,c:function(t){return J.H.useMemoCache(t)}};q.cache=function(t){return function(){return t.apply(null,arguments)}};q.cacheSignal=function(){return null};q.cloneElement=function(t,e,r){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var n=w6({},t.props),i=t.key;if(e!=null)for(o in e.key!==void 0&&(i=""+e.key),e)!A6.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(n[o]=e[o]);var o=arguments.length-2;if(o===1)n.children=r;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];n.children=a}return Hp(t.type,i,n)};q.createContext=function(t){return t={$$typeof:KG,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:VG,_context:t},t};q.createElement=function(t,e,r){var n,i={},o=null;if(e!=null)for(n in e.key!==void 0&&(o=""+e.key),e)A6.call(e,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var s=Array(a),u=0;u<a;u++)s[u]=arguments[u+2];i.children=s}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return Hp(t,o,i)};q.createRef=function(){return{current:null}};q.forwardRef=function(t){return{$$typeof:WG,render:t}};q.isValidElement=Yp;q.lazy=function(t){return{$$typeof:S6,_payload:{_status:-1,_result:t},_init:e$}};q.memo=function(t,e){return{$$typeof:HG,type:t,compare:e===void 0?null:e}};q.startTransition=function(t){var e=J.T,r={};J.T=r;try{var n=t(),i=J.S;i!==null&&i(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Vp,D6)}catch(o){D6(o)}finally{e!==null&&r.types!==null&&(e.types=r.types),J.T=e}};q.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()};q.use=function(t){return J.H.use(t)};q.useActionState=function(t,e,r){return J.H.useActionState(t,e,r)};q.useCallback=function(t,e){return J.H.useCallback(t,e)};q.useContext=function(t){return J.H.useContext(t)};q.useDebugValue=function(){};q.useDeferredValue=function(t,e){return J.H.useDeferredValue(t,e)};q.useEffect=function(t,e){return J.H.useEffect(t,e)};q.useEffectEvent=function(t){return J.H.useEffectEvent(t)};q.useId=function(){return J.H.useId()};q.useImperativeHandle=function(t,e,r){return J.H.useImperativeHandle(t,e,r)};q.useInsertionEffect=function(t,e){return J.H.useInsertionEffect(t,e)};q.useLayoutEffect=function(t,e){return J.H.useLayoutEffect(t,e)};q.useMemo=function(t,e){return J.H.useMemo(t,e)};q.useOptimistic=function(t,e){return J.H.useOptimistic(t,e)};q.useReducer=function(t,e,r){return J.H.useReducer(t,e,r)};q.useRef=function(t){return J.H.useRef(t)};q.useState=function(t){return J.H.useState(t)};q.useSyncExternalStore=function(t,e,r){return J.H.useSyncExternalStore(t,e,r)};q.useTransition=function(){return J.H.useTransition()};q.version="19.2.3"});var I6=d((Iue,T6)=>{"use strict";T6.exports=F6()});var be=d(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.Log=ze.LogLevel=void 0;var r$=" DEBUG ",n$=" INFO ",i$=" WARN ",o$=" ERROR ";function x0(t){return t.unshift("[Statsig]"),t}ze.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};var h0=class t{static info(...e){t.level>=ze.LogLevel.Info&&console.info(n$,...x0(e))}static debug(...e){t.level>=ze.LogLevel.Debug&&console.debug(r$,...x0(e))}static warn(...e){t.level>=ze.LogLevel.Warn&&console.warn(i$,...x0(e))}static error(...e){t.level>=ze.LogLevel.Error&&console.error(o$,...x0(e))}};ze.Log=h0;h0.level=ze.LogLevel.Warn});var Mt=d(He=>{"use strict";var Jp,Xp,Qp;Object.defineProperty(He,"__esModule",{value:!0});He._getInstance=He._getStatsigGlobalFlag=He._getStatsigGlobal=void 0;var a$=be(),s$=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Oo}catch{return Oo}};He._getStatsigGlobal=s$;var u$=t=>(0,He._getStatsigGlobal)()[t];He._getStatsigGlobalFlag=u$;var c$=t=>{let e=(0,He._getStatsigGlobal)();return t?e.instances&&e.instances[t]:(e.instances&&Object.keys(e.instances).length>1&&a$.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};He._getInstance=c$;var bi="__STATSIG__",P6=typeof window<"u"?window:{},j6=typeof global<"u"?global:{},q6=typeof globalThis<"u"?globalThis:{},Oo=(Qp=(Xp=(Jp=P6[bi])!==null&&Jp!==void 0?Jp:j6[bi])!==null&&Xp!==void 0?Xp:q6[bi])!==null&&Qp!==void 0?Qp:{instance:He._getInstance};P6[bi]=Oo;j6[bi]=Oo;q6[bi]=Oo});var v0=d(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.Diagnostics=void 0;var m0=new Map,Zp="start",ex="end",l$="statsig::diagnostics";Yr.Diagnostics={_getMarkers:t=>m0.get(t),_markInitOverallStart:t=>{yi(t,_i({},Zp,"overall"))},_markInitOverallEnd:(t,e,r)=>{yi(t,_i({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:r},ex,"overall"))},_markInitNetworkReqStart:(t,e)=>{yi(t,_i(e,Zp,"initialize","network_request"))},_markInitNetworkReqEnd:(t,e)=>{yi(t,_i(e,ex,"initialize","network_request"))},_markInitProcessStart:t=>{yi(t,_i({},Zp,"initialize","process"))},_markInitProcessEnd:(t,e)=>{yi(t,_i(e,ex,"initialize","process"))},_clearMarkers:t=>{m0.delete(t)},_formatError(t){if(t&&typeof t=="object")return{code:tx(t,"code"),name:tx(t,"name"),message:tx(t,"message")}},_getDiagnosticsData(t,e,r,n){var i;return{success:t?.ok===!0,statusCode:t?.status,sdkRegion:(i=t?.headers)===null||i===void 0?void 0:i.get("x-statsig-region"),isDelta:r.includes('"is_delta":true')===!0?!0:void 0,attempt:e,error:Yr.Diagnostics._formatError(n)}},_enqueueDiagnosticsEvent(t,e,r,n){let i=Yr.Diagnostics._getMarkers(r);if(i==null||i.length<=0)return-1;let o=i[i.length-1].timestamp-i[0].timestamp;Yr.Diagnostics._clearMarkers(r);let a=f$(t,{context:"initialize",markers:i.slice(),statsigOptions:n});return e.enqueue(a),o}};function _i(t,e,r,n){return Object.assign({key:r,action:e,step:n,timestamp:Date.now()},t)}function f$(t,e){return{eventName:l$,user:t,value:null,metadata:e,time:Date.now()}}function yi(t,e){var r;let n=(r=m0.get(t))!==null&&r!==void 0?r:[];n.push(e),m0.set(t,n)}function tx(t,e){if(e in t)return t[e]}});var g0=d(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di._isTypeMatch=Di._typeOf=void 0;function d$(t){return Array.isArray(t)?"array":typeof t}Di._typeOf=d$;function p$(t,e){let r=n=>Array.isArray(n)?"array":n===null?"null":typeof n;return r(t)===r(e)}Di._isTypeMatch=p$});var Jr=d(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye._getSortedObject=Ye._DJB2Object=Ye._DJB2=void 0;var x$=g0(),h$=t=>{let e=0;for(let r=0;r<t.length;r++){let n=t.charCodeAt(r);e=(e<<5)-e+n,e=e&e}return String(e>>>0)};Ye._DJB2=h$;var m$=(t,e)=>(0,Ye._DJB2)(JSON.stringify((0,Ye._getSortedObject)(t,e)));Ye._DJB2Object=m$;var v$=(t,e)=>{if(t==null)return null;let r=Object.keys(t).sort(),n={};return r.forEach(i=>{let o=t[i];if(e===0||(0,x$._typeOf)(o)!=="object"){n[i]=o;return}n[i]=(0,Ye._getSortedObject)(o,e!=null?e-1:e)}),n};Ye._getSortedObject=v$});var Co=d(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si._getStorageKey=Si._getUserStorageKey=void 0;var M6=Jr();function k6(t,e,r){var n;if(r)return r(t,e);let i=e&&e.customIDs?e.customIDs:{},o=[`uid:${(n=e?.userID)!==null&&n!==void 0?n:""}`,`cids:${Object.keys(i).sort((a,s)=>a.localeCompare(s)).map(a=>`${a}-${i[a]}`).join(",")}`,`k:${t}`];return(0,M6._DJB2)(o.join("|"))}Si._getUserStorageKey=k6;function g$(t,e,r){return e?k6(t,e,r):(0,M6._DJB2)(`k:${t}`)}Si._getStorageKey=g$});var Ao=d(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.NetworkParam=Je.NetworkDefault=Je.Endpoint=void 0;Je.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"};Je.NetworkDefault={[Je.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Je.Endpoint._initialize]:"https://featureassets.org/v1",[Je.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"};Je.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}});var kt=d(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re._cloneObject=re._getUnloadEvent=re._getCurrentPageUrlSafe=re._addDocumentEventListenerSafe=re._addWindowEventListenerSafe=re._isServerEnv=re._getDocumentSafe=re._getWindowSafe=void 0;var b$=be(),_$=()=>typeof window<"u"?window:null;re._getWindowSafe=_$;var y$=()=>{var t;let e=(0,re._getWindowSafe)();return(t=e?.document)!==null&&t!==void 0?t:null};re._getDocumentSafe=y$;var D$=()=>{if((0,re._getDocumentSafe)()!==null)return!1;let t=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||t};re._isServerEnv=D$;var S$=(t,e)=>{let r=(0,re._getWindowSafe)();typeof r?.addEventListener=="function"&&r.addEventListener(t,e)};re._addWindowEventListenerSafe=S$;var E$=(t,e)=>{let r=(0,re._getDocumentSafe)();typeof r?.addEventListener=="function"&&r.addEventListener(t,e)};re._addDocumentEventListenerSafe=E$;var w$=()=>{var t;try{return(t=(0,re._getWindowSafe)())===null||t===void 0?void 0:t.location.href.split(/[?#]/)[0]}catch{return}};re._getCurrentPageUrlSafe=w$;var O$=()=>{let t=(0,re._getWindowSafe)();return t&&"onpagehide"in t?"pagehide":"beforeunload"};re._getUnloadEvent=O$;var C$=(t,e)=>{try{return JSON.parse(JSON.stringify(e))}catch{return b$.Log.error(`Failed to clone object ${t}`),null}};re._cloneObject=C$});var nx=d(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge._createLayerParameterExposure=Ge._createConfigExposure=Ge._mapExposures=Ge._createGateExposure=Ge._isExposureEvent=void 0;var L6="statsig::config_exposure",R6="statsig::gate_exposure",B6="statsig::layer_exposure",rx=(t,e,r,n,i)=>(r.bootstrapMetadata&&(n.bootstrapMetadata=r.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:P$(r,n),secondaryExposures:i,time:Date.now()}),A$=({eventName:t})=>t===R6||t===L6||t===B6;Ge._isExposureEvent=A$;var F$=(t,e,r)=>{var n,i,o;let a={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return((n=e.__evaluation)===null||n===void 0?void 0:n.version)!=null&&(a.configVersion=e.__evaluation.version),rx(R6,t,e.details,a,b0((o=(i=e.__evaluation)===null||i===void 0?void 0:i.secondary_exposures)!==null&&o!==void 0?o:[],r))};Ge._createGateExposure=F$;function b0(t,e){return t.map(r=>typeof r=="string"?(e??{})[r]:r).filter(r=>r!=null)}Ge._mapExposures=b0;var T$=(t,e,r)=>{var n,i,o,a;let s={config:e.name,ruleID:e.ruleID};return((n=e.__evaluation)===null||n===void 0?void 0:n.version)!=null&&(s.configVersion=e.__evaluation.version),((i=e.__evaluation)===null||i===void 0?void 0:i.passed)!=null&&(s.rulePassed=String(e.__evaluation.passed)),rx(L6,t,e.details,s,b0((a=(o=e.__evaluation)===null||o===void 0?void 0:o.secondary_exposures)!==null&&a!==void 0?a:[],r))};Ge._createConfigExposure=T$;var I$=(t,e,r,n)=>{var i,o,a,s,u,c,l;let p=e.__evaluation,x=((i=p?.explicit_parameters)===null||i===void 0?void 0:i.includes(r))===!0,h="",g=(o=p?.undelegated_secondary_exposures)!==null&&o!==void 0?o:[];x&&(h=(a=p.allocated_experiment_name)!==null&&a!==void 0?a:"",g=(s=p.secondary_exposures)!==null&&s!==void 0?s:[]);let b=(u=e.__evaluation)===null||u===void 0?void 0:u.parameter_rule_ids,m={config:e.name,parameterName:r,ruleID:(c=b?.[r])!==null&&c!==void 0?c:e.ruleID,allocatedExperiment:h,isExplicitParameter:String(x)};return((l=e.__evaluation)===null||l===void 0?void 0:l.version)!=null&&(m.configVersion=e.__evaluation.version),rx(B6,t,e.details,m,b0(g,n))};Ge._createLayerParameterExposure=I$;var P$=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)});var Fo=d(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.LoggingEnabledOption=Ei.LogEventCompressionMode=void 0;Ei.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"};Ei.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}});var Lt=d(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe._setObjectInStorage=Xe._getObjectFromStorage=Xe.Storage=void 0;var U6=be(),j$=kt(),To={},ox={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>To[t]?To[t]:null,setItem:(t,e)=>{To[t]=e},removeItem:t=>{delete To[t]},getAllKeys:()=>Object.keys(To)},_0=null;try{let t=(0,j$._getWindowSafe)();t&&t.localStorage&&typeof t.localStorage.getItem=="function"&&(_0={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:e=>t.localStorage.getItem(e),setItem:(e,r)=>t.localStorage.setItem(e,r),removeItem:e=>t.localStorage.removeItem(e),getAllKeys:()=>Object.keys(t.localStorage)})}catch{U6.Log.warn("Failed to setup localStorageProvider.")}var ix=_0??ox,mt=ix;function N6(t){try{return t()}catch(e){if(e instanceof Error&&e.name==="SecurityError")return Xe.Storage._setProvider(ox),null;throw e}}Xe.Storage={isReady:()=>mt.isReady(),isReadyResolver:()=>mt.isReadyResolver(),getProviderName:()=>mt.getProviderName(),getItem:t=>N6(()=>mt.getItem(t)),setItem:(t,e)=>N6(()=>mt.setItem(t,e)),removeItem:t=>mt.removeItem(t),getAllKeys:()=>mt.getAllKeys(),_setProvider:t=>{ix=t,mt=t},_setDisabled:t=>{t?mt=ox:mt=ix}};function q$(t){let e=Xe.Storage.getItem(t);try{return JSON.parse(e??"null")}catch{return U6.Log.error(`Failed to parse value for key "${t}"`),null}}Xe._getObjectFromStorage=q$;function M$(t,e){Xe.Storage.setItem(t,JSON.stringify(e))}Xe._setObjectInStorage=M$});var sx=d(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});D0.UrlConfiguration=void 0;var k$=Jr(),y0=Ao(),L$={[y0.Endpoint._initialize]:"i",[y0.Endpoint._rgstr]:"e",[y0.Endpoint._download_config_specs]:"d"},ax=class{constructor(e,r,n,i){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=L$[e],r&&(this.customUrl=r),!r&&n&&(this.customUrl=n.endsWith("/")?`${n}${e}`:`${n}/${e}`),i&&(this.fallbackUrls=i);let o=y0.NetworkDefault[e];this.defaultUrl=`${o}/${e}`}getUrl(){var e;return(e=this.customUrl)!==null&&e!==void 0?e:this.defaultUrl}getChecksum(){var e;let r=((e=this.fallbackUrls)!==null&&e!==void 0?e:[]).sort().join(",");return(0,k$._DJB2)(this.customUrl+r)}};D0.UrlConfiguration=ax});var E0=d(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe._notifyVisibilityChanged=Fe._subscribeToVisiblityChanged=Fe._isUnloading=Fe._isCurrentlyVisible=void 0;var Io=kt(),S0="foreground",cx="background",G6=[],ux=S0,lx=!1,R$=()=>ux===S0;Fe._isCurrentlyVisible=R$;var B$=()=>lx;Fe._isUnloading=B$;var N$=t=>{G6.unshift(t)};Fe._subscribeToVisiblityChanged=N$;var U$=t=>{t!==ux&&(ux=t,G6.forEach(e=>e(t)))};Fe._notifyVisibilityChanged=U$;(0,Io._addWindowEventListenerSafe)("focus",()=>{lx=!1,(0,Fe._notifyVisibilityChanged)(S0)});(0,Io._addWindowEventListenerSafe)("blur",()=>(0,Fe._notifyVisibilityChanged)(cx));(0,Io._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Fe._notifyVisibilityChanged)(document.visibilityState==="visible"?S0:cx)});(0,Io._addWindowEventListenerSafe)((0,Io._getUnloadEvent)(),()=>{lx=!0,(0,Fe._notifyVisibilityChanged)(cx)})});var px=d(Oi=>{"use strict";var Po=Oi&&Oi.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.EventLogger=void 0;var G$=Co(),$$=Jr(),wi=be(),$6=Ao(),fx=kt(),V$=nx(),V6=Fo(),gr=Lt(),K$=sx(),K6=E0(),W$=100,z$=1e4,H$=1e3,Y$=6e5,J$=500,W6=200,jo={},dx=class t{static _safeFlushAndForget(e){var r;(r=jo[e])===null||r===void 0||r.flush().catch(()=>{})}static _safeRetryFailedLogs(e){var r;(r=jo[e])===null||r===void 0||r._retryFailedLogs()}constructor(e,r,n,i){var o,a;this._sdkKey=e,this._emitter=r,this._network=n,this._options=i,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(o=i?.loggingEnabled)!==null&&o!==void 0?o:i?.disableLogging===!0?V6.LoggingEnabledOption.disabled:V6.LoggingEnabledOption.browserOnly,i?.loggingEnabled&&i.disableLogging!==void 0&&wi.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(a=i?.loggingBufferMaxSize)!==null&&a!==void 0?a:W$;let s=i?.networkConfig;this._logEventUrlConfig=new K$.UrlConfiguration($6.Endpoint._rgstr,s?.logEventUrl,s?.api,s?.logEventFallbackUrls)}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}setLoggingEnabled(e){if(this._loggingEnabled==="disabled"&&e!=="disabled"){let r=this._getStorageKey(),n=(0,gr._getObjectFromStorage)(r);n&&this._queue.push(...n),gr.Storage.removeItem(r)}this._loggingEnabled=e}enqueue(e){this._shouldLogEvent(e)&&(this._normalizeAndAppendEvent(e),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&t._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(e){var r;let n=(r=this._nonExposedChecks[e])!==null&&r!==void 0?r:0;this._nonExposedChecks[e]=n+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e;let r=(0,fx._isServerEnv)();r&&((e=this._options)===null||e===void 0?void 0:e.loggingEnabled)!=="always"||(jo[this._sdkKey]=this,r||(0,K6._subscribeToVisiblityChanged)(n=>{n==="background"?t._safeFlushAndForget(this._sdkKey):n==="foreground"&&t._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(),this._startBackgroundFlushInterval())}stop(){return Po(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete jo[this._sdkKey],yield this.flush()})}flush(){return Po(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;let e=this._queue;this._queue=[],yield this._sendEvents(e)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>W6)&&setTimeout(()=>t._safeFlushAndForget(this._sdkKey),W6))}_shouldLogEvent(e){var r;if(((r=this._options)===null||r===void 0?void 0:r.loggingEnabled)!=="always"&&(0,fx._isServerEnv)())return!1;if(!(0,V$._isExposureEvent)(e))return!0;let n=e.user?e.user:{statsigEnvironment:void 0},i=(0,G$._getUserStorageKey)(this._sdkKey,n),o=e.metadata?e.metadata:{},a=[e.eventName,i,o.gate,o.config,o.ruleID,o.allocatedExperiment,o.parameterName,String(o.isExplicitParameter),o.reason].join("|"),s=this._lastExposureTimeMap[a],u=Date.now();return s&&u-s<Y$?!1:(Object.keys(this._lastExposureTimeMap).length>H$&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[a]=u,!0)}_sendEvents(e){return Po(this,void 0,void 0,function*(){var r,n;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(e),!1;try{let o=(0,K6._isUnloading)()&&this._network.isBeaconSupported()&&((n=(r=this._options)===null||r===void 0?void 0:r.networkConfig)===null||n===void 0?void 0:n.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:e}),(o?this._sendEventsViaBeacon(e):yield this._sendEventsViaPost(e)).success?(this._emitter({name:"logs_flushed",events:e}),!0):(wi.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(e),!1)}catch{return wi.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(e){return Po(this,void 0,void 0,function*(){var r;let n=yield this._network.post(this._getRequestData(e)),i=(r=n?.code)!==null&&r!==void 0?r:-1;return{success:i>=200&&i<300}})}_sendEventsViaBeacon(e){return{success:this._network.beacon(this._getRequestData(e))}}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[$6.NetworkParam.EventCount]:String(e.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(e){for(;e.length>J$;)e.shift();let r=this._getStorageKey();try{let n=this._getFailedLogsFromStorage(r);(0,gr._setObjectInStorage)(r,[...n,...e])}catch{wi.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(e){let r=[];try{let n=(0,gr._getObjectFromStorage)(e);return Array.isArray(n)&&(r=n),r}catch{return[]}}_retryFailedLogs(){let e=this._getStorageKey();Po(this,void 0,void 0,function*(){gr.Storage.isReady()||(yield gr.Storage.isReadyResolver());let r=(0,gr._getObjectFromStorage)(e);r&&(gr.Storage.removeItem(e),yield this._sendEvents(r))}).catch(()=>{wi.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,$$._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let r={},n=this._getCurrentPageUrl();n&&(r.statsigMetadata={currentPage:n});let i=Object.assign(Object.assign({},e),r);wi.Log.debug("Enqueued Event:",i),this._queue.push(i)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var e;if(((e=this._options)===null||e===void 0?void 0:e.includeCurrentPageUrlWithEvents)!==!1)return(0,fx._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var e,r;let n=(r=(e=this._options)===null||e===void 0?void 0:e.loggingIntervalMs)!==null&&r!==void 0?r:z$,i=setInterval(()=>{let o=jo[this._sdkKey];!o||o._flushIntervalId!==i?clearInterval(i):t._safeFlushAndForget(this._sdkKey)},n);this._flushIntervalId=i}};Oi.EventLogger=dx});var qo=d(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.StatsigMetadataProvider=Xr.SDK_VERSION=void 0;Xr.SDK_VERSION="3.31.0";var xx={sdkVersion:Xr.SDK_VERSION,sdkType:"js-mono"};Xr.StatsigMetadataProvider={get:()=>xx,add:t=>{xx=Object.assign(Object.assign({},xx),t)}}});var H6=d(z6=>{"use strict";Object.defineProperty(z6,"__esModule",{value:!0})});var O0=d(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.getUUID=void 0;function X$(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let t=new Date().getTime(),e=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,n=>{let i=Math.random()*16;return t>0?(i=(t+i)%16|0,t=Math.floor(t/16)):(i=(e+i)%16|0,e=Math.floor(e/16)),(n==="x"?i:i&7|8).toString(16)})}w0.getUUID=X$});var ko=d(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.getCookieName=Ci.StableID=void 0;var X6=Co(),Q$=be(),Q6=kt(),Z6=Lt(),Z$=O0(),Mo={},mx={},Y6={};Ci.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:t=>{if(Y6[t])return null;if(Mo[t]!=null)return Mo[t];let e=null;return e=tV(t),e!=null?(Mo[t]=e,hx(e,t),e):(e=eV(t),e==null&&(e=(0,Z$.getUUID)()),hx(e,t),J6(e,t),Mo[t]=e,e)},setOverride:(t,e)=>{Mo[e]=t,hx(t,e),J6(t,e)},_setCookiesEnabled:(t,e)=>{mx[t]=e},_setDisabled:(t,e)=>{Y6[t]=e}};function eD(t){return`statsig.stable_id.${(0,X6._getStorageKey)(t)}`}function hx(t,e){let r=eD(e);try{(0,Z6._setObjectInStorage)(r,t)}catch{Q$.Log.warn("Failed to save StableID to storage")}}function eV(t){let e=eD(t);return(0,Z6._getObjectFromStorage)(e)}function tV(t){if(!mx[t]||(0,Q6._getDocumentSafe)()==null)return null;let e=document.cookie.split(";");for(let r of e){let[n,i]=r.trim().split("=");if(n===vx(t))return decodeURIComponent(i)}return null}function J6(t,e){if(!mx[e]||(0,Q6._getDocumentSafe)()==null)return;let r=new Date;r.setFullYear(r.getFullYear()+1),document.cookie=`${vx(e)}=${encodeURIComponent(t)}; expires=${r.toUTCString()}; path=/`}function vx(t){return`statsig.stable_id.${(0,X6._getStorageKey)(t)}`}Ci.getCookieName=vx});var gx=d(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai._getFullUserHash=Ai._normalizeUser=void 0;var rV=Jr(),nV=be(),iV=kt();function oV(t,e,r){let n=(0,iV._cloneObject)("StatsigUser",t);return n==null?(nV.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(e!=null&&e.environment!=null?n.statsigEnvironment=e.environment:r!=null&&(n.statsigEnvironment={tier:r}),n)}Ai._normalizeUser=oV;function aV(t){return t?(0,rV._DJB2Object)(t):null}Ai._getFullUserHash=aV});var bx=d(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});C0._typedJsonParse=void 0;var sV=be();function uV(t,e,r){try{let n=JSON.parse(t);if(n&&typeof n=="object"&&e in n)return n}catch{}return sV.Log.error(`Failed to parse ${r}`),null}C0._typedJsonParse=uV});var iD=d(_r=>{"use strict";var _x=_r&&_r.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(_r,"__esModule",{value:!0});_r._makeDataAdapterResult=_r.DataAdapterCore=void 0;var A0=be(),tD=ko(),F0=gx(),br=Lt(),rD=bx(),cV=10,lV=8,yx=class{constructor(e,r){this._adapterName=e,this._cacheSuffix=r,this._options=null,this._sdkKey=null,this._cacheLimit=cV,this._lastModifiedStoreKey=`statsig.last_modified_time.${r}`,this._inMemoryCache=new Dx}attach(e,r,n){this._sdkKey=e,this._options=r}getDataSync(e){let r=e&&(0,F0._normalizeUser)(e,this._options),n=this._getCacheKey(r),i=this._inMemoryCache.get(n,r);if(i&&this._getIsCacheValueValid(i))return i;let o=this._loadFromCache(n);return o&&this._getIsCacheValueValid(o)?(this._inMemoryCache.add(n,o,this._cacheLimit),this._inMemoryCache.get(n,r)):null}setData(e,r){let n=r&&(0,F0._normalizeUser)(r,this._options),i=this._getCacheKey(n);this._inMemoryCache.add(i,T0("Bootstrap",e,null,n),this._cacheLimit)}_getIsCacheValueValid(e){return e.stableID==null||e.stableID===tD.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,r,n){return _x(this,void 0,void 0,function*(){br.Storage.isReady()||(yield br.Storage.isReadyResolver());let i=e??this.getDataSync(r),o=[this._fetchAndPrepFromNetwork(i,r,n)];return n?.timeoutMs&&o.push(new Promise(a=>setTimeout(a,n.timeoutMs)).then(()=>(A0.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(o)})}_prefetchDataImpl(e,r){return _x(this,void 0,void 0,function*(){let n=e&&(0,F0._normalizeUser)(e,this._options),i=this._getCacheKey(n),o=yield this._getDataAsyncImpl(null,n,r);o&&this._inMemoryCache.add(i,Object.assign(Object.assign({},o),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(e,r,n){return _x(this,void 0,void 0,function*(){var i;let o=(i=e?.data)!==null&&i!==void 0?i:null,a=e!=null&&this._isCachedResultValidFor204(e,r),s=yield this._fetchFromNetwork(o,r,n,a);if(!s)return A0.Log.debug("No response returned for latest value"),null;let u=(0,rD._typedJsonParse)(s,"has_updates","Response"),c=this._getSdkKey(),l=tD.StableID.get(c),p=null;if(u?.has_updates===!0)p=T0("Network",s,l,r);else if(o&&u?.has_updates===!1)p=T0("NetworkNotModified",o,l,r);else return null;let x=this._getCacheKey(r);return this._inMemoryCache.add(x,p,this._cacheLimit),this._writeToCache(x,p),p})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(A0.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(e){var r;let n=(r=br.Storage.getItem)===null||r===void 0?void 0:r.call(br.Storage,e);if(n==null)return null;let i=(0,rD._typedJsonParse)(n,"source","Cached Result");return i?Object.assign(Object.assign({},i),{source:"Cache"}):null}_writeToCache(e,r){let n=JSON.stringify(r);for(let i=0;i<lV;i++)try{br.Storage.setItem(e,n);break}catch(o){if(!(o instanceof Error)||!(o.toString().includes("QuotaExceededError")||o.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw o;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(e,this._cacheLimit-1)}this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e,r=this._cacheLimit){var n;let i=(n=(0,br._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&n!==void 0?n:{};i[e]=Date.now();let o=nD(i,r);for(let a of o)delete i[a],br.Storage.removeItem(a);(0,br._setObjectInStorage)(this._lastModifiedStoreKey,i)}};_r.DataAdapterCore=yx;function T0(t,e,r,n){return{source:t,data:e,receivedAt:Date.now(),stableID:r,fullUserHash:(0,F0._getFullUserHash)(n)}}_r._makeDataAdapterResult=T0;var Dx=class{constructor(){this._data={}}get(e,r){var n;let i=this._data[e],o=i?.stableID,a=(n=r?.customIDs)===null||n===void 0?void 0:n.stableID;return a&&o&&a!==o?(A0.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):i}add(e,r,n){let i=nD(this._data,n-1);for(let o of i)delete this._data[o];this._data[e]=r}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}};function nD(t,e){let r=Object.keys(t);return r.length<=e?[]:e===0?r:r.sort((n,i)=>{let o=t[n],a=t[i];return typeof o=="object"&&typeof a=="object"?o.receivedAt-a.receivedAt:o-a}).slice(0,r.length-e)}});var aD=d(oD=>{"use strict";Object.defineProperty(oD,"__esModule",{value:!0})});var P0=d(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.SDKType=void 0;var sD={},Fi;I0.SDKType={_get:t=>{var e;return((e=sD[t])!==null&&e!==void 0?e:"js-mono")+(Fi??"")},_setClientType(t,e){sD[t]=e},_setBindingType(t){(!Fi||Fi==="-react")&&(Fi="-"+t)}}});var Ex=d(Rt=>{"use strict";var fV=Rt&&Rt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.ErrorBoundary=Rt.EXCEPTION_ENDPOINT=void 0;var dV=be(),pV=P0(),xV=qo();Rt.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";var cD="[Statsig] UnknownError",Sx=class{constructor(e,r,n,i){this._sdkKey=e,this._options=r,this._emitter=n,this._lastSeenError=i,this._seen=new Set}wrap(e,r){try{let n=e;mV(n).forEach(i=>{let o=n[i];"$EB"in o||(n[i]=(...a)=>this._capture(r?`${r}:${i}`:i,()=>o.apply(e,a)),n[i].$EB=!0)})}catch(n){this._onError("eb:wrap",n)}}logError(e,r){this._onError(e,r)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,e??null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=uD(e))}_capture(e,r){try{let n=r();return n&&n instanceof Promise?n.catch(i=>this._onError(e,i)):n}catch(n){return this._onError(e,n),null}}_onError(e,r){try{dV.Log.warn(`Caught error in ${e}`,{error:r}),fV(this,void 0,void 0,function*(){var i,o,a,s,u,c,l;let p=r||Error(cD),x=p instanceof Error,h=x?p.name:"No Name",g=uD(p);if(this._lastSeenError=g,this._seen.has(h))return;if(this._seen.add(h),!((o=(i=this._options)===null||i===void 0?void 0:i.networkConfig)===null||o===void 0)&&o.preventAllNetworkTraffic){(a=this._emitter)===null||a===void 0||a.call(this,{name:"error",error:r,tag:e});return}let b=pV.SDKType._get(this._sdkKey),m=xV.StatsigMetadataProvider.get(),v=x?p.stack:hV(p),_=Object.assign({tag:e,exception:h,info:v,statsigOptions:vV(this._options)},Object.assign(Object.assign({},m),{sdkType:b}));yield((c=(u=(s=this._options)===null||s===void 0?void 0:s.networkConfig)===null||u===void 0?void 0:u.networkOverrideFunc)!==null&&c!==void 0?c:fetch)(Rt.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(b),"STATSIG-SDK-VERSION":String(m.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(_)}),(l=this._emitter)===null||l===void 0||l.call(this,{name:"error",error:r,tag:e})}).then(()=>{}).catch(()=>{})}catch{}}};Rt.ErrorBoundary=Sx;function uD(t){return t instanceof Error?t:typeof t=="string"?new Error(t):new Error("An unknown error occurred.")}function hV(t){try{return JSON.stringify(t)}catch{return cD}}function mV(t){let e=new Set,r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).filter(n=>typeof r?.[n]=="function").forEach(n=>e.add(n)),r=Object.getPrototypeOf(r);return Array.from(e)}function vV(t){if(!t)return{};let e={};return Object.keys(t).forEach(r=>{let n=r,i=t[n];switch(typeof i){case"number":case"bigint":case"boolean":e[String(n)]=i;break;case"string":i.length<50?e[String(n)]=i:e[String(n)]="set";break;case"object":n==="environment"?e.environment=i:n==="networkConfig"?e.networkConfig=i:e[String(n)]=i!=null?"set":"unset";break;default:}}),e}});var fD=d(lD=>{"use strict";Object.defineProperty(lD,"__esModule",{value:!0})});var pD=d(dD=>{"use strict";Object.defineProperty(dD,"__esModule",{value:!0})});var hD=d(xD=>{"use strict";Object.defineProperty(xD,"__esModule",{value:!0})});var wx=d(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.createMemoKey=Ti.MemoPrefix=void 0;Ti.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};var gV=new Set([]),bV=new Set(["userPersistedValues"]);function _V(t,e,r){let n=`${t}|${e}`;if(!r)return n;for(let i of Object.keys(r)){if(bV.has(i))return;gV.has(i)?n+=`|${i}=true`:n+=`|${i}=${r[i]}`}return n}Ti.createMemoKey=_V});var mD=d(Ii=>{"use strict";var yV=Ii&&Ii.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ii,"__esModule",{value:!0});Ii._fetchTxtRecords=void 0;var DV=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),SV="https://cloudflare-dns.com/dns-query",EV=["i","e","d"],wV=200;function OV(t){return yV(this,void 0,void 0,function*(){let e=yield t(SV,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:DV});if(!e.ok){let i=new Error("Failed to fetch TXT records from DNS");throw i.name="DnsTxtFetchError",i}let r=yield e.arrayBuffer(),n=new Uint8Array(r);return CV(n)})}Ii._fetchTxtRecords=OV;function CV(t){let e=t.findIndex((n,i)=>i<wV&&String.fromCharCode(n)==="="&&EV.includes(String.fromCharCode(t[i-1])));if(e===-1){let n=new Error("Failed to parse TXT records from DNS");throw n.name="DnsTxtParseError",n}let r="";for(let n=e-1;n<t.length;n++)r+=String.fromCharCode(t[n]);return r.split(",")}});var yD=d(yr=>{"use strict";var vD=yr&&yr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(yr,"__esModule",{value:!0});yr._isDomainFailure=yr.NetworkFallbackResolver=void 0;var AV=mD(),FV=Jr(),TV=be(),Cx=Lt(),gD=10080*60*1e3,IV=14400*1e3,Ax=class{constructor(e){var r;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(r=e.networkConfig)===null||r===void 0?void 0:r.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,r){var n;let i=(n=this._fallbackInfo)===null||n===void 0?void 0:n[r.endpoint];i&&(i.expiryTime=Date.now()+gD,Ox(e,Object.assign(Object.assign({},this._fallbackInfo),{[r.endpoint]:i})))}getActiveFallbackUrl(e,r){var n,i;if(r.customUrl!=null&&r.fallbackUrls!=null)return null;let o=this._fallbackInfo;o==null&&(o=(n=PV(e))!==null&&n!==void 0?n:{},this._fallbackInfo=o);let a=o[r.endpoint];return!a||Date.now()>((i=a.expiryTime)!==null&&i!==void 0?i:0)||r.getChecksum()!==a.urlConfigChecksum?(delete o[r.endpoint],this._fallbackInfo=o,Ox(e,this._fallbackInfo),null):a.url?a.url:null}tryFetchUpdatedFallbackInfo(e,r,n,i){return vD(this,void 0,void 0,function*(){var o,a;try{if(!bD(n,i))return!1;let u=r.customUrl==null&&r.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(r):r.fallbackUrls,c=this._pickNewFallbackUrl((o=this._fallbackInfo)===null||o===void 0?void 0:o[r.endpoint],u);return c?(this._updateFallbackInfoWithNewUrl(e,r,c),!0):!1}catch(s){return(a=this._errorBoundary)===null||a===void 0||a.logError("tryFetchUpdatedFallbackInfo",s),!1}})}_updateFallbackInfoWithNewUrl(e,r,n){var i,o,a;let s={urlConfigChecksum:r.getChecksum(),url:n,expiryTime:Date.now()+gD,previous:[]},u=r.endpoint,c=(i=this._fallbackInfo)===null||i===void 0?void 0:i[u];c&&s.previous.push(...c.previous),s.previous.length>10&&(s.previous=[]);let l=(a=(o=this._fallbackInfo)===null||o===void 0?void 0:o[u])===null||a===void 0?void 0:a.url;l!=null&&s.previous.push(l),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[u]:s}),Ox(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return vD(this,void 0,void 0,function*(){var r;let n=this._dnsQueryCooldowns[e.endpoint];if(n&&Date.now()<n)return null;this._dnsQueryCooldowns[e.endpoint]=Date.now()+IV;let i=[],o=yield(0,AV._fetchTxtRecords)((r=this._networkOverrideFunc)!==null&&r!==void 0?r:fetch),a=jV(e.defaultUrl);for(let s of o){if(!s.startsWith(e.endpointDnsKey+"="))continue;let u=s.split("=");if(u.length>1){let c=u[1];c.endsWith("/")&&(c=c.slice(0,-1)),i.push(`https://${c}${a}`)}}return i})}_pickNewFallbackUrl(e,r){var n;if(r==null)return null;let i=new Set((n=e?.previous)!==null&&n!==void 0?n:[]),o=e?.url,a=null;for(let s of r){let u=s.endsWith("/")?s.slice(0,-1):s;if(!i.has(s)&&u!==o){a=u;break}}return a}};yr.NetworkFallbackResolver=Ax;function bD(t,e){var r;let n=(r=t?.toLowerCase())!==null&&r!==void 0?r:"";return e||n.includes("uncaught exception")||n.includes("failed to fetch")||n.includes("networkerror when attempting to fetch resource")}yr._isDomainFailure=bD;function _D(t){return`statsig.network_fallback.${(0,FV._DJB2)(t)}`}function Ox(t,e){let r=_D(t);if(!e||Object.keys(e).length===0){Cx.Storage.removeItem(r);return}Cx.Storage.setItem(r,JSON.stringify(e))}function PV(t){let e=_D(t),r=Cx.Storage.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return TV.Log.error("Failed to parse FallbackInfo"),null}}function jV(t){try{return new URL(t).pathname}catch{return null}}});var Fx=d(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});j0.SDKFlags=void 0;var DD={};j0.SDKFlags={setFlags:(t,e)=>{DD[t]=e},get:(t,e)=>{var r,n;return(n=(r=DD[t])===null||r===void 0?void 0:r[e])!==null&&n!==void 0?n:!1}}});var M0=d(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.StatsigSession=Qr.SessionID=void 0;var qV=Mt(),MV=Co(),kV=be(),ED=Lt(),wD=O0(),OD=1800*1e3,CD=14400*1e3,q0={};Qr.SessionID={get:t=>Qr.StatsigSession.get(t).data.sessionID};Qr.StatsigSession={get:t=>{q0[t]==null&&(q0[t]=LV(t));let e=q0[t];return BV(e)},overrideInitialSessionID:(t,e)=>{q0[e]=RV(t,e)}};function LV(t){let e=$V(t),r=Date.now();return e||(e={sessionID:(0,wD.getUUID)(),startTime:r,lastUpdate:r}),{data:e,sdkKey:t}}function RV(t,e){let r=Date.now();return{data:{sessionID:t,startTime:r,lastUpdate:r},sdkKey:e}}function BV(t){let e=Date.now(),r=t.data,n=t.sdkKey;if(NV(r)||UV(r)){r.sessionID=(0,wD.getUUID)(),r.startTime=e;let o=__STATSIG__==null?void 0:__STATSIG__.instance(n);o&&o.$emt({name:"session_expired"})}r.lastUpdate=e,GV(r,t.sdkKey),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID);let i=e-r.startTime;return t.idleTimeoutID=SD(n,OD),t.ageTimeoutID=SD(n,CD-i),t}function SD(t,e){return setTimeout(()=>{var r;let n=(r=(0,qV._getStatsigGlobal)())===null||r===void 0?void 0:r.instance(t);n&&n.$emt({name:"session_expired"})},e)}function NV({lastUpdate:t}){return Date.now()-t>OD}function UV({startTime:t}){return Date.now()-t>CD}function AD(t){return`statsig.session_id.${(0,MV._getStorageKey)(t)}`}function GV(t,e){let r=AD(e);try{(0,ED._setObjectInStorage)(r,t)}catch{kV.Log.warn("Failed to save SessionID")}}function $V(t){let e=AD(t);return(0,ED._getObjectFromStorage)(e)}});var Tx=d(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});k0.ErrorTag=void 0;k0.ErrorTag={NetworkError:"NetworkError"}});var kD=d(Pi=>{"use strict";var L0=Pi&&Pi.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.NetworkCore=void 0;Mt();var ID=Mt(),Ix=v0(),Zr=be(),Qe=Ao(),VV=yD(),KV=Fx(),PD=P0(),WV=kt(),jD=M0(),zV=ko(),HV=Tx(),qD=qo(),Lo=Fo(),YV=E0(),JV=1e4,XV=500,QV=3e4,ZV=1e3,MD=50,eK=MD/ZV,tK=new Set([408,500,502,503,504,522,524,599]),Px=class{constructor(e,r){this._emitter=r,this._errorBoundary=null,this._timeout=JV,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new VV.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e){if(!FD(e))return!1;let r=this._getInternalRequestArgs("POST",e),n=this._getPopulatedURL(r),i=navigator;return i.sendBeacon.bind(i)(n,r.body)}post(e){return L0(this,void 0,void 0,function*(){let r=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(r),yield this._tryToCompressBody(r),this._sendRequest(r)})}get(e){let r=this._getInternalRequestArgs("GET",e);return this._sendRequest(r)}_sendRequest(e){return L0(this,void 0,void 0,function*(){var r,n,i,o;if(!FD(e)||this._netConfig.preventAllNetworkTraffic)return null;let{method:a,body:s,retries:u,attempt:c}=e,l=e.urlConfig.endpoint;if(this._isRateLimited(l))return Zr.Log.warn(`Request to ${l} was blocked because you are making requests too frequently.`),null;let p=c??1,x=!1,h=this._getPopulatedURL(e),g=null,b=(0,YV._isUnloading)();try{let m={method:a,body:s,headers:Object.assign({},e.headers),priority:e.priority,keepalive:b};aK(e,p);let v=this._leakyBucket[l];v&&(v.lastRequestTime=Date.now(),this._leakyBucket[l]=v);let _=(r=this._netConfig.networkOverrideFunc)!==null&&r!==void 0?r:fetch,y;if(g=yield Promise.race([_(h,m).finally(()=>clearTimeout(y)),new Promise((w,B)=>{y=setTimeout(()=>{x=!0,B(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!g.ok){let w=yield g.text().catch(()=>"No Text"),B=new Error(`NetworkError: ${h} ${w}`);throw B.name="NetworkError",B}let A=yield g.text();return TD(e,g,p,A),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:A,code:g.status}}catch(m){let v=iK(m),_=oK(v??"",x);if(TD(e,g,p,"",m),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,v,_))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!u||p>u||!tK.has((n=g?.status)!==null&&n!==void 0?n:500)){(i=this._emitter)===null||i===void 0||i.call(this,{name:"error",error:m,tag:HV.ErrorTag.NetworkError,requestArgs:e});let A=`A networking error occurred during ${a} request to ${h}.`;return Zr.Log.error(A,v,m),(o=this._errorBoundary)===null||o===void 0||o.attachErrorIfNoneExists(A),null}return yield sK(p),this._sendRequest(Object.assign(Object.assign({},e),{retries:u,attempt:p+1}))}})}_getLogEventCompressionMode(e){let r=e?.logEventCompressionMode;return!r&&e?.disableCompression===!0&&(r=Lo.LogEventCompressionMode.Disabled),r||(r=Lo.LogEventCompressionMode.Enabled),r}_isRateLimited(e){var r;let n=Date.now(),i=(r=this._leakyBucket[e])!==null&&r!==void 0?r:{count:0,lastRequestTime:n},o=n-i.lastRequestTime,a=Math.floor(o*eK);return i.count=Math.max(0,i.count-a),i.count>=MD?!0:(i.count+=1,i.lastRequestTime=n,this._leakyBucket[e]=i,!1)}_getPopulatedURL(e){var r;let n=(r=e.fallbackUrl)!==null&&r!==void 0?r:e.urlConfig.getUrl();(e.urlConfig.endpoint===Qe.Endpoint._initialize||e.urlConfig.endpoint===Qe.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=n);let i=Object.assign({[Qe.NetworkParam.SdkKey]:e.sdkKey,[Qe.NetworkParam.SdkType]:PD.SDKType._get(e.sdkKey),[Qe.NetworkParam.SdkVersion]:qD.SDK_VERSION,[Qe.NetworkParam.Time]:String(Date.now()),[Qe.NetworkParam.SessionID]:jD.SessionID.get(e.sdkKey)},e.params),o=Object.keys(i).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(i[a])}`).join("&");return`${n}${o?`?${o}`:""}`}_tryEncodeBody(e){var r;let n=(0,WV._getWindowSafe)(),i=e.body;if(!(!e.isStatsigEncodable||this._options.disableStatsigEncoding||typeof i!="string"||(0,ID._getStatsigGlobalFlag)("no-encode")!=null||!n?.btoa))try{e.body=n.btoa(i).split("").reverse().join(""),e.params=Object.assign(Object.assign({},(r=e.params)!==null&&r!==void 0?r:{}),{[Qe.NetworkParam.StatsigEncoded]:"1"})}catch(o){Zr.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,o)}}_tryToCompressBody(e){return L0(this,void 0,void 0,function*(){var r;let n=e.body;if(!(typeof n!="string"||!nK(e,this._options)))try{let i=new TextEncoder().encode(n),o=new CompressionStream("gzip"),a=o.writable.getWriter();a.write(i).catch(Zr.Log.error),a.close().catch(Zr.Log.error);let s=o.readable.getReader(),u=[],c;for(;!(c=yield s.read()).done;)u.push(c.value);let l=u.reduce((h,g)=>h+g.length,0),p=new Uint8Array(l),x=0;for(let h of u)p.set(h,x),x+=h.length;e.body=p,e.params=Object.assign(Object.assign({},(r=e.params)!==null&&r!==void 0?r:{}),{[Qe.NetworkParam.IsGzipped]:"1"})}catch(i){Zr.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,i)}})}_getInternalRequestArgs(e,r){let n=this._fallbackResolver.getActiveFallbackUrl(r.sdkKey,r.urlConfig),i=Object.assign(Object.assign({},r),{method:e,fallbackUrl:n});return"data"in r&&rK(i,r.data),i}};Pi.NetworkCore=Px;var FD=t=>t.sdkKey?!0:(Zr.Log.warn("Unable to make request without an SDK key"),!1),rK=(t,e)=>{let{sdkKey:r,fallbackUrl:n}=t,i=zV.StableID.get(r),o=jD.SessionID.get(r),a=PD.SDKType._get(r);t.body=JSON.stringify(Object.assign(Object.assign({},e),{statsigMetadata:Object.assign(Object.assign({},qD.StatsigMetadataProvider.get()),{stableID:i,sessionID:o,sdkType:a,fallbackUrl:n})}))};function nK(t,e){if(!t.isCompressable||(0,ID._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;let r=t.urlConfig.customUrl!=null||t.urlConfig.fallbackUrls!=null,n=KV.SDKFlags.get(t.sdkKey,"enable_log_event_compression")===!0;switch(e.logEventCompressionMode){case Lo.LogEventCompressionMode.Disabled:return!1;case Lo.LogEventCompressionMode.Enabled:return!(r&&!n);case Lo.LogEventCompressionMode.Forced:return!0;default:return!1}}function iK(t){return typeof t=="string"?t:t instanceof Error?`${t.name}: ${t.message}`:"Unknown Error"}function oK(t,e){return t.includes("Timeout")||e}function aK(t,e){t.urlConfig.endpoint===Qe.Endpoint._initialize&&Ix.Diagnostics._markInitNetworkReqStart(t.sdkKey,{attempt:e})}function TD(t,e,r,n,i){t.urlConfig.endpoint===Qe.Endpoint._initialize&&Ix.Diagnostics._markInitNetworkReqEnd(t.sdkKey,Ix.Diagnostics._getDiagnosticsData(e,r,n,i))}function sK(t){return L0(this,void 0,void 0,function*(){yield new Promise(e=>setTimeout(e,Math.min(XV*(t*t),QV)))})}});var RD=d(LD=>{"use strict";Object.defineProperty(LD,"__esModule",{value:!0})});var ND=d(BD=>{"use strict";Object.defineProperty(BD,"__esModule",{value:!0})});var UD=d(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro._fastApproxSizeOf=void 0;var uK=2,cK=1,lK=(t,e)=>{let r=0,n=Object.keys(t);for(let i=0;i<n.length;i++){let o=n[i],a=t[o];if(r+=o.length,typeof a=="object"&&a!==null?r+=(0,Ro._fastApproxSizeOf)(a,e)+uK:r+=String(a).length+cK,r>=e)return r}return r};Ro._fastApproxSizeOf=lK});var GD=d(ji=>{"use strict";var fK=ji&&ji.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ji,"__esModule",{value:!0});ji.StatsigClientBase=void 0;Mt();var dK=Mt(),pK=Ex(),xK=px(),qx=be(),hK=wx(),mK=kt(),vK=M0(),jx=ko(),gK=Fo(),R0=Lt(),bK=3e3,Mx=class{constructor(e,r,n,i){var o,a,s,u;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};let c=this.$emt.bind(this);i?.logLevel!=null&&(qx.Log.level=i.logLevel),i?.disableStorage&&R0.Storage._setDisabled(!0),i?.initialSessionID&&vK.StatsigSession.overrideInitialSessionID(i.initialSessionID,e),i?.storageProvider&&R0.Storage._setProvider(i.storageProvider),i?.enableCookies&&jx.StableID._setCookiesEnabled(e,i.enableCookies),i?.disableStableID&&jx.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=i??{},this._memoCache={},this.overrideAdapter=(o=i?.overrideAdapter)!==null&&o!==void 0?o:null,this._logger=new xK.EventLogger(e,c,n,i),this._errorBoundary=new pK.ErrorBoundary(e,i,c),this._errorBoundary.wrap(this),this._errorBoundary.wrap(r),this._errorBoundary.wrap(this._logger),n.setErrorBoundary(this._errorBoundary),this.dataAdapter=r,this.dataAdapter.attach(e,i,n),this.storageProvider=R0.Storage,(u=(s=(a=this.overrideAdapter)===null||a===void 0?void 0:a.loadFromStorage)===null||s===void 0?void 0:s.call(a))===null||u===void 0||u.catch(l=>this._errorBoundary.logError("OA::loadFromStorage",l)),this._primeReadyRipcord(),_K(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):e.disableLogging!=null&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),e.disableStorage!=null&&(this._options.disableStorage=e.disableStorage,R0.Storage._setDisabled(e.disableStorage)),e.enableCookies!=null&&(this._options.enableCookies=e.enableCookies,jx.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(gK.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return fK(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,r){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(r)}off(e,r){if(this._listeners[e]){let n=this._listeners[e].indexOf(r);n!==-1&&this._listeners[e].splice(n,1)}}$on(e,r){r.__isInternal=!0,this.on(e,r)}$emt(e){var r;let n=i=>{try{i(e)}catch(o){if(i.__isInternal===!0){this._errorBoundary.logError(`__emit:${e.name}`,o);return}qx.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(i=>n(i)),(r=this._listeners["*"])===null||r===void 0||r.forEach(n)}_setStatus(e,r){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:r})}_enqueueExposure(e,r,n){if(n?.disableExposureLog===!0){this._logger.incrementNonExposureCount(e);return}this._logger.enqueue(r)}_memoize(e,r){return(n,i)=>{if(this._options.disableEvaluationMemoization)return r(n,i);let o=(0,hK.createMemoKey)(e,n,i);return o?(o in this._memoCache||(Object.keys(this._memoCache).length>=bK&&(this._memoCache={}),this._memoCache[o]=r(n,i)),this._memoCache[o]):r(n,i)}}};ji.StatsigClientBase=Mx;function _K(t,e){var r;if((0,mK._isServerEnv)())return;let n=(0,dK._getStatsigGlobal)(),i=(r=n.instances)!==null&&r!==void 0?r:{},o=e;i[t]!=null&&qx.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),i[t]=o,n.firstInstance||(n.firstInstance=o),n.instances=i,__STATSIG__=n}});var $D=d(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.DataAdapterCachePrefix=void 0;B0.DataAdapterCachePrefix="statsig.cached"});var KD=d(VD=>{"use strict";Object.defineProperty(VD,"__esModule",{value:!0})});var zD=d(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te._makeTypedGet=Te._mergeOverride=Te._makeLayer=Te._makeExperiment=Te._makeDynamicConfig=Te._makeFeatureGate=void 0;var yK=be(),DK=g0();function kx(t,e,r,n){var i;return{name:t,details:e,ruleID:(i=r?.rule_id)!==null&&i!==void 0?i:"",__evaluation:r,value:n}}function SK(t,e,r){var n;return Object.assign(Object.assign({},kx(t,e,r,r?.value===!0)),{idType:(n=r?.id_type)!==null&&n!==void 0?n:null})}Te._makeFeatureGate=SK;function WD(t,e,r){var n,i;let o=(n=r?.value)!==null&&n!==void 0?n:{};return Object.assign(Object.assign({},kx(t,e,r,o)),{idType:(i=r?.id_type)!==null&&i!==void 0?i:null,get:N0(t,r?.value)})}Te._makeDynamicConfig=WD;function EK(t,e,r){var n;let i=WD(t,e,r);return Object.assign(Object.assign({},i),{groupName:(n=r?.group_name)!==null&&n!==void 0?n:null})}Te._makeExperiment=EK;function wK(t,e,r,n){var i,o;return Object.assign(Object.assign({},kx(t,e,r,void 0)),{get:N0(t,r?.value,n),groupName:(i=r?.group_name)!==null&&i!==void 0?i:null,__value:(o=r?.value)!==null&&o!==void 0?o:{}})}Te._makeLayer=wK;function OK(t,e,r,n){return Object.assign(Object.assign(Object.assign({},t),e),{get:N0(t.name,r,n)})}Te._mergeOverride=OK;function N0(t,e,r){return(n,i)=>{var o;let a=(o=e?.[n])!==null&&o!==void 0?o:null;return a==null?i??null:i!=null&&!(0,DK._isTypeMatch)(a,i)?(yK.Log.warn(`Parameter type mismatch. '${t}.${n}' was found to be type '${typeof a}' but fallback/return type is '${typeof i}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),i??null):(r?.(n),a)}}Te._makeTypedGet=N0});var YD=d(HD=>{"use strict";Object.defineProperty(HD,"__esModule",{value:!0})});var JD=d(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.UPDATE_DETAIL_ERROR_MESSAGES=qi.createUpdateDetails=void 0;var CK=(t,e,r,n,i,o)=>({duration:r,source:e,success:t,error:n,sourceUrl:i,warnings:o});qi.createUpdateDetails=CK;qi.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}});var Ze=d(C=>{"use strict";var AK=C&&C.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N=C&&C.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AK(e,t,r)};Object.defineProperty(C,"__esModule",{value:!0});C.Storage=C.Log=C.EventLogger=C.Diagnostics=void 0;Mt();var FK=Mt(),TK=v0();Object.defineProperty(C,"Diagnostics",{enumerable:!0,get:function(){return TK.Diagnostics}});var IK=px();Object.defineProperty(C,"EventLogger",{enumerable:!0,get:function(){return IK.EventLogger}});var XD=be();Object.defineProperty(C,"Log",{enumerable:!0,get:function(){return XD.Log}});var PK=qo(),jK=Lt();Object.defineProperty(C,"Storage",{enumerable:!0,get:function(){return jK.Storage}});N(Mt(),C);N(Co(),C);N(H6(),C);N(iD(),C);N(v0(),C);N(aD(),C);N(Ex(),C);N(fD(),C);N(pD(),C);N(Jr(),C);N(hD(),C);N(be(),C);N(wx(),C);N(Ao(),C);N(kD(),C);N(RD(),C);N(ND(),C);N(kt(),C);N(P0(),C);N(M0(),C);N(UD(),C);N(ko(),C);N(GD(),C);N(Tx(),C);N($D(),C);N(nx(),C);N(qo(),C);N(Fo(),C);N(KD(),C);N(zD(),C);N(YD(),C);N(gx(),C);N(Lt(),C);N(bx(),C);N(g0(),C);N(sx(),C);N(O0(),C);N(E0(),C);N(JD(),C);N(Fx(),C);Object.assign((0,FK._getStatsigGlobal)(),{Log:XD.Log,SDK_VERSION:PK.SDK_VERSION})});var QD=d(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.V1InitializeContainer=void 0;var qK=Ze(),Lx=class{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,r){var n,i;return e&&(i=(n=e[r])!==null&&n!==void 0?n:e[(0,qK._DJB2)(r)])!==null&&i!==void 0?i:null}};U0.V1InitializeContainer=Lx});var ZD=d(G0=>{"use strict";Object.defineProperty(G0,"__esModule",{value:!0});G0.V2InitializeContainer=void 0;var MK=Ze(),Rx=class{constructor(e){this._values=e}getGate(e){var r,n,i;let o=this._getResultFromLookup(this._values.feature_gates,e);return o?{name:e,value:o.v===!0,rule_id:(r=o.r)!==null&&r!==void 0?r:"default",secondary_exposures:(n=o.s)!==null&&n!==void 0?n:[],id_type:(i=o.i)!==null&&i!==void 0?i:""}:null}getConfig(e){var r,n,i,o;let a=this._getResultFromLookup(this._values.dynamic_configs,e);return a?{name:e,value:(r=this._values.values[a.v])!==null&&r!==void 0?r:{},rule_id:a.r,secondary_exposures:(n=a.s)!==null&&n!==void 0?n:[],id_type:(i=a.i)!==null&&i!==void 0?i:"",is_user_in_experiment:a.ue===!0,passed:a.p===!0,group_name:(o=a.gn)!==null&&o!==void 0?o:void 0,is_experiment_active:a.ea===!0,group:a.r,is_device_based:a.i==="stableID"}:null}getLayer(e){var r,n,i,o,a,s;let u=this._getResultFromLookup(this._values.layer_configs,e);return u?{name:e,value:(r=this._values.values[u.v])!==null&&r!==void 0?r:{},rule_id:u.r,secondary_exposures:(n=u.s)!==null&&n!==void 0?n:[],is_user_in_experiment:u.ue===!0,group_name:(i=u.gn)!==null&&i!==void 0?i:void 0,is_experiment_active:u.ea===!0,group:u.r,is_device_based:u.i==="stableID",allocated_experiment_name:(o=u.ae)!==null&&o!==void 0?o:"",explicit_parameters:(a=u.ep)!==null&&a!==void 0?a:[],undelegated_secondary_exposures:(s=u.us)!==null&&s!==void 0?s:[],parameter_rule_ids:u.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,r){var n,i;return e&&(i=(n=e[r])!==null&&n!==void 0?n:e[(0,MK._DJB2)(r)])!==null&&i!==void 0?i:null}};G0.V2InitializeContainer=Rx});var eS=d(Nx=>{"use strict";Object.defineProperty(Nx,"__esModule",{value:!0});var Mi=Ze(),kK=QD(),LK=ZD(),Bx=class{constructor(e){this._sdkKey=e,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(e,r){var n,i;if(!e)return!1;let o=(0,Mi._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return o==null?!1:(this._source=e.source,o?.has_updates!==!0||((n=o.time)!==null&&n!==void 0?n:0)<this._lcut||(this._valuesForExternalUse=(0,Mi._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=o.time,this._receivedAt=e.receivedAt,o.response_format==="init-v2"?this._values=new LK.V2InitializeContainer(o):this._values=new kK.V1InitializeContainer(o),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,o),e.source&&o.user&&this._setWarningState(r,o),Mi.SDKFlags.setFlags(this._sdkKey,(i=o.sdk_flags)!==null&&i!==void 0?i:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(e){let r=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(r)}getConfig(e){let r=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(r)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){let r=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(r)}getParamStore(e){let r=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(r)}getSource(){return this._source}getExposureMapping(){var e;return(e=this._values)===null||e===void 0?void 0:e.getExposureMapping()}_extractBootstrapMetadata(e,r){if(e!=="Bootstrap")return null;let n={};return r.user&&(n.user=r.user),r.sdkInfo&&(n.generatorSDKInfo=r.sdkInfo),n.lcut=r.time,n}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(e==null)}}_setWarningState(e,r){var n,i;let o=Mi.StableID.get(this._sdkKey);if(((n=e.customIDs)===null||n===void 0?void 0:n.stableID)!==o&&(!((i=e.customIDs)===null||i===void 0)&&i.stableID||o)){this._warnings.add("StableIDMismatch");return}if("user"in r){let a=r.user,s=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,Mi._getFullUserHash)(s)!==(0,Mi._getFullUserHash)(a)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){var r,n;let i=this.getCurrentSourceDetails(),o=i.reason,a=(r=i.warnings)!==null&&r!==void 0?r:[];this._source==="Bootstrap"&&a.length>0&&(o=o+a[0]),o!=="Uninitialized"&&o!=="NoValues"&&(o=`${o}:${e?"Unrecognized":"Recognized"}`);let s=this._source==="Bootstrap"&&(n=this._bootstrapMetadata)!==null&&n!==void 0?n:void 0;return s&&(i.bootstrapMetadata=s),Object.assign(Object.assign({},i),{reason:o})}};Nx.default=Bx});var rS=d($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0._resolveDeltasResponse=void 0;var tS=Ze(),RK=2;function BK(t,e){let r=(0,tS._typedJsonParse)(e,"checksum","DeltasEvaluationResponse");if(!r)return{hadBadDeltaChecksum:!0};let n=NK(t,r),i=UK(n),o=(0,tS._DJB2Object)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},RK);return o===r.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:o,badMergedConfigs:i,badFullResponse:r.deltas_full_response}}$0._resolveDeltasResponse=BK;function NK(t,e){return Object.assign(Object.assign(Object.assign({},t),e),{feature_gates:Object.assign(Object.assign({},t.feature_gates),e.feature_gates),layer_configs:Object.assign(Object.assign({},t.layer_configs),e.layer_configs),dynamic_configs:Object.assign(Object.assign({},t.dynamic_configs),e.dynamic_configs)})}function UK(t){let e=t;return Ux(t.deleted_gates,e.feature_gates),delete e.deleted_gates,Ux(t.deleted_configs,e.dynamic_configs),delete e.deleted_configs,Ux(t.deleted_layers,e.layer_configs),delete e.deleted_layers,e}function Ux(t,e){t?.forEach(r=>{delete e[r]})}});var $x=d(Bo=>{"use strict";var nS=Bo&&Bo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Bo,"__esModule",{value:!0});var V0=Ze(),GK=rS(),Gx=class extends V0.NetworkCore{constructor(e,r){super(e,r);let n=e?.networkConfig;this._option=e,this._initializeUrlConfig=new V0.UrlConfiguration(V0.Endpoint._initialize,n?.initializeUrl,n?.api,n?.initializeFallbackUrls)}fetchEvaluations(e,r,n,i,o){return nS(this,void 0,void 0,function*(){var a,s,u,c,l,p;let x=r?(0,V0._typedJsonParse)(r,"has_updates","InitializeResponse"):null,h={user:i,hash:(u=(s=(a=this._option)===null||a===void 0?void 0:a.networkConfig)===null||s===void 0?void 0:s.initializeHashAlgorithm)!==null&&u!==void 0?u:"djb2",deltasResponseRequested:!1,full_checksum:null};if(x?.has_updates){let g=x?.hash_used!==((p=(l=(c=this._option)===null||c===void 0?void 0:c.networkConfig)===null||l===void 0?void 0:l.initializeHashAlgorithm)!==null&&p!==void 0?p:"djb2");h=Object.assign(Object.assign({},h),{sinceTime:o&&!g?x.time:0,previousDerivedFields:"derived_fields"in x&&o?x.derived_fields:{},deltasResponseRequested:!0,full_checksum:x.full_checksum,partialUserMatchSinceTime:g?0:x.time})}return this._fetchEvaluations(e,x,h,n)})}_fetchEvaluations(e,r,n,i){return nS(this,void 0,void 0,function*(){var o,a;let s=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:i});if(s?.code===204)return'{"has_updates": false}';if(s?.code!==200)return(o=s?.body)!==null&&o!==void 0?o:null;if(r?.has_updates!==!0||((a=s.body)===null||a===void 0?void 0:a.includes('"is_delta":true'))!==!0||n.deltasResponseRequested!==!0)return s.body;let u=(0,GK._resolveDeltasResponse)(r,s.body);return typeof u=="string"?u:this._fetchEvaluations(e,r,Object.assign(Object.assign(Object.assign({},n),u),{deltasResponseRequested:!1}),i)})}};Bo.default=Gx});var oS=d(z0=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});z0._makeParamStoreGetter=void 0;var iS=Ze(),K0={disableExposureLog:!0};function W0(t){return t==null||t.disableExposureLog===!1}function Vx(t,e){return e!=null&&!(0,iS._isTypeMatch)(t,e)}function $K(t,e){return t.value}function VK(t,e,r){return t.getFeatureGate(e.gate_name,W0(r)?void 0:K0).value?e.pass_value:e.fail_value}function KK(t,e,r,n){let o=t.getDynamicConfig(e.config_name,W0(n)?void 0:K0).get(e.param_name);return Vx(o,r)?r:o}function WK(t,e,r,n){let o=t.getExperiment(e.experiment_name,W0(n)?void 0:K0).get(e.param_name);return Vx(o,r)?r:o}function zK(t,e,r,n){let o=t.getLayer(e.layer_name,W0(n)?void 0:K0).get(e.param_name);return Vx(o,r)?r:o}function HK(t,e,r){return(n,i)=>{if(e==null)return i;let o=e[n];if(o==null||i!=null&&(0,iS._typeOf)(i)!==o.param_type)return i;switch(o.ref_type){case"static":return $K(o,r);case"gate":return VK(t,o,r);case"dynamic_config":return KK(t,o,i,r);case"experiment":return WK(t,o,i,r);case"layer":return zK(t,o,i,r);default:return i}}}z0._makeParamStoreGetter=HK});var sS=d(ki=>{"use strict";var YK=ki&&ki.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ki,"__esModule",{value:!0});ki.StatsigEvaluationsDataAdapter=void 0;var en=Ze(),aS=$x(),Kx=class extends en.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,r,n){super.attach(e,r,n),n!==null&&n instanceof aS.default?this._network=n:this._network=new aS.default(r??{})}getDataAsync(e,r,n){return this._getDataAsyncImpl(e,(0,en._normalizeUser)(r,this._options),n)}prefetchData(e,r){return this._prefetchDataImpl(e,r)}setData(e){let r=(0,en._typedJsonParse)(e,"has_updates","data");r&&"user"in r?super.setData(e,r.user):en.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,r){super.setData(e,r)}_fetchFromNetwork(e,r,n,i){return YK(this,void 0,void 0,function*(){var o;let a=yield(o=this._network)===null||o===void 0?void 0:o.fetchEvaluations(this._getSdkKey(),e,n?.priority,r,i);return a??null})}_getCacheKey(e){var r;let n=(0,en._getStorageKey)(this._getSdkKey(),e,(r=this._options)===null||r===void 0?void 0:r.customUserCacheKeyFunc);return`${en.DataAdapterCachePrefix}.${this._cacheSuffix}.${n}`}_isCachedResultValidFor204(e,r){return e.fullUserHash!=null&&e.fullUserHash===(0,en._getFullUserHash)(r)}};ki.StatsigEvaluationsDataAdapter=Kx});var cS=d(No=>{"use strict";var H0=No&&No.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(p){a(p)}}function u(l){try{c(n.throw(l))}catch(p){a(p)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(No,"__esModule",{value:!0});var P=Ze(),JK=eS(),XK=$x(),uS=oS(),QK=sS(),Wx=class t extends P.StatsigClientBase{static instance(e){let r=(0,P._getStatsigGlobal)().instance(e);return r instanceof t?r:(P.Log.warn((0,P._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new t(e??"",{}))}constructor(e,r,n=null){var i,o;P.SDKType._setClientType(e,"javascript-client");let a=new XK.default(n,u=>{this.$emt(u)});super(e,(i=n?.dataAdapter)!==null&&i!==void 0?i:new QK.StatsigEvaluationsDataAdapter,a,n),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(P.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(P.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(P.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(P.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(P.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(P.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new JK.default(e),this._network=a,this._user=this._configureUser(r,n),this._sdkInstanceID=(0,P.getUUID)();let s=(o=n?.plugins)!==null&&o!==void 0?o:[];for(let u of s)u.bind(this)}initializeSync(e){var r;return this.loadingStatus!=="Uninitialized"?(0,P.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(r=this._store.getWarnings())!==null&&r!==void 0?r:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return H0(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(e),this._initializePromise)})}updateUserSync(e,r){let n=performance.now();try{return this._updateUserSyncImpl(e,r,n)}catch(i){let o=i instanceof Error?i:new Error(String(i));return this._createErrorUpdateDetails(o,n)}}_updateUserSyncImpl(e,r,n){var i;let o=[...(i=this._store.getWarnings())!==null&&i!==void 0?i:[]];this._resetForUser(e);let a=this.dataAdapter.getDataSync(this._user);a==null&&o.push("NoCachedValues"),this._store.setValues(a,this._user),this._finalizeUpdate(a);let s=r?.disableBackgroundCacheRefresh;return s===!0||s==null&&a?.source==="Bootstrap"?(0,P.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),o):(this._runPostUpdate(a??null,this._user),(0,P.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),o))}updateUserAsync(e,r){return H0(this,void 0,void 0,function*(){let n=performance.now();try{return yield this._updateUserAsyncImpl(e,r)}catch(i){let o=i instanceof Error?i:new Error(String(i));return this._createErrorUpdateDetails(o,n)}})}_updateUserAsyncImpl(e,r){return H0(this,void 0,void 0,function*(){this._resetForUser(e);let n=this._user;P.Diagnostics._markInitOverallStart(this._sdkKey);let i=this.dataAdapter.getDataSync(n);if(this._store.setValues(i,this._user),this._setStatus("Loading",i),i=yield this.dataAdapter.getDataAsync(i,n,r),n!==this._user)return(0,P.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let o=!1;i!=null&&(P.Diagnostics._markInitProcessStart(this._sdkKey),o=this._store.setValues(i,this._user),P.Diagnostics._markInitProcessEnd(this._sdkKey,{success:o})),this._finalizeUpdate(i),o||(this._errorBoundary.attachErrorIfNoneExists(P.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),P.Diagnostics._markInitOverallEnd(this._sdkKey,o,this._store.getCurrentSourceDetails());let a=P.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,P.createUpdateDetails)(o,this._store.getSource(),a,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,P._cloneObject)("StatsigUser",this._user);return e==null&&(P.Log.error("Failed to clone user"),e={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:P.StatsigSession.get(this._sdkKey),stableID:P.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(e,r){return this.getFeatureGate(e,r).value}logEvent(e,r,n){let i=typeof e=="string"?{eventName:e,value:r,metadata:n}:e;this.$emt({name:"log_event_called",event:i}),this._logger.enqueue(Object.assign(Object.assign({},i),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return H0(this,void 0,void 0,function*(){return P.Storage.isReady()||(yield P.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,r){var n;return(0,P.createUpdateDetails)(!1,this._store.getSource(),performance.now()-r,e,null,[...(n=this._store.getWarnings())!==null&&n!==void 0?n:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,r){this.dataAdapter.getDataAsync(e,r,{priority:"low"}).catch(n=>{P.Log.error("An error occurred after update.",n)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,r){var n,i,o;let a=(0,P._normalizeUser)(e,r),s=(n=a.customIDs)===null||n===void 0?void 0:n.stableID;if(s){let u=(o=(i=this.storageProvider).isReadyResolver)===null||o===void 0?void 0:o.call(i);u?u.then(()=>P.StableID.setOverride(s,this._sdkKey),()=>P.StableID.setOverride(s,this._sdkKey)):P.StableID.setOverride(s,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(a.analyticsOnlyMetadata=Object.assign(Object.assign({},a.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),a}_getFeatureGateImpl(e,r){var n,i;let{result:o,details:a}=this._store.getGate(e),s=(0,P._makeFeatureGate)(e,a,o),u=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getGateOverride)===null||i===void 0?void 0:i.call(n,s,this._user,r),c=u??s;return this._enqueueExposure(e,(0,P._createGateExposure)(this._user,c,this._store.getExposureMapping()),r),this.$emt({name:"gate_evaluation",gate:c}),c}_getDynamicConfigImpl(e,r){var n,i;let{result:o,details:a}=this._store.getConfig(e),s=(0,P._makeDynamicConfig)(e,a,o),u=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getDynamicConfigOverride)===null||i===void 0?void 0:i.call(n,s,this._user,r),c=u??s;return this._enqueueExposure(e,(0,P._createConfigExposure)(this._user,c,this._store.getExposureMapping()),r),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:c}),c}_getExperimentImpl(e,r){var n,i,o,a;let{result:s,details:u}=this._store.getConfig(e),c=(0,P._makeExperiment)(e,u,s);c.__evaluation!=null&&(c.__evaluation.secondary_exposures=(0,P._mapExposures)((i=(n=c.__evaluation)===null||n===void 0?void 0:n.secondary_exposures)!==null&&i!==void 0?i:[],this._store.getExposureMapping()));let l=(a=(o=this.overrideAdapter)===null||o===void 0?void 0:o.getExperimentOverride)===null||a===void 0?void 0:a.call(o,c,this._user,r),p=l??c;return this._enqueueExposure(e,(0,P._createConfigExposure)(this._user,p,this._store.getExposureMapping()),r),this.$emt({name:"experiment_evaluation",experiment:p}),p}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,r){var n,i,o;let{result:a,details:s}=this._store.getLayer(e),u=(0,P._makeLayer)(e,s,a),c=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getLayerOverride)===null||i===void 0?void 0:i.call(n,u,this._user,r);r?.disableExposureLog&&this._logger.incrementNonExposureCount(e);let l=(0,P._mergeOverride)(u,c,(o=c?.__value)!==null&&o!==void 0?o:u.__value,p=>{r?.disableExposureLog||this._enqueueExposure(e,(0,P._createLayerParameterExposure)(this._user,l,p,this._store.getExposureMapping()),r)});return this.$emt({name:"layer_evaluation",layer:l}),l}_getParameterStoreImpl(e,r){var n,i;let{result:o,details:a}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let s={name:e,details:a,__configuration:o,get:(0,uS._makeParamStoreGetter)(this,o,r)},u=(i=(n=this.overrideAdapter)===null||n===void 0?void 0:n.getParamStoreOverride)===null||i===void 0?void 0:i.call(n,s,r);return u!=null&&(s.__configuration=u.config,s.details=u.details,s.get=(0,uS._makeParamStoreGetter)(this,u.config,r)),s}};No.default=Wx});var fS=d(vt=>{"use strict";var ZK=vt&&vt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eW=vt&&vt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZK(e,t,r)};Object.defineProperty(vt,"__esModule",{value:!0});vt.StatsigClient=void 0;var tW=Ze(),lS=cS();vt.StatsigClient=lS.default;eW(Ze(),vt);var rW=Object.assign((0,tW._getStatsigGlobal)(),{StatsigClient:lS.default});vt.default=rW});import NS from"os";import sh from"path";import Yo from"fs";var zo="hcode",rt=".hcode",Ho="HCODE_GIT_BASH_PATH";var US={"qwen3-coder-plus":{enable:!1,env:{BASE_URL:"https://dashscope.aliyuncs.com/apps/anthropic",AUTH_TOKEN:"sk-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"qwen3-coder-plus",SMALL_FAST_MODEL:"qwen3-coder-plus"}},"kimi-k2":{enable:!1,env:{BASE_URL:"https://api.moonshot.cn/anthropic",AUTH_TOKEN:"sk-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"kimi-k2-0905-preview",SMALL_FAST_MODEL:"kimi-k2-0905-preview"}},deepseek:{enable:!1,env:{BASE_URL:"https://api.deepseek.com/anthropic",AUTH_TOKEN:"sk-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",API_TIMEOUT_MS:"600000",MODEL:"deepseek-chat",SMALL_FAST_MODEL:"deepseek-chat",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"}},openrouter:{enable:!1,env:{BASE_URL:"https://openrouter.ai/api/v1",AUTH_TOKEN:"sk-or-v1-{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"anthropic/claude-sonnet-4",SMALL_FAST_MODEL:"anthropic/claude-sonnet-4",API_TYPE:"openai"}},gemini:{enable:!1,env:{BASE_URL:"https://generativelanguage.googleapis.com",AUTH_TOKEN:"AI{ \u4F7F\u7528\u81EA\u5DF1\u7684 token }",MODEL:"gemini-2.5-pro",SMALL_FAST_MODEL:"gemini-2.5-pro",API_TYPE:"gemini"}}};function uh(){let t=NS.homedir();return sh.join(t,rt,"config.json")}function ch(){let t=uh();Yo.existsSync(t)||(Yo.mkdirSync(sh.dirname(t),{recursive:!0}),Yo.writeFileSync(t,JSON.stringify(US,null,2)))}function lh(){let t=Yo.readFileSync(uh(),"utf-8");return JSON.parse(t)}import{spawn as PS}from"child_process";var pe=(t,e=[])=>t.name==="up"||e.includes("vim")&&t.name==="k"||e.includes("emacs")&&t.ctrl&&t.name==="p",De=(t,e=[])=>t.name==="down"||e.includes("vim")&&t.name==="j"||e.includes("emacs")&&t.ctrl&&t.name==="n",nl=t=>t.name==="space",Dr=t=>t.name==="backspace",bt=t=>t.name==="tab",Ui=t=>"1234567890".includes(t.name),oe=t=>t.name==="enter"||t.name==="return";var Sr=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}},Jo=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Gi=class extends Error{name="ExitPromptError"},Xo=class extends Error{name="HookError"},nt=class extends Error{name="ValidationError"};import{AsyncResource as KS}from"node:async_hooks";import{AsyncLocalStorage as GS,AsyncResource as $S}from"node:async_hooks";var fh=new GS;function VS(t){return{rl:t,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function dh(t,e){let r=VS(t);return fh.run(r,()=>{function n(i){r.handleChange=()=>{r.index=0,i()},r.handleChange()}return e(n)})}function Er(){let t=fh.getStore();if(!t)throw new Xo("[Inquirer] Hook functions can only be called from within a prompt");return t}function il(){return Er().rl}function ol(t){let e=(...r)=>{let n=Er(),i=!1,o=n.handleChange;n.handleChange=()=>{i=!0};let a=t(...r);return i&&o(),n.handleChange=o,a};return $S.bind(e)}function rn(t){let e=Er(),{index:r}=e,n={get(){return e.hooks[r]},set(o){e.hooks[r]=o},initialized:r in e.hooks},i=t(n);return e.index++,i}function ph(){Er().handleChange()}var wr={queue(t){let e=Er(),{index:r}=e;e.hooksEffect.push(()=>{e.hooksCleanup[r]?.();let n=t(il());if(n!=null&&typeof n!="function")throw new nt("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[r]=n})},run(){let t=Er();ol(()=>{t.hooksEffect.forEach(e=>{e()}),t.hooksEffect.length=0})()},clearAll(){let t=Er();t.hooksCleanup.forEach(e=>{e?.()}),t.hooksEffect.length=0,t.hooksCleanup.length=0}};function T(t){return rn(e=>{let r=KS.bind(function(o){e.get()!==o&&(e.set(o),ph())});if(e.initialized)return[e.get(),r];let n=typeof t=="function"?t():t;return e.set(n),[n,r]})}function Ie(t,e){rn(r=>{let n=r.get();(!Array.isArray(n)||e.some((o,a)=>!Object.is(o,n[a])))&&wr.queue(t),r.set(e)})}var qe=le(Bt(),1);import it from"node:process";function HS(){return it.platform!=="win32"?it.env.TERM!=="linux":!!it.env.WT_SESSION||!!it.env.TERMINUS_SUBLIME||it.env.ConEmuTask==="{cmd::Cmder}"||it.env.TERM_PROGRAM==="Terminus-Sublime"||it.env.TERM_PROGRAM==="vscode"||it.env.TERM==="xterm-256color"||it.env.TERM==="alacritty"||it.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var hh={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},mh={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},YS={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},JS={...hh,...mh},XS={...hh,...YS},QS=HS(),ZS=QS?JS:XS,je=ZS,iz=Object.entries(mh);var vh={prefix:{idle:qe.default.blue("?"),done:qe.default.green(je.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(t=>qe.default.yellow(t))},style:{answer:qe.default.cyan,message:qe.default.bold,error:t=>qe.default.red(`> ${t}`),defaultAnswer:t=>qe.default.dim(`(${t})`),help:qe.default.dim,highlight:qe.default.cyan,key:t=>qe.default.cyan(qe.default.bold(`<${t}>`))}};function gh(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function bh(...t){let e={};for(let r of t)for(let[n,i]of Object.entries(r)){let o=e[n];e[n]=gh(o)&&gh(i)?bh(o,i):i}return e}function ie(...t){let e=[vh,...t.filter(r=>r!=null)];return bh(...e)}function ae({status:t="idle",theme:e}){let[r,n]=T(!1),[i,o]=T(0),{prefix:a,spinner:s}=ie(e);return Ie(()=>{if(t==="loading"){let c,l=-1,p=setTimeout(()=>{n(!0),c=setInterval(()=>{l=l+1,o(l%s.frames.length)},s.interval)},300);return()=>{clearTimeout(p),clearInterval(c)}}else n(!1)},[t]),r?s.frames[i]:typeof a=="string"?a:a[t==="loading"?"idle":t]??a.idle}function Se(t,e){return rn(r=>{let n=r.get();if(!n||n.dependencies.length!==e.length||n.dependencies.some((i,o)=>i!==e[o])){let i=t();return r.set({value:i,dependencies:e}),i}return n.value})}function Or(t){return T({current:t})[0]}function se(t){let e=Or(t);e.current=t,Ie(r=>{let n=!1,i=ol((o,a)=>{n||e.current(a,r)});return r.input.on("keypress",i),()=>{n=!0,r.input.removeListener("keypress",i)}},[])}var Hh=le(yh(),1),Yh=le(zh(),1);function Ki(t,e){return t.split(`
26
26
  `).flatMap(r=>(0,Yh.default)(r,e,{trim:!1,hard:!0}).split(`
27
27
  `).map(n=>n.trimEnd())).join(`
28
28
  `)}function ea(){return(0,Hh.default)({defaultWidth:80,output:il().output})}function DE({active:t,renderedItems:e,pageSize:r,loop:n}){let i=Or({lastPointer:t,lastActive:void 0}),{lastPointer:o,lastActive:a}=i.current,s=Math.floor(r/2),u=e.reduce((p,x)=>p+x.length,0),c=e.slice(0,t).reduce((p,x)=>p+x.length,0),l=c;if(u>r)if(n)l=o,a!=null&&a<t&&t-a<r&&(l=Math.min(s,Math.abs(t-a)===1?Math.min(o+(e[a]?.length??0),Math.max(c,o)):o+t-a));else{let p=e.slice(t).reduce((x,h)=>x+h.length,0);l=p<r-s?r-p:Math.min(c,s)}return i.current.lastPointer=l,i.current.lastActive=t,l}function Cr({items:t,active:e,renderItem:r,pageSize:n,loop:i=!0}){let o=ea(),a=v=>(v%t.length+t.length)%t.length,s=t.map((v,_)=>v==null?[]:Ki(r({item:v,index:_,isActive:_===e}),o).split(`
@@ -33,24 +33,24 @@ Calls to async() callback can have unexpected results.`),x=!0,function(_,y){_?p(
33
33
  `);let s=e+(r?`
34
34
  `+r:""),c=Math.floor(i.length/a)-this.cursorPos.rows+(r?Zh(r):0);c>0&&(s+=Dl(c)),s+=El(this.cursorPos.cols),this.write(Sl(this.extraLinesUnderPrompt)+wl(this.height)+s),this.extraLinesUnderPrompt=c,this.height=Zh(s)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(El(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let r=Sl(this.extraLinesUnderPrompt);r+=e?wl(this.height):`
35
35
  `,r+=na,this.write(r),this.rl.close()}};var ia=class extends Promise{static withResolver(){let e,r;return{promise:new Promise((i,o)=>{e=i,r=o}),resolve:e,reject:r}}};function FE(){let t=Error.prepareStackTrace,e=[];try{Error.prepareStackTrace=(r,n)=>{let i=n.slice(1);return e=i,i},new Error().stack}catch{return e}return Error.prepareStackTrace=t,e}function ue(t){let e=FE();return(n,i={})=>{let{input:o=process.stdin,signal:a}=i,s=new Set,u=new tm.default;u.pipe(i.output??process.stdout);let c=em.createInterface({terminal:!0,input:o,output:u}),l=new Wi(c),{promise:p,resolve:x,reject:h}=ia.withResolver(),g=()=>h(new Jo);if(a){let v=()=>h(new Sr({cause:a.reason}));if(a.aborted)return v(),Object.assign(p,{cancel:g});a.addEventListener("abort",v),s.add(()=>a.removeEventListener("abort",v))}s.add(Xh((v,_)=>{h(new Gi(`User force closed the prompt with ${v} ${_}`))}));let b=()=>h(new Gi("User force closed the prompt with SIGINT"));c.on("SIGINT",b),s.add(()=>c.removeListener("SIGINT",b));let m=()=>l.checkCursorPos();return c.input.on("keypress",m),s.add(()=>c.input.removeListener("keypress",m)),dh(c,v=>{let _=AE.bind(()=>wr.clearAll());return c.on("close",_),s.add(()=>c.removeListener("close",_)),v(()=>{try{let y=t(n,B=>{setImmediate(()=>x(B))});if(y===void 0){let B=e[1]?.getFileName();throw new Error(`Prompt functions must return a string.
36
- at ${B}`)}let[A,w]=typeof y=="string"?[y]:y;l.render(A,w),wr.run()}catch(y){h(y)}}),Object.assign(p.then(y=>(wr.clearAll(),y),y=>{throw wr.clearAll(),y}).finally(()=>{s.forEach(y=>y()),l.done({clearContent:!!i.clearPromptOnDone}),u.end()}).then(()=>p),{cancel:g})})}}var rm=le(Bt(),1);var U=class{separator=rm.default.dim(Array.from({length:15}).join(je.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="separator")}};var Fr=le(Bt(),1);var TE={icon:{checked:Fr.default.green(je.circleFilled),unchecked:je.circle,cursor:je.pointer},style:{disabledChoice:t=>Fr.default.dim(`- ${t}`),renderSelectedChoices:t=>t.map(e=>e.short).join(", "),description:t=>Fr.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${Fr.default.bold(e)} ${Fr.default.dim(r)}`).join(Fr.default.dim(" \u2022 "))},helpMode:"always",keybindings:[]};function Nt(t){return!U.isSeparator(t)&&!t.disabled}function Ol(t){return Nt(t)&&t.checked}function Cl(t){return Nt(t)?{...t,checked:!t.checked}:t}function IE(t){return function(e){return Nt(e)?{...e,checked:t}:e}}function PE(t){return t.map(e=>{if(U.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,checkedName:e.checkedName??r,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var Al=ue((t,e)=>{let{instructions:r,pageSize:n=7,loop:i=!0,required:o,validate:a=()=>!0}=t,s={all:"a",invert:"i",...t.shortcuts},u=ne(TE,t.theme),{keybindings:c}=u,[l,p]=T("idle"),x=ae({status:l,theme:u}),[h,g]=T(PE(t.choices)),b=Se(()=>{let F=h.findIndex(Nt),S=h.findLastIndex(Nt);if(F===-1)throw new nt("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:F,last:S}},[h]),[m,v]=T(b.first),[_,y]=T();se(async F=>{if(oe(F)){let S=h.filter(Ol),L=await a([...S]);o&&!h.some(Ol)?y("At least one choice must be selected"):L===!0?(p("done"),e(S.map(X=>X.value))):y(L||"You must select a valid value")}else if(pe(F,c)||De(F,c)){if(i||pe(F,c)&&m!==b.first||De(F,c)&&m!==b.last){let S=pe(F,c)?-1:1,L=m;do L=(L+S+h.length)%h.length;while(!Nt(h[L]));v(L)}}else if(nl(F))y(void 0),g(h.map((S,L)=>L===m?Cl(S):S));else if(F.name===s.all){let S=h.some(L=>Nt(L)&&!L.checked);g(h.map(IE(S)))}else if(F.name===s.invert)g(h.map(Cl));else if(Ui(F)){let S=Number(F.name)-1,L=-1,X=h.findIndex(tt=>U.isSeparator(tt)?!1:(L++,L===S)),de=h[X];de&&Nt(de)&&(v(X),g(h.map((tt,Ni)=>Ni===X?Cl(tt):tt)))}});let A=u.style.message(t.message,l),w,B=Cr({items:h,active:m,renderItem({item:F,isActive:S}){if(U.isSeparator(F))return` ${F.separator}`;if(F.disabled){let Ni=typeof F.disabled=="string"?F.disabled:"(disabled)";return u.style.disabledChoice(`${F.name} ${Ni}`)}S&&(w=F.description);let L=F.checked?u.icon.checked:u.icon.unchecked,X=F.checked?F.checkedName:F.name,de=S?u.style.highlight:Ni=>Ni,tt=S?u.icon.cursor:" ";return de(`${tt}${L} ${X}`)},pageSize:n,loop:i});if(l==="done"){let F=h.filter(Ol),S=u.style.answer(u.style.renderSelectedChoices(F,h));return[x,A,S].filter(Boolean).join(" ")}let I;if(u.helpMode!=="never"&&r!==!1)if(typeof r=="string")I=r;else{let F=[["\u2191\u2193","navigate"],["space","select"]];s.all&&F.push([s.all,"all"]),s.invert&&F.push([s.invert,"invert"]),F.push(["\u23CE","submit"]),I=u.style.keysHelpTip(F)}return`${[[x,A].filter(Boolean).join(" "),B," ",w?u.style.description(w):"",_?u.style.error(_):"",I].filter(Boolean).join(`
37
- `).trimEnd()}${sn}`});var nv=le(hm(),1),Kf=le(tv(),1);import{spawn as g8,spawnSync as b8}from"child_process";import{readFileSync as _8,unlinkSync as y8,writeFileSync as D8}from"fs";import Vf from"node:path";import S8 from"node:os";import{randomUUID as E8}from"node:crypto";var Ea=class extends Error{originalError;constructor(e){super(`Failed to create temporary file. ${e.message}`),this.originalError=e}};var Zi=class extends Error{originalError;constructor(e){super(`Failed to launch editor. ${e.message}`),this.originalError=e}};var wa=class extends Error{originalError;constructor(e){super(`Failed to read temporary file. ${e.message}`),this.originalError=e}};var Oa=class extends Error{originalError;constructor(e){super(`Failed to remove temporary file. ${e.message}`),this.originalError=e}};function iv(t="",e,r){let n=new Wf(t,r);n.runAsync((i,o)=>{if(i)setImmediate(e,i,void 0);else try{n.cleanup(),setImmediate(e,void 0,o)}catch(a){setImmediate(e,a,void 0)}})}function rv(t){return t?t.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function w8(t){let e=[],r="";for(let n=0;n<t.length;n++){let i=t.charAt(n);n>0&&i===" "&&t[n-1]!=="\\"&&r.length>0?(e.push(r),r=""):r=`${r}${i}`}return r.length>0&&e.push(r),e}var Wf=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(e="",r){this.text=e,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(e){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(e,void 0,this.text)}catch(r){setImmediate(e,r,void 0)}})}catch(r){setImmediate(e,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let e=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=w8(e).map(i=>i.replace("\\ "," ")),n=r.shift();this.editor={args:r,bin:n}}createTemporaryFile(){try{let e=this.fileOptions.dir??S8.tmpdir(),r=E8(),n=rv(this.fileOptions.prefix),i=rv(this.fileOptions.postfix),o=`${n}${r}${i}`,a=Vf.resolve(e,o),s=Vf.resolve(e)+Vf.sep;if(!a.startsWith(s))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=a;let u={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(u.mode=this.fileOptions.mode),D8(this.tempFile,this.text,u)}catch(e){throw new Ea(e)}}readTemporaryFile(){try{let e=_8(this.tempFile);if(e.length===0)this.text="";else{let r=(0,nv.detect)(e)??"utf8";Kf.default.encodingExists(r)||(r="utf8"),this.text=Kf.default.decode(e,r)}}catch(e){throw new wa(e)}}removeTemporaryFile(){try{y8(this.tempFile)}catch(e){throw new Oa(e)}}launchEditor(){try{let e=b8(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=e.status??0}catch(e){throw new Zi(e)}}launchEditorAsync(e){try{g8(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",n=>{this.lastExitStatus=n,setImmediate(e)})}catch(r){throw new Zi(r)}}};var O8={validationFailureMode:"keep"},zf=ue((t,e)=>{let{waitForUserInput:r=!0,file:{postfix:n=t.postfix??".txt",...i}={},validate:o=()=>!0}=t,a=ne(O8,t.theme),[s,u]=T("idle"),[c="",l]=T(t.default),[p,x]=T(),h=ae({status:s,theme:a});function g(_){_.pause();let y=async(A,w)=>{if(_.resume(),A)x(A.toString());else{u("loading");let B=w??"",I=await o(B);I===!0?(x(void 0),u("done"),e(B)):(a.validationFailureMode==="clear"?l(t.default):l(B),x(I||"You must provide a valid value"),u("idle"))}};iv(c,(A,w)=>void y(A,w),{postfix:n,...i})}Ie(_=>{r||g(_)},[]),se((_,y)=>{s==="idle"&&oe(_)&&g(y)});let b=a.style.message(t.message,s),m="";if(s==="loading")m=a.style.help("Received");else if(s==="idle"){let _=a.style.key("enter");m=a.style.help(`Press ${_} to launch your preferred editor.`)}let v="";return p&&(v=a.style.error(p)),[[h,b,m].filter(Boolean).join(" "),v]});function ov(t,e){let r=e!==!1;return/^(y|yes)/i.test(t)?r=!0:/^(n|no)/i.test(t)&&(r=!1),r}function av(t){return t?"Yes":"No"}var Hf=ue((t,e)=>{let{transformer:r=av}=t,[n,i]=T("idle"),[o,a]=T(""),s=ne(t.theme),u=ae({status:n,theme:s});se((x,h)=>{if(n==="idle")if(oe(x)){let g=ov(o,t.default);a(r(g)),i("done"),e(g)}else if(bt(x)){let g=av(!ov(o,t.default));h.clearLine(0),h.write(g),a(g)}else a(h.line)});let c=o,l="";n==="done"?c=s.style.answer(o):l=` ${s.style.defaultAnswer(t.default===!1?"y/N":"Y/n")}`;let p=s.style.message(t.message,n);return`${u} ${p}${l} ${c}`});var C8={validationFailureMode:"keep"},Yf=ue((t,e)=>{let{prefill:r="tab"}=t,n=ne(C8,t.theme),[i,o]=T("idle"),[a="",s]=T(t.default),[u,c]=T(),[l,p]=T(""),x=ae({status:i,theme:n});async function h(_){let{required:y,pattern:A,patternError:w="Invalid input"}=t;return y&&!_?"You must provide a value":A&&!A.test(_)?w:typeof t.validate=="function"?await t.validate(_)||"You must provide a valid value":!0}se(async(_,y)=>{if(i==="idle")if(oe(_)){let A=l||a;o("loading");let w=await h(A);w===!0?(p(A),o("done"),e(A)):(n.validationFailureMode==="clear"?p(""):y.write(l),c(w),o("idle"))}else Dr(_)&&!l?s(void 0):bt(_)&&!l?(s(void 0),y.clearLine(0),y.write(a),p(a)):(p(y.line),c(void 0))}),Ie(_=>{r==="editable"&&a&&(_.write(a),p(a))},[]);let g=n.style.message(t.message,i),b=l;typeof t.transformer=="function"?b=t.transformer(l,{isFinal:i==="done"}):i==="done"&&(b=n.style.answer(l));let m;a&&i!=="done"&&!l&&(m=n.style.defaultAnswer(a));let v="";return u&&(v=n.style.error(u)),[[x,g,m,b].filter(_=>_!==void 0).join(" "),v]});function A8(t,e,r){let n=t*Math.pow(10,6),i=e*Math.pow(10,6),o=r*Math.pow(10,6);return(n-(Number.isFinite(r)?o:0))%i===0}function sv(t,{min:e,max:r,step:n}){return t==null||Number.isNaN(t)?!1:t<e||t>r?`Value must be between ${e} and ${r}`:n!=="any"&&!A8(t,n,e)?`Value must be a multiple of ${n}${Number.isFinite(e)?` starting from ${e}`:""}`:!0}var Jf=ue((t,e)=>{let{validate:r=()=>!0,min:n=-1/0,max:i=1/0,step:o=1,required:a=!1}=t,s=ne(t.theme),[u,c]=T("idle"),[l,p]=T(""),x=sv(t.default,{min:n,max:i,step:o})===!0?t.default?.toString():void 0,[h="",g]=T(x),[b,m]=T(),v=ae({status:u,theme:s});se(async(B,I)=>{if(u==="idle")if(oe(B)){let re=l||h,F=re===""?void 0:Number(re);c("loading");let S=!0;(a||F!=null)&&(S=sv(F,{min:n,max:i,step:o})),S===!0&&(S=await r(F)),S===!0?(p(String(F??"")),c("done"),e(F)):(I.write(l),m(S||"You must provide a valid numeric value"),c("idle"))}else Dr(B)&&!l?g(void 0):bt(B)&&!l?(g(void 0),I.clearLine(0),I.write(h),p(h)):(p(I.line),m(void 0))});let _=s.style.message(t.message,u),y=l;u==="done"&&(y=s.style.answer(l));let A;h&&u!=="done"&&!l&&(A=s.style.defaultAnswer(h));let w="";return b&&(w=s.style.error(b)),[[v,_,A,y].filter(B=>B!==void 0).join(" "),w]});var Xf=le(Bt(),1);function F8(t){return t.map(e=>{if(U.isSeparator(e))return e;let r="name"in e?e.name:String(e.value);return{value:"value"in e?e.value:r,name:r,key:e.key.toLowerCase()}})}var T8={key:"h",name:"Help, list all options",value:void 0},Qf=ue((t,e)=>{let{default:r="h"}=t,n=Se(()=>F8(t.choices),[t.choices]),[i,o]=T("idle"),[a,s]=T(""),[u,c]=T(t.expanded??!1),[l,p]=T(),x=ne(t.theme),h=ae({theme:x,status:i});se((w,B)=>{if(oe(w)){let I=(a||r).toLowerCase();if(I==="h"&&!u)c(!0);else{let re=n.find(F=>!U.isSeparator(F)&&F.key===I);re?(o("done"),s(I),e(re.value)):p(a===""?"Please input a value":`"${Xf.default.red(a)}" isn't an available option`)}}else s(B.line),p(void 0)});let g=x.style.message(t.message,i);if(i==="done"){let w=n.find(B=>!U.isSeparator(B)&&B.key===a.toLowerCase());return`${h} ${g} ${x.style.answer(w.name)}`}let b=u?n:[...n,T8],m="",v=b.map(w=>U.isSeparator(w)?"":w.key===r?w.key.toUpperCase():w.key).join("");v=` ${x.style.defaultAnswer(v)}`,u&&(v="",m=b.map(w=>{if(U.isSeparator(w))return` ${w.separator}`;let B=` ${w.key}) ${w.name}`;return w.key===a.toLowerCase()?x.style.highlight(B):B}).join(`
36
+ at ${B}`)}let[A,w]=typeof y=="string"?[y]:y;l.render(A,w),wr.run()}catch(y){h(y)}}),Object.assign(p.then(y=>(wr.clearAll(),y),y=>{throw wr.clearAll(),y}).finally(()=>{s.forEach(y=>y()),l.done({clearContent:!!i.clearPromptOnDone}),u.end()}).then(()=>p),{cancel:g})})}}var rm=le(Bt(),1);var U=class{separator=rm.default.dim(Array.from({length:15}).join(je.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="separator")}};var Fr=le(Bt(),1);var TE={icon:{checked:Fr.default.green(je.circleFilled),unchecked:je.circle,cursor:je.pointer},style:{disabledChoice:t=>Fr.default.dim(`- ${t}`),renderSelectedChoices:t=>t.map(e=>e.short).join(", "),description:t=>Fr.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${Fr.default.bold(e)} ${Fr.default.dim(r)}`).join(Fr.default.dim(" \u2022 "))},helpMode:"always",keybindings:[]};function Nt(t){return!U.isSeparator(t)&&!t.disabled}function Ol(t){return Nt(t)&&t.checked}function Cl(t){return Nt(t)?{...t,checked:!t.checked}:t}function IE(t){return function(e){return Nt(e)?{...e,checked:t}:e}}function PE(t){return t.map(e=>{if(U.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,checkedName:e.checkedName??r,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var Al=ue((t,e)=>{let{instructions:r,pageSize:n=7,loop:i=!0,required:o,validate:a=()=>!0}=t,s={all:"a",invert:"i",...t.shortcuts},u=ie(TE,t.theme),{keybindings:c}=u,[l,p]=T("idle"),x=ae({status:l,theme:u}),[h,g]=T(PE(t.choices)),b=Se(()=>{let F=h.findIndex(Nt),S=h.findLastIndex(Nt);if(F===-1)throw new nt("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:F,last:S}},[h]),[m,v]=T(b.first),[_,y]=T();se(async F=>{if(oe(F)){let S=h.filter(Ol),L=await a([...S]);o&&!h.some(Ol)?y("At least one choice must be selected"):L===!0?(p("done"),e(S.map(X=>X.value))):y(L||"You must select a valid value")}else if(pe(F,c)||De(F,c)){if(i||pe(F,c)&&m!==b.first||De(F,c)&&m!==b.last){let S=pe(F,c)?-1:1,L=m;do L=(L+S+h.length)%h.length;while(!Nt(h[L]));v(L)}}else if(nl(F))y(void 0),g(h.map((S,L)=>L===m?Cl(S):S));else if(F.name===s.all){let S=h.some(L=>Nt(L)&&!L.checked);g(h.map(IE(S)))}else if(F.name===s.invert)g(h.map(Cl));else if(Ui(F)){let S=Number(F.name)-1,L=-1,X=h.findIndex(tt=>U.isSeparator(tt)?!1:(L++,L===S)),de=h[X];de&&Nt(de)&&(v(X),g(h.map((tt,Ni)=>Ni===X?Cl(tt):tt)))}});let A=u.style.message(t.message,l),w,B=Cr({items:h,active:m,renderItem({item:F,isActive:S}){if(U.isSeparator(F))return` ${F.separator}`;if(F.disabled){let Ni=typeof F.disabled=="string"?F.disabled:"(disabled)";return u.style.disabledChoice(`${F.name} ${Ni}`)}S&&(w=F.description);let L=F.checked?u.icon.checked:u.icon.unchecked,X=F.checked?F.checkedName:F.name,de=S?u.style.highlight:Ni=>Ni,tt=S?u.icon.cursor:" ";return de(`${tt}${L} ${X}`)},pageSize:n,loop:i});if(l==="done"){let F=h.filter(Ol),S=u.style.answer(u.style.renderSelectedChoices(F,h));return[x,A,S].filter(Boolean).join(" ")}let I;if(u.helpMode!=="never"&&r!==!1)if(typeof r=="string")I=r;else{let F=[["\u2191\u2193","navigate"],["space","select"]];s.all&&F.push([s.all,"all"]),s.invert&&F.push([s.invert,"invert"]),F.push(["\u23CE","submit"]),I=u.style.keysHelpTip(F)}return`${[[x,A].filter(Boolean).join(" "),B," ",w?u.style.description(w):"",_?u.style.error(_):"",I].filter(Boolean).join(`
37
+ `).trimEnd()}${sn}`});var nv=le(hm(),1),Kf=le(tv(),1);import{spawn as g8,spawnSync as b8}from"child_process";import{readFileSync as _8,unlinkSync as y8,writeFileSync as D8}from"fs";import Vf from"node:path";import S8 from"node:os";import{randomUUID as E8}from"node:crypto";var Ea=class extends Error{originalError;constructor(e){super(`Failed to create temporary file. ${e.message}`),this.originalError=e}};var Zi=class extends Error{originalError;constructor(e){super(`Failed to launch editor. ${e.message}`),this.originalError=e}};var wa=class extends Error{originalError;constructor(e){super(`Failed to read temporary file. ${e.message}`),this.originalError=e}};var Oa=class extends Error{originalError;constructor(e){super(`Failed to remove temporary file. ${e.message}`),this.originalError=e}};function iv(t="",e,r){let n=new Wf(t,r);n.runAsync((i,o)=>{if(i)setImmediate(e,i,void 0);else try{n.cleanup(),setImmediate(e,void 0,o)}catch(a){setImmediate(e,a,void 0)}})}function rv(t){return t?t.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function w8(t){let e=[],r="";for(let n=0;n<t.length;n++){let i=t.charAt(n);n>0&&i===" "&&t[n-1]!=="\\"&&r.length>0?(e.push(r),r=""):r=`${r}${i}`}return r.length>0&&e.push(r),e}var Wf=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(e="",r){this.text=e,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(e){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(e,void 0,this.text)}catch(r){setImmediate(e,r,void 0)}})}catch(r){setImmediate(e,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let e=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=w8(e).map(i=>i.replace("\\ "," ")),n=r.shift();this.editor={args:r,bin:n}}createTemporaryFile(){try{let e=this.fileOptions.dir??S8.tmpdir(),r=E8(),n=rv(this.fileOptions.prefix),i=rv(this.fileOptions.postfix),o=`${n}${r}${i}`,a=Vf.resolve(e,o),s=Vf.resolve(e)+Vf.sep;if(!a.startsWith(s))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=a;let u={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(u.mode=this.fileOptions.mode),D8(this.tempFile,this.text,u)}catch(e){throw new Ea(e)}}readTemporaryFile(){try{let e=_8(this.tempFile);if(e.length===0)this.text="";else{let r=(0,nv.detect)(e)??"utf8";Kf.default.encodingExists(r)||(r="utf8"),this.text=Kf.default.decode(e,r)}}catch(e){throw new wa(e)}}removeTemporaryFile(){try{y8(this.tempFile)}catch(e){throw new Oa(e)}}launchEditor(){try{let e=b8(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=e.status??0}catch(e){throw new Zi(e)}}launchEditorAsync(e){try{g8(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",n=>{this.lastExitStatus=n,setImmediate(e)})}catch(r){throw new Zi(r)}}};var O8={validationFailureMode:"keep"},zf=ue((t,e)=>{let{waitForUserInput:r=!0,file:{postfix:n=t.postfix??".txt",...i}={},validate:o=()=>!0}=t,a=ie(O8,t.theme),[s,u]=T("idle"),[c="",l]=T(t.default),[p,x]=T(),h=ae({status:s,theme:a});function g(_){_.pause();let y=async(A,w)=>{if(_.resume(),A)x(A.toString());else{u("loading");let B=w??"",I=await o(B);I===!0?(x(void 0),u("done"),e(B)):(a.validationFailureMode==="clear"?l(t.default):l(B),x(I||"You must provide a valid value"),u("idle"))}};iv(c,(A,w)=>void y(A,w),{postfix:n,...i})}Ie(_=>{r||g(_)},[]),se((_,y)=>{s==="idle"&&oe(_)&&g(y)});let b=a.style.message(t.message,s),m="";if(s==="loading")m=a.style.help("Received");else if(s==="idle"){let _=a.style.key("enter");m=a.style.help(`Press ${_} to launch your preferred editor.`)}let v="";return p&&(v=a.style.error(p)),[[h,b,m].filter(Boolean).join(" "),v]});function ov(t,e){let r=e!==!1;return/^(y|yes)/i.test(t)?r=!0:/^(n|no)/i.test(t)&&(r=!1),r}function av(t){return t?"Yes":"No"}var Hf=ue((t,e)=>{let{transformer:r=av}=t,[n,i]=T("idle"),[o,a]=T(""),s=ie(t.theme),u=ae({status:n,theme:s});se((x,h)=>{if(n==="idle")if(oe(x)){let g=ov(o,t.default);a(r(g)),i("done"),e(g)}else if(bt(x)){let g=av(!ov(o,t.default));h.clearLine(0),h.write(g),a(g)}else a(h.line)});let c=o,l="";n==="done"?c=s.style.answer(o):l=` ${s.style.defaultAnswer(t.default===!1?"y/N":"Y/n")}`;let p=s.style.message(t.message,n);return`${u} ${p}${l} ${c}`});var C8={validationFailureMode:"keep"},Yf=ue((t,e)=>{let{prefill:r="tab"}=t,n=ie(C8,t.theme),[i,o]=T("idle"),[a="",s]=T(t.default),[u,c]=T(),[l,p]=T(""),x=ae({status:i,theme:n});async function h(_){let{required:y,pattern:A,patternError:w="Invalid input"}=t;return y&&!_?"You must provide a value":A&&!A.test(_)?w:typeof t.validate=="function"?await t.validate(_)||"You must provide a valid value":!0}se(async(_,y)=>{if(i==="idle")if(oe(_)){let A=l||a;o("loading");let w=await h(A);w===!0?(p(A),o("done"),e(A)):(n.validationFailureMode==="clear"?p(""):y.write(l),c(w),o("idle"))}else Dr(_)&&!l?s(void 0):bt(_)&&!l?(s(void 0),y.clearLine(0),y.write(a),p(a)):(p(y.line),c(void 0))}),Ie(_=>{r==="editable"&&a&&(_.write(a),p(a))},[]);let g=n.style.message(t.message,i),b=l;typeof t.transformer=="function"?b=t.transformer(l,{isFinal:i==="done"}):i==="done"&&(b=n.style.answer(l));let m;a&&i!=="done"&&!l&&(m=n.style.defaultAnswer(a));let v="";return u&&(v=n.style.error(u)),[[x,g,m,b].filter(_=>_!==void 0).join(" "),v]});function A8(t,e,r){let n=t*Math.pow(10,6),i=e*Math.pow(10,6),o=r*Math.pow(10,6);return(n-(Number.isFinite(r)?o:0))%i===0}function sv(t,{min:e,max:r,step:n}){return t==null||Number.isNaN(t)?!1:t<e||t>r?`Value must be between ${e} and ${r}`:n!=="any"&&!A8(t,n,e)?`Value must be a multiple of ${n}${Number.isFinite(e)?` starting from ${e}`:""}`:!0}var Jf=ue((t,e)=>{let{validate:r=()=>!0,min:n=-1/0,max:i=1/0,step:o=1,required:a=!1}=t,s=ie(t.theme),[u,c]=T("idle"),[l,p]=T(""),x=sv(t.default,{min:n,max:i,step:o})===!0?t.default?.toString():void 0,[h="",g]=T(x),[b,m]=T(),v=ae({status:u,theme:s});se(async(B,I)=>{if(u==="idle")if(oe(B)){let ne=l||h,F=ne===""?void 0:Number(ne);c("loading");let S=!0;(a||F!=null)&&(S=sv(F,{min:n,max:i,step:o})),S===!0&&(S=await r(F)),S===!0?(p(String(F??"")),c("done"),e(F)):(I.write(l),m(S||"You must provide a valid numeric value"),c("idle"))}else Dr(B)&&!l?g(void 0):bt(B)&&!l?(g(void 0),I.clearLine(0),I.write(h),p(h)):(p(I.line),m(void 0))});let _=s.style.message(t.message,u),y=l;u==="done"&&(y=s.style.answer(l));let A;h&&u!=="done"&&!l&&(A=s.style.defaultAnswer(h));let w="";return b&&(w=s.style.error(b)),[[v,_,A,y].filter(B=>B!==void 0).join(" "),w]});var Xf=le(Bt(),1);function F8(t){return t.map(e=>{if(U.isSeparator(e))return e;let r="name"in e?e.name:String(e.value);return{value:"value"in e?e.value:r,name:r,key:e.key.toLowerCase()}})}var T8={key:"h",name:"Help, list all options",value:void 0},Qf=ue((t,e)=>{let{default:r="h"}=t,n=Se(()=>F8(t.choices),[t.choices]),[i,o]=T("idle"),[a,s]=T(""),[u,c]=T(t.expanded??!1),[l,p]=T(),x=ie(t.theme),h=ae({theme:x,status:i});se((w,B)=>{if(oe(w)){let I=(a||r).toLowerCase();if(I==="h"&&!u)c(!0);else{let ne=n.find(F=>!U.isSeparator(F)&&F.key===I);ne?(o("done"),s(I),e(ne.value)):p(a===""?"Please input a value":`"${Xf.default.red(a)}" isn't an available option`)}}else s(B.line),p(void 0)});let g=x.style.message(t.message,i);if(i==="done"){let w=n.find(B=>!U.isSeparator(B)&&B.key===a.toLowerCase());return`${h} ${g} ${x.style.answer(w.name)}`}let b=u?n:[...n,T8],m="",v=b.map(w=>U.isSeparator(w)?"":w.key===r?w.key.toUpperCase():w.key).join("");v=` ${x.style.defaultAnswer(v)}`,u&&(v="",m=b.map(w=>{if(U.isSeparator(w))return` ${w.separator}`;let B=` ${w.key}) ${w.name}`;return w.key===a.toLowerCase()?x.style.highlight(B):B}).join(`
38
38
  `));let _="",y=n.find(w=>!U.isSeparator(w)&&w.key===a.toLowerCase());y&&(_=`${Xf.default.cyan(">>")} ${y.name}`);let A="";return l&&(A=x.style.error(l)),[`${h} ${g}${v} ${a}`,[m,_,A].filter(Boolean).join(`
39
- `)]});var cv=le(Bt(),1),I8=/\d+/;function jr(t){return t!=null&&!U.isSeparator(t)}function P8(t){let e=0;return t.map(r=>{if(U.isSeparator(r))return r;if(e+=1,typeof r=="string")return{value:r,name:r,short:r,key:String(e)};let n=r.name??String(r.value);return{value:r.value,name:n,short:r.short??n,key:r.key??String(e)}})}function uv(t,e){let r,n=e.filter(jr);if(r=n.find(i=>i.key===t),!r&&I8.test(t)){let i=Number.parseInt(t,10)-1;r=n[i]}return r?[r,e.indexOf(r)]:[void 0,void 0]}var Zf=ue((t,e)=>{let{loop:r=!0}=t,n=Se(()=>P8(t.choices),[t.choices]),[i,o]=T("idle"),[a,s]=T(""),[u,c]=T(),l=ne(t.theme),p=ae({status:i,theme:l}),x=Se(()=>{let m=n.findIndex(jr),v=n.findLastIndex(jr);if(m===-1)throw new nt("[select prompt] No selectable choices. All choices are disabled.");return{first:m,last:v}},[n]);se((m,v)=>{if(oe(m)){let[_]=uv(a,n);jr(_)?(s(_.short),o("done"),e(_.value)):c(a===""?"Please input a value":`"${cv.default.red(a)}" isn't an available option`)}else if(pe(m)||De(m)){v.clearLine(0);let[_,y]=uv(a,n);if(_){if(r||pe(m)&&y!==x.first||De(m)&&y!==x.last){let A=pe(m)?-1:1,w=y;do w=(w+A+n.length)%n.length;while(!jr(n[w]));s(n[w].key)}}else{let A=De(m)?n.find(jr):n.findLast(jr);s(A.key)}}else s(v.line),c(void 0)});let h=l.style.message(t.message,i);if(i==="done")return`${p} ${h} ${l.style.answer(a)}`;let g=n.map(m=>{if(U.isSeparator(m))return` ${m.separator}`;let v=` ${m.key}) ${m.name}`;return m.key===a.toLowerCase()?l.style.highlight(v):v}).join(`
39
+ `)]});var cv=le(Bt(),1),I8=/\d+/;function jr(t){return t!=null&&!U.isSeparator(t)}function P8(t){let e=0;return t.map(r=>{if(U.isSeparator(r))return r;if(e+=1,typeof r=="string")return{value:r,name:r,short:r,key:String(e)};let n=r.name??String(r.value);return{value:r.value,name:n,short:r.short??n,key:r.key??String(e)}})}function uv(t,e){let r,n=e.filter(jr);if(r=n.find(i=>i.key===t),!r&&I8.test(t)){let i=Number.parseInt(t,10)-1;r=n[i]}return r?[r,e.indexOf(r)]:[void 0,void 0]}var Zf=ue((t,e)=>{let{loop:r=!0}=t,n=Se(()=>P8(t.choices),[t.choices]),[i,o]=T("idle"),[a,s]=T(""),[u,c]=T(),l=ie(t.theme),p=ae({status:i,theme:l}),x=Se(()=>{let m=n.findIndex(jr),v=n.findLastIndex(jr);if(m===-1)throw new nt("[select prompt] No selectable choices. All choices are disabled.");return{first:m,last:v}},[n]);se((m,v)=>{if(oe(m)){let[_]=uv(a,n);jr(_)?(s(_.short),o("done"),e(_.value)):c(a===""?"Please input a value":`"${cv.default.red(a)}" isn't an available option`)}else if(pe(m)||De(m)){v.clearLine(0);let[_,y]=uv(a,n);if(_){if(r||pe(m)&&y!==x.first||De(m)&&y!==x.last){let A=pe(m)?-1:1,w=y;do w=(w+A+n.length)%n.length;while(!jr(n[w]));s(n[w].key)}}else{let A=De(m)?n.find(jr):n.findLast(jr);s(A.key)}}else s(v.line),c(void 0)});let h=l.style.message(t.message,i);if(i==="done")return`${p} ${h} ${l.style.answer(a)}`;let g=n.map(m=>{if(U.isSeparator(m))return` ${m.separator}`;let v=` ${m.key}) ${m.name}`;return m.key===a.toLowerCase()?l.style.highlight(v):v}).join(`
40
40
  `),b="";return u&&(b=l.style.error(u)),[`${p} ${h} ${a}`,[g,b].filter(Boolean).join(`
41
- `)]});var ed=ue((t,e)=>{let{validate:r=()=>!0}=t,n=ne(t.theme),[i,o]=T("idle"),[a,s]=T(),[u,c]=T(""),l=ae({status:i,theme:n});se(async(b,m)=>{if(i==="idle")if(oe(b)){let v=u;o("loading");let _=await r(v);_===!0?(c(v),o("done"),e(v)):(m.write(u),s(_||"You must provide a valid value"),o("idle"))}else c(m.line),s(void 0)});let p=n.style.message(t.message,i),x="",h;t.mask?x=(typeof t.mask=="string"?t.mask:"*").repeat(u.length):i!=="done"&&(h=`${n.style.help("[input is masked]")}${sn}`),i==="done"&&(x=n.style.answer(x));let g="";return a&&(g=n.style.error(a)),[[l,p,t.mask?x:h].join(" "),g]});var qr=le(Bt(),1);var j8={icon:{cursor:je.pointer},style:{disabled:t=>qr.default.dim(`- ${t}`),searchTerm:t=>qr.default.cyan(t),description:t=>qr.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${qr.default.bold(e)} ${qr.default.dim(r)}`).join(qr.default.dim(" \u2022 "))},helpMode:"always"};function td(t){return!U.isSeparator(t)&&!t.disabled}function q8(t){return t.map(e=>{if(U.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var rd=ue((t,e)=>{let{pageSize:r=7,validate:n=()=>!0}=t,i=ne(j8,t.theme),[o,a]=T("loading"),[s,u]=T(""),[c,l]=T([]),[p,x]=T(),h=ae({status:o,theme:i}),g=Se(()=>{let S=c.findIndex(td),L=c.findLastIndex(td);return{first:S,last:L}},[c]),[b=g.first,m]=T();Ie(()=>{let S=new AbortController;return a("loading"),x(void 0),(async()=>{try{let X=await t.source(s||void 0,{signal:S.signal});S.signal.aborted||(m(void 0),x(void 0),l(q8(X)),a("idle"))}catch(X){!S.signal.aborted&&X instanceof Error&&x(X.message)}})(),()=>{S.abort()}},[s]);let v=c[b];se(async(S,L)=>{if(oe(S))if(v){a("loading");let X=await n(v.value);a("idle"),X===!0?(a("done"),e(v.value)):v.name===s?x(X||"You must provide a valid value"):(L.write(v.name),u(v.name))}else L.write(s);else if(bt(S)&&v)L.clearLine(0),L.write(v.name),u(v.name);else if(o!=="loading"&&(pe(S)||De(S))){if(L.clearLine(0),pe(S)&&b!==g.first||De(S)&&b!==g.last){let X=pe(S)?-1:1,de=b;do de=(de+X+c.length)%c.length;while(!td(c[de]));m(de)}}else u(L.line)});let _=i.style.message(t.message,o),y;if(i.helpMode!=="never")if(t.instructions){let{pager:S,navigation:L}=t.instructions;y=i.style.help(c.length>r?S:L)}else y=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let A=Cr({items:c,active:b,renderItem({item:S,isActive:L}){if(U.isSeparator(S))return` ${S.separator}`;if(S.disabled){let tt=typeof S.disabled=="string"?S.disabled:"(disabled)";return i.style.disabled(`${S.name} ${tt}`)}let X=L?i.style.highlight:tt=>tt,de=L?i.icon.cursor:" ";return X(`${de} ${S.name}`)},pageSize:r,loop:!1}),w;p?w=i.style.error(p):c.length===0&&s!==""&&o==="idle"&&(w=i.style.error("No results found"));let B;if(o==="done"&&v)return[h,_,i.style.answer(v.short)].filter(Boolean).join(" ").trimEnd();B=i.style.searchTerm(s);let I=v?.description,re=[h,_,B].filter(Boolean).join(" ").trimEnd(),F=[w??A," ",I?i.style.description(I):"",y].filter(Boolean).join(`
42
- `).trimEnd();return[re,F]});var dn=le(Bt(),1);var M8={icon:{cursor:je.pointer},style:{disabled:t=>dn.default.dim(`- ${t}`),description:t=>dn.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${dn.default.bold(e)} ${dn.default.dim(r)}`).join(dn.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function fn(t){return!U.isSeparator(t)&&!t.disabled}function k8(t){return t.map(e=>{if(U.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var Ca=ue((t,e)=>{let{loop:r=!0,pageSize:n=7}=t,i=ne(M8,t.theme),{keybindings:o}=i,[a,s]=T("idle"),u=ae({status:a,theme:i}),c=Or(),l=!o.includes("vim"),p=Se(()=>k8(t.choices),[t.choices]),x=Se(()=>{let I=p.findIndex(fn),re=p.findLastIndex(fn);if(I===-1)throw new nt("[select prompt] No selectable choices. All choices are disabled.");return{first:I,last:re}},[p]),h=Se(()=>"default"in t?p.findIndex(I=>fn(I)&&I.value===t.default):-1,[t.default,p]),[g,b]=T(h===-1?x.first:h),m=p[g];se((I,re)=>{if(clearTimeout(c.current),oe(I))s("done"),e(m.value);else if(pe(I,o)||De(I,o)){if(re.clearLine(0),r||pe(I,o)&&g!==x.first||De(I,o)&&g!==x.last){let F=pe(I,o)?-1:1,S=g;do S=(S+F+p.length)%p.length;while(!fn(p[S]));b(S)}}else if(Ui(I)&&!Number.isNaN(Number(re.line))){let F=Number(re.line)-1,S=-1,L=p.findIndex(de=>U.isSeparator(de)?!1:(S++,S===F)),X=p[L];X!=null&&fn(X)&&b(L),c.current=setTimeout(()=>{re.clearLine(0)},700)}else if(Dr(I))re.clearLine(0);else if(l){let F=re.line.toLowerCase(),S=p.findIndex(L=>U.isSeparator(L)||!fn(L)?!1:L.name.toLowerCase().startsWith(F));S!==-1&&b(S),c.current=setTimeout(()=>{re.clearLine(0)},700)}}),Ie(()=>()=>{clearTimeout(c.current)},[]);let v=i.style.message(t.message,a),_;if(i.helpMode!=="never")if(t.instructions){let{pager:I,navigation:re}=t.instructions;_=i.style.help(p.length>n?I:re)}else _=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let y=0,A=Cr({items:p,active:g,renderItem({item:I,isActive:re,index:F}){if(U.isSeparator(I))return y++,` ${I.separator}`;let S=i.indexMode==="number"?`${F+1-y}. `:"";if(I.disabled){let de=typeof I.disabled=="string"?I.disabled:"(disabled)";return i.style.disabled(`${S}${I.name} ${de}`)}let L=re?i.style.highlight:de=>de,X=re?i.icon.cursor:" ";return L(`${X} ${S}${I.name}`)},pageSize:n,loop:r});if(a==="done")return[u,v,i.style.answer(m.short)].filter(Boolean).join(" ");let{description:w}=m;return`${[[u,v].filter(Boolean).join(" "),A," ",w?i.style.description(w):"",_].filter(Boolean).join(`
41
+ `)]});var ed=ue((t,e)=>{let{validate:r=()=>!0}=t,n=ie(t.theme),[i,o]=T("idle"),[a,s]=T(),[u,c]=T(""),l=ae({status:i,theme:n});se(async(b,m)=>{if(i==="idle")if(oe(b)){let v=u;o("loading");let _=await r(v);_===!0?(c(v),o("done"),e(v)):(m.write(u),s(_||"You must provide a valid value"),o("idle"))}else c(m.line),s(void 0)});let p=n.style.message(t.message,i),x="",h;t.mask?x=(typeof t.mask=="string"?t.mask:"*").repeat(u.length):i!=="done"&&(h=`${n.style.help("[input is masked]")}${sn}`),i==="done"&&(x=n.style.answer(x));let g="";return a&&(g=n.style.error(a)),[[l,p,t.mask?x:h].join(" "),g]});var qr=le(Bt(),1);var j8={icon:{cursor:je.pointer},style:{disabled:t=>qr.default.dim(`- ${t}`),searchTerm:t=>qr.default.cyan(t),description:t=>qr.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${qr.default.bold(e)} ${qr.default.dim(r)}`).join(qr.default.dim(" \u2022 "))},helpMode:"always"};function td(t){return!U.isSeparator(t)&&!t.disabled}function q8(t){return t.map(e=>{if(U.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var rd=ue((t,e)=>{let{pageSize:r=7,validate:n=()=>!0}=t,i=ie(j8,t.theme),[o,a]=T("loading"),[s,u]=T(""),[c,l]=T([]),[p,x]=T(),h=ae({status:o,theme:i}),g=Se(()=>{let S=c.findIndex(td),L=c.findLastIndex(td);return{first:S,last:L}},[c]),[b=g.first,m]=T();Ie(()=>{let S=new AbortController;return a("loading"),x(void 0),(async()=>{try{let X=await t.source(s||void 0,{signal:S.signal});S.signal.aborted||(m(void 0),x(void 0),l(q8(X)),a("idle"))}catch(X){!S.signal.aborted&&X instanceof Error&&x(X.message)}})(),()=>{S.abort()}},[s]);let v=c[b];se(async(S,L)=>{if(oe(S))if(v){a("loading");let X=await n(v.value);a("idle"),X===!0?(a("done"),e(v.value)):v.name===s?x(X||"You must provide a valid value"):(L.write(v.name),u(v.name))}else L.write(s);else if(bt(S)&&v)L.clearLine(0),L.write(v.name),u(v.name);else if(o!=="loading"&&(pe(S)||De(S))){if(L.clearLine(0),pe(S)&&b!==g.first||De(S)&&b!==g.last){let X=pe(S)?-1:1,de=b;do de=(de+X+c.length)%c.length;while(!td(c[de]));m(de)}}else u(L.line)});let _=i.style.message(t.message,o),y;if(i.helpMode!=="never")if(t.instructions){let{pager:S,navigation:L}=t.instructions;y=i.style.help(c.length>r?S:L)}else y=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let A=Cr({items:c,active:b,renderItem({item:S,isActive:L}){if(U.isSeparator(S))return` ${S.separator}`;if(S.disabled){let tt=typeof S.disabled=="string"?S.disabled:"(disabled)";return i.style.disabled(`${S.name} ${tt}`)}let X=L?i.style.highlight:tt=>tt,de=L?i.icon.cursor:" ";return X(`${de} ${S.name}`)},pageSize:r,loop:!1}),w;p?w=i.style.error(p):c.length===0&&s!==""&&o==="idle"&&(w=i.style.error("No results found"));let B;if(o==="done"&&v)return[h,_,i.style.answer(v.short)].filter(Boolean).join(" ").trimEnd();B=i.style.searchTerm(s);let I=v?.description,ne=[h,_,B].filter(Boolean).join(" ").trimEnd(),F=[w??A," ",I?i.style.description(I):"",y].filter(Boolean).join(`
42
+ `).trimEnd();return[ne,F]});var dn=le(Bt(),1);var M8={icon:{cursor:je.pointer},style:{disabled:t=>dn.default.dim(`- ${t}`),description:t=>dn.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${dn.default.bold(e)} ${dn.default.dim(r)}`).join(dn.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function fn(t){return!U.isSeparator(t)&&!t.disabled}function k8(t){return t.map(e=>{if(U.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var Ca=ue((t,e)=>{let{loop:r=!0,pageSize:n=7}=t,i=ie(M8,t.theme),{keybindings:o}=i,[a,s]=T("idle"),u=ae({status:a,theme:i}),c=Or(),l=!o.includes("vim"),p=Se(()=>k8(t.choices),[t.choices]),x=Se(()=>{let I=p.findIndex(fn),ne=p.findLastIndex(fn);if(I===-1)throw new nt("[select prompt] No selectable choices. All choices are disabled.");return{first:I,last:ne}},[p]),h=Se(()=>"default"in t?p.findIndex(I=>fn(I)&&I.value===t.default):-1,[t.default,p]),[g,b]=T(h===-1?x.first:h),m=p[g];se((I,ne)=>{if(clearTimeout(c.current),oe(I))s("done"),e(m.value);else if(pe(I,o)||De(I,o)){if(ne.clearLine(0),r||pe(I,o)&&g!==x.first||De(I,o)&&g!==x.last){let F=pe(I,o)?-1:1,S=g;do S=(S+F+p.length)%p.length;while(!fn(p[S]));b(S)}}else if(Ui(I)&&!Number.isNaN(Number(ne.line))){let F=Number(ne.line)-1,S=-1,L=p.findIndex(de=>U.isSeparator(de)?!1:(S++,S===F)),X=p[L];X!=null&&fn(X)&&b(L),c.current=setTimeout(()=>{ne.clearLine(0)},700)}else if(Dr(I))ne.clearLine(0);else if(l){let F=ne.line.toLowerCase(),S=p.findIndex(L=>U.isSeparator(L)||!fn(L)?!1:L.name.toLowerCase().startsWith(F));S!==-1&&b(S),c.current=setTimeout(()=>{ne.clearLine(0)},700)}}),Ie(()=>()=>{clearTimeout(c.current)},[]);let v=i.style.message(t.message,a),_;if(i.helpMode!=="never")if(t.instructions){let{pager:I,navigation:ne}=t.instructions;_=i.style.help(p.length>n?I:ne)}else _=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let y=0,A=Cr({items:p,active:g,renderItem({item:I,isActive:ne,index:F}){if(U.isSeparator(I))return y++,` ${I.separator}`;let S=i.indexMode==="number"?`${F+1-y}. `:"";if(I.disabled){let de=typeof I.disabled=="string"?I.disabled:"(disabled)";return i.style.disabled(`${S}${I.name} ${de}`)}let L=ne?i.style.highlight:de=>de,X=ne?i.icon.cursor:" ";return L(`${X} ${S}${I.name}`)},pageSize:n,loop:r});if(a==="done")return[u,v,i.style.answer(m.short)].filter(Boolean).join(" ");let{description:w}=m;return`${[[u,v].filter(Boolean).join(" "),A," ",w?i.style.description(w):"",_].filter(Boolean).join(`
43
43
  `).trimEnd()}${sn}`});var ee=le(k_(),1),bp=le(N_(),1),G_=le(hl(),1);import zk from"node:readline";var U_={set:(t,e="",r)=>{let n=t;e.split(".").forEach((i,o,a)=>{i==="__proto__"||i==="constructor"||(o===a.length-1?n[i]=r:(!(i in n)||typeof n[i]!="object")&&(n[i]={}),n=n[i])})},get:(t,e="",r)=>{let n=o=>String.prototype.split.call(e,o).filter(Boolean).reduce((a,s)=>a==null?a:a[s],t),i=n(/[,[\]]+?/)||n(/[,.[\]]+?/);return i===void 0||i===t?r:i}};async function vp(t,e,r){let n=t[e];return typeof n=="function"?(0,bp.default)(n)(r):n}var gp=class extends Error{name="TTYError";isTtyError=!0};function Hk(t){t.skipTTYChecks=t.skipTTYChecks===void 0?!0:t.skipTTYChecks;let e=t.input||process.stdin;if(!t.skipTTYChecks&&!e.isTTY)throw new gp("Prompts can not be meaningfully rendered in non-TTY environments");let r=new G_.default;return r.pipe(t.output||process.stdout),{terminal:!0,...t,input:e,output:r}}function Yk(t){return Array.isArray(t)}function Jk(t){return Object.values(t).every(e=>typeof e=="object"&&!Array.isArray(e)&&e!=null)}function Xk(t){return!!(t.prototype&&"run"in t.prototype&&typeof t.prototype.run=="function")}var Xn=class{prompts;answers={};process=ee.EMPTY;abortController=new AbortController;opt;constructor(e,r={}){this.opt=r,this.prompts=e}async run(e,r){this.abortController=new AbortController,this.answers=typeof r=="object"?{...r}:{};let n;return Yk(e)?n=(0,ee.from)(e):(0,ee.isObservable)(e)?n=e:Jk(e)?n=(0,ee.from)(Object.entries(e).map(([i,o])=>Object.assign({},o,{name:i}))):n=(0,ee.from)([e]),this.process=n.pipe((0,ee.concatMap)(i=>(0,ee.of)(i).pipe((0,ee.concatMap)(o=>(0,ee.from)(this.shouldRun(o).then(a=>{if(a)return o})).pipe((0,ee.filter)(a=>a!=null))),(0,ee.concatMap)(o=>(0,ee.defer)(()=>(0,ee.from)(this.fetchAnswer(o))))))),(0,ee.lastValueFrom)(this.process.pipe((0,ee.reduce)((i,o)=>(U_.set(i,o.name,o.answer),i),this.answers))).then(()=>this.answers).finally(()=>this.close())}prepareQuestion=async e=>{let[r,n,i]=await Promise.all([vp(e,"message",this.answers),vp(e,"default",this.answers),vp(e,"choices",this.answers)]),o;return Array.isArray(i)&&(o=i.map(a=>{let s=typeof a!="object"||a==null?{name:a,value:a}:{...a,value:"value"in a?a.value:"name"in a?a.name:void 0};return"value"in s&&Array.isArray(n)?{checked:n.includes(s.value),...s}:s})),Object.assign({},e,{message:r,default:n,choices:o,type:e.type in this.prompts?e.type:"input"})};fetchAnswer=async e=>{let r=await this.prepareQuestion(e),n=this.prompts[r.type];if(n==null)throw new Error(`Prompt for type ${r.type} not found`);let i,o=Xk(n)?(l,p)=>new Promise((x,h)=>{let{signal:g}=p;if(g.aborted){h(new Sr({cause:g.reason}));return}let b=zk.createInterface(Hk(p)),m=()=>{this.close(),process.kill(process.pid,"SIGINT"),console.log("")},v=()=>{process.removeListener("exit",m),b.removeListener("SIGINT",m),b.setPrompt(""),b.output.unmute(),b.output.write(na),b.output.end(),b.close()};process.on("exit",m),b.on("SIGINT",m);let _=new n(l,b,this.answers),y=()=>{v(),i?.()},A=()=>{h(new Sr({cause:g.reason})),y()};g.addEventListener("abort",A),i=()=>{g.removeEventListener("abort",A),i=void 0},_.run().then(x,h).finally(y)}):n,a,{signal:s}=this.opt;if(s?.aborted)this.abortController.abort(s.reason);else if(s){let l=()=>this.abortController.abort(s.reason);s.addEventListener("abort",l),a=()=>{s.removeEventListener("abort",l)}}let{filter:u=l=>l}=r,{signal:c}=this.abortController;return o(r,{...this.opt,signal:c}).then(l=>({name:r.name,answer:u(l,this.answers)})).finally(()=>{i?.(),a?.()})};close=()=>{this.abortController.abort()};shouldRun=async e=>{if(e.askAnswered!==!0&&U_.get(this.answers,e.name)!==void 0)return!1;let{when:r}=e;return typeof r=="function"?!!await(0,bp.default)(r)(this.answers):r!==!1}};var $_={input:Yf,select:Ca,list:Ca,number:Jf,confirm:Hf,rawlist:Zf,expand:Qf,checkbox:Al,password:ed,editor:zf,search:rd};function V_(t){function e(r,n){let i=new Xn(e.prompts,t),o=i.run(r,n);return Object.assign(o,{ui:i})}return e.prompts={...$_},e.registerPrompt=function(r,n){return e.prompts[r]=n,this},e.restoreDefaultPrompts=function(){e.prompts={...$_}},e}var _p=V_();function Qk(t,e){_p.registerPrompt(t,e)}function Zk(){_p.restoreDefaultPrompts()}var eL={prompt:_p,ui:{Prompt:Xn},createPromptModule:V_,registerPrompt:Qk,restoreDefaultPrompts:Zk,Separator:U},K_=eL;import rl from"path";import{fileURLToPath as jS}from"url";import{existsSync as Z0,readFileSync as PW,writeFileSync as el,mkdirSync as jW,watch as FS}from"fs";import{join as TS,dirname as qW}from"path";import{homedir as MW}from"os";import{existsSync as Vo,mkdirSync as OS}from"fs";import{dirname as CS,join as gt}from"path";import{writeFileSync as eh,readFileSync as _W,appendFileSync as yW}from"fs";var At=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Ue=globalThis;var Kr="10.32.1";function Qn(){return vo(Ue),Ue}function vo(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Kr,e[Kr]=e[Kr]||{}}function Zn(t,e,r=Ue){let n=r.__SENTRY__=r.__SENTRY__||{},i=n[Kr]=n[Kr]||{};return i[t]||(i[t]=e())}var tL="Sentry Logger ",W_={};function rL(t){if(!("console"in Ue))return t();let e=Ue.console,r={},n=Object.keys(W_);n.forEach(i=>{let o=W_[i];r[i]=e[i],e[i]=o});try{return t()}finally{n.forEach(i=>{e[i]=r[i]})}}function nL(){Dp().enabled=!0}function iL(){Dp().enabled=!1}function z_(){return Dp().enabled}function oL(...t){yp("log",...t)}function aL(...t){yp("warn",...t)}function sL(...t){yp("error",...t)}function yp(t,...e){At&&z_()&&rL(()=>{Ue.console[t](`${tL}[${t}]:`,...e)})}function Dp(){return At?Zn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var ei={enable:nL,disable:iL,isEnabled:z_,log:oL,warn:aL,error:sL};var uL=Object.prototype.toString;function cL(t,e){return uL.call(t)===`[object ${e}]`}function H_(t){return cL(t,"Object")}function Y_(t){return!!(t?.then&&typeof t.then=="function")}function J_(t,e,r){try{Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}catch{At&&ei.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function X_(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function lL(){let t=Ue;return t.crypto||t.msCrypto}var Sp;function fL(){return Math.random()*16}function fr(t=lL()){try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"")}catch{}return Sp||(Sp="10000000100040008000"+1e11),Sp.replace(/[018]/g,e=>(e^(fL()&15)>>e/4).toString(16))}var Z_=1e3;function Ep(){return Date.now()/Z_}function dL(){let{performance:t}=Ue;if(!t?.now||!t.timeOrigin)return Ep;let e=t.timeOrigin;return()=>(e+t.now())/Z_}var Q_;function e1(){return(Q_??(Q_=dL()))()}function t1(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||e1(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:fr()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function wp(t,e,r=2){if(!e||typeof e!="object"||r<=0)return e;if(t&&Object.keys(e).length===0)return t;let n={...t};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=wp(n[i],e[i],r-1));return n}function Op(){return fr()}var Cp="_sentrySpan";function Ap(t,e){e?J_(t,Cp,e):delete t[Cp]}function Fp(t){return t[Cp]}var pL=100,We=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Op(),sampleRand:Math.random()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Ap(e,Fp(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&t1(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,r){return this.setTags({[e]:r})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,r){return this.setAttributes({[e]:r})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,r){return this._extra={...this._extra,[e]:r},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let r=typeof e=="function"?e(this):e,n=r instanceof t?r.getScopeData():H_(r)?e:void 0,{tags:i,attributes:o,extra:a,user:s,contexts:u,level:c,fingerprint:l=[],propagationContext:p}=n||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...o},this._extra={...this._extra,...a},this._contexts={...this._contexts,...u},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),l.length&&(this._fingerprint=l),p&&(this._propagationContext=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,Ap(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Op(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,r){let n=typeof r=="number"?r:pL;if(n<=0)return this;let i={timestamp:Ep(),...e,message:e.message?X_(e.message,2048):e.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Fp(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=wp(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,r){let n=r?.event_id||fr();if(!this._client)return At&&ei.warn("No client configured on scope - will not capture exception!"),n;let i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureMessage(e,r,n){let i=n?.event_id||fr();if(!this._client)return At&&ei.warn("No client configured on scope - will not capture message!"),i;let o=n?.syntheticException??new Error(e);return this._client.captureMessage(e,r,{originalException:e,syntheticException:o,...n,event_id:i},this),i}captureEvent(e,r){let n=r?.event_id||fr();return this._client?(this._client.captureEvent(e,{...r,event_id:n},this),n):(At&&ei.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function r1(){return Zn("defaultCurrentScope",()=>new We)}function n1(){return Zn("defaultIsolationScope",()=>new We)}var Tp=class{constructor(e,r){let n;e?n=e:n=new We;let i;r?i=r:i=new We,this._stack=[{scope:n}],this._isolationScope=i}withScope(e){let r=this._pushScope(),n;try{n=e(r)}catch(i){throw this._popScope(),i}return Y_(n)?n.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function ti(){let t=Qn(),e=vo(t);return e.stack=e.stack||new Tp(r1(),n1())}function xL(t){return ti().withScope(t)}function hL(t,e){let r=ti();return r.withScope(()=>(r.getStackTop().scope=t,e(t)))}function i1(t){return ti().withScope(()=>t(ti().getIsolationScope()))}function o1(){return{withIsolationScope:i1,withScope:xL,withSetScope:hL,withSetIsolationScope:(t,e)=>i1(e),getCurrentScope:()=>ti().getScope(),getIsolationScope:()=>ti().getIsolationScope()}}function Ip(t){let e=vo(t);return e.acs?e.acs:o1()}function Pp(){let t=Qn();return Ip(t).getCurrentScope()}function Lc(){let t=Qn();return Ip(t).getIsolationScope()}function a1(t){if(t)return mL(t)?{captureContext:t}:gL(t)?{captureContext:t}:t}function mL(t){return t instanceof We||typeof t=="function"}var vL=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function gL(t){return Object.keys(t).some(e=>vL.includes(e))}function Rc(t,e){return Pp().captureException(t,a1(e))}function Bc(t){Lc().setExtras(t)}function Nc(t){Lc().setUser(t)}import{existsSync as Jx,readFileSync as Xx,writeFileSync as pW}from"fs";import{resolve as b0e,join as DS}from"path";var BL=typeof global=="object"&&global&&global.Object===Object&&global,Uc=BL;var NL=typeof self=="object"&&self&&self.Object===Object&&self,UL=Uc||NL||Function("return this")(),ce=UL;var GL=ce.Symbol,Ft=GL;var s1=Object.prototype,$L=s1.hasOwnProperty,VL=s1.toString,go=Ft?Ft.toStringTag:void 0;function KL(t){var e=$L.call(t,go),r=t[go];try{t[go]=void 0;var n=!0}catch{}var i=VL.call(t);return n&&(e?t[go]=r:delete t[go]),i}var u1=KL;var WL=Object.prototype,zL=WL.toString;function HL(t){return zL.call(t)}var c1=HL;var YL="[object Null]",JL="[object Undefined]",l1=Ft?Ft.toStringTag:void 0;function XL(t){return t==null?t===void 0?JL:YL:l1&&l1 in Object(t)?u1(t):c1(t)}var Tt=XL;function QL(t){return t!=null&&typeof t=="object"}var xt=QL;var ZL=Array.isArray,ri=ZL;function eR(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ht=eR;var tR="[object AsyncFunction]",rR="[object Function]",nR="[object GeneratorFunction]",iR="[object Proxy]";function oR(t){if(!ht(t))return!1;var e=Tt(t);return e==rR||e==nR||e==tR||e==iR}var Gc=oR;var aR=ce["__core-js_shared__"],$c=aR;var f1=(function(){var t=/[^.]+$/.exec($c&&$c.keys&&$c.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function sR(t){return!!f1&&f1 in t}var d1=sR;var uR=Function.prototype,cR=uR.toString;function lR(t){if(t!=null){try{return cR.call(t)}catch{}try{return t+""}catch{}}return""}var It=lR;var fR=/[\\^$.*+?()[\]{}|]/g,dR=/^\[object .+?Constructor\]$/,pR=Function.prototype,xR=Object.prototype,hR=pR.toString,mR=xR.hasOwnProperty,vR=RegExp("^"+hR.call(mR).replace(fR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gR(t){if(!ht(t)||d1(t))return!1;var e=Gc(t)?vR:dR;return e.test(It(t))}var p1=gR;function bR(t,e){return t?.[e]}var x1=bR;function _R(t,e){var r=x1(t,e);return p1(r)?r:void 0}var Ae=_R;var yR=Ae(ce,"WeakMap"),Vc=yR;var h1=Object.create,DR=(function(){function t(){}return function(e){if(!ht(e))return{};if(h1)return h1(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),m1=DR;function SR(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var v1=SR;var ER=(function(){try{var t=Ae(Object,"defineProperty");return t({},"",{}),t}catch{}})(),jp=ER;function wR(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var g1=wR;var OR=9007199254740991,CR=/^(?:0|[1-9]\d*)$/;function AR(t,e){var r=typeof t;return e=e??OR,!!e&&(r=="number"||r!="symbol"&&CR.test(t))&&t>-1&&t%1==0&&t<e}var b1=AR;function FR(t,e,r){e=="__proto__"&&jp?jp(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Kc=FR;function TR(t,e){return t===e||t!==t&&e!==e}var Wc=TR;var IR=Object.prototype,PR=IR.hasOwnProperty;function jR(t,e,r){var n=t[e];(!(PR.call(t,e)&&Wc(n,r))||r===void 0&&!(e in t))&&Kc(t,e,r)}var zc=jR;function qR(t,e,r,n){var i=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var s=e[o],u=n?n(r[s],t[s],s,r,t):void 0;u===void 0&&(u=t[s]),i?Kc(r,s,u):zc(r,s,u)}return r}var dr=qR;var MR=9007199254740991;function kR(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MR}var Hc=kR;function LR(t){return t!=null&&Hc(t.length)&&!Gc(t)}var Yc=LR;var RR=Object.prototype;function BR(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||RR;return t===r}var ni=BR;function NR(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var _1=NR;var UR="[object Arguments]";function GR(t){return xt(t)&&Tt(t)==UR}var qp=GR;var y1=Object.prototype,$R=y1.hasOwnProperty,VR=y1.propertyIsEnumerable,KR=qp((function(){return arguments})())?qp:function(t){return xt(t)&&$R.call(t,"callee")&&!VR.call(t,"callee")},D1=KR;function WR(){return!1}var S1=WR;var O1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,E1=O1&&typeof module=="object"&&module&&!module.nodeType&&module,zR=E1&&E1.exports===O1,w1=zR?ce.Buffer:void 0,HR=w1?w1.isBuffer:void 0,YR=HR||S1,Jc=YR;var JR="[object Arguments]",XR="[object Array]",QR="[object Boolean]",ZR="[object Date]",eB="[object Error]",tB="[object Function]",rB="[object Map]",nB="[object Number]",iB="[object Object]",oB="[object RegExp]",aB="[object Set]",sB="[object String]",uB="[object WeakMap]",cB="[object ArrayBuffer]",lB="[object DataView]",fB="[object Float32Array]",dB="[object Float64Array]",pB="[object Int8Array]",xB="[object Int16Array]",hB="[object Int32Array]",mB="[object Uint8Array]",vB="[object Uint8ClampedArray]",gB="[object Uint16Array]",bB="[object Uint32Array]",Y={};Y[fB]=Y[dB]=Y[pB]=Y[xB]=Y[hB]=Y[mB]=Y[vB]=Y[gB]=Y[bB]=!0;Y[JR]=Y[XR]=Y[cB]=Y[QR]=Y[lB]=Y[ZR]=Y[eB]=Y[tB]=Y[rB]=Y[nB]=Y[iB]=Y[oB]=Y[aB]=Y[sB]=Y[uB]=!1;function _B(t){return xt(t)&&Hc(t.length)&&!!Y[Tt(t)]}var C1=_B;function yB(t){return function(e){return t(e)}}var ii=yB;var A1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bo=A1&&typeof module=="object"&&module&&!module.nodeType&&module,DB=bo&&bo.exports===A1,Mp=DB&&Uc.process,SB=(function(){try{var t=bo&&bo.require&&bo.require("util").types;return t||Mp&&Mp.binding&&Mp.binding("util")}catch{}})(),Pt=SB;var F1=Pt&&Pt.isTypedArray,EB=F1?ii(F1):C1,T1=EB;var wB=Object.prototype,OB=wB.hasOwnProperty;function CB(t,e){var r=ri(t),n=!r&&D1(t),i=!r&&!n&&Jc(t),o=!r&&!n&&!i&&T1(t),a=r||n||i||o,s=a?_1(t.length,String):[],u=s.length;for(var c in t)(e||OB.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||b1(c,u)))&&s.push(c);return s}var Xc=CB;function AB(t,e){return function(r){return t(e(r))}}var Qc=AB;var FB=Qc(Object.keys,Object),I1=FB;var TB=Object.prototype,IB=TB.hasOwnProperty;function PB(t){if(!ni(t))return I1(t);var e=[];for(var r in Object(t))IB.call(t,r)&&r!="constructor"&&e.push(r);return e}var P1=PB;function jB(t){return Yc(t)?Xc(t):P1(t)}var oi=jB;function qB(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var j1=qB;var MB=Object.prototype,kB=MB.hasOwnProperty;function LB(t){if(!ht(t))return j1(t);var e=ni(t),r=[];for(var n in t)n=="constructor"&&(e||!kB.call(t,n))||r.push(n);return r}var q1=LB;function RB(t){return Yc(t)?Xc(t,!0):q1(t)}var ai=RB;var BB=Ae(Object,"create"),jt=BB;function NB(){this.__data__=jt?jt(null):{},this.size=0}var M1=NB;function UB(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var k1=UB;var GB="__lodash_hash_undefined__",$B=Object.prototype,VB=$B.hasOwnProperty;function KB(t){var e=this.__data__;if(jt){var r=e[t];return r===GB?void 0:r}return VB.call(e,t)?e[t]:void 0}var L1=KB;var WB=Object.prototype,zB=WB.hasOwnProperty;function HB(t){var e=this.__data__;return jt?e[t]!==void 0:zB.call(e,t)}var R1=HB;var YB="__lodash_hash_undefined__";function JB(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=jt&&e===void 0?YB:e,this}var B1=JB;function si(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}si.prototype.clear=M1;si.prototype.delete=k1;si.prototype.get=L1;si.prototype.has=R1;si.prototype.set=B1;var kp=si;function XB(){this.__data__=[],this.size=0}var N1=XB;function QB(t,e){for(var r=t.length;r--;)if(Wc(t[r][0],e))return r;return-1}var pr=QB;var ZB=Array.prototype,eN=ZB.splice;function tN(t){var e=this.__data__,r=pr(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():eN.call(e,r,1),--this.size,!0}var U1=tN;function rN(t){var e=this.__data__,r=pr(e,t);return r<0?void 0:e[r][1]}var G1=rN;function nN(t){return pr(this.__data__,t)>-1}var $1=nN;function iN(t,e){var r=this.__data__,n=pr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var V1=iN;function ui(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ui.prototype.clear=N1;ui.prototype.delete=U1;ui.prototype.get=G1;ui.prototype.has=$1;ui.prototype.set=V1;var xr=ui;var oN=Ae(ce,"Map"),hr=oN;function aN(){this.size=0,this.__data__={hash:new kp,map:new(hr||xr),string:new kp}}var K1=aN;function sN(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var W1=sN;function uN(t,e){var r=t.__data__;return W1(e)?r[typeof e=="string"?"string":"hash"]:r.map}var mr=uN;function cN(t){var e=mr(this,t).delete(t);return this.size-=e?1:0,e}var z1=cN;function lN(t){return mr(this,t).get(t)}var H1=lN;function fN(t){return mr(this,t).has(t)}var Y1=fN;function dN(t,e){var r=mr(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var J1=dN;function ci(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ci.prototype.clear=K1;ci.prototype.delete=z1;ci.prototype.get=H1;ci.prototype.has=Y1;ci.prototype.set=J1;var _o=ci;var pN="Expected a function";function Lp(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(pN);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Lp.Cache||_o),r}Lp.Cache=_o;var z=Lp;function xN(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Zc=xN;var hN=Qc(Object.getPrototypeOf,Object),e0=hN;function mN(){this.__data__=new xr,this.size=0}var X1=mN;function vN(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Q1=vN;function gN(t){return this.__data__.get(t)}var Z1=gN;function bN(t){return this.__data__.has(t)}var ey=bN;var _N=200;function yN(t,e){var r=this.__data__;if(r instanceof xr){var n=r.__data__;if(!hr||n.length<_N-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new _o(n)}return r.set(t,e),this.size=r.size,this}var ty=yN;function li(t){var e=this.__data__=new xr(t);this.size=e.size}li.prototype.clear=X1;li.prototype.delete=Q1;li.prototype.get=Z1;li.prototype.has=ey;li.prototype.set=ty;var ry=li;function DN(t,e){return t&&dr(e,oi(e),t)}var ny=DN;function SN(t,e){return t&&dr(e,ai(e),t)}var iy=SN;var uy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oy=uy&&typeof module=="object"&&module&&!module.nodeType&&module,EN=oy&&oy.exports===uy,ay=EN?ce.Buffer:void 0,sy=ay?ay.allocUnsafe:void 0;function wN(t,e){if(e)return t.slice();var r=t.length,n=sy?sy(r):new t.constructor(r);return t.copy(n),n}var cy=wN;function ON(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var a=t[r];e(a,r,t)&&(o[i++]=a)}return o}var ly=ON;function CN(){return[]}var t0=CN;var AN=Object.prototype,FN=AN.propertyIsEnumerable,fy=Object.getOwnPropertySymbols,TN=fy?function(t){return t==null?[]:(t=Object(t),ly(fy(t),function(e){return FN.call(t,e)}))}:t0,fi=TN;function IN(t,e){return dr(t,fi(t),e)}var dy=IN;var PN=Object.getOwnPropertySymbols,jN=PN?function(t){for(var e=[];t;)Zc(e,fi(t)),t=e0(t);return e}:t0,r0=jN;function qN(t,e){return dr(t,r0(t),e)}var py=qN;function MN(t,e,r){var n=e(t);return ri(t)?n:Zc(n,r(t))}var n0=MN;function kN(t){return n0(t,oi,fi)}var xy=kN;function LN(t){return n0(t,ai,r0)}var hy=LN;var RN=Ae(ce,"DataView"),i0=RN;var BN=Ae(ce,"Promise"),o0=BN;var NN=Ae(ce,"Set"),a0=NN;var my="[object Map]",UN="[object Object]",vy="[object Promise]",gy="[object Set]",by="[object WeakMap]",_y="[object DataView]",GN=It(i0),$N=It(hr),VN=It(o0),KN=It(a0),WN=It(Vc),Wr=Tt;(i0&&Wr(new i0(new ArrayBuffer(1)))!=_y||hr&&Wr(new hr)!=my||o0&&Wr(o0.resolve())!=vy||a0&&Wr(new a0)!=gy||Vc&&Wr(new Vc)!=by)&&(Wr=function(t){var e=Tt(t),r=e==UN?t.constructor:void 0,n=r?It(r):"";if(n)switch(n){case GN:return _y;case $N:return my;case VN:return vy;case KN:return gy;case WN:return by}return e});var di=Wr;var zN=Object.prototype,HN=zN.hasOwnProperty;function YN(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&HN.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var yy=YN;var JN=ce.Uint8Array,Rp=JN;function XN(t){var e=new t.constructor(t.byteLength);return new Rp(e).set(new Rp(t)),e}var pi=XN;function QN(t,e){var r=e?pi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Dy=QN;var ZN=/\w*$/;function eU(t){var e=new t.constructor(t.source,ZN.exec(t));return e.lastIndex=t.lastIndex,e}var Sy=eU;var Ey=Ft?Ft.prototype:void 0,wy=Ey?Ey.valueOf:void 0;function tU(t){return wy?Object(wy.call(t)):{}}var Oy=tU;function rU(t,e){var r=e?pi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Cy=rU;var nU="[object Boolean]",iU="[object Date]",oU="[object Map]",aU="[object Number]",sU="[object RegExp]",uU="[object Set]",cU="[object String]",lU="[object Symbol]",fU="[object ArrayBuffer]",dU="[object DataView]",pU="[object Float32Array]",xU="[object Float64Array]",hU="[object Int8Array]",mU="[object Int16Array]",vU="[object Int32Array]",gU="[object Uint8Array]",bU="[object Uint8ClampedArray]",_U="[object Uint16Array]",yU="[object Uint32Array]";function DU(t,e,r){var n=t.constructor;switch(e){case fU:return pi(t);case nU:case iU:return new n(+t);case dU:return Dy(t,r);case pU:case xU:case hU:case mU:case vU:case gU:case bU:case _U:case yU:return Cy(t,r);case oU:return new n;case aU:case cU:return new n(t);case sU:return Sy(t);case uU:return new n;case lU:return Oy(t)}}var Ay=DU;function SU(t){return typeof t.constructor=="function"&&!ni(t)?m1(e0(t)):{}}var Fy=SU;var EU="[object Map]";function wU(t){return xt(t)&&di(t)==EU}var Ty=wU;var Iy=Pt&&Pt.isMap,OU=Iy?ii(Iy):Ty,Py=OU;var CU="[object Set]";function AU(t){return xt(t)&&di(t)==CU}var jy=AU;var qy=Pt&&Pt.isSet,FU=qy?ii(qy):jy,My=FU;var TU=1,IU=2,PU=4,ky="[object Arguments]",jU="[object Array]",qU="[object Boolean]",MU="[object Date]",kU="[object Error]",Ly="[object Function]",LU="[object GeneratorFunction]",RU="[object Map]",BU="[object Number]",Ry="[object Object]",NU="[object RegExp]",UU="[object Set]",GU="[object String]",$U="[object Symbol]",VU="[object WeakMap]",KU="[object ArrayBuffer]",WU="[object DataView]",zU="[object Float32Array]",HU="[object Float64Array]",YU="[object Int8Array]",JU="[object Int16Array]",XU="[object Int32Array]",QU="[object Uint8Array]",ZU="[object Uint8ClampedArray]",eG="[object Uint16Array]",tG="[object Uint32Array]",H={};H[ky]=H[jU]=H[KU]=H[WU]=H[qU]=H[MU]=H[zU]=H[HU]=H[YU]=H[JU]=H[XU]=H[RU]=H[BU]=H[Ry]=H[NU]=H[UU]=H[GU]=H[$U]=H[QU]=H[ZU]=H[eG]=H[tG]=!0;H[kU]=H[Ly]=H[VU]=!1;function s0(t,e,r,n,i,o){var a,s=e&TU,u=e&IU,c=e&PU;if(r&&(a=i?r(t,n,i,o):r(t)),a!==void 0)return a;if(!ht(t))return t;var l=ri(t);if(l){if(a=yy(t),!s)return v1(t,a)}else{var p=di(t),x=p==Ly||p==LU;if(Jc(t))return cy(t,s);if(p==Ry||p==ky||x&&!i){if(a=u||x?{}:Fy(t),!s)return u?py(t,iy(a,t)):dy(t,ny(a,t))}else{if(!H[p])return i?t:{};a=Ay(t,p,s)}}o||(o=new ry);var h=o.get(t);if(h)return h;o.set(t,a),My(t)?t.forEach(function(m){a.add(s0(m,e,r,m,t,o))}):Py(t)&&t.forEach(function(m,v){a.set(v,s0(m,e,r,v,t,o))});var g=c?u?hy:xy:u?ai:oi,b=l?void 0:g(t);return g1(b||t,function(m,v){b&&(v=m,m=t[v]),zc(a,v,s0(m,e,r,v,t,o))}),a}var By=s0;var rG=1,nG=4;function iG(t){return By(t,rG|nG)}var yo=iG;import{execFile as MG}from"child_process";import{cwd as qG}from"process";import*as W from"fs";import{existsSync as wo}from"fs";import{spawn as OG,execSync as s6,execFileSync as o6}from"child_process";import zr,{isAbsolute as CG,resolve as AG,join as So}from"path";import*as u6 from"os";var c6=le(i6(),1);import{promisify as FG}from"util";var TG=FG(c6.default),vr=zr.join(u6.tmpdir(),`${zo}`);W.existsSync(vr)||W.mkdirSync(vr,{recursive:!0});var IG=1800*1e3,a6=143,Eo={STATUS:"-status",STDOUT:"-stdout",STDERR:"-stderr",CWD:"-cwd",PID:"-pid"};function qt(t){return`'${t.replace(/'/g,"'\\''")}'`}function xi(t,e){if(t.startsWith("/")||e==="posix")return t;let r=t.replace(/\\/g,"/").replace(/\\\\/g,"/");if(/^[A-Za-z]:/.exec(r)){let i=r[0].toLowerCase(),o=r.slice(2);return e==="msys"?"/"+i+(o.startsWith("/")?o:`/${o}`):"/mnt/"+i+(o.startsWith("/")?o:`/${o}`)}return r}function PG(t,e){if(!t)return[];if(e!=="win32")return t.split(":").map(o=>o.trim().replace(/^"|"$/g,"")).filter(Boolean);let r=[],n="",i=()=>{let o=n.trim().replace(/^"|"$/g,"");o&&r.push(o),n=""};for(let o=0;o<t.length;o++){let a=t[o];if(a===";"){i();continue}if(a===":"){let s=n.length,u=n[0];if(!(s===1&&/[A-Za-z]/.test(u||""))){i();continue}}n+=a}return i(),r}function jG(){if(!(process.platform==="win32"))return{bin:process.env.SHELL||"/bin/bash",args:["-l"],type:"posix"};if(process.env.SHELL&&/bash\.exe$/i.test(process.env.SHELL)&&wo(process.env.SHELL))return{bin:process.env.SHELL,args:[],type:"msys"};if(process.env[Ho]&&wo(process.env[Ho]))return{bin:process.env[Ho],args:[],type:"msys"};let e=[process.env.ProgramFiles,process.env["ProgramFiles(x86)"],process.env.ProgramW6432].filter(Boolean),r=process.env.LocalAppData,n=[];for(let s of e)n.push(So(s,"Git","bin","bash.exe"),So(s,"Git","usr","bin","bash.exe"));r&&n.push(So(r,"Programs","Git","bin","bash.exe"),So(r,"Programs","Git","usr","bin","bash.exe")),n.push("C:/msys64/usr/bin/bash.exe");for(let s of n)if(wo(s))return{bin:s,args:[],type:"msys"};let i=process.env.PATH||process.env.Path||process.env.path||"",o=PG(i,process.platform);for(let s of o){let u=So(s,"bash.exe");if(wo(u))return{bin:u,args:[],type:"msys"}}try{return s6('wsl.exe -e bash -lc "echo UCLAUCE_OK"',{stdio:"ignore",timeout:1500}),{bin:"wsl.exe",args:["-e","bash","-l"],type:"wsl"}}catch{}let a=["\u65E0\u6CD5\u627E\u5230\u53EF\u7528\u7684bash\u3002\u8BF7\u5B89\u88C5Git for Windows\u6216\u542F\u7528WSL\u3002","\u63A8\u8350\u5B89\u88C5Git: https://git-scm.com/download/win","\u6216\u542F\u7528WSL\u5E76\u5B89\u88C5Ubuntu: https://learn.microsoft.com/windows/wsl/install"].join(`
44
- `);throw new Error(a)}var l0=class t{static runingInstances=new Map;commandQueue=[];isExecuting=!1;shell;isAlive=!0;commandInterrupted=!1;statusFile;stdoutFile;stderrFile;cwdFile;cwd;binShell;shellArgs;shellType;statusFileBashPath;stdoutFileBashPath;stderrFileBashPath;cwdFileBashPath;keepTemp;bashId;pidFile;constructor(e,{keepTemp:r=!1,bashId:n=null}){let{bin:i,args:o,type:a}=jG();this.binShell=i,this.shellArgs=o,this.shellType=a,this.keepTemp=r,this.bashId=n,this.shell=OG(this.binShell,this.shellArgs,{stdio:["pipe","pipe","pipe"],cwd:e,env:{...process.env,GIT_EDITOR:"true"}}),this.cwd=e,this.shell.on("exit",(u,c)=>{if(u&&ie(`Shell exited with code ${u} and signal ${c}`),!this.keepTemp)for(let l of[this.statusFile,this.stdoutFile,this.stderrFile,this.cwdFile,this.pidFile])W.existsSync(l)&&W.unlinkSync(l);this.isAlive=!1}),this.bashId||(this.bashId=Math.floor(Math.random()*65536).toString(16).padStart(4,"0"));let s=this.bashId;this.statusFile=zr.join(vr,s+Eo.STATUS),this.stdoutFile=zr.join(vr,s+Eo.STDOUT),this.stderrFile=zr.join(vr,s+Eo.STDERR),this.cwdFile=zr.join(vr,s+Eo.CWD),this.pidFile=zr.join(vr,s+Eo.PID);for(let u of[this.statusFile,this.stdoutFile,this.stderrFile])W.writeFileSync(u,"");W.writeFileSync(this.pidFile,this.shell.pid+""),W.writeFileSync(this.cwdFile,e),this.statusFileBashPath=xi(this.statusFile,this.shellType),this.stdoutFileBashPath=xi(this.stdoutFile,this.shellType),this.stderrFileBashPath=xi(this.stderrFile,this.shellType),this.cwdFileBashPath=xi(this.cwdFile,this.shellType),this.shellType==="msys"?(this.sendToShell("[ -f ~/.bashrc ] && source ~/.bashrc || true"),this.sendToShell(`pwd -W > ${qt(this.cwdFileBashPath)}`)):this.sendToShell("[ -f ~/.bashrc ] && source ~/.bashrc || true")}static instance=null;static restart(){t.instance&&(t.instance.close(),t.instance=null)}static getInstance(){return(!t.instance||!t.instance.isAlive)&&(t.instance=new t(process.cwd(),{})),t.instance}static createInstance(e){return new t(process.cwd(),{bashId:e,keepTemp:!0})}static stop(e){let r=t.runingInstances.get(e);return r?(r.abortController.abort(),!0):!1}static async runCommandConcurrent(e,r){let n=new t(process.cwd(),{bashId:r,keepTemp:!0}),i={instance:n,abortController:new AbortController};try{return t.runingInstances.set(r,i),await n.exec(e,{abortSignal:i.abortController.signal})}catch{return null}finally{n.closeFast(),t.runingInstances.delete(r)}}static async runCommand(e){let r=t.getInstance();try{return await r.exec(e)}catch{return null}}async killChildren(){let e=this.shell.pid;try{(await TG(e)).forEach(n=>{try{process.kill(Number(n.PID),"SIGTERM")}catch(i){ie(`Failed to kill process ${n.PID}: ${i}`)}})}catch{}finally{this.commandInterrupted=!0}}async processQueue(){if(this.isExecuting||this.commandQueue.length===0)return;this.isExecuting=!0;let{command:e,options:r,resolve:n,reject:i}=this.commandQueue.shift();if(r.abortSignal?.aborted){n({stdout:"",stderr:"Command aborted",code:2,interrupted:!0}),this.isExecuting=!1,this.processQueue();return}let o=()=>this.killChildren();r.abortSignal&&r.abortSignal.addEventListener("abort",o);try{let a=await this.exec_(e,r);n(a)}catch(a){i(a)}finally{this.isExecuting=!1,r.abortSignal&&r.abortSignal.removeEventListener("abort",o),this.processQueue()}}async exec(e,r={}){return new Promise((n,i)=>{if(r.abortSignal?.aborted){n({stdout:"",stderr:"Command aborted before execution",code:2,interrupted:!0});return}let o=()=>{let a=this.commandQueue.findIndex(s=>s.resolve===n);a!==-1&&(this.commandQueue.splice(a,1),n({stdout:"",stderr:"Command aborted while in queue",code:2,interrupted:!0}))};r.abortSignal&&r.abortSignal.addEventListener("abort",o,{once:!0}),this.commandQueue.push({command:e,options:r,resolve:n,reject:i}),this.processQueue()})}async exec_(e,r={}){let{timeout:n,stdin:i}=r,o=qt(e);try{this.shellType==="wsl"?o6("wsl.exe",["-e","bash","-n","-c",e],{stdio:"ignore",timeout:1e3}):this.shellType==="msys"?o6(this.binShell,["-n","-c",e],{stdio:"ignore",timeout:1e3}):s6(`${this.binShell} -n -c ${o}`,{stdio:"ignore",timeout:1e3})}catch(s){let u=s,c=u?.status??u?.code??2,l=u?.stderr?.toString()||u?.message||String(s||"");return Promise.resolve({stdout:"",stderr:l,code:c,interrupted:!1})}let a=n||IG;return this.commandInterrupted=!1,new Promise(s=>{W.writeFileSync(this.stdoutFile,""),W.writeFileSync(this.stderrFile,""),W.writeFileSync(this.statusFile,"");let u=null,c=null;i&&(u=zr.join(vr,`${this.bashId}-stdin-${Date.now()}`),W.writeFileSync(u,i),c=xi(u,this.shellType));let l=[],p=c?qt(c):"/dev/null";l.push(`eval ${o} < ${p} > ${qt(this.stdoutFileBashPath)} 2> ${qt(this.stderrFileBashPath)}`),l.push("EXEC_EXIT_CODE=$?"),this.shellType==="msys"?l.push(`pwd -W > ${qt(this.cwdFileBashPath)}`):l.push(`pwd > ${qt(this.cwdFileBashPath)}`),l.push(`echo $EXEC_EXIT_CODE > ${qt(this.statusFileBashPath)}`),this.sendToShell(l.join(`
44
+ `);throw new Error(a)}var l0=class t{static runingInstances=new Map;commandQueue=[];isExecuting=!1;shell;isAlive=!0;commandInterrupted=!1;statusFile;stdoutFile;stderrFile;cwdFile;cwd;binShell;shellArgs;shellType;statusFileBashPath;stdoutFileBashPath;stderrFileBashPath;cwdFileBashPath;keepTemp;bashId;pidFile;constructor(e,{keepTemp:r=!1,bashId:n=null}){let{bin:i,args:o,type:a}=jG();this.binShell=i,this.shellArgs=o,this.shellType=a,this.keepTemp=r,this.bashId=n,this.shell=OG(this.binShell,this.shellArgs,{stdio:["pipe","pipe","pipe"],cwd:e,env:{...process.env,GIT_EDITOR:"true"}}),this.cwd=e,this.shell.on("exit",(u,c)=>{if(u&&te(`Shell exited with code ${u} and signal ${c}`),!this.keepTemp)for(let l of[this.statusFile,this.stdoutFile,this.stderrFile,this.cwdFile,this.pidFile])W.existsSync(l)&&W.unlinkSync(l);this.isAlive=!1}),this.bashId||(this.bashId=Math.floor(Math.random()*65536).toString(16).padStart(4,"0"));let s=this.bashId;this.statusFile=zr.join(vr,s+Eo.STATUS),this.stdoutFile=zr.join(vr,s+Eo.STDOUT),this.stderrFile=zr.join(vr,s+Eo.STDERR),this.cwdFile=zr.join(vr,s+Eo.CWD),this.pidFile=zr.join(vr,s+Eo.PID);for(let u of[this.statusFile,this.stdoutFile,this.stderrFile])W.writeFileSync(u,"");W.writeFileSync(this.pidFile,this.shell.pid+""),W.writeFileSync(this.cwdFile,e),this.statusFileBashPath=xi(this.statusFile,this.shellType),this.stdoutFileBashPath=xi(this.stdoutFile,this.shellType),this.stderrFileBashPath=xi(this.stderrFile,this.shellType),this.cwdFileBashPath=xi(this.cwdFile,this.shellType),this.shellType==="msys"?(this.sendToShell("[ -f ~/.bashrc ] && source ~/.bashrc || true"),this.sendToShell(`pwd -W > ${qt(this.cwdFileBashPath)}`)):this.sendToShell("[ -f ~/.bashrc ] && source ~/.bashrc || true")}static instance=null;static restart(){t.instance&&(t.instance.close(),t.instance=null)}static getInstance(){return(!t.instance||!t.instance.isAlive)&&(t.instance=new t(process.cwd(),{})),t.instance}static createInstance(e){return new t(process.cwd(),{bashId:e,keepTemp:!0})}static stop(e){let r=t.runingInstances.get(e);return r?(r.abortController.abort(),!0):!1}static async runCommandConcurrent(e,r,n={}){n||(n={});let i=new t(process.cwd(),{bashId:r,keepTemp:!0}),o={instance:i,abortController:new AbortController};try{return t.runingInstances.set(r,o),await i.exec(e,{...n,abortSignal:o.abortController.signal})}catch(a){return te(a),null}finally{i.closeFast(),t.runingInstances.delete(r)}}static async runCommand(e){let r=t.getInstance();try{return await r.exec(e)}catch{return null}}async killChildren(){let e=this.shell.pid;try{(await TG(e)).forEach(n=>{try{process.kill(Number(n.PID),"SIGTERM")}catch(i){te(`Failed to kill process ${n.PID}: ${i}`)}})}catch{}finally{this.commandInterrupted=!0}}async processQueue(){if(this.isExecuting||this.commandQueue.length===0)return;this.isExecuting=!0;let{command:e,options:r,resolve:n,reject:i}=this.commandQueue.shift();if(r.abortSignal?.aborted){n({stdout:"",stderr:"Command aborted",code:2,interrupted:!0}),this.isExecuting=!1,this.processQueue();return}let o=()=>this.killChildren();r.abortSignal&&r.abortSignal.addEventListener("abort",o);try{let a=await this.exec_(e,r);n(a)}catch(a){i(a)}finally{this.isExecuting=!1,r.abortSignal&&r.abortSignal.removeEventListener("abort",o),this.processQueue()}}async exec(e,r={}){return new Promise((n,i)=>{if(r.abortSignal?.aborted){n({stdout:"",stderr:"Command aborted before execution",code:2,interrupted:!0});return}let o=()=>{let a=this.commandQueue.findIndex(s=>s.resolve===n);a!==-1&&(this.commandQueue.splice(a,1),n({stdout:"",stderr:"Command aborted while in queue",code:2,interrupted:!0}))};r.abortSignal&&r.abortSignal.addEventListener("abort",o,{once:!0}),this.commandQueue.push({command:e,options:r,resolve:n,reject:i}),this.processQueue()})}async exec_(e,r={}){let{timeout:n,stdin:i}=r,o=qt(e);try{this.shellType==="wsl"?o6("wsl.exe",["-e","bash","-n","-c",e],{stdio:"ignore",timeout:1e3}):this.shellType==="msys"?o6(this.binShell,["-n","-c",e],{stdio:"ignore",timeout:1e3}):s6(`${this.binShell} -n -c ${o}`,{stdio:"ignore",timeout:1e3})}catch(s){let u=s,c=u?.status??u?.code??2,l=u?.stderr?.toString()||u?.message||String(s||"");return Promise.resolve({stdout:"",stderr:l,code:c,interrupted:!1})}let a=n||IG;return this.commandInterrupted=!1,new Promise(s=>{W.writeFileSync(this.stdoutFile,""),W.writeFileSync(this.stderrFile,""),W.writeFileSync(this.statusFile,"");let u=null,c=null;i&&(u=zr.join(vr,`${this.bashId}-stdin-${Date.now()}`),W.writeFileSync(u,i),c=xi(u,this.shellType));let l=[],p=c?qt(c):"/dev/null";l.push(`eval ${o} < ${p} > ${qt(this.stdoutFileBashPath)} 2> ${qt(this.stderrFileBashPath)}`),l.push("EXEC_EXIT_CODE=$?"),this.shellType==="msys"?l.push(`pwd -W > ${qt(this.cwdFileBashPath)}`):l.push(`pwd > ${qt(this.cwdFileBashPath)}`),l.push(`echo $EXEC_EXIT_CODE > ${qt(this.statusFileBashPath)}`),this.sendToShell(l.join(`
45
45
  `));let x=Date.now(),h=setInterval(()=>{try{let g=0;if(W.existsSync(this.statusFile)&&(g=W.statSync(this.statusFile).size),g>0||Date.now()-x>a||this.commandInterrupted){clearInterval(h);let b=W.existsSync(this.stdoutFile)?W.readFileSync(this.stdoutFile,"utf8"):"",m=W.existsSync(this.stderrFile)?W.readFileSync(this.stderrFile,"utf8"):"",v;if(this.commandInterrupted?(v=a6,m+=(m?`
46
46
  `:"")+"Command execution was interrupted"):g?v=Number(W.readFileSync(this.statusFile,"utf8")):(this.killChildren(),v=a6,m+=(m?`
47
47
  `:"")+"Command execution timed out"),u&&W.existsSync(u))try{W.unlinkSync(u)}catch{}s({stdout:b,stderr:m,code:v,interrupted:this.commandInterrupted})}}catch{}},10)})}sendToShell(e){try{this.shell.stdin.write(e+`
48
- `)}catch(r){let n=r instanceof Error?r.message:String(r||"Unknown error");throw ie(`Error in sendToShell: ${n}`),r}}pwd(){try{let e=W.readFileSync(this.cwdFile,"utf8").trim();e&&(this.cwd=e)}catch(e){ie(`Shell pwd error ${e}`)}return this.cwd}async setCwd(e){let r=CG(e)?e:AG(process.cwd(),e);if(!wo(r))throw new Error(`Path "${r}" does not exist`);let n=xi(r,this.shellType);await this.exec(`cd ${qt(n)}`)}close(){this.shell.stdin.end(),this.shell.kill()}closeFast(){try{this.shell.stdin?.end(),this.shell.stdin?.destroy(),this.shell.stdout?.destroy(),this.shell.stderr?.destroy(),this.shell.kill("SIGTERM"),this.shell.removeAllListeners()}catch(e){ie(`Error in close: ${e}`)}}};var due={originalCwd:qG()};function Hr(){return l0.getInstance().pwd()}var kG=1e3,LG=60;function hi(t,e,r,n=10*LG*kG,i=!0){return new Promise(o=>{try{MG(t,e,{maxBuffer:1e6,signal:r,timeout:n,cwd:Hr()},(a,s,u)=>{if(a)if(i){let c=typeof a.code=="number"?a.code:1;o({stdout:s||"",stderr:u||"",code:c})}else o({stdout:"",stderr:"",code:1});else o({stdout:s,stderr:u,code:0})})}catch(a){console.log(a),ie(a),o({stdout:"",stderr:"",code:1})}})}import{join as f0}from"path";import{homedir as RG}from"os";import{cwd as BG}from"process";import{execFileSync as mi}from"child_process";var Gp=process.env.CLAUDE_CONFIG_DIR??f0(RG(),rt),d0=process.env.CLAUDE_CONFIG_DIR?f0(Gp,"config.json"):f0(Gp,`${zo}.json`),wue=f0(Gp,"memory");var l6=z(async()=>{let{code:t}=await hi("test",["-f","/.dockerenv"]);return t!==0?!1:process.platform==="linux"}),f6=z(async()=>{try{let t=new AbortController,e=setTimeout(()=>t.abort(),1e3);return await fetch("http://1.1.1.1",{method:"HEAD",signal:t.signal}),clearTimeout(e),!0}catch{return!1}}),d6=z(()=>BG()),p6=z(()=>{try{return mi("git",["rev-parse","--git-dir"],{stdio:"ignore"}),!0}catch{return!1}}),x6=z(()=>{try{return mi("git",["rev-parse","--show-toplevel"],{encoding:"utf8"}).trim()}catch{return null}}),h6=z(()=>{try{return mi("git",["rev-parse","--abbrev-ref","HEAD"],{encoding:"utf8"}).trim()}catch{return null}}),m6=z(()=>{let t=process.platform;try{if(t==="win32"){let r=mi("wmic",["os","get","Caption,Version","/format:list"],{encoding:"utf8"}).split(`
48
+ `)}catch(r){let n=r instanceof Error?r.message:String(r||"Unknown error");throw te(`Error in sendToShell: ${n}`),r}}pwd(){try{let e=W.readFileSync(this.cwdFile,"utf8").trim();e&&(this.cwd=e)}catch(e){te(`Shell pwd error ${e}`)}return this.cwd}async setCwd(e){let r=CG(e)?e:AG(process.cwd(),e);if(!wo(r))throw new Error(`Path "${r}" does not exist`);let n=xi(r,this.shellType);await this.exec(`cd ${qt(n)}`)}close(){this.shell.stdin.end(),this.shell.kill()}closeFast(){try{this.shell.stdin?.end(),this.shell.stdin?.destroy(),this.shell.stdout?.destroy(),this.shell.stderr?.destroy(),this.shell.kill("SIGTERM"),this.shell.removeAllListeners()}catch(e){te(`Error in close: ${e}`)}}};var due={originalCwd:qG()};function Hr(){return l0.getInstance().pwd()}var kG=1e3,LG=60;function hi(t,e,r,n=10*LG*kG,i=!0){return new Promise(o=>{try{MG(t,e,{maxBuffer:1e6,signal:r,timeout:n,cwd:Hr()},(a,s,u)=>{if(a)if(i){let c=typeof a.code=="number"?a.code:1;o({stdout:s||"",stderr:u||"",code:c})}else o({stdout:"",stderr:"",code:1});else o({stdout:s,stderr:u,code:0})})}catch(a){console.log(a),te(a),o({stdout:"",stderr:"",code:1})}})}import{join as f0}from"path";import{homedir as RG}from"os";import{cwd as BG}from"process";import{execFileSync as mi}from"child_process";var Gp=process.env.CLAUDE_CONFIG_DIR??f0(RG(),rt),d0=process.env.CLAUDE_CONFIG_DIR?f0(Gp,"config.json"):f0(Gp,`${zo}.json`),wue=f0(Gp,"memory");var l6=z(async()=>{let{code:t}=await hi("test",["-f","/.dockerenv"]);return t!==0?!1:process.platform==="linux"}),f6=z(async()=>{try{let t=new AbortController,e=setTimeout(()=>t.abort(),1e3);return await fetch("http://1.1.1.1",{method:"HEAD",signal:t.signal}),clearTimeout(e),!0}catch{return!1}}),d6=z(()=>BG()),p6=z(()=>{try{return mi("git",["rev-parse","--git-dir"],{stdio:"ignore"}),!0}catch{return!1}}),x6=z(()=>{try{return mi("git",["rev-parse","--show-toplevel"],{encoding:"utf8"}).trim()}catch{return null}}),h6=z(()=>{try{return mi("git",["rev-parse","--abbrev-ref","HEAD"],{encoding:"utf8"}).trim()}catch{return null}}),m6=z(()=>{let t=process.platform;try{if(t==="win32"){let r=mi("wmic",["os","get","Caption,Version","/format:list"],{encoding:"utf8"}).split(`
49
49
  `).filter(o=>o.trim()),n=r.find(o=>o.startsWith("Caption="))?.split("=")[1]?.trim(),i=r.find(o=>o.startsWith("Version="))?.split("=")[1]?.trim();return n&&i?`${n} ${i}`:"Windows"}else return t==="darwin"?`macOS ${mi("sw_vers",["-productVersion"],{encoding:"utf8"}).trim()}`:mi("lsb_release",["-d","-s"],{encoding:"utf8"}).trim()||"Linux"}catch{return t==="win32"?"Windows":t==="darwin"?"macOS":"Linux"}}),v6=z(()=>new Date().toISOString().split("T")[0]),Oue=z(async()=>{let[t,e,r,n,i,o,a,s,u]=await Promise.all([d6(),p6(),x6(),h6(),m6(),v6(),l6(),f6(),ge.isCI]),c=[`Working directory: ${t}`,`Is directory a git repo: ${e?"Yes":"No"}`,`Platform: ${process.platform}`,`OS Version: ${i}`,`Today's date: ${o}`,`Node version: ${ge.nodeVersion}`,`Terminal: ${ge.terminal||"Unknown"}`,`Is Docker: ${a?"Yes":"No"}`,`Has internet access: ${s?"Yes":"No"}`,`Is CI: ${u?"Yes":"No"}`];return e&&r&&c.push(`Git repo root: ${r}`),e&&n&&c.push(`Current branch: ${n}`),`<env>
50
50
  ${c.join(`
51
51
  `)}
52
- </env>`}),ge={getIsDocker:l6,hasInternetAccess:f6,getWorkingDirectory:d6,getIsGitRepo:p6,getGitRepoRoot:x6,getCurrentBranch:h6,getOSVersion:m6,getCurrentDate:v6,isCI:!!process.env.CI,platform:process.platform==="win32"?"windows":process.platform==="darwin"?"macos":"linux",nodeVersion:process.version,terminal:process.env.TERM_PROGRAM};import{randomBytes as xW}from"crypto";function g6(t){if(!t)return null;try{return JSON.parse(t)}catch(e){return ie(e),null}}var dW=le(I6(),1);var J0=le(fS(),1);var nW={visibilityState:"visible",documentElement:{lang:"en"},addEventListener:(t,e)=>{}},iW={document:nW,location:{href:"node://localhost",pathname:"/"},addEventListener:(t,e)=>{t==="beforeunload"&&process.on("exit",()=>{typeof e=="function"?e({}):e.handleEvent({})})},focus:()=>{},innerHeight:768,innerWidth:1024},oW={sendBeacon:(t,e)=>!0,userAgent:"Mozilla/5.0 (Node.js) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0",language:"en-US"};typeof window>"u"&&(global.window=iW);typeof navigator>"u"&&(global.navigator=oW);import*as et from"fs";import*as Uo from"path";import{homedir as aW}from"os";import{existsSync as sW,unlinkSync as uW}from"fs";var tn=Uo.join(aW(),rt,"statsig");try{et.mkdirSync(tn,{recursive:!0})}catch(t){ie(`Failed to create statsig storage directory: ${t}`)}var Y0=class{cache=new Map;ready=!1;constructor(){try{et.existsSync(tn)||et.mkdirSync(tn,{recursive:!0});let e=et.readdirSync(tn);for(let r of e){let n=decodeURIComponent(r),i=et.readFileSync(Uo.join(tn,r),"utf8");this.cache.set(n,i)}this.ready=!0}catch(e){ie(`Failed to initialize statsig storage: ${e}`),this.ready=!0}}isReady(){return this.ready}isReadyResolver(){return this.ready?Promise.resolve():null}getProviderName(){return"FileSystemStorageProvider"}getItem(e){return this.cache.get(e)??null}setItem(e,r){this.cache.set(e,r);try{let n=encodeURIComponent(e);et.writeFileSync(Uo.join(tn,n),r,"utf8")}catch(n){ie(`Failed to write statsig storage item: ${n}`)}}removeItem(e){this.cache.delete(e);let r=encodeURIComponent(e),n=Uo.join(tn,r);if(sW(n))try{uW(n)}catch(i){ie(`Failed to remove statsig storage item: ${i}`)}}getAllKeys(){return Array.from(this.cache.keys())}};var dS="client-RRNS7R65EAtReO5XA4xDC3eU6ZdJQi6lLEP6b5j32Me";var pS="tengu-token-efficient-tools",xS="token-efficient-tools-2024-12-11";var hS="claude-code-20250219";var cW=z(async()=>{let t=[hS];return(process.env.USER_TYPE==="ant"||process.env.SWE_BENCH)&&await zx(pS)&&t.push(xS),t});var Hx=z(async()=>{let{code:t}=await hi("git",["rev-parse","--is-inside-work-tree"]);return t===0});var vS=!!process.env.CLAUDE_CODE_USE_BEDROCK,gS=!!process.env.CLAUDE_CODE_USE_VERTEX,mS={bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",firstParty:"claude-3-7-sonnet-20250219"},Jce=process.env.ANTHROPIC_SMALL_FAST_MODEL?process.env.ANTHROPIC_SMALL_FAST_MODEL:vS?"us.anthropic.claude-3-5-haiku-20241022-v1:0":gS?"claude-3-5-haiku@20241022":"claude-3-5-haiku-20241022";async function lW(){try{return await bS("tengu-capable-model-config",mS)}catch(t){return ie(t),mS}}var fW=z(async()=>{if(process.env.ANTHROPIC_MODEL||process.env.USER_TYPE==="SWE_BENCH"&&process.env.ANTHROPIC_MODEL)return process.env.ANTHROPIC_MODEL;let t=await lW();return vS?t.bedrock:gS?t.vertex:t.firstParty});var _S={},Go=null,Yx=z(async()=>{if(ge.isCI)return null;let t=await X0(),e={networkConfig:{api:"https://statsig.anthropic.com/v1/"},environment:{tier:ge.isCI||["test","development"].includes("production")?"dev":"production"},logLevel:J0.LogLevel.None,storageProvider:new Y0};return Go=new J0.StatsigClient(dS,t,e),Go.on("error",r=>{ie(`Statsig error: ${r}`)}),await Go.initializeAsync(),process.on("exit",()=>{Go?.flush()}),Go});var zx=z(async t=>{if(ge.isCI)return!1;let e=await Yx();if(!e)return!1;let r=e.checkGate(t);return _S[t]=r,r});function yS(){return{..._S}}var f0e=z(async(t,e)=>{if(ge.isCI)return e;let r=await Yx();if(!r)return e;let n=r.getExperiment(t);return Object.keys(n.value).length===0?(ie(`getExperimentValue got empty value for ${t}`),e):n.value}),bS=async(t,e)=>{if(ge.isCI)return e;let r=await Yx();if(!r)return e;let n=r.getDynamicConfig(t);return Object.keys(n.value).length===0?(ie(`getDynamicConfig got empty value for ${t}`),e):n.value};var $o=class extends Error{filePath;defaultConfig;constructor(e,r,n){super(e),this.name="ConfigParseError",this.filePath=r,this.defaultConfig=n}};var hW={allowedTools:[],context:{},history:[],dontCrawlDirectory:!1,enableArchitectTool:!1,mcpContextUris:[],mcpServers:{},approvedMcprcServers:[],rejectedMcprcServers:[],hasTrustDialogAccepted:!1};var Q0={mcpServers:{},numStartups:0,autoUpdaterStatus:"disabled",theme:"dark",preferredNotifChannel:"iterm2",verbose:!1,customApiKeyResponses:{approved:[],rejected:[]}};var A0e={...Q0,autoUpdaterStatus:"disabled"},F0e={...hW};function mW(t){vW(d0,{...t,projects:SS(d0,Q0).projects},Q0)}function Qx(){return SS(d0,Q0)}function vW(t,e,r){let n=Object.fromEntries(Object.entries(e).filter(([i,o])=>JSON.stringify(o)!==JSON.stringify(r[i])||i=="mcpServers"));pW(t,JSON.stringify(n,null,2),"utf-8")}var gW=!1;function SS(t,e,r){if(!gW)throw new Error("Config accessed before allowed.");if(!Jx(t))return yo(e);try{let n=Xx(t,"utf-8");try{let i=JSON.parse(n);return{...yo(e),...i}}catch(i){let o=i instanceof Error?i.message:String(i);throw new $o(o,t,e)}}catch(n){if(n instanceof $o&&r)throw n;return yo(e)}}var T0e=z(()=>{let t=DS(Hr(),".mcp.json");if(!Jx(t))return{};try{let e=Xx(t,"utf-8"),r=g6(e);if(r&&typeof r=="object")return r=r.mcpServers,Object.keys(r).length.toString(),r}catch{}return{}},()=>{let t=Hr(),e=DS(t,".mcp.json");if(Jx(e))try{let r=Xx(e,"utf-8");return`${t}:${r}`}catch{return t}return t});function ES(){let t=Qx();if(t.userID)return t.userID;let e=xW(32).toString("hex");return mW({...t,userID:e}),e}var bW=z(async()=>{let t=await hi("git",["config","user.email"]);if(t.code!==0){ie(`Failed to get git email: ${t.stdout} ${t.stderr}`);return}return t.stdout.trim()||void 0}),X0=z(async()=>{let t=ES(),e=Qx(),r=process.env.USER_TYPE==="ant"?e.oauthAccount?.emailAddress??await bW()??(process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:void 0):void 0;return{customIDs:{sessionId:Li},userID:t,appVersion:MACRO.VERSION,userAgent:ge.platform,email:r,custom:{nodeVersion:ge.nodeVersion,userType:process.env.USER_TYPE,organizationUuid:e.oauthAccount?.organizationUuid,accountUuid:e.oauthAccount?.accountUuid}}});async function wS(t){try{let[e,r]=await Promise.all([Hx(),X0()]);Bc({nodeVersion:ge.nodeVersion,platform:ge.platform,cwd:Hr(),isCI:ge.isCI,isGit:e,isTest:!1,packageVersion:MACRO.VERSION,sessionId:Li,statsigGates:yS(),terminal:ge.terminal,userType:process.env.USER_TYPE}),Nc({id:r.userID,email:r.email}),Rc(t)}catch{}}import{randomUUID as DW}from"crypto";import{homedir as SW}from"os";var Zx=[],EW=100,Li=DW(),Ri=gt(SW(),rt);function Bi(t){return t.replace(/[^a-zA-Z0-9]/g,"-")}var th={apis:()=>gt(Ri,"project",Bi(process.cwd()),"apis"),errors:()=>gt(Ri,"project",Bi(process.cwd()),"errors"),messages:()=>gt(Ri,"project",Bi(process.cwd()),"messages"),mcpLogs:t=>gt(Ri,"project",Bi(process.cwd()),`mcp-logs-${t}`),log:()=>gt(Ri,"project",Bi(process.cwd()),"log"),vcrFixtures:()=>gt(Ri,"project",Bi(process.cwd()),"vcr-fixtures")};function wW(t){return t.toISOString().replace(/[:.]/g,"-")}var rh=wW(new Date);function OW(){return gt(th.errors(),rh+".txt")}function CW(){return gt(th.log(),rh+".log")}function AW(){return gt(th.log(),"error-"+rh+".log")}function AS(t,e,...r){let n=r.map(i=>i instanceof Error?`${i.name}: ${i.message}
53
- ${i.stack.replace(/^/gm," ")}`:i);TW(e,{level:t,message:n.length==1?n[0]:n})}function Ko(...t){AS("info",CW(),...t)}function nh(...t){AS("error",AW(),...t)}function ie(t){try{let e=t instanceof Error?t.stack||t.message:String(t),r={error:e,timestamp:new Date().toISOString()};Zx.length>=EW&&Zx.shift(),Zx.push(r),IW(OW(),{error:e})}catch{}wS(t)}function FW(t){if(!Vo(t))return[];try{return JSON.parse(_W(t,"utf8"))}catch{return[]}}function TW(t,e){let r=CS(t);Vo(r)||OS(r,{recursive:!0});let i=(typeof e=="string"?e:JSON.stringify(e))+`
52
+ </env>`}),ge={getIsDocker:l6,hasInternetAccess:f6,getWorkingDirectory:d6,getIsGitRepo:p6,getGitRepoRoot:x6,getCurrentBranch:h6,getOSVersion:m6,getCurrentDate:v6,isCI:!!process.env.CI,platform:process.platform==="win32"?"windows":process.platform==="darwin"?"macos":"linux",nodeVersion:process.version,terminal:process.env.TERM_PROGRAM};import{randomBytes as xW}from"crypto";function g6(t){if(!t)return null;try{return JSON.parse(t)}catch(e){return te(e),null}}var dW=le(I6(),1);var J0=le(fS(),1);var nW={visibilityState:"visible",documentElement:{lang:"en"},addEventListener:(t,e)=>{}},iW={document:nW,location:{href:"node://localhost",pathname:"/"},addEventListener:(t,e)=>{t==="beforeunload"&&process.on("exit",()=>{typeof e=="function"?e({}):e.handleEvent({})})},focus:()=>{},innerHeight:768,innerWidth:1024},oW={sendBeacon:(t,e)=>!0,userAgent:"Mozilla/5.0 (Node.js) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0",language:"en-US"};typeof window>"u"&&(global.window=iW);typeof navigator>"u"&&(global.navigator=oW);import*as et from"fs";import*as Uo from"path";import{homedir as aW}from"os";import{existsSync as sW,unlinkSync as uW}from"fs";var tn=Uo.join(aW(),rt,"statsig");try{et.mkdirSync(tn,{recursive:!0})}catch(t){te(`Failed to create statsig storage directory: ${t}`)}var Y0=class{cache=new Map;ready=!1;constructor(){try{et.existsSync(tn)||et.mkdirSync(tn,{recursive:!0});let e=et.readdirSync(tn);for(let r of e){let n=decodeURIComponent(r),i=et.readFileSync(Uo.join(tn,r),"utf8");this.cache.set(n,i)}this.ready=!0}catch(e){te(`Failed to initialize statsig storage: ${e}`),this.ready=!0}}isReady(){return this.ready}isReadyResolver(){return this.ready?Promise.resolve():null}getProviderName(){return"FileSystemStorageProvider"}getItem(e){return this.cache.get(e)??null}setItem(e,r){this.cache.set(e,r);try{let n=encodeURIComponent(e);et.writeFileSync(Uo.join(tn,n),r,"utf8")}catch(n){te(`Failed to write statsig storage item: ${n}`)}}removeItem(e){this.cache.delete(e);let r=encodeURIComponent(e),n=Uo.join(tn,r);if(sW(n))try{uW(n)}catch(i){te(`Failed to remove statsig storage item: ${i}`)}}getAllKeys(){return Array.from(this.cache.keys())}};var dS="client-RRNS7R65EAtReO5XA4xDC3eU6ZdJQi6lLEP6b5j32Me";var pS="tengu-token-efficient-tools",xS="token-efficient-tools-2024-12-11";var hS="claude-code-20250219";var cW=z(async()=>{let t=[hS];return(process.env.USER_TYPE==="ant"||process.env.SWE_BENCH)&&await zx(pS)&&t.push(xS),t});var Hx=z(async()=>{let{code:t}=await hi("git",["rev-parse","--is-inside-work-tree"]);return t===0});var vS=!!process.env.CLAUDE_CODE_USE_BEDROCK,gS=!!process.env.CLAUDE_CODE_USE_VERTEX,mS={bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",firstParty:"claude-3-7-sonnet-20250219"},Jce=process.env.ANTHROPIC_SMALL_FAST_MODEL?process.env.ANTHROPIC_SMALL_FAST_MODEL:vS?"us.anthropic.claude-3-5-haiku-20241022-v1:0":gS?"claude-3-5-haiku@20241022":"claude-3-5-haiku-20241022";async function lW(){try{return await bS("tengu-capable-model-config",mS)}catch(t){return te(t),mS}}var fW=z(async()=>{if(process.env.ANTHROPIC_MODEL||process.env.USER_TYPE==="SWE_BENCH"&&process.env.ANTHROPIC_MODEL)return process.env.ANTHROPIC_MODEL;let t=await lW();return vS?t.bedrock:gS?t.vertex:t.firstParty});var _S={},Go=null,Yx=z(async()=>{if(ge.isCI)return null;let t=await X0(),e={networkConfig:{api:"https://statsig.anthropic.com/v1/"},environment:{tier:ge.isCI||["test","development"].includes("production")?"dev":"production"},logLevel:J0.LogLevel.None,storageProvider:new Y0};return Go=new J0.StatsigClient(dS,t,e),Go.on("error",r=>{te(`Statsig error: ${r}`)}),await Go.initializeAsync(),process.on("exit",()=>{Go?.flush()}),Go});var zx=z(async t=>{if(ge.isCI)return!1;let e=await Yx();if(!e)return!1;let r=e.checkGate(t);return _S[t]=r,r});function yS(){return{..._S}}var f0e=z(async(t,e)=>{if(ge.isCI)return e;let r=await Yx();if(!r)return e;let n=r.getExperiment(t);return Object.keys(n.value).length===0?(te(`getExperimentValue got empty value for ${t}`),e):n.value}),bS=async(t,e)=>{if(ge.isCI)return e;let r=await Yx();if(!r)return e;let n=r.getDynamicConfig(t);return Object.keys(n.value).length===0?(te(`getDynamicConfig got empty value for ${t}`),e):n.value};var $o=class extends Error{filePath;defaultConfig;constructor(e,r,n){super(e),this.name="ConfigParseError",this.filePath=r,this.defaultConfig=n}};var hW={allowedTools:[],context:{},history:[],dontCrawlDirectory:!1,enableArchitectTool:!1,mcpContextUris:[],mcpServers:{},approvedMcprcServers:[],rejectedMcprcServers:[],hasTrustDialogAccepted:!1};var Q0={mcpServers:{},numStartups:0,autoUpdaterStatus:"disabled",theme:"dark",preferredNotifChannel:"iterm2",verbose:!1,customApiKeyResponses:{approved:[],rejected:[]}};var A0e={...Q0,autoUpdaterStatus:"disabled"},F0e={...hW};function mW(t){vW(d0,{...t,projects:SS(d0,Q0).projects},Q0)}function Qx(){return SS(d0,Q0)}function vW(t,e,r){let n=Object.fromEntries(Object.entries(e).filter(([i,o])=>JSON.stringify(o)!==JSON.stringify(r[i])||i=="mcpServers"));pW(t,JSON.stringify(n,null,2),"utf-8")}var gW=!1;function SS(t,e,r){if(!gW)throw new Error("Config accessed before allowed.");if(!Jx(t))return yo(e);try{let n=Xx(t,"utf-8");try{let i=JSON.parse(n);return{...yo(e),...i}}catch(i){let o=i instanceof Error?i.message:String(i);throw new $o(o,t,e)}}catch(n){if(n instanceof $o&&r)throw n;return yo(e)}}var T0e=z(()=>{let t=DS(Hr(),".mcp.json");if(!Jx(t))return{};try{let e=Xx(t,"utf-8"),r=g6(e);if(r&&typeof r=="object")return r=r.mcpServers,Object.keys(r).length.toString(),r}catch{}return{}},()=>{let t=Hr(),e=DS(t,".mcp.json");if(Jx(e))try{let r=Xx(e,"utf-8");return`${t}:${r}`}catch{return t}return t});function ES(){let t=Qx();if(t.userID)return t.userID;let e=xW(32).toString("hex");return mW({...t,userID:e}),e}var bW=z(async()=>{let t=await hi("git",["config","user.email"]);if(t.code!==0){te(`Failed to get git email: ${t.stdout} ${t.stderr}`);return}return t.stdout.trim()||void 0}),X0=z(async()=>{let t=ES(),e=Qx(),r=process.env.USER_TYPE==="ant"?e.oauthAccount?.emailAddress??await bW()??(process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:void 0):void 0;return{customIDs:{sessionId:Li},userID:t,appVersion:MACRO.VERSION,userAgent:ge.platform,email:r,custom:{nodeVersion:ge.nodeVersion,userType:process.env.USER_TYPE,organizationUuid:e.oauthAccount?.organizationUuid,accountUuid:e.oauthAccount?.accountUuid}}});async function wS(t){try{let[e,r]=await Promise.all([Hx(),X0()]);Bc({nodeVersion:ge.nodeVersion,platform:ge.platform,cwd:Hr(),isCI:ge.isCI,isGit:e,isTest:!1,packageVersion:MACRO.VERSION,sessionId:Li,statsigGates:yS(),terminal:ge.terminal,userType:process.env.USER_TYPE}),Nc({id:r.userID,email:r.email}),Rc(t)}catch{}}import{randomUUID as DW}from"crypto";import{homedir as SW}from"os";var Zx=[],EW=100,Li=DW(),Ri=gt(SW(),rt);function Bi(t){return t.replace(/[^a-zA-Z0-9]/g,"-")}var th={apis:()=>gt(Ri,"project",Bi(process.cwd()),"apis"),errors:()=>gt(Ri,"project",Bi(process.cwd()),"errors"),messages:()=>gt(Ri,"project",Bi(process.cwd()),"messages"),mcpLogs:t=>gt(Ri,"project",Bi(process.cwd()),`mcp-logs-${t}`),log:()=>gt(Ri,"project",Bi(process.cwd()),"log"),vcrFixtures:()=>gt(Ri,"project",Bi(process.cwd()),"vcr-fixtures")};function wW(t){return t.toISOString().replace(/[:.]/g,"-")}var rh=wW(new Date);function OW(){return gt(th.errors(),rh+".txt")}function CW(){return gt(th.log(),rh+".log")}function AW(){return gt(th.log(),"error-"+rh+".log")}function AS(t,e,...r){let n=r.map(i=>i instanceof Error?`${i.name}: ${i.message}
53
+ ${i.stack.replace(/^/gm," ")}`:i);TW(e,{level:t,message:n.length==1?n[0]:n})}function Ko(...t){AS("info",CW(),...t)}function nh(...t){AS("error",AW(),...t)}function te(t){try{let e=t instanceof Error?t.stack||t.message:String(t),r={error:e,timestamp:new Date().toISOString()};Zx.length>=EW&&Zx.shift(),Zx.push(r),IW(OW(),{error:e})}catch{}wS(t)}function FW(t){if(!Vo(t))return[];try{return JSON.parse(_W(t,"utf8"))}catch{return[]}}function TW(t,e){let r=CS(t);Vo(r)||OS(r,{recursive:!0});let i=(typeof e=="string"?e:JSON.stringify(e))+`
54
54
  `;Vo(t)?yW(t,i,"utf8"):eh(t,i,"utf8")}function IW(t,e){process.env.USER_TYPE;let r=CS(t);Vo(r)||OS(r,{recursive:!0}),Vo(t)||eh(t,"[]","utf8");let n=FW(t),i={...e,cwd:process.cwd(),userType:process.env.USER_TYPE,sessionId:Li,timestamp:new Date().toISOString(),version:MACRO.VERSION};n.push(i),eh(t,JSON.stringify(n,null,2),"utf8")}var tl={env:{},permissions:{allow:[],deny:[]},enableAllProjectMcpServers:!1,enabledMcpjsonServers:[],autoCompactEnabled:!1,language:"auto"},ih=class t{static instance;constructor(){this.initializeConfigDirectories()}initializeConfigDirectories(){let e=this.getUserSettingsPath(),r=this.getProjectSettingsPath();this.ensureDirExists(e),Z0(e)||el(e,JSON.stringify(this.getDefaultSettingsStructure(),null,2),"utf-8"),this.ensureDirExists(r),Z0(r)||el(r,JSON.stringify(this.getDefaultSettingsStructure(),null,2),"utf-8")}getDefaultSettingsStructure(){return{env:{},permissions:{allow:[],deny:[]}}}static getInstance(){return t.instance||(t.instance=new t),t.instance}addProjectAllowedTools(e){let r=this.loadSettingsFromFile(this.getProjectSettingsPath()),n=r.permissions||{allow:[],deny:[]};if(n.allow||(n.allow=[]),n.allow.includes(e))Ko(`\u5DE5\u5177 '${e}' \u5DF2\u5B58\u5728\u4E8E\u9879\u76EE\u5141\u8BB8\u5217\u8868\u4E2D\uFF0C\u65E0\u9700\u91CD\u590D\u6DFB\u52A0`);else{n.allow.push(e),n.allow.sort();let i={...r,permissions:{...n}};this.saveSettingsToFile(this.getProjectSettingsPath(),i,tl),Ko(`\u5DF2\u5C06\u5DE5\u5177 '${e}' \u6DFB\u52A0\u5230\u9879\u76EE\u5141\u8BB8\u5217\u8868`)}}getUserSettingsPath(){return TS(MW(),".hcode","settings.json")}getProjectSettingsPath(){let e=process.cwd();return TS(e,".hcode","settings.json")}ensureDirExists(e){let r=qW(e);Z0(r)||jW(r,{recursive:!0})}loadSettingsFromFile(e){if(!Z0(e))return{};let r="";try{return r=PW(e,"utf-8"),JSON.parse(r)}catch(n){return console.error(`Error reading settings file ${e} => ${r} `,n),{}}}saveSettingsToFile(e,r,n){let i={...r};for(let[o,a]of Object.entries(r))if(o in n)if(typeof a=="object"&&typeof n[o]=="object"){if(JSON.stringify(a)===JSON.stringify(n[o]))delete i[o];else if(o==="permissions"&&a&&typeof a=="object"){let s=n.permissions||{},u=a;Array.isArray(u.allow)&&Array.isArray(s.allow)&&JSON.stringify(u.allow)===JSON.stringify(s.allow)&&delete u.allow,Array.isArray(u.deny)&&Array.isArray(s.deny)&&JSON.stringify(u.deny)===JSON.stringify(s.deny)&&delete u.deny,Object.keys(u).length===0&&delete i[o]}}else a===n[o]&&delete i[o];this.ensureDirExists(e),Object.keys(i).length===0?el(e,"{}","utf-8"):el(e,JSON.stringify(i,null,2),"utf-8")}loadSettings(){let e=this.loadSettingsFromFile(this.getUserSettingsPath()),r=this.loadSettingsFromFile(this.getProjectSettingsPath()),n={...e.env,...r.env},i={...e.permissions};if(e.permissions?.allow&&r.permissions?.allow){let a=[...e.permissions.allow];r.permissions.allow.forEach(s=>{a.includes(s)||a.push(s)}),i.allow=a}else r.permissions?.allow&&(i.allow=[...r.permissions.allow]);if(e.permissions?.deny&&r.permissions?.deny){let a=[...e.permissions.deny];r.permissions.deny.forEach(s=>{a.includes(s)||a.push(s)}),i.deny=a}else r.permissions?.deny&&(i.deny=[...r.permissions.deny]);let o={...tl,...e,...r};return n&&Object.keys(n).length>0&&(o.env=n),i&&(i.allow||i.deny)&&(o.permissions=i),o}saveUserSettings(e){let r=this.getUserSettingsPath();this.saveSettingsToFile(r,e,tl)}saveProjectSettings(e){let r=this.getProjectSettingsPath();this.saveSettingsToFile(r,e,tl)}getSetting(e){return this.loadSettings()[e]}updateSetting(e,r){let i={...this.loadSettings(),[e]:r};this.saveProjectSettings(i)}resetSetting(e){let n={...this.loadSettings()};delete n[e],this.saveProjectSettings(n)}getAllSettings(){return this.loadSettings()}},Wo=ih.getInstance(),IS=Wo.getAllSettings();function oh(){let t=Wo.getUserSettingsPath(),e=Wo.getProjectSettingsPath();FS(t,(r,n)=>{r==="change"&&(IS=null,Ko("\u7528\u6237\u7EA7\u914D\u7F6E\u5DF2\u70ED\u52A0\u8F7D"))}).on("error",r=>{nh("\u7528\u6237\u7EA7\u914D\u7F6E\u76D1\u63A7\u51FA\u9519:",r),setTimeout(()=>oh(),100)}),FS(e,(r,n)=>{r==="change"&&(IS=null,Ko("\u9879\u76EE\u7EA7\u914D\u7F6E\u5DF2\u70ED\u52A0\u8F7D",n))}).on("error",r=>{nh("\u9879\u76EE\u7EA7\u914D\u7F6E\u76D1\u63A7\u51FA\u9519:",r),setTimeout(()=>oh(),100)})}oh();function kW(){ch();let t=lh(),e=[];Object.entries(t).forEach(([r,n],i)=>{n.enable===!0&&e.push({name:`${i}. ${r}`,value:r})}),e.length===0&&(console.error(`\u8BF7\u68C0\u67E5\u914D\u7F6E\u6587\u4EF6 ~/${rt}/config.json\uFF0C\u786E\u4FDD\u81F3\u5C11\u6709\u4E00\u4E2A\u6A21\u578B\u7684 enable \u8BBE\u7F6E\u4E3A true\u3002`),process.exit(1)),(async()=>{let r=await K_.prompt([{type:"list",name:"choice",message:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6A21\u578B\uFF1A",choices:e}]);var n=t[r.choice];let i=n.env,o={};Object.keys(i).forEach(p=>{["BASE_URL","AUTH_TOKEN","MODEL","SMALL_FAST_MODEL"].includes(p)?o[`ANTHROPIC_${p}`]=i[p]:o[p]=i[p]});let a=Wo.getSetting("env")||{};process.platform==="win32"&&!process.env.HCODE_GIT_BASH_PATH&&!o.HCODE_GIT_BASH_PATH&&!a.HCODE_GIT_BASH_PATH&&(console.error("\u5728 Windows \u7CFB\u7EDF\u4E0A\u8FD0\u884C\uFF0C\u8BF7\u786E\u4FDD\u914D\u7F6E\u73AF\u5883\u53D8\u91CF HCODE_GIT_BASH_PATH\uFF0C\u53C2\u8003\u6587\u6863\uFF1Ahttps://www.hawacode.com/docs"),process.exit(1));let s=jS(import.meta.url),u=rl.dirname(s),c=rl.join(u,"cli.js"),l=PS(process.execPath,["--no-deprecation",c,...process.argv.slice(2)],{env:{...process.env,...o,...a},stdio:"inherit",cwd:process.cwd()});l.on("error",p=>{console.error("Failed to start command:",p.message),process.exit(1)}),l.on("close",p=>{process.exit(p||0)})})()}async function LW(){let t=jS(import.meta.url),e=rl.dirname(t),r=rl.join(e,"cli.js"),n=PS(process.execPath,["--no-deprecation",r,...process.argv.slice(2)],{env:process.env,stdio:"inherit",cwd:process.cwd()});n.on("error",i=>{console.error("Failed to start command:",i.message),process.exit(1)}),n.on("close",i=>{process.exit(i||0)})}async function RW(){process.argv.length<=2?kW():await LW()}await RW();
55
55
  /*! Bundled license information:
56
56