@micro-lc/preview 0.5.0-rc5 → 0.5.0-rc6

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.
@@ -17,7 +17,7 @@
17
17
  </style>
18
18
  <script src="https://unpkg.com/zone.js"></script>
19
19
 
20
- <script type="module" crossorigin src="./assets/index-243486eb.js"></script>
20
+ <script type="module" crossorigin src="./assets/index-62118151.js"></script>
21
21
  </head>
22
22
  <body></body>
23
23
  </html>
@@ -8,7 +8,7 @@
8
8
  "dynamicImports": [
9
9
  "../../.yarn/__virtual__/@micro-lc-composer-virtual-1e9d239e46/0/cache/@micro-lc-composer-npm-2.0.3-7d85cea61f-88452090ec.zip/node_modules/@micro-lc/composer/dist/lib/logger/errors.js"
10
10
  ],
11
- "file": "assets/index-243486eb.js",
11
+ "file": "assets/index-62118151.js",
12
12
  "isEntry": true,
13
13
  "src": "index.html"
14
14
  }
@@ -1979,7 +1979,6 @@
1979
1979
 
1980
1980
  // service-worker.ts
1981
1981
  var openChannels = /* @__PURE__ */ new Map();
1982
- var clientIdsToScope = /* @__PURE__ */ new Map();
1983
1982
  var sourceMap = /* @__PURE__ */ new Map();
1984
1983
  var tosMap = /* @__PURE__ */ new Map();
