@mndw/cli 0.0.0-stage → 0.1.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 (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/meta.json +1821 -0
  4. package/dist/mndw.js +4011 -0
  5. package/host-dev/assets/_virtual_sandbox-manifest-DbTeSIus.js +1 -0
  6. package/host-dev/assets/_virtual_sandbox-plugin-Cg-1CvkF.js +1 -0
  7. package/host-dev/assets/index-Bks-EVsE.js +94 -0
  8. package/host-dev/assets/index-TmL5gfki.css +1 -0
  9. package/host-dev/assets/sandbox-url-0nkeUf58.js +1 -0
  10. package/host-dev/assets/sprite-DIkKar2y.svg +189 -0
  11. package/host-dev/assets/ticker-pool.worker-DJA1ERT2.js +1 -0
  12. package/host-dev/index.html +33 -0
  13. package/host-dev/shared/angular-common@21.2.18.js +30 -0
  14. package/host-dev/shared/angular-compiler@21.2.18.js +84 -0
  15. package/host-dev/shared/angular-core@21.2.18.js +122 -0
  16. package/host-dev/shared/angular-platform-browser@21.2.18.js +34 -0
  17. package/host-dev/shared/d3@7.9.0.js +5 -0
  18. package/host-dev/shared/hash-wasm@4.12.0.js +10 -0
  19. package/host-dev/shared/mndw-ui@0.1.2.js +1656 -0
  20. package/host-dev/shared/rci-tools-core@0.6.0.js +15 -0
  21. package/host-dev/shared/rxjs-operators@7.8.2.js +3 -0
  22. package/host-dev/shared/rxjs@7.8.2.js +3 -0
  23. package/host-dev/shared/vue@3.5.39.js +56 -0
  24. package/host-dev/shared/zone@0.15.1.js +11 -0
  25. package/package.json +77 -3
  26. package/templates/angular/i18n/en.json +13 -0
  27. package/templates/angular/i18n/ru.json +13 -0
  28. package/templates/angular/src/app.component.ts +57 -0
  29. package/templates/angular/src/index.ts +21 -0
  30. package/templates/angular/src/l10n.test.ts +50 -0
  31. package/templates/angular/src/table.test.ts +59 -0
  32. package/templates/angular/tsconfig.json +18 -0
  33. package/templates/backend/main.sh +7 -0
  34. package/templates/go/backend/cmd/__MNDW_NAME__d/main.go +20 -0
  35. package/templates/go/backend/go.mod +6 -0
  36. package/templates/go/backend/integration_test.go +174 -0
  37. package/templates/go/backend/internal/httpapi/server.go +87 -0
  38. package/templates/go/backend/internal/httpapi/server_test.go +63 -0
  39. package/templates/go/gitignore +6 -0
  40. package/templates/go/i18n/en.json +8 -0
  41. package/templates/go/i18n/ru.json +8 -0
  42. package/templates/go/manifest.json +25 -0
  43. package/templates/go/package.json +20 -0
  44. package/templates/go/src/index.css +31 -0
  45. package/templates/go/src/index.test.ts +59 -0
  46. package/templates/go/src/index.ts +92 -0
  47. package/templates/go/src/l10n.test.ts +66 -0
  48. package/templates/go/src/test-helpers.ts +6 -0
  49. package/templates/svelte/i18n/en.json +13 -0
  50. package/templates/svelte/i18n/ru.json +13 -0
  51. package/templates/svelte/src/App.svelte +102 -0
  52. package/templates/svelte/src/TableNameCell.svelte +10 -0
  53. package/templates/svelte/src/index.ts +14 -0
  54. package/templates/svelte/src/l10n.test.ts +45 -0
  55. package/templates/svelte/src/table.test.ts +53 -0
  56. package/templates/svelte/vitest.config.ts +9 -0
  57. package/templates/vanilla/i18n/en.json +7 -0
  58. package/templates/vanilla/i18n/ru.json +7 -0
  59. package/templates/vanilla/src/index.css +31 -0
  60. package/templates/vanilla/src/index.ts +65 -0
  61. package/templates/vanilla/src/l10n.test.ts +44 -0
  62. package/templates/vue/i18n/en.json +13 -0
  63. package/templates/vue/i18n/ru.json +13 -0
  64. package/templates/vue/src/App.vue +80 -0
  65. package/templates/vue/src/TableNameCell.vue +12 -0
  66. package/templates/vue/src/env.d.ts +6 -0
  67. package/templates/vue/src/index.ts +16 -0
  68. package/templates/vue/src/l10n.test.ts +45 -0
  69. package/templates/vue/src/table.test.ts +53 -0
  70. package/templates/vue/vitest.config.ts +6 -0
@@ -0,0 +1,15 @@
1
+ import{timer as $e,BehaviorSubject as fr,defer as N,throwError as J,ReplaySubject as qs,Subject as Z,of as S,Subscription as Xs,filter as Ds,map as gt,take as $s,NEVER as qp,tap as Xp,race as Ks,switchMap as Cs,delayWhen as Kp,repeat as Wp,skipWhile as jp,merge as Gp,catchError as sr,from as Ls,exhaustMap as ar,finalize as Qp,Observable as zp,identity as Yp}from"rxjs";import{take as bt,map as C,distinctUntilChanged as Vp,catchError as tt,filter as Ws,timeout as js,tap as nr,finalize as ir,shareReplay as Gs,switchMap as Jp,exhaustMap as ht}from"rxjs/operators";var la=typeof global=="object"&&global&&global.Object===Object&&global,Gt=la;var ha=typeof self=="object"&&self&&self.Object===Object&&self,ca=Gt||ha||Function("return this")(),I=ca;var ma=I.Symbol,_=ma;var pr=Object.prototype,da=pr.hasOwnProperty,ga=pr.toString,Lt=_?_.toStringTag:void 0;function xa(t){var e=da.call(t,Lt),r=t[Lt];try{t[Lt]=void 0;var o=!0}catch{}var s=ga.call(t);return o&&(e?t[Lt]=r:delete t[Lt]),s}var lr=xa;var ba=Object.prototype,ya=ba.toString;function wa(t){return ya.call(t)}var hr=wa;var Aa="[object Null]",Ta="[object Undefined]",cr=_?_.toStringTag:void 0;function va(t){return t==null?t===void 0?Ta:Aa:cr&&cr in Object(t)?lr(t):hr(t)}var M=va;function Ea(t){return t!=null&&typeof t=="object"}var k=Ea;var Sa="[object Symbol]";function Ia(t){return typeof t=="symbol"||k(t)&&M(t)==Sa}var j=Ia;function Ra(t,e){for(var r=-1,o=t==null?0:t.length,s=Array(o);++r<o;)s[r]=e(t[r],r,t);return s}var B=Ra;var Oa=Array.isArray,b=Oa;var Pa=1/0,mr=_?_.prototype:void 0,dr=mr?mr.toString:void 0;function gr(t){if(typeof t=="string")return t;if(b(t))return B(t,gr)+"";if(j(t))return dr?dr.call(t):"";var e=t+"";return e=="0"&&1/t==-Pa?"-0":e}var xr=gr;function _a(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var v=_a;function Na(t){return t}var U=Na;var Da="[object AsyncFunction]",$a="[object Function]",Ca="[object GeneratorFunction]",La="[object Proxy]";function Ma(t){if(!v(t))return!1;var e=M(t);return e==$a||e==Ca||e==Da||e==La}var Qt=Ma;var ka=I["__core-js_shared__"],zt=ka;var br=(function(){var t=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Ha(t){return!!br&&br in t}var yr=Ha;var Ba=Function.prototype,Ua=Ba.toString;function Fa(t){if(t!=null){try{return Ua.call(t)}catch{}try{return t+""}catch{}}return""}var G=Fa;var qa=/[\\^$.*+?()[\]{}|]/g,Xa=/^\[object .+?Constructor\]$/,Ka=Function.prototype,Wa=Object.prototype,ja=Ka.toString,Ga=Wa.hasOwnProperty,Qa=RegExp("^"+ja.call(Ga).replace(qa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function za(t){if(!v(t)||yr(t))return!1;var e=Qt(t)?Qa:Xa;return e.test(G(t))}var wr=za;function Ya(t,e){return t?.[e]}var Ar=Ya;function Va(t,e){var r=Ar(t,e);return wr(r)?r:void 0}var $=Va;var Ja=$(I,"WeakMap"),Yt=Ja;function Za(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Tr=Za;var tn=800,en=16,rn=Date.now;function on(t){var e=0,r=0;return function(){var o=rn(),s=en-(o-r);if(r=o,s>0){if(++e>=tn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var vr=on;function sn(t){return function(){return t}}var Er=sn;var an=(function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch{}})(),yt=an;var nn=yt?function(t,e){return yt(t,"toString",{configurable:!0,enumerable:!1,value:Er(e),writable:!0})}:U,Sr=nn;var un=vr(Sr),Vt=un;function fn(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Ir=fn;var pn=9007199254740991,ln=/^(?:0|[1-9]\d*)$/;function hn(t,e){var r=typeof t;return e=e??pn,!!e&&(r=="number"||r!="symbol"&&ln.test(t))&&t>-1&&t%1==0&&t<e}var rt=hn;function cn(t,e,r){e=="__proto__"&&yt?yt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Jt=cn;function mn(t,e){return t===e||t!==t&&e!==e}var ot=mn;var dn=Object.prototype,gn=dn.hasOwnProperty;function xn(t,e,r){var o=t[e];(!(gn.call(t,e)&&ot(o,r))||r===void 0&&!(e in t))&&Jt(t,e,r)}var Rr=xn;var Or=Math.max;function bn(t,e,r){return e=Or(e===void 0?t.length-1:e,0),function(){for(var o=arguments,s=-1,a=Or(o.length-e,0),n=Array(a);++s<a;)n[s]=o[e+s];s=-1;for(var i=Array(e+1);++s<e;)i[s]=o[s];return i[e]=r(n),Tr(t,this,i)}}var Zt=bn;function yn(t,e){return Vt(Zt(t,e,U),t+"")}var Pr=yn;var wn=9007199254740991;function An(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=wn}var wt=An;function Tn(t){return t!=null&&wt(t.length)&&!Qt(t)}var F=Tn;function vn(t,e,r){if(!v(r))return!1;var o=typeof e;return(o=="number"?F(r)&&rt(e,r.length):o=="string"&&e in r)?ot(r[e],t):!1}var Mt=vn;var En=Object.prototype;function Sn(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||En;return t===r}var te=Sn;function In(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var _r=In;var Rn="[object Arguments]";function On(t){return k(t)&&M(t)==Rn}var Ce=On;var Nr=Object.prototype,Pn=Nr.hasOwnProperty,_n=Nr.propertyIsEnumerable,Nn=Ce((function(){return arguments})())?Ce:function(t){return k(t)&&Pn.call(t,"callee")&&!_n.call(t,"callee")},At=Nn;function Dn(){return!1}var Dr=Dn;var Lr=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$r=Lr&&typeof module=="object"&&module&&!module.nodeType&&module,$n=$r&&$r.exports===Lr,Cr=$n?I.Buffer:void 0,Cn=Cr?Cr.isBuffer:void 0,Ln=Cn||Dr,kt=Ln;var Mn="[object Arguments]",kn="[object Array]",Hn="[object Boolean]",Bn="[object Date]",Un="[object Error]",Fn="[object Function]",qn="[object Map]",Xn="[object Number]",Kn="[object Object]",Wn="[object RegExp]",jn="[object Set]",Gn="[object String]",Qn="[object WeakMap]",zn="[object ArrayBuffer]",Yn="[object DataView]",Vn="[object Float32Array]",Jn="[object Float64Array]",Zn="[object Int8Array]",ti="[object Int16Array]",ei="[object Int32Array]",ri="[object Uint8Array]",oi="[object Uint8ClampedArray]",si="[object Uint16Array]",ai="[object Uint32Array]",A={};A[Vn]=A[Jn]=A[Zn]=A[ti]=A[ei]=A[ri]=A[oi]=A[si]=A[ai]=!0;A[Mn]=A[kn]=A[zn]=A[Hn]=A[Yn]=A[Bn]=A[Un]=A[Fn]=A[qn]=A[Xn]=A[Kn]=A[Wn]=A[jn]=A[Gn]=A[Qn]=!1;function ni(t){return k(t)&&wt(t.length)&&!!A[M(t)]}var Mr=ni;function ii(t){return function(e){return t(e)}}var ee=ii;var kr=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ht=kr&&typeof module=="object"&&module&&!module.nodeType&&module,ui=Ht&&Ht.exports===kr,Le=ui&&Gt.process,fi=(function(){try{var t=Ht&&Ht.require&&Ht.require("util").types;return t||Le&&Le.binding&&Le.binding("util")}catch{}})(),Me=fi;var Hr=Me&&Me.isTypedArray,pi=Hr?ee(Hr):Mr,re=pi;var li=Object.prototype,hi=li.hasOwnProperty;function ci(t,e){var r=b(t),o=!r&&At(t),s=!r&&!o&&kt(t),a=!r&&!o&&!s&&re(t),n=r||o||s||a,i=n?_r(t.length,String):[],u=i.length;for(var p in t)(e||hi.call(t,p))&&!(n&&(p=="length"||s&&(p=="offset"||p=="parent")||a&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||rt(p,u)))&&i.push(p);return i}var oe=ci;function mi(t,e){return function(r){return t(e(r))}}var se=mi;var di=se(Object.keys,Object),Br=di;var gi=Object.prototype,xi=gi.hasOwnProperty;function bi(t){if(!te(t))return Br(t);var e=[];for(var r in Object(t))xi.call(t,r)&&r!="constructor"&&e.push(r);return e}var Ur=bi;function yi(t){return F(t)?oe(t):Ur(t)}var Q=yi;function wi(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Fr=wi;var Ai=Object.prototype,Ti=Ai.hasOwnProperty;function vi(t){if(!v(t))return Fr(t);var e=te(t),r=[];for(var o in t)o=="constructor"&&(e||!Ti.call(t,o))||r.push(o);return r}var qr=vi;function Ei(t){return F(t)?oe(t,!0):qr(t)}var Xr=Ei;var Si=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ii=/^\w*$/;function Ri(t,e){if(b(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||j(t)?!0:Ii.test(t)||!Si.test(t)||e!=null&&t in Object(e)}var Tt=Ri;var Oi=$(Object,"create"),z=Oi;function Pi(){this.__data__=z?z(null):{},this.size=0}var Kr=Pi;function _i(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Wr=_i;var Ni="__lodash_hash_undefined__",Di=Object.prototype,$i=Di.hasOwnProperty;function Ci(t){var e=this.__data__;if(z){var r=e[t];return r===Ni?void 0:r}return $i.call(e,t)?e[t]:void 0}var jr=Ci;var Li=Object.prototype,Mi=Li.hasOwnProperty;function ki(t){var e=this.__data__;return z?e[t]!==void 0:Mi.call(e,t)}var Gr=ki;var Hi="__lodash_hash_undefined__";function Bi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=z&&e===void 0?Hi:e,this}var Qr=Bi;function vt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}vt.prototype.clear=Kr;vt.prototype.delete=Wr;vt.prototype.get=jr;vt.prototype.has=Gr;vt.prototype.set=Qr;var ke=vt;function Ui(){this.__data__=[],this.size=0}var zr=Ui;function Fi(t,e){for(var r=t.length;r--;)if(ot(t[r][0],e))return r;return-1}var st=Fi;var qi=Array.prototype,Xi=qi.splice;function Ki(t){var e=this.__data__,r=st(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Xi.call(e,r,1),--this.size,!0}var Yr=Ki;function Wi(t){var e=this.__data__,r=st(e,t);return r<0?void 0:e[r][1]}var Vr=Wi;function ji(t){return st(this.__data__,t)>-1}var Jr=ji;function Gi(t,e){var r=this.__data__,o=st(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Zr=Gi;function Et(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}Et.prototype.clear=zr;Et.prototype.delete=Yr;Et.prototype.get=Vr;Et.prototype.has=Jr;Et.prototype.set=Zr;var at=Et;var Qi=$(I,"Map"),nt=Qi;function zi(){this.size=0,this.__data__={hash:new ke,map:new(nt||at),string:new ke}}var to=zi;function Yi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var eo=Yi;function Vi(t,e){var r=t.__data__;return eo(e)?r[typeof e=="string"?"string":"hash"]:r.map}var it=Vi;function Ji(t){var e=it(this,t).delete(t);return this.size-=e?1:0,e}var ro=Ji;function Zi(t){return it(this,t).get(t)}var oo=Zi;function tu(t){return it(this,t).has(t)}var so=tu;function eu(t,e){var r=it(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var ao=eu;function St(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}St.prototype.clear=to;St.prototype.delete=ro;St.prototype.get=oo;St.prototype.has=so;St.prototype.set=ao;var mt=St;var ru="Expected a function";function He(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ru);var r=function(){var o=arguments,s=e?e.apply(this,o):o[0],a=r.cache;if(a.has(s))return a.get(s);var n=t.apply(this,o);return r.cache=a.set(s,n)||a,n};return r.cache=new(He.Cache||mt),r}He.Cache=mt;var no=He;var ou=500;function su(t){var e=no(t,function(o){return r.size===ou&&r.clear(),o}),r=e.cache;return e}var io=su;var au=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nu=/\\(\\)?/g,iu=io(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(au,function(r,o,s,a){e.push(s?a.replace(nu,"$1"):o||r)}),e}),uo=iu;function uu(t){return t==null?"":xr(t)}var fo=uu;function fu(t,e){return b(t)?t:Tt(t,e)?[t]:uo(fo(t))}var ut=fu;var pu=1/0;function lu(t){if(typeof t=="string"||j(t))return t;var e=t+"";return e=="0"&&1/t==-pu?"-0":e}var q=lu;function hu(t,e){e=ut(e,t);for(var r=0,o=e.length;t!=null&&r<o;)t=t[q(e[r++])];return r&&r==o?t:void 0}var ft=hu;function cu(t,e,r){var o=t==null?void 0:ft(t,e);return o===void 0?r:o}var X=cu;function mu(t,e){for(var r=-1,o=e.length,s=t.length;++r<o;)t[s+r]=e[r];return t}var It=mu;var po=_?_.isConcatSpreadable:void 0;function du(t){return b(t)||At(t)||!!(po&&t&&t[po])}var lo=du;function ho(t,e,r,o,s){var a=-1,n=t.length;for(r||(r=lo),s||(s=[]);++a<n;){var i=t[a];e>0&&r(i)?e>1?ho(i,e-1,r,o,s):It(s,i):o||(s[s.length]=i)}return s}var Rt=ho;function gu(t){var e=t==null?0:t.length;return e?Rt(t,1):[]}var co=gu;function xu(t){return Vt(Zt(t,void 0,co),t+"")}var mo=xu;var bu=se(Object.getPrototypeOf,Object),go=bu;function yu(t,e,r,o){var s=-1,a=t==null?0:t.length;for(o&&a&&(r=t[++s]);++s<a;)r=e(r,t[s],s,t);return r}var xo=yu;function wu(){this.__data__=new at,this.size=0}var bo=wu;function Au(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var yo=Au;function Tu(t){return this.__data__.get(t)}var wo=Tu;function vu(t){return this.__data__.has(t)}var Ao=vu;var Eu=200;function Su(t,e){var r=this.__data__;if(r instanceof at){var o=r.__data__;if(!nt||o.length<Eu-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new mt(o)}return r.set(t,e),this.size=r.size,this}var To=Su;function Ot(t){var e=this.__data__=new at(t);this.size=e.size}Ot.prototype.clear=bo;Ot.prototype.delete=yo;Ot.prototype.get=wo;Ot.prototype.has=Ao;Ot.prototype.set=To;var Pt=Ot;function Iu(t,e){for(var r=-1,o=t==null?0:t.length,s=0,a=[];++r<o;){var n=t[r];e(n,r,t)&&(a[s++]=n)}return a}var vo=Iu;function Ru(){return[]}var ae=Ru;var Ou=Object.prototype,Pu=Ou.propertyIsEnumerable,Eo=Object.getOwnPropertySymbols,_u=Eo?function(t){return t==null?[]:(t=Object(t),vo(Eo(t),function(e){return Pu.call(t,e)}))}:ae,ne=_u;var Nu=Object.getOwnPropertySymbols,Du=Nu?function(t){for(var e=[];t;)It(e,ne(t)),t=go(t);return e}:ae,So=Du;function $u(t,e,r){var o=e(t);return b(t)?o:It(o,r(t))}var ie=$u;function Cu(t){return ie(t,Q,ne)}var Be=Cu;function Lu(t){return ie(t,Xr,So)}var Io=Lu;var Mu=$(I,"DataView"),ue=Mu;var ku=$(I,"Promise"),fe=ku;var Hu=$(I,"Set"),pe=Hu;var Ro="[object Map]",Bu="[object Object]",Oo="[object Promise]",Po="[object Set]",_o="[object WeakMap]",No="[object DataView]",Uu=G(ue),Fu=G(nt),qu=G(fe),Xu=G(pe),Ku=G(Yt),dt=M;(ue&&dt(new ue(new ArrayBuffer(1)))!=No||nt&&dt(new nt)!=Ro||fe&&dt(fe.resolve())!=Oo||pe&&dt(new pe)!=Po||Yt&&dt(new Yt)!=_o)&&(dt=function(t){var e=M(t),r=e==Bu?t.constructor:void 0,o=r?G(r):"";if(o)switch(o){case Uu:return No;case Fu:return Ro;case qu:return Oo;case Xu:return Po;case Ku:return _o}return e});var Ue=dt;var Wu=I.Uint8Array,Fe=Wu;var ju="__lodash_hash_undefined__";function Gu(t){return this.__data__.set(t,ju),this}var Do=Gu;function Qu(t){return this.__data__.has(t)}var $o=Qu;function le(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new mt;++e<r;)this.add(t[e])}le.prototype.add=le.prototype.push=Do;le.prototype.has=$o;var Co=le;function zu(t,e){for(var r=-1,o=t==null?0:t.length;++r<o;)if(e(t[r],r,t))return!0;return!1}var he=zu;function Yu(t,e){return t.has(e)}var Lo=Yu;var Vu=1,Ju=2;function Zu(t,e,r,o,s,a){var n=r&Vu,i=t.length,u=e.length;if(i!=u&&!(n&&u>i))return!1;var p=a.get(t),c=a.get(e);if(p&&c)return p==e&&c==t;var l=-1,h=!0,g=r&Ju?new Co:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var m=t[l],x=e[l];if(o)var y=n?o(x,m,l,e,t,a):o(m,x,l,t,e,a);if(y!==void 0){if(y)continue;h=!1;break}if(g){if(!he(e,function(E,w){if(!Lo(g,w)&&(m===E||s(m,E,r,o,a)))return g.push(w)})){h=!1;break}}else if(!(m===x||s(m,x,r,o,a))){h=!1;break}}return a.delete(t),a.delete(e),h}var ce=Zu;function tf(t){var e=-1,r=Array(t.size);return t.forEach(function(o,s){r[++e]=[s,o]}),r}var Mo=tf;function ef(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var ko=ef;var rf=1,of=2,sf="[object Boolean]",af="[object Date]",nf="[object Error]",uf="[object Map]",ff="[object Number]",pf="[object RegExp]",lf="[object Set]",hf="[object String]",cf="[object Symbol]",mf="[object ArrayBuffer]",df="[object DataView]",Ho=_?_.prototype:void 0,qe=Ho?Ho.valueOf:void 0;function gf(t,e,r,o,s,a,n){switch(r){case df:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case mf:return!(t.byteLength!=e.byteLength||!a(new Fe(t),new Fe(e)));case sf:case af:case ff:return ot(+t,+e);case nf:return t.name==e.name&&t.message==e.message;case pf:case hf:return t==e+"";case uf:var i=Mo;case lf:var u=o&rf;if(i||(i=ko),t.size!=e.size&&!u)return!1;var p=n.get(t);if(p)return p==e;o|=of,n.set(t,e);var c=ce(i(t),i(e),o,s,a,n);return n.delete(t),c;case cf:if(qe)return qe.call(t)==qe.call(e)}return!1}var Bo=gf;var xf=1,bf=Object.prototype,yf=bf.hasOwnProperty;function wf(t,e,r,o,s,a){var n=r&xf,i=Be(t),u=i.length,p=Be(e),c=p.length;if(u!=c&&!n)return!1;for(var l=u;l--;){var h=i[l];if(!(n?h in e:yf.call(e,h)))return!1}var g=a.get(t),m=a.get(e);if(g&&m)return g==e&&m==t;var x=!0;a.set(t,e),a.set(e,t);for(var y=n;++l<u;){h=i[l];var E=t[h],w=e[h];if(o)var D=n?o(w,E,h,e,t,a):o(E,w,h,t,e,a);if(!(D===void 0?E===w||s(E,w,r,o,a):D)){x=!1;break}y||(y=h=="constructor")}if(x&&!y){var T=t.constructor,O=e.constructor;T!=O&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof O=="function"&&O instanceof O)&&(x=!1)}return a.delete(t),a.delete(e),x}var Uo=wf;var Af=1,Fo="[object Arguments]",qo="[object Array]",me="[object Object]",Tf=Object.prototype,Xo=Tf.hasOwnProperty;function vf(t,e,r,o,s,a){var n=b(t),i=b(e),u=n?qo:Ue(t),p=i?qo:Ue(e);u=u==Fo?me:u,p=p==Fo?me:p;var c=u==me,l=p==me,h=u==p;if(h&&kt(t)){if(!kt(e))return!1;n=!0,c=!1}if(h&&!c)return a||(a=new Pt),n||re(t)?ce(t,e,r,o,s,a):Bo(t,e,u,r,o,s,a);if(!(r&Af)){var g=c&&Xo.call(t,"__wrapped__"),m=l&&Xo.call(e,"__wrapped__");if(g||m){var x=g?t.value():t,y=m?e.value():e;return a||(a=new Pt),s(x,y,r,o,a)}}return h?(a||(a=new Pt),Uo(t,e,r,o,s,a)):!1}var Ko=vf;function Wo(t,e,r,o,s){return t===e?!0:t==null||e==null||!k(t)&&!k(e)?t!==t&&e!==e:Ko(t,e,r,o,Wo,s)}var de=Wo;var Ef=1,Sf=2;function If(t,e,r,o){var s=r.length,a=s,n=!o;if(t==null)return!a;for(t=Object(t);s--;){var i=r[s];if(n&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++s<a;){i=r[s];var u=i[0],p=t[u],c=i[1];if(n&&i[2]){if(p===void 0&&!(u in t))return!1}else{var l=new Pt;if(o)var h=o(p,c,u,t,e,l);if(!(h===void 0?de(c,p,Ef|Sf,o,l):h))return!1}}return!0}var jo=If;function Rf(t){return t===t&&!v(t)}var ge=Rf;function Of(t){for(var e=Q(t),r=e.length;r--;){var o=e[r],s=t[o];e[r]=[o,s,ge(s)]}return e}var Go=Of;function Pf(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var xe=Pf;function _f(t){var e=Go(t);return e.length==1&&e[0][2]?xe(e[0][0],e[0][1]):function(r){return r===t||jo(r,t,e)}}var Qo=_f;function Nf(t,e){return t!=null&&e in Object(t)}var zo=Nf;function Df(t,e,r){e=ut(e,t);for(var o=-1,s=e.length,a=!1;++o<s;){var n=q(e[o]);if(!(a=t!=null&&r(t,n)))break;t=t[n]}return a||++o!=s?a:(s=t==null?0:t.length,!!s&&wt(s)&&rt(n,s)&&(b(t)||At(t)))}var be=Df;function $f(t,e){return t!=null&&be(t,e,zo)}var ye=$f;var Cf=1,Lf=2;function Mf(t,e){return Tt(t)&&ge(e)?xe(q(t),e):function(r){var o=X(r,t);return o===void 0&&o===e?ye(r,t):de(e,o,Cf|Lf)}}var Yo=Mf;function kf(t){return function(e){return e?.[t]}}var Vo=kf;function Hf(t){return function(e){return ft(e,t)}}var Jo=Hf;function Bf(t){return Tt(t)?Vo(q(t)):Jo(t)}var Zo=Bf;function Uf(t){return typeof t=="function"?t:t==null?U:typeof t=="object"?b(t)?Yo(t[0],t[1]):Qo(t):Zo(t)}var L=Uf;function Ff(t){return function(e,r,o){for(var s=-1,a=Object(e),n=o(e),i=n.length;i--;){var u=n[t?i:++s];if(r(a[u],u,a)===!1)break}return e}}var ts=Ff;var qf=ts(),es=qf;function Xf(t,e){return t&&es(t,e,Q)}var we=Xf;function Kf(t,e){return function(r,o){if(r==null)return r;if(!F(r))return t(r,o);for(var s=r.length,a=e?s:-1,n=Object(r);(e?a--:++a<s)&&o(n[a],a,n)!==!1;);return r}}var rs=Kf;var Wf=rs(we),pt=Wf;function jf(t){return typeof t=="function"?t:U}var os=jf;function Gf(t,e){var r=b(t)?Ir:pt;return r(t,os(e))}var Xe=Gf;function Qf(t,e){var r=-1,o=F(t)?Array(t.length):[];return pt(t,function(s,a,n){o[++r]=e(s,a,n)}),o}var Ae=Qf;function zf(t,e){var r=b(t)?B:Ae;return r(t,L(e,3))}var ss=zf;function Yf(t,e){return Rt(ss(t,e),1)}var Te=Yf;var Vf=Object.prototype,Jf=Vf.hasOwnProperty;function Zf(t,e){return t!=null&&Jf.call(t,e)}var as=Zf;function tp(t,e){return t!=null&&be(t,e,as)}var Ke=tp;function ep(t,e){var r={};return e=L(e,3),we(t,function(o,s,a){Jt(r,s,e(o,s,a))}),r}var We=ep;function rp(t,e,r,o){if(!v(t))return t;e=ut(e,t);for(var s=-1,a=e.length,n=a-1,i=t;i!=null&&++s<a;){var u=q(e[s]),p=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(s!=n){var c=i[u];p=o?o(c,u,i):void 0,p===void 0&&(p=v(c)?c:rt(e[s+1])?[]:{})}Rr(i,u,p),i=i[u]}return t}var ve=rp;function op(t,e,r){for(var o=-1,s=e.length,a={};++o<s;){var n=e[o],i=ft(t,n);r(i,n)&&ve(a,ut(n,t),i)}return a}var Ee=op;function sp(t,e){if(t==null)return{};var r=B(Io(t),function(o){return[o]});return e=L(e),Ee(t,r,function(o,s){return e(o,s[0])})}var je=sp;function ap(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}var ns=ap;function np(t,e){if(t!==e){var r=t!==void 0,o=t===null,s=t===t,a=j(t),n=e!==void 0,i=e===null,u=e===e,p=j(e);if(!i&&!p&&!a&&t>e||a&&n&&u&&!i&&!p||o&&n&&u||!r&&u||!s)return 1;if(!o&&!a&&!p&&t<e||p&&r&&s&&!o&&!a||i&&r&&s||!n&&s||!u)return-1}return 0}var is=np;function ip(t,e,r){for(var o=-1,s=t.criteria,a=e.criteria,n=s.length,i=r.length;++o<n;){var u=is(s[o],a[o]);if(u){if(o>=i)return u;var p=r[o];return u*(p=="desc"?-1:1)}}return t.index-e.index}var us=ip;function up(t,e,r){e.length?e=B(e,function(a){return b(a)?function(n){return ft(n,a.length===1?a[0]:a)}:a}):e=[U];var o=-1;e=B(e,ee(L));var s=Ae(t,function(a,n,i){var u=B(e,function(p){return p(a)});return{criteria:u,index:++o,value:a}});return ns(s,function(a,n){return us(a,n,r)})}var Se=up;function fp(t,e,r,o){return t==null?[]:(b(e)||(e=e==null?[]:[e]),r=o?void 0:r,b(r)||(r=r==null?[]:[r]),Se(t,e,r))}var Ge=fp;function pp(t,e){return Ee(t,e,function(r,o){return ye(t,o)})}var fs=pp;var lp=mo(function(t,e){return t==null?{}:fs(t,e)}),Qe=lp;function hp(t,e,r,o,s){return s(t,function(a,n,i){r=o?(o=!1,a):e(r,a,n,i)}),r}var ps=hp;function cp(t,e,r){var o=b(t)?xo:ps,s=arguments.length<3;return o(t,L(e,4),r,s,pt)}var ze=cp;function mp(t,e,r){return t==null?t:ve(t,e,r)}var Ye=mp;function dp(t,e){var r;return pt(t,function(o,s,a){return r=e(o,s,a),!r}),!!r}var ls=dp;function gp(t,e,r){var o=b(t)?he:ls;return r&&Mt(t,e,r)&&(e=void 0),o(t,L(e,3))}var Ve=gp;var xp=Pr(function(t,e){if(t==null)return[];var r=e.length;return r>1&&Mt(t,e[0],e[1])?e=[]:r>2&&Mt(e[0],e[1],e[2])&&(e=[e[0]]),Se(t,Rt(e,1),[])}),Je=xp;import{md5 as Zp,argon2id as tl,createHMAC as el,createSHA3 as Qs}from"hash-wasm";var Ts="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vs="ARRAYBUFFER not supported by this environment",Es="UINT8ARRAY not supported by this environment";function hs(t,e,r,o){let s,a,n,i=e||[0],u=(r=r||0)>>>3,p=o===-1?3:0;for(s=0;s<t.length;s+=1)n=s+u,a=n>>>2,i.length<=a&&i.push(0),i[a]|=t[s]<<8*(p+o*(n%4));return{value:i,binLen:8*t.length+r}}function Dt(t,e,r){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":return function(o,s,a){return(function(n,i,u,p){let c,l,h,g;if(n.length%2!=0)throw new Error("String of HEX type must be in byte increments");let m=i||[0],x=(u=u||0)>>>3,y=p===-1?3:0;for(c=0;c<n.length;c+=2){if(l=parseInt(n.substr(c,2),16),isNaN(l))throw new Error("String of HEX type contains invalid characters");for(g=(c>>>1)+x,h=g>>>2;m.length<=h;)m.push(0);m[h]|=l<<8*(y+p*(g%4))}return{value:m,binLen:4*n.length+u}})(o,s,a,r)};case"TEXT":return function(o,s,a){return(function(n,i,u,p,c){let l,h,g,m,x,y,E,w,D=0,T=u||[0],O=(p=p||0)>>>3;if(i==="UTF8")for(E=c===-1?3:0,g=0;g<n.length;g+=1)for(l=n.charCodeAt(g),h=[],128>l?h.push(l):2048>l?(h.push(192|l>>>6),h.push(128|63&l)):55296>l||57344<=l?h.push(224|l>>>12,128|l>>>6&63,128|63&l):(g+=1,l=65536+((1023&l)<<10|1023&n.charCodeAt(g)),h.push(240|l>>>18,128|l>>>12&63,128|l>>>6&63,128|63&l)),m=0;m<h.length;m+=1){for(y=D+O,x=y>>>2;T.length<=x;)T.push(0);T[x]|=h[m]<<8*(E+c*(y%4)),D+=1}else for(E=c===-1?2:0,w=i==="UTF16LE"&&c!==1||i!=="UTF16LE"&&c===1,g=0;g<n.length;g+=1){for(l=n.charCodeAt(g),w===!0&&(m=255&l,l=m<<8|l>>>8),y=D+O,x=y>>>2;T.length<=x;)T.push(0);T[x]|=l<<8*(E+c*(y%4)),D+=2}return{value:T,binLen:8*D+p}})(o,e,s,a,r)};case"B64":return function(o,s,a){return(function(n,i,u,p){let c,l,h,g,m,x,y,E=0,w=i||[0],D=(u=u||0)>>>3,T=p===-1?3:0,O=n.indexOf("=");if(n.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(n=n.replace(/=/g,""),O!==-1&&O<n.length)throw new Error("Invalid '=' found in base-64 string");for(l=0;l<n.length;l+=4){for(m=n.substr(l,4),g=0,h=0;h<m.length;h+=1)c=Ts.indexOf(m.charAt(h)),g|=c<<18-6*h;for(h=0;h<m.length-1;h+=1){for(y=E+D,x=y>>>2;w.length<=x;)w.push(0);w[x]|=(g>>>16-8*h&255)<<8*(T+p*(y%4)),E+=1}}return{value:w,binLen:8*E+u}})(o,s,a,r)};case"BYTES":return function(o,s,a){return(function(n,i,u,p){let c,l,h,g,m=i||[0],x=(u=u||0)>>>3,y=p===-1?3:0;for(l=0;l<n.length;l+=1)c=n.charCodeAt(l),g=l+x,h=g>>>2,m.length<=h&&m.push(0),m[h]|=c<<8*(y+p*(g%4));return{value:m,binLen:8*n.length+u}})(o,s,a,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error(vs)}return function(o,s,a){return(function(n,i,u,p){return hs(new Uint8Array(n),i,u,p)})(o,s,a,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error(Es)}return function(o,s,a){return hs(o,s,a,r)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function cs(t,e,r,o){switch(t){case"HEX":return function(s){return(function(a,n,i,u){let p="0123456789abcdef",c,l,h="",g=n/8,m=i===-1?3:0;for(c=0;c<g;c+=1)l=a[c>>>2]>>>8*(m+i*(c%4)),h+=p.charAt(l>>>4&15)+p.charAt(15&l);return u.outputUpper?h.toUpperCase():h})(s,e,r,o)};case"B64":return function(s){return(function(a,n,i,u){let p,c,l,h,g,m="",x=n/8,y=i===-1?3:0;for(p=0;p<x;p+=3)for(h=p+1<x?a[p+1>>>2]:0,g=p+2<x?a[p+2>>>2]:0,l=(a[p>>>2]>>>8*(y+i*(p%4))&255)<<16|(h>>>8*(y+i*((p+1)%4))&255)<<8|g>>>8*(y+i*((p+2)%4))&255,c=0;c<4;c+=1)m+=8*p+6*c<=n?Ts.charAt(l>>>6*(3-c)&63):u.b64Pad;return m})(s,e,r,o)};case"BYTES":return function(s){return(function(a,n,i){let u,p,c="",l=n/8,h=i===-1?3:0;for(u=0;u<l;u+=1)p=a[u>>>2]>>>8*(h+i*(u%4))&255,c+=String.fromCharCode(p);return c})(s,e,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error(vs)}return function(s){return(function(a,n,i){let u,p=n/8,c=new ArrayBuffer(p),l=new Uint8Array(c),h=i===-1?3:0;for(u=0;u<p;u+=1)l[u]=a[u>>>2]>>>8*(h+i*(u%4))&255;return c})(s,e,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error(Es)}return function(s){return(function(a,n,i){let u,p=n/8,c=i===-1?3:0,l=new Uint8Array(p);for(u=0;u<p;u+=1)l[u]=a[u>>>2]>>>8*(c+i*(u%4))&255;return l})(s,e,r)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var Ft=4294967296,d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],V=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],qt="Chosen SHA variant is not supported",Ss="Cannot set numRounds with MAC";function Re(t,e){let r,o,s=t.binLen>>>3,a=e.binLen>>>3,n=s<<3,i=4-s<<3;if(s%4!=0){for(r=0;r<a;r+=4)o=s+r>>>2,t.value[o]|=e.value[r>>>2]<<n,t.value.push(0),t.value[o+1]|=e.value[r>>>2]>>>i;return(t.value.length<<2)-4>=a+s&&t.value.pop(),{value:t.value,binLen:t.binLen+e.binLen}}return{value:t.value.concat(e.value),binLen:t.binLen+e.binLen}}function ms(t){let e={outputUpper:!1,b64Pad:"=",outputLen:-1},r=t||{},o="Output length must be a multiple of 8";if(e.outputUpper=r.outputUpper||!1,r.b64Pad&&(e.b64Pad=r.b64Pad),r.outputLen){if(r.outputLen%8!=0)throw new Error(o);e.outputLen=r.outputLen}else if(r.shakeLen){if(r.shakeLen%8!=0)throw new Error(o);e.outputLen=r.shakeLen}if(typeof e.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof e.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return e}function lt(t,e,r,o){let s=t+" must include a value and format";if(!e){if(!o)throw new Error(s);return o}if(e.value===void 0||!e.format)throw new Error(s);return Dt(e.format,e.encoding||"UTF8",r)(e.value)}var Nt=class{constructor(e,r,o){let s=o||{};if(this.t=r,this.i=s.encoding||"UTF8",this.numRounds=s.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(e){let r,o=0,s=this.m>>>5,a=this.C(e,this.h,this.u),n=a.binLen,i=a.value,u=n>>>5;for(r=0;r<u;r+=s)o+this.m<=n&&(this.U=this.R(i.slice(r,r+s),this.U),o+=this.m);return this.A+=o,this.h=i.slice(o>>>5),this.u=n%this.m,this.l=!0,this}getHash(e,r){let o,s,a=this.K,n=ms(r);if(this.v){if(n.outputLen===-1)throw new Error("Output length must be specified in options");a=n.outputLen}let i=cs(e,a,this.T,n);if(this.H&&this.F)return i(this.F(n));for(s=this.L(this.h.slice(),this.u,this.A,this.B(this.U),a),o=1;o<this.numRounds;o+=1)this.v&&a%32!=0&&(s[s.length-1]&=16777215>>>24-a%32),s=this.L(s,a,0,this.M(this.o),a);return i(s)}setHMACKey(e,r,o){if(!this.k)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");let s=Dt(r,(o||{}).encoding||"UTF8",this.T);this.Y(s(e))}Y(e){let r=this.m>>>3,o=r/4-1,s;if(this.numRounds!==1)throw new Error(Ss);if(this.H)throw new Error("MAC key already set");for(r<e.binLen/8&&(e.value=this.L(e.value,e.binLen,0,this.M(this.o),this.K));e.value.length<=o;)e.value.push(0);for(s=0;s<=o;s+=1)this.S[s]=909522486^e.value[s],this.p[s]=1549556828^e.value[s];this.U=this.R(this.S,this.U),this.A=this.m,this.H=!0}getHMAC(e,r){let o=ms(r);return cs(e,this.K,this.T,o)(this.N())}N(){let e;if(!this.H)throw new Error("Cannot call getHMAC without first setting MAC key");let r=this.L(this.h.slice(),this.u,this.A,this.B(this.U),this.K);return e=this.R(this.p,this.M(this.o)),e=this.L(r,this.K,this.m,e,this.K),e}};function _t(t,e){return t<<e|t>>>32-e}function K(t,e){return t>>>e|t<<32-e}function Is(t,e){return t>>>e}function ds(t,e,r){return t^e^r}function Rs(t,e,r){return t&e^~t&r}function Os(t,e,r){return t&e^t&r^e&r}function bp(t){return K(t,2)^K(t,13)^K(t,22)}function P(t,e){let r=(65535&t)+(65535&e);return(65535&(t>>>16)+(e>>>16)+(r>>>16))<<16|65535&r}function yp(t,e,r,o){let s=(65535&t)+(65535&e)+(65535&r)+(65535&o);return(65535&(t>>>16)+(e>>>16)+(r>>>16)+(o>>>16)+(s>>>16))<<16|65535&s}function Ut(t,e,r,o,s){let a=(65535&t)+(65535&e)+(65535&r)+(65535&o)+(65535&s);return(65535&(t>>>16)+(e>>>16)+(r>>>16)+(o>>>16)+(s>>>16)+(a>>>16))<<16|65535&a}function wp(t){return K(t,17)^K(t,19)^Is(t,10)}function Ap(t){return K(t,7)^K(t,18)^Is(t,3)}function Tp(t){return K(t,6)^K(t,11)^K(t,25)}function vp(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function Ps(t,e){let r,o,s,a,n,i,u,p=[];for(r=e[0],o=e[1],s=e[2],a=e[3],n=e[4],u=0;u<80;u+=1)p[u]=u<16?t[u]:_t(p[u-3]^p[u-8]^p[u-14]^p[u-16],1),i=u<20?Ut(_t(r,5),Rs(o,s,a),n,1518500249,p[u]):u<40?Ut(_t(r,5),ds(o,s,a),n,1859775393,p[u]):u<60?Ut(_t(r,5),Os(o,s,a),n,2400959708,p[u]):Ut(_t(r,5),ds(o,s,a),n,3395469782,p[u]),n=a,a=s,s=_t(o,30),o=r,r=i;return e[0]=P(r,e[0]),e[1]=P(o,e[1]),e[2]=P(s,e[2]),e[3]=P(a,e[3]),e[4]=P(n,e[4]),e}function Ep(t,e,r,o){let s,a=15+(e+65>>>9<<4),n=e+r;for(;t.length<=a;)t.push(0);for(t[e>>>5]|=128<<24-e%32,t[a]=4294967295&n,t[a-1]=n/Ft|0,s=0;s<t.length;s+=16)o=Ps(t.slice(s,s+16),o);return o}var Sp=class extends Nt{constructor(t,e,r){if(t!=="SHA-1")throw new Error(qt);super(t,e,r);let o=r||{};this.k=!0,this.F=this.N,this.T=-1,this.C=Dt(this.t,this.i,this.T),this.R=Ps,this.B=function(s){return s.slice()},this.M=vp,this.L=Ep,this.U=[1732584193,4023233417,2562383102,271733878,3285377520],this.m=512,this.K=160,this.v=!1,o.hmacKey&&this.Y(lt("hmacKey",o.hmacKey,this.T))}};function gs(t){let e;return e=t=="SHA-224"?Y.slice():V.slice(),e}function xs(t,e){let r,o,s,a,n,i,u,p,c,l,h,g=[];for(r=e[0],o=e[1],s=e[2],a=e[3],n=e[4],i=e[5],u=e[6],p=e[7],h=0;h<64;h+=1)g[h]=h<16?t[h]:yp(wp(g[h-2]),g[h-7],Ap(g[h-15]),g[h-16]),c=Ut(p,Tp(n),Rs(n,i,u),d[h],g[h]),l=P(bp(r),Os(r,o,s)),p=u,u=i,i=n,n=P(a,c),a=s,s=o,o=r,r=P(c,l);return e[0]=P(r,e[0]),e[1]=P(o,e[1]),e[2]=P(s,e[2]),e[3]=P(a,e[3]),e[4]=P(n,e[4]),e[5]=P(i,e[5]),e[6]=P(u,e[6]),e[7]=P(p,e[7]),e}var Ip=class extends Nt{constructor(t,e,r){if(t!=="SHA-224"&&t!=="SHA-256")throw new Error(qt);super(t,e,r);let o=r||{};this.F=this.N,this.k=!0,this.T=-1,this.C=Dt(this.t,this.i,this.T),this.R=xs,this.B=function(s){return s.slice()},this.M=gs,this.L=function(s,a,n,i){return(function(u,p,c,l,h){let g,m,x=15+(p+65>>>9<<4),y=p+c;for(;u.length<=x;)u.push(0);for(u[p>>>5]|=128<<24-p%32,u[x]=4294967295&y,u[x-1]=y/Ft|0,g=0;g<u.length;g+=16)l=xs(u.slice(g,g+16),l);return m=h==="SHA-224"?[l[0],l[1],l[2],l[3],l[4],l[5],l[6]]:l,m})(s,a,n,i,t)},this.U=gs(t),this.m=512,this.K=t==="SHA-224"?224:256,this.v=!1,o.hmacKey&&this.Y(lt("hmacKey",o.hmacKey,this.T))}},f=class{constructor(e,r){this.I=e,this.X=r}};function bs(t,e){let r;return e>32?(r=64-e,new f(t.X<<e|t.I>>>r,t.I<<e|t.X>>>r)):e!==0?(r=32-e,new f(t.I<<e|t.X>>>r,t.X<<e|t.I>>>r)):t}function W(t,e){let r;return e<32?(r=32-e,new f(t.I>>>e|t.X<<r,t.X>>>e|t.I<<r)):(r=64-e,new f(t.X>>>e|t.I<<r,t.I>>>e|t.X<<r))}function _s(t,e){return new f(t.I>>>e,t.X>>>e|t.I<<32-e)}function Rp(t,e,r){return new f(t.I&e.I^~t.I&r.I,t.X&e.X^~t.X&r.X)}function Op(t,e,r){return new f(t.I&e.I^t.I&r.I^e.I&r.I,t.X&e.X^t.X&r.X^e.X&r.X)}function Pp(t){let e=W(t,28),r=W(t,34),o=W(t,39);return new f(e.I^r.I^o.I,e.X^r.X^o.X)}function H(t,e){let r,o;r=(65535&t.X)+(65535&e.X),o=(t.X>>>16)+(e.X>>>16)+(r>>>16);let s=(65535&o)<<16|65535&r;return r=(65535&t.I)+(65535&e.I)+(o>>>16),o=(t.I>>>16)+(e.I>>>16)+(r>>>16),new f((65535&o)<<16|65535&r,s)}function _p(t,e,r,o){let s,a;s=(65535&t.X)+(65535&e.X)+(65535&r.X)+(65535&o.X),a=(t.X>>>16)+(e.X>>>16)+(r.X>>>16)+(o.X>>>16)+(s>>>16);let n=(65535&a)<<16|65535&s;return s=(65535&t.I)+(65535&e.I)+(65535&r.I)+(65535&o.I)+(a>>>16),a=(t.I>>>16)+(e.I>>>16)+(r.I>>>16)+(o.I>>>16)+(s>>>16),new f((65535&a)<<16|65535&s,n)}function Np(t,e,r,o,s){let a,n;a=(65535&t.X)+(65535&e.X)+(65535&r.X)+(65535&o.X)+(65535&s.X),n=(t.X>>>16)+(e.X>>>16)+(r.X>>>16)+(o.X>>>16)+(s.X>>>16)+(a>>>16);let i=(65535&n)<<16|65535&a;return a=(65535&t.I)+(65535&e.I)+(65535&r.I)+(65535&o.I)+(65535&s.I)+(n>>>16),n=(t.I>>>16)+(e.I>>>16)+(r.I>>>16)+(o.I>>>16)+(s.I>>>16)+(a>>>16),new f((65535&n)<<16|65535&a,i)}function Bt(t,e){return new f(t.I^e.I,t.X^e.X)}function Dp(t,e,r,o,s){return new f(t.I^e.I^r.I^o.I^s.I,t.X^e.X^r.X^o.X^s.X)}function $p(t){let e=W(t,19),r=W(t,61),o=_s(t,6);return new f(e.I^r.I^o.I,e.X^r.X^o.X)}function Cp(t){let e=W(t,1),r=W(t,8),o=_s(t,7);return new f(e.I^r.I^o.I,e.X^r.X^o.X)}function Lp(t){let e=W(t,14),r=W(t,18),o=W(t,41);return new f(e.I^r.I^o.I,e.X^r.X^o.X)}var Mp=[new f(d[0],3609767458),new f(d[1],602891725),new f(d[2],3964484399),new f(d[3],2173295548),new f(d[4],4081628472),new f(d[5],3053834265),new f(d[6],2937671579),new f(d[7],3664609560),new f(d[8],2734883394),new f(d[9],1164996542),new f(d[10],1323610764),new f(d[11],3590304994),new f(d[12],4068182383),new f(d[13],991336113),new f(d[14],633803317),new f(d[15],3479774868),new f(d[16],2666613458),new f(d[17],944711139),new f(d[18],2341262773),new f(d[19],2007800933),new f(d[20],1495990901),new f(d[21],1856431235),new f(d[22],3175218132),new f(d[23],2198950837),new f(d[24],3999719339),new f(d[25],766784016),new f(d[26],2566594879),new f(d[27],3203337956),new f(d[28],1034457026),new f(d[29],2466948901),new f(d[30],3758326383),new f(d[31],168717936),new f(d[32],1188179964),new f(d[33],1546045734),new f(d[34],1522805485),new f(d[35],2643833823),new f(d[36],2343527390),new f(d[37],1014477480),new f(d[38],1206759142),new f(d[39],344077627),new f(d[40],1290863460),new f(d[41],3158454273),new f(d[42],3505952657),new f(d[43],106217008),new f(d[44],3606008344),new f(d[45],1432725776),new f(d[46],1467031594),new f(d[47],851169720),new f(d[48],3100823752),new f(d[49],1363258195),new f(d[50],3750685593),new f(d[51],3785050280),new f(d[52],3318307427),new f(d[53],3812723403),new f(d[54],2003034995),new f(d[55],3602036899),new f(d[56],1575990012),new f(d[57],1125592928),new f(d[58],2716904306),new f(d[59],442776044),new f(d[60],593698344),new f(d[61],3733110249),new f(d[62],2999351573),new f(d[63],3815920427),new f(3391569614,3928383900),new f(3515267271,566280711),new f(3940187606,3454069534),new f(4118630271,4000239992),new f(116418474,1914138554),new f(174292421,2731055270),new f(289380356,3203993006),new f(460393269,320620315),new f(685471733,587496836),new f(852142971,1086792851),new f(1017036298,365543100),new f(1126000580,2618297676),new f(1288033470,3409855158),new f(1501505948,4234509866),new f(1607167915,987167468),new f(1816402316,1246189591)];function ys(t){return t==="SHA-384"?[new f(3418070365,Y[0]),new f(1654270250,Y[1]),new f(2438529370,Y[2]),new f(355462360,Y[3]),new f(1731405415,Y[4]),new f(41048885895,Y[5]),new f(3675008525,Y[6]),new f(1203062813,Y[7])]:[new f(V[0],4089235720),new f(V[1],2227873595),new f(V[2],4271175723),new f(V[3],1595750129),new f(V[4],2917565137),new f(V[5],725511199),new f(V[6],4215389547),new f(V[7],327033209)]}function ws(t,e){let r,o,s,a,n,i,u,p,c,l,h,g,m=[];for(r=e[0],o=e[1],s=e[2],a=e[3],n=e[4],i=e[5],u=e[6],p=e[7],h=0;h<80;h+=1)h<16?(g=2*h,m[h]=new f(t[g],t[g+1])):m[h]=_p($p(m[h-2]),m[h-7],Cp(m[h-15]),m[h-16]),c=Np(p,Lp(n),Rp(n,i,u),Mp[h],m[h]),l=H(Pp(r),Op(r,o,s)),p=u,u=i,i=n,n=H(a,c),a=s,s=o,o=r,r=H(c,l);return e[0]=H(r,e[0]),e[1]=H(o,e[1]),e[2]=H(s,e[2]),e[3]=H(a,e[3]),e[4]=H(n,e[4]),e[5]=H(i,e[5]),e[6]=H(u,e[6]),e[7]=H(p,e[7]),e}var kp=class extends Nt{constructor(t,e,r){if(t!=="SHA-384"&&t!=="SHA-512")throw new Error(qt);super(t,e,r);let o=r||{};this.F=this.N,this.k=!0,this.T=-1,this.C=Dt(this.t,this.i,this.T),this.R=ws,this.B=function(s){return s.slice()},this.M=ys,this.L=function(s,a,n,i){return(function(u,p,c,l,h){let g,m,x=31+(p+129>>>10<<5),y=p+c;for(;u.length<=x;)u.push(0);for(u[p>>>5]|=128<<24-p%32,u[x]=4294967295&y,u[x-1]=y/Ft|0,g=0;g<u.length;g+=32)l=ws(u.slice(g,g+32),l);return m=h==="SHA-384"?[l[0].I,l[0].X,l[1].I,l[1].X,l[2].I,l[2].X,l[3].I,l[3].X,l[4].I,l[4].X,l[5].I,l[5].X]:[l[0].I,l[0].X,l[1].I,l[1].X,l[2].I,l[2].X,l[3].I,l[3].X,l[4].I,l[4].X,l[5].I,l[5].X,l[6].I,l[6].X,l[7].I,l[7].X],m})(s,a,n,i,t)},this.U=ys(t),this.m=1024,this.K=t==="SHA-384"?384:512,this.v=!1,o.hmacKey&&this.Y(lt("hmacKey",o.hmacKey,this.T))}},Hp=[new f(0,1),new f(0,32898),new f(2147483648,32906),new f(2147483648,2147516416),new f(0,32907),new f(0,2147483649),new f(2147483648,2147516545),new f(2147483648,32777),new f(0,138),new f(0,136),new f(0,2147516425),new f(0,2147483658),new f(0,2147516555),new f(2147483648,139),new f(2147483648,32905),new f(2147483648,32771),new f(2147483648,32770),new f(2147483648,128),new f(0,32778),new f(2147483648,2147483658),new f(2147483648,2147516545),new f(2147483648,32896),new f(0,2147483649),new f(2147483648,2147516424)],Bp=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function tr(t){let e,r=[];for(e=0;e<5;e+=1)r[e]=[new f(0,0),new f(0,0),new f(0,0),new f(0,0),new f(0,0)];return r}function Up(t){let e,r=[];for(e=0;e<5;e+=1)r[e]=t[e].slice();return r}function Ie(t,e){let r,o,s,a,n=[],i=[];if(t!==null)for(o=0;o<t.length;o+=2)e[(o>>>1)%5][(o>>>1)/5|0]=Bt(e[(o>>>1)%5][(o>>>1)/5|0],new f(t[o+1],t[o]));for(r=0;r<24;r+=1){for(a=tr(),o=0;o<5;o+=1)n[o]=Dp(e[o][0],e[o][1],e[o][2],e[o][3],e[o][4]);for(o=0;o<5;o+=1)i[o]=Bt(n[(o+4)%5],bs(n[(o+1)%5],1));for(o=0;o<5;o+=1)for(s=0;s<5;s+=1)e[o][s]=Bt(e[o][s],i[o]);for(o=0;o<5;o+=1)for(s=0;s<5;s+=1)a[s][(2*o+3*s)%5]=bs(e[o][s],Bp[o][s]);for(o=0;o<5;o+=1)for(s=0;s<5;s+=1)e[o][s]=Bt(a[o][s],new f(~a[(o+1)%5][s].I&a[(o+2)%5][s].I,~a[(o+1)%5][s].X&a[(o+2)%5][s].X));e[0][0]=Bt(e[0][0],Hp[r])}return e}function Ns(t){let e,r,o=0,s=[0,0],a=[4294967295&t,t/Ft&2097151];for(e=6;e>=0;e--)r=a[e>>2]>>>8*e&255,r===0&&o===0||(s[o+1>>2]|=r<<8*(o+1),o+=1);return o=o!==0?o:1,s[0]|=o,{value:o+1>4?s:[s[0]],binLen:8+8*o}}function Ze(t){return Re(Ns(t.binLen),t)}function As(t,e){let r,o=Ns(e);o=Re(o,t);let s=e>>>2,a=(s-o.value.length%s)%s;for(r=0;r<a;r++)o.value.push(0);return o.value}var Fp=class extends Nt{constructor(t,e,r){let o=6,s=0;super(t,e,r);let a=r||{};if(this.numRounds!==1){if(a.kmacKey||a.hmacKey)throw new Error(Ss);if(this.o==="CSHAKE128"||this.o==="CSHAKE256")throw new Error("Cannot set numRounds for CSHAKE variants")}switch(this.T=1,this.C=Dt(this.t,this.i,this.T),this.R=Ie,this.B=Up,this.M=tr,this.U=tr(),this.v=!1,t){case"SHA3-224":this.m=s=1152,this.K=224,this.k=!0,this.F=this.N;break;case"SHA3-256":this.m=s=1088,this.K=256,this.k=!0,this.F=this.N;break;case"SHA3-384":this.m=s=832,this.K=384,this.k=!0,this.F=this.N;break;case"SHA3-512":this.m=s=576,this.K=512,this.k=!0,this.F=this.N;break;case"SHAKE128":o=31,this.m=s=1344,this.K=-1,this.v=!0,this.k=!1,this.F=null;break;case"SHAKE256":o=31,this.m=s=1088,this.K=-1,this.v=!0,this.k=!1,this.F=null;break;case"KMAC128":o=4,this.m=s=1344,this._(r),this.K=-1,this.v=!0,this.k=!1,this.F=this.O;break;case"KMAC256":o=4,this.m=s=1088,this._(r),this.K=-1,this.v=!0,this.k=!1,this.F=this.O;break;case"CSHAKE128":this.m=s=1344,o=this.P(r),this.K=-1,this.v=!0,this.k=!1,this.F=null;break;case"CSHAKE256":this.m=s=1088,o=this.P(r),this.K=-1,this.v=!0,this.k=!1,this.F=null;break;default:throw new Error(qt)}this.L=function(n,i,u,p,c){return(function(l,h,g,m,x,y,E){let w,D,T=0,O=[],jt=x>>>5,pa=h>>>5;for(w=0;w<pa&&h>=x;w+=jt)m=Ie(l.slice(w,w+jt),m),h-=x;for(l=l.slice(w),h%=x;l.length<jt;)l.push(0);for(w=h>>>3,l[w>>2]^=y<<w%4*8,l[jt-1]^=2147483648,m=Ie(l,m);32*O.length<E&&(D=m[T%5][T/5|0],O.push(D.X),!(32*O.length>=E));)O.push(D.I),T+=1,64*T%x==0&&(Ie(null,m),T=0);return O})(n,i,0,p,s,o,c)},a.hmacKey&&this.Y(lt("hmacKey",a.hmacKey,this.T))}P(t,e){let r=(function(s){let a=s||{};return{funcName:lt("funcName",a.funcName,1,{value:[],binLen:0}),customization:lt("Customization",a.customization,1,{value:[],binLen:0})}})(t||{});e&&(r.funcName=e);let o=Re(Ze(r.funcName),Ze(r.customization));if(r.customization.binLen!==0||r.funcName.binLen!==0){let s=As(o,this.m>>>3);for(let a=0;a<s.length;a+=this.m>>>5)this.U=this.R(s.slice(a,a+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}_(t){let e=(function(o){let s=o||{};return{kmacKey:lt("kmacKey",s.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:lt("Customization",s.customization,1,{value:[],binLen:0})}})(t||{});this.P(t,e.funcName);let r=As(Ze(e.kmacKey),this.m>>>3);for(let o=0;o<r.length;o+=this.m>>>5)this.U=this.R(r.slice(o,o+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}O(t){let e=Re({value:this.h.slice(),binLen:this.u},(function(r){let o,s,a=0,n=[0,0],i=[4294967295&r,r/Ft&2097151];for(o=6;o>=0;o--)s=i[o>>2]>>>8*o&255,s===0&&a===0||(n[a>>2]|=s<<8*a,a+=1);return a=a!==0?a:1,n[a>>2]|=a<<8*a,{value:a+1>4?n:[n[0]],binLen:8+8*a}})(t.outputLen));return this.L(e.value,e.binLen,this.A,this.B(this.U),t.outputLen)}},Oe=class{constructor(e,r,o){if(e=="SHA-1")this.V=new Sp(e,r,o);else if(e=="SHA-224"||e=="SHA-256")this.V=new Ip(e,r,o);else if(e=="SHA-384"||e=="SHA-512")this.V=new kp(e,r,o);else{if(e!="SHA3-224"&&e!="SHA3-256"&&e!="SHA3-384"&&e!="SHA3-512"&&e!="SHAKE128"&&e!="SHAKE256"&&e!="CSHAKE128"&&e!="CSHAKE256"&&e!="KMAC128"&&e!="KMAC256")throw new Error(qt);this.V=new Fp(e,r,o)}}update(e){return this.V.update(e),this}getHash(e,r){return this.V.getHash(e,r)}setHMACKey(e,r,o){this.V.setHMACKey(e,r,o)}getHMAC(e,r){return this.V.getHMAC(e,r)}};var zs=Symbol.for("@rci-tools/core/RciHttpError"),xt=class extends Error{status;response;constructor(t,e){super(t,{cause:e.cause}),this.name="RciHttpError",this.status=e.status,this.response=e.response??null,Object.defineProperty(this,zs,{value:!0})}},Ys=t=>typeof t=="object"&&t!==null&&t[zs]===!0,Vs=(t,e,r)=>t.post(e,r).pipe(gt(o=>{if(!Array.isArray(o.data))throw new xt("Malformed RCI response: expected an array",{status:o.status,response:o});return o.data})),R={READY:"READY",BATCHING_TASKS:"BATCHING_TASKS",PENDING:"PENDING",AWAITING_RESPONSE:"AWAITING_RESPONSE"},Js=20,Ms=[R.BATCHING_TASKS,R.AWAITING_RESPONSE,R.PENDING],Zs=6e4,rl=3e4,ta="system.configuration.save",ol={saveConfiguration:!1,isPriorityTask:!1},Wt=class Ne{static compactQueries(e,r=0){let o=ze(e,(c,l,h)=>{let g=Qe(l,["path","data"]),m=JSON.stringify(g);return c[m]?c[m].indices.push(h):c[m]={key:m,query:l,indices:[h]},c},{}),s=[],a=[],n;r&2&&(s.push(c=>c.query.path.startsWith(ta)),a.push("asc")),r&1&&(s.push(c=>c.query.path.startsWith("show")),a.push("desc")),s.length>0?n=Ge(o,s,a):n=Object.values(o);let i=n.map(({query:c})=>Ne.toQueryObject(c)),u=Object.fromEntries(n.map(({key:c},l)=>[c,l])),p=We(o,c=>({...c,keyIndex:u[c.key]}));return{queryArray:i,queryMap:p}}static inflateResponse(e,r){let o=Te(r,({keyIndex:s,indices:a})=>{let n=e[s];return a.map(i=>({idx:i,response:n}))});return Je(o,"idx").map(s=>s.response)}static batchTasks(e){let r=Te(e,"queries");return Ne.compactQueries(r,3)}static splitResponsesPerTask(e,r,o){let s=Ne.inflateResponse(e,o),a=[],n=0;for(let{queries:i}of r){let u=n+i.length,p=s.slice(n,u).map((c,l)=>this.prepareResponseData(c,i[l]));a.push(p),n=u}return a}static toQueryObject(e){let{path:r,data:o={}}=e;return Ye({},r,o)}static prepareResponseData(e,r){if(r.extractData===!1)return e;if(e!==void 0)return X(e,r.path)}},ks=2147483647;function $t(t,e,r){if(e===void 0)return r.fallback;let o=r.positive?"> 0":">= 0";if(typeof e!="number"||!Number.isFinite(e)||(r.positive?e<=0:e<0)||e>ks)throw new RangeError(`${t} must be a finite number ${o} and <= ${ks}, got ${String(e)}`);return e}function ea(t){return t===0?Yp:js(t)}var sl=class{constructor(t){this.timeoutMs=t}timeoutMs;schedule(t){return $e(this.timeoutMs).pipe(bt(1),C(()=>{}))}},al=class extends Error{constructor(t){super(`Cannot replace scheduler unless queue state is READY (current: ${t}).`),this.state=t,this.name="QueueNotIdleError"}state},De=class extends Error{constructor(t="Queue destroyed"){super(t),this.name="QueueDestroyedError"}},Hs=class{constructor(t,e,r={}){this.rciPath=t,this.httpTransport=e,this.initOptions=r;let o=$t("batchTimeout",this.initOptions.batchTimeout,{fallback:Js});this.requestTimeout=$t("requestTimeout",this.initOptions.requestTimeout,{fallback:Zs}),this.blockerQueue=this.initOptions.blockerQueue??null,this.queueName=this.initOptions.queueName??"unknown",this.scheduler=this.initOptions.scheduler??new sl(o),this.statsCollector=this.initOptions.statsCollector??null,this.blockerQueue&&(this.blockerSubscription=this.blockerQueue.isBusy$.pipe(Vp()).subscribe(s=>{s?this.preempt():this.resume()}))}rciPath;httpTransport;initOptions;stateSub$=new fr(R.READY);state$=this.stateSub$.asObservable();isBusy$=this.state$.pipe(C(t=>Ms.includes(t)));blockerQueue;scheduler;queueName;statsCollector;requestTimeout;pendingTasks=[];inFlight=null;blockerSubscription=null;batchCreatedAt=0;currentBatchSub$=null;currentSchedulerSub=null;isDestroyed=!1;get isBusy(){return Ms.includes(this.stateSub$.value)}addTask(t,e=!1){return N(()=>this.enqueueTask(t,e))}setScheduler(t){if(this.isDestroyed)throw new De("Unable to set scheduler: queue is destroyed");if(this.stateSub$.value!==R.READY)throw new al(this.stateSub$.value);this.scheduler=t}destroy(){if(this.isDestroyed)return;this.isDestroyed=!0,this.blockerSubscription?.unsubscribe(),this.blockerSubscription=null,this.closeCurrentWindow(),this.inFlight&&(this.inFlight.subscription.unsubscribe(),this.pendingTasks=[...this.inFlight.tasks,...this.pendingTasks],this.inFlight=null);let t=this.pendingTasks;this.pendingTasks=[];for(let e of t)e.subject.error(new De);this.stateSub$.complete()}enqueueTask(t,e){if(this.isDestroyed)return J(()=>new De);let r=this.prepareTask(t,e),o=this.stateSub$.value===R.READY;return this.pendingTasks.push(r),o?this.startBatch():this.emitBatchSnapshot(),r.subject.asObservable()}prepareTask(t,e){let r=new qs(1),o=!Array.isArray(t),s=o?[t]:[...t],a=s.length;return e&&s.push({path:ta}),{queries:s.map(i=>({...i,extractData:i?.extractData??!0})),subject:r,isSingleQuery:o,resultCount:a}}setState(t){this.stateSub$.next(t)}isBlocked(){return this.blockerQueue?.isBusy??!1}startBatch(){this.closeCurrentWindow(),this.setState(R.BATCHING_TASKS),this.batchCreatedAt=Date.now(),this.currentBatchSub$=new Z,this.currentSchedulerSub=this.scheduler.schedule(this.currentBatchSub$.asObservable()).pipe(bt(1),tt(t=>(console.error("Scheduler error, forcing batch flush:",t),S(void 0)))).subscribe(()=>{this.onSchedulerFired()}),this.emitBatchSnapshot()}closeCurrentWindow(){this.currentSchedulerSub?.unsubscribe(),this.currentSchedulerSub=null,this.currentBatchSub$?.complete(),this.currentBatchSub$=null}emitBatchSnapshot(){if(!this.currentBatchSub$)return;let t=this.pendingTasks.flatMap(e=>e.queries.map(r=>r.path));this.currentBatchSub$.next({taskCount:this.pendingTasks.length,queryCount:t.length,createdAt:this.batchCreatedAt,elapsedMs:Date.now()-this.batchCreatedAt,queryPaths:t})}onSchedulerFired(){if(this.closeCurrentWindow(),this.isBlocked()){this.setState(R.PENDING);return}this.sendPendingTasks()}sendPendingTasks(){if(this.pendingTasks.length===0){this.setState(R.READY);return}let t=this.pendingTasks;this.pendingTasks=[],this.setState(R.AWAITING_RESPONSE);let{queryArray:e,queryMap:r}=Wt.batchTasks(t),o=Date.now(),s=!1,a=N(()=>Vs(this.httpTransport,this.rciPath,e)).pipe(ea(this.requestTimeout),C(n=>[n,null]),tt(n=>S([[],n]))).subscribe(([n,i])=>{s=!0,this.inFlight=null,this.handleBatchResponse(t,r,o,n,i)});s||(this.inFlight={tasks:t,subscription:a})}handleBatchResponse(t,e,r,o,s){if(s)this.provideErrorDataToTasks(s,t);else{let u=Wt.splitResponsesPerTask(o,t,e);this.provideDataToTasks(u,t)}let a=Date.now()-r,n=t.reduce((u,p)=>u+p.queries.length,0),i=t.flatMap(u=>u.queries.map(p=>p.path));try{this.statsCollector?.collect({queueName:this.queueName,taskCount:t.length,queryCount:n,queryPaths:i,sentAt:r,durationMs:a,success:!s,error:s??void 0})}catch(u){console.warn("Stats collection failed:",u)}this.onSendFinished()}onSendFinished(){this.isDestroyed||(this.pendingTasks.length===0?this.setState(R.READY):this.isBlocked()?this.setState(R.PENDING):this.startBatch())}provideDataToTasks(t,e){e.forEach(({subject:r,isSingleQuery:o,resultCount:s},a)=>{let n=o?t[a][0]:t[a].slice(0,s);r.next(n),r.complete()})}provideErrorDataToTasks(t,e){e.forEach(({subject:r})=>{r.error(t)})}preempt(){let t=this.stateSub$.value;t===R.AWAITING_RESPONSE?(this.recallInFlightTasks(),this.setState(R.PENDING)):t===R.BATCHING_TASKS&&(this.closeCurrentWindow(),this.setState(R.PENDING))}resume(){this.stateSub$.value===R.PENDING&&this.sendPendingTasks()}recallInFlightTasks(){if(!this.inFlight)return;let{tasks:t,subscription:e}=this.inFlight;this.inFlight=null,e.unsubscribe(),this.pendingTasks=[...t,...this.pendingTasks]}},ur={pollInterval:1e3,timeout:0},ra=(t=>(t.DONE="DONE",t.ABORTED="ABORTED",t.TIMED_OUT="TIMED_OUT",t.ERROR="ERROR",t))(ra||{}),nl=(t=>(t.INIT="INIT",t.QUEUED="QUEUED",t.RUNNING="RUNNING",t.COMPLETED="COMPLETED",t.ABORTING="ABORTING",t.ABORTED="ABORTED",t.TIMED_OUT="TIMED_OUT",t.ERROR="ERROR",t))(nl||{}),il={DONE:"COMPLETED",ABORTED:"ABORTED",TIMED_OUT:"TIMED_OUT",ERROR:"ERROR"},oa=class{data$;result$;done$;state$;command;data;options;responseSub$=new Z;resultSub$=new Z;doneSub$=new Z;abortSub$=new qs(1);subscriptions=new Xs;isDestroyed=!1;lastError=null;rciPath;httpTransport;pollIntervalMs;timeoutMs;stateSub$=new fr("INIT");startTrigger$=new Z;isAttached=!1;constructor(t,e,r,o,s){this.command=t,this.data=e,this.options={...r},this.rciPath=o,this.httpTransport=s,this.pollIntervalMs=$t("pollInterval",r.pollInterval,{fallback:ur.pollInterval,positive:!0}),this.timeoutMs=$t("timeout",r.timeout,{fallback:ur.timeout}),this.data$=this.responseSub$.asObservable().pipe(Ds(Boolean)),this.result$=this.resultSub$.asObservable(),this.done$=this.doneSub$.asObservable(),this.state$=this.stateSub$.asObservable(),this.subscriptions.add(this.startTrigger$.pipe(Ds(()=>this.stateSub$.value==="INIT"||this.stateSub$.value==="QUEUED"),gt(()=>(this.stateSub$.next("RUNNING"),this))).subscribe(()=>{this.execute()})),this.subscriptions.add(this.done$.subscribe(a=>{this.stateSub$.next(il[a])}))}getState(){return this.stateSub$.value}get error(){return this.lastError}getProcessUrl(t){return`${this.rciPath}${t.replace(/\./g,"/")}`}requestRemoteStop(){this.httpTransport.delete(this.getProcessUrl(this.command)).subscribe({error:t=>{console.error(`Failed to stop background process: ${this.command}`,t)}})}destroy(){this.isDestroyed||(this.isDestroyed=!0,this.subscriptions.unsubscribe(),this.responseSub$.complete(),this.resultSub$.complete(),this.doneSub$.complete(),this.abortSub$.complete(),this.startTrigger$.complete(),this.stateSub$.complete())}start(){return this.stateSub$.value!=="INIT"?(console.error(`Cannot start process: current state is ${this.stateSub$.value}`),!1):(this.startTrigger$.next(),!0)}attachToRunning(){return this.stateSub$.value!=="INIT"?(console.error(`Cannot attach to process: current state is ${this.stateSub$.value}`),!1):(this.isAttached=!0,this.startTrigger$.next(),!0)}abort(){return this.stateSub$.value==="QUEUED"?(this.finish("ABORTED"),!0):this.stateSub$.value!=="RUNNING"?(console.error(`Cannot abort process: current state is ${this.stateSub$.value}`),!1):(this.stateSub$.next("ABORTING"),this.requestRemoteStop(),this.abortSub$.next(),this.abortSub$.complete(),!0)}setQueued(t){if(this.stateSub$.value!=="INIT")return console.error(`Cannot queue process: current state is ${this.stateSub$.value}`),!1;this.stateSub$.next("QUEUED");let e=t.pipe($s(1)).subscribe(()=>{this.startTrigger$.next()});return this.subscriptions.add(e),!0}finish(t){this.responseSub$.complete(),this.resultSub$.complete(),this.doneSub$.next(t),this.doneSub$.complete()}markDone(){this.doneSub$.next("DONE"),this.doneSub$.complete()}execute(){let e=(this.timeoutMs?$e(this.timeoutMs):qp).pipe(Xp(()=>this.requestRemoteStop()),gt(()=>"TIMED_OUT")),r=this.abortSub$.pipe(gt(()=>"ABORTED")),o=this.executeTask(this.command,this.data),a=Ks(o,e,r).subscribe({next:n=>{typeof n=="string"?Object.values(ra).includes(n)?(this.responseSub$.next(null),this.doneSub$.next(n),this.doneSub$.complete()):this.markDone():(this.responseSub$.next(n),this.resultSub$.next(n),this.markDone()),this.responseSub$.complete(),this.resultSub$.complete()},error:n=>{this.lastError=n,this.finish("ERROR")}});this.subscriptions.add(a)}executeTask(t,e){let r=this.getProcessUrl(t),o=i=>this.responseSub$.next(i),s=i=>!i.data?.continued,a=()=>this.httpTransport.get(r);return(this.isAttached?this.httpTransport.get(r):this.httpTransport.post(r,e)).pipe(Cs(i=>{if(s(i))return S(i.data);let u=S(null).pipe(Cs(()=>a()),gt(p=>(s(p)||o(p.data),p)),Kp(p=>$e(s(p)?0:this.pollIntervalMs)),Wp());return o(i.data),u.pipe(jp(p=>!s(p)),gt(p=>p.data),$s(1))}))}},Pe={READY:"READY",AWAITING_RESPONSE:"AWAITING_RESPONSE"},ul=class{constructor(t,e,r){this.rciPath=t,this.command=e,this.httpTransport=r,this.subscription.add(this.initializePendingTasksQueueSubscription())}rciPath;command;httpTransport;queuedProcesses=[];currentProcess=null;nextProcess$=new Z;subscription=new Xs;stateSub$=new fr(Pe.READY);isDestroyed=!1;state$=this.stateSub$.asObservable();push(t,e=ur){if(this.isDestroyed)throw new De;let r=new Z,o=new oa(this.command,t,e,this.rciPath,this.httpTransport);o.setQueued(r);let s={process:o,trigger:r};return this.stateSub$.value===Pe.AWAITING_RESPONSE?this.queuedProcesses.push(s):this.nextProcess$.next(s),o}initializePendingTasksQueueSubscription(){return this.nextProcess$.subscribe(t=>{this.currentProcess=t.process,this.stateSub$.next(Pe.AWAITING_RESPONSE);let e=t.process.done$.subscribe({complete:()=>{this.currentProcess=null,this.stateSub$.next(Pe.READY);let r=this.queuedProcesses[0];r&&(this.queuedProcesses=this.queuedProcesses.slice(1),this.nextProcess$.next(r))}});this.subscription.add(e),t.trigger.next(),t.trigger.complete()})}destroy(){this.isDestroyed||(this.isDestroyed=!0,this.subscription.unsubscribe(),this.currentProcess?.destroy(),this.queuedProcesses.forEach(({process:t,trigger:e})=>{t.destroy(),e.complete()}),this.queuedProcesses=[],this.nextProcess$.complete(),this.stateSub$.complete())}},fl=class{subject$=new Z;isEnabled=!1;stats$=this.subject$.asObservable();collect(t){this.isEnabled&&!this.subject$.closed&&this.subject$.next(t)}toggle(t){this.isEnabled=t}destroy(){this.subject$.closed||this.subject$.complete()}},Bs=t=>Array.isArray(t),pl=class extends Error{constructor(){super("A scheduler replacement is already in progress."),this.name="SchedulerReplacementInProgressError"}},Xt=class extends Error{constructor(){super("RciManager is destroyed."),this.name="RciManagerDestroyedError"}},Rb=class{constructor(t,e,r={}){this.host=t,this.httpTransport=e,this.options=r;let o=$t("batchTimeout",this.options.batchTimeout,{fallback:Js});this.requestTimeout=$t("requestTimeout",this.options.requestTimeout,{fallback:Zs}),this.rciPath=`${this.host}/rci/`,this.priorityQueue=new Hs(this.rciPath,this.httpTransport,{batchTimeout:0,requestTimeout:this.requestTimeout,queueName:"priority",statsCollector:this.statsCollector}),this.batchQueue=new Hs(this.rciPath,this.httpTransport,{batchTimeout:o,requestTimeout:this.requestTimeout,blockerQueue:this.priorityQueue,queueName:"batch",scheduler:this.options.batchScheduler,statsCollector:this.statsCollector})}host;httpTransport;options;batchQueue;priorityQueue;backgroundQueues={};statsCollector=new fl;requestTimeout;currentSchedulerSwapToken=null;isDestroyed=!1;rciPath;get stats$(){return this.statsCollector.stats$}toggleStats(t){this.statsCollector.toggle(t)}replaceBatchScheduler(t,e={}){let r=e.waitIdleFor??rl,o=null;return N(()=>o||(o=N(()=>{if(this.isDestroyed)return J(()=>new Xt);if(this.currentSchedulerSwapToken)return J(()=>new pl);let s=Symbol("scheduler-swap");return this.currentSchedulerSwapToken=s,this.batchQueue.state$.pipe(Ws(a=>a===R.READY),bt(1),js(r),nr(()=>{this.batchQueue.setScheduler(t)}),C(()=>{}),ir(()=>{this.currentSchedulerSwapToken===s&&(this.currentSchedulerSwapToken=null)}))}).pipe(Gs({bufferSize:1,refCount:!1})),o))}execute(t){let e=!Bs(t),r=e?[t]:[...t],{queryArray:o,queryMap:s}=Wt.compactQueries(r);return N(()=>this.isDestroyed?J(()=>new Xt):Vs(this.httpTransport,this.rciPath,o)).pipe(ea(this.requestTimeout),C(a=>{let i=Wt.inflateResponse(a,s).map((u,p)=>Wt.prepareResponseData(u,r[p]));return e?i[0]:i}))}queue(t,e=ol){let r=Bs(t)?[...t]:t;return N(()=>this.isDestroyed?J(()=>new Xt):e.isPriorityTask?this.priorityQueue.addTask(r,e.saveConfiguration):this.batchQueue.addTask(r,e.saveConfiguration))}initBackgroundProcess(t,e={}){if(this.isDestroyed)throw new Xt;return new oa(t.path,t.data??{},e,this.rciPath,this.httpTransport)}queueBackgroundProcess(t,e={}){if(this.isDestroyed)throw new Xt;let{path:r}=t,o=String(r),s=t.data??{};return this.backgroundQueues[o]||(this.backgroundQueues[o]=new ul(this.rciPath,r,this.httpTransport)),this.backgroundQueues[o].push(s,e)}destroy(){this.isDestroyed||(this.isDestroyed=!0,this.batchQueue.destroy(),this.priorityQueue.destroy(),Object.values(this.backgroundQueues).forEach(t=>t.destroy()),this.statsCollector.destroy())}},Ob=class Kt{static hasCode(e,r){return Kt.collectResponseStatuses(r).some(s=>s.code===e)}static hasErrors(e){return v(e)&&!b(e)&&(e.error||e.status==="error")?!0:v(e)||b(e)?Ve(e,r=>Kt.hasErrors(r)):!1}static getErrors(e,r=[]){let o={};return Kt.processNdmResponseErrors(e,(s,a)=>{o[s]=a}),je(o,s=>!r.includes(s.code))}static collectResponseStatuses(e,r=[]){let o=[];return(b(e)||v(e))&&(b(e)?e.forEach((s,a)=>{o.push(...this.collectResponseStatuses(s,[...r,String(a)]))}):Q(e).forEach(a=>{let n=e[a],i=[...r,a];a==="status"?o.push({...X(n,[0],{}),path:i}):o.push(...this.collectResponseStatuses(n,i))})),o}static processNdmResponseErrors(e,r=()=>{},o=[]){if(v(e)&&(Ke(e,"error")||X(e,"status")==="error")){let s=o.join(".").replace("body.",""),a=String(X(e,"error")??""),n=String(X(e,"message")??""),i=String(X(e,"code")??"");r(s,{error:a,message:n,code:i})}else(v(e)||b(e))&&Xe(e,(s,a)=>{Kt.processNdmResponseErrors(s,r,[...o,a])})}},Pb=class{constructor(t){if(this.rules=t,t.length===0)throw new Error("RuleScheduler requires at least one rule.")}rules;schedule(t){return Gp(...this.rules.map(e=>e(t))).pipe(bt(1),C(()=>{}))}},sa=t=>e=>e.pipe(Ws(t),bt(1)),_b=t=>()=>$e(t).pipe(bt(1)),Nb=t=>sa(e=>e.queryCount>=t),Db=t=>sa(e=>e.queryPaths.includes(t)),ll=class{constructor(t){this.schedulers=t}schedulers;schedule(t){return Ks(...this.schedulers.map(e=>e.schedule(t))).pipe(bt(1))}},$b=(t,...e)=>new ll([t,...e]),Ct={NDW4:"x-ndw4-interactive",NDW2:"x-ndw2-interactive"},et={REJECTED:"rejected",UNAVAILABLE:"unavailable"},aa=()=>({success:!0}),ct=t=>({success:!1,reason:t}),na=t=>t.isAuthenticated().pipe(C(e=>e?aa():ct(et.UNAVAILABLE))),hl=class{constructor(t,e){this.host=t,this.httpTransport=e,this.authEndpoint=`${this.host}/auth`}host;httpTransport;schema=Ct.NDW2;authEndpoint;isSupported(t){return this.httpTransport.getHeader(t,"WWW-Authenticate")?.includes(this.schema)??!1}authenticate(t,e,r,o){let s=this.httpTransport.getHeader(t,"X-NDM-Challenge"),a=this.httpTransport.getHeader(t,"X-NDM-Realm");return!s||!a?(e.logError('One of the requried headers ("X-NDM-Challenge", "X-NDM-Realm") is missing'),S(ct(et.UNAVAILABLE))):this.getEncryptedPassword({token:s,realm:a,login:r,password:o}).pipe(ar(n=>this.doAuth(e,r,n)))}getEncryptedPassword(t){let{token:e,login:r,realm:o,password:s}=t;return N(()=>Zp(`${r}:${o}:${s}`)).pipe(C(a=>{let n=new Oe("SHA-256","TEXT");return n.update(e+String(a)),n.getHash("HEX")}))}doAuth(t,e,r){let o={login:e,password:r};return this.httpTransport.post(this.authEndpoint,o).pipe(tt(s=>(t.logError(s),S(t.errorToResponse(s)))),ar(s=>s?s.status===401?S(ct(et.REJECTED)):na(t):S(ct(et.UNAVAILABLE))))}},cl=async t=>(await Qs(512)).init().update(t).digest("binary"),_e=async(t,e)=>(await el(Qs(512),t)).init().update(e).digest("binary"),ml=(t,e)=>{if(t.length!==e.length)return!1;let r=0;for(let o=0;o<t.length;o+=1)r|=t[o]^e[o];return r===0},Us=t=>{let e=Array.from(t,r=>String.fromCharCode(r)).join("");if(typeof globalThis.btoa=="function")return globalThis.btoa(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64");throw new Error("No base64 encoder available.")},er=t=>{if(typeof globalThis.atob=="function")return Uint8Array.from(globalThis.atob(t),e=>e.charCodeAt(0));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(t,"base64"));throw new Error("No base64 decoder available.")},dl="NDW4 Interactive Client Key",gl="NDW4 Interactive Server Key",xl=64,bl=1,rr="X-NDM-Data",Fs=16,yl=64,wl=8,Al=262144,or=class extends Error{},Tl=class{constructor(t,e){this.host=t,this.httpTransport=e}host;httpTransport;schema=Ct.NDW4;isSupported(t){return this.httpTransport.getHeader(t,"WWW-Authenticate")?.includes(this.schema)??!1}authenticate(t,e,r,o){return N(()=>S(this.createHandshake(t,r,o))).pipe(ht(s=>this.requestChallenge(s,e)),ht(s=>this.deriveKeys(s)),ht(s=>this.sendClientProof(s,e)),ht(s=>this.sendSignatureProof(s,e)),tt(s=>{e.logError(s);let a=s instanceof or?et.REJECTED:et.UNAVAILABLE;return S(ct(a))}))}requestChallenge(t,e){let r={login:t.username,nonce:t.clientNonce};return this.exchange(t.authUrl,r,e).pipe(C(o=>this.toChallenge(t,o)))}sendClientProof(t,e){return N(()=>this.createProof(t.keys,t.authMessage)).pipe(ht(r=>{let o={login:t.username,nonce:t.combinedNonce,proof:r};return this.exchange(t.authUrl,o,e)}),ht(r=>this.verifyServerSignature(t,r)))}sendSignatureProof(t,e){let{keys:r,signatureBase64:o}=t,s=`${t.authMessage};signature4=${o}`;return N(()=>this.createProof(r,s)).pipe(ht(a=>{let n={login:t.username,nonce:t.combinedNonce,"signature-proof":a};return this.post(t.authUrl,n,e)}),ht(a=>a.status>=200&&a.status<300?na(e):S(ct(et.UNAVAILABLE))))}createHandshake(t,e,r){let o=this.getAuthEndpoint(t);if(!o)throw new Error("NDW4 auth failed: no auth endpoint provided.");let s=Us(this.createNonce());return{authUrl:`${this.host}${o}`,username:e,password:r,clientNonce:s}}getAuthEndpoint(t){let e=this.httpTransport.getHeader(t,"WWW-Authenticate");if(!e)return null;let o=e.split(",").find(a=>a.includes(this.schema));if(!o)return null;let s=o.match(/endpoint="([^"]+)"/)?.[1];return s||null}toChallenge(t,e){this.throwOnReplyError(e,"first");let{username:r,clientNonce:o}=t,s=this.requireString(e.nonce,"nonce");if(!s.startsWith(o))throw new Error("NDW4 auth failed: server nonce does not start with client nonce.");let a=this.requireString(e.salt,"salt"),n=er(a);if(n.length!==Fs)throw new Error(`NDW4 auth failed: salt must be exactly ${Fs} bytes.`);let i=this.toCostParameter(e.iter,"iter",1,yl),u=this.toCostParameter(e.memcost,"memcost",wl,Al),p=`login1=${r},nonce1=${o}`,c=[`iter2=${i.raw}`,`memcost2=${u.raw}`,`nonce2=${s}`,`salt2=${a}`].join(","),l=`login3=${r},nonce3=${s}`,h=`${p};${c};${l}`;return{...t,combinedNonce:s,salt:n,iterations:i.value,memorySize:u.value,authMessage:h}}async deriveKeys(t){let e=await tl({password:t.password,salt:t.salt,iterations:t.iterations,parallelism:bl,memorySize:t.memorySize,hashLength:xl,outputType:"binary"}),r=await _e(e,dl);return{...t,keys:{clientKey:r,storedKey:await cl(r),serverKey:await _e(e,gl)}}}async createProof(t,e){let r=await _e(t.storedKey,e),o=this.xorBytes(t.clientKey,r);return Us(o)}verifyServerSignature(t,e){return N(async()=>{this.throwOnReplyError(e,"second");let r=this.requireString(e.signature,"signature"),o=await _e(t.keys.serverKey,t.authMessage);if(!ml(er(r),o))throw new or("NDW4 auth failed: server signature mismatch.");return{...t,signatureBase64:r}})}exchange(t,e,r){return this.post(t,e,r).pipe(C(o=>this.decodeReply(o)))}post(t,e,r){return this.httpTransport.post(t,e).pipe(tt(o=>{let s=r.errorToResponse(o);return s?S(s):J(()=>o)}))}decodeReply(t){let e=this.httpTransport.getHeader(t,rr);if(!e)throw new Error(`NDW4 auth failed: missing ${rr} header (HTTP ${t.status}).`);let r=er(e),o=new TextDecoder().decode(r),s=JSON.parse(o);if(!this.isRecord(s))throw new Error(`NDW4 auth failed: invalid ${rr} payload.`);return s}isRecord(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}throwOnReplyError(t,e){let r=t.error??t.e;if(typeof r=="string"&&r)throw new or(`NDW4 auth failed at ${e} step: ${r}`)}createNonce(){let t=new Uint8Array(16);return globalThis.crypto.getRandomValues(t)}requireString(t,e){if(typeof t!="string"||!t)throw new Error(`NDW4 auth failed: reply is missing the "${e}" field.`);return t}toCostParameter(t,e,r,o){let s=typeof t=="string"&&/^\d+$/.test(t),a=typeof t=="number"||s?Number(t):Number.NaN;if(!Number.isInteger(a))throw new Error(`NDW4 auth failed: invalid ${e} value.`);if(a<r||a>o)throw new Error(`NDW4 auth failed: ${e} value out of range.`);return{raw:String(t),value:a}}xorBytes(t,e){if(t.length!==e.length)throw new Error("NDW4 auth failed: proof length mismatch.");let r=new Uint8Array(t.length);for(let o=0;o<t.length;o+=1)r[o]=t[o]^e[o];return r}},vl=[Ct.NDW4,Ct.NDW2],Cb=class{constructor(t,e,r={}){this.host=t,this.httpTransport=e,this.authUri=`${this.host}/auth`;let o=r.protocols??vl;if(o.length===0)throw new Error("SessionManager: at least one auth protocol is required.");this.authProtocols=[...new Set(o)].map(s=>this.createAuthProtocol(s))}host;httpTransport;authProtocols;authUri;isLoggingErrors=!1;loginAttemptInProgress$=null;createAuthProtocol(t){switch(t){case Ct.NDW4:return new Tl(this.host,this.httpTransport);case Ct.NDW2:return new hl(this.host,this.httpTransport);default:throw new Error(`SessionManager: unknown auth protocol "${String(t)}".`)}}isAuthenticated(){return this.httpTransport.get(this.authUri).pipe(tt(t=>(this.logError(t),S(this.errorToResponse(t)))),C(t=>t?(this.httpTransport.onAuthRequest(t),t?.status===200):!1))}getRealmHeader(){return this.httpTransport.get(this.authUri).pipe(tt(t=>S(this.errorToResponse(t))),C(t=>t?this.httpTransport.getHeader(t,"X-NDM-Realm"):null))}login(t,e){return this.loginDetailed(t,e).pipe(C(r=>r.success))}loginDetailed(t,e){return N(()=>{if(this.loginAttemptInProgress$)return this.loginAttemptInProgress$;let r=this.runLoginHandshake(t,e).pipe(nr({next:()=>this.onLoginAttemptEnd(r),complete:()=>this.onLoginAttemptEnd(r),error:()=>this.onLoginAttemptEnd(r)}),ir(()=>this.onLoginAttemptEnd(r)),Gs({bufferSize:1,refCount:!0}));return this.loginAttemptInProgress$=r,r})}runLoginHandshake(t,e){return N(()=>(this.httpTransport.authErrorSuspension?.suspend(),this.httpTransport.get(this.authUri).pipe(tt(r=>{let o=this.errorToResponse(r);return o||this.logError(r),S(o)}),Jp(r=>{if(!r)return S({...ct(et.UNAVAILABLE),protocol:null});if(this.httpTransport.onAuthRequest(r),r.status===200)return S({...aa(),protocol:null});let o=this.authProtocols.find(s=>s.isSupported(r));return o?this.authenticateWith(o,r,t,e):(this.logError(`No supported authentication protocol found for response with status ${r.status}`),S({...ct(et.UNAVAILABLE),protocol:null}))}),ir(()=>this.httpTransport.authErrorSuspension?.resume()))))}authenticateWith(t,e,r,o){return t.authenticate(e,this.getAuthContext(),r,o).pipe(C(s=>({...s,protocol:t.schema})))}onLoginAttemptEnd(t){this.loginAttemptInProgress$===t&&(this.loginAttemptInProgress$=null)}logout(){return this.httpTransport.delete(this.authUri).pipe(tt(t=>S(this.errorToResponse(t))),nr(()=>{this.httpTransport.clearAuthData()}))}toggleErrorLogging(t){this.isLoggingErrors=t}logError(t){this.isLoggingErrors&&console.warn(t)}errorToResponse(t){return Ys(t)?t.response:null}getAuthContext(){return{isAuthenticated:()=>this.isAuthenticated(),errorToResponse:t=>this.errorToResponse(t),logError:t=>this.logError(t)}}},ia=class ua{authErrorSub$=new Z;authError$=this.authErrorSub$.asObservable();suspendDepth=0;suspend(){this.suspendDepth+=1}resume(){this.suspendDepth=Math.max(0,this.suspendDepth-1)}static is401Error(e){return Ys(e)&&e.status===401}handleAuthError(){return sr(e=>(ua.is401Error(e)&&this.suspendDepth===0&&this.authErrorSub$.next(),J(()=>e)))}destroy(){this.authErrorSub$.complete()}},Lb=class{authHandler=new ia;authError$=this.authHandler.authError$;authErrorSuspension=this.authHandler;onAuthRequest(){}clearAuthData(){}getHeader(t,e){return t?.headers?.get(e)??null}get(t){return this.request(t,{})}post(t,e){let r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)};return this.request(t,r)}delete(t){return this.request(t,{method:"DELETE"})}request(t,e){return N(()=>{let r=new AbortController,o=fetch(t,{...e,signal:r.signal});return N(()=>Ls(o)).pipe(sr(s=>J(()=>new xt("Network request failed",{status:null,cause:s}))),ar(s=>this.processResponse(s)),Qp(()=>r.abort()))}).pipe(this.authHandler.handleAuthError())}processResponse(t){return Ls(t.text()).pipe(sr(e=>J(()=>new xt("Failed to read the response body",{status:t.status,cause:e}))),gt(e=>{let r;try{r=JSON.parse(e)}catch{r={}}let o={status:t.status,headers:t.headers,data:r};if(o.status>=200&&o.status<300)return o;throw new xt(`HTTP ${o.status}`,{status:o.status,response:o})}))}},El=class fa{entries=new Map;static fromRaw(e){let r=new fa;for(let o of e.split(/\r?\n/)){let s=o.indexOf(":");if(s<=0)continue;let a=o.slice(0,s).trim(),n=o.slice(s+1).trim();a&&r.append(a,n)}return r}append(e,r){let o=e.toLowerCase(),s=this.entries.get(o);this.entries.set(o,s?`${s}
2
+ ${r}`:r)}get(e){return this.entries.get(e.toLowerCase())??null}},Mb=class{authHandler=new ia;authError$=this.authHandler.authError$;authErrorSuspension=this.authHandler;onAuthRequest(){}clearAuthData(){}getHeader(t,e){return t?.headers?.get(e)??null}get(t){return this.request("GET",t,void 0,void 0)}post(t,e){return this.request("POST",t,JSON.stringify(e),{Accept:"application/json","Content-Type":"application/json"})}delete(t){return this.request("DELETE",t,void 0,void 0)}request(t,e,r,o){return this.sendRequest(t,e,r,o).pipe(this.authHandler.handleAuthError())}sendRequest(t,e,r,o){return new zp(s=>{let a=new XMLHttpRequest;if(a.open(t,e,!0),a.withCredentials=!0,o)for(let[n,i]of Object.entries(o))a.setRequestHeader(n,i);return a.onreadystatechange=()=>{if(a.readyState!==XMLHttpRequest.DONE)return;if(a.status===0){s.error(new xt("Network request failed",{status:null}));return}let n=this.toResponse(a);if(n.status>=200&&n.status<300)s.next(n),s.complete();else{let i=new xt(`HTTP ${n.status}`,{status:n.status,response:n});s.error(i)}},a.onerror=()=>{let n=new Error("XMLHttpRequest request failed");s.error(new xt("Network request failed",{status:null,cause:n}))},a.send(r),()=>{a.readyState!==XMLHttpRequest.DONE&&(a.onreadystatechange=null,a.onerror=null,a.abort())}})}toResponse(t){let e;try{e=t.responseText?JSON.parse(t.responseText):{}}catch{e={}}return{status:t.status,headers:El.fromRaw(t.getAllResponseHeaders()),data:e}}};export{Ct as AUTH_PROTOCOL,ia as AuthErrorHandler,Lb as FetchTransport,et as LOGIN_FAILURE_REASON,fl as QueryStatsCollector,De as QueueDestroyedError,al as QueueNotIdleError,ra as RCI_BACKGROUND_PROCESS_FINISH_REASON,nl as RCI_BACKGROUND_PROCESS_STATE,R as RCI_QUEUE_STATE,oa as RciBackgroundProcess,xt as RciHttpError,Rb as RciManager,Xt as RciManagerDestroyedError,Hs as RciQueue,Ob as RciResponseHelper,Pb as RuleScheduler,pl as SchedulerReplacementInProgressError,Cb as SessionManager,sl as TimerScheduler,El as XHRHeaders,Mb as XHRTransport,_b as after,Ys as isRciHttpError,Db as pathIncluded,Nb as queryCountAtLeast,$b as raceSchedulers,sa as when};
3
+ /*! Bundled license information:
4
+
5
+ lodash-es/lodash.js:
6
+ (**
7
+ * @license
8
+ * Lodash (Custom Build) <https://lodash.com/>
9
+ * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
10
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
11
+ * Released under MIT license <https://lodash.com/license>
12
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
14
+ *)
15
+ */
@@ -0,0 +1,3 @@
1
+ function g(r){return typeof r=="function"}function Xr(r){return g(r?.lift)}function p(r){return function(t){if(Xr(t))return t.lift(function(e){try{return r(e,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}var Hr=function(r,t){return Hr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},Hr(r,t)};function F(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Hr(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Tt(r,t,e,o){function n(i){return i instanceof e?i:new e(function(u){u(i)})}return new(e||(e=Promise))(function(i,u){function f(l){try{a(o.next(l))}catch(s){u(s)}}function c(l){try{a(o.throw(l))}catch(s){u(s)}}function a(l){l.done?i(l.value):n(l.value).then(f,c)}a((o=o.apply(r,t||[])).next())})}function _r(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=f(0),u.throw=f(1),u.return=f(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(a){return function(l){return c([a,l])}}function c(a){if(o)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(e=0)),e;)try{if(o=1,n&&(i=a[0]&2?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){e.label=a[1];break}if(a[0]===6&&e.label<i[1]){e.label=i[1],i=a;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(a);break}i[2]&&e.ops.pop(),e.trys.pop();continue}a=t.call(r,e)}catch(l){a=[6,l],n=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function j(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],o=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),n,i=[],u;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(f){u={error:f}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(u)throw u.error}}return i}function _(r,t,e){if(e||arguments.length===2)for(var o=0,n=t.length,i;o<n;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return r.concat(i||Array.prototype.slice.call(t))}function rr(r){return this instanceof rr?(this.v=r,this):new rr(r)}function jt(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=e.apply(r,t||[]),n,i=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),f("next"),f("throw"),f("return",u),n[Symbol.asyncIterator]=function(){return this},n;function u(h){return function(b){return Promise.resolve(b).then(h,s)}}function f(h,b){o[h]&&(n[h]=function(y){return new Promise(function(x,w){i.push([h,y,x,w])>1||c(h,y)})},b&&(n[h]=b(n[h])))}function c(h,b){try{a(o[h](b))}catch(y){d(i[0][3],y)}}function a(h){h.value instanceof rr?Promise.resolve(h.value.v).then(l,s):d(i[0][2],h)}function l(h){c("next",h)}function s(h){c("throw",h)}function d(h,b){h(b),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Ft(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof j=="function"?j(r):r[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(i){e[i]=r[i]&&function(u){return new Promise(function(f,c){u=r[i](u),n(f,c,u.done,u.value)})}}function n(i,u,f,c){Promise.resolve(c).then(function(a){i({value:a,done:f})},u)}}var Or=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function Er(r){return g(r?.then)}function N(r){var t=function(o){Error.call(o),o.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Ar=N(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
2
+ `+e.map(function(o,n){return n+1+") "+o.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function M(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var R=(function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,o,n,i;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var f=j(u),c=f.next();!c.done;c=f.next()){var a=c.value;a.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=f.return)&&e.call(f)}finally{if(t)throw t.error}}else u.remove(this);var l=this.initialTeardown;if(g(l))try{l()}catch(y){i=y instanceof Ar?y.errors:[y]}var s=this._finalizers;if(s){this._finalizers=null;try{for(var d=j(s),h=d.next();!h.done;h=d.next()){var b=h.value;try{Pt(b)}catch(y){i=i??[],y instanceof Ar?i=_(_([],S(i)),S(y.errors)):i.push(y)}}}catch(y){o={error:y}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(o)throw o.error}}}if(i)throw new Ar(i)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Pt(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&M(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&M(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=(function(){var t=new r;return t.closed=!0,t})(),r})();var Qr=R.EMPTY;function Ir(r){return r instanceof R||r&&"closed"in r&&g(r.remove)&&g(r.add)&&g(r.unsubscribe)}function Pt(r){g(r)?r():r.unsubscribe()}var z={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var fr={setTimeout:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=fr.delegate;return n?.setTimeout?n.setTimeout.apply(n,_([r,t],S(e))):setTimeout.apply(void 0,_([r,t],S(e)))},clearTimeout:function(r){var t=fr.delegate;return(t?.clearTimeout||clearTimeout)(r)},delegate:void 0};function Tr(r){fr.setTimeout(function(){var t=z.onUnhandledError;if(t)t(r);else throw r})}function E(){}var Ct=(function(){return rt("C",void 0,void 0)})();function Rt(r){return rt("E",void 0,r)}function Mt(r){return rt("N",r,void 0)}function rt(r,t,e){return{kind:r,value:t,error:e}}var tr=null;function ar(r){if(z.useDeprecatedSynchronousErrorHandling){var t=!tr;if(t&&(tr={errorThrown:!1,error:null}),r(),t){var e=tr,o=e.errorThrown,n=e.error;if(tr=null,o)throw n}}else r()}function kt(r){z.useDeprecatedSynchronousErrorHandling&&tr&&(tr.errorThrown=!0,tr.error=r)}var vr=(function(r){F(t,r);function t(e){var o=r.call(this)||this;return o.isStopped=!1,e?(o.destination=e,Ir(e)&&e.add(o)):o.destination=be,o}return t.create=function(e,o,n){return new er(e,o,n)},t.prototype.next=function(e){this.isStopped?et(Mt(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?et(Rt(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?et(Ct,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(R);var ve=Function.prototype.bind;function tt(r,t){return ve.call(r,t)}var de=(function(){function r(t){this.partialObserver=t}return r.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(o){jr(o)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(o){jr(o)}else jr(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){jr(e)}},r})(),er=(function(r){F(t,r);function t(e,o,n){var i=r.call(this)||this,u;if(g(e)||!e)u={next:e??void 0,error:o??void 0,complete:n??void 0};else{var f;i&&z.useDeprecatedNextContext?(f=Object.create(e),f.unsubscribe=function(){return i.unsubscribe()},u={next:e.next&&tt(e.next,f),error:e.error&&tt(e.error,f),complete:e.complete&&tt(e.complete,f)}):u=e}return i.destination=new de(u),i}return t})(vr);function jr(r){z.useDeprecatedSynchronousErrorHandling?kt(r):Tr(r)}function he(r){throw r}function et(r,t){var e=z.onStoppedNotification;e&&fr.setTimeout(function(){return e(r,t)})}var be={closed:!0,next:E,error:he,complete:E};var cr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function I(r){return r}function Fr(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return ot(r)}function ot(r){return r.length===0?I:r.length===1?r[0]:function(e){return r.reduce(function(o,n){return n(o)},e)}}var O=(function(){function r(t){t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,o){var n=this,i=xe(t)?t:new er(t,e,o);return ar(function(){var u=n,f=u.operator,c=u.source;i.add(f?f.call(i,c):c?n._subscribe(i):n._trySubscribe(i))}),i},r.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},r.prototype.forEach=function(t,e){var o=this;return e=Wt(e),new e(function(n,i){var u=new er({next:function(f){try{t(f)}catch(c){i(c),u.unsubscribe()}},error:i,complete:n});o.subscribe(u)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[cr]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ot(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Wt(t),new t(function(o,n){var i;e.subscribe(function(u){return i=u},function(u){return n(u)},function(){return o(i)})})},r.create=function(t){return new r(t)},r})();function Wt(r){var t;return(t=r??z.Promise)!==null&&t!==void 0?t:Promise}function ye(r){return r&&g(r.next)&&g(r.error)&&g(r.complete)}function xe(r){return r&&r instanceof vr||ye(r)&&Ir(r)}function Pr(r){return g(r[cr])}function Cr(r){return Symbol.asyncIterator&&g(r?.[Symbol.asyncIterator])}function Rr(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ge(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Mr=ge();function kr(r){return g(r?.[Mr])}function Wr(r){return jt(this,arguments,function(){var e,o,n,i;return _r(this,function(u){switch(u.label){case 0:e=r.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,rr(e.read())];case 3:return o=u.sent(),n=o.value,i=o.done,i?[4,rr(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,rr(n)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Lr(r){return g(r?.getReader)}function v(r){if(r instanceof O)return r;if(r!=null){if(Pr(r))return we(r);if(Or(r))return Se(r);if(Er(r))return _e(r);if(Cr(r))return Lt(r);if(kr(r))return Oe(r);if(Lr(r))return Ee(r)}throw Rr(r)}function we(r){return new O(function(t){var e=r[cr]();if(g(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Se(r){return new O(function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()})}function _e(r){return new O(function(t){r.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Tr)})}function Oe(r){return new O(function(t){var e,o;try{for(var n=j(r),i=n.next();!i.done;i=n.next()){var u=i.value;if(t.next(u),t.closed)return}}catch(f){e={error:f}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}t.complete()})}function Lt(r){return new O(function(t){Ae(r,t).catch(function(e){return t.error(e)})})}function Ee(r){return Lt(Wr(r))}function Ae(r,t){var e,o,n,i;return Tt(this,void 0,void 0,function(){var u,f;return _r(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),e=Ft(r),c.label=1;case 1:return[4,e.next()];case 2:if(o=c.sent(),!!o.done)return[3,4];if(u=o.value,t.next(u),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=c.sent(),n={error:f},[3,11];case 6:return c.trys.push([6,,9,10]),o&&!o.done&&(i=e.return)?[4,i.call(e)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function m(r,t,e,o,n){return new dr(r,t,e,o,n)}var dr=(function(r){F(t,r);function t(e,o,n,i,u,f){var c=r.call(this,e)||this;return c.onFinalize=u,c.shouldUnsubscribe=f,c._next=o?function(a){try{o(a)}catch(l){e.error(l)}}:r.prototype._next,c._error=i?function(a){try{i(a)}catch(l){e.error(l)}finally{this.unsubscribe()}}:r.prototype._error,c._complete=n?function(){try{n()}catch(a){e.error(a)}finally{this.unsubscribe()}}:r.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var o=this.closed;r.prototype.unsubscribe.call(this),!o&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(vr);function nt(r){return p(function(t,e){var o=!1,n=null,i=null,u=!1,f=function(){if(i?.unsubscribe(),i=null,o){o=!1;var a=n;n=null,e.next(a)}u&&e.complete()},c=function(){i=null,u&&e.complete()};t.subscribe(m(e,function(a){o=!0,n=a,i||v(r(a)).subscribe(i=m(e,f,c))},function(){u=!0,(!o||!i||i.closed)&&e.complete()}))})}var Nt=(function(r){F(t,r);function t(e,o){return r.call(this)||this}return t.prototype.schedule=function(e,o){return o===void 0&&(o=0),this},t})(R);var hr={setInterval:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=hr.delegate;return n?.setInterval?n.setInterval.apply(n,_([r,t],S(e))):setInterval.apply(void 0,_([r,t],S(e)))},clearInterval:function(r){var t=hr.delegate;return(t?.clearInterval||clearInterval)(r)},delegate:void 0};var Vt=(function(r){F(t,r);function t(e,o){var n=r.call(this,e,o)||this;return n.scheduler=e,n.work=o,n.pending=!1,n}return t.prototype.schedule=function(e,o){var n;if(o===void 0&&(o=0),this.closed)return this;this.state=e;var i=this.id,u=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(u,i,o)),this.pending=!0,this.delay=o,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(u,this.id,o),this},t.prototype.requestAsyncId=function(e,o,n){return n===void 0&&(n=0),hr.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,o,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return o;o!=null&&hr.clearInterval(o)},t.prototype.execute=function(e,o){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,o);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,o){var n=!1,i;try{this.work(e)}catch(u){n=!0,i=u||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),i},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,o=e.id,n=e.scheduler,i=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,M(i,this),o!=null&&(this.id=this.recycleAsyncId(n,o,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},t})(Nt);var or={now:function(){return(or.delegate||Date).now()},delegate:void 0};var it=(function(){function r(t,e){e===void 0&&(e=r.now),this.schedulerActionCtor=t,this.now=e}return r.prototype.schedule=function(t,e,o){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(o,e)},r.now=or.now,r})();var Ut=(function(r){F(t,r);function t(e,o){o===void 0&&(o=it.now);var n=r.call(this,e,o)||this;return n.actions=[],n._active=!1,n}return t.prototype.flush=function(e){var o=this.actions;if(this._active){o.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=o.shift());if(this._active=!1,n){for(;e=o.shift();)e.unsubscribe();throw n}},t})(it);var C=new Ut(Vt),Nr=C;function Vr(r){return r&&g(r.schedule)}function pr(r){return r instanceof Date&&!isNaN(r)}function U(r,t,e){r===void 0&&(r=0),e===void 0&&(e=Nr);var o=-1;return t!=null&&(Vr(t)?e=t:o=t),new O(function(n){var i=pr(r)?+r-e.now():r;i<0&&(i=0);var u=0;return e.schedule(function(){n.closed||(n.next(u++),0<=o?this.schedule(void 0,o):n.complete())},i)})}function Ie(r,t){return t===void 0&&(t=C),nt(function(){return U(r,t)})}function Te(r){return p(function(t,e){var o=[];return t.subscribe(m(e,function(n){return o.push(n)},function(){e.next(o),e.complete()})),v(r).subscribe(m(e,function(){var n=o;o=[],e.next(n)},E)),function(){o=null}})}function je(r,t){return t===void 0&&(t=null),t=t??r,p(function(e,o){var n=[],i=0;e.subscribe(m(o,function(u){var f,c,a,l,s=null;i++%t===0&&n.push([]);try{for(var d=j(n),h=d.next();!h.done;h=d.next()){var b=h.value;b.push(u),r<=b.length&&(s=s??[],s.push(b))}}catch(w){f={error:w}}finally{try{h&&!h.done&&(c=d.return)&&c.call(d)}finally{if(f)throw f.error}}if(s)try{for(var y=j(s),x=y.next();!x.done;x=y.next()){var b=x.value;M(n,b),o.next(b)}}catch(w){a={error:w}}finally{try{x&&!x.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}},function(){var u,f;try{for(var c=j(n),a=c.next();!a.done;a=c.next()){var l=a.value;o.next(l)}}catch(s){u={error:s}}finally{try{a&&!a.done&&(f=c.return)&&f.call(c)}finally{if(u)throw u.error}}o.complete()},void 0,function(){n=null}))})}function ut(r){return r[r.length-1]}function $(r){return g(ut(r))?r.pop():void 0}function k(r){return Vr(ut(r))?r.pop():void 0}function Dt(r,t){return typeof ut(r)=="number"?r.pop():t}function P(r,t,e,o,n){o===void 0&&(o=0),n===void 0&&(n=!1);var i=t.schedule(function(){e(),n?r.add(this.schedule(null,o)):this.unsubscribe()},o);if(r.add(i),!n)return i}function Fe(r){for(var t,e,o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];var i=(t=k(o))!==null&&t!==void 0?t:C,u=(e=o[0])!==null&&e!==void 0?e:null,f=o[1]||1/0;return p(function(c,a){var l=[],s=!1,d=function(y){var x=y.buffer,w=y.subs;w.unsubscribe(),M(l,y),a.next(x),s&&h()},h=function(){if(l){var y=new R;a.add(y);var x=[],w={buffer:x,subs:y};l.push(w),P(y,i,function(){return d(w)},r)}};u!==null&&u>=0?P(a,i,h,u,!0):s=!0,h();var b=m(a,function(y){var x,w,T=l.slice();try{for(var L=j(T),B=L.next();!B.done;B=L.next()){var H=B.value,Q=H.buffer;Q.push(y),f<=Q.length&&d(H)}}catch(se){x={error:se}}finally{try{B&&!B.done&&(w=L.return)&&w.call(L)}finally{if(x)throw x.error}}},function(){for(;l?.length;)a.next(l.shift().buffer);b?.unsubscribe(),a.complete(),a.unsubscribe()},void 0,function(){return l=null});c.subscribe(b)})}function Pe(r,t){return p(function(e,o){var n=[];v(r).subscribe(m(o,function(i){var u=[];n.push(u);var f=new R,c=function(){M(n,u),o.next(u),f.unsubscribe()};f.add(v(t(i)).subscribe(m(o,c,E)))},E)),e.subscribe(m(o,function(i){var u,f;try{for(var c=j(n),a=c.next();!a.done;a=c.next()){var l=a.value;l.push(i)}}catch(s){u={error:s}}finally{try{a&&!a.done&&(f=c.return)&&f.call(c)}finally{if(u)throw u.error}}},function(){for(;n.length>0;)o.next(n.shift());o.complete()}))})}function Ce(r){return p(function(t,e){var o=null,n=null,i=function(){n?.unsubscribe();var u=o;o=[],u&&e.next(u),v(r()).subscribe(n=m(e,i,E))};i(),t.subscribe(m(e,function(u){return o?.push(u)},function(){o&&e.next(o),e.complete()},void 0,function(){return o=n=null}))})}function zt(r){return p(function(t,e){var o=null,n=!1,i;o=t.subscribe(m(e,void 0,void 0,function(u){i=v(r(u,zt(r)(t))),o?(o.unsubscribe(),o=null,i.subscribe(e)):n=!0})),n&&(o.unsubscribe(),o=null,i.subscribe(e))})}var Re=Array.isArray,Me=Object.getPrototypeOf,ke=Object.prototype,We=Object.keys;function qt(r){if(r.length===1){var t=r[0];if(Re(t))return{args:t,keys:null};if(Le(t)){var e=We(t);return{args:e.map(function(o){return t[o]}),keys:e}}}return{args:r,keys:null}}function Le(r){return r&&typeof r=="object"&&Me(r)===ke}function br(r,t){return t===void 0&&(t=0),p(function(e,o){e.subscribe(m(o,function(n){return P(o,r,function(){return o.next(n)},t)},function(){return P(o,r,function(){return o.complete()},t)},function(n){return P(o,r,function(){return o.error(n)},t)}))})}function yr(r,t){return t===void 0&&(t=0),p(function(e,o){o.add(r.schedule(function(){return e.subscribe(o)},t))})}function Yt(r,t){return v(r).pipe(yr(t),br(t))}function Gt(r,t){return v(r).pipe(yr(t),br(t))}function Kt(r,t){return new O(function(e){var o=0;return t.schedule(function(){o===r.length?e.complete():(e.next(r[o++]),e.closed||this.schedule())})})}function Bt(r,t){return new O(function(e){var o;return P(e,t,function(){o=r[Mr](),P(e,t,function(){var n,i,u;try{n=o.next(),i=n.value,u=n.done}catch(f){e.error(f);return}u?e.complete():e.next(i)},0,!0)}),function(){return g(o?.return)&&o.return()}})}function Ur(r,t){if(!r)throw new Error("Iterable cannot be null");return new O(function(e){P(e,t,function(){var o=r[Symbol.asyncIterator]();P(e,t,function(){o.next().then(function(n){n.done?e.complete():e.next(n.value)})},0,!0)})})}function $t(r,t){return Ur(Wr(r),t)}function Zt(r,t){if(r!=null){if(Pr(r))return Yt(r,t);if(Or(r))return Kt(r,t);if(Er(r))return Gt(r,t);if(Cr(r))return Ur(r,t);if(kr(r))return Bt(r,t);if(Lr(r))return $t(r,t)}throw Rr(r)}function q(r,t){return t?Zt(r,t):v(r)}function V(r,t){return p(function(e,o){var n=0;e.subscribe(m(o,function(i){o.next(r.call(t,i,n++))}))})}var Ne=Array.isArray;function Ve(r,t){return Ne(t)?r.apply(void 0,_([],S(t))):r(t)}function mr(r){return V(function(t){return Ve(r,t)})}function Jt(r,t){return r.reduce(function(e,o,n){return e[o]=t[n],e},{})}function Ht(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r),o=$(r),n=qt(r),i=n.args,u=n.keys;if(i.length===0)return q([],e);var f=new O(ft(i,e,u?function(c){return Jt(u,c)}:I));return o?f.pipe(mr(o)):f}function ft(r,t,e){return e===void 0&&(e=I),function(o){Xt(t,function(){for(var n=r.length,i=new Array(n),u=n,f=n,c=function(l){Xt(t,function(){var s=q(r[l],t),d=!1;s.subscribe(m(o,function(h){i[l]=h,d||(d=!0,f--),f||o.next(e(i.slice()))},function(){--u||o.complete()}))},o)},a=0;a<n;a++)c(a)},o)}}function Xt(r,t,e){r?P(e,r,t):t()}function lr(r,t,e,o,n,i,u,f){var c=[],a=0,l=0,s=!1,d=function(){s&&!c.length&&!a&&t.complete()},h=function(y){return a<o?b(y):c.push(y)},b=function(y){i&&t.next(y),a++;var x=!1;v(e(y,l++)).subscribe(m(t,function(w){n?.(w),i?h(w):t.next(w)},function(){x=!0},void 0,function(){if(x)try{a--;for(var w=function(){var T=c.shift();u?P(t,u,function(){return b(T)}):b(T)};c.length&&a<o;)w();d()}catch(T){t.error(T)}}))};return r.subscribe(m(t,h,function(){s=!0,d()})),function(){f?.()}}function W(r,t,e){return e===void 0&&(e=1/0),g(t)?W(function(o,n){return V(function(i,u){return t(o,i,n,u)})(v(r(o,n)))},e):(typeof t=="number"&&(e=t),p(function(o,n){return lr(o,n,r,e)}))}function Dr(r,t,e,o,n){return function(i,u){var f=e,c=t,a=0;i.subscribe(m(u,function(l){var s=a++;c=f?r(c,l,s):(f=!0,l),o&&u.next(c)},n&&(function(){f&&u.next(c),u.complete()})))}}function K(r,t){return p(Dr(r,t,arguments.length>=2,!1,!0))}var Ue=function(r,t){return r.push(t),r};function at(){return p(function(r,t){K(Ue,[])(r).subscribe(t)})}function zr(r,t){return Fr(at(),W(function(e){return r(e)}),t?mr(t):I)}function ct(r){return zr(Ht,r)}var De=ct;var ze=Array.isArray;function Y(r){return r.length===1&&ze(r[0])?r[0]:r}function qr(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=$(r);return e?Fr(qr.apply(void 0,_([],S(r))),mr(e)):p(function(o,n){ft(_([o],S(Y(r))))(n)})}function qe(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return qr.apply(void 0,_([],S(r)))}function xr(r){return r===void 0&&(r=1/0),W(I,r)}function gr(){return xr(1)}function pt(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r);return p(function(o,n){gr()(q(_([o],S(r)),e)).subscribe(n)})}function Yr(r,t){return g(t)?W(r,t,1):W(r,1)}function Ye(r,t){return g(t)?Yr(function(){return r},t):Yr(function(){return r})}function Ge(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return pt.apply(void 0,_([],S(r)))}var Qt=N(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var A=(function(r){F(t,r);function t(){var e=r.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var o=new re(this,this);return o.operator=e,o},t.prototype._throwIfClosed=function(){if(this.closed)throw new Qt},t.prototype.next=function(e){var o=this;ar(function(){var n,i;if(o._throwIfClosed(),!o.isStopped){o.currentObservers||(o.currentObservers=Array.from(o.observers));try{for(var u=j(o.currentObservers),f=u.next();!f.done;f=u.next()){var c=f.value;c.next(e)}}catch(a){n={error:a}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var o=this;ar(function(){if(o._throwIfClosed(),!o.isStopped){o.hasError=o.isStopped=!0,o.thrownError=e;for(var n=o.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;ar(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var o=e.observers;o.length;)o.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var o=this,n=this,i=n.hasError,u=n.isStopped,f=n.observers;return i||u?Qr:(this.currentObservers=null,f.push(e),new R(function(){o.currentObservers=null,M(f,e)}))},t.prototype._checkFinalizedStatuses=function(e){var o=this,n=o.hasError,i=o.thrownError,u=o.isStopped;n?e.error(i):u&&e.complete()},t.prototype.asObservable=function(){var e=new O;return e.source=this,e},t.create=function(e,o){return new re(e,o)},t})(O);var re=(function(r){F(t,r);function t(e,o){var n=r.call(this)||this;return n.destination=e,n.source=o,n}return t.prototype.next=function(e){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,e)},t.prototype.error=function(e){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,e)},t.prototype.complete=function(){var e,o;(o=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||o===void 0||o.call(e)},t.prototype._subscribe=function(e){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(e))!==null&&n!==void 0?n:Qr},t})(A);function te(r){return new O(function(t){return r.subscribe(t)})}var Ke={connector:function(){return new A}};function wr(r,t){t===void 0&&(t=Ke);var e=t.connector;return p(function(o,n){var i=e();v(r(te(i))).subscribe(n),n.add(o.subscribe(i))})}function Be(r){return K(function(t,e,o){return!r||r(e,o)?t+1:t},0)}function $e(r){return p(function(t,e){var o=!1,n=null,i=null,u=function(){if(i?.unsubscribe(),i=null,o){o=!1;var f=n;n=null,e.next(f)}};t.subscribe(m(e,function(f){i?.unsubscribe(),o=!0,n=f,i=m(e,u,E),v(r(f)).subscribe(i)},function(){u(),e.complete()},void 0,function(){n=i=null}))})}function Ze(r,t){return t===void 0&&(t=C),p(function(e,o){var n=null,i=null,u=null,f=function(){if(n){n.unsubscribe(),n=null;var a=i;i=null,o.next(a)}};function c(){var a=u+r,l=t.now();if(l<a){n=this.schedule(void 0,a-l),o.add(n);return}f()}e.subscribe(m(o,function(a){i=a,u=t.now(),n||(n=t.schedule(c,r),o.add(n))},function(){f(),o.complete()},void 0,function(){i=n=null}))})}function nr(r){return p(function(t,e){var o=!1;t.subscribe(m(e,function(n){o=!0,e.next(n)},function(){o||e.next(r),e.complete()}))})}function ir(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return gr()(q(r,k(r)))}var G=new O(function(r){return r.complete()});function Z(r){return r<=0?function(){return G}:p(function(t,e){var o=0;t.subscribe(m(e,function(n){++o<=r&&(e.next(n),r<=o&&e.complete())}))})}function mt(){return p(function(r,t){r.subscribe(m(t,E))})}function lt(r){return V(function(){return r})}function Gr(r,t){return t?function(e){return ir(t.pipe(Z(1),mt()),e.pipe(Gr(r)))}:W(function(e,o){return v(r(e,o)).pipe(Z(1),lt(e))})}function Je(r,t){t===void 0&&(t=C);var e=U(r,t);return Gr(function(){return e})}function Kr(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r);return q(r,e)}function ee(r,t){var e=g(r)?r:function(){return r},o=function(n){return n.error(e())};return new O(t?function(n){return t.schedule(o,0,n)}:o)}var oe;(function(r){r.NEXT="N",r.ERROR="E",r.COMPLETE="C"})(oe||(oe={}));var Br=(function(){function r(t,e,o){this.kind=t,this.value=e,this.error=o,this.hasValue=t==="N"}return r.prototype.observe=function(t){return st(this,t)},r.prototype.do=function(t,e,o){var n=this,i=n.kind,u=n.value,f=n.error;return i==="N"?t?.(u):i==="E"?e?.(f):o?.()},r.prototype.accept=function(t,e,o){var n;return g((n=t)===null||n===void 0?void 0:n.next)?this.observe(t):this.do(t,e,o)},r.prototype.toObservable=function(){var t=this,e=t.kind,o=t.value,n=t.error,i=e==="N"?Kr(o):e==="E"?ee(function(){return n}):e==="C"?G:0;if(!i)throw new TypeError("Unexpected notification kind "+e);return i},r.createNext=function(t){return new r("N",t)},r.createError=function(t){return new r("E",void 0,t)},r.createComplete=function(){return r.completeNotification},r.completeNotification=new r("C"),r})();function st(r,t){var e,o,n,i=r,u=i.kind,f=i.value,c=i.error;if(typeof u!="string")throw new TypeError('Invalid notification, missing "kind"');u==="N"?(e=t.next)===null||e===void 0||e.call(t,f):u==="E"?(o=t.error)===null||o===void 0||o.call(t,c):(n=t.complete)===null||n===void 0||n.call(t)}function Xe(){return p(function(r,t){r.subscribe(m(t,function(e){return st(e,t)}))})}function He(r,t){return p(function(e,o){var n=new Set;e.subscribe(m(o,function(i){var u=r?r(i):i;n.has(u)||(n.add(u),o.next(i))})),t&&v(t).subscribe(m(o,function(){return n.clear()},E))})}function vt(r,t){return t===void 0&&(t=I),r=r??Qe,p(function(e,o){var n,i=!0;e.subscribe(m(o,function(u){var f=t(u);(i||!r(n,f))&&(i=!1,n=f,o.next(u))}))})}function Qe(r,t){return r===t}function ro(r,t){return vt(function(e,o){return t?t(e[r],o[r]):e[r]===o[r]})}var dt=N(function(r){return function(){r(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}});function D(r,t){return p(function(e,o){var n=0;e.subscribe(m(o,function(i){return r.call(t,i,n++)&&o.next(i)}))})}var J=N(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function ur(r){return r===void 0&&(r=to),p(function(t,e){var o=!1;t.subscribe(m(e,function(n){o=!0,e.next(n)},function(){return o?e.complete():e.error(r())}))})}function to(){return new J}function eo(r,t){if(r<0)throw new dt;var e=arguments.length>=2;return function(o){return o.pipe(D(function(n,i){return i===r}),Z(1),e?nr(t):ur(function(){return new dt}))}}function oo(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return function(e){return ir(e,Kr.apply(void 0,_([],S(r))))}}function no(r,t){return p(function(e,o){var n=0;e.subscribe(m(o,function(i){r.call(t,i,n++,e)||(o.next(!1),o.complete())},function(){o.next(!0),o.complete()}))})}function $r(r,t){return t?function(e){return e.pipe($r(function(o,n){return v(r(o,n)).pipe(V(function(i,u){return t(o,i,n,u)}))}))}:p(function(e,o){var n=0,i=null,u=!1;e.subscribe(m(o,function(f){i||(i=m(o,void 0,function(){i=null,u&&o.complete()}),v(r(f,n++)).subscribe(i))},function(){u=!0,!i&&o.complete()}))})}function ht(){return $r(I)}var io=ht;function uo(r,t,e){return t===void 0&&(t=1/0),t=(t||0)<1?1/0:t,p(function(o,n){return lr(o,n,r,t,void 0,!0,e)})}function fo(r){return p(function(t,e){try{t.subscribe(e)}finally{e.add(r)}})}function ao(r,t){return p(bt(r,t,"value"))}function bt(r,t,e){var o=e==="index";return function(n,i){var u=0;n.subscribe(m(i,function(f){var c=u++;r.call(t,f,c,n)&&(i.next(o?c:f),i.complete())},function(){i.next(o?-1:void 0),i.complete()}))}}function co(r,t){return p(bt(r,t,"index"))}function po(r,t){var e=arguments.length>=2;return function(o){return o.pipe(r?D(function(n,i){return r(n,i,o)}):I,Z(1),e?nr(t):ur(function(){return new J}))}}function mo(r,t,e,o){return p(function(n,i){var u;!t||typeof t=="function"?u=t:(e=t.duration,u=t.element,o=t.connector);var f=new Map,c=function(b){f.forEach(b),b(i)},a=function(b){return c(function(y){return y.error(b)})},l=0,s=!1,d=new dr(i,function(b){try{var y=r(b),x=f.get(y);if(!x){f.set(y,x=o?o():new A);var w=h(y,x);if(i.next(w),e){var T=m(x,function(){x.complete(),T?.unsubscribe()},void 0,void 0,function(){return f.delete(y)});d.add(v(e(w)).subscribe(T))}}x.next(u?u(b):b)}catch(L){a(L)}},function(){return c(function(b){return b.complete()})},a,function(){return f.clear()},function(){return s=!0,l===0});n.subscribe(d);function h(b,y){var x=new O(function(w){l++;var T=y.subscribe(w);return function(){T.unsubscribe(),--l===0&&s&&d.unsubscribe()}});return x.key=b,x}})}function lo(){return p(function(r,t){r.subscribe(m(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}function yt(r){return r<=0?function(){return G}:p(function(t,e){var o=[];t.subscribe(m(e,function(n){o.push(n),r<o.length&&o.shift()},function(){var n,i;try{for(var u=j(o),f=u.next();!f.done;f=u.next()){var c=f.value;e.next(c)}}catch(a){n={error:a}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}e.complete()},void 0,function(){o=null}))})}function so(r,t){var e=arguments.length>=2;return function(o){return o.pipe(r?D(function(n,i){return r(n,i,o)}):I,yt(1),e?nr(t):ur(function(){return new J}))}}function vo(){return p(function(r,t){r.subscribe(m(t,function(e){t.next(Br.createNext(e))},function(){t.next(Br.createComplete()),t.complete()},function(e){t.next(Br.createError(e)),t.complete()}))})}function ho(r){return K(g(r)?function(t,e){return r(t,e)>0?t:e}:function(t,e){return t>e?t:e})}function xt(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r),o=Dt(r,1/0);return p(function(n,i){xr(o)(q(_([n],S(r)),e)).subscribe(i)})}var bo=W;function yo(r,t,e){return e===void 0&&(e=1/0),g(t)?W(function(){return r},t,e):(typeof t=="number"&&(e=t),W(function(){return r},e))}function xo(r,t,e){return e===void 0&&(e=1/0),p(function(o,n){var i=t;return lr(o,n,function(u,f){return r(i,u,f)},e,function(u){i=u},!1,void 0,function(){return i=null})})}function go(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return xt.apply(void 0,_([],S(r)))}function wo(r){return K(g(r)?function(t,e){return r(t,e)<0?t:e}:function(t,e){return t<e?t:e})}function gt(){return p(function(r,t){var e=null;r._refCount++;var o=m(t,void 0,void 0,void 0,function(){if(!r||r._refCount<=0||0<--r._refCount){e=null;return}var n=r._connection,i=e;e=null,n&&(!i||n===i)&&n.unsubscribe(),t.unsubscribe()});r.subscribe(o),o.closed||(e=r.connect())})}var sr=(function(r){F(t,r);function t(e,o){var n=r.call(this)||this;return n.source=e,n.subjectFactory=o,n._subject=null,n._refCount=0,n._connection=null,Xr(e)&&(n.lift=e.lift),n}return t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},t.prototype.connect=function(){var e=this,o=this._connection;if(!o){o=this._connection=new R;var n=this.getSubject();o.add(this.source.subscribe(m(n,void 0,function(){e._teardown(),n.complete()},function(i){e._teardown(),n.error(i)},function(){return e._teardown()}))),o.closed&&(this._connection=null,o=R.EMPTY)}return o},t.prototype.refCount=function(){return gt()(this)},t})(O);function Sr(r,t){var e=g(r)?r:function(){return r};return g(t)?wr(t,{connector:e}):function(o){return new sr(o,e)}}function ne(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=Y(r);return new O(function(o){var n=0,i=function(){if(n<e.length){var u=void 0;try{u=v(e[n++])}catch{i();return}var f=new dr(o,void 0,E,E);u.subscribe(f),f.add(i)}else o.complete()};i()})}function So(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=Y(r);return function(o){return ne.apply(void 0,_([o],S(e)))}}var _o=So;function Oo(){return p(function(r,t){var e,o=!1;r.subscribe(m(t,function(n){var i=e;e=n,o&&t.next([i,n]),o=!0}))})}function ie(r,t){return function(e,o){return!r.call(t,e,o)}}function Eo(r,t){return function(e){return[D(r,t)(e),D(ie(r,t))(e)]}}function Ao(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=r.length;if(e===0)throw new Error("list of properties cannot be empty.");return V(function(o){for(var n=o,i=0;i<e;i++){var u=n?.[r[i]];if(typeof u<"u")n=u;else return}return n})}function Io(r){return r?function(t){return wr(r)(t)}:function(t){return Sr(new A)(t)}}var ue=(function(r){F(t,r);function t(e){var o=r.call(this)||this;return o._value=e,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var o=r.prototype._subscribe.call(this,e);return!o.closed&&e.next(this._value),o},t.prototype.getValue=function(){var e=this,o=e.hasError,n=e.thrownError,i=e._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},t})(A);function To(r){return function(t){var e=new ue(r);return new sr(t,function(){return e})}}var fe=(function(r){F(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}return t.prototype._checkFinalizedStatuses=function(e){var o=this,n=o.hasError,i=o._hasValue,u=o._value,f=o.thrownError,c=o.isStopped,a=o._isComplete;n?e.error(f):(c||a)&&(i&&e.next(u),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var e=this,o=e._hasValue,n=e._value,i=e._isComplete;i||(this._isComplete=!0,o&&r.prototype.next.call(this,n),r.prototype.complete.call(this))},t})(A);function jo(){return function(r){var t=new fe;return new sr(r,function(){return t})}}var Zr=(function(r){F(t,r);function t(e,o,n){e===void 0&&(e=1/0),o===void 0&&(o=1/0),n===void 0&&(n=or);var i=r.call(this)||this;return i._bufferSize=e,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(e){var o=this,n=o.isStopped,i=o._buffer,u=o._infiniteTimeWindow,f=o._timestampProvider,c=o._windowTime;n||(i.push(e),!u&&i.push(f.now()+c)),this._trimBuffer(),r.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(e),n=this,i=n._infiniteTimeWindow,u=n._buffer,f=u.slice(),c=0;c<f.length&&!e.closed;c+=i?1:2)e.next(f[c]);return this._checkFinalizedStatuses(e),o},t.prototype._trimBuffer=function(){var e=this,o=e._bufferSize,n=e._timestampProvider,i=e._buffer,u=e._infiniteTimeWindow,f=(u?1:2)*o;if(o<1/0&&f<i.length&&i.splice(0,i.length-f),!u){for(var c=n.now(),a=0,l=1;l<i.length&&i[l]<=c;l+=2)a=l;a&&i.splice(0,a+1)}},t})(A);function Fo(r,t,e,o){e&&!g(e)&&(o=e);var n=g(e)?e:void 0;return function(i){return Sr(new Zr(r,t,o),n)(i)}}function ae(r){return function(t){for(var e=[],o=function(i){e.push(v(r[i]).subscribe(m(t,function(u){if(e){for(var f=0;f<e.length;f++)f!==i&&e[f].unsubscribe();e=null}t.next(u)})))},n=0;e&&!t.closed&&n<r.length;n++)o(n)}}function wt(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return r.length?p(function(e,o){ae(_([e],S(r)))(o)}):I}function Po(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return wt.apply(void 0,_([],S(Y(r))))}function Co(r){var t,e=1/0,o;return r!=null&&(typeof r=="object"?(t=r.count,e=t===void 0?1/0:t,o=r.delay):e=r),e<=0?function(){return G}:p(function(n,i){var u=0,f,c=function(){if(f?.unsubscribe(),f=null,o!=null){var l=typeof o=="number"?U(o):v(o(u)),s=m(i,function(){s.unsubscribe(),a()});l.subscribe(s)}else a()},a=function(){var l=!1;f=n.subscribe(m(i,void 0,function(){++u<e?f?c():l=!0:i.complete()})),l&&c()};a()})}function Ro(r){return p(function(t,e){var o,n=!1,i,u=!1,f=!1,c=function(){return f&&u&&(e.complete(),!0)},a=function(){return i||(i=new A,v(r(i)).subscribe(m(e,function(){o?l():n=!0},function(){u=!0,c()}))),i},l=function(){f=!1,o=t.subscribe(m(e,void 0,function(){f=!0,!c()&&a().next()})),n&&(o.unsubscribe(),o=null,n=!1,l())};l()})}function Mo(r){r===void 0&&(r=1/0);var t;r&&typeof r=="object"?t=r:t={count:r};var e=t.count,o=e===void 0?1/0:e,n=t.delay,i=t.resetOnSuccess,u=i===void 0?!1:i;return o<=0?I:p(function(f,c){var a=0,l,s=function(){var d=!1;l=f.subscribe(m(c,function(h){u&&(a=0),c.next(h)},void 0,function(h){if(a++<o){var b=function(){l?(l.unsubscribe(),l=null,s()):d=!0};if(n!=null){var y=typeof n=="number"?U(n):v(n(h,a)),x=m(c,function(){x.unsubscribe(),b()},function(){c.complete()});y.subscribe(x)}else b()}else c.error(h)})),d&&(l.unsubscribe(),l=null,s())};s()})}function ko(r){return p(function(t,e){var o,n=!1,i,u=function(){o=t.subscribe(m(e,void 0,void 0,function(f){i||(i=new A,v(r(i)).subscribe(m(e,function(){return o?u():n=!0}))),i&&i.next(f)})),n&&(o.unsubscribe(),o=null,n=!1,u())};u()})}function St(r){return p(function(t,e){var o=!1,n=null;t.subscribe(m(e,function(i){o=!0,n=i})),v(r).subscribe(m(e,function(){if(o){o=!1;var i=n;n=null,e.next(i)}},E))})}function ce(r,t){return r===void 0&&(r=0),t===void 0&&(t=C),r<0&&(r=0),U(r,r,t)}function Wo(r,t){return t===void 0&&(t=C),St(ce(r,t))}function Lo(r,t){return p(Dr(r,t,arguments.length>=2,!0))}function No(r,t){return t===void 0&&(t=function(e,o){return e===o}),p(function(e,o){var n=pe(),i=pe(),u=function(c){o.next(c),o.complete()},f=function(c,a){var l=m(o,function(s){var d=a.buffer,h=a.complete;d.length===0?h?u(!1):c.buffer.push(s):!t(s,d.shift())&&u(!1)},function(){c.complete=!0;var s=a.complete,d=a.buffer;s&&u(d.length===0),l?.unsubscribe()});return l};e.subscribe(f(n,i)),v(r).subscribe(f(i,n))})}function pe(){return{buffer:[],complete:!1}}function Ot(r){r===void 0&&(r={});var t=r.connector,e=t===void 0?function(){return new A}:t,o=r.resetOnError,n=o===void 0?!0:o,i=r.resetOnComplete,u=i===void 0?!0:i,f=r.resetOnRefCountZero,c=f===void 0?!0:f;return function(a){var l,s,d,h=0,b=!1,y=!1,x=function(){s?.unsubscribe(),s=void 0},w=function(){x(),l=d=void 0,b=y=!1},T=function(){var L=l;w(),L?.unsubscribe()};return p(function(L,B){h++,!y&&!b&&x();var H=d=d??e();B.add(function(){h--,h===0&&!y&&!b&&(s=_t(T,c))}),H.subscribe(B),!l&&h>0&&(l=new er({next:function(Q){return H.next(Q)},error:function(Q){y=!0,x(),s=_t(w,n,Q),H.error(Q)},complete:function(){b=!0,x(),s=_t(w,u),H.complete()}}),v(L).subscribe(l))})(a)}}function _t(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];if(t===!0){r();return}if(t!==!1){var n=new er({next:function(){n.unsubscribe(),r()}});return v(t.apply(void 0,_([],S(e)))).subscribe(n)}}function Vo(r,t,e){var o,n,i,u,f=!1;return r&&typeof r=="object"?(o=r.bufferSize,u=o===void 0?1/0:o,n=r.windowTime,t=n===void 0?1/0:n,i=r.refCount,f=i===void 0?!1:i,e=r.scheduler):u=r??1/0,Ot({connector:function(){return new Zr(u,t,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:f})}var me=N(function(r){return function(e){r(this),this.name="SequenceError",this.message=e}});var le=N(function(r){return function(e){r(this),this.name="NotFoundError",this.message=e}});function Uo(r){return p(function(t,e){var o=!1,n,i=!1,u=0;t.subscribe(m(e,function(f){i=!0,(!r||r(f,u++,t))&&(o&&e.error(new me("Too many matching values")),o=!0,n=f)},function(){o?(e.next(n),e.complete()):e.error(i?new le("No matching values"):new J)}))})}function Do(r){return D(function(t,e){return r<=e})}function zo(r){return r<=0?I:p(function(t,e){var o=new Array(r),n=0;return t.subscribe(m(e,function(i){var u=n++;if(u<r)o[u]=i;else{var f=u%r,c=o[f];o[f]=i,e.next(c)}})),function(){o=null}})}function qo(r){return p(function(t,e){var o=!1,n=m(e,function(){n?.unsubscribe(),o=!0},E);v(r).subscribe(n),t.subscribe(m(e,function(i){return o&&e.next(i)}))})}function Yo(r){return p(function(t,e){var o=!1,n=0;t.subscribe(m(e,function(i){return(o||(o=!r(i,n++)))&&e.next(i)}))})}function Go(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r);return p(function(o,n){(e?ir(r,o,e):ir(r,o)).subscribe(n)})}function X(r,t){return p(function(e,o){var n=null,i=0,u=!1,f=function(){return u&&!n&&o.complete()};e.subscribe(m(o,function(c){n?.unsubscribe();var a=0,l=i++;v(r(c,l)).subscribe(n=m(o,function(s){return o.next(t?t(c,s,l,a++):s)},function(){n=null,f()}))},function(){u=!0,f()}))})}function Ko(){return X(I)}function Bo(r,t){return g(t)?X(function(){return r},t):X(function(){return r})}function $o(r,t){return p(function(e,o){var n=t;return X(function(i,u){return r(n,i,u)},function(i,u){return n=u,u})(e).subscribe(o),function(){n=null}})}function Zo(r){return p(function(t,e){v(r).subscribe(m(e,function(){return e.complete()},E)),!e.closed&&t.subscribe(e)})}function Jo(r,t){return t===void 0&&(t=!1),p(function(e,o){var n=0;e.subscribe(m(o,function(i){var u=r(i,n++);(u||t)&&o.next(i),!u&&o.complete()}))})}function Xo(r,t,e){var o=g(r)||t||e?{next:r,error:t,complete:e}:r;return o?p(function(n,i){var u;(u=o.subscribe)===null||u===void 0||u.call(o);var f=!0;n.subscribe(m(i,function(c){var a;(a=o.next)===null||a===void 0||a.call(o,c),i.next(c)},function(){var c;f=!1,(c=o.complete)===null||c===void 0||c.call(o),i.complete()},function(c){var a;f=!1,(a=o.error)===null||a===void 0||a.call(o,c),i.error(c)},function(){var c,a;f&&((c=o.unsubscribe)===null||c===void 0||c.call(o)),(a=o.finalize)===null||a===void 0||a.call(o)}))}):I}function Et(r,t){return p(function(e,o){var n=t??{},i=n.leading,u=i===void 0?!0:i,f=n.trailing,c=f===void 0?!1:f,a=!1,l=null,s=null,d=!1,h=function(){s?.unsubscribe(),s=null,c&&(x(),d&&o.complete())},b=function(){s=null,d&&o.complete()},y=function(w){return s=v(r(w)).subscribe(m(o,h,b))},x=function(){if(a){a=!1;var w=l;l=null,o.next(w),!d&&y(w)}};e.subscribe(m(o,function(w){a=!0,l=w,!(s&&!s.closed)&&(u?x():y(w))},function(){d=!0,!(c&&a&&s&&!s.closed)&&o.complete()}))})}function Ho(r,t,e){t===void 0&&(t=C);var o=U(r,t);return Et(function(){return o},e)}function Qo(r){return r===void 0&&(r=C),p(function(t,e){var o=r.now();t.subscribe(m(e,function(n){var i=r.now(),u=i-o;o=i,e.next(new rn(n,u))}))})}var rn=(function(){function r(t,e){this.value=t,this.interval=e}return r})();var tn=N(function(r){return function(e){e===void 0&&(e=null),r(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}});function At(r,t){var e=pr(r)?{first:r}:typeof r=="number"?{each:r}:r,o=e.first,n=e.each,i=e.with,u=i===void 0?en:i,f=e.scheduler,c=f===void 0?t??C:f,a=e.meta,l=a===void 0?null:a;if(o==null&&n==null)throw new TypeError("No timeout provided.");return p(function(s,d){var h,b,y=null,x=0,w=function(T){b=P(d,c,function(){try{h.unsubscribe(),v(u({meta:l,lastValue:y,seen:x})).subscribe(d)}catch(L){d.error(L)}},T)};h=s.subscribe(m(d,function(T){b?.unsubscribe(),x++,d.next(y=T),n>0&&w(n)},void 0,void 0,function(){b?.closed||b?.unsubscribe(),y=null})),!x&&w(o!=null?typeof o=="number"?o:+o-c.now():n)})}function en(r){throw new tn(r)}function on(r,t,e){var o,n,i;if(e=e??Nr,pr(r)?o=r:typeof r=="number"&&(n=r),t)i=function(){return t};else throw new TypeError("No observable provided to switch to");if(o==null&&n==null)throw new TypeError("No timeout provided.");return At({first:o,each:n,scheduler:e,with:i})}function nn(r){return r===void 0&&(r=or),V(function(t){return{value:t,timestamp:r.now()}})}function un(r){return p(function(t,e){var o=new A;e.next(o.asObservable());var n=function(i){o.error(i),e.error(i)};return t.subscribe(m(e,function(i){return o?.next(i)},function(){o.complete(),e.complete()},n)),v(r).subscribe(m(e,function(){o.complete(),e.next(o=new A)},E,n)),function(){o?.unsubscribe(),o=null}})}function fn(r,t){t===void 0&&(t=0);var e=t>0?t:r;return p(function(o,n){var i=[new A],u=[],f=0;n.next(i[0].asObservable()),o.subscribe(m(n,function(c){var a,l;try{for(var s=j(i),d=s.next();!d.done;d=s.next()){var h=d.value;h.next(c)}}catch(x){a={error:x}}finally{try{d&&!d.done&&(l=s.return)&&l.call(s)}finally{if(a)throw a.error}}var b=f-r+1;if(b>=0&&b%e===0&&i.shift().complete(),++f%e===0){var y=new A;i.push(y),n.next(y.asObservable())}},function(){for(;i.length>0;)i.shift().complete();n.complete()},function(c){for(;i.length>0;)i.shift().error(c);n.error(c)},function(){u=null,i=null}))})}function an(r){for(var t,e,o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];var i=(t=k(o))!==null&&t!==void 0?t:C,u=(e=o[0])!==null&&e!==void 0?e:null,f=o[1]||1/0;return p(function(c,a){var l=[],s=!1,d=function(x){var w=x.window,T=x.subs;w.complete(),T.unsubscribe(),M(l,x),s&&h()},h=function(){if(l){var x=new R;a.add(x);var w=new A,T={window:w,subs:x,seen:0};l.push(T),a.next(w.asObservable()),P(x,i,function(){return d(T)},r)}};u!==null&&u>=0?P(a,i,h,u,!0):s=!0,h();var b=function(x){return l.slice().forEach(x)},y=function(x){b(function(w){var T=w.window;return x(T)}),x(a),a.unsubscribe()};return c.subscribe(m(a,function(x){b(function(w){w.window.next(x),f<=++w.seen&&d(w)})},function(){return y(function(x){return x.complete()})},function(x){return y(function(w){return w.error(x)})})),function(){l=null}})}function cn(r,t){return p(function(e,o){var n=[],i=function(u){for(;0<n.length;)n.shift().error(u);o.error(u)};v(r).subscribe(m(o,function(u){var f=new A;n.push(f);var c=new R,a=function(){M(n,f),f.complete(),c.unsubscribe()},l;try{l=v(t(u))}catch(s){i(s);return}o.next(f.asObservable()),c.add(l.subscribe(m(o,a,E,i)))},E)),e.subscribe(m(o,function(u){var f,c,a=n.slice();try{for(var l=j(a),s=l.next();!s.done;s=l.next()){var d=s.value;d.next(u)}}catch(h){f={error:h}}finally{try{s&&!s.done&&(c=l.return)&&c.call(l)}finally{if(f)throw f.error}}},function(){for(;0<n.length;)n.shift().complete();o.complete()},i,function(){for(;0<n.length;)n.shift().unsubscribe()}))})}function pn(r){return p(function(t,e){var o,n,i=function(f){o.error(f),e.error(f)},u=function(){n?.unsubscribe(),o?.complete(),o=new A,e.next(o.asObservable());var f;try{f=v(r())}catch(c){i(c);return}f.subscribe(n=m(e,u,u,i))};u(),t.subscribe(m(e,function(f){return o.next(f)},function(){o.complete(),e.complete()},i,function(){n?.unsubscribe(),o=null}))})}function mn(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=$(r);return p(function(o,n){for(var i=r.length,u=new Array(i),f=r.map(function(){return!1}),c=!1,a=function(s){v(r[s]).subscribe(m(n,function(d){u[s]=d,!c&&!f[s]&&(f[s]=!0,(c=f.every(I))&&(f=null))},E))},l=0;l<i;l++)a(l);o.subscribe(m(n,function(s){if(c){var d=_([s],S(u));n.next(e?e.apply(void 0,_([],S(d))):d)}}))})}function Jr(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=$(r),o=Y(r);return o.length?new O(function(n){var i=o.map(function(){return[]}),u=o.map(function(){return!1});n.add(function(){i=u=null});for(var f=function(a){v(o[a]).subscribe(m(n,function(l){if(i[a].push(l),i.every(function(d){return d.length})){var s=i.map(function(d){return d.shift()});n.next(e?e.apply(void 0,_([],S(s))):s),i.some(function(d,h){return!d.length&&u[h]})&&n.complete()}},function(){u[a]=!0,!i[a].length&&n.complete()}))},c=0;!n.closed&&c<o.length;c++)f(c);return function(){i=u=null}}):G}function It(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return p(function(e,o){Jr.apply(void 0,_([e],S(r))).subscribe(o)})}function ln(r){return zr(Jr,r)}function sn(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return It.apply(void 0,_([],S(r)))}export{nt as audit,Ie as auditTime,Te as buffer,je as bufferCount,Fe as bufferTime,Pe as bufferToggle,Ce as bufferWhen,zt as catchError,De as combineAll,qr as combineLatest,ct as combineLatestAll,qe as combineLatestWith,pt as concat,gr as concatAll,Yr as concatMap,Ye as concatMapTo,Ge as concatWith,wr as connect,Be as count,$e as debounce,Ze as debounceTime,nr as defaultIfEmpty,Je as delay,Gr as delayWhen,Xe as dematerialize,He as distinct,vt as distinctUntilChanged,ro as distinctUntilKeyChanged,eo as elementAt,oo as endWith,no as every,io as exhaust,ht as exhaustAll,$r as exhaustMap,uo as expand,D as filter,fo as finalize,ao as find,co as findIndex,po as first,bo as flatMap,mo as groupBy,mt as ignoreElements,lo as isEmpty,so as last,V as map,lt as mapTo,vo as materialize,ho as max,xt as merge,xr as mergeAll,W as mergeMap,yo as mergeMapTo,xo as mergeScan,go as mergeWith,wo as min,Sr as multicast,br as observeOn,_o as onErrorResumeNext,Oo as pairwise,Eo as partition,Ao as pluck,Io as publish,To as publishBehavior,jo as publishLast,Fo as publishReplay,Po as race,wt as raceWith,K as reduce,gt as refCount,Co as repeat,Ro as repeatWhen,Mo as retry,ko as retryWhen,St as sample,Wo as sampleTime,Lo as scan,No as sequenceEqual,Ot as share,Vo as shareReplay,Uo as single,Do as skip,zo as skipLast,qo as skipUntil,Yo as skipWhile,Go as startWith,yr as subscribeOn,Ko as switchAll,X as switchMap,Bo as switchMapTo,$o as switchScan,Z as take,yt as takeLast,Zo as takeUntil,Jo as takeWhile,Xo as tap,Et as throttle,Ho as throttleTime,ur as throwIfEmpty,Qo as timeInterval,At as timeout,on as timeoutWith,nn as timestamp,at as toArray,un as window,fn as windowCount,an as windowTime,cn as windowToggle,pn as windowWhen,mn as withLatestFrom,It as zip,ln as zipAll,sn as zipWith};
@@ -0,0 +1,3 @@
1
+ var ct=function(r,t){return ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},ct(r,t)};function E(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ct(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Zt(r,t,e,o){function n(i){return i instanceof e?i:new e(function(u){u(i)})}return new(e||(e=Promise))(function(i,u){function f(l){try{c(o.next(l))}catch(s){u(s)}}function a(l){try{c(o.throw(l))}catch(s){u(s)}}function c(l){l.done?i(l.value):n(l.value).then(f,a)}c((o=o.apply(r,t||[])).next())})}function br(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=f(0),u.throw=f(1),u.return=f(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(c){return function(l){return a([c,l])}}function a(c){if(o)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(e=0)),e;)try{if(o=1,n&&(i=c[0]&2?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,n=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1],i=c;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(c);break}i[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(r,e)}catch(l){c=[6,l],n=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function P(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],o=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),n,i=[],u;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(f){u={error:f}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(u)throw u.error}}return i}function _(r,t,e){if(e||arguments.length===2)for(var o=0,n=t.length,i;o<n;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return r.concat(i||Array.prototype.slice.call(t))}function fr(r){return this instanceof fr?(this.v=r,this):new fr(r)}function Ht(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=e.apply(r,t||[]),n,i=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),f("next"),f("throw"),f("return",u),n[Symbol.asyncIterator]=function(){return this},n;function u(d){return function(x){return Promise.resolve(x).then(d,s)}}function f(d,x){o[d]&&(n[d]=function(b){return new Promise(function(g,S){i.push([d,b,g,S])>1||a(d,b)})},x&&(n[d]=x(n[d])))}function a(d,x){try{c(o[d](x))}catch(b){h(i[0][3],b)}}function c(d){d.value instanceof fr?Promise.resolve(d.value.v).then(l,s):h(i[0][2],d)}function l(d){a("next",d)}function s(d){a("throw",d)}function h(d,x){d(x),i.shift(),i.length&&a(i[0][0],i[0][1])}}function Xt(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof P=="function"?P(r):r[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(i){e[i]=r[i]&&function(u){return new Promise(function(f,a){u=r[i](u),n(f,a,u.done,u.value)})}}function n(i,u,f,a){Promise.resolve(a).then(function(c){i({value:c,done:f})},u)}}function y(r){return typeof r=="function"}function U(r){var t=function(o){Error.call(o),o.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Or=U(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
2
+ `+e.map(function(o,n){return n+1+") "+o.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function L(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var j=(function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,o,n,i;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var f=P(u),a=f.next();!a.done;a=f.next()){var c=a.value;c.remove(this)}}catch(b){t={error:b}}finally{try{a&&!a.done&&(e=f.return)&&e.call(f)}finally{if(t)throw t.error}}else u.remove(this);var l=this.initialTeardown;if(y(l))try{l()}catch(b){i=b instanceof Or?b.errors:[b]}var s=this._finalizers;if(s){this._finalizers=null;try{for(var h=P(s),d=h.next();!d.done;d=h.next()){var x=d.value;try{re(x)}catch(b){i=i??[],b instanceof Or?i=_(_([],A(i)),A(b.errors)):i.push(b)}}}catch(b){o={error:b}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(o)throw o.error}}}if(i)throw new Or(i)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)re(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&L(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&L(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=(function(){var t=new r;return t.closed=!0,t})(),r})();var mt=j.EMPTY;function Ur(r){return r instanceof j||r&&"closed"in r&&y(r.remove)&&y(r.add)&&y(r.unsubscribe)}function re(r){y(r)?r():r.unsubscribe()}var G={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var yr={setTimeout:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=yr.delegate;return n?.setTimeout?n.setTimeout.apply(n,_([r,t],A(e))):setTimeout.apply(void 0,_([r,t],A(e)))},clearTimeout:function(r){var t=yr.delegate;return(t?.clearTimeout||clearTimeout)(r)},delegate:void 0};function qr(r){yr.setTimeout(function(){var t=G.onUnhandledError;if(t)t(r);else throw r})}function O(){}var te=(function(){return pt("C",void 0,void 0)})();function ee(r){return pt("E",void 0,r)}function oe(r){return pt("N",r,void 0)}function pt(r,t,e){return{kind:r,value:t,error:e}}var ar=null;function gr(r){if(G.useDeprecatedSynchronousErrorHandling){var t=!ar;if(t&&(ar={errorThrown:!1,error:null}),r(),t){var e=ar,o=e.errorThrown,n=e.error;if(ar=null,o)throw n}}else r()}function ne(r){G.useDeprecatedSynchronousErrorHandling&&ar&&(ar.errorThrown=!0,ar.error=r)}var wr=(function(r){E(t,r);function t(e){var o=r.call(this)||this;return o.isStopped=!1,e?(o.destination=e,Ur(e)&&e.add(o)):o.destination=qe,o}return t.create=function(e,o,n){return new Z(e,o,n)},t.prototype.next=function(e){this.isStopped?st(oe(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?st(ee(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?st(te,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(j);var Ne=Function.prototype.bind;function lt(r,t){return Ne.call(r,t)}var We=(function(){function r(t){this.partialObserver=t}return r.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(o){Dr(o)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(o){Dr(o)}else Dr(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Dr(e)}},r})(),Z=(function(r){E(t,r);function t(e,o,n){var i=r.call(this)||this,u;if(y(e)||!e)u={next:e??void 0,error:o??void 0,complete:n??void 0};else{var f;i&&G.useDeprecatedNextContext?(f=Object.create(e),f.unsubscribe=function(){return i.unsubscribe()},u={next:e.next&&lt(e.next,f),error:e.error&&lt(e.error,f),complete:e.complete&&lt(e.complete,f)}):u=e}return i.destination=new We(u),i}return t})(wr);function Dr(r){G.useDeprecatedSynchronousErrorHandling?ne(r):qr(r)}function Ue(r){throw r}function st(r,t){var e=G.onStoppedNotification;e&&yr.setTimeout(function(){return e(r,t)})}var qe={closed:!0,next:O,error:Ue,complete:O};var cr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function F(r){return r}function Ir(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return vt(r)}function vt(r){return r.length===0?F:r.length===1?r[0]:function(e){return r.reduce(function(o,n){return n(o)},e)}}var w=(function(){function r(t){t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,o){var n=this,i=Ye(t)?t:new Z(t,e,o);return gr(function(){var u=n,f=u.operator,a=u.source;i.add(f?f.call(i,a):a?n._subscribe(i):n._trySubscribe(i))}),i},r.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},r.prototype.forEach=function(t,e){var o=this;return e=ie(e),new e(function(n,i){var u=new Z({next:function(f){try{t(f)}catch(a){i(a),u.unsubscribe()}},error:i,complete:n});o.subscribe(u)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[cr]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return vt(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=ie(t),new t(function(o,n){var i;e.subscribe(function(u){return i=u},function(u){return n(u)},function(){return o(i)})})},r.create=function(t){return new r(t)},r})();function ie(r){var t;return(t=r??G.Promise)!==null&&t!==void 0?t:Promise}function De(r){return r&&y(r.next)&&y(r.error)&&y(r.complete)}function Ye(r){return r&&r instanceof wr||De(r)&&Ur(r)}function dt(r){return y(r?.lift)}function m(r){return function(t){if(dt(t))return t.lift(function(e){try{return r(e,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}function p(r,t,e,o,n){return new Fr(r,t,e,o,n)}var Fr=(function(r){E(t,r);function t(e,o,n,i,u,f){var a=r.call(this,e)||this;return a.onFinalize=u,a.shouldUnsubscribe=f,a._next=o?function(c){try{o(c)}catch(l){e.error(l)}}:r.prototype._next,a._error=i?function(c){try{i(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:r.prototype._error,a._complete=n?function(){try{n()}catch(c){e.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,a}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var o=this.closed;r.prototype.unsubscribe.call(this),!o&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(wr);function ht(){return m(function(r,t){var e=null;r._refCount++;var o=p(t,void 0,void 0,void 0,function(){if(!r||r._refCount<=0||0<--r._refCount){e=null;return}var n=r._connection,i=e;e=null,n&&(!i||n===i)&&n.unsubscribe(),t.unsubscribe()});r.subscribe(o),o.closed||(e=r.connect())})}var mr=(function(r){E(t,r);function t(e,o){var n=r.call(this)||this;return n.source=e,n.subjectFactory=o,n._subject=null,n._refCount=0,n._connection=null,dt(e)&&(n.lift=e.lift),n}return t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},t.prototype.connect=function(){var e=this,o=this._connection;if(!o){o=this._connection=new j;var n=this.getSubject();o.add(this.source.subscribe(p(n,void 0,function(){e._teardown(),n.complete()},function(i){e._teardown(),n.error(i)},function(){return e._teardown()}))),o.closed&&(this._connection=null,o=j.EMPTY)}return o},t.prototype.refCount=function(){return ht()(this)},t})(w);var xt={now:function(){return(xt.delegate||performance).now()},delegate:void 0};var H={schedule:function(r){var t=requestAnimationFrame,e=cancelAnimationFrame,o=H.delegate;o&&(t=o.requestAnimationFrame,e=o.cancelAnimationFrame);var n=t(function(i){e=void 0,r(i)});return new j(function(){return e?.(n)})},requestAnimationFrame:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=H.delegate;return(e?.requestAnimationFrame||requestAnimationFrame).apply(void 0,_([],A(r)))},cancelAnimationFrame:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=H.delegate;return(e?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,_([],A(r)))},delegate:void 0};function ze(r){return r?ue(r):Ge}function ue(r){return new w(function(t){var e=r||xt,o=e.now(),n=0,i=function(){t.closed||(n=H.requestAnimationFrame(function(u){n=0;var f=e.now();t.next({timestamp:r?f:u,elapsed:f-o}),i()}))};return i(),function(){n&&H.cancelAnimationFrame(n)}})}var Ge=ue();var bt=U(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var I=(function(r){E(t,r);function t(){var e=r.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var o=new fe(this,this);return o.operator=e,o},t.prototype._throwIfClosed=function(){if(this.closed)throw new bt},t.prototype.next=function(e){var o=this;gr(function(){var n,i;if(o._throwIfClosed(),!o.isStopped){o.currentObservers||(o.currentObservers=Array.from(o.observers));try{for(var u=P(o.currentObservers),f=u.next();!f.done;f=u.next()){var a=f.value;a.next(e)}}catch(c){n={error:c}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var o=this;gr(function(){if(o._throwIfClosed(),!o.isStopped){o.hasError=o.isStopped=!0,o.thrownError=e;for(var n=o.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;gr(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var o=e.observers;o.length;)o.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var o=this,n=this,i=n.hasError,u=n.isStopped,f=n.observers;return i||u?mt:(this.currentObservers=null,f.push(e),new j(function(){o.currentObservers=null,L(f,e)}))},t.prototype._checkFinalizedStatuses=function(e){var o=this,n=o.hasError,i=o.thrownError,u=o.isStopped;n?e.error(i):u&&e.complete()},t.prototype.asObservable=function(){var e=new w;return e.source=this,e},t.create=function(e,o){return new fe(e,o)},t})(w);var fe=(function(r){E(t,r);function t(e,o){var n=r.call(this)||this;return n.destination=e,n.source=o,n}return t.prototype.next=function(e){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,e)},t.prototype.error=function(e){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,e)},t.prototype.complete=function(){var e,o;(o=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||o===void 0||o.call(e)},t.prototype._subscribe=function(e){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(e))!==null&&n!==void 0?n:mt},t})(I);var yt=(function(r){E(t,r);function t(e){var o=r.call(this)||this;return o._value=e,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var o=r.prototype._subscribe.call(this,e);return!o.closed&&e.next(this._value),o},t.prototype.getValue=function(){var e=this,o=e.hasError,n=e.thrownError,i=e._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},t})(I);var pr={now:function(){return(pr.delegate||Date).now()},delegate:void 0};var Tr=(function(r){E(t,r);function t(e,o,n){e===void 0&&(e=1/0),o===void 0&&(o=1/0),n===void 0&&(n=pr);var i=r.call(this)||this;return i._bufferSize=e,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(e){var o=this,n=o.isStopped,i=o._buffer,u=o._infiniteTimeWindow,f=o._timestampProvider,a=o._windowTime;n||(i.push(e),!u&&i.push(f.now()+a)),this._trimBuffer(),r.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(e),n=this,i=n._infiniteTimeWindow,u=n._buffer,f=u.slice(),a=0;a<f.length&&!e.closed;a+=i?1:2)e.next(f[a]);return this._checkFinalizedStatuses(e),o},t.prototype._trimBuffer=function(){var e=this,o=e._bufferSize,n=e._timestampProvider,i=e._buffer,u=e._infiniteTimeWindow,f=(u?1:2)*o;if(o<1/0&&f<i.length&&i.splice(0,i.length-f),!u){for(var a=n.now(),c=0,l=1;l<i.length&&i[l]<=a;l+=2)c=l;c&&i.splice(0,c+1)}},t})(I);var jr=(function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}return t.prototype._checkFinalizedStatuses=function(e){var o=this,n=o.hasError,i=o._hasValue,u=o._value,f=o.thrownError,a=o.isStopped,c=o._isComplete;n?e.error(f):(a||c)&&(i&&e.next(u),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var e=this,o=e._hasValue,n=e._value,i=e._isComplete;i||(this._isComplete=!0,o&&r.prototype.next.call(this,n),r.prototype.complete.call(this))},t})(I);var ae=(function(r){E(t,r);function t(e,o){return r.call(this)||this}return t.prototype.schedule=function(e,o){return o===void 0&&(o=0),this},t})(j);var Pr={setInterval:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=Pr.delegate;return n?.setInterval?n.setInterval.apply(n,_([r,t],A(e))):setInterval.apply(void 0,_([r,t],A(e)))},clearInterval:function(r){var t=Pr.delegate;return(t?.clearInterval||clearInterval)(r)},delegate:void 0};var Q=(function(r){E(t,r);function t(e,o){var n=r.call(this,e,o)||this;return n.scheduler=e,n.work=o,n.pending=!1,n}return t.prototype.schedule=function(e,o){var n;if(o===void 0&&(o=0),this.closed)return this;this.state=e;var i=this.id,u=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(u,i,o)),this.pending=!0,this.delay=o,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(u,this.id,o),this},t.prototype.requestAsyncId=function(e,o,n){return n===void 0&&(n=0),Pr.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,o,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return o;o!=null&&Pr.clearInterval(o)},t.prototype.execute=function(e,o){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,o);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,o){var n=!1,i;try{this.work(e)}catch(u){n=!0,i=u||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),i},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,o=e.id,n=e.scheduler,i=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,L(i,this),o!=null&&(this.id=this.recycleAsyncId(n,o,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},t})(ae);var Ke=1,gt,wt={};function ce(r){return r in wt?(delete wt[r],!0):!1}var St={setImmediate:function(r){var t=Ke++;return wt[t]=!0,gt||(gt=Promise.resolve()),gt.then(function(){return ce(t)&&r()}),t},clearImmediate:function(r){ce(r)}};var Qe=St.setImmediate,Be=St.clearImmediate,Cr={setImmediate:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=Cr.delegate;return(e?.setImmediate||Qe).apply(void 0,_([],A(r)))},clearImmediate:function(r){var t=Cr.delegate;return(t?.clearImmediate||Be)(r)},delegate:void 0};var me=(function(r){E(t,r);function t(e,o){var n=r.call(this,e,o)||this;return n.scheduler=e,n.work=o,n}return t.prototype.requestAsyncId=function(e,o,n){return n===void 0&&(n=0),n!==null&&n>0?r.prototype.requestAsyncId.call(this,e,o,n):(e.actions.push(this),e._scheduled||(e._scheduled=Cr.setImmediate(e.flush.bind(e,void 0))))},t.prototype.recycleAsyncId=function(e,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,e,o,n);var u=e.actions;o!=null&&((i=u[u.length-1])===null||i===void 0?void 0:i.id)!==o&&(Cr.clearImmediate(o),e._scheduled===o&&(e._scheduled=void 0))},t})(Q);var Yr=(function(){function r(t,e){e===void 0&&(e=r.now),this.schedulerActionCtor=t,this.now=e}return r.prototype.schedule=function(t,e,o){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(o,e)},r.now=pr.now,r})();var B=(function(r){E(t,r);function t(e,o){o===void 0&&(o=Yr.now);var n=r.call(this,e,o)||this;return n.actions=[],n._active=!1,n}return t.prototype.flush=function(e){var o=this.actions;if(this._active){o.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=o.shift());if(this._active=!1,n){for(;e=o.shift();)e.unsubscribe();throw n}},t})(Yr);var pe=(function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var o=this._scheduled;this._scheduled=void 0;var n=this.actions,i;e=e||n.shift();do if(i=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===o&&n.shift());if(this._active=!1,i){for(;(e=n[0])&&e.id===o&&n.shift();)e.unsubscribe();throw i}},t})(B);var le=new pe(me),$e=le;var C=new B(Q),Rr=C;var se=(function(r){E(t,r);function t(e,o){var n=r.call(this,e,o)||this;return n.scheduler=e,n.work=o,n}return t.prototype.schedule=function(e,o){return o===void 0&&(o=0),o>0?r.prototype.schedule.call(this,e,o):(this.delay=o,this.state=e,this.scheduler.flush(this),this)},t.prototype.execute=function(e,o){return o>0||this.closed?r.prototype.execute.call(this,e,o):this._execute(e,o)},t.prototype.requestAsyncId=function(e,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?r.prototype.requestAsyncId.call(this,e,o,n):(e.flush(this),0)},t})(Q);var ve=(function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t})(B);var de=new ve(se),Je=de;var he=(function(r){E(t,r);function t(e,o){var n=r.call(this,e,o)||this;return n.scheduler=e,n.work=o,n}return t.prototype.requestAsyncId=function(e,o,n){return n===void 0&&(n=0),n!==null&&n>0?r.prototype.requestAsyncId.call(this,e,o,n):(e.actions.push(this),e._scheduled||(e._scheduled=H.requestAnimationFrame(function(){return e.flush(void 0)})))},t.prototype.recycleAsyncId=function(e,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,e,o,n);var u=e.actions;o!=null&&o===e._scheduled&&((i=u[u.length-1])===null||i===void 0?void 0:i.id)!==o&&(H.cancelAnimationFrame(o),e._scheduled=void 0)},t})(Q);var xe=(function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var o;e?o=e.id:(o=this._scheduled,this._scheduled=void 0);var n=this.actions,i;e=e||n.shift();do if(i=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===o&&n.shift());if(this._active=!1,i){for(;(e=n[0])&&e.id===o&&n.shift();)e.unsubscribe();throw i}},t})(B);var be=new xe(he),Ze=be;var He=(function(r){E(t,r);function t(e,o){e===void 0&&(e=ye),o===void 0&&(o=1/0);var n=r.call(this,e,function(){return n.frame})||this;return n.maxFrames=o,n.frame=0,n.index=-1,n}return t.prototype.flush=function(){for(var e=this,o=e.actions,n=e.maxFrames,i,u;(u=o[0])&&u.delay<=n&&(o.shift(),this.frame=u.delay,!(i=u.execute(u.state,u.delay))););if(i){for(;u=o.shift();)u.unsubscribe();throw i}},t.frameTimeFactor=10,t})(B);var ye=(function(r){E(t,r);function t(e,o,n){n===void 0&&(n=e.index+=1);var i=r.call(this,e,o)||this;return i.scheduler=e,i.work=o,i.index=n,i.active=!0,i.index=e.index=n,i}return t.prototype.schedule=function(e,o){if(o===void 0&&(o=0),Number.isFinite(o)){if(!this.id)return r.prototype.schedule.call(this,e,o);this.active=!1;var n=new t(this.scheduler,this.work);return this.add(n),n.schedule(e,o)}else return j.EMPTY},t.prototype.requestAsyncId=function(e,o,n){n===void 0&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,o,n){n===void 0&&(n=0)},t.prototype._execute=function(e,o){if(this.active===!0)return r.prototype._execute.call(this,e,o)},t.sortActions=function(e,o){return e.delay===o.delay?e.index===o.index?0:e.index>o.index?1:-1:e.delay>o.delay?1:-1},t})(Q);var M=new w(function(r){return r.complete()});function Xe(r){return r?ro(r):M}function ro(r){return new w(function(t){return r.schedule(function(){return t.complete()})})}function tr(r){return r&&y(r.schedule)}function At(r){return r[r.length-1]}function $(r){return y(At(r))?r.pop():void 0}function k(r){return tr(At(r))?r.pop():void 0}function zr(r,t){return typeof At(r)=="number"?r.pop():t}var Sr=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function Gr(r){return y(r?.then)}function Kr(r){return y(r[cr])}function Qr(r){return Symbol.asyncIterator&&y(r?.[Symbol.asyncIterator])}function Br(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function to(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var $r=to();function Jr(r){return y(r?.[$r])}function Zr(r){return Ht(this,arguments,function(){var e,o,n,i;return br(this,function(u){switch(u.label){case 0:e=r.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,fr(e.read())];case 3:return o=u.sent(),n=o.value,i=o.done,i?[4,fr(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,fr(n)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Hr(r){return y(r?.getReader)}function v(r){if(r instanceof w)return r;if(r!=null){if(Kr(r))return eo(r);if(Sr(r))return oo(r);if(Gr(r))return no(r);if(Qr(r))return ge(r);if(Jr(r))return io(r);if(Hr(r))return uo(r)}throw Br(r)}function eo(r){return new w(function(t){var e=r[cr]();if(y(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function oo(r){return new w(function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()})}function no(r){return new w(function(t){r.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,qr)})}function io(r){return new w(function(t){var e,o;try{for(var n=P(r),i=n.next();!i.done;i=n.next()){var u=i.value;if(t.next(u),t.closed)return}}catch(f){e={error:f}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}t.complete()})}function ge(r){return new w(function(t){fo(r,t).catch(function(e){return t.error(e)})})}function uo(r){return ge(Zr(r))}function fo(r,t){var e,o,n,i;return Zt(this,void 0,void 0,function(){var u,f;return br(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),e=Xt(r),a.label=1;case 1:return[4,e.next()];case 2:if(o=a.sent(),!!o.done)return[3,4];if(u=o.value,t.next(u),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=a.sent(),n={error:f},[3,11];case 6:return a.trys.push([6,,9,10]),o&&!o.done&&(i=e.return)?[4,i.call(e)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function R(r,t,e,o,n){o===void 0&&(o=0),n===void 0&&(n=!1);var i=t.schedule(function(){e(),n?r.add(this.schedule(null,o)):this.unsubscribe()},o);if(r.add(i),!n)return i}function lr(r,t){return t===void 0&&(t=0),m(function(e,o){e.subscribe(p(o,function(n){return R(o,r,function(){return o.next(n)},t)},function(){return R(o,r,function(){return o.complete()},t)},function(n){return R(o,r,function(){return o.error(n)},t)}))})}function sr(r,t){return t===void 0&&(t=0),m(function(e,o){o.add(r.schedule(function(){return e.subscribe(o)},t))})}function we(r,t){return v(r).pipe(sr(t),lr(t))}function Se(r,t){return v(r).pipe(sr(t),lr(t))}function Ae(r,t){return new w(function(e){var o=0;return t.schedule(function(){o===r.length?e.complete():(e.next(r[o++]),e.closed||this.schedule())})})}function Xr(r,t){return new w(function(e){var o;return R(e,t,function(){o=r[$r](),R(e,t,function(){var n,i,u;try{n=o.next(),i=n.value,u=n.done}catch(f){e.error(f);return}u?e.complete():e.next(i)},0,!0)}),function(){return y(o?.return)&&o.return()}})}function rt(r,t){if(!r)throw new Error("Iterable cannot be null");return new w(function(e){R(e,t,function(){var o=r[Symbol.asyncIterator]();R(e,t,function(){o.next().then(function(n){n.done?e.complete():e.next(n.value)})},0,!0)})})}function _e(r,t){return rt(Zr(r),t)}function _t(r,t){if(r!=null){if(Kr(r))return we(r,t);if(Sr(r))return Ae(r,t);if(Gr(r))return Se(r,t);if(Qr(r))return rt(r,t);if(Jr(r))return Xr(r,t);if(Hr(r))return _e(r,t)}throw Br(r)}function N(r,t){return t?_t(r,t):v(r)}function Mr(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r);return N(r,e)}function Et(r,t){var e=y(r)?r:function(){return r},o=function(n){return n.error(e())};return new w(t?function(n){return t.schedule(o,0,n)}:o)}var Ot;(function(r){r.NEXT="N",r.ERROR="E",r.COMPLETE="C"})(Ot||(Ot={}));var kr=(function(){function r(t,e,o){this.kind=t,this.value=e,this.error=o,this.hasValue=t==="N"}return r.prototype.observe=function(t){return It(this,t)},r.prototype.do=function(t,e,o){var n=this,i=n.kind,u=n.value,f=n.error;return i==="N"?t?.(u):i==="E"?e?.(f):o?.()},r.prototype.accept=function(t,e,o){var n;return y((n=t)===null||n===void 0?void 0:n.next)?this.observe(t):this.do(t,e,o)},r.prototype.toObservable=function(){var t=this,e=t.kind,o=t.value,n=t.error,i=e==="N"?Mr(o):e==="E"?Et(function(){return n}):e==="C"?M:0;if(!i)throw new TypeError("Unexpected notification kind "+e);return i},r.createNext=function(t){return new r("N",t)},r.createError=function(t){return new r("E",void 0,t)},r.createComplete=function(){return r.completeNotification},r.completeNotification=new r("C"),r})();function It(r,t){var e,o,n,i=r,u=i.kind,f=i.value,a=i.error;if(typeof u!="string")throw new TypeError('Invalid notification, missing "kind"');u==="N"?(e=t.next)===null||e===void 0||e.call(t,f):u==="E"?(o=t.error)===null||o===void 0||o.call(t,a):(n=t.complete)===null||n===void 0||n.call(t)}function ao(r){return!!r&&(r instanceof w||y(r.lift)&&y(r.subscribe))}var D=U(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function co(r,t){var e=typeof t=="object";return new Promise(function(o,n){var i=!1,u;r.subscribe({next:function(f){u=f,i=!0},error:n,complete:function(){i?o(u):e?o(t.defaultValue):n(new D)}})})}function mo(r,t){var e=typeof t=="object";return new Promise(function(o,n){var i=new Z({next:function(u){o(u),i.unsubscribe()},error:n,complete:function(){e?o(t.defaultValue):n(new D)}});r.subscribe(i)})}var tt=U(function(r){return function(){r(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}});var Ft=U(function(r){return function(e){r(this),this.name="NotFoundError",this.message=e}});var Tt=U(function(r){return function(e){r(this),this.name="SequenceError",this.message=e}});function Ar(r){return r instanceof Date&&!isNaN(r)}var Ee=U(function(r){return function(e){e===void 0&&(e=null),r(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}});function jt(r,t){var e=Ar(r)?{first:r}:typeof r=="number"?{each:r}:r,o=e.first,n=e.each,i=e.with,u=i===void 0?po:i,f=e.scheduler,a=f===void 0?t??C:f,c=e.meta,l=c===void 0?null:c;if(o==null&&n==null)throw new TypeError("No timeout provided.");return m(function(s,h){var d,x,b=null,g=0,S=function(T){x=R(h,a,function(){try{d.unsubscribe(),v(u({meta:l,lastValue:b,seen:g})).subscribe(h)}catch(W){h.error(W)}},T)};d=s.subscribe(p(h,function(T){x?.unsubscribe(),g++,h.next(b=T),n>0&&S(n)},void 0,void 0,function(){x?.closed||x?.unsubscribe(),b=null})),!g&&S(o!=null?typeof o=="number"?o:+o-a.now():n)})}function po(r){throw new Ee(r)}function Y(r,t){return m(function(e,o){var n=0;e.subscribe(p(o,function(i){o.next(r.call(t,i,n++))}))})}var lo=Array.isArray;function so(r,t){return lo(t)?r.apply(void 0,_([],A(t))):r(t)}function q(r){return Y(function(t){return so(r,t)})}function _r(r,t,e,o){if(e)if(tr(e))o=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return _r(r,t,o).apply(this,n).pipe(q(e))};return o?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return _r(r,t).apply(this,n).pipe(sr(o),lr(o))}:function(){for(var n=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var f=new jr,a=!0;return new w(function(c){var l=f.subscribe(c);if(a){a=!1;var s=!1,h=!1;t.apply(n,_(_([],A(i)),[function(){for(var d=[],x=0;x<arguments.length;x++)d[x]=arguments[x];if(r){var b=d.shift();if(b!=null){f.error(b);return}}f.next(1<d.length?d:d[0]),h=!0,s&&f.complete()}])),h&&f.complete(),s=!0}return l})}}function vo(r,t,e){return _r(!1,r,t,e)}function ho(r,t,e){return _r(!0,r,t,e)}var xo=Array.isArray,bo=Object.getPrototypeOf,yo=Object.prototype,go=Object.keys;function et(r){if(r.length===1){var t=r[0];if(xo(t))return{args:t,keys:null};if(wo(t)){var e=go(t);return{args:e.map(function(o){return t[o]}),keys:e}}}return{args:r,keys:null}}function wo(r){return r&&typeof r=="object"&&bo(r)===yo}function ot(r,t){return r.reduce(function(e,o,n){return e[o]=t[n],e},{})}function Pt(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r),o=$(r),n=et(r),i=n.args,u=n.keys;if(i.length===0)return N([],e);var f=new w(Ct(i,e,u?function(a){return ot(u,a)}:F));return o?f.pipe(q(o)):f}function Ct(r,t,e){return e===void 0&&(e=F),function(o){Oe(t,function(){for(var n=r.length,i=new Array(n),u=n,f=n,a=function(l){Oe(t,function(){var s=N(r[l],t),h=!1;s.subscribe(p(o,function(d){i[l]=d,h||(h=!0,f--),f||o.next(e(i.slice()))},function(){--u||o.complete()}))},o)},c=0;c<n;c++)a(c)},o)}}function Oe(r,t,e){r?R(e,r,t):t()}function Er(r,t,e,o,n,i,u,f){var a=[],c=0,l=0,s=!1,h=function(){s&&!a.length&&!c&&t.complete()},d=function(b){return c<o?x(b):a.push(b)},x=function(b){i&&t.next(b),c++;var g=!1;v(e(b,l++)).subscribe(p(t,function(S){n?.(S),i?d(S):t.next(S)},function(){g=!0},void 0,function(){if(g)try{c--;for(var S=function(){var T=a.shift();u?R(t,u,function(){return x(T)}):x(T)};a.length&&c<o;)S();h()}catch(T){t.error(T)}}))};return r.subscribe(p(t,d,function(){s=!0,h()})),function(){f?.()}}function V(r,t,e){return e===void 0&&(e=1/0),y(t)?V(function(o,n){return Y(function(i,u){return t(o,i,n,u)})(v(r(o,n)))},e):(typeof t=="number"&&(e=t),m(function(o,n){return Er(o,n,r,e)}))}function vr(r){return r===void 0&&(r=1/0),V(F,r)}function Vr(){return vr(1)}function er(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return Vr()(N(r,k(r)))}function dr(r){return new w(function(t){v(r()).subscribe(t)})}var So={connector:function(){return new I},resetOnDisconnect:!0};function Ao(r,t){t===void 0&&(t=So);var e=null,o=t.connector,n=t.resetOnDisconnect,i=n===void 0?!0:n,u=o(),f=new w(function(a){return u.subscribe(a)});return f.connect=function(){return(!e||e.closed)&&(e=dr(function(){return r}).subscribe(u),i&&e.add(function(){return u=o()})),e},f}function _o(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=$(r),o=et(r),n=o.args,i=o.keys,u=new w(function(f){var a=n.length;if(!a){f.complete();return}for(var c=new Array(a),l=a,s=a,h=function(x){var b=!1;v(n[x]).subscribe(p(f,function(g){b||(b=!0,s--),c[x]=g},function(){return l--},void 0,function(){(!l||!b)&&(s||f.next(i?ot(i,c):c),f.complete())}))},d=0;d<a;d++)h(d)});return e?u.pipe(q(e)):u}var Eo=["addListener","removeListener"],Oo=["addEventListener","removeEventListener"],Io=["on","off"];function Rt(r,t,e,o){if(y(e)&&(o=e,e=void 0),o)return Rt(r,t,e).pipe(q(o));var n=A(jo(r)?Oo.map(function(f){return function(a){return r[f](t,a,e)}}):Fo(r)?Eo.map(Ie(r,t)):To(r)?Io.map(Ie(r,t)):[],2),i=n[0],u=n[1];if(!i&&Sr(r))return V(function(f){return Rt(f,t,e)})(v(r));if(!i)throw new TypeError("Invalid event target");return new w(function(f){var a=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return f.next(1<c.length?c:c[0])};return i(a),function(){return u(a)}})}function Ie(r,t){return function(e){return function(o){return r[e](t,o)}}}function Fo(r){return y(r.addListener)&&y(r.removeListener)}function To(r){return y(r.on)&&y(r.off)}function jo(r){return y(r.addEventListener)&&y(r.removeEventListener)}function Fe(r,t,e){return e?Fe(r,t).pipe(q(e)):new w(function(o){var n=function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];return o.next(u.length===1?u[0]:u)},i=r(n);return y(t)?function(){return t(n,i)}:void 0})}function Po(r,t,e,o,n){var i,u,f,a;arguments.length===1?(i=r,a=i.initialState,t=i.condition,e=i.iterate,u=i.resultSelector,f=u===void 0?F:u,n=i.scheduler):(a=r,!o||tr(o)?(f=F,n=o):f=o);function c(){var l;return br(this,function(s){switch(s.label){case 0:l=a,s.label=1;case 1:return!t||t(l)?[4,f(l)]:[3,4];case 2:s.sent(),s.label=3;case 3:return l=e(l),[3,1];case 4:return[2]}})}return dr(n?function(){return Xr(c(),n)}:c)}function Co(r,t,e){return dr(function(){return r()?t:e})}function z(r,t,e){r===void 0&&(r=0),e===void 0&&(e=Rr);var o=-1;return t!=null&&(tr(t)?e=t:o=t),new w(function(n){var i=Ar(r)?+r-e.now():r;i<0&&(i=0);var u=0;return e.schedule(function(){n.closed||(n.next(u++),0<=o?this.schedule(void 0,o):n.complete())},i)})}function Mt(r,t){return r===void 0&&(r=0),t===void 0&&(t=C),r<0&&(r=0),z(r,r,t)}function Ro(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r),o=zr(r,1/0),n=r;return n.length?n.length===1?v(n[0]):vr(o)(N(n,e)):M}var Te=new w(O);function Mo(){return Te}var ko=Array.isArray;function J(r){return r.length===1&&ko(r[0])?r[0]:r}function kt(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=J(r);return new w(function(o){var n=0,i=function(){if(n<e.length){var u=void 0;try{u=v(e[n++])}catch{i();return}var f=new Fr(o,void 0,O,O);u.subscribe(f),f.add(i)}else o.complete()};i()})}function Vo(r,t){return N(Object.entries(r),t)}function je(r,t){return function(e,o){return!r.call(t,e,o)}}function K(r,t){return m(function(e,o){var n=0;e.subscribe(p(o,function(i){return r.call(t,i,n++)&&o.next(i)}))})}function Lo(r,t,e){return[K(t,e)(v(r)),K(je(t,e))(v(r))]}function No(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return r=J(r),r.length===1?v(r[0]):new w(Vt(r))}function Vt(r){return function(t){for(var e=[],o=function(i){e.push(v(r[i]).subscribe(p(t,function(u){if(e){for(var f=0;f<e.length;f++)f!==i&&e[f].unsubscribe();e=null}t.next(u)})))},n=0;e&&!t.closed&&n<r.length;n++)o(n)}}function Wo(r,t,e){if(t==null&&(t=r,r=0),t<=0)return M;var o=t+r;return new w(e?function(n){var i=r;return e.schedule(function(){i<o?(n.next(i++),this.schedule()):n.complete()})}:function(n){for(var i=r;i<o&&!n.closed;)n.next(i++);n.complete()})}function Uo(r,t){return new w(function(e){var o=r(),n=t(o),i=n?v(n):M;return i.subscribe(e),function(){o&&o.unsubscribe()}})}function Lr(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=$(r),o=J(r);return o.length?new w(function(n){var i=o.map(function(){return[]}),u=o.map(function(){return!1});n.add(function(){i=u=null});for(var f=function(c){v(o[c]).subscribe(p(n,function(l){if(i[c].push(l),i.every(function(h){return h.length})){var s=i.map(function(h){return h.shift()});n.next(e?e.apply(void 0,_([],A(s))):s),i.some(function(h,d){return!h.length&&u[d]})&&n.complete()}},function(){u[c]=!0,!i[c].length&&n.complete()}))},a=0;!n.closed&&a<o.length;a++)f(a);return function(){i=u=null}}):M}function Lt(r){return m(function(t,e){var o=!1,n=null,i=null,u=!1,f=function(){if(i?.unsubscribe(),i=null,o){o=!1;var c=n;n=null,e.next(c)}u&&e.complete()},a=function(){i=null,u&&e.complete()};t.subscribe(p(e,function(c){o=!0,n=c,i||v(r(c)).subscribe(i=p(e,f,a))},function(){u=!0,(!o||!i||i.closed)&&e.complete()}))})}function qo(r,t){return t===void 0&&(t=C),Lt(function(){return z(r,t)})}function Do(r){return m(function(t,e){var o=[];return t.subscribe(p(e,function(n){return o.push(n)},function(){e.next(o),e.complete()})),v(r).subscribe(p(e,function(){var n=o;o=[],e.next(n)},O)),function(){o=null}})}function Yo(r,t){return t===void 0&&(t=null),t=t??r,m(function(e,o){var n=[],i=0;e.subscribe(p(o,function(u){var f,a,c,l,s=null;i++%t===0&&n.push([]);try{for(var h=P(n),d=h.next();!d.done;d=h.next()){var x=d.value;x.push(u),r<=x.length&&(s=s??[],s.push(x))}}catch(S){f={error:S}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(f)throw f.error}}if(s)try{for(var b=P(s),g=b.next();!g.done;g=b.next()){var x=g.value;L(n,x),o.next(x)}}catch(S){c={error:S}}finally{try{g&&!g.done&&(l=b.return)&&l.call(b)}finally{if(c)throw c.error}}},function(){var u,f;try{for(var a=P(n),c=a.next();!c.done;c=a.next()){var l=c.value;o.next(l)}}catch(s){u={error:s}}finally{try{c&&!c.done&&(f=a.return)&&f.call(a)}finally{if(u)throw u.error}}o.complete()},void 0,function(){n=null}))})}function zo(r){for(var t,e,o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];var i=(t=k(o))!==null&&t!==void 0?t:C,u=(e=o[0])!==null&&e!==void 0?e:null,f=o[1]||1/0;return m(function(a,c){var l=[],s=!1,h=function(b){var g=b.buffer,S=b.subs;S.unsubscribe(),L(l,b),c.next(g),s&&d()},d=function(){if(l){var b=new j;c.add(b);var g=[],S={buffer:g,subs:b};l.push(S),R(b,i,function(){return h(S)},r)}};u!==null&&u>=0?R(c,i,d,u,!0):s=!0,d();var x=p(c,function(b){var g,S,T=l.slice();try{for(var W=P(T),rr=W.next();!rr.done;rr=W.next()){var ir=rr.value,ur=ir.buffer;ur.push(b),f<=ur.length&&h(ir)}}catch(Le){g={error:Le}}finally{try{rr&&!rr.done&&(S=W.return)&&S.call(W)}finally{if(g)throw g.error}}},function(){for(;l?.length;)c.next(l.shift().buffer);x?.unsubscribe(),c.complete(),c.unsubscribe()},void 0,function(){return l=null});a.subscribe(x)})}function Go(r,t){return m(function(e,o){var n=[];v(r).subscribe(p(o,function(i){var u=[];n.push(u);var f=new j,a=function(){L(n,u),o.next(u),f.unsubscribe()};f.add(v(t(i)).subscribe(p(o,a,O)))},O)),e.subscribe(p(o,function(i){var u,f;try{for(var a=P(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.push(i)}}catch(s){u={error:s}}finally{try{c&&!c.done&&(f=a.return)&&f.call(a)}finally{if(u)throw u.error}}},function(){for(;n.length>0;)o.next(n.shift());o.complete()}))})}function Ko(r){return m(function(t,e){var o=null,n=null,i=function(){n?.unsubscribe();var u=o;o=[],u&&e.next(u),v(r()).subscribe(n=p(e,i,O))};i(),t.subscribe(p(e,function(u){return o?.push(u)},function(){o&&e.next(o),e.complete()},void 0,function(){return o=n=null}))})}function Pe(r){return m(function(t,e){var o=null,n=!1,i;o=t.subscribe(p(e,void 0,void 0,function(u){i=v(r(u,Pe(r)(t))),o?(o.unsubscribe(),o=null,i.subscribe(e)):n=!0})),n&&(o.unsubscribe(),o=null,i.subscribe(e))})}function nt(r,t,e,o,n){return function(i,u){var f=e,a=t,c=0;i.subscribe(p(u,function(l){var s=c++;a=f?r(a,l,s):(f=!0,l),o&&u.next(a)},n&&(function(){f&&u.next(a),u.complete()})))}}function X(r,t){return m(nt(r,t,arguments.length>=2,!1,!0))}var Qo=function(r,t){return r.push(t),r};function Nt(){return m(function(r,t){X(Qo,[])(r).subscribe(t)})}function it(r,t){return Ir(Nt(),V(function(e){return r(e)}),t?q(t):F)}function Wt(r){return it(Pt,r)}var Bo=Wt;function Ut(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=$(r);return e?Ir(Ut.apply(void 0,_([],A(r))),q(e)):m(function(o,n){Ct(_([o],A(J(r))))(n)})}function $o(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return Ut.apply(void 0,_([],A(r)))}function ut(r,t){return y(t)?V(r,t,1):V(r,1)}function Jo(r,t){return y(t)?ut(function(){return r},t):ut(function(){return r})}function Ce(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r);return m(function(o,n){Vr()(N(_([o],A(r)),e)).subscribe(n)})}function Zo(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return Ce.apply(void 0,_([],A(r)))}function Re(r){return new w(function(t){return r.subscribe(t)})}var Ho={connector:function(){return new I}};function Nr(r,t){t===void 0&&(t=Ho);var e=t.connector;return m(function(o,n){var i=e();v(r(Re(i))).subscribe(n),n.add(o.subscribe(i))})}function Xo(r){return X(function(t,e,o){return!r||r(e,o)?t+1:t},0)}function rn(r){return m(function(t,e){var o=!1,n=null,i=null,u=function(){if(i?.unsubscribe(),i=null,o){o=!1;var f=n;n=null,e.next(f)}};t.subscribe(p(e,function(f){i?.unsubscribe(),o=!0,n=f,i=p(e,u,O),v(r(f)).subscribe(i)},function(){u(),e.complete()},void 0,function(){n=i=null}))})}function tn(r,t){return t===void 0&&(t=C),m(function(e,o){var n=null,i=null,u=null,f=function(){if(n){n.unsubscribe(),n=null;var c=i;i=null,o.next(c)}};function a(){var c=u+r,l=t.now();if(l<c){n=this.schedule(void 0,c-l),o.add(n);return}f()}e.subscribe(p(o,function(c){i=c,u=t.now(),n||(n=t.schedule(a,r),o.add(n))},function(){f(),o.complete()},void 0,function(){i=n=null}))})}function hr(r){return m(function(t,e){var o=!1;t.subscribe(p(e,function(n){o=!0,e.next(n)},function(){o||e.next(r),e.complete()}))})}function or(r){return r<=0?function(){return M}:m(function(t,e){var o=0;t.subscribe(p(e,function(n){++o<=r&&(e.next(n),r<=o&&e.complete())}))})}function qt(){return m(function(r,t){r.subscribe(p(t,O))})}function Dt(r){return Y(function(){return r})}function ft(r,t){return t?function(e){return er(t.pipe(or(1),qt()),e.pipe(ft(r)))}:V(function(e,o){return v(r(e,o)).pipe(or(1),Dt(e))})}function en(r,t){t===void 0&&(t=C);var e=z(r,t);return ft(function(){return e})}function on(){return m(function(r,t){r.subscribe(p(t,function(e){return It(e,t)}))})}function nn(r,t){return m(function(e,o){var n=new Set;e.subscribe(p(o,function(i){var u=r?r(i):i;n.has(u)||(n.add(u),o.next(i))})),t&&v(t).subscribe(p(o,function(){return n.clear()},O))})}function Yt(r,t){return t===void 0&&(t=F),r=r??un,m(function(e,o){var n,i=!0;e.subscribe(p(o,function(u){var f=t(u);(i||!r(n,f))&&(i=!1,n=f,o.next(u))}))})}function un(r,t){return r===t}function fn(r,t){return Yt(function(e,o){return t?t(e[r],o[r]):e[r]===o[r]})}function xr(r){return r===void 0&&(r=an),m(function(t,e){var o=!1;t.subscribe(p(e,function(n){o=!0,e.next(n)},function(){return o?e.complete():e.error(r())}))})}function an(){return new D}function cn(r,t){if(r<0)throw new tt;var e=arguments.length>=2;return function(o){return o.pipe(K(function(n,i){return i===r}),or(1),e?hr(t):xr(function(){return new tt}))}}function mn(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return function(e){return er(e,Mr.apply(void 0,_([],A(r))))}}function pn(r,t){return m(function(e,o){var n=0;e.subscribe(p(o,function(i){r.call(t,i,n++,e)||(o.next(!1),o.complete())},function(){o.next(!0),o.complete()}))})}function at(r,t){return t?function(e){return e.pipe(at(function(o,n){return v(r(o,n)).pipe(Y(function(i,u){return t(o,i,n,u)}))}))}:m(function(e,o){var n=0,i=null,u=!1;e.subscribe(p(o,function(f){i||(i=p(o,void 0,function(){i=null,u&&o.complete()}),v(r(f,n++)).subscribe(i))},function(){u=!0,!i&&o.complete()}))})}function zt(){return at(F)}var ln=zt;function sn(r,t,e){return t===void 0&&(t=1/0),t=(t||0)<1?1/0:t,m(function(o,n){return Er(o,n,r,t,void 0,!0,e)})}function vn(r){return m(function(t,e){try{t.subscribe(e)}finally{e.add(r)}})}function dn(r,t){return m(Gt(r,t,"value"))}function Gt(r,t,e){var o=e==="index";return function(n,i){var u=0;n.subscribe(p(i,function(f){var a=u++;r.call(t,f,a,n)&&(i.next(o?a:f),i.complete())},function(){i.next(o?-1:void 0),i.complete()}))}}function hn(r,t){return m(Gt(r,t,"index"))}function xn(r,t){var e=arguments.length>=2;return function(o){return o.pipe(r?K(function(n,i){return r(n,i,o)}):F,or(1),e?hr(t):xr(function(){return new D}))}}function bn(r,t,e,o){return m(function(n,i){var u;!t||typeof t=="function"?u=t:(e=t.duration,u=t.element,o=t.connector);var f=new Map,a=function(x){f.forEach(x),x(i)},c=function(x){return a(function(b){return b.error(x)})},l=0,s=!1,h=new Fr(i,function(x){try{var b=r(x),g=f.get(b);if(!g){f.set(b,g=o?o():new I);var S=d(b,g);if(i.next(S),e){var T=p(g,function(){g.complete(),T?.unsubscribe()},void 0,void 0,function(){return f.delete(b)});h.add(v(e(S)).subscribe(T))}}g.next(u?u(x):x)}catch(W){c(W)}},function(){return a(function(x){return x.complete()})},c,function(){return f.clear()},function(){return s=!0,l===0});n.subscribe(h);function d(x,b){var g=new w(function(S){l++;var T=b.subscribe(S);return function(){T.unsubscribe(),--l===0&&s&&h.unsubscribe()}});return g.key=x,g}})}function yn(){return m(function(r,t){r.subscribe(p(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}function Kt(r){return r<=0?function(){return M}:m(function(t,e){var o=[];t.subscribe(p(e,function(n){o.push(n),r<o.length&&o.shift()},function(){var n,i;try{for(var u=P(o),f=u.next();!f.done;f=u.next()){var a=f.value;e.next(a)}}catch(c){n={error:c}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}e.complete()},void 0,function(){o=null}))})}function gn(r,t){var e=arguments.length>=2;return function(o){return o.pipe(r?K(function(n,i){return r(n,i,o)}):F,Kt(1),e?hr(t):xr(function(){return new D}))}}function wn(){return m(function(r,t){r.subscribe(p(t,function(e){t.next(kr.createNext(e))},function(){t.next(kr.createComplete()),t.complete()},function(e){t.next(kr.createError(e)),t.complete()}))})}function Sn(r){return X(y(r)?function(t,e){return r(t,e)>0?t:e}:function(t,e){return t>e?t:e})}var An=V;function _n(r,t,e){return e===void 0&&(e=1/0),y(t)?V(function(){return r},t,e):(typeof t=="number"&&(e=t),V(function(){return r},e))}function En(r,t,e){return e===void 0&&(e=1/0),m(function(o,n){var i=t;return Er(o,n,function(u,f){return r(i,u,f)},e,function(u){i=u},!1,void 0,function(){return i=null})})}function Me(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r),o=zr(r,1/0);return m(function(n,i){vr(o)(N(_([n],A(r)),e)).subscribe(i)})}function On(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return Me.apply(void 0,_([],A(r)))}function In(r){return X(y(r)?function(t,e){return r(t,e)<0?t:e}:function(t,e){return t<e?t:e})}function Wr(r,t){var e=y(r)?r:function(){return r};return y(t)?Nr(t,{connector:e}):function(o){return new mr(o,e)}}function Fn(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=J(r);return function(o){return kt.apply(void 0,_([o],A(e)))}}function Tn(){return m(function(r,t){var e,o=!1;r.subscribe(p(t,function(n){var i=e;e=n,o&&t.next([i,n]),o=!0}))})}function jn(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=r.length;if(e===0)throw new Error("list of properties cannot be empty.");return Y(function(o){for(var n=o,i=0;i<e;i++){var u=n?.[r[i]];if(typeof u<"u")n=u;else return}return n})}function Pn(r){return r?function(t){return Nr(r)(t)}:function(t){return Wr(new I)(t)}}function Cn(r){return function(t){var e=new yt(r);return new mr(t,function(){return e})}}function Rn(){return function(r){var t=new jr;return new mr(r,function(){return t})}}function Mn(r,t,e,o){e&&!y(e)&&(o=e);var n=y(e)?e:void 0;return function(i){return Wr(new Tr(r,t,o),n)(i)}}function kn(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return r.length?m(function(e,o){Vt(_([e],A(r)))(o)}):F}function Vn(r){var t,e=1/0,o;return r!=null&&(typeof r=="object"?(t=r.count,e=t===void 0?1/0:t,o=r.delay):e=r),e<=0?function(){return M}:m(function(n,i){var u=0,f,a=function(){if(f?.unsubscribe(),f=null,o!=null){var l=typeof o=="number"?z(o):v(o(u)),s=p(i,function(){s.unsubscribe(),c()});l.subscribe(s)}else c()},c=function(){var l=!1;f=n.subscribe(p(i,void 0,function(){++u<e?f?a():l=!0:i.complete()})),l&&a()};c()})}function Ln(r){return m(function(t,e){var o,n=!1,i,u=!1,f=!1,a=function(){return f&&u&&(e.complete(),!0)},c=function(){return i||(i=new I,v(r(i)).subscribe(p(e,function(){o?l():n=!0},function(){u=!0,a()}))),i},l=function(){f=!1,o=t.subscribe(p(e,void 0,function(){f=!0,!a()&&c().next()})),n&&(o.unsubscribe(),o=null,n=!1,l())};l()})}function Nn(r){r===void 0&&(r=1/0);var t;r&&typeof r=="object"?t=r:t={count:r};var e=t.count,o=e===void 0?1/0:e,n=t.delay,i=t.resetOnSuccess,u=i===void 0?!1:i;return o<=0?F:m(function(f,a){var c=0,l,s=function(){var h=!1;l=f.subscribe(p(a,function(d){u&&(c=0),a.next(d)},void 0,function(d){if(c++<o){var x=function(){l?(l.unsubscribe(),l=null,s()):h=!0};if(n!=null){var b=typeof n=="number"?z(n):v(n(d,c)),g=p(a,function(){g.unsubscribe(),x()},function(){a.complete()});b.subscribe(g)}else x()}else a.error(d)})),h&&(l.unsubscribe(),l=null,s())};s()})}function Wn(r){return m(function(t,e){var o,n=!1,i,u=function(){o=t.subscribe(p(e,void 0,void 0,function(f){i||(i=new I,v(r(i)).subscribe(p(e,function(){return o?u():n=!0}))),i&&i.next(f)})),n&&(o.unsubscribe(),o=null,n=!1,u())};u()})}function Qt(r){return m(function(t,e){var o=!1,n=null;t.subscribe(p(e,function(i){o=!0,n=i})),v(r).subscribe(p(e,function(){if(o){o=!1;var i=n;n=null,e.next(i)}},O))})}function Un(r,t){return t===void 0&&(t=C),Qt(Mt(r,t))}function qn(r,t){return m(nt(r,t,arguments.length>=2,!0))}function Dn(r,t){return t===void 0&&(t=function(e,o){return e===o}),m(function(e,o){var n=ke(),i=ke(),u=function(a){o.next(a),o.complete()},f=function(a,c){var l=p(o,function(s){var h=c.buffer,d=c.complete;h.length===0?d?u(!1):a.buffer.push(s):!t(s,h.shift())&&u(!1)},function(){a.complete=!0;var s=c.complete,h=c.buffer;s&&u(h.length===0),l?.unsubscribe()});return l};e.subscribe(f(n,i)),v(r).subscribe(f(i,n))})}function ke(){return{buffer:[],complete:!1}}function $t(r){r===void 0&&(r={});var t=r.connector,e=t===void 0?function(){return new I}:t,o=r.resetOnError,n=o===void 0?!0:o,i=r.resetOnComplete,u=i===void 0?!0:i,f=r.resetOnRefCountZero,a=f===void 0?!0:f;return function(c){var l,s,h,d=0,x=!1,b=!1,g=function(){s?.unsubscribe(),s=void 0},S=function(){g(),l=h=void 0,x=b=!1},T=function(){var W=l;S(),W?.unsubscribe()};return m(function(W,rr){d++,!b&&!x&&g();var ir=h=h??e();rr.add(function(){d--,d===0&&!b&&!x&&(s=Bt(T,a))}),ir.subscribe(rr),!l&&d>0&&(l=new Z({next:function(ur){return ir.next(ur)},error:function(ur){b=!0,g(),s=Bt(S,n,ur),ir.error(ur)},complete:function(){x=!0,g(),s=Bt(S,u),ir.complete()}}),v(W).subscribe(l))})(c)}}function Bt(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];if(t===!0){r();return}if(t!==!1){var n=new Z({next:function(){n.unsubscribe(),r()}});return v(t.apply(void 0,_([],A(e)))).subscribe(n)}}function Yn(r,t,e){var o,n,i,u,f=!1;return r&&typeof r=="object"?(o=r.bufferSize,u=o===void 0?1/0:o,n=r.windowTime,t=n===void 0?1/0:n,i=r.refCount,f=i===void 0?!1:i,e=r.scheduler):u=r??1/0,$t({connector:function(){return new Tr(u,t,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:f})}function zn(r){return m(function(t,e){var o=!1,n,i=!1,u=0;t.subscribe(p(e,function(f){i=!0,(!r||r(f,u++,t))&&(o&&e.error(new Tt("Too many matching values")),o=!0,n=f)},function(){o?(e.next(n),e.complete()):e.error(i?new Ft("No matching values"):new D)}))})}function Gn(r){return K(function(t,e){return r<=e})}function Kn(r){return r<=0?F:m(function(t,e){var o=new Array(r),n=0;return t.subscribe(p(e,function(i){var u=n++;if(u<r)o[u]=i;else{var f=u%r,a=o[f];o[f]=i,e.next(a)}})),function(){o=null}})}function Qn(r){return m(function(t,e){var o=!1,n=p(e,function(){n?.unsubscribe(),o=!0},O);v(r).subscribe(n),t.subscribe(p(e,function(i){return o&&e.next(i)}))})}function Bn(r){return m(function(t,e){var o=!1,n=0;t.subscribe(p(e,function(i){return(o||(o=!r(i,n++)))&&e.next(i)}))})}function $n(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=k(r);return m(function(o,n){(e?er(r,o,e):er(r,o)).subscribe(n)})}function nr(r,t){return m(function(e,o){var n=null,i=0,u=!1,f=function(){return u&&!n&&o.complete()};e.subscribe(p(o,function(a){n?.unsubscribe();var c=0,l=i++;v(r(a,l)).subscribe(n=p(o,function(s){return o.next(t?t(a,s,l,c++):s)},function(){n=null,f()}))},function(){u=!0,f()}))})}function Jn(){return nr(F)}function Zn(r,t){return y(t)?nr(function(){return r},t):nr(function(){return r})}function Hn(r,t){return m(function(e,o){var n=t;return nr(function(i,u){return r(n,i,u)},function(i,u){return n=u,u})(e).subscribe(o),function(){n=null}})}function Xn(r){return m(function(t,e){v(r).subscribe(p(e,function(){return e.complete()},O)),!e.closed&&t.subscribe(e)})}function ri(r,t){return t===void 0&&(t=!1),m(function(e,o){var n=0;e.subscribe(p(o,function(i){var u=r(i,n++);(u||t)&&o.next(i),!u&&o.complete()}))})}function ti(r,t,e){var o=y(r)||t||e?{next:r,error:t,complete:e}:r;return o?m(function(n,i){var u;(u=o.subscribe)===null||u===void 0||u.call(o);var f=!0;n.subscribe(p(i,function(a){var c;(c=o.next)===null||c===void 0||c.call(o,a),i.next(a)},function(){var a;f=!1,(a=o.complete)===null||a===void 0||a.call(o),i.complete()},function(a){var c;f=!1,(c=o.error)===null||c===void 0||c.call(o,a),i.error(a)},function(){var a,c;f&&((a=o.unsubscribe)===null||a===void 0||a.call(o)),(c=o.finalize)===null||c===void 0||c.call(o)}))}):F}function Jt(r,t){return m(function(e,o){var n=t??{},i=n.leading,u=i===void 0?!0:i,f=n.trailing,a=f===void 0?!1:f,c=!1,l=null,s=null,h=!1,d=function(){s?.unsubscribe(),s=null,a&&(g(),h&&o.complete())},x=function(){s=null,h&&o.complete()},b=function(S){return s=v(r(S)).subscribe(p(o,d,x))},g=function(){if(c){c=!1;var S=l;l=null,o.next(S),!h&&b(S)}};e.subscribe(p(o,function(S){c=!0,l=S,!(s&&!s.closed)&&(u?g():b(S))},function(){h=!0,!(a&&c&&s&&!s.closed)&&o.complete()}))})}function ei(r,t,e){t===void 0&&(t=C);var o=z(r,t);return Jt(function(){return o},e)}function oi(r){return r===void 0&&(r=C),m(function(t,e){var o=r.now();t.subscribe(p(e,function(n){var i=r.now(),u=i-o;o=i,e.next(new ni(n,u))}))})}var ni=(function(){function r(t,e){this.value=t,this.interval=e}return r})();function ii(r,t,e){var o,n,i;if(e=e??Rr,Ar(r)?o=r:typeof r=="number"&&(n=r),t)i=function(){return t};else throw new TypeError("No observable provided to switch to");if(o==null&&n==null)throw new TypeError("No timeout provided.");return jt({first:o,each:n,scheduler:e,with:i})}function ui(r){return r===void 0&&(r=pr),Y(function(t){return{value:t,timestamp:r.now()}})}function fi(r){return m(function(t,e){var o=new I;e.next(o.asObservable());var n=function(i){o.error(i),e.error(i)};return t.subscribe(p(e,function(i){return o?.next(i)},function(){o.complete(),e.complete()},n)),v(r).subscribe(p(e,function(){o.complete(),e.next(o=new I)},O,n)),function(){o?.unsubscribe(),o=null}})}function ai(r,t){t===void 0&&(t=0);var e=t>0?t:r;return m(function(o,n){var i=[new I],u=[],f=0;n.next(i[0].asObservable()),o.subscribe(p(n,function(a){var c,l;try{for(var s=P(i),h=s.next();!h.done;h=s.next()){var d=h.value;d.next(a)}}catch(g){c={error:g}}finally{try{h&&!h.done&&(l=s.return)&&l.call(s)}finally{if(c)throw c.error}}var x=f-r+1;if(x>=0&&x%e===0&&i.shift().complete(),++f%e===0){var b=new I;i.push(b),n.next(b.asObservable())}},function(){for(;i.length>0;)i.shift().complete();n.complete()},function(a){for(;i.length>0;)i.shift().error(a);n.error(a)},function(){u=null,i=null}))})}function ci(r){for(var t,e,o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];var i=(t=k(o))!==null&&t!==void 0?t:C,u=(e=o[0])!==null&&e!==void 0?e:null,f=o[1]||1/0;return m(function(a,c){var l=[],s=!1,h=function(g){var S=g.window,T=g.subs;S.complete(),T.unsubscribe(),L(l,g),s&&d()},d=function(){if(l){var g=new j;c.add(g);var S=new I,T={window:S,subs:g,seen:0};l.push(T),c.next(S.asObservable()),R(g,i,function(){return h(T)},r)}};u!==null&&u>=0?R(c,i,d,u,!0):s=!0,d();var x=function(g){return l.slice().forEach(g)},b=function(g){x(function(S){var T=S.window;return g(T)}),g(c),c.unsubscribe()};return a.subscribe(p(c,function(g){x(function(S){S.window.next(g),f<=++S.seen&&h(S)})},function(){return b(function(g){return g.complete()})},function(g){return b(function(S){return S.error(g)})})),function(){l=null}})}function mi(r,t){return m(function(e,o){var n=[],i=function(u){for(;0<n.length;)n.shift().error(u);o.error(u)};v(r).subscribe(p(o,function(u){var f=new I;n.push(f);var a=new j,c=function(){L(n,f),f.complete(),a.unsubscribe()},l;try{l=v(t(u))}catch(s){i(s);return}o.next(f.asObservable()),a.add(l.subscribe(p(o,c,O,i)))},O)),e.subscribe(p(o,function(u){var f,a,c=n.slice();try{for(var l=P(c),s=l.next();!s.done;s=l.next()){var h=s.value;h.next(u)}}catch(d){f={error:d}}finally{try{s&&!s.done&&(a=l.return)&&a.call(l)}finally{if(f)throw f.error}}},function(){for(;0<n.length;)n.shift().complete();o.complete()},i,function(){for(;0<n.length;)n.shift().unsubscribe()}))})}function pi(r){return m(function(t,e){var o,n,i=function(f){o.error(f),e.error(f)},u=function(){n?.unsubscribe(),o?.complete(),o=new I,e.next(o.asObservable());var f;try{f=v(r())}catch(a){i(a);return}f.subscribe(n=p(e,u,u,i))};u(),t.subscribe(p(e,function(f){return o.next(f)},function(){o.complete(),e.complete()},i,function(){n?.unsubscribe(),o=null}))})}function li(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=$(r);return m(function(o,n){for(var i=r.length,u=new Array(i),f=r.map(function(){return!1}),a=!1,c=function(s){v(r[s]).subscribe(p(n,function(h){u[s]=h,!a&&!f[s]&&(f[s]=!0,(a=f.every(F))&&(f=null))},O))},l=0;l<i;l++)c(l);o.subscribe(p(n,function(s){if(a){var h=_([s],A(u));n.next(e?e.apply(void 0,_([],A(h))):h)}}))})}function si(r){return it(Lr,r)}function Ve(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return m(function(e,o){Lr.apply(void 0,_([e],A(r))).subscribe(o)})}function vi(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return Ve.apply(void 0,_([],A(r)))}export{tt as ArgumentOutOfRangeError,jr as AsyncSubject,yt as BehaviorSubject,mr as ConnectableObservable,M as EMPTY,D as EmptyError,Te as NEVER,Ft as NotFoundError,kr as Notification,Ot as NotificationKind,bt as ObjectUnsubscribedError,w as Observable,Tr as ReplaySubject,Yr as Scheduler,Tt as SequenceError,I as Subject,wr as Subscriber,j as Subscription,Ee as TimeoutError,Or as UnsubscriptionError,ye as VirtualAction,He as VirtualTimeScheduler,Ze as animationFrame,be as animationFrameScheduler,ze as animationFrames,$e as asap,le as asapScheduler,Rr as async,C as asyncScheduler,Lt as audit,qo as auditTime,vo as bindCallback,ho as bindNodeCallback,Do as buffer,Yo as bufferCount,zo as bufferTime,Go as bufferToggle,Ko as bufferWhen,Pe as catchError,Bo as combineAll,Pt as combineLatest,Wt as combineLatestAll,$o as combineLatestWith,er as concat,Vr as concatAll,ut as concatMap,Jo as concatMapTo,Zo as concatWith,G as config,Nr as connect,Ao as connectable,Xo as count,rn as debounce,tn as debounceTime,hr as defaultIfEmpty,dr as defer,en as delay,ft as delayWhen,on as dematerialize,nn as distinct,Yt as distinctUntilChanged,fn as distinctUntilKeyChanged,cn as elementAt,Xe as empty,mn as endWith,pn as every,ln as exhaust,zt as exhaustAll,at as exhaustMap,sn as expand,K as filter,vn as finalize,dn as find,hn as findIndex,xn as first,mo as firstValueFrom,An as flatMap,_o as forkJoin,N as from,Rt as fromEvent,Fe as fromEventPattern,Po as generate,bn as groupBy,F as identity,qt as ignoreElements,Co as iif,Mt as interval,yn as isEmpty,ao as isObservable,gn as last,co as lastValueFrom,Y as map,Dt as mapTo,wn as materialize,Sn as max,Ro as merge,vr as mergeAll,V as mergeMap,_n as mergeMapTo,En as mergeScan,On as mergeWith,In as min,Wr as multicast,Mo as never,O as noop,cr as observable,lr as observeOn,Mr as of,kt as onErrorResumeNext,Fn as onErrorResumeNextWith,Vo as pairs,Tn as pairwise,Lo as partition,Ir as pipe,jn as pluck,Pn as publish,Cn as publishBehavior,Rn as publishLast,Mn as publishReplay,Je as queue,de as queueScheduler,No as race,kn as raceWith,Wo as range,X as reduce,ht as refCount,Vn as repeat,Ln as repeatWhen,Nn as retry,Wn as retryWhen,Qt as sample,Un as sampleTime,qn as scan,_t as scheduled,Dn as sequenceEqual,$t as share,Yn as shareReplay,zn as single,Gn as skip,Kn as skipLast,Qn as skipUntil,Bn as skipWhile,$n as startWith,sr as subscribeOn,Jn as switchAll,nr as switchMap,Zn as switchMapTo,Hn as switchScan,or as take,Kt as takeLast,Xn as takeUntil,ri as takeWhile,ti as tap,Jt as throttle,ei as throttleTime,Et as throwError,xr as throwIfEmpty,oi as timeInterval,jt as timeout,ii as timeoutWith,z as timer,ui as timestamp,Nt as toArray,Uo as using,fi as window,ai as windowCount,ci as windowTime,mi as windowToggle,pi as windowWhen,li as withLatestFrom,Lr as zip,si as zipAll,vi as zipWith};