@micro-lc/preview 0.7.1 → 0.7.3-rc0
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.
- package/package.json +4 -3
- package/website/.vite/manifest.json +1 -1
- package/website/assets/{index-5hug6TwQ.js → index-S8G5Ak69.js} +52 -50
- package/website/assets/index-vqyfhyLF.js +97 -0
- package/website/development/.vite/manifest.json +1 -1
- package/website/development/assets/{index-rbglf7s6.js → index-Fs5pROqu.js} +2289 -819
- package/website/development/assets/{index-xE-oRO06.js → index-ISo-oWvS.js} +2292 -822
- package/website/development/index.html +1 -1
- package/website/development/service-worker.js +1195 -491
- package/website/index.html +1 -1
- package/website/service-worker.js +24 -3
- package/website/assets/index-7T1ZCqRR.js +0 -95
package/website/index.html
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
}
|
17
17
|
</style>
|
18
18
|
<script src="https://unpkg.com/zone.js"></script>
|
19
|
-
<script type="module" crossorigin src="./assets/index-
|
19
|
+
<script type="module" crossorigin src="./assets/index-vqyfhyLF.js"></script>
|
20
20
|
<link rel="stylesheet" crossorigin href="./assets/index-AYPpxqPP.css">
|
21
21
|
</head>
|
22
22
|
<body></body>
|
@@ -1,3 +1,24 @@
|
|
1
|
-
"use strict";(()=>{var
|
2
|
-
`+e.map(function(o
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function I(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var g=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 s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=E(s),f=a.next();!f.done;f=a.next()){var c=f.value;c.remove(this)}}catch(h){t={error:h}}finally{try{f&&!f.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else s.remove(this);var p=this.initialTeardown;if(u(p))try{p()}catch(h){i=h instanceof N?h.errors:[h]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var l=E(m),d=l.next();!d.done;d=l.next()){var x=d.value;try{yr(x)}catch(h){i=i??[],h instanceof N?i=_(_([],y(i)),y(h.errors)):i.push(h)}}}catch(h){o={error:h}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(o)throw o.error}}}if(i)throw new N(i)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)yr(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)&&I(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&I(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}();var Z=g.EMPTY;function z(r){return r instanceof g||r&&"closed"in r&&u(r.remove)&&u(r.add)&&u(r.unsubscribe)}function yr(r){u(r)?r():r.unsubscribe()}var w={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var k={setTimeout:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=k.delegate;return n?.setTimeout?n.setTimeout.apply(n,_([r,t],y(e))):setTimeout.apply(void 0,_([r,t],y(e)))},clearTimeout:function(r){var t=k.delegate;return(t?.clearTimeout||clearTimeout)(r)},delegate:void 0};function G(r){k.setTimeout(function(){var t=w.onUnhandledError;if(t)t(r);else throw r})}function rr(){}var xr=function(){return er("C",void 0,void 0)}();function _r(r){return er("E",void 0,r)}function gr(r){return er("N",r,void 0)}function er(r,t,e){return{kind:r,value:t,error:e}}var A=null;function C(r){if(w.useDeprecatedSynchronousErrorHandling){var t=!A;if(t&&(A={errorThrown:!1,error:null}),r(),t){var e=A,o=e.errorThrown,n=e.error;if(A=null,o)throw n}}else r()}function wr(r){w.useDeprecatedSynchronousErrorHandling&&A&&(A.errorThrown=!0,A.error=r)}var $=function(r){v(t,r);function t(e){var o=r.call(this)||this;return o.isStopped=!1,e?(o.destination=e,z(e)&&e.add(o)):o.destination=oe,o}return t.create=function(e,o,n){return new R(e,o,n)},t.prototype.next=function(e){this.isStopped?or(gr(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?or(_r(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?or(xr,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}(g);var re=Function.prototype.bind;function tr(r,t){return re.call(r,t)}var ee=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){K(o)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(o){K(o)}else K(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){K(e)}},r}(),R=function(r){v(t,r);function t(e,o,n){var i=r.call(this)||this,s;if(u(e)||!e)s={next:e??void 0,error:o??void 0,complete:n??void 0};else{var a;i&&w.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return i.unsubscribe()},s={next:e.next&&tr(e.next,a),error:e.error&&tr(e.error,a),complete:e.complete&&tr(e.complete,a)}):s=e}return i.destination=new ee(s),i}return t}($);function K(r){w.useDeprecatedSynchronousErrorHandling?wr(r):G(r)}function te(r){throw r}function or(r,t){var e=w.onStoppedNotification;e&&k.setTimeout(function(){return e(r,t)})}var oe={closed:!0,next:rr,error:te,complete:rr};var W=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Sr(r){return r}function Er(r){return r.length===0?Sr:r.length===1?r[0]:function(e){return r.reduce(function(o,n){return n(o)},e)}}var b=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=ie(t)?t:new R(t,e,o);return C(function(){var s=n,a=s.operator,f=s.source;i.add(a?a.call(i,f):f?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=Or(e),new e(function(n,i){var s=new R({next:function(a){try{t(a)}catch(f){i(f),s.unsubscribe()}},error:i,complete:n});o.subscribe(s)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[W]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Er(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Or(t),new t(function(o,n){var i;e.subscribe(function(s){return i=s},function(s){return n(s)},function(){return o(i)})})},r.create=function(t){return new r(t)},r}();function Or(r){var t;return(t=r??w.Promise)!==null&&t!==void 0?t:Promise}function ne(r){return r&&u(r.next)&&u(r.error)&&u(r.complete)}function ie(r){return r&&r instanceof $||ne(r)&&z(r)}function se(r){return u(r?.lift)}function M(r){return function(t){if(se(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 O(r,t,e,o,n){return new ae(r,t,e,o,n)}var ae=function(r){v(t,r);function t(e,o,n,i,s,a){var f=r.call(this,e)||this;return f.onFinalize=s,f.shouldUnsubscribe=a,f._next=o?function(c){try{o(c)}catch(p){e.error(p)}}:r.prototype._next,f._error=i?function(c){try{i(c)}catch(p){e.error(p)}finally{this.unsubscribe()}}:r.prototype._error,f._complete=n?function(){try{n()}catch(c){e.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,f}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}($);var Tr=j(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var nr=function(r){v(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 Mr(this,this);return o.operator=e,o},t.prototype._throwIfClosed=function(){if(this.closed)throw new Tr},t.prototype.next=function(e){var o=this;C(function(){var n,i;if(o._throwIfClosed(),!o.isStopped){o.currentObservers||(o.currentObservers=Array.from(o.observers));try{for(var s=E(o.currentObservers),a=s.next();!a.done;a=s.next()){var f=a.value;f.next(e)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var o=this;C(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;C(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,s=n.isStopped,a=n.observers;return i||s?Z:(this.currentObservers=null,a.push(e),new g(function(){o.currentObservers=null,I(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var o=this,n=o.hasError,i=o.thrownError,s=o.isStopped;n?e.error(i):s&&e.complete()},t.prototype.asObservable=function(){var e=new b;return e.source=this,e},t.create=function(e,o){return new Mr(e,o)},t}(b);var Mr=function(r){v(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:Z},t}(nr);var V={now:function(){return(V.delegate||Date).now()},delegate:void 0};var F=function(r){v(t,r);function t(e,o,n){e===void 0&&(e=1/0),o===void 0&&(o=1/0),n===void 0&&(n=V);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,s=o._infiniteTimeWindow,a=o._timestampProvider,f=o._windowTime;n||(i.push(e),!s&&i.push(a.now()+f)),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,s=n._buffer,a=s.slice(),f=0;f<a.length&&!e.closed;f+=i?1:2)e.next(a[f]);return this._checkFinalizedStatuses(e),o},t.prototype._trimBuffer=function(){var e=this,o=e._bufferSize,n=e._timestampProvider,i=e._buffer,s=e._infiniteTimeWindow,a=(s?1:2)*o;if(o<1/0&&a<i.length&&i.splice(0,i.length-a),!s){for(var f=n.now(),c=0,p=1;p<i.length&&i[p]<=f;p+=2)c=p;c&&i.splice(0,c+1)}},t}(nr);var Pr=function(r){v(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}(g);var q={setInterval:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=q.delegate;return n?.setInterval?n.setInterval.apply(n,_([r,t],y(e))):setInterval.apply(void 0,_([r,t],y(e)))},clearInterval:function(r){var t=q.delegate;return(t?.clearInterval||clearInterval)(r)},delegate:void 0};var Ir=function(r){v(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,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,o)),this.pending=!0,this.delay=o,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(s,this.id,o),this},t.prototype.requestAsyncId=function(e,o,n){return n===void 0&&(n=0),q.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&&q.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(s){n=!0,i=s||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,I(i,this),o!=null&&(this.id=this.recycleAsyncId(n,o,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},t}(Pr);var ir=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=V.now,r}();var Ar=function(r){v(t,r);function t(e,o){o===void 0&&(o=ir.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}(ir);var sr=new Ar(Ir),jr=sr;var kr=new b(function(r){return r.complete()});function Cr(r){return r&&u(r.schedule)}var J=function(r){return r&&typeof r.length=="number"&&typeof r!="function"};function Rr(r){return u(r?.then)}function Wr(r){return u(r[W])}function Fr(r){return Symbol.asyncIterator&&u(r?.[Symbol.asyncIterator])}function Ur(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 ce(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Lr=ce();function Dr(r){return u(r?.[Lr])}function $r(r){return vr(this,arguments,function(){var e,o,n,i;return B(this,function(s){switch(s.label){case 0:e=r.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,P(e.read())];case 3:return o=s.sent(),n=o.value,i=o.done,i?[4,P(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,P(n)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Vr(r){return u(r?.getReader)}function U(r){if(r instanceof b)return r;if(r!=null){if(Wr(r))return fe(r);if(J(r))return ue(r);if(Rr(r))return pe(r);if(Fr(r))return qr(r);if(Dr(r))return le(r);if(Vr(r))return me(r)}throw Ur(r)}function fe(r){return new b(function(t){var e=r[W]();if(u(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ue(r){return new b(function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()})}function pe(r){return new b(function(t){r.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,G)})}function le(r){return new b(function(t){var e,o;try{for(var n=E(r),i=n.next();!i.done;i=n.next()){var s=i.value;if(t.next(s),t.closed)return}}catch(a){e={error:a}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}t.complete()})}function qr(r){return new b(function(t){de(r,t).catch(function(e){return t.error(e)})})}function me(r){return qr($r(r))}function de(r,t){var e,o,n,i;return hr(this,void 0,void 0,function(){var s,a;return B(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),e=br(r),f.label=1;case 1:return[4,e.next()];case 2:if(o=f.sent(),!!o.done)return[3,4];if(s=o.value,t.next(s),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=f.sent(),n={error:a},[3,11];case 6:return f.trys.push([6,,9,10]),o&&!o.done&&(i=e.return)?[4,i.call(e)]:[3,8];case 7:f.sent(),f.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 Hr(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}var Yr=j(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function ar(r,t){var e=typeof t=="object";return new Promise(function(o,n){var i=new R({next:function(s){o(s),i.unsubscribe()},error:n,complete:function(){e?o(t.defaultValue):n(new Yr)}});r.subscribe(i)})}function Br(r){return r instanceof Date&&!isNaN(r)}function T(r,t){return M(function(e,o){var n=0;e.subscribe(O(o,function(i){o.next(r.call(t,i,n++))}))})}var he=Array.isArray;function ve(r,t){return he(t)?r.apply(void 0,_([],y(t))):r(t)}function Nr(r){return T(function(t){return ve(r,t)})}function zr(r,t,e,o,n,i,s,a){var f=[],c=0,p=0,m=!1,l=function(){m&&!f.length&&!c&&t.complete()},d=function(h){return c<o?x(h):f.push(h)},x=function(h){i&&t.next(h),c++;var dr=!1;U(e(h,p++)).subscribe(O(t,function(D){n?.(D),i?d(D):t.next(D)},function(){dr=!0},void 0,function(){if(dr)try{c--;for(var D=function(){var Y=f.shift();s?Hr(t,s,function(){return x(Y)}):x(Y)};f.length&&c<o;)D();l()}catch(Y){t.error(Y)}}))};return r.subscribe(O(t,d,function(){m=!0,l()})),function(){a?.()}}function cr(r,t,e){return e===void 0&&(e=1/0),u(t)?cr(function(o,n){return T(function(i,s){return t(o,i,n,s)})(U(r(o,n)))},e):(typeof t=="number"&&(e=t),M(function(o,n){return zr(o,n,r,e)}))}var be=["addListener","removeListener"],ye=["addEventListener","removeEventListener"],xe=["on","off"];function H(r,t,e,o){if(u(e)&&(o=e,e=void 0),o)return H(r,t,e).pipe(Nr(o));var n=y(we(r)?ye.map(function(a){return function(f){return r[a](t,f,e)}}):_e(r)?be.map(Gr(r,t)):ge(r)?xe.map(Gr(r,t)):[],2),i=n[0],s=n[1];if(!i&&J(r))return cr(function(a){return H(a,t,e)})(U(r));if(!i)throw new TypeError("Invalid event target");return new b(function(a){var f=function(){for(var c=[],p=0;p<arguments.length;p++)c[p]=arguments[p];return a.next(1<c.length?c:c[0])};return i(f),function(){return s(f)}})}function Gr(r,t){return function(e){return function(o){return r[e](t,o)}}}function _e(r){return u(r.addListener)&&u(r.removeListener)}function ge(r){return u(r.on)&&u(r.off)}function we(r){return u(r.addEventListener)&&u(r.removeEventListener)}function Kr(r,t,e){r===void 0&&(r=0),e===void 0&&(e=jr);var o=-1;return t!=null&&(Cr(t)?e=t:o=t),new b(function(n){var i=Br(r)?+r-e.now():r;i<0&&(i=0);var s=0;return e.schedule(function(){n.closed||(n.next(s++),0<=o?this.schedule(void 0,o):n.complete())},i)})}function fr(r,t){return r===void 0&&(r=0),t===void 0&&(t=sr),r<0&&(r=0),Kr(r,r,t)}function S(r,t){return M(function(e,o){var n=0;e.subscribe(O(o,function(i){return r.call(t,i,n++)&&o.next(i)}))})}function L(r){return r<=0?function(){return kr}:M(function(t,e){var o=0;t.subscribe(O(e,function(n){++o<=r&&(e.next(n),r<=o&&e.complete())}))})}var Jr=(r,t)=>e=>({postMessage:o=>{let{errorCatcher:n=()=>()=>{},...i}=t??{};r.clients.get(e).then(s=>s?.postMessage(o,i)).catch(n(e,o))}});var Qr=(r=>(r.Ack="ack",r.Syn="syn",r))(Qr||{}),Se=Object.values(Qr),ur=r=>r.data,pr=r=>t=>t.type===r.toString(),Ee=r=>{let t=r.data;return typeof t=="object"&&t!==null&&"type"in t&&typeof t.type=="string"&&"instance"in t&&typeof t.instance=="string"&&"content"in t},Oe=()=>{let r="#";for(let t=0;t<3;t++)r+=`0${Math.floor(Math.random()*Math.pow(16,2)/2).toString(16)}`.slice(-2);return r},Te=class{__generateId;__instance;__colors;__listener;__log;__receiver;__subscription;__okToWrite;__write$;__recv$;__connect(r,t){let e=fr(t).subscribe(()=>this.__receiver.postMessage({content:r,instance:r,type:"syn"}));this.__subscription.add(e),this.__subscription.add(this.__recv$.pipe(T(ur),S(pr("ack")),S(({content:o})=>o===r),L(1)).subscribe(({instance:o})=>{this.__okToWrite.next(0),this.__subscription.add(this.__recv$.pipe(S(({data:{type:n,instance:i}})=>!Se.includes(n)&&i===o)).subscribe(n=>{this.__listener(n);let{data:i}=n;i._id!==void 0&&this.__receiver.postMessage({...i,content:i,instance:r,type:"ack"})})),e.unsubscribe()})),this.__subscription.add(this.__recv$.pipe(T(ur),S(pr("syn")),S(({instance:o})=>o!==r),L(1)).subscribe(({content:o})=>{this.__receiver.postMessage({content:o,instance:r,type:"ack"})}))}__write(r,t){let e={};t!==void 0&&(e._id=t),this.__subscription.add(this.__write$.subscribe(()=>{let o=Object.assign(r,{instance:this.__instance,...e});this.__receiver.postMessage(o),this.__log?.(o)}))}constructor(r,t,e,o){this.__generateId=()=>globalThis.crypto.randomUUID();let n=this.__generateId(),i=new F,s=H(t,"message").pipe(S(Ee)).subscribe(i);this.__subscription=new g,this.__subscription.add(s),this.__okToWrite=new F(1),this.__write$=this.__okToWrite.pipe(L(1)),this.__recv$=i.asObservable(),this.__listener=r,this.__log=o?.log&&o.log.bind(this),this.__instance=n;let a=Oe();this.__colors={bg:`${a}22`,fg:a},this.__receiver=e,this.__connect(n,o?.period?o.period:10)}disconnect(){this.__subscription.unsubscribe()}send(r){this.__write(r)}ackSend(r){let t,e=new Promise(n=>{t=n}),o=this.__generateId();return this.__subscription.add(this.__recv$.pipe(T(ur),S(pr("ack")),S(({_id:n})=>n===o),L(1)).subscribe(()=>t())),this.__write(r,o),e}get instance(){return this.__instance}get colors(){return this.__colors}get ready(){return ar(this.__write$).then(()=>{})}},Xr=Te;var Q=new Map,lr=new Map,mr=new Map,Zr=(r,t)=>{let e=t.keys(),o,{done:n=!1,value:i}=e.next();for(;!n&&o===void 0;){i!==void 0&&r.startsWith(i)&&(o=i,n=!0);let{value:s,done:a=!1}=e.next();n=a,i=s}return o},Me=r=>r!==null&&"id"in r,Pe=r=>t=>console.error(`[SW]: error on ${r} - ${String(t)}`),Ie=Jr(self,{errorCatcher:Pe}),Ae=r=>function({data:e}){let o=e;switch(o.type){case"set-source-map":{let{content:n}=o,i=Object.entries(n).reduce((s,[a,f])=>{let{clientSourceMap:c,clientTosMap:p}=s,{headers:m={}}=f;return Object.keys(m).length>0&&p.set(encodeURI(f.to),m),c.set(encodeURI(a),f),s},{clientSourceMap:new Map,clientTosMap:new Map});lr.set(r,i.clientSourceMap),mr.set(r,i.clientTosMap);break}case"unload-client":{lr.delete(r),mr.delete(r),Q.delete(r),this.disconnect();break}default:break}},je=r=>{let t=new Map,e=new F,o={addEventListener(n,i){t.set(i,e.subscribe(s=>i(s)))},removeEventListener(n,i){t.get(i)?.unsubscribe(),t.delete(i)}};return{buffer:e,channel:new Xr(Ae(r),o,Ie(r))}},ke=r=>{let t=Q.get(r);return t||(t=je(r),Q.set(r,t)),t};self.addEventListener("install",()=>{self.skipWaiting().catch(r=>console.error(`[SW] error while skipWaiting - ${String(r)}`))});self.addEventListener("activate",r=>{r.waitUntil(self.clients.claim())});self.addEventListener("message",r=>{let{source:t}=r;if(!Me(t))return;let{id:e}=t;ke(e).buffer.next(r)});self.addEventListener("fetch",r=>{let t=r.clientId!==""?r.clientId:r.resultingClientId,e=lr.get(t);if(!e)return r.respondWith(self.fetch(r.request));let o=mr.get(t),{request:{url:n}}=r,i=Zr(n,e),s=Zr(n,o),a=new Headers(r.request.headers),f={};if(i!==void 0){let m=e.get(i)?.to,l=e.get(i)?.headers??{},d=n.substring(i.length);f=e.get(i)?.query??{},n=`${m}${d}`,Object.entries(l).forEach(([x,h])=>a.set(x,h))}if(s!==void 0){let m=o.get(s)??{};Object.entries(m).forEach(([l,d])=>a.set(l,d))}let c;try{let m=new URL(n);Object.entries(f).forEach(([l,d])=>m.searchParams.set(l,d)),c=m.href}catch{c=n}let p=Q.get(t)?.channel;r.respondWith(self.fetch(c,{...r.request,headers:a}).catch(m=>(console.error(m),Promise.reject(m))))});})();
|
1
|
+
"use strict";(()=>{var S=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var sr=(r=>typeof S<"u"?S:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof S<"u"?S:t)[e]}):r)(function(r){if(typeof S<"u")return S.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),ne=function(r,t){return ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},ne(r,t)};function w(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ne(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function ar(r,t,e,n){function o(i){return i instanceof e?i:new e(function(s){s(i)})}return new(e||(e=Promise))(function(i,s){function a(l){try{u(n.next(l))}catch(h){s(h)}}function c(l){try{u(n.throw(l))}catch(h){s(h)}}function u(l){l.done?i(l.value):o(l.value).then(a,c)}u((n=n.apply(r,t||[])).next())})}function Ce(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(e=0)),e;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1],i=u;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(u);break}i[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function I(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(s)throw s.error}}return i}function M(r,t,e){if(e||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return r.concat(i||Array.prototype.slice.call(t))}function P(r){return this instanceof P?(this.v=r,this):new P(r)}function cr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),o,i=[];return o={},a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(f){return function(y){return Promise.resolve(y).then(f,h)}}function a(f,y){n[f]&&(o[f]=function(p){return new Promise(function(or,ir){i.push([f,p,or,ir])>1||c(f,p)})},y&&(o[f]=y(o[f])))}function c(f,y){try{u(n[f](y))}catch(p){d(i[0][3],p)}}function u(f){f.value instanceof P?Promise.resolve(f.value.v).then(l,h):d(i[0][2],f)}function l(f){c("next",f)}function h(f){c("throw",f)}function d(f,y){f(y),i.shift(),i.length&&c(i[0][0],i[0][1])}}function ur(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 I=="function"?I(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=r[i]&&function(s){return new Promise(function(a,c){s=r[i](s),o(a,c,s.done,s.value)})}}function o(i,s,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},s)}}function m(r){return typeof r=="function"}function ie(r){var t=function(n){Error.call(n),n.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var X=ie(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
|
2
|
+
`+e.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function V(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var A=function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=I(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(p){t={error:p}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else s.remove(this);var l=this.initialTeardown;if(m(l))try{l()}catch(p){i=p instanceof X?p.errors:[p]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var d=I(h),f=d.next();!f.done;f=d.next()){var y=f.value;try{Oe(y)}catch(p){i=i??[],p instanceof X?i=M(M([],j(i)),j(p.errors)):i.push(p)}}}catch(p){n={error:p}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}}if(i)throw new X(i)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Oe(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)&&V(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&V(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}(),We=A.EMPTY;function Ue(r){return r instanceof A||r&&"closed"in r&&m(r.remove)&&m(r.add)&&m(r.unsubscribe)}function Oe(r){m(r)?r():r.unsubscribe()}var T={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},B={setTimeout:function(r,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var o=B.delegate;return o?.setTimeout?o.setTimeout.apply(o,M([r,t],j(e))):setTimeout.apply(void 0,M([r,t],j(e)))},clearTimeout:function(r){var t=B.delegate;return(t?.clearTimeout||clearTimeout)(r)},delegate:void 0};function Re(r){B.setTimeout(function(){var t=T.onUnhandledError;if(t)t(r);else throw r})}function Pe(){}var fr=function(){return se("C",void 0,void 0)}();function lr(r){return se("E",void 0,r)}function pr(r){return se("N",r,void 0)}function se(r,t,e){return{kind:r,value:t,error:e}}var E=null;function q(r){if(T.useDeprecatedSynchronousErrorHandling){var t=!E;if(t&&(E={errorThrown:!1,error:null}),r(),t){var e=E,n=e.errorThrown,o=e.error;if(E=null,n)throw o}}else r()}function hr(r){T.useDeprecatedSynchronousErrorHandling&&E&&(E.errorThrown=!0,E.error=r)}var ae=function(r){w(t,r);function t(e){var n=r.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Ue(e)&&e.add(n)):n.destination=vr,n}return t.create=function(e,n,o){return new H(e,n,o)},t.prototype.next=function(e){this.isStopped?ee(pr(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?ee(lr(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?ee(fr,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}(A),dr=Function.prototype.bind;function Z(r,t){return dr.call(r,t)}var mr=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(n){$(n)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){$(n)}else $(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){$(e)}},r}(),H=function(r){w(t,r);function t(e,n,o){var i=r.call(this)||this,s;if(m(e)||!e)s={next:e??void 0,error:n??void 0,complete:o??void 0};else{var a;i&&T.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return i.unsubscribe()},s={next:e.next&&Z(e.next,a),error:e.error&&Z(e.error,a),complete:e.complete&&Z(e.complete,a)}):s=e}return i.destination=new mr(s),i}return t}(ae);function $(r){T.useDeprecatedSynchronousErrorHandling?hr(r):Re(r)}function yr(r){throw r}function ee(r,t){var e=T.onStoppedNotification;e&&B.setTimeout(function(){return e(r,t)})}var vr={closed:!0,next:Pe,error:yr,complete:Pe},ce=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function br(r){return r}function _r(r){return r.length===0?br:r.length===1?r[0]:function(e){return r.reduce(function(n,o){return o(n)},e)}}var _=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,n){var o=this,i=wr(t)?t:new H(t,e,n);return q(function(){var s=o,a=s.operator,c=s.source;i.add(a?a.call(i,c):c?o._subscribe(i):o._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 n=this;return e=Ie(e),new e(function(o,i){var s=new H({next:function(a){try{t(a)}catch(c){i(c),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[ce]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return _r(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Ie(t),new t(function(n,o){var i;e.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(t){return new r(t)},r}();function Ie(r){var t;return(t=r??T.Promise)!==null&&t!==void 0?t:Promise}function xr(r){return r&&m(r.next)&&m(r.error)&&m(r.complete)}function wr(r){return r&&r instanceof ae||xr(r)&&Ue(r)}function gr(r){return m(r?.lift)}function ue(r){return function(t){if(gr(t))return t.lift(function(e){try{return r(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function fe(r,t,e,n,o){return new Sr(r,t,e,n,o)}var Sr=function(r){w(t,r);function t(e,n,o,i,s,a){var c=r.call(this,e)||this;return c.onFinalize=s,c.shouldUnsubscribe=a,c._next=n?function(u){try{n(u)}catch(l){e.error(l)}}:r.prototype._next,c._error=i?function(u){try{i(u)}catch(l){e.error(l)}finally{this.unsubscribe()}}:r.prototype._error,c._complete=o?function(){try{o()}catch(u){e.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(ae),Er=ie(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),le=function(r){w(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 n=new je(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Er},t.prototype.next=function(e){var n=this;q(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=I(n.currentObservers),a=s.next();!a.done;a=s.next()){var c=a.value;c.next(e)}}catch(u){o={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},t.prototype.error=function(e){var n=this;q(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var o=n.observers;o.length;)o.shift().error(e)}})},t.prototype.complete=function(){var e=this;q(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.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 n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?We:(this.currentObservers=null,a.push(e),new A(function(){n.currentObservers=null,V(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?e.error(i):s&&e.complete()},t.prototype.asObservable=function(){var e=new _;return e.source=this,e},t.create=function(e,n){return new je(e,n)},t}(_),je=function(r){w(t,r);function t(e,n){var o=r.call(this)||this;return o.destination=e,o.source=n,o}return t.prototype.next=function(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,e)},t.prototype.error=function(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&o!==void 0?o:We},t}(le),pe={now:function(){return(pe.delegate||Date).now()},delegate:void 0},Tr=function(r){w(t,r);function t(e,n,o){e===void 0&&(e=1/0),n===void 0&&(n=1/0),o===void 0&&(o=pe);var i=r.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(e){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;o||(i.push(e),!s&&i.push(a.now()+c)),this._trimBuffer(),r.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(e),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),c=0;c<a.length&&!e.closed;c+=i?1:2)e.next(a[c]);return this._checkFinalizedStatuses(e),n},t.prototype._trimBuffer=function(){var e=this,n=e._bufferSize,o=e._timestampProvider,i=e._buffer,s=e._infiniteTimeWindow,a=(s?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!s){for(var c=o.now(),u=0,l=1;l<i.length&&i[l]<=c;l+=2)u=l;u&&i.splice(0,u+1)}},t}(le),Or=function(r){w(t,r);function t(e,n){return r.call(this)||this}return t.prototype.schedule=function(e,n){return n===void 0&&(n=0),this},t}(A),Y={setInterval:function(r,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var o=Y.delegate;return o?.setInterval?o.setInterval.apply(o,M([r,t],j(e))):setInterval.apply(void 0,M([r,t],j(e)))},clearInterval:function(r){var t=Y.delegate;return(t?.clearInterval||clearInterval)(r)},delegate:void 0},Pr=function(r){w(t,r);function t(e,n){var o=r.call(this,e,n)||this;return o.scheduler=e,o.work=n,o.pending=!1,o}return t.prototype.schedule=function(e,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},t.prototype.requestAsyncId=function(e,n,o){return o===void 0&&(o=0),Y.setInterval(e.flush.bind(e,this),o)},t.prototype.recycleAsyncId=function(e,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&Y.clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(e,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var o=!1,i;try{this.work(e)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,o=e.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,V(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},t}(Or),Me=function(){function r(t,e){e===void 0&&(e=r.now),this.schedulerActionCtor=t,this.now=e}return r.prototype.schedule=function(t,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},r.now=pe.now,r}(),Ir=function(r){w(t,r);function t(e,n){n===void 0&&(n=Me.now);var o=r.call(this,e,n)||this;return o.actions=[],o._active=!1,o}return t.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var o;this._active=!0;do if(o=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,o){for(;e=n.shift();)e.unsubscribe();throw o}},t}(Me),Fe=new Ir(Pr),jr=Fe,Mr=new _(function(r){return r.complete()});function Ar(r){return r&&m(r.schedule)}var kr=function(r){return r&&typeof r.length=="number"&&typeof r!="function"};function Cr(r){return m(r?.then)}function Wr(r){return m(r[ce])}function Ur(r){return Symbol.asyncIterator&&m(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 Fr(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Dr=Fr();function Lr(r){return m(r?.[Dr])}function $r(r){return cr(this,arguments,function(){var e,n,o,i;return Ce(this,function(s){switch(s.label){case 0:e=r.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,P(e.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,P(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,P(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function qr(r){return m(r?.getReader)}function Ae(r){if(r instanceof _)return r;if(r!=null){if(Wr(r))return Vr(r);if(kr(r))return Br(r);if(Cr(r))return Hr(r);if(Ur(r))return De(r);if(Lr(r))return Yr(r);if(qr(r))return zr(r)}throw Rr(r)}function Vr(r){return new _(function(t){var e=r[ce]();if(m(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Br(r){return new _(function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()})}function Hr(r){return new _(function(t){r.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Re)})}function Yr(r){return new _(function(t){var e,n;try{for(var o=I(r),i=o.next();!i.done;i=o.next()){var s=i.value;if(t.next(s),t.closed)return}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}t.complete()})}function De(r){return new _(function(t){Nr(r,t).catch(function(e){return t.error(e)})})}function zr(r){return De($r(r))}function Nr(r,t){var e,n,o,i;return ar(this,void 0,void 0,function(){var s,a;return Ce(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),e=ur(r),c.label=1;case 1:return[4,e.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),o={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.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(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}var Le=ie(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function Gr(r,t){var e=typeof t=="object";return new Promise(function(n,o){var i=!1,s;r.subscribe({next:function(a){s=a,i=!0},error:o,complete:function(){i?n(s):e?n(t.defaultValue):o(new Le)}})})}function Kr(r,t){var e=typeof t=="object";return new Promise(function(n,o){var i=new H({next:function(s){n(s),i.unsubscribe()},error:o,complete:function(){e?n(t.defaultValue):o(new Le)}});r.subscribe(i)})}function Jr(r){return r instanceof Date&&!isNaN(r)}function Qr(r,t){return ue(function(e,n){var o=0;e.subscribe(fe(n,function(i){n.next(r.call(t,i,o++))}))})}function Xr(r,t,e){r===void 0&&(r=0),e===void 0&&(e=jr);var n=-1;return t!=null&&(Ar(t)?e=t:n=t),new _(function(o){var i=Jr(r)?+r-e.now():r;i<0&&(i=0);var s=0;return e.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Zr(r,t){return r===void 0&&(r=0),t===void 0&&(t=Fe),r<0&&(r=0),Xr(r,r,t)}function et(r,t){return function(e,n){return!r.call(t,e,n)}}function x(r,t){return ue(function(e,n){var o=0;e.subscribe(fe(n,function(i){return r.call(t,i,o++)&&n.next(i)}))})}function rt(r,t,e){return[x(t,e)(Ae(r)),x(et(t,e))(Ae(r))]}function F(r){return r<=0?function(){return Mr}:ue(function(t,e){var n=0;t.subscribe(fe(e,function(o){++n<=r&&(e.next(o),r<=n&&e.complete())}))})}var $e=(r=>(r.Msg="msg",r))($e||{}),qe=(r=>(r.Ack="ack",r.Syn="syn",r))(qe||{}),tt=(r,t)=>e=>({postMessage:n=>{let{errorCatcher:o=()=>()=>{},...i}=t??{};r.clients.get(e).then(s=>s?.postMessage(n,i)).catch(o(e,n))}}),re=(r,t)=>({postMessage:e=>{r.postMessage(e,t?.targetOrigin??"*",t?.transfer)}}),Ve={fromChild(r){return{from:r,to:re(r.parent)}},fromParent(r){if(r.contentWindow){if(r.ownerDocument.defaultView)return{from:r.ownerDocument.defaultView,to:re(r.contentWindow)};throw new TypeError("iframe ownerDocument.defaultView is null")}throw new TypeError("iframe contentWindow is null")},fromServiceWorkerToReceiver:tt,fromWindowToReceiver:re},Be=Object.values(qe),nt=Object.values($e),ot=r=>r.data,te=r=>t=>t.type===r,ke=r=>{let t=r.data;return typeof t=="object"&&t!==null&&"type"in t&&typeof t.type=="string"&&[...Be,...nt].includes(t.type)&&"instance"in t&&typeof t.instance=="string"&&"content"in t},it=()=>{let r="#";for(let t=0;t<3;t++)r+=`0${Math.floor(Math.random()*Math.pow(16,2)/2).toString(16)}`.slice(-2);return r},st=class oe{static __generateId=()=>window?window.crypto.randomUUID():sr("crypto").randomUUID();static utils={isPostChannelMessage:ke};__instance;__sender;__listener;__log;__receiver;__handler;__subscription;__okToWrite;__write$;__synack$;__user$;__colors;__connect(t){let e=Zr(t).subscribe(()=>this.__receiver.postMessage({content:this.__instance,instance:this.__instance,type:"syn"}));this.__subscription.add(e),this.__subscription.add(this.__user$.subscribe(n=>{Gr(this.__okToWrite.pipe(F(1))).then(o=>{n.instance===o&&(this.__listener(n.content),n._id!==void 0&&this.__receiver.postMessage({content:n._id,instance:this.__instance,type:"ack"}))}).catch(o=>{console.error("Unexpected error",o.message)})})),this.__subscription.add(this.__synack$.pipe(x(te("ack")),x(({content:n})=>n===this.instance),F(1)).subscribe(({instance:n})=>{this.__okToWrite.next(n),e.unsubscribe()})),this.__subscription.add(this.__synack$.pipe(x(te("syn")),x(({instance:n})=>n!==this.instance),F(1)).subscribe(({content:n})=>{this.__receiver.postMessage({content:n,instance:this.instance,type:"ack"})}))}__write(t,e){this.__subscription.add(this.__write$.subscribe(()=>{let n={_id:e,content:t,instance:this.__instance,type:"msg"};this.__receiver.postMessage(n),this.__log?.(t)}))}constructor(t,e){let n=new le;this.__instance=e.instance??oe.__generateId(),this.__listener=t,this.__sender=e.from,this.__receiver=e.to,this.__handler=a=>n.next(a),this.__log=e.log&&e.log.bind(this),this.__subscription=new A,this.__sender.addEventListener("message",this.__handler);let[o,i]=rt(n.pipe(x(ke),Qr(ot)),a=>Be.includes(a.type));this.__synack$=o,this.__user$=i,this.__okToWrite=new Tr(1),this.__write$=this.__okToWrite.pipe(F(1));let s=it();this.__colors={bg:`${s}22`,fg:s},this.__connect(e?.period?e.period:10)}disconnect(){this.__subscription.unsubscribe(),this.__sender.removeEventListener("message",this.__handler)}send(t){this.__write(t)}ackSend(t){let e,n=new Promise(i=>{e=i}),o=oe.__generateId();return this.__subscription.add(this.__synack$.pipe(x(te("ack")),x(({content:i})=>i===o),F(1)).subscribe(()=>e())),this.__write(t,o),n}get instance(){return this.__instance}get colors(){return this.__colors}get ready(){return Kr(this.__write$).then(()=>{})}},He=(r,t)=>{let e=new st(r,t);return e.ready.then(()=>e)};var he=function(r,t){return he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},he(r,t)};function g(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");he(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function D(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function k(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(s)throw s.error}}return i}function C(r,t,e){if(e||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return r.concat(i||Array.prototype.slice.call(t))}function v(r){return typeof r=="function"}function z(r){var t=function(n){Error.call(n),n.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var N=z(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
|
4
|
+
`+e.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
5
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function L(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var W=function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=D(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(p){t={error:p}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else s.remove(this);var l=this.initialTeardown;if(v(l))try{l()}catch(p){i=p instanceof N?p.errors:[p]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var d=D(h),f=d.next();!f.done;f=d.next()){var y=f.value;try{Ye(y)}catch(p){i=i??[],p instanceof N?i=C(C([],k(i)),k(p.errors)):i.push(p)}}}catch(p){n={error:p}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}}if(i)throw new N(i)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ye(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 de=W.EMPTY;function G(r){return r instanceof W||r&&"closed"in r&&v(r.remove)&&v(r.add)&&v(r.unsubscribe)}function Ye(r){v(r)?r():r.unsubscribe()}var b={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var U={setTimeout:function(r,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var o=U.delegate;return o?.setTimeout?o.setTimeout.apply(o,C([r,t],k(e))):setTimeout.apply(void 0,C([r,t],k(e)))},clearTimeout:function(r){var t=U.delegate;return(t?.clearTimeout||clearTimeout)(r)},delegate:void 0};function ze(r){U.setTimeout(function(){var t=b.onUnhandledError;if(t)t(r);else throw r})}function me(){}var Ne=function(){return ye("C",void 0,void 0)}();function Ge(r){return ye("E",void 0,r)}function Ke(r){return ye("N",r,void 0)}function ye(r,t,e){return{kind:r,value:t,error:e}}var O=null;function R(r){if(b.useDeprecatedSynchronousErrorHandling){var t=!O;if(t&&(O={errorThrown:!1,error:null}),r(),t){var e=O,n=e.errorThrown,o=e.error;if(O=null,n)throw o}}else r()}function Je(r){b.useDeprecatedSynchronousErrorHandling&&O&&(O.errorThrown=!0,O.error=r)}var _e=function(r){g(t,r);function t(e){var n=r.call(this)||this;return n.isStopped=!1,e?(n.destination=e,G(e)&&e.add(n)):n.destination=ft,n}return t.create=function(e,n,o){return new J(e,n,o)},t.prototype.next=function(e){this.isStopped?be(Ke(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?be(Ge(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?be(Ne,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}(W);var at=Function.prototype.bind;function ve(r,t){return at.call(r,t)}var ct=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(n){K(n)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){K(n)}else K(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){K(e)}},r}(),J=function(r){g(t,r);function t(e,n,o){var i=r.call(this)||this,s;if(v(e)||!e)s={next:e??void 0,error:n??void 0,complete:o??void 0};else{var a;i&&b.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return i.unsubscribe()},s={next:e.next&&ve(e.next,a),error:e.error&&ve(e.error,a),complete:e.complete&&ve(e.complete,a)}):s=e}return i.destination=new ct(s),i}return t}(_e);function K(r){b.useDeprecatedSynchronousErrorHandling?Je(r):ze(r)}function ut(r){throw r}function be(r,t){var e=b.onStoppedNotification;e&&U.setTimeout(function(){return e(r,t)})}var ft={closed:!0,next:me,error:ut,complete:me};var Qe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Xe(r){return r}function Ze(r){return r.length===0?Xe:r.length===1?r[0]:function(e){return r.reduce(function(n,o){return o(n)},e)}}var xe=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,n){var o=this,i=pt(t)?t:new J(t,e,n);return R(function(){var s=o,a=s.operator,c=s.source;i.add(a?a.call(i,c):c?o._subscribe(i):o._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 n=this;return e=er(e),new e(function(o,i){var s=new J({next:function(a){try{t(a)}catch(c){i(c),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[Qe]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ze(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=er(t),new t(function(n,o){var i;e.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(t){return new r(t)},r}();function er(r){var t;return(t=r??b.Promise)!==null&&t!==void 0?t:Promise}function lt(r){return r&&v(r.next)&&v(r.error)&&v(r.complete)}function pt(r){return r&&r instanceof _e||lt(r)&&G(r)}var rr=z(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var we=function(r){g(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 n=new tr(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new rr},t.prototype.next=function(e){var n=this;R(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=D(n.currentObservers),a=s.next();!a.done;a=s.next()){var c=a.value;c.next(e)}}catch(u){o={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},t.prototype.error=function(e){var n=this;R(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var o=n.observers;o.length;)o.shift().error(e)}})},t.prototype.complete=function(){var e=this;R(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.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 n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?de:(this.currentObservers=null,a.push(e),new W(function(){n.currentObservers=null,L(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?e.error(i):s&&e.complete()},t.prototype.asObservable=function(){var e=new xe;return e.source=this,e},t.create=function(e,n){return new tr(e,n)},t}(xe);var tr=function(r){g(t,r);function t(e,n){var o=r.call(this)||this;return o.destination=e,o.source=n,o}return t.prototype.next=function(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,e)},t.prototype.error=function(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&o!==void 0?o:de},t}(we);var ge={now:function(){return(ge.delegate||Date).now()},delegate:void 0};var Se=function(r){g(t,r);function t(e,n,o){e===void 0&&(e=1/0),n===void 0&&(n=1/0),o===void 0&&(o=ge);var i=r.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(e){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;o||(i.push(e),!s&&i.push(a.now()+c)),this._trimBuffer(),r.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(e),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),c=0;c<a.length&&!e.closed;c+=i?1:2)e.next(a[c]);return this._checkFinalizedStatuses(e),n},t.prototype._trimBuffer=function(){var e=this,n=e._bufferSize,o=e._timestampProvider,i=e._buffer,s=e._infiniteTimeWindow,a=(s?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!s){for(var c=o.now(),u=0,l=1;l<i.length&&i[l]<=c;l+=2)u=l;u&&i.splice(0,u+1)}},t}(we);var Q=new Map,Ee=new Map,Te=new Map,nr=(r,t)=>{let e=t.keys(),n,{done:o=!1,value:i}=e.next();for(;!o&&n===void 0;){i!==void 0&&r.startsWith(i)&&(n=i,o=!0);let{value:s,done:a=!1}=e.next();o=a,i=s}return n},ht=r=>r!==null&&"id"in r,dt=r=>t=>console.error(`[SW]: error on ${r} - ${String(t)}`),mt=Ve.fromServiceWorkerToReceiver(self,{errorCatcher:dt}),yt=r=>function(e){let n=e;switch(n.type){case"set-source-map":{let{content:o}=n,i=Object.entries(o).reduce((s,[a,c])=>{let{clientSourceMap:u,clientTosMap:l}=s,{headers:h={}}=c;return Object.keys(h).length>0&&l.set(encodeURI(c.to),h),u.set(encodeURI(a),c),s},{clientSourceMap:new Map,clientTosMap:new Map});Ee.set(r,i.clientSourceMap),Te.set(r,i.clientTosMap);break}case"unload-client":{Ee.delete(r),Te.delete(r),Q.delete(r),this.disconnect();break}default:break}},vt=r=>{let t=new Map,e=new Se,n={addEventListener(o,i){t.set(i,e.subscribe(s=>i(s)))},removeEventListener(o,i){t.get(i)?.unsubscribe(),t.delete(i)}};return{buffer:e,channel:He(yt(r),{from:n,instance:"service-worker",to:mt(r)})}},bt=r=>{let t=Q.get(r);return t||(t=vt(r),Q.set(r,t)),t};self.addEventListener("install",()=>{self.skipWaiting().catch(r=>console.error(`[SW] error while skipWaiting - ${String(r)}`))});self.addEventListener("activate",r=>{r.waitUntil(self.clients.claim())});self.addEventListener("message",r=>{let{source:t}=r;if(!ht(t))return;let{id:e}=t;bt(e).buffer.next(r)});self.addEventListener("fetch",r=>{let t=r.clientId!==""?r.clientId:r.resultingClientId,e=Ee.get(t);if(!e)return r.respondWith(self.fetch(r.request));let n=Te.get(t),{request:{url:o}}=r,i=nr(o,e),s=nr(o,n),a=new Headers(r.request.headers),c={};if(i!==void 0){let h=e.get(i)?.to,d=e.get(i)?.headers??{},f=o.substring(i.length);c=e.get(i)?.query??{},o=`${h}${f}`,Object.entries(d).forEach(([y,p])=>a.set(y,p))}if(s!==void 0){let h=n.get(s)??{};Object.entries(h).forEach(([d,f])=>a.set(d,f))}let u;try{let h=new URL(o);Object.entries(c).forEach(([d,f])=>h.searchParams.set(d,f)),u=h.href}catch{u=o}let l=Q.get(t)?.channel;r.respondWith(self.fetch(u,{...r.request,headers:a}).catch(h=>(console.error(h),Promise.reject(h))))});})();
|
6
|
+
/*! Bundled license information:
|
7
|
+
|
8
|
+
@micro-lc/post-channel/dist/es/index.js:
|
9
|
+
(*!
|
10
|
+
Copyright 2023 Mia srl
|
11
|
+
|
12
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
13
|
+
you may not use this file except in compliance with the License.
|
14
|
+
You may obtain a copy of the License at
|
15
|
+
|
16
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
17
|
+
|
18
|
+
Unless required by applicable law or agreed to in writing, software
|
19
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
20
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
21
|
+
See the License for the specific language governing permissions and
|
22
|
+
limitations under the License.
|
23
|
+
*)
|
24
|
+
*/
|