1985
1984
  var isAvailable = (key, map2) => {
@@ -2005,9 +2004,8 @@
2005
2004
  const workerMessageData = data;
2006
2005
  switch (workerMessageData.type) {
2007
2006
  case "set-source-map": {
2008
- const { content: { scope, dictionary } } = workerMessageData;
2009
- const scopedId = scope ?? clientId;
2010
- const clientMaps = Object.entries(dictionary).reduce((maps, [key, value]) => {
2007
+ const { content } = workerMessageData;
2008
+ const clientMaps = Object.entries(content).reduce((maps, [key, value]) => {
2011
2009
  const { clientSourceMap, clientTosMap } = maps;
2012
2010
  if (Object.keys(value.headers).length > 0) {
2013
2011
  clientTosMap.set(encodeURI(value.to), value.headers);
@@ -2015,17 +2013,11 @@
2015
2013
  clientSourceMap.set(encodeURI(key), value);
2016
2014
  return maps;
2017
2015
  }, { clientSourceMap: /* @__PURE__ */ new Map(), clientTosMap: /* @__PURE__ */ new Map() });
2018
- if (scope) {
2019
- clientIdsToScope.set(clientId, scope);
2020
- } else {
2021
- clientIdsToScope.delete(clientId);
2022
- }
2023
- sourceMap.set(scopedId, clientMaps.clientSourceMap);
2024
- tosMap.set(scopedId, clientMaps.clientTosMap);
2016
+ sourceMap.set(clientId, clientMaps.clientSourceMap);
2017
+ tosMap.set(clientId, clientMaps.clientTosMap);
2025
2018
  break;
2026
2019
  }
2027
2020
  case "unload-client": {
2028
- clientIdsToScope.delete(clientId);
2029
2021
  openChannels.delete(clientId);
2030
2022
  this.disconnect();
2031
2023
  break;
@@ -2076,13 +2068,11 @@
2076
2068
  });
2077
2069
  self.addEventListener("fetch", (event) => {
2078
2070
  const clientId = event.clientId !== "" ? event.clientId : event.resultingClientId;
2079
- const scope = clientIdsToScope.get(clientId);
2080
- const scopedId = scope ?? clientId;
2081
- const clientSourceMap = sourceMap.get(scopedId);
2071
+ const clientSourceMap = sourceMap.get(clientId);
2082
2072
  if (!clientSourceMap) {
2083
2073
  return event.respondWith(self.fetch(event.request));
2084
2074
  }
2085
- const clientTosMap = tosMap.get(scopedId);
2075
+ const clientTosMap = tosMap.get(clientId);
2086
2076
  let { request: { url } } = event;
2087
2077
  const key = isAvailable(url, clientSourceMap);
2088
2078
  const to = isAvailable(url, clientTosMap);
@@ -17,7 +17,7 @@
17
17
  </style>
18
18
  <script src="https://unpkg.com/zone.js"></script>
19
19
 
20
- <script type="module" crossorigin src="./assets/index-1fa72460.js"></script>
20
+ <script type="module" crossorigin src="./assets/index-d846d55b.js"></script>
21
21
  </head>
22
22
  <body></body>
23
23
  </html>
@@ -8,7 +8,7 @@
8
8
  "dynamicImports": [
9
9
  "../../.yarn/__virtual__/@micro-lc-composer-virtual-1e9d239e46/0/cache/@micro-lc-composer-npm-2.0.3-7d85cea61f-88452090ec.zip/node_modules/@micro-lc/composer/dist/lib/logger/errors.js"
10
10
  ],
11
- "file": "assets/index-1fa72460.js",
11
+ "file": "assets/index-d846d55b.js",
12
12
  "isEntry": true,
13
13
  "src": "index.html"
14
14
  }
@@ -1,3 +1,3 @@
1
- "use strict";(()=>{var Z=function(r,t){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},Z(r,t)};function v(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Z(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function dr(r,t,e,o){function n(i){return i instanceof e?i:new e(function(s){s(i)})}return new(e||(e=Promise))(function(i,s){function a(u){try{c(o.next(u))}catch(h){s(h)}}function f(u){try{c(o.throw(u))}catch(h){s(h)}}function c(u){u.done?i(u.value):n(u.value).then(a,f)}c((o=o.apply(r,t||[])).next())})}function N(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,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(c){return function(u){return f([c,u])}}function f(c){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(e=0)),e;)try{if(o=1,n&&(i=c[0]&2?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,n=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1],i=c;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(c);break}i[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(r,e)}catch(u){c=[6,u],n=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function E(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],o=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),n,i=[],s;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(s)throw s.error}}return i}function _(r,t,e){if(e||arguments.length===2)for(var o=0,n=t.length,i;o<n;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return r.concat(i||Array.prototype.slice.call(t))}function I(r){return this instanceof I?(this.v=r,this):new I(r)}function hr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=e.apply(r,t||[]),n,i=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(l){o[l]&&(n[l]=function(m){return new Promise(function(y,d){i.push([l,m,y,d])>1||a(l,m)})})}function a(l,m){try{f(o[l](m))}catch(y){h(i[0][3],y)}}function f(l){l.value instanceof I?Promise.resolve(l.value.v).then(c,u):h(i[0][2],l)}function c(l){a("next",l)}function u(l){a("throw",l)}function h(l,m){l(m),i.shift(),i.length&&a(i[0][0],i[0][1])}}function vr(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 E=="function"?E(r):r[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(i){e[i]=r[i]&&function(s){return new Promise(function(a,f){s=r[i](s),n(a,f,s.done,s.value)})}}function n(i,s,a,f){Promise.resolve(f).then(function(c){i({value:c,done:a})},s)}}function p(r){return typeof r=="function"}function j(r){var t=function(o){Error.call(o),o.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var z=j(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
1
+ "use strict";(()=>{var Q=function(r,t){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},Q(r,t)};function v(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Q(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mr(r,t,e,o){function n(i){return i instanceof e?i:new e(function(s){s(i)})}return new(e||(e=Promise))(function(i,s){function a(u){try{c(o.next(u))}catch(h){s(h)}}function f(u){try{c(o.throw(u))}catch(h){s(h)}}function c(u){u.done?i(u.value):n(u.value).then(a,f)}c((o=o.apply(r,t||[])).next())})}function B(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,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(c){return function(u){return f([c,u])}}function f(c){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(e=0)),e;)try{if(o=1,n&&(i=c[0]&2?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,n=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1],i=c;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(c);break}i[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(r,e)}catch(u){c=[6,u],n=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function E(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],o=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),n,i=[],s;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(s)throw s.error}}return i}function _(r,t,e){if(e||arguments.length===2)for(var o=0,n=t.length,i;o<n;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return r.concat(i||Array.prototype.slice.call(t))}function I(r){return this instanceof I?(this.v=r,this):new I(r)}function hr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=e.apply(r,t||[]),n,i=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(l){o[l]&&(n[l]=function(d){return new Promise(function(x,m){i.push([l,d,x,m])>1||a(l,d)})})}function a(l,d){try{f(o[l](d))}catch(x){h(i[0][3],x)}}function f(l){l.value instanceof I?Promise.resolve(l.value.v).then(c,u):h(i[0][2],l)}function c(l){a("next",l)}function u(l){a("throw",l)}function h(l,d){l(d),i.shift(),i.length&&a(i[0][0],i[0][1])}}function dr(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 E=="function"?E(r):r[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(i){e[i]=r[i]&&function(s){return new Promise(function(a,f){s=r[i](s),n(a,f,s.done,s.value)})}}function n(i,s,a,f){Promise.resolve(f).then(function(c){i({value:c,done:a})},s)}}function p(r){return typeof r=="function"}function j(r){var t=function(o){Error.call(o),o.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var N=j(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
2
2
  `+e.map(function(o,n){return n+1+") "+o.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=e}});function P(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(d){t={error:d}}finally{try{f&&!f.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else s.remove(this);var u=this.initialTeardown;if(p(u))try{u()}catch(d){i=d instanceof z?d.errors:[d]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=E(h),m=l.next();!m.done;m=l.next()){var y=m.value;try{br(y)}catch(d){i=i??[],d instanceof z?i=_(_([],x(i)),x(d.errors)):i.push(d)}}}catch(d){o={error:d}}finally{try{m&&!m.done&&(n=l.return)&&n.call(l)}finally{if(o)throw o.error}}}if(i)throw new z(i)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)br(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)&&P(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&P(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}();var rr=g.EMPTY;function G(r){return r instanceof g||r&&"closed"in r&&p(r.remove)&&p(r.add)&&p(r.unsubscribe)}function br(r){p(r)?r():r.unsubscribe()}var w={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var C={setTimeout:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=C.delegate;return n?.setTimeout?n.setTimeout.apply(n,_([r,t],x(e))):setTimeout.apply(void 0,_([r,t],x(e)))},clearTimeout:function(r){var t=C.delegate;return(t?.clearTimeout||clearTimeout)(r)},delegate:void 0};function K(r){C.setTimeout(function(){var t=w.onUnhandledError;if(t)t(r);else throw r})}function er(){}var yr=function(){return tr("C",void 0,void 0)}();function xr(r){return tr("E",void 0,r)}function _r(r){return tr("N",r,void 0)}function tr(r,t,e){return{kind:r,value:t,error:e}}var A=null;function k(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 gr(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,G(e)&&e.add(o)):o.destination=ne,o}return t.create=function(e,o,n){return new R(e,o,n)},t.prototype.next=function(e){this.isStopped?nr(_r(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?nr(xr(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?nr(yr,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 ee=Function.prototype.bind;function or(r,t){return ee.call(r,t)}var te=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){J(o)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(o){J(o)}else J(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){J(e)}},r}(),R=function(r){v(t,r);function t(e,o,n){var i=r.call(this)||this,s;if(p(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&&or(e.next,a),error:e.error&&or(e.error,a),complete:e.complete&&or(e.complete,a)}):s=e}return i.destination=new te(s),i}return t}($);function J(r){w.useDeprecatedSynchronousErrorHandling?gr(r):K(r)}function oe(r){throw r}function nr(r,t){var e=w.onStoppedNotification;e&&C.setTimeout(function(){return e(r,t)})}var ne={closed:!0,next:er,error:oe,complete:er};var W=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function wr(r){return r}function Sr(r){return r.length===0?wr: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=se(t)?t:new R(t,e,o);return k(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=Er(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 Sr(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Er(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 Er(r){var t;return(t=r??w.Promise)!==null&&t!==void 0?t:Promise}function ie(r){return r&&p(r.next)&&p(r.error)&&p(r.complete)}function se(r){return r&&r instanceof $||ie(r)&&G(r)}function ae(r){return p(r?.lift)}function M(r){return function(t){if(ae(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 ce(r,t,e,o,n)}var ce=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(u){e.error(u)}}:r.prototype._next,f._error=i?function(c){try{i(c)}catch(u){e.error(u)}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 Or=j(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var ir=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 Tr(this,this);return o.operator=e,o},t.prototype._throwIfClosed=function(){if(this.closed)throw new Or},t.prototype.next=function(e){var o=this;k(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;k(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;k(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?rr:(this.currentObservers=null,a.push(e),new g(function(){o.currentObservers=null,P(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 Tr(e,o)},t}(b);var Tr=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:rr},t}(ir);var q={now:function(){return(q.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=q);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,u=1;u<i.length&&i[u]<=f;u+=2)c=u;c&&i.splice(0,c+1)}},t}(ir);var Mr=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 V={setInterval:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=V.delegate;return n?.setInterval?n.setInterval.apply(n,_([r,t],x(e))):setInterval.apply(void 0,_([r,t],x(e)))},clearInterval:function(r){var t=V.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),V.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&&V.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,P(i,this),o!=null&&(this.id=this.recycleAsyncId(n,o,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},t}(Mr);var sr=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=q.now,r}();var Pr=function(r){v(t,r);function t(e,o){o===void 0&&(o=sr.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}(sr);var ar=new Pr(Ir),Ar=ar;var jr=new b(function(r){return r.complete()});function Cr(r){return r&&p(r.schedule)}var Q=function(r){return r&&typeof r.length=="number"&&typeof r!="function"};function kr(r){return p(r?.then)}function Rr(r){return p(r[W])}function Wr(r){return Symbol.asyncIterator&&p(r?.[Symbol.asyncIterator])}function Fr(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 fe(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ur=fe();function Lr(r){return p(r?.[Ur])}function Dr(r){return hr(this,arguments,function(){var e,o,n,i;return N(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,I(e.read())];case 3:return o=s.sent(),n=o.value,i=o.done,i?[4,I(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,I(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 $r(r){return p(r?.getReader)}function U(r){if(r instanceof b)return r;if(r!=null){if(Rr(r))return ue(r);if(Q(r))return pe(r);if(kr(r))return le(r);if(Wr(r))return qr(r);if(Lr(r))return me(r);if($r(r))return de(r)}throw Fr(r)}function ue(r){return new b(function(t){var e=r[W]();if(p(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function pe(r){return new b(function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()})}function le(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,K)})}function me(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){he(r,t).catch(function(e){return t.error(e)})})}function de(r){return qr(Dr(r))}function he(r,t){var e,o,n,i;return dr(this,void 0,void 0,function(){var s,a;return N(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),e=vr(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 Vr(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 Hr=j(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function cr(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 Hr)}});r.subscribe(i)})}function Yr(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 ve=Array.isArray;function be(r,t){return ve(t)?r.apply(void 0,_([],x(t))):r(t)}function Br(r){return T(function(t){return be(r,t)})}function Nr(r,t,e,o,n,i,s,a){var f=[],c=0,u=0,h=!1,l=function(){h&&!f.length&&!c&&t.complete()},m=function(d){return c<o?y(d):f.push(d)},y=function(d){i&&t.next(d),c++;var Y=!1;U(e(d,u++)).subscribe(O(t,function(D){n?.(D),i?m(D):t.next(D)},function(){Y=!0},void 0,function(){if(Y)try{c--;for(var D=function(){var B=f.shift();s?Vr(t,s,function(){return y(B)}):y(B)};f.length&&c<o;)D();l()}catch(B){t.error(B)}}))};return r.subscribe(O(t,m,function(){h=!0,l()})),function(){a?.()}}function fr(r,t,e){return e===void 0&&(e=1/0),p(t)?fr(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 Nr(o,n,r,e)}))}var ye=["addListener","removeListener"],xe=["addEventListener","removeEventListener"],_e=["on","off"];function H(r,t,e,o){if(p(e)&&(o=e,e=void 0),o)return H(r,t,e).pipe(Br(o));var n=x(Se(r)?xe.map(function(a){return function(f){return r[a](t,f,e)}}):ge(r)?ye.map(zr(r,t)):we(r)?_e.map(zr(r,t)):[],2),i=n[0],s=n[1];if(!i&&Q(r))return fr(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=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return a.next(1<c.length?c:c[0])};return i(f),function(){return s(f)}})}function zr(r,t){return function(e){return function(o){return r[e](t,o)}}}function ge(r){return p(r.addListener)&&p(r.removeListener)}function we(r){return p(r.on)&&p(r.off)}function Se(r){return p(r.addEventListener)&&p(r.removeEventListener)}function Gr(r,t,e){r===void 0&&(r=0),e===void 0&&(e=Ar);var o=-1;return t!=null&&(Cr(t)?e=t:o=t),new b(function(n){var i=Yr(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 ur(r,t){return r===void 0&&(r=0),t===void 0&&(t=ar),r<0&&(r=0),Gr(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 jr}:M(function(t,e){var o=0;t.subscribe(O(e,function(n){++o<=r&&(e.next(n),r<=o&&e.complete())}))})}var Kr=(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 Jr=(r=>(r.Ack="ack",r.Syn="syn",r))(Jr||{}),Ee=Object.values(Jr),pr=r=>r.data,lr=r=>t=>t.type===r.toString(),Oe=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},Te=()=>{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},Me=class{__generateId;__instance;__colors;__listener;__log;__receiver;__subscription;__okToWrite;__write$;__recv$;__connect(r,t){let e=ur(t).subscribe(()=>this.__receiver.postMessage({content:r,instance:r,type:"syn".toString()}));this.__subscription.add(e),this.__subscription.add(this.__recv$.pipe(T(pr),S(lr("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}})=>!Ee.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(pr),S(lr("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(Oe)).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=Te();this.__colors={bg:a,fg:`${a}22`},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(pr),S(lr("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 cr(this.__write$).then(()=>{})}},Qr=Me;var mr=new Map,X=new Map,Zr=new Map,re=new Map,Xr=(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},Ie=r=>r!==null&&"id"in r,Pe=r=>t=>console.error(`[SW]: error on ${r} - ${String(t)}`),Ae=Kr(self,{errorCatcher:Pe}),je=r=>function({data:e}){let o=e;switch(o.type){case"set-source-map":{let{content:{scope:n,dictionary:i}}=o,s=n??r,a=Object.entries(i).reduce((f,[c,u])=>{let{clientSourceMap:h,clientTosMap:l}=f;return Object.keys(u.headers).length>0&&l.set(encodeURI(u.to),u.headers),h.set(encodeURI(c),u),f},{clientSourceMap:new Map,clientTosMap:new Map});n?X.set(r,n):X.delete(r),Zr.set(s,a.clientSourceMap),re.set(s,a.clientTosMap);break}case"unload-client":{X.delete(r),mr.delete(r),this.disconnect();break}default:break}},Ce=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 Qr(je(r),o,Ae(r))}},ke=r=>{let t=mr.get(r);return t||(t=Ce(r),mr.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(!Ie(t))return;let{id:e}=t;ke(e).buffer.next(r)});self.addEventListener("fetch",r=>{let t=r.clientId!==""?r.clientId:r.resultingClientId,o=X.get(t)??t,n=Zr.get(o);if(!n)return r.respondWith(self.fetch(r.request));let i=re.get(o),{request:{url:s}}=r,a=Xr(s,n),f=Xr(s,i),c=new Headers(r.request.headers),u={};if(a!==void 0){let l=n.get(a)?.to,m=n.get(a)?.headers,y=s.substring(a.length);u=n.get(a)?.query,s=`${l}${y}`,Object.entries(m).forEach(([d,Y])=>c.set(d,Y))}if(f!==void 0){let l=i.get(f);Object.entries(l).forEach(([m,y])=>c.set(m,y))}let h;try{let l=new URL(s);Object.entries(u).forEach(([m,y])=>l.searchParams.set(m,y)),h=l.href}catch{h=s}console.log({clientId:t,clientSourceMap:n,finalUrl:h}),r.respondWith(self.fetch(h,{...r.request,headers:c}).catch(l=>(console.error(l),Promise.reject(l))))});})();
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function P(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(m){t={error:m}}finally{try{f&&!f.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else s.remove(this);var u=this.initialTeardown;if(p(u))try{u()}catch(m){i=m instanceof N?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=E(h),d=l.next();!d.done;d=l.next()){var x=d.value;try{vr(x)}catch(m){i=i??[],m instanceof N?i=_(_([],y(i)),y(m.errors)):i.push(m)}}}catch(m){o={error:m}}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)vr(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)&&P(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&P(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}();var X=g.EMPTY;function z(r){return r instanceof g||r&&"closed"in r&&p(r.remove)&&p(r.add)&&p(r.unsubscribe)}function vr(r){p(r)?r():r.unsubscribe()}var w={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var C={setTimeout:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=C.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=C.delegate;return(t?.clearTimeout||clearTimeout)(r)},delegate:void 0};function G(r){C.setTimeout(function(){var t=w.onUnhandledError;if(t)t(r);else throw r})}function Z(){}var br=function(){return rr("C",void 0,void 0)}();function yr(r){return rr("E",void 0,r)}function xr(r){return rr("N",r,void 0)}function rr(r,t,e){return{kind:r,value:t,error:e}}var A=null;function k(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 _r(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?tr(xr(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?tr(yr(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?tr(br,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 er(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(p(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&&er(e.next,a),error:e.error&&er(e.error,a),complete:e.complete&&er(e.complete,a)}):s=e}return i.destination=new ee(s),i}return t}($);function K(r){w.useDeprecatedSynchronousErrorHandling?_r(r):G(r)}function te(r){throw r}function tr(r,t){var e=w.onStoppedNotification;e&&C.setTimeout(function(){return e(r,t)})}var oe={closed:!0,next:Z,error:te,complete:Z};var W=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function gr(r){return r}function wr(r){return r.length===0?gr: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 k(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=Sr(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 wr(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Sr(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 Sr(r){var t;return(t=r??w.Promise)!==null&&t!==void 0?t:Promise}function ne(r){return r&&p(r.next)&&p(r.error)&&p(r.complete)}function ie(r){return r&&r instanceof $||ne(r)&&z(r)}function se(r){return p(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(u){e.error(u)}}:r.prototype._next,f._error=i?function(c){try{i(c)}catch(u){e.error(u)}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 Er=j(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var or=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 Or(this,this);return o.operator=e,o},t.prototype._throwIfClosed=function(){if(this.closed)throw new Er},t.prototype.next=function(e){var o=this;k(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;k(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;k(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?X:(this.currentObservers=null,a.push(e),new g(function(){o.currentObservers=null,P(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 Or(e,o)},t}(b);var Or=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:X},t}(or);var q={now:function(){return(q.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=q);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,u=1;u<i.length&&i[u]<=f;u+=2)c=u;c&&i.splice(0,c+1)}},t}(or);var Tr=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 V={setInterval:function(r,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var n=V.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=V.delegate;return(t?.clearInterval||clearInterval)(r)},delegate:void 0};var Mr=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),V.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&&V.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,P(i,this),o!=null&&(this.id=this.recycleAsyncId(n,o,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},t}(Tr);var nr=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=q.now,r}();var Ir=function(r){v(t,r);function t(e,o){o===void 0&&(o=nr.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}(nr);var ir=new Ir(Mr),Pr=ir;var Ar=new b(function(r){return r.complete()});function jr(r){return r&&p(r.schedule)}var J=function(r){return r&&typeof r.length=="number"&&typeof r!="function"};function Cr(r){return p(r?.then)}function kr(r){return p(r[W])}function Rr(r){return Symbol.asyncIterator&&p(r?.[Symbol.asyncIterator])}function Wr(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 Fr=ce();function Ur(r){return p(r?.[Fr])}function Lr(r){return hr(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,I(e.read())];case 3:return o=s.sent(),n=o.value,i=o.done,i?[4,I(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,I(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 Dr(r){return p(r?.getReader)}function U(r){if(r instanceof b)return r;if(r!=null){if(kr(r))return fe(r);if(J(r))return ue(r);if(Cr(r))return pe(r);if(Rr(r))return $r(r);if(Ur(r))return le(r);if(Dr(r))return me(r)}throw Wr(r)}function fe(r){return new b(function(t){var e=r[W]();if(p(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 $r(r){return new b(function(t){he(r,t).catch(function(e){return t.error(e)})})}function me(r){return $r(Lr(r))}function he(r,t){var e,o,n,i;return mr(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=dr(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 qr(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 Vr=j(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function sr(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 Vr)}});r.subscribe(i)})}function Hr(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 de=Array.isArray;function ve(r,t){return de(t)?r.apply(void 0,_([],y(t))):r(t)}function Yr(r){return T(function(t){return ve(r,t)})}function Br(r,t,e,o,n,i,s,a){var f=[],c=0,u=0,h=!1,l=function(){h&&!f.length&&!c&&t.complete()},d=function(m){return c<o?x(m):f.push(m)},x=function(m){i&&t.next(m),c++;var lr=!1;U(e(m,u++)).subscribe(O(t,function(D){n?.(D),i?d(D):t.next(D)},function(){lr=!0},void 0,function(){if(lr)try{c--;for(var D=function(){var Y=f.shift();s?qr(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(){h=!0,l()})),function(){a?.()}}function ar(r,t,e){return e===void 0&&(e=1/0),p(t)?ar(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 Br(o,n,r,e)}))}var be=["addListener","removeListener"],ye=["addEventListener","removeEventListener"],xe=["on","off"];function H(r,t,e,o){if(p(e)&&(o=e,e=void 0),o)return H(r,t,e).pipe(Yr(o));var n=y(we(r)?ye.map(function(a){return function(f){return r[a](t,f,e)}}):_e(r)?be.map(Nr(r,t)):ge(r)?xe.map(Nr(r,t)):[],2),i=n[0],s=n[1];if(!i&&J(r))return ar(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=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return a.next(1<c.length?c:c[0])};return i(f),function(){return s(f)}})}function Nr(r,t){return function(e){return function(o){return r[e](t,o)}}}function _e(r){return p(r.addListener)&&p(r.removeListener)}function ge(r){return p(r.on)&&p(r.off)}function we(r){return p(r.addEventListener)&&p(r.removeEventListener)}function zr(r,t,e){r===void 0&&(r=0),e===void 0&&(e=Pr);var o=-1;return t!=null&&(jr(t)?e=t:o=t),new b(function(n){var i=Hr(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 cr(r,t){return r===void 0&&(r=0),t===void 0&&(t=ir),r<0&&(r=0),zr(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 Ar}:M(function(t,e){var o=0;t.subscribe(O(e,function(n){++o<=r&&(e.next(n),r<=o&&e.complete())}))})}var Gr=(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 Kr=(r=>(r.Ack="ack",r.Syn="syn",r))(Kr||{}),Se=Object.values(Kr),fr=r=>r.data,ur=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=cr(t).subscribe(()=>this.__receiver.postMessage({content:r,instance:r,type:"syn".toString()}));this.__subscription.add(e),this.__subscription.add(this.__recv$.pipe(T(fr),S(ur("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(fr),S(ur("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,fg:`${a}22`},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(fr),S(ur("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 sr(this.__write$).then(()=>{})}},Jr=Te;var pr=new Map,Xr=new Map,Zr=new Map,Qr=(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,Ie=r=>t=>console.error(`[SW]: error on ${r} - ${String(t)}`),Pe=Gr(self,{errorCatcher:Ie}),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:u}=s;return Object.keys(f.headers).length>0&&u.set(encodeURI(f.to),f.headers),c.set(encodeURI(a),f),s},{clientSourceMap:new Map,clientTosMap:new Map});Xr.set(r,i.clientSourceMap),Zr.set(r,i.clientTosMap);break}case"unload-client":{pr.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 Jr(Ae(r),o,Pe(r))}},Ce=r=>{let t=pr.get(r);return t||(t=je(r),pr.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;Ce(e).buffer.next(r)});self.addEventListener("fetch",r=>{let t=r.clientId!==""?r.clientId:r.resultingClientId,e=Xr.get(t);if(!e)return r.respondWith(self.fetch(r.request));let o=Zr.get(t),{request:{url:n}}=r,i=Qr(n,e),s=Qr(n,o),a=new Headers(r.request.headers),f={};if(i!==void 0){let u=e.get(i)?.to,h=e.get(i)?.headers,l=n.substring(i.length);f=e.get(i)?.query,n=`${u}${l}`,Object.entries(h).forEach(([d,x])=>a.set(d,x))}if(s!==void 0){let u=o.get(s);Object.entries(u).forEach(([h,l])=>a.set(h,l))}let c;try{let u=new URL(n);Object.entries(f).forEach(([h,l])=>u.searchParams.set(h,l)),c=u.href}catch{c=n}console.log({clientId:t,clientSourceMap:e,finalUrl:c}),r.respondWith(self.fetch(c,{...r.request,headers:a}).catch(u=>(console.error(u),Promise.reject(u))))});})();