ix
Version: 
The Interactive Extensions for JavaScript
1 lines • 85.3 kB
JavaScript
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Ix",[],n):"object"==typeof exports?exports.Ix=n():t.Ix=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){"use strict";e.r(n);var r={};e.r(r),e.d(r,"IterableX",function(){return g}),e.d(r,"average",function(){return k}),e.d(r,"buffer",function(){return A}),e.d(r,"_case",function(){return W}),e.d(r,"_catch",function(){return R}),e.d(r,"_catchStatic",function(){return T}),e.d(r,"catchWith",function(){return U}),e.d(r,"chain",function(){return z}),e.d(r,"concat",function(){return J}),e.d(r,"concatAll",function(){return F}),e.d(r,"concatStatic",function(){return V}),e.d(r,"count",function(){return K}),e.d(r,"create",function(){return $}),e.d(r,"defaultIfEmpty",function(){return H}),e.d(r,"defer",function(){return B}),e.d(r,"distinct",function(){return et}),e.d(r,"distinctUntilChanged",function(){return ot}),e.d(r,"doWhile",function(){return st}),e.d(r,"elementAt",function(){return ct}),e.d(r,"empty",function(){return D}),e.d(r,"endWith",function(){return at}),e.d(r,"every",function(){return lt}),e.d(r,"except",function(){return yt}),e.d(r,"expand",function(){return pt}),e.d(r,"filter",function(){return wt}),e.d(r,"_finally",function(){return bt}),e.d(r,"find",function(){return St}),e.d(r,"findIndex",function(){return xt}),e.d(r,"first",function(){return gt}),e.d(r,"flatMap",function(){return It}),e.d(r,"flatten",function(){return Et}),e.d(r,"_for",function(){return Bt}),e.d(r,"generate",function(){return Dt}),e.d(r,"groupBy",function(){return Rt}),e.d(r,"groupJoin",function(){return qt}),e.d(r,"_if",function(){return Ut}),e.d(r,"ignoreElements",function(){return zt}),e.d(r,"includes",function(){return Ct}),e.d(r,"innerJoin",function(){return Vt}),e.d(r,"intersect",function(){return Xt}),e.d(r,"isEmpty",function(){return $t}),e.d(r,"last",function(){return Gt}),e.d(r,"map",function(){return Mt}),e.d(r,"max",function(){return Ht}),e.d(r,"maxBy",function(){return tn}),e.d(r,"memoize",function(){return on}),e.d(r,"min",function(){return un}),e.d(r,"minBy",function(){return sn}),e.d(r,"ofEntries",function(){return fn}),e.d(r,"ofKeys",function(){return ln}),e.d(r,"ofValues",function(){return yn}),e.d(r,"onErrorResumeNext",function(){return pn}),e.d(r,"orderBy",function(){return bn}),e.d(r,"orderByDescending",function(){return Sn}),e.d(r,"thenBy",function(){return xn}),e.d(r,"thenByDescending",function(){return gn}),e.d(r,"pairwise",function(){return In}),e.d(r,"partition",function(){return kn}),e.d(r,"pipe",function(){return En}),e.d(r,"pluck",function(){return An}),e.d(r,"publish",function(){return Bn}),e.d(r,"range",function(){return Dn}),e.d(r,"reduce",function(){return Wn}),e.d(r,"reduceRight",function(){return Ln}),e.d(r,"repeat",function(){return Rn}),e.d(r,"repeatStatic",function(){return Tn}),e.d(r,"retry",function(){return qn}),e.d(r,"reverse",function(){return Nn}),e.d(r,"scan",function(){return Cn}),e.d(r,"scanRight",function(){return Vn}),e.d(r,"sequenceEqual",function(){return Fn}),e.d(r,"share",function(){return Xn}),e.d(r,"single",function(){return $n}),e.d(r,"skip",function(){return Hn}),e.d(r,"skipLast",function(){return Yn}),e.d(r,"skipWhile",function(){return te}),e.d(r,"slice",function(){return ee}),e.d(r,"some",function(){return re}),e.d(r,"startWith",function(){return ie}),e.d(r,"sum",function(){return ue}),e.d(r,"take",function(){return ce}),e.d(r,"takeLast",function(){return ae}),e.d(r,"takeWhile",function(){return he}),e.d(r,"tap",function(){return de}),e.d(r,"_throw",function(){return _e}),e.d(r,"toArray",function(){return jn}),e.d(r,"toDOMStream",function(){return Fe}),e.d(r,"toMap",function(){return Ke}),e.d(r,"toSet",function(){return Xe}),e.d(r,"union",function(){return Ge}),e.d(r,"_while",function(){return ut}),e.d(r,"zip",function(){return Qe});var o={};e.r(o),e.d(o,"buffer",function(){return Ye}),e.d(o,"_catch",function(){return Ze}),e.d(o,"catchWith",function(){return tr}),e.d(o,"concat",function(){return nr}),e.d(o,"concatAll",function(){return er}),e.d(o,"defaultIfEmpty",function(){return rr}),e.d(o,"distinct",function(){return or}),e.d(o,"distinctUntilChanged",function(){return ir}),e.d(o,"doWhile",function(){return ur}),e.d(o,"endWith",function(){return sr}),e.d(o,"except",function(){return cr}),e.d(o,"expand",function(){return fr}),e.d(o,"filter",function(){return ar}),e.d(o,"_finally",function(){return lr}),e.d(o,"flatMap",function(){return hr}),e.d(o,"flatten",function(){return yr}),e.d(o,"groupBy",function(){return dr}),e.d(o,"groupJoin",function(){return pr}),e.d(o,"ignoreElements",function(){return _r}),e.d(o,"innerJoin",function(){return wr}),e.d(o,"intersect",function(){return mr}),e.d(o,"map",function(){return br}),e.d(o,"maxBy",function(){return Sr}),e.d(o,"memoize",function(){return xr}),e.d(o,"minBy",function(){return gr}),e.d(o,"onErrorResumeNext",function(){return vr}),e.d(o,"orderBy",function(){return Ir}),e.d(o,"orderByDescending",function(){return kr}),e.d(o,"pairwise",function(){return Mr}),e.d(o,"pluck",function(){return Br}),e.d(o,"publish",function(){return Or}),e.d(o,"repeat",function(){return Dr}),e.d(o,"retry",function(){return Wr}),e.d(o,"reverse",function(){return jr}),e.d(o,"scan",function(){return Lr}),e.d(o,"scanRight",function(){return Pr}),e.d(o,"share",function(){return Rr}),e.d(o,"skip",function(){return Tr}),e.d(o,"skipLast",function(){return qr}),e.d(o,"skipWhile",function(){return Ur}),e.d(o,"slice",function(){return Nr}),e.d(o,"startWith",function(){return zr}),e.d(o,"take",function(){return Cr}),e.d(o,"takeLast",function(){return Jr}),e.d(o,"takeWhile",function(){return Vr}),e.d(o,"tap",function(){return Fr}),e.d(o,"thenBy",function(){return Er}),e.d(o,"thenByDescending",function(){return Ar}),e.d(o,"toDOMStream",function(){return Kr}),e.d(o,"union",function(){return Xr}),e.d(o,"zip",function(){return $r});var i={};e.r(i),e.d(i,"AsyncIterableX",function(){return Se}),e.d(i,"asyncify",function(){return Gr}),e.d(i,"asyncifyErrback",function(){return Hr}),e.d(i,"average",function(){return Qr}),e.d(i,"batch",function(){return Zr}),e.d(i,"buffer",function(){return no}),e.d(i,"_case",function(){return uo}),e.d(i,"_catch",function(){return fo}),e.d(i,"_catchStatic",function(){return ao}),e.d(i,"catchWith",function(){return ho}),e.d(i,"chain",function(){return po}),e.d(i,"combineLatest",function(){return bo}),e.d(i,"concat",function(){return xo}),e.d(i,"concatAll",function(){return Io}),e.d(i,"concatStatic",function(){return go}),e.d(i,"count",function(){return ko}),e.d(i,"create",function(){return Be}),e.d(i,"debounce",function(){return Ao}),e.d(i,"defaultIfEmpty",function(){return Bo}),e.d(i,"defer",function(){return ro}),e.d(i,"distinct",function(){return Do}),e.d(i,"distinctUntilChanged",function(){return jo}),e.d(i,"doWhile",function(){return Ro}),e.d(i,"elementAt",function(){return To}),e.d(i,"empty",function(){return io}),e.d(i,"endWith",function(){return Uo}),e.d(i,"every",function(){return No}),e.d(i,"except",function(){return Co}),e.d(i,"expand",function(){return Vo}),e.d(i,"filter",function(){return Ko}),e.d(i,"_finally",function(){return $o}),e.d(i,"find",function(){return Go}),e.d(i,"findIndex",function(){return Ho}),e.d(i,"first",function(){return Qo}),e.d(i,"flatMap",function(){return Zo}),e.d(i,"flatten",function(){return ni}),e.d(i,"_for",function(){return oi}),e.d(i,"forkJoin",function(){return si}),e.d(i,"fromEvent",function(){return fi}),e.d(i,"fromEventPattern",function(){return ci}),e.d(i,"generate",function(){return li}),e.d(i,"generateTime",function(){return di}),e.d(i,"groupBy",function(){return bi}),e.d(i,"groupJoin",function(){return xi}),e.d(i,"_if",function(){return gi}),e.d(i,"ignoreElements",function(){return Ii}),e.d(i,"includes",function(){return ki}),e.d(i,"innerJoin",function(){return Ai}),e.d(i,"intersect",function(){return Oi}),e.d(i,"isEmpty",function(){return Di}),e.d(i,"last",function(){return Wi}),e.d(i,"map",function(){return ri}),e.d(i,"max",function(){return ji}),e.d(i,"maxBy",function(){return Ti}),e.d(i,"memoize",function(){return De}),e.d(i,"merge",function(){return zi}),e.d(i,"mergeAll",function(){return Ci}),e.d(i,"min",function(){return Ji}),e.d(i,"minBy",function(){return Vi}),e.d(i,"ofEntries",function(){return Ki}),e.d(i,"ofKeys",function(){return $i}),e.d(i,"ofValues",function(){return Hi}),e.d(i,"onErrorResumeNext",function(){return Yi}),e.d(i,"onErrorResumeNextStatic",function(){return Zi}),e.d(i,"orderBy",function(){return ru}),e.d(i,"orderByDescending",function(){return ou}),e.d(i,"thenBy",function(){return iu}),e.d(i,"thenByDescending",function(){return uu}),e.d(i,"pairwise",function(){return cu}),e.d(i,"partition",function(){return fu}),e.d(i,"pluck",function(){return au}),e.d(i,"publish",function(){return je}),e.d(i,"race",function(){return hu}),e.d(i,"range",function(){return du}),e.d(i,"reduce",function(){return pu}),e.d(i,"reduceRight",function(){return _u}),e.d(i,"repeat",function(){return mu}),e.d(i,"repeatStatic",function(){return bu}),e.d(i,"retry",function(){return Su}),e.d(i,"reverse",function(){return gu}),e.d(i,"scan",function(){return Iu}),e.d(i,"scanRight",function(){return Eu}),e.d(i,"sequenceEqual",function(){return Au}),e.d(i,"share",function(){return Bu}),e.d(i,"single",function(){return Ou}),e.d(i,"skip",function(){return Wu}),e.d(i,"skipLast",function(){return Lu}),e.d(i,"skipUntil",function(){return Ru}),e.d(i,"skipWhile",function(){return qu}),e.d(i,"slice",function(){return Nu}),e.d(i,"some",function(){return zu}),e.d(i,"startWith",function(){return Ju}),e.d(i,"sum",function(){return Vu}),e.d(i,"take",function(){return Ku}),e.d(i,"takeLast",function(){return $u}),e.d(i,"takeUntil",function(){return Hu}),e.d(i,"takeWhile",function(){return Yu}),e.d(i,"tap",function(){return es}),e.d(i,"throttle",function(){return os}),e.d(i,"timeInterval",function(){return us}),e.d(i,"timeout",function(){return ls}),e.d(i,"timestamp",function(){return ys}),e.d(i,"_throw",function(){return ps}),e.d(i,"toArray",function(){return tu}),e.d(i,"toDOMStream",function(){return Ve}),e.d(i,"toMap",function(){return _s}),e.d(i,"toObservable",function(){return Ss}),e.d(i,"toSet",function(){return xs}),e.d(i,"union",function(){return vs}),e.d(i,"_while",function(){return Po}),e.d(i,"zip",function(){return ks});var u={};function s(t,n,e){if(void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}function c(t){return t}async function f(t){return t}e.r(u),e.d(u,"buffer",function(){return Es}),e.d(u,"_catch",function(){return As}),e.d(u,"catchWith",function(){return Ms}),e.d(u,"concat",function(){return Bs}),e.d(u,"concatAll",function(){return Os}),e.d(u,"debounce",function(){return Ds}),e.d(u,"defaultIfEmpty",function(){return Ws}),e.d(u,"delay",function(){return Ls}),e.d(u,"delayEach",function(){return Rs}),e.d(u,"distinct",function(){return Ts}),e.d(u,"distinctUntilChanged",function(){return qs}),e.d(u,"doWhile",function(){return Us}),e.d(u,"endWith",function(){return Ns}),e.d(u,"except",function(){return zs}),e.d(u,"expand",function(){return Cs}),e.d(u,"filter",function(){return Js}),e.d(u,"_finally",function(){return Vs}),e.d(u,"flatMap",function(){return Fs}),e.d(u,"flatten",function(){return Ks}),e.d(u,"groupBy",function(){return Xs}),e.d(u,"groupJoin",function(){return $s}),e.d(u,"ignoreElements",function(){return Gs}),e.d(u,"innerJoin",function(){return Hs}),e.d(u,"intersect",function(){return Qs}),e.d(u,"map",function(){return Ys}),e.d(u,"maxBy",function(){return Zs}),e.d(u,"memoize",function(){return tc}),e.d(u,"merge",function(){return nc}),e.d(u,"mergeAll",function(){return ec}),e.d(u,"minBy",function(){return rc}),e.d(u,"onErrorResumeNext",function(){return oc}),e.d(u,"orderBy",function(){return ic}),e.d(u,"orderByDescending",function(){return uc}),e.d(u,"pairwise",function(){return fc}),e.d(u,"pluck",function(){return ac}),e.d(u,"publish",function(){return lc}),e.d(u,"repeat",function(){return hc}),e.d(u,"retry",function(){return yc}),e.d(u,"reverse",function(){return dc}),e.d(u,"scan",function(){return pc}),e.d(u,"scanRight",function(){return _c}),e.d(u,"share",function(){return wc}),e.d(u,"skip",function(){return mc}),e.d(u,"skipLast",function(){return bc}),e.d(u,"skipUntil",function(){return Sc}),e.d(u,"skipWhile",function(){return xc}),e.d(u,"slice",function(){return gc}),e.d(u,"startWith",function(){return vc}),e.d(u,"take",function(){return Ic}),e.d(u,"takeLast",function(){return kc}),e.d(u,"takeUntil",function(){return Ec}),e.d(u,"takeWhile",function(){return Ac}),e.d(u,"tap",function(){return Mc}),e.d(u,"thenBy",function(){return sc}),e.d(u,"thenByDescending",function(){return cc}),e.d(u,"throttle",function(){return Bc}),e.d(u,"timeInterval",function(){return Oc}),e.d(u,"timeout",function(){return Dc}),e.d(u,"timestamp",function(){return Wc}),e.d(u,"toDOMStream",function(){return jc}),e.d(u,"union",function(){return Lc}),e.d(u,"zip",function(){return Pc});const a=9007199254740991;function l(t){const n=function(t){const n=+t;return isNaN(n)?0:0!==n&&isFinite(n)?(n>0?1:-1)*Math.floor(Math.abs(n)):n}(t);return Math.min(Math.max(n,0),a)}const h=t=>"number"==typeof t,y=t=>"boolean"==typeof t,d=t=>"function"==typeof t,p=t=>null!=t&&Object(t)===t;function _(t){return p(t)&&h(t.length)}function w(t){return p(t)&&d(t[Symbol.iterator])}function m(t){return p(t)&&!d(t[Symbol.iterator])&&d(t.next)}function b(t){return p(t)&&d(t[Symbol.asyncIterator])}const S=t=>p(t)&&d(t.pipe)&&d(t._read)&&y(t.readable)&&p(t._readableState),x=t=>p(t)&&d(t.end)&&d(t._write)&&y(t.writable)&&p(t._writableState);class g{forEach(t,n){const e=s(t,n,2);let r=0;for(let o of this)e(o,r++)}pipe(...t){let n=-1,e=t.length,r=this,o=g.as;for(;++n<e;)r=o(t[n](r));return r}tee(){return this._getDOMStream().tee()}pipeTo(t,n){return this._getDOMStream().pipeTo(t,n)}pipeThrough(t,n){return this._getDOMStream().pipeThrough(t,n)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.publish().toDOMStream())}static as(t){return t instanceof g?t:"string"==typeof t?new I([t]):w(t)?new v(t,c):_(t)?new v(t,c):new I([t])}static from(t,n=c,e){const r=s(n,e,2);if(w(t))return new v(t,r);if(_(t))return new v(t,r);if(m(t))return new v({[Symbol.iterator]:()=>t},r);throw new TypeError("Input type not supported")}static of(...t){return new I(t)}}class v extends g{constructor(t,n){super(),this._source=t,this._fn=n}*[Symbol.iterator](){let t=0;if(w(this._source))for(let n of this._source)yield this._fn(n,t++);else{let n=l(this._source.length);for(;t<n;){let n=this._source[t];yield this._fn(n,t++)}}}}class I extends g{constructor(t){super(),this._args=t}*[Symbol.iterator](){yield*this._args}}try{(t=>{if(typeof window==="object"&&typeof document==="object"&&document.nodeType===9)return;const n=g.as;g.prototype.pipe=function(...t){let r,o,i=-1,u=t.length,s=this;for(;++i<u;)if("function"==typeof(o=t[i]))s=n(o(s));else if(x(o))return({end:r=!0}=t[i+1]||{}),S(s)?s.pipe(o,{end:r}):s.toNodeStream(e(o)).pipe(o,{end:r});return s};const e=(t,n=t._writableState||{objectMode:!0})=>n})()}catch(Tc){}function k(t,n=c){let e=0,r=0;for(let o of t)e+=n(o),r++;if(0===r)throw Error("Empty collection");return e/r}class E extends g{constructor(t,n,e){super(),this._source=t,this._count=n,this._skip=e}*[Symbol.iterator](){let t=[],n=0;for(let e of this._source){n%this._skip==0&&t.push([]);for(let n of t)n.push(e);t.length>0&&t[0].length===this._count&&(yield t.shift()),n++}for(;t.length>0;)yield t.shift()}}function A(t,n,e){return null==e&&(e=n),new E(t,n,e)}class M extends g{constructor(t){super(),this._fn=t}*[Symbol.iterator](){for(let t of this._fn())yield t}}function B(t){return new M(t)}class O extends g{*[Symbol.iterator](){}}function D(){return new O}function W(t,n,e=D()){return B(()=>{const r=t();return n.has(r)?n.get(r):e})}function j(t){"function"==typeof t.return&&t.return()}async function L(t){"function"==typeof t.return&&await t.return()}class P extends g{constructor(t){super(),this._source=t}*[Symbol.iterator](){let t=null,n=!1;for(let e of this._source){const r=e[Symbol.iterator]();for(t=null,n=!1;;){let e={};try{const{done:o,value:i}=r.next();if(o){j(r);break}e=i}catch(Tc){t=Tc,n=!0,j(r);break}yield e}if(!n)break}if(n)throw t}}function R(t,...n){return new P([t,...n])}function T(...t){return new P(t)}class q extends g{constructor(t,n){super(),this._source=t,this._handler=n}*[Symbol.iterator](){let t,n=!1,e=this._source[Symbol.iterator]();for(;;){let r={};try{if((r=e.next()).done){j(e);break}}catch(Tc){t=this._handler(Tc),n=!0,j(e);break}yield r.value}if(n)for(let r of t)yield r}}function U(t,n){return new q(t,n)}class N extends g{constructor(t){super(),this._result=t}[Symbol.iterator](){return this._result[Symbol.iterator]()}}function z(t,n){return new N(n(t))}class C extends g{constructor(t){super(),this._source=t}*[Symbol.iterator](){for(let t of this._source)yield*t}}function J(t,...n){return new C([t,...n])}function V(...t){return new C(t)}function F(t){return new C(t)}function K(t,n=(()=>!0)){let e=0;for(let r of t)n(r)&&e++;return e}class X extends g{constructor(t){super(),this._fn=t}[Symbol.iterator](){return this._fn()}}function $(t){return new X(t)}class G extends g{constructor(t,n){super(),this._source=t,this._defaultValue=n}*[Symbol.iterator](){let t=1;for(let n of this._source)t=2,yield n;1===t&&(yield this._defaultValue)}}function H(t,n){return new G(t,n)}function Q(t,n,e){for(let r=0,o=t.length;r<o;r++)if(e(n,t[r]))return r;return-1}async function Y(t,n,e){for(let r=0,o=t.length;r<o;r++)if(await e(n,t[r]))return r;return-1}function Z(t,n){return t===n||"number"==typeof t&&"number"==typeof n&&isNaN(t)&&isNaN(n)}async function tt(t,n){return t===n||"number"==typeof t&&"number"==typeof n&&isNaN(t)&&isNaN(n)}class nt extends g{constructor(t,n,e){super(),this._source=t,this._keySelector=n,this._cmp=e}*[Symbol.iterator](){let t=[];for(let n of this._source){let e=this._keySelector(n);-1===Q(t,e,this._cmp)&&(t.push(e),yield n)}}}function et(t,n=c,e=Z){return new nt(t,n,e)}class rt extends g{constructor(t,n,e){super(),this._source=t,this._keySelector=n,this._comparer=e}*[Symbol.iterator](){let t={},n=!1;for(let e of this._source){let r=this._keySelector(e),o=!1;n&&(o=this._comparer(t,r)),n&&o||(n=!0,t=r,yield e)}}}function ot(t,n=c,e=Z){return new rt(t,n,e)}class it extends g{constructor(t,n){super(),this._condition=t,this._source=n}*[Symbol.iterator](){for(;this._condition();)yield*this._source}}function ut(t,n){return new it(t,n)}function st(t,n){return V(t,ut(n,t))}function ct(t,n){for(let e of t){if(0===n)return e;n--}}class ft extends g{constructor(t,n){super(),this._source=t,this._args=n}*[Symbol.iterator](){for(let t of this._source)yield t;for(let t of this._args)yield t}}function at(t,...n){return new ft(t,n)}function lt(t,n){let e=0;for(let r of t)if(!n(r,e++))return!1;return!0}class ht extends g{constructor(t,n,e){super(),this._first=t,this._second=n,this._comparer=e}*[Symbol.iterator](){let t=[];for(let n of this._second)t.push(n);for(let n of this._first)-1===Q(t,n,this._comparer)&&(t.push(n),yield n)}}function yt(t,n,e=Z){return new ht(t,n,e)}class dt extends g{constructor(t,n){super(),this._source=t,this._fn=n}*[Symbol.iterator](){let t=[this._source];for(;t.length>0;){let n=t.shift();for(let e of n)t.push(this._fn(e)),yield e}}}function pt(t,n){return new dt(t,n)}class _t extends g{constructor(t,n){super(),this._source=t,this._predicate=n}*[Symbol.iterator](){let t=0;for(let n of this._source)this._predicate(n,t++)&&(yield n)}}function wt(t,n,e){return new _t(t,s(n,e,2))}class mt extends g{constructor(t,n){super(),this._source=t,this._action=n}*[Symbol.iterator](){try{yield*this._source}finally{this._action()}}}function bt(t,n){return new mt(t,n)}function St(t,n,e){if("function"!=typeof n)throw new TypeError;const r=s(n,e,2);let o=0;for(let i of t)if(r(i,o++))return i}function xt(t,n,e){if("function"!=typeof n)throw new TypeError;const r=s(n,e,2);let o=0;for(let i of t)if(r(i,o++))return o;return-1}function gt(t,n=(()=>!0)){let e=0;for(let r of t)if(n(r,e++))return r}class vt extends g{constructor(t,n){super(),this._source=t,this._fn=n}*[Symbol.iterator](){for(let t of this._source)for(let n of this._fn(t))yield n}}function It(t,n,e){return new vt(t,s(n,e,1))}class kt extends g{constructor(t,n){super(),this._source=t,this._depth=n}*_flatten(t,n){if(0!==n)for(let e of t)if(w(e))for(let t of this._flatten(e,n-1))yield t;else yield e;else for(let e of t)yield e}[Symbol.iterator](){return this._flatten(this._source,this._depth)[Symbol.iterator]()}}function Et(t,n=1/0){return new kt(t,n)}class At extends g{constructor(t,n){super(),this._source=t,this._selector=n}*[Symbol.iterator](){let t=0;for(let n of this._source)yield this._selector(n,t++)}}function Mt(t,n,e){return new At(t,s(n,e,2))}function Bt(t,n){return F(Mt(t,n))}class Ot extends g{constructor(t,n,e,r){super(),this._initialState=t,this._condition=n,this._iterate=e,this._resultSelector=r}*[Symbol.iterator](){for(let t=this._initialState;this._condition(t);t=this._iterate(t))yield this._resultSelector(t)}}function Dt(t,n,e,r){return new Ot(t,n,e,r)}function Wt(t,n,e){let r=new Map;for(let o of t){let t=n(o),i=r.get(t);r.has(t)||(i=[],r.set(t,i)),i.push(e(o))}return r}class jt extends g{constructor(t,n){super(),this.key=t,this._source=n}[Symbol.iterator](){return this._source[Symbol.iterator]()}}class Lt extends g{constructor(t,n,e,r){super(),this._source=t,this._keySelector=n,this._elementSelector=e,this._resultSelector=r}*[Symbol.iterator](){const t=Wt(this._source,this._keySelector,this._elementSelector);for(let[n,e]of t)yield this._resultSelector(n,e)}}function Pt(t,n){return new jt(t,n)}function Rt(t,n,e=c,r=Pt){return new Lt(t,n,e,r)}class Tt extends g{constructor(t,n,e,r,o){super(),this._outer=t,this._inner=n,this._outerSelector=e,this._innerSelector=r,this._resultSelector=o}*[Symbol.iterator](){const t=Wt(this._inner,this._innerSelector,c);for(let n of this._outer){const e=this._outerSelector(n),r=t.has(e)?t.get(e):D();yield this._resultSelector(n,r)}}}function qt(t,n,e,r,o){return new Tt(t,n,e,r,o)}function Ut(t,n,e=D()){return B(()=>t()?n:e)}class Nt extends g{constructor(t){super(),this._source=t}*[Symbol.iterator](){const t=this._source[Symbol.iterator]();for(;!t.next().done;);}}function zt(t){return new Nt(t)}function Ct(t,n,e=0){let r=0;Math.abs(e)&&(e=0);for(let o of t)if(r++>e&&Z(o,n))return!0;return!1}class Jt extends g{constructor(t,n,e,r,o){super(),this._outer=t,this._inner=n,this._outerSelector=e,this._innerSelector=r,this._resultSelector=o}*[Symbol.iterator](){const t=Wt(this._inner,this._innerSelector,c);for(let n of this._outer){const e=this._outerSelector(n);if(t.has(e))for(let r of t.get(e))yield this._resultSelector(n,r)}}}function Vt(t,n,e,r,o){return new Jt(t,n,e,r,o)}function Ft(t,n,e){let r=Q(t,n,e);return-1!==r&&(t.splice(r,1),!0)}class Kt extends g{constructor(t,n,e){super(),this._first=t,this._second=n,this._comparer=e}*[Symbol.iterator](){let t=[];for(let n of this._second)t.push(n);for(let n of this._first)Ft(t,n,this._comparer)&&(yield n)}}function Xt(t,n,e=Z){return new Kt(t,n,e)}function $t(t){for(let n of t)return!1;return!0}function Gt(t,n=(()=>!0)){let e,r=0;for(let o of t)n(o,r++)&&(e=o);return e}function Ht(t,n=c){let e=!1,r=-1/0;for(let o of t){e||(e=!0);let t=n(o);t>r&&(r=t)}if(!e)throw Error("Sequence contains no elements");return r}function Qt(t,n){return t>n?1:t<n?-1:0}class Yt extends g{constructor(t,n,e){super(),this._source=t,this._keyFn=n,this._cmp=e}*[Symbol.iterator](){let t,n=[];const e=this._source[Symbol.iterator]();if((t=e.next()).done)throw Error("Sequence contains no elements");let r=t.value,o=this._keyFn(r);for(n.push(r);!(t=e.next()).done;){let e=t.value,r=this._keyFn(e);const i=this._cmp(r,o);0===i?n.push(e):i>0&&(n=[e],o=r)}yield*n}}function Zt(t,n,e){return new Yt(t,n,e)}function tn(t,n,e=Qt){return Zt(t,n,e)}class nn{constructor(){this._list=[]}clear(){this._list=[]}get count(){return this._list.length}get(t){return this._list[t]}push(t){this._list.push(t)}done(){}}class en{constructor(t){this._count=0,this._readerCount=t,this._list=new Map}clear(){this._list.clear()}get count(){return this._count}get readerCount(){return this._readerCount}set readerCount(t){this._readerCount=t}done(){this._readerCount--}get(t){if(!this._list.has(t))throw Error("Element no longer available in the buffer.");const n=this._list.get(t),e=n.value;return 0==--n.count&&this._list.delete(t),e}push(t){this._list.set(this._count++,{value:t,count:this._readerCount})}}class rn extends g{constructor(t,n){super(),this._stopped=!1,this._source=t,this._buffer=n}*[Symbol.iterator](){let t=0;try{for(;;){let n=!1,e={};if(t>=this._buffer.count){if(!this._stopped)try{let t=this._source.next();(n=!t.done)&&(e=t.value)}catch(Tc){this._error=Tc,this._stopped=!0}if(this._stopped)throw this._error;n&&this._buffer.push(e)}else n=!0;if(!n)break;yield this._buffer.get(t),t++}}finally{this._buffer.done()}}}function on(t,n=-1,e){return e?$(()=>e(on(t,n))[Symbol.iterator]()):new rn(t[Symbol.iterator](),-1===n?new nn:new en(n))}function un(t,n=c){let e=!1,r=1/0;for(let o of t){e||(e=!0);let t=n(o);t<r&&(r=t)}if(!e)throw Error("Sequence contains no elements");return r}function sn(t,n,e=Qt){return Zt(t,n,(t,n)=>-e(t,n))}class cn extends g{constructor(t){super(),this._source=t}[Symbol.iterator](){return Mt(Object.keys(this._source),t=>(function(t,n){return[t,n]})(t,this._source[t]))[Symbol.iterator]()}}function fn(t){return new cn(t)}class an extends g{constructor(t){super(),this._source=t}[Symbol.iterator](){return Object.keys(this._source)[Symbol.iterator]()}}function ln(t){return new an(t)}class hn extends g{constructor(t){super(),this._source=t}[Symbol.iterator](){return Mt(Object.keys(this._source),t=>this._source[t])[Symbol.iterator]()}}function yn(t){return new hn(t)}class dn extends g{constructor(t){super(),this._source=t}*[Symbol.iterator](){for(let t of this._source){let n=t[Symbol.iterator]();for(;;){let t;try{t=n.next()}catch(Tc){break}if(t.done)break;yield t.value}}}}function pn(t,...n){return new dn([t,...n])}function _n(t,n){return t>n?1:t<n?-1:0}class wn extends g{constructor(t){super(),this._source=t}*[Symbol.iterator](){const t=Array.from(this._source),n=t.length,e=Array(n);for(let r=0,o=t.length;r<o;r++)e[r]=r;e.sort(this._getSorter(t));for(const r of e)yield t[r]}thenBy(t,n=_n){return new mn(this._source,t,n,!1,this)}thenByDescending(t,n=_n){return new mn(this._source,t,n,!0,this)}}class mn extends wn{constructor(t,n,e,r,o){super(t),this._keySelector=n,this._comparer=e,this._descending=r,this._parent=o}_getSorter(t,n){const e=t.map(this._keySelector),r=this._comparer,o=this._parent,i=this._descending,u=(t,o)=>{const u=r(e[t],e[o]);return 0===u?n?n(t,o):t-o:i?-u:u};return o?o._getSorter(t,u):u}}function bn(t,n,e=_n){return new mn(t,n,e,!1)}function Sn(t,n,e=_n){return new mn(t,n,e,!0)}function xn(t,n,e=_n){return new mn(t._source,n,e,!1,t)}function gn(t,n,e=_n){return new mn(t._source,n,e,!0,t)}class vn extends g{constructor(t){super(),this._source=t}*[Symbol.iterator](){let t,n=!1;for(const e of this._source)n?yield[t,e]:n=!0,t=e}}function In(t){return new vn(t)}function kn(t,n,e){return[wt(t,n,e),wt(t,(t,e)=>!n(t,e),e)]}function En(t,...n){if(0===n.length)return t instanceof g?t:g.from(t);return(t=>n.reduce((t,n)=>n(t),t))(t)}function An(t,...n){return Mt(t,(e=n,r=n.length,t=>{let n=t;for(let o=0;o<r;o++){const t=n[e[o]];if(void 0===t)return;n=t}return n}));var e,r}class Mn extends g{constructor(t){super(),this._stopped=!1,this._source=t,this._buffer=new en(0)}*_getIterable(t){try{for(;;){let n=!1,e={};if(t>=this._buffer.count){if(!this._stopped)try{let t=this._source.next();(n=!t.done)&&(e=t.value)}catch(Tc){this._error=Tc,this._stopped=!0}if(this._stopped){if(this._error)throw this._error;break}n&&this._buffer.push(e)}else n=!0;if(!n)break;yield this._buffer.get(t),t++}}finally{this._buffer.done()}}[Symbol.iterator](){return this._buffer.readerCount++,this._getIterable(this._buffer.count)[Symbol.iterator]()}}function Bn(t,n){return n?$(()=>n(Bn(t))[Symbol.iterator]()):new Mn(t[Symbol.iterator]())}class On extends g{constructor(t,n){super(),this._start=t,this._count=n}*[Symbol.iterator](){for(let t=this._start,n=this._start+this._count;t<n;t++)yield t}}function Dn(t,n){return new On(t,n)}function Wn(t,n,...e){const r=1===e.length;let o=0,i=!1,u=e[0];for(let s of t)i||(i=r)?u=n(u,s,o++):(u=s,i=!0,o++);if(!r&&!i)throw Error("Sequence contains no elements");return u}function jn(t){let n=[];for(let e of t)n.push(e);return n}function Ln(t,n,...e){const r=jn(t),o=1===e.length;let i=!1,u=e[0];for(let s=r.length-1;s>=0;s--){const t=r[s];i||(i=o)?u=n(u,t,s):(u=t,i=!0)}if(!o&&!i)throw Error("Sequence contains no elements");return u}class Pn extends g{constructor(t,n){super(),this._source=t,this._count=n}*[Symbol.iterator](){if(-1===this._count)for(;;)for(let t of this._source)yield t;else for(let t=0;t<this._count;t++)for(let n of this._source)yield n}}function Rn(t,n=-1){return new Pn(t,n)}function Tn(t,n=-1){return new Pn(g.of(t),n)}function qn(t,n=-1){return function(t){return new P(t)}(Tn(t,n))}class Un extends g{constructor(t){super(),this._source=t}*[Symbol.iterator](){let t=[];for(let n of this._source)t.unshift(n);yield*t}}function Nn(t){return new Un(t)}class zn extends g{constructor(t,n,e){super(),this._source=t,this._fn=n,this._hasSeed=1===e.length,this._seed=e[0]}*[Symbol.iterator](){let t=0,n=!1,e=this._seed;for(let r of this._source)n||(n=this._hasSeed)?(e=this._fn(e,r,t++),yield e):(e=r,n=!0,t++);1!==t||this._hasSeed||(yield e)}}function Cn(t,n,...e){return new zn(t,n,e)}class Jn extends g{constructor(t,n,e){super(),this._source=t,this._fn=n,this._hasSeed=1===e.length,this._seed=e[0]}*[Symbol.iterator](){let t=!1,n=this._seed;const e=jn(this._source);for(let r=e.length-1;r>=0;r--){const o=e[r];t||(t=this._hasSeed)?(n=this._fn(n,o,r),yield n):(n=o,t=!0)}}}function Vn(t,n,...e){return new Jn(t,n,e)}function Fn(t,n,e=Z){const r=t[Symbol.iterator](),o=n[Symbol.iterator]();let i,u;for(;!(i=r.next()).done;)if((u=o.next()).done||!e(i.value,u.value))return!1;return o.next().done}class Kn extends g{constructor(t){super(),this._it=t}[Symbol.iterator](){return this._it}}function Xn(t,n){return n?$(()=>n(new Kn(t[Symbol.iterator]()))[Symbol.iterator]()):new Kn(t[Symbol.iterator]())}function $n(t,n=(()=>!0)){let e,r=!1,o=0;for(let i of t){if(r&&n(i,o++))throw Error("More than one element was found");n(i,o++)&&(e=i,r=!0)}return e}class Gn extends g{constructor(t,n){super(),this._source=t,this._count=n}*[Symbol.iterator](){let t,n=this._source[Symbol.iterator](),e=this._count;for(;e>0&&!(t=n.next()).done;)e--;if(e<=0)for(;!(t=n.next()).done;)yield t.value}}function Hn(t,n){return new Gn(t,n)}class Qn extends g{constructor(t,n){super(),this._source=t,this._count=n}*[Symbol.iterator](){let t=[];for(let n of this._source)t.push(n),t.length>this._count&&(yield t.shift())}}function Yn(t,n){return new Qn(t,n)}class Zn extends g{constructor(t,n){super(),this._source=t,this._predicate=n}*[Symbol.iterator](){let t=!1,n=0;for(let e of this._source)t||this._predicate(e,n++)||(t=!0),t&&(yield e)}}function te(t,n){return new Zn(t,n)}class ne extends g{constructor(t,n,e){super(),this._source=t,this._begin=n,this._end=e}*[Symbol.iterator](){let t,n=this._source[Symbol.iterator](),e=this._begin;for(;e>0&&!(t=n.next()).done;)e--;let r=this._end;if(r>0)for(;!(t=n.next()).done&&(yield t.value,0!=--r););}}function ee(t,n,e=1/0){return new ne(t,n,e)}function re(t,n){let e=0;for(let r of t)if(n(r,e++))return!0;return!1}class oe extends g{constructor(t,n){super(),this._source=t,this._args=n}*[Symbol.iterator](){for(let t of this._args)yield t;for(let t of this._source)yield t}}function ie(t,...n){return new oe(t,n)}function ue(t,n=c){let e=0;for(let r of t)e+=n(r);return e}class se extends g{constructor(t,n){super(),this._source=t,this._count=n}*[Symbol.iterator](){let t=this._count;if(t>0)for(let n of this._source)if(yield n,0==--t)break}}function ce(t,n){return new se(t,n)}class fe extends g{constructor(t,n){super(),this._source=t,this._count=n}*[Symbol.iterator](){if(this._count>0){let t=[];for(let n of this._source)t.length>=this._count&&t.shift(),t.push(n);for(;t.length>0;)yield t.shift()}}}function ae(t,n){return new fe(t,n)}class le extends g{constructor(t,n){super(),this._source=t,this._predicate=n}*[Symbol.iterator](){let t=0;for(let n of this._source){if(!this._predicate(n,t++))break;yield n}}}function he(t,n){return new le(t,n)}class ye extends g{constructor(t,n){super(),this._source=t,this._observer=n}*[Symbol.iterator](){const t=this._source[Symbol.iterator]();for(;;){let n;try{if((n=t.next()).done)break}catch(Tc){throw this._observer.error&&this._observer.error(Tc),Tc}this._observer.next&&this._observer.next(n.value),yield n.value}this._observer.complete&&this._observer.complete()}}function de(t,n){return new ye(t,n)}class pe extends g{constructor(t){super(),this._error=t}*[Symbol.iterator](){throw this._error}}function _e(t){return new pe(t)}const we="value",me="error";class be{constructor(){this._ended=!1,this._values=[],this._resolvers=[]}[Symbol.asyncIterator](){return this}write(t){this._push({type:we,value:t})}error(t){this._push({type:me,error:t})}_push(t){if(this._ended)throw Error("AsyncSink already ended");if(this._resolvers.length>0){const{resolve:n,reject:e}=this._resolvers.shift();t.type===me?e(t.error):n({done:!1,value:t.value})}else this._values.push(t)}next(){if(this._values.length>0){const{type:t,value:n,error:e}=this._values.shift();return t===me?Promise.reject(e):Promise.resolve({done:!1,value:n})}return this._ended?Promise.resolve({done:!0}):new Promise((t,n)=>{this._resolvers.push({resolve:t,reject:n})})}end(){for(;this._resolvers.length>0;)this._resolvers.shift().resolve({done:!0});this._ended=!0}}class Se{async forEach(t,n){const e=s(t,n,2);let r=0;for await(let o of this)await e(o,r++)}pipe(...t){let n=-1,e=t.length,r=this,o=Se.as;for(;++n<e;)r=o(t[n](r));return r}tee(){return this._getDOMStream().tee()}pipeTo(t,n){return this._getDOMStream().pipeTo(t,n)}pipeThrough(t,n){return this._getDOMStream().pipeThrough(t,n)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.publish().toDOMStream())}static as(t){return t instanceof Se?t:"string"==typeof t?new Ae([t]):w(t)||b(t)?new ge(t,f):ke(t)?new ve(t,f):Ee(t)?new Ie(t,f):_(t)?new xe(t,f):new Ae([t])}static from(t,n=f,e){const r=s(n,e,2);if(w(t)||b(t))return new ge(t,r);if(ke(t))return new ve(t,r);if(Ee(t))return new Ie(t,r);if(_(t))return new xe(t,r);if(m(t))return new ge({[Symbol.asyncIterator]:()=>t},r);throw new TypeError("Input type not supported")}static of(...t){return new Ae(t)}}class xe extends Se{constructor(t,n){super(),this._source=t,this._selector=n}async*[Symbol.asyncIterator](){let t=0;const n=l(this._source.length);for(;t<n;)yield await this._selector(this._source[t],t++)}}class ge extends Se{constructor(t,n){super(),this._source=t,this._selector=n}async*[Symbol.asyncIterator](){let t=0;for await(let n of this._source)yield await this._selector(n,t++)}}class ve extends Se{constructor(t,n){super(),this._source=t,this._selector=n}async*[Symbol.asyncIterator](){const t=await this._source;yield await this._selector(t,0)}}class Ie extends Se{constructor(t,n){super(),this._observable=t,this._selector=n}async*[Symbol.asyncIterator](){const t=new be,n=this._observable.subscribe({next(n){t.write(n)},error(n){t.error(n)},complete(){t.end()}});let e=0;try{for(let n;!(n=await t.next()).done;)yield await this._selector(n.value,e++)}finally{n.unsubscribe()}}}function ke(t){return null!=t&&Object(t)===t&&"function"==typeof t.then}function Ee(t){return null!=t&&Object(t)===t&&"function"==typeof t.subscribe}class Ae extends Se{constructor(t){super(),this._args=t}async*[Symbol.asyncIterator](){for(let t of this._args)yield t}}try{(t=>{if(typeof window==="object"&&typeof document==="object"&&document.nodeType===9)return;const n=Se.as;Se.prototype.pipe=function(...t){let r,o,i=-1,u=t.length,s=this;for(;++i<u;)if("function"==typeof(o=t[i]))s=n(o(s));else if(x(o))return({end:r=!0}=t[i+1]||{}),S(s)?s.pipe(o,{end:r}):s.toNodeStream(e(o)).pipe(o,{end:r});return s};const e=(t,n=t._writableState||{objectMode:!0})=>n})()}catch(Tc){}class Me extends Se{constructor(t){super(),this._fn=t}async*[Symbol.asyncIterator](){let t,n=await this._fn();for(;!(t=await n.next()).done;)yield t.value}}function Be(t){return new Me(t)}class Oe extends Se{constructor(t,n){super(),this._error=null,this._shared=null,this._stopped=!1,this._source=t,this._buffer=n}[Symbol.asyncIterator](){return this._getIterable(0)}async*_getIterable(t=0){let n=t-1,e=!1,r=this._buffer;try{do{if(++n<r.count)yield r.get(n);else{if(this._stopped)throw this._error;null===this._shared&&(this._shared=this._source.next().then(t=>(this._shared=null,t.done||r.push(t.value),t))),({done:e}=await this._shared.catch(t=>{throw this._error=t,this._stopped=!0,t})),e||(yield r.get(n))}}while(!e)}finally{r.done()}}}function De(t,n=-1,e){return e?Be(()=>e(De(t,n))[Symbol.asyncIterator]()):new Oe(t[Symbol.asyncIterator](),-1===n?new nn:new en(n))}class We extends Oe{constructor(t){super(t,new en(0))}[Symbol.asyncIterator](){return this._buffer.readerCount++,this._getIterable(this._buffer.count)[Symbol.asyncIterator]()}}function je(t,n){return n?Be(async()=>n(je(t))[Symbol.asyncIterator]()):new We(t[Symbol.asyncIterator]())}Se.prototype.publish=function(t){return je(this,t)},Se.prototype.toDOMStream=function(t){return t?Ve(this,t):Ve(this)};const Le="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;class Pe extends Se{constructor(t){super(),this._stream=t}[Symbol.asyncIterator](){const t=this._stream,n=t.getReader();return Te(t,n,async function*(t){let n;for(;!(n=await t.read()).done;)yield n.value}(n))}}class Re extends Pe{[Symbol.asyncIterator](){let t,n=this._stream;try{t=n.getReader({mode:"byob"})}catch(Tc){return super[Symbol.asyncIterator]()}const e=Te(n,t,async function*(t){let n,e=yield null;for(;!(n=await qe(t,e,0)).done;)e=yield n.value}(t));return e.next(),e}}async function*Te(t,n,e){let r=!1;try{yield*e}catch(Tc){(r=!0)&&n&&await n.cancel(Tc)}finally{if(!n)return;if(r||await n.cancel(),t.locked)try{n.closed.catch(()=>{}),n.releaseLock()}catch(Tc){}}}async function qe(t,n,e){let r,o;if("number"==typeof n)o=new ArrayBuffer(r=n);else if(n instanceof ArrayBuffer)r=(o=n).byteLength;else{if(!(n instanceof Le))return{done:!0,value:void 0};r=(o=n).byteLength}return await async function t(n,e,r,o){if(r>=o)return{done:!1,value:new Uint8Array(e,0,o)};const{done:i,value:u}=await n.read(new Uint8Array(e,r,o-r));if((r+=u.byteLength)<o&&!i)return await t(n,u.buffer,r,o);return{done:i,value:new Uint8Array(u.buffer,0,r)}}(t,o,e,r)}function Ue(t,n){return n&&"byob"===n.mode?new Re(t):new Pe(t)}class Ne{constructor(t){this._source=t}async cancel(){const t=this._source;t&&t.return&&await t.return(),this._source=null}}class ze extends Ne{constructor(t){super(t)}async pull(t){const n=this._source;if(n){const e=await n.next(t.desiredSize);if(!e.done)return t.enqueue(e.value)}t.close()}}class Ce extends Ne{constructor(t,n={}){super(t),this.type="bytes",this.autoAllocateChunkSize=n.autoAllocateChunkSize,this.fallbackDefaultSource=new ze(t)}async pull(t){if(!t.byobRequest)return await this.fallbackDefaultSource.pull(t);if(this._source){const{view:n}=t.byobRequest,{done:e,value:r}=await this._source.next(n);if(!e){if("number"==typeof r)return t.byobRequest.respond(r);if(ArrayBuffer.isView(r))return r.buffer===n.buffer?t.byobRequest.respondWithNewView(r):t.byobRequest.respond(function(t,n,e=0,r=n.byteLength){const o=t.byteLength,i=new Uint8Array(t.buffer,t.byteOffset,o),u=new Uint8Array(n.buffer,n.byteOffset,Math.min(r,o,n.buffer.byteLength-n.byteOffset));return i.set(u,e),u.byteLength}(n,r))}}t.close()}}const Je=(()=>{let t,n,e=(o,i)=>{return t=class extends ReadableStream{[Symbol.asyncIterator](){return Ue(this,{mode:"byob"})[Symbol.asyncIterator]()}},n=class extends ReadableStream{[Symbol.asyncIterator](){return Ue(this)[Symbol.asyncIterator]()}},e=r,r(o,i)},r=(e,r)=>e instanceof Ce?new t(e,r):new n(e,r);return(t,n)=>e(t,n)})();function Ve(t,n){return n&&"type"in n&&"bytes"===n.type?Je(new Ce(t[Symbol.asyncIterator]()),n):Je(new ze(t[Symbol.asyncIterator]()),n)}function Fe(t,n){return n&&"type"in n&&n.type,Ve(Se.from(t),n)}function Ke(t,n,e){let r=new Map;for(let o of t){let t=e?e(o):o;r.set(n(o),t)}return r}function Xe(t){let n=new Set;for(let e of t)n.add(e);return n}g.prototype.publish=function(t){return Bn(this,t)},g.prototype.toDOMStream=function(t){return t?Fe(this,t):Fe(this)};class $e extends g{constructor(t,n,e){super(),this._left=t,this._right=n,this._comparer=e}*[Symbol.iterator](){let t=[];for(let n of this._left)-1===Q(t,n,this._comparer)&&(t.push(n),yield n);for(let n of this._right)-1===Q(t,n,this._comparer)&&(t.push(n),yield n)}}function Ge(t,n,e=Z){return new $e(t,n,e)}class He extends g{constructor(t,n){super(),this._sources=t,this._fn=n}*[Symbol.iterator](){const t=this._fn,n=this._sources.length,e=this._sources.map(t=>t[Symbol.iterator]());for(;n>0;){const r=Array(n);for(let t=-1;++t<n;){const n=e[t].next();if(n.done)return void e.forEach(j);r[t]=n.value}yield t(r)}}}function Qe(...t){let n=t.shift()||c;return n&&"function"!=typeof n&&(t.unshift(n),n=c),new He(t,n)}function Ye(t,n){return null==n&&(n=t),function(e){return new E(e,t,n)}}function Ze(...t){return function(n){return new P([n,...t])}}function tr(t){return function(n){return new q(n,t)}}function nr(...t){return function(n){return new C([n,...t])}}function er(){return function(t){return new C(t)}}function rr(t){return function(n){return new G(n,t)}}function or(t=c,n=Z){return function(e){return new nt(e,t,n)}}function ir(t=c,n=Z){return function(e){return new rt(e,t,n)}}function ur(t){return function(n){return V(n,ut(t,n))}}function sr(...t){return function(n){return new ft(n,t)}}function cr(t,n=Z){return function(e){return new ht(e,t,n)}}function fr(t){return function(n){return new dt(n,t)}}function ar(t,n){return function(e){return new _t(e,s(t,n,2))}}function lr(t){return function(n){return new mt(n,t)}}function hr(t,n){return function(e){return new vt(e,s(t,n,1))}}function yr(t=1/0){return function(n){return new kt(n,t)}}function dr(t,n=c,e=Pt){return function(r){return new Lt(r,t,n,e)}}function pr(t,n,e,r){return function(o){return new Tt(o,t,n,e,r)}}function _r(){return function(t){return new Nt(t)}}function wr(t,n,e,r){return function(o){return new Jt(o,t,n,e,r)}}function mr(t,n=Z){return function(e){return new Kt(e,t,n)}}function br(t,n){return function(e){return new At(e,s(t,n,2))}}function Sr(t,n=Qt){return function(e){return Zt(e,t,n)}}function xr(t=-1,n){return function(e){return on(e,t,n)}}function gr(t,n=Qt){return function(e){return Zt(e,t,(t,e)=>-n(t,e))}}function vr(...t){return function(n){return new dn([n,...t])}}function Ir(t,n=_n){return function(e){return new mn(e,t,n,!1)}}function kr(t,n=_n){return function(e){return new mn(e,t,n,!0)}}function Er(t,n=_n){return function(e){const r=e;return new mn(r._source,t,n,!1,r)}}function Ar(t,n=_n){return function(e){const r=e;return new mn(r._source,t,n,!0,r)}}function Mr(){return function(t){return new vn(t)}}function Br(...t){return function(n){return An(n,...t)}}function Or(t){return function(n){return Bn(n,t)}}function Dr(t=-1){return function(n){return new Pn(n,t)}}function Wr(t=-1){return function(n){return qn(n,t)}}function jr(){return function(t){return new Un(t)}}function Lr(t,...n){return function(e){return new zn(e,t,n)}}function Pr(t,...n){return function(e){return new Jn(e,t,n)}}function Rr(t){return function(n){return Xn(n,t)}}function Tr(t){return function(n){return new Gn(n,t)}}function qr(t){return function(n){return new Qn(n,t)}}function Ur(t){return function(n){return new Zn(n,t)}}function Nr(t,n=1/0){return function(e){return new ne(e,t,n)}}function zr(...t){return function(n){return new oe(n,t)}}function Cr(t){return function(n){return new se(n,t)}}function Jr(t){return function(n){return new fe(n,t)}}function Vr(t){return function(n){return new le(n,t)}}function Fr(t){return function(n){return new ye(n,t)}}function Kr(t){return function(n){return t&&"type"in t&&t.type,Fe(n,t)}}function Xr(t,n=Z){return function(e){return new $e(e,t,n)}}function $r(...t){return function(n){let e=t.shift()||c;return e&&"function"!=typeof e&&(t.unshift(e),e=c),new He([n,...t],e)}}function Gr(t){return function(...n){const e=new be,r=function(...t){e.write(1===t.length?t[0]:t),e.end()};try{t(...n.concat(r))}catch(Tc){e.error(Tc),e.end()}return De(async function*(){for(let t;!(t=await e.next()).done;)yield t.value}())}}function Hr(t){return function(...n){const e=new be,r=function(t,...n){t?(e.error(t),e.end()):(e.write(1===n.length?n[0]:n),e.end())};try{t(...n.concat(r))}catch(Tc){e.error(Tc),e.end()}return De(async function*(){for(let t;!(t=await e.next()).done;)yield t.value}())}}async function Qr(t,n=f){let e=0,r=0;for await(let o of t)e+=await n(o),r++;if(0===r)throw Error("Empty collection");return e/r}class Yr extends Se{constructor(t){super(),this._source=t}[Symbol.asyncIterator](){const t=this._source[Symbol.asyncIterator]();let n={type:"batching",values:[]},e=null;return function r(){t.next().then(t=>{if(t.done)e=Promise.resolve({done:!0}),"waiting"===n.type&&n.resolver.resolve(e);else{if("waiting"===n.type){const{resolve:e}=n.resolver;n={type:"batching",values:[]},e({done:t.done,value:[t.value]})}else"batching"===n.type?n.values.push(t.value):function(t){throw Error(`Unhandled discriminated union member ${t}`)}(n);r()}},t=>{if(e=Promise.reject(t),"waiting"===n.type){const{reject:e}=n.resolver;e(t)}})}(),{next(){if("batching"===n.type&&n.values.length>0){const{values:t}=n;return n.values=[],Promise.resolve({done:!1,value:t})}if(e)return e;if("waiting"===n.type)throw Error("Previous `next()` is still in progress");return new Promise((t,e)=>{n={type:"waiting",resolver:{resolve:t,reject:e}}})},return:n=>t.return?t.return(n).then(()=>({done:!0})):Promise.resolve({done:!0})}}}function Zr(t){return new Yr(t)}class to extends Se{constructor(t,n,e){super(),this._source=t,this._count=n,this._skip=e}async*[Symbol.asyncIterator](){let t=[],n=0;for await(let e of this._source){n%this._skip==0&&t.push([]);for(let n of t)n.push(e);t.length>0&&t[0].length===this._count&&(yield t.shift()),n++}for(;t.length>0;)yield t.shift()}}function no(t,n,e){return null==e&&(e=n),new to(t,n,e)}class eo extends Se{constructor(t){super(),this._fn=t}async*[Symbol.asyncIterator](){let t=await this._fn();for await(let n of t)yield n}}function ro(t){return new eo(t)}class oo extends Se{async*[Symbol.asyncIterator](){}}function io(){return new oo}function uo(t,n,e=io()){return ro(async()=>{const r=await t();return n.has(r)?n.get(r):e})}class so extends Se{constructor(t){super(),this._source=t}async*[Symbol.asyncIterator](){let t=null,n=!1;for(let e of this._source){const r=e[Symbol.asyncIterator]();for(t=null,n=!1;;){let e={};try{const{done:o,value:i}=await r.next();if(o){await L(r);break}e=i}catch(Tc){t=Tc,n=!0,await L(r);break}yield e}if(!n)break}if(n)throw t}}function co(t){return new so(t)}function fo(t,...n){return co([t,...n])}function ao(...t){return co(t)}class lo extends Se{constructor(t,n){super(),this._source=t,this._handler=n}async*[Symbol.asyncIterator](){let t,n=!1,e=this._source[Symbol.asyncIterator]();for(;;){let r={};try{if((r=await e.next()).done){await L(e);break}}catch(Tc){t=await this._handler(Tc),n=!0,await L(e);break}yield r.value}if(n)for await(let r of t)yield r}}function ho(t,n){return new lo(t,n)}class yo extends Se{constructor(t){super(),this._result=t}[Symbol.asyncIterator](){return this._result[Symbol.asyncIterator]()}}function po(t,n){return new yo(n(t))}const _o=new Promise(()=>{});function wo(t,n){return t.then(t=>({value:t,index:n}))}class mo extends Se{constructor(t,n){super(),this._sources=t,this._fn=n}async*[Symbol.asyncIterator](){const t=this._fn,n=this._sources.length,e=Array(n),r=Array(n);let o=!1;const i=Array(n),u=Array(n);let s=n;u.fill(!1);for(let c=0;c<n;c++){const t=this._sources[c][Symbol.asyncIterator]();e[c]=t,r[c]=wo(t.next(),c)}for(;s>0;){const n=Promise.race(r),{value:f,index:a}=await n;if(f.done)r[a]=_o,s--;else{i[a]=f.value,u[a]=!0;const n=e[a];r[a]=wo(n.next(),a),(o||(o=u.every(c)))&&(yield await t(i))}}}}function bo(...t){let n=t.shift()||f;return n&&"function"!=typeof n&&(t.unshift(n),n=f),new mo(t,n)}class So extends Se{constructor(t){super(),this._source=t}async*[Symbol.asyncIterator](){for(let t of this._source)for await(let n of t)yield n}}function xo(t,...n){return new So([t,...n])}function go(...t){return new So(t)}class vo extends Se{constructor(t){super(),this._source=t}async*[Symbol.asyncIterator](){for await(let t of this._source)for await(let n of t)