seroval 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/development/index.cjs +17 -2
- package/dist/cjs/development/index.cjs.map +2 -2
- package/dist/cjs/production/index.cjs +3 -3
- package/dist/esm/development/index.mjs +17 -2
- package/dist/esm/development/index.mjs.map +2 -2
- package/dist/esm/production/index.mjs +3 -3
- package/dist/types/core/Serializer.d.ts +4 -0
- package/dist/types/core/Serializer.d.ts.map +1 -1
- package/dist/types/core/keys.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/core/Serializer.ts +18 -0
- package/src/core/keys.ts +4 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case" ":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return}}function l(a){let e="",r=0,t;for(let n=0,s=a.length;n<s;n++)t=
|
|
3
|
-
`).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\t/g," ").replace(/\\f/g,"\f").replace(/\\x3C/g,"<").replace(/\\u2028/g,"\u2028").replace(/\\u2029/g,"\u2029")}var A="__SEROVAL_REFS__",b="_$",y="$R",pe="s",me="f",ge="P",ve="Ps",he="Pf",Se="c",be="S",H="Se",Fe=`self.${b}=self.${b}||{${ge}:function(s,f,p){return(p=new Promise(function(a,b){s=a,f=b})).${pe}=s,p.${me}=f,p},uP:function(p){delete p.${pe};delete p.${me}},${ve}:function(p,d){p.${pe}(d),p.status="success",p.value=d,this.uP(p)},${he}:function(p,d){p.${me}(d),p.status="failure",p.value=d,this.uP(p)},uS:function(s){delete s.${Se}},${H}:function(s,t,d,c){switch(c=s.${Se},t){case 0:return c.enqueue(d);case 1:return(this.uS(s),c.error(d));case 2:return(this.uS(s),c.close())}},${be}:function(s,c){return(s=new ReadableStream({start:function(x){c=x}})).${Se}=c,s}}`;function Ue(a){return a==null?`self.${y}=self.${y}||[];`:`(self.${y}=self.${y}||{})["${l(a)}"]=[];`}var ye=new Map,P=new Map;function Me(a,e){return ye.set(e,a),P.set(a,e),e}function w(a){return ye.has(a)}function ir(a){return P.has(a)}function je(a){return S(w(a),new Error("Missing reference id")),ye.get(a)}function _e(a){return S(ir(a),new Error("Missing reference for id:"+a)),P.get(a)}typeof globalThis!==void 0?Object.defineProperty(globalThis,A,{value:P,configurable:!0,writable:!1,enumerable:!1}):typeof window!==void 0?Object.defineProperty(window,A,{value:P,configurable:!0,writable:!1,enumerable:!1}):typeof self!==void 0?Object.defineProperty(self,A,{value:P,configurable:!0,writable:!1,enumerable:!1}):typeof global!==void 0&&Object.defineProperty(global,A,{value:P,configurable:!0,writable:!1,enumerable:!1});function ne(a){switch(a){case 1/0:return De;case-1/0:return Ve;default:return a!==a?Le:Object.is(a,-0)?Be:{t:0,i:void 0,s:a,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}}function se(a){return{t:1,i:void 0,s:l(a),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function ae(a){return{t:3,i:void 0,s:""+a,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Ne(a){return{t:4,i:a,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function z(a,e){return{t:5,i:a,s:e.toISOString(),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function T(a,e){return{t:6,i:a,s:void 0,l:void 0,c:e.source,m:e.flags,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function B(a,e){let r=new Uint8Array(e),t=r.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=r[s];return{t:21,i:a,s:n,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function ie(a,e){return S(e in ce,new Error("Only well-known symbols are supported.")),{t:17,i:a,s:ce[e],l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Re(a,e){return{t:20,i:a,s:l(je(e)),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function D(a,e,r){return{t:40,i:a,s:r,l:void 0,c:l(e),m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}var v=(f=>(f[f.AggregateError=1]="AggregateError",f[f.ArrayPrototypeValues=2]="ArrayPrototypeValues",f[f.ArrowFunction=4]="ArrowFunction",f[f.BigInt=8]="BigInt",f[f.ErrorPrototypeStack=16]="ErrorPrototypeStack",f[f.Map=32]="Map",f[f.MethodShorthand=64]="MethodShorthand",f[f.ObjectAssign=128]="ObjectAssign",f[f.Promise=256]="Promise",f[f.Set=512]="Set",f[f.Symbol=1024]="Symbol",f[f.TypedArray=2048]="TypedArray",f[f.BigIntTypedArray=4096]="BigIntTypedArray",f[f.WebAPI=8192]="WebAPI",f))(v||{});function oe(a,e){return{body:e,cache:a.cache,credentials:a.credentials,headers:a.headers,integrity:a.integrity,keepalive:a.keepalive,method:a.method,mode:a.mode,redirect:a.redirect,referrer:a.referrer,referrerPolicy:a.referrerPolicy}}function de(a){return{headers:a.headers,status:a.status,statusText:a.statusText}}function le(a){return{bubbles:a.bubbles,cancelable:a.cancelable,composed:a.composed}}function ue(a){return{detail:a.detail,bubbles:a.bubbles,cancelable:a.cancelable,composed:a.composed}}var V=class{constructor(e){this.marked=new Set;this.plugins=e.plugins,this.features=16383^(e.disabledFeatures||0),this.refs=e.refs||new Map}markRef(e){this.marked.add(e)}isMarked(e){return this.marked.has(e)}getReference(e){let r=this.refs.get(e);if(r!=null)return this.markRef(r),Ne(r);let t=this.refs.size;return this.refs.set(e,t),w(e)?Re(t,e):t}getStrictReference(e){let r=this.refs.get(e);if(r!=null)return this.markRef(r),Ne(r);let t=this.refs.size;return this.refs.set(e,t),Re(t,e)}isIterable(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let r=e.constructor,t=this.features;if(t&2048)switch(r){case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return!1;default:break}if((t&4104)===4104)switch(r){case BigInt64Array:case BigUint64Array:return!1;default:break}if(t&32&&r===Map||t&512&&r===Set||t&8192&&(typeof Headers!="undefined"&&r===Headers||typeof File!="undefined"&&r===File))return!1;let n=this.plugins;if(n)for(let s=0,i=n.length;s<i;s++){let o=n[s];if(o.test(e)&&o.isIterable&&o.isIterable(e))return!1}return t&1024?Symbol.iterator in e:!1}};async function Ee(a){try{return[1,await a]}catch(e){return[0,e]}}function K(a){return a instanceof EvalError?1:a instanceof RangeError?2:a instanceof ReferenceError?3:a instanceof SyntaxError?4:a instanceof TypeError?5:a instanceof URIError?6:0}function He(a){switch(a){case"Int8Array":return Int8Array;case"Int16Array":return Int16Array;case"Int32Array":return Int32Array;case"Uint8Array":return Uint8Array;case"Uint16Array":return Uint16Array;case"Uint32Array":return Uint32Array;case"Uint8ClampedArray":return Uint8ClampedArray;case"Float32Array":return Float32Array;case"Float64Array":return Float64Array;case"BigInt64Array":return BigInt64Array;case"BigUint64Array":return BigUint64Array;default:throw new Error(`Unknown TypedArray "${a}"`)}}var dr=/^[$A-Z_][0-9A-Z_$]*$/i;function xe(a){let e=a[0];return(e==="$"||e==="_"||e>="A"&&e<="Z"||e>="a"&&e<="z")&&dr.test(a)}function L(a){return Object.isFrozen(a)?3:Object.isSealed(a)?2:Object.isExtensible(a)?0:1}function F(a,e){let r,t=Q[K(a)];a.name!==t?r={name:a.name}:a.constructor.name!==t&&(r={name:a.constructor.name});let n=Object.getOwnPropertyNames(a);for(let s=0,i=n.length,o;s<i;s++)o=n[s],o!=="name"&&o!=="message"&&(o==="stack"?e&16&&(r=r||{},r[o]=a[o]):(r=r||{},r[o]=a[o]));return r}function U(a,e){return{t:18,i:a,s:l(e.href),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function M(a,e){return{t:19,i:a,s:l(e.toString()),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function j(a,e){return{t:39,i:a,s:l(e.message),l:void 0,c:l(e.name),m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}var O=class extends V{async parseItems(e){let r=e.length,t=[],n=[];for(let s=0,i;s<r;s++)s in e&&(i=e[s],this.isIterable(i)?n[s]=i:t[s]=await this.parse(i));for(let s=0;s<r;s++)s in n&&(t[s]=await this.parse(n[s]));return t}async parseArray(e,r){return{t:9,i:e,s:void 0,l:r.length,c:void 0,m:void 0,p:void 0,e:void 0,a:await this.parseItems(r),f:void 0,b:void 0,o:L(r)}}async parseBoxed(e,r){return{t:27,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.valueOf()),b:void 0,o:void 0}}async parseTypedArray(e,r){return{t:15,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.buffer),b:r.byteOffset,o:void 0}}async parseBigIntTypedArray(e,r){return{t:16,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.buffer),b:r.byteOffset,o:void 0}}async parseDataView(e,r){return{t:22,i:e,s:void 0,l:r.byteLength,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.buffer),b:r.byteOffset,o:void 0}}async parseProperties(e){let r=Object.entries(e),t=[],n=[],s=[],i=[];for(let o=0,d=r.length,c,g;o<d;o++)c=l(r[o][0]),g=r[o][1],this.isIterable(g)?(s.push(c),i.push(g)):(t.push(c),n.push(await this.parse(g)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(await this.parse(i[o]));return this.features&1024&&Symbol.iterator in e&&(t.push(0),n.push(await this.parse(Array.from(e)))),{k:t,v:n,s:t.length}}async parsePlainObject(e,r,t){return{t:t?11:10,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:await this.parseProperties(r),e:void 0,a:void 0,f:void 0,b:void 0,o:L(r)}}async parseError(e,r){let t=F(r,this.features),n=t?await this.parseProperties(t):void 0;return{t:13,i:e,s:K(r),l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async parseMap(e,r){let t=[],n=[],s=[],i=[];for(let[o,d]of r.entries())this.isIterable(o)||this.isIterable(d)?(s.push(o),i.push(d)):(t.push(await this.parse(o)),n.push(await this.parse(d)));for(let o=0,d=s.length;o<d;o++)t.push(await this.parse(s[o])),n.push(await this.parse(i[o]));return{t:8,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:n,s:r.size},a:void 0,f:void 0,b:void 0,o:void 0}}async parseSet(e,r){let t=[],n=[];for(let s of r.keys())this.isIterable(s)?n.push(s):t.push(await this.parse(s));for(let s=0,i=n.length;s<i;s++)t.push(await this.parse(n[s]));return{t:7,i:e,s:void 0,l:r.size,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}async parseBlob(e,r){return{t:23,i:e,s:void 0,l:void 0,c:l(r.type),m:void 0,p:void 0,e:void 0,f:await this.parse(await r.arrayBuffer()),a:void 0,b:void 0,o:void 0}}async parseFile(e,r){return{t:24,i:e,s:void 0,l:void 0,c:l(r.type),m:l(r.name),p:void 0,e:void 0,f:await this.parse(await r.arrayBuffer()),a:void 0,b:r.lastModified,o:void 0}}async parsePlainProperties(e){let r=e.length,t=[],n=[],s=[],i=[];for(let o=0,d,c;o<r;o++)d=l(e[o][0]),c=e[o][1],this.isIterable(c)?(s.push(d),i.push(c)):(t.push(d),n.push(await this.parse(c)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(await this.parse(i[o]));return{k:t,v:n,s:r}}async parseHeaders(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:25,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}async parseFormData(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:26,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}async parseRequest(e,r){return{t:35,i:e,s:l(r.url),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:await this.parse(oe(r,r.body?await r.clone().arrayBuffer():null)),a:void 0,b:void 0,o:void 0}}async parseResponse(e,r){return{t:36,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:[r.body?await this.parse(await r.clone().arrayBuffer()):x,await this.parse(de(r))],b:void 0,o:void 0}}async parseEvent(e,r){return{t:37,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(le(r)),b:void 0,o:void 0}}async parseCustomEvent(e,r){return{t:38,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(ue(r)),b:void 0,o:void 0}}async parseAggregateError(e,r){let t=F(r,this.features),n=t?await this.parseProperties(t):void 0;return{t:14,i:e,s:void 0,l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async parsePromise(e,r){let[t,n]=await Ee(r);return{t:12,i:e,s:t,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(n),b:void 0,o:void 0}}async parsePlugin(e,r){let t=this.plugins;if(t)for(let n=0,s=t.length;n<s;n++){let i=t[n];if(i.parse.async&&i.test(r))return D(e,i.tag,await i.parse.async(r,this,{id:e}))}}async parseObject(e,r){if(Array.isArray(r))return this.parseArray(e,r);let t=r.constructor;switch(t){case Object:return this.parsePlainObject(e,r,!1);case void 0:return this.parsePlainObject(e,r,!0);case Date:return z(e,r);case RegExp:return T(e,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return this.parseError(e,r);case Number:case Boolean:case String:case BigInt:return this.parseBoxed(e,r);default:break}let n=this.features;if(n&256&&(t===Promise||r instanceof Promise))return this.parsePromise(e,r);if(n&2048)switch(t){case ArrayBuffer:return B(e,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return this.parseTypedArray(e,r);case DataView:return this.parseDataView(e,r);default:break}if((n&4104)===4104)switch(t){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(e,r);default:break}if(n&32&&t===Map)return this.parseMap(e,r);if(n&512&&t===Set)return this.parseSet(e,r);if(n&8192)switch(t){case(typeof URL!="undefined"?URL:u):return U(e,r);case(typeof URLSearchParams!="undefined"?URLSearchParams:u):return M(e,r);case(typeof Blob!="undefined"?Blob:u):return this.parseBlob(e,r);case(typeof File!="undefined"?File:u):return this.parseFile(e,r);case(typeof Headers!="undefined"?Headers:u):return this.parseHeaders(e,r);case(typeof FormData!="undefined"?FormData:u):return this.parseFormData(e,r);case(typeof Request!="undefined"?Request:u):return this.parseRequest(e,r);case(typeof Response!="undefined"?Response:u):return this.parseResponse(e,r);case(typeof Event!="undefined"?Event:u):return this.parseEvent(e,r);case(typeof CustomEvent!="undefined"?CustomEvent:u):return this.parseCustomEvent(e,r);case(typeof DOMException!="undefined"?DOMException:u):return j(e,r);default:break}let s=await this.parsePlugin(e,r);if(s)return s;if(n&1&&typeof AggregateError!="undefined"&&(t===AggregateError||r instanceof AggregateError))return this.parseAggregateError(e,r);if(r instanceof Error)return this.parseError(e,r);if(n&1024&&Symbol.iterator in r)return this.parsePlainObject(e,r,!!t);throw new m(r)}async parse(e){switch(e){case!0:return ee;case!1:return re;case void 0:return te;case null:return x;default:break}switch(typeof e){case"string":return se(e);case"number":return ne(e);case"bigint":return S(this.features&8,new m(e)),ae(e);case"object":{let r=this.getReference(e);return typeof r=="number"?this.parseObject(r,e):r}case"symbol":{S(this.features&1024,new m(e));let r=this.getReference(e);return typeof r=="number"?ie(r,e):r}case"function":return S(w(e),new Error("Cannot serialize function without reference ID.")),this.getStrictReference(e);default:throw new m(e)}}};var _=class extends O{constructor(){super(...arguments);this.mode="vanilla"}};function Ke(a,e){switch(e){case 3:return Object.freeze(a);case 1:return Object.preventExtensions(a);case 2:return Object.seal(a);default:return a}}function lr(){let a,e;return{resolve(r){a(r)},reject(r){e(r)},promise:new Promise((r,t)=>{a=r,e=t})}}var G=class{constructor(e){this.values=new Map;this.plugins=e.plugins,this.refs=new Set(e.markedRefs)}assignIndexedValue(e,r){return this.refs.has(e)&&this.values.set(e,r),r}deserializeReference(e){return this.assignIndexedValue(e.i,_e(p(e.s)))}deserializeArray(e){let r=e.l,t=this.assignIndexedValue(e.i,new Array(r)),n;for(let s=0;s<r;s++)n=e.a[s],n&&(t[s]=this.deserialize(n));return Ke(t,e.o),t}deserializeProperties(e,r){let t=e.s;if(t){let n,s,i=e.k,o=e.v;for(let d=0;d<t;d++)switch(n=i[d],s=this.deserialize(o[d]),n){case 0:{let c=s;r[Symbol.iterator]=()=>c.values()}break;default:r[p(n)]=s;break}}return r}deserializeObject(e){let r=this.assignIndexedValue(e.i,e.t===10?{}:Object.create(null));return this.deserializeProperties(e.p,r),Ke(r,e.o),r}deserializeDate(e){return this.assignIndexedValue(e.i,new Date(e.s))}deserializeRegExp(e){return this.assignIndexedValue(e.i,new RegExp(e.c,e.m))}deserializeSet(e){let r=this.assignIndexedValue(e.i,new Set),t=e.a;for(let n=0,s=e.l;n<s;n++)r.add(this.deserialize(t[n]));return r}deserializeMap(e){let r=this.assignIndexedValue(e.i,new Map),t=e.e.k,n=e.e.v;for(let s=0,i=e.e.s;s<i;s++)r.set(this.deserialize(t[s]),this.deserialize(n[s]));return r}deserializeArrayBuffer(e){let r=new Uint8Array(e.s);return this.assignIndexedValue(e.i,r.buffer)}deserializeTypedArray(e){let r=He(e.c),t=this.deserialize(e.f);return this.assignIndexedValue(e.i,new r(t,e.b,e.l))}deserializeDataView(e){let r=this.deserialize(e.f);return this.assignIndexedValue(e.i,new DataView(r,e.b,e.l))}deserializeDictionary(e,r){if(e.p){let t=this.deserializeProperties(e.p,{});Object.assign(r,t)}return r}deserializeAggregateError(e){let r=this.assignIndexedValue(e.i,new AggregateError([],p(e.m)));return this.deserializeDictionary(e,r)}deserializeError(e){let r=Te[e.s],t=this.assignIndexedValue(e.i,new r(p(e.m)));return this.deserializeDictionary(e,t)}async deserializePromise(e){let r=lr(),t=this.assignIndexedValue(e.i,r.promise),n=this.deserialize(e.f);return e.s?r.resolve(n):r.reject(n),t}deserializeURL(e){return this.assignIndexedValue(e.i,new URL(p(e.s)))}deserializeURLSearchParams(e){return this.assignIndexedValue(e.i,new URLSearchParams(p(e.s)))}deserializeBlob(e){let r=this.deserialize(e.f);return this.assignIndexedValue(e.i,new Blob([r],{type:p(e.c)}))}deserializeFile(e){let r=this.deserialize(e.f);return this.assignIndexedValue(e.i,new File([r],p(e.m),{type:p(e.c),lastModified:e.b}))}deserializeHeaders(e){let r=this.assignIndexedValue(e.i,new Headers),t=e.e.k,n=e.e.v;for(let s=0,i=e.e.s;s<i;s++)r.set(p(t[s]),this.deserialize(n[s]));return r}deserializeFormData(e){let r=this.assignIndexedValue(e.i,new FormData),t=e.e.k,n=e.e.v;for(let s=0,i=e.e.s;s<i;s++)r.set(p(t[s]),this.deserialize(n[s]));return r}deserializeBoxed(e){return this.assignIndexedValue(e.i,Object(this.deserialize(e.f)))}deserializeRequest(e){return this.assignIndexedValue(e.i,new Request(p(e.s),this.deserialize(e.f)))}deserializeResponse(e){return this.assignIndexedValue(e.i,new Response(this.deserialize(e.a[0]),this.deserialize(e.a[1])))}deserializeEvent(e){return this.assignIndexedValue(e.i,new Event(p(e.s),this.deserialize(e.f)))}deserializeCustomEvent(e){return this.assignIndexedValue(e.i,new CustomEvent(p(e.s),this.deserialize(e.f)))}deserializeDOMException(e){return this.assignIndexedValue(e.i,new DOMException(p(e.s),p(e.c)))}deserializePlugin(e){let r=this.plugins;if(r)for(let t=0,n=r.length;t<n;t++){let s=r[t];if(s.tag===e.c)return s.deserialize(e.s,this,{id:e.i})}throw new Error('Missing plugin for tag "'+e.c+'".')}deserialize(e){switch(e.t){case 2:return ze[e.s];case 0:return e.s;case 1:return p(e.s);case 3:return BigInt(e.s);case 4:return this.values.get(e.i);case 20:return this.deserializeReference(e);case 9:return this.deserializeArray(e);case 10:case 11:return this.deserializeObject(e);case 5:return this.deserializeDate(e);case 6:return this.deserializeRegExp(e);case 7:return this.deserializeSet(e);case 8:return this.deserializeMap(e);case 21:return this.deserializeArrayBuffer(e);case 16:case 15:return this.deserializeTypedArray(e);case 22:return this.deserializeDataView(e);case 14:return this.deserializeAggregateError(e);case 13:return this.deserializeError(e);case 12:return this.deserializePromise(e);case 17:return Ce[e.s];case 18:return this.deserializeURL(e);case 19:return this.deserializeURLSearchParams(e);case 23:return this.deserializeBlob(e);case 24:return this.deserializeFile(e);case 25:return this.deserializeHeaders(e);case 26:return this.deserializeFormData(e);case 27:return this.deserializeBoxed(e);case 35:return this.deserializeRequest(e);case 36:return this.deserializeResponse(e);case 37:return this.deserializeEvent(e);case 38:return this.deserializeCustomEvent(e);case 39:return this.deserializeDOMException(e);case 40:return this.deserializePlugin(e);default:throw new Error("invariant")}}};function W(a){switch(a.t){case"index":return a.s+"="+a.v;case"set":return a.s+".set("+a.k+","+a.v+")";case"add":return a.s+".add("+a.v+")";case"delete":return a.s+".delete("+a.k+")";default:return""}}function ur(a){let e=[],r=a[0];for(let t=1,n=a.length,s,i=r;t<n;t++)s=a[t],s.t==="index"&&s.v===i.v?r={t:"index",s:s.s,k:void 0,v:W(r)}:s.t==="set"&&s.s===i.s?r={t:"set",s:W(r),k:s.k,v:s.v}:s.t==="add"&&s.s===i.s?r={t:"add",s:W(r),k:void 0,v:s.v}:s.t==="delete"&&s.s===i.s?r={t:"delete",s:W(r),k:s.k,v:void 0}:(e.push(r),r=s),i=s;return e.push(r),e}function Ge(a){if(a.length){let e="",r=ur(a);for(let t=0,n=r.length;t<n;t++)e+=W(r[t])+",";return e}}var fr="Object.create(null)",cr="new Set",pr="new Map",mr="Promise.resolve",Sr="Promise.reject",We="Symbol.iterator";var gr={0:"[]"},vr={3:"Object.freeze",2:"Object.seal",1:"Object.preventExtensions",0:void 0},I=class{constructor(e){this.stack=[];this.flags=[];this.assignments=[];this.specials=new Set;this.plugins=e.plugins,this.features=e.features,this.marked=new Set(e.markedRefs)}markRef(e){this.marked.add(e)}isMarked(e){return this.marked.has(e)}getSpecialReference(e){let r=this.getRefParam("_"+e);return this.specials.has(e)?r:(this.specials.add(e),r+"="+gr[e])}pushObjectFlag(e,r){e!==0&&(this.markRef(r),this.flags.push({type:e,value:this.getRefParam(r)}))}resolveFlags(){let e="";for(let r=0,t=this.flags,n=t.length;r<n;r++){let s=t[r];e+=vr[s.type]+"("+s.value+"),"}return e}resolvePatches(){let e=Ge(this.assignments),r=this.resolveFlags();return e?r?e+r:e:r}createAssignment(e,r){this.assignments.push({t:"index",s:e,k:void 0,v:r})}createAddAssignment(e,r){this.assignments.push({t:"add",s:this.getRefParam(e),k:void 0,v:r})}createSetAssignment(e,r,t){this.assignments.push({t:"set",s:this.getRefParam(e),k:r,v:t})}createDeleteAssignment(e,r){this.assignments.push({t:"delete",s:this.getRefParam(e),k:r,v:void 0})}createArrayAssign(e,r,t){this.createAssignment(this.getRefParam(e)+"["+r+"]",t)}createObjectAssign(e,r,t){this.createAssignment(this.getRefParam(e)+"."+r,t)}isIndexedValueInStack(e){return e.t===4&&this.stack.includes(e.i)}serializeReference(e){return this.assignIndexedValue(e.i,A+'.get("'+e.s+'")')}getIterableAccess(){return this.features&2?".values()":"["+We+"]()"}serializeIterable(e){let r="["+We+"]",t=this.stack;this.stack=[];let n=this.serialize(e)+this.getIterableAccess();return this.stack=t,this.features&4?n=":()=>"+n:this.features&64?n="(){return "+n+"}":n=":function(){return "+n+"}",r+n}serializeArrayItem(e,r,t){return r?this.isIndexedValueInStack(r)?(this.markRef(e),this.createArrayAssign(e,t,this.getRefParam(r.i)),""):this.serialize(r):""}serializeArray(e){let r=e.i;if(e.l){this.stack.push(r);let t=e.a,n=this.serializeArrayItem(r,t[0],0),s=n==="";for(let i=1,o=e.l,d;i<o;i++)d=this.serializeArrayItem(r,t[i],i),n+=","+d,s=d==="";return this.stack.pop(),this.pushObjectFlag(e.o,e.i),this.assignIndexedValue(r,"["+n+(s?",]":"]"))}return this.assignIndexedValue(r,"[]")}serializeProperty(e,r,t){switch(r){case 0:return this.serializeIterable(t);default:{let n=Number(r),s=n>=0||xe(r);if(this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);return this.markRef(e),s&&n!==n?this.createObjectAssign(e,r,i):this.createArrayAssign(e,s?r:'"'+r+'"',i),""}return(s?r:'"'+r+'"')+":"+this.serialize(t)}}}serializeProperties(e,r){let t=r.s;if(t){this.stack.push(e);let n=r.k,s=r.v,i=this.serializeProperty(e,n[0],s[0]);for(let o=1,d=i;o<t;o++)d=this.serializeProperty(e,n[o],s[o]),i+=(d&&i&&",")+d;return this.stack.pop(),"{"+i+"}"}return"{}"}serializeObject(e){return this.pushObjectFlag(e.o,e.i),this.assignIndexedValue(e.i,this.serializeProperties(e.i,e.p))}serializeWithObjectAssign(e,r,t){let n=this.serializeProperties(r,e);return n!=="{}"?"Object.assign("+t+","+n+")":t}serializeAssignment(e,r,t,n){switch(t){case 0:{let s=this.stack;this.stack=[];let i=this.serialize(n)+this.getIterableAccess();this.stack=s;let o=this.assignments;this.assignments=r,this.createArrayAssign(e,this.getSpecialReference(0),this.features&4?"()=>"+i:"function(){return "+i+"}"),this.assignments=o}break;default:{let s=this.serialize(n),i=Number(t),o=i>=0||xe(t);if(this.isIndexedValueInStack(n))o&&i!==i?this.createObjectAssign(e,t,s):this.createArrayAssign(e,o?t:'"'+t+'"',s);else{let d=this.assignments;this.assignments=r,o?this.createObjectAssign(e,t,s):this.createArrayAssign(e,o?t:'"'+t+'"',s),this.assignments=d}}}}serializeAssignments(e,r){let t=r.s;if(t){this.stack.push(e);let n=[],s=r.k,i=r.v;for(let o=0;o<t;o++)this.serializeAssignment(e,n,s[o],i[o]);return this.stack.pop(),Ge(n)}}serializeDictionary(e,r,t){if(r)if(this.features&128)t=this.serializeWithObjectAssign(r,e,t);else{this.markRef(e);let n=this.serializeAssignments(e,r);if(n)return"("+this.assignIndexedValue(e,t)+","+n+this.getRefParam(e)+")"}return this.assignIndexedValue(e,t)}serializeNullConstructor(e){return this.pushObjectFlag(e.o,e.i),this.serializeDictionary(e.i,e.p,fr)}serializeDate(e){return this.assignIndexedValue(e.i,'new Date("'+e.s+'")')}serializeRegExp(e){return this.assignIndexedValue(e.i,"/"+e.c+"/"+e.m)}serializeSetItem(e,r){return this.isIndexedValueInStack(r)?(this.markRef(e),this.createAddAssignment(e,this.getRefParam(r.i)),""):this.serialize(r)}serializeSet(e){let r=cr,t=e.l,n=e.i;if(t){let s=e.a;this.stack.push(n);let i=this.serializeSetItem(n,s[0]);for(let o=1,d=i;o<t;o++)d=this.serializeSetItem(n,s[o]),i+=(d&&i&&",")+d;this.stack.pop(),i&&(r+="(["+i+"])")}return this.assignIndexedValue(n,r)}serializeMapEntry(e,r,t){if(this.isIndexedValueInStack(r)){let n=this.getRefParam(r.i);if(this.markRef(e),this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);return this.createSetAssignment(e,n,i),""}if(t.t!==4&&t.i!=null&&this.isMarked(t.i)){let i="("+this.serialize(t)+",["+this.getSpecialReference(0)+","+this.getSpecialReference(0)+"])";return this.createSetAssignment(e,n,this.getRefParam(t.i)),this.createDeleteAssignment(e,this.getSpecialReference(0)),i}let s=this.stack;return this.stack=[],this.createSetAssignment(e,n,this.serialize(t)),this.stack=s,""}if(this.isIndexedValueInStack(t)){let n=this.getRefParam(t.i);if(this.markRef(e),r.t!==4&&r.i!=null&&this.isMarked(r.i)){let i="("+this.serialize(r)+",["+this.getSpecialReference(0)+","+this.getSpecialReference(0)+"])";return this.createSetAssignment(e,this.getRefParam(r.i),n),this.createDeleteAssignment(e,this.getSpecialReference(0)),i}let s=this.stack;return this.stack=[],this.createSetAssignment(e,this.serialize(r),n),this.stack=s,""}return"["+this.serialize(r)+","+this.serialize(t)+"]"}serializeMap(e){let r=pr,t=e.e.s,n=e.i;if(t){let s=e.e.k,i=e.e.v;this.stack.push(n);let o=this.serializeMapEntry(n,s[0],i[0]);for(let d=1,c=o;d<t;d++)c=this.serializeMapEntry(n,s[d],i[d]),o+=(c&&o&&",")+c;this.stack.pop(),o&&(r+="(["+o+"])")}return this.assignIndexedValue(n,r)}serializeArrayBuffer(e){let r="new Uint8Array(",t=e.s,n=t.length;if(n){r+="["+t[0];for(let s=1;s<n;s++)r+=","+t[s];r+="]"}return this.assignIndexedValue(e.i,r+").buffer")}serializeTypedArray(e){return this.assignIndexedValue(e.i,"new "+e.c+"("+this.serialize(e.f)+","+e.b+","+e.l+")")}serializeDataView(e){return this.assignIndexedValue(e.i,"new DataView("+this.serialize(e.f)+","+e.b+","+e.l+")")}serializeAggregateError(e){let r=e.i;this.stack.push(r);let t='new AggregateError([],"'+e.m+'")';return this.stack.pop(),this.serializeDictionary(r,e.p,t)}serializeError(e){return this.serializeDictionary(e.i,e.p,"new "+Q[e.s]+'("'+e.m+'")')}serializePromise(e){let r,t=e.f,n=e.i,s=e.s?mr:Sr;if(this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);this.features&4?e.s?r=s+"().then(()=>"+i+")":r=s+"().catch(()=>{throw "+i+"})":e.s?r=s+"().then(function(){return "+i+"})":r=s+"().catch(function(){throw "+i+"})"}else{this.stack.push(n);let i=this.serialize(t);this.stack.pop(),r=s+"("+i+")"}return this.assignIndexedValue(n,r)}serializeWKSymbol(e){return this.assignIndexedValue(e.i,Ie[e.s])}serializeURL(e){return this.assignIndexedValue(e.i,'new URL("'+e.s+'")')}serializeURLSearchParams(e){return this.assignIndexedValue(e.i,e.s?'new URLSearchParams("'+e.s+'")':"new URLSearchParams")}serializeBlob(e){return this.assignIndexedValue(e.i,"new Blob(["+this.serialize(e.f)+'],{type:"'+e.c+'"})')}serializeFile(e){return this.assignIndexedValue(e.i,"new File(["+this.serialize(e.f)+'],"'+e.m+'",{type:"'+e.c+'",lastModified:'+e.b+"})")}serializeHeaders(e){return this.assignIndexedValue(e.i,"new Headers("+this.serializeProperties(e.i,e.e)+")")}serializeFormDataEntry(e,r,t){return this.getRefParam(e)+'.append("'+r+'",'+this.serialize(t)+")"}serializeFormDataEntries(e,r){let t=e.e.k,n=e.e.v,s=e.i,i=this.serializeFormDataEntry(s,t[0],n[0]);for(let o=1;o<r;o++)i+=","+this.serializeFormDataEntry(s,t[o],n[o]);return i}serializeFormData(e){let r=e.e.s,t=e.i;r&&this.markRef(t);let n=this.assignIndexedValue(t,"new FormData()");if(r){let s=this.serializeFormDataEntries(e,r);return"("+n+","+(s?s+",":"")+this.getRefParam(t)+")"}return n}serializeBoxed(e){return this.assignIndexedValue(e.i,"Object("+this.serialize(e.f)+")")}serializeRequest(e){return this.assignIndexedValue(e.i,'new Request("'+e.s+'",'+this.serialize(e.f)+")")}serializeResponse(e){return this.assignIndexedValue(e.i,"new Response("+this.serialize(e.a[0])+","+this.serialize(e.a[1])+")")}serializeEvent(e){return this.assignIndexedValue(e.i,'new Event("'+e.s+'",'+this.serialize(e.f)+")")}serializeCustomEvent(e){return this.assignIndexedValue(e.i,'new CustomEvent("'+e.s+'",'+this.serialize(e.f)+")")}serializeDOMException(e){return this.assignIndexedValue(e.i,'new DOMException("'+e.s+'","'+e.c+'")')}serializePlugin(e){let r=this.plugins;if(r)for(let t=0,n=r.length;t<n;t++){let s=r[t];if(s.tag===e.c)return s.serialize(e.s,this,{id:e.i})}throw new Error('Missing plugin for tag "'+e.c+'".')}serialize(e){switch(e.t){case 2:return ke[e.s];case 0:return""+e.s;case 1:return'"'+e.s+'"';case 3:return e.s+"n";case 4:return this.getRefParam(e.i);case 20:return this.serializeReference(e);case 9:return this.serializeArray(e);case 10:return this.serializeObject(e);case 11:return this.serializeNullConstructor(e);case 5:return this.serializeDate(e);case 6:return this.serializeRegExp(e);case 7:return this.serializeSet(e);case 8:return this.serializeMap(e);case 21:return this.serializeArrayBuffer(e);case 16:case 15:return this.serializeTypedArray(e);case 22:return this.serializeDataView(e);case 14:return this.serializeAggregateError(e);case 13:return this.serializeError(e);case 12:return this.serializePromise(e);case 17:return this.serializeWKSymbol(e);case 18:return this.serializeURL(e);case 19:return this.serializeURLSearchParams(e);case 23:return this.serializeBlob(e);case 24:return this.serializeFile(e);case 25:return this.serializeHeaders(e);case 26:return this.serializeFormData(e);case 27:return this.serializeBoxed(e);case 28:return this.serializePromiseConstructor(e);case 29:return this.serializePromiseResolve(e);case 30:return this.serializePromiseReject(e);case 31:return this.serializeReadableStreamConstructor(e);case 32:return this.serializeReadableStreamEnqueue(e);case 34:return this.serializeReadableStreamError(e);case 33:return this.serializeReadableStreamClose(e);case 35:return this.serializeRequest(e);case 36:return this.serializeResponse(e);case 37:return this.serializeEvent(e);case 38:return this.serializeCustomEvent(e);case 39:return this.serializeDOMException(e);case 40:return this.serializePlugin(e);default:throw new Error("invariant")}}};var Ye="hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_",$e=Ye.length,Je="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_",Xe=Je.length;function Pe(a){let e=a%$e,r=Ye[e];for(a=(a-e)/$e;a>0;)e=a%Xe,r+=Je[e],a=(a-e)/Xe;return r}var C=class extends I{constructor(){super(...arguments);this.mode="vanilla";this.valid=new Map;this.vars=[]}markRef(r){this.marked.add(r)}getRefParam(r){let t=this.valid.get(r);t==null&&(t=this.valid.size,this.valid.set(r,t));let n=this.vars[t];return n==null&&(n=Pe(t),this.vars[t]=n),n}assignIndexedValue(r,t){return this.isMarked(r)?this.getRefParam(r)+"="+t:t}serializePromiseConstructor(r){throw new Error('Unsupported node type "'+r.t+'".')}serializePromiseResolve(r){throw new Error('Unsupported node type "'+r.t+'".')}serializePromiseReject(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamConstructor(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamEnqueue(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamError(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamClose(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeTop(r){let t=this.serialize(r);if(r.i!=null&&this.vars.length){let n=this.resolvePatches(),s=t;if(n){let o=this.getRefParam(r.i);s=t+","+n+o,t.startsWith(o+"=")||(s=o+"="+s)}let i=this.vars.length>1?this.vars.join(","):this.vars[0];return this.features&4?(i=this.vars.length>1||this.vars.length===0?"("+i+")":i,"("+i+"=>("+s+"))()"):"(function("+i+"){return "+s+"})()"}return r.t===10?"("+t+")":t}};var N=class extends V{parseItems(e){let r=e.length,t=[],n=[];for(let s=0,i;s<r;s++)s in e&&(i=e[s],this.isIterable(i)?n[s]=i:t[s]=this.parse(i));for(let s=0;s<r;s++)s in n&&(t[s]=this.parse(n[s]));return t}parseArray(e,r){return{t:9,i:e,s:void 0,l:r.length,c:void 0,m:void 0,p:void 0,e:void 0,a:this.parseItems(r),f:void 0,b:void 0,o:L(r)}}parseProperties(e){let r=Object.entries(e),t=[],n=[],s=[],i=[];for(let o=0,d=r.length,c,g;o<d;o++)c=l(r[o][0]),g=r[o][1],this.isIterable(g)?(s.push(c),i.push(g)):(t.push(c),n.push(this.parse(g)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(this.parse(i[o]));return this.features&1024&&Symbol.iterator in e&&(t.push(0),n.push(this.parse(Array.from(e)))),{k:t,v:n,s:t.length}}parsePlainObject(e,r,t){return{t:t?11:10,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:this.parseProperties(r),e:void 0,a:void 0,f:void 0,b:void 0,o:L(r)}}parseBoxed(e,r){return{t:27,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.valueOf()),b:void 0,o:void 0}}parseTypedArray(e,r){return{t:15,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.buffer),b:r.byteOffset,o:void 0}}parseBigIntTypedArray(e,r){return{t:16,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.buffer),b:r.byteOffset,o:void 0}}parseDataView(e,r){return{t:22,i:e,s:void 0,l:r.byteLength,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.buffer),b:r.byteOffset,o:void 0}}parseError(e,r){let t=F(r,this.features),n=t?this.parseProperties(t):void 0;return{t:13,i:e,s:K(r),l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parseMap(e,r){let t=[],n=[],s=[],i=[];for(let[o,d]of r.entries())this.isIterable(o)||this.isIterable(d)?(s.push(o),i.push(d)):(t.push(this.parse(o)),n.push(this.parse(d)));for(let o=0,d=s.length;o<d;o++)t.push(this.parse(s[o])),n.push(this.parse(i[o]));return{t:8,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:n,s:r.size},a:void 0,f:void 0,b:void 0,o:void 0}}parseSet(e,r){let t=[],n=[];for(let s of r.keys())this.isIterable(s)?n.push(s):t.push(this.parse(s));for(let s=0,i=n.length;s<i;s++)t.push(this.parse(n[s]));return{t:7,i:e,s:void 0,l:r.size,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}parsePlainProperties(e){let r=e.length,t=[],n=[],s=[],i=[];for(let o=0,d,c;o<r;o++)d=l(e[o][0]),c=e[o][1],this.isIterable(c)?(s.push(d),i.push(c)):(t.push(d),n.push(this.parse(c)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(this.parse(i[o]));return{k:t,v:n,s:r}}parseHeaders(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:25,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}parseFormData(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:26,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}parseEvent(e,r){return{t:37,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(le(r)),b:void 0,o:void 0}}parseCustomEvent(e,r){return{t:38,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(ue(r)),b:void 0,o:void 0}}parseAggregateError(e,r){let t=F(r,this.features),n=t?this.parseProperties(t):void 0;return{t:14,i:e,s:void 0,l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parsePlugin(e,r){let t=this.plugins;if(t)for(let n=0,s=t.length;n<s;n++){let i=t[n];if(i.parse.sync&&i.test(r))return D(e,i.tag,i.parse.sync(r,this,{id:e}))}}parseObject(e,r){if(Array.isArray(r))return this.parseArray(e,r);let t=r.constructor;switch(t){case Object:return this.parsePlainObject(e,r,!1);case void 0:return this.parsePlainObject(e,r,!0);case Date:return z(e,r);case RegExp:return T(e,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return this.parseError(e,r);case Number:case Boolean:case String:case BigInt:return this.parseBoxed(e,r);default:break}let n=this.features;if(n&2048)switch(t){case ArrayBuffer:return B(e,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return this.parseTypedArray(e,r);case DataView:return this.parseDataView(e,r);default:break}if((n&4104)===4104)switch(t){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(e,r);default:break}if(n&32&&t===Map)return this.parseMap(e,r);if(n&512&&t===Set)return this.parseSet(e,r);if(n&8192)switch(t){case(typeof URL!="undefined"?URL:u):return U(e,r);case(typeof URLSearchParams!="undefined"?URLSearchParams:u):return M(e,r);case(typeof Headers!="undefined"?Headers:u):return this.parseHeaders(e,r);case(typeof FormData!="undefined"?FormData:u):return this.parseFormData(e,r);case(typeof Event!="undefined"?Event:u):return this.parseEvent(e,r);case(typeof CustomEvent!="undefined"?CustomEvent:u):return this.parseCustomEvent(e,r);case(typeof DOMException!="undefined"?DOMException:u):return j(e,r);default:break}let s=this.parsePlugin(e,r);if(s)return s;if(n&1&&typeof AggregateError!="undefined"&&(t===AggregateError||r instanceof AggregateError))return this.parseAggregateError(e,r);if(r instanceof Error)return this.parseError(e,r);if(n&1024&&Symbol.iterator in r)return this.parsePlainObject(e,r,!!t);throw new m(r)}parse(e){switch(e){case!0:return ee;case!1:return re;case void 0:return te;case null:return x;default:break}switch(typeof e){case"string":return se(e);case"number":return ne(e);case"bigint":return S(this.features&8,new m(e)),ae(e);case"object":{let r=this.getReference(e);return typeof r=="number"?this.parseObject(r,e):r}case"symbol":{S(this.features&1024,new m(e));let r=this.getReference(e);return typeof r=="number"?ie(r,e):r}case"function":return S(w(e),new Error("Cannot serialize function without reference ID.")),this.getStrictReference(e);default:throw new m(e)}}};var q=class extends N{constructor(){super(...arguments);this.mode="vanilla"}};function we(a,e={}){let r=new q({plugins:e.plugins,disabledFeatures:e.disabledFeatures}),t=r.parse(a);return new C({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}async function hr(a,e={}){let r=new _({plugins:e.plugins,disabledFeatures:e.disabledFeatures}),t=await r.parse(a);return new C({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}function br(a){return(0,eval)(a)}function yr(a,e={}){let r=new q({plugins:e.plugins,disabledFeatures:e.disabledFeatures});return{t:r.parse(a),f:r.features,m:Array.from(r.marked)}}async function Nr(a,e={}){let r=new _({plugins:e.plugins,disabledFeatures:e.disabledFeatures});return{t:await r.parse(a),f:r.features,m:Array.from(r.marked)}}function Rr(a,e={}){return new C({plugins:e.plugins,features:a.f,markedRefs:a.m}).serializeTop(a.t)}function Er(a,e={}){return new G({plugins:e.plugins,markedRefs:a.m}).deserialize(a.t)}var $=class extends O{constructor(){super(...arguments);this.mode="cross"}};var k=class extends I{constructor(r){super(r);this.mode="cross";this.scopeId=r.scopeId}getRefParam(r){return typeof r=="string"?y+"."+r:y+"["+r+"]"}assignIndexedValue(r,t){return this.getRefParam(r)+"="+t}serializePromiseConstructor(r){return this.assignIndexedValue(r.i,b+"."+ge+"()")}serializePromiseResolve(r){return b+"."+ve+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializePromiseReject(r){return b+"."+he+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializeReadableStreamConstructor(r){return this.assignIndexedValue(r.i,b+"."+be+"()")}serializeReadableStreamEnqueue(r){return b+"."+H+"("+this.getRefParam(r.i)+",0,"+this.serialize(r.f)+")"}serializeReadableStreamError(r){return b+"."+H+"("+this.getRefParam(r.i)+",1,"+this.serialize(r.f)+")"}serializeReadableStreamClose(r){return b+"."+H+"("+this.getRefParam(r.i)+",2)"}serializeTop(r){let t=this.serialize(r),n=r.i;if(n==null)return t;let s=this.resolvePatches(),i=this.getRefParam(n),o=this.scopeId==null?"":y,d=s?t+","+s:t;if(o==="")return s?"("+d+i+")":d;let c=this.scopeId==null?"()":"("+y+'["'+l(this.scopeId)+'"])',g=d+(s?i:"");return this.features&4?"("+o+"=>("+g+"))"+c:"(function("+o+"){return "+g+"})"+c}};var X=class extends N{constructor(r){super(r);this.alive=!0;this.pending=0;this.onParseCallback=r.onParse,this.onErrorCallback=r.onError,this.onDoneCallback=r.onDone}onParse(r,t){this.onParseCallback(r,t)}onError(r){if(this.onErrorCallback)this.onErrorCallback(r);else throw r}onDone(){this.onDoneCallback&&this.onDoneCallback()}push(r){this.onParse(this.parse(r),!1)}pushPendingState(){this.pending++}popPendingState(){--this.pending<=0&&this.onDone()}pushReadableStreamReader(r,t){t.read().then(n=>{if(this.alive)if(n.done)this.onParse({t:33,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0},!1),this.popPendingState();else{let s=this.parseWithError(n.value);s&&(this.onParse({t:32,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.pushReadableStreamReader(r,t))}},n=>{if(this.alive){let s=this.parseWithError(n);s&&(this.onParse({t:34,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.popPendingState())}})}parseReadableStream(r,t){let n=t.getReader();return this.pushPendingState(),this.pushReadableStreamReader(r,n),{t:31,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parseRequest(r,t){return{t:35,i:r,s:l(t.url),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:this.parse(oe(t,t.clone().body)),a:void 0,b:void 0,o:void 0}}parseResponse(r,t){return{t:36,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:[t.body?this.parse(t.clone().body):x,this.parse(de(t))],b:void 0,o:void 0}}parsePromise(r,t){return t.then(n=>{let s=this.parseWithError(n);s&&(this.onParse({t:29,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.popPendingState())},n=>{if(this.alive){let s=this.parseWithError(n);s&&(this.onParse({t:30,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.popPendingState())}}),this.pushPendingState(),{t:28,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parsePlugin(r,t){let n=this.plugins;if(n)for(let s=0,i=n.length;s<i;s++){let o=n[s];if(o.parse.stream&&o.test(t))return D(r,o.tag,o.parse.stream(t,this,{id:r}))}}parseObject(r,t){if(Array.isArray(t))return this.parseArray(r,t);let n=t.constructor;switch(n){case Object:return this.parsePlainObject(r,t,!1);case void 0:return this.parsePlainObject(r,t,!0);case Date:return z(r,t);case RegExp:return T(r,t);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return this.parseError(r,t);case Number:case Boolean:case String:case BigInt:return this.parseBoxed(r,t);default:break}let s=this.features;if(s&256&&(n===Promise||t instanceof Promise))return this.parsePromise(r,t);if(s&2048)switch(n){case ArrayBuffer:return B(r,t);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return this.parseTypedArray(r,t);case DataView:return this.parseDataView(r,t);default:break}if((s&4104)===4104)switch(n){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(r,t);default:break}if(s&32&&n===Map)return this.parseMap(r,t);if(s&512&&n===Set)return this.parseSet(r,t);if(s&8192)switch(n){case(typeof URL!="undefined"?URL:u):return U(r,t);case(typeof URLSearchParams!="undefined"?URLSearchParams:u):return M(r,t);case(typeof Headers!="undefined"?Headers:u):return this.parseHeaders(r,t);case(typeof FormData!="undefined"?FormData:u):return this.parseFormData(r,t);case(typeof ReadableStream!="undefined"?ReadableStream:u):return this.parseReadableStream(r,t);case(typeof Request!="undefined"?Request:u):return this.parseRequest(r,t);case(typeof Response!="undefined"?Response:u):return this.parseResponse(r,t);case(typeof Event!="undefined"?Event:u):return this.parseEvent(r,t);case(typeof CustomEvent!="undefined"?CustomEvent:u):return this.parseCustomEvent(r,t);case(typeof DOMException!="undefined"?DOMException:u):return j(r,t);default:break}let i=this.parsePlugin(r,t);if(i)return i;if(s&1&&typeof AggregateError!="undefined"&&(n===AggregateError||t instanceof AggregateError))return this.parseAggregateError(r,t);if(t instanceof Error)return this.parseError(r,t);if(s&1024&&Symbol.iterator in t)return this.parsePlainObject(r,t,!!n);throw new m(t)}parseWithError(r){try{return this.parse(r)}catch(t){this.onError(t);return}}start(r){let t=this.parseWithError(r);t&&(this.onParse(t,!0),this.pending<=0&&this.destroy())}destroy(){this.alive&&(this.onDone(),this.alive=!1)}isAlive(){return this.alive}};var Y=class extends X{constructor(){super(...arguments);this.mode="cross"}};var J=class extends N{constructor(){super(...arguments);this.mode="cross"}};function xr(a,e={}){let r=new J({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=r.parse(a);return new k({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}).serializeTop(t)}async function Ar(a,e={}){let r=new $({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=await r.parse(a);return new k({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}).serializeTop(t)}function Oe(a,e){let r=new Y({refs:e.refs,disabledFeatures:e.disabledFeatures,onParse(t,n){let s=new k({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}),i;try{i=s.serializeTop(t)}catch(o){e.onError&&e.onError(o);return}e.onSerialize(i,n)},onError:e.onError,onDone:e.onDone});return r.start(a),()=>{r.destroy()}}var Z=class{constructor(e){this.options=e;this.alive=!0;this.flushed=!1;this.done=!1;this.pending=0;this.cleanups=[];this.refs=new Map}write(e,r){this.alive&&!this.flushed&&(this.pending++,this.cleanups.push(Oe(r,{scopeId:this.options.scopeId,refs:this.refs,disabledFeatures:this.options.disabledFeatures,onError:this.options.onError,onSerialize:(t,n)=>{this.alive&&this.options.onData(n?this.options.globalIdentifier+'["'+l(e)+'"]='+t:t)},onDone:()=>{this.alive&&(this.pending--,this.pending<=0&&this.flushed&&!this.done&&this.options.onDone&&(this.options.onDone(),this.done=!0))}})))}flush(){this.alive&&(this.flushed=!0,this.pending<=0&&!this.done&&this.options.onDone&&(this.options.onDone(),this.done=!0))}close(){if(this.alive){for(let e=0,r=this.cleanups.length;e<r;e++)this.cleanups[e]();!this.done&&this.options.onDone&&(this.options.onDone(),this.done=!0),this.alive=!1}}};function Pr(a){return a}var wr=we;
|
|
1
|
+
"use strict";var ce=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var rr=Object.prototype.hasOwnProperty;var tr=(a,e)=>{for(var r in e)ce(a,r,{get:e[r],enumerable:!0})},nr=(a,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of er(e))!rr.call(a,n)&&n!==r&&ce(a,n,{get:()=>e[n],enumerable:!(t=Qe(e,n))||t.enumerable});return a};var sr=a=>nr(ce({},"__esModule",{value:!0}),a);var Ir={};tr(Ir,{Feature:()=>h,GLOBAL_CONTEXT_API_SCRIPT:()=>Ue,Serializer:()=>Z,compileJSON:()=>Er,createPlugin:()=>Pr,createReference:()=>je,crossSerialize:()=>Ar,crossSerializeAsync:()=>wr,crossSerializeStream:()=>Ie,default:()=>Or,deserialize:()=>yr,fromJSON:()=>xr,getCrossReferenceHeader:()=>Me,serialize:()=>Oe,serializeAsync:()=>br,toJSON:()=>Nr,toJSONAsync:()=>Rr});module.exports=sr(Ir);var{toString:ar}=Object.prototype,m=class extends Error{constructor(r){super('Unsupported type "'+ar.call(r)+'"');this.value=r}};function S(a,e){if(!a)throw e}var Ce={0:"Symbol.asyncIterator",1:"Symbol.hasInstance",2:"Symbol.isConcatSpreadable",3:"Symbol.iterator",4:"Symbol.match",5:"Symbol.matchAll",6:"Symbol.replace",7:"Symbol.search",8:"Symbol.species",9:"Symbol.split",10:"Symbol.toPrimitive",11:"Symbol.toStringTag",12:"Symbol.unscopables"},pe={[Symbol.asyncIterator]:0,[Symbol.hasInstance]:1,[Symbol.isConcatSpreadable]:2,[Symbol.iterator]:3,[Symbol.match]:4,[Symbol.matchAll]:5,[Symbol.replace]:6,[Symbol.search]:7,[Symbol.species]:8,[Symbol.split]:9,[Symbol.toPrimitive]:10,[Symbol.toStringTag]:11,[Symbol.unscopables]:12},ke={0:Symbol.asyncIterator,1:Symbol.hasInstance,2:Symbol.isConcatSpreadable,3:Symbol.iterator,4:Symbol.match,5:Symbol.matchAll,6:Symbol.replace,7:Symbol.search,8:Symbol.species,9:Symbol.split,10:Symbol.toPrimitive,11:Symbol.toStringTag,12:Symbol.unscopables},ze={2:"!0",3:"!1",1:"void 0",0:"null",4:"-0",5:"1/0",6:"-1/0",7:"0/0"},Te={2:!0,3:!1,1:void 0,0:null,4:-0,5:1/0,6:-1/0,7:NaN};var Q={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},Be={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError},u=Symbol("why");function R(a){return{t:2,i:void 0,s:a,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}var ee=R(2),re=R(3),te=R(1),E=R(0),De=R(4),Ve=R(5),Le=R(6),Fe=R(7);function ir(a){switch(a){case'"':return'\\"';case"\\":return"\\\\";case`
|
|
2
|
+
`:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case" ":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return}}function l(a){let e="",r=0,t;for(let n=0,s=a.length;n<s;n++)t=ir(a[n]),t&&(e+=a.slice(r,n)+t,r=n+1);return r===0?e=a:e+=a.slice(r),e}function p(a){return a.replace(/\\"/g,'"').replace(/\\\\/g,"\\").replace(/\\n/g,`
|
|
3
|
+
`).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\t/g," ").replace(/\\f/g,"\f").replace(/\\x3C/g,"<").replace(/\\u2028/g,"\u2028").replace(/\\u2029/g,"\u2029")}var A="__SEROVAL_REFS__",b="_$",x="$R",me="s",Se="f",he="P",ve="Ps",be="Pf",ge="c",ye="S",H="Se",ne=`self.${b}`,Ue=`${ne}=${ne}||{${he}:function(s,f,p){return(p=new Promise(function(a,b){s=a,f=b})).${me}=s,p.${Se}=f,p},uP:function(p){delete p.${me};delete p.${Se}},${ve}:function(p,d){p.${me}(d),p.status="success",p.value=d,this.uP(p)},${be}:function(p,d){p.${Se}(d),p.status="failure",p.value=d,this.uP(p)},uS:function(s){delete s.${ge}},${H}:function(s,t,d,c){switch(c=s.${ge},t){case 0:return c.enqueue(d);case 1:return(this.uS(s),c.error(d));case 2:return(this.uS(s),c.close())}},${ye}:function(s,c){return(s=new ReadableStream({start:function(x){c=x}})).${ge}=c,s}}`;function Me(a){return a==null?`self.${x}=self.${x}||[];`:`(${ne}=${ne}||{})["${l(a)}"]=[];`}var Ne=new Map,w=new Map;function je(a,e){return Ne.set(e,a),w.set(a,e),e}function P(a){return Ne.has(a)}function or(a){return w.has(a)}function _e(a){return S(P(a),new Error("Missing reference id")),Ne.get(a)}function qe(a){return S(or(a),new Error("Missing reference for id:"+a)),w.get(a)}typeof globalThis!==void 0?Object.defineProperty(globalThis,A,{value:w,configurable:!0,writable:!1,enumerable:!1}):typeof window!==void 0?Object.defineProperty(window,A,{value:w,configurable:!0,writable:!1,enumerable:!1}):typeof self!==void 0?Object.defineProperty(self,A,{value:w,configurable:!0,writable:!1,enumerable:!1}):typeof global!==void 0&&Object.defineProperty(global,A,{value:w,configurable:!0,writable:!1,enumerable:!1});function se(a){switch(a){case 1/0:return Ve;case-1/0:return Le;default:return a!==a?Fe:Object.is(a,-0)?De:{t:0,i:void 0,s:a,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}}function ae(a){return{t:1,i:void 0,s:l(a),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function ie(a){return{t:3,i:void 0,s:""+a,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Re(a){return{t:4,i:a,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function z(a,e){return{t:5,i:a,s:e.toISOString(),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function T(a,e){return{t:6,i:a,s:void 0,l:void 0,c:e.source,m:e.flags,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function B(a,e){let r=new Uint8Array(e),t=r.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=r[s];return{t:21,i:a,s:n,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function oe(a,e){return S(e in pe,new Error("Only well-known symbols are supported.")),{t:17,i:a,s:pe[e],l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Ee(a,e){return{t:20,i:a,s:l(_e(e)),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function D(a,e,r){return{t:40,i:a,s:r,l:void 0,c:l(e),m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}var h=(f=>(f[f.AggregateError=1]="AggregateError",f[f.ArrayPrototypeValues=2]="ArrayPrototypeValues",f[f.ArrowFunction=4]="ArrowFunction",f[f.BigInt=8]="BigInt",f[f.ErrorPrototypeStack=16]="ErrorPrototypeStack",f[f.Map=32]="Map",f[f.MethodShorthand=64]="MethodShorthand",f[f.ObjectAssign=128]="ObjectAssign",f[f.Promise=256]="Promise",f[f.Set=512]="Set",f[f.Symbol=1024]="Symbol",f[f.TypedArray=2048]="TypedArray",f[f.BigIntTypedArray=4096]="BigIntTypedArray",f[f.WebAPI=8192]="WebAPI",f))(h||{});function de(a,e){return{body:e,cache:a.cache,credentials:a.credentials,headers:a.headers,integrity:a.integrity,keepalive:a.keepalive,method:a.method,mode:a.mode,redirect:a.redirect,referrer:a.referrer,referrerPolicy:a.referrerPolicy}}function le(a){return{headers:a.headers,status:a.status,statusText:a.statusText}}function ue(a){return{bubbles:a.bubbles,cancelable:a.cancelable,composed:a.composed}}function fe(a){return{detail:a.detail,bubbles:a.bubbles,cancelable:a.cancelable,composed:a.composed}}var V=class{constructor(e){this.marked=new Set;this.plugins=e.plugins,this.features=16383^(e.disabledFeatures||0),this.refs=e.refs||new Map}markRef(e){this.marked.add(e)}isMarked(e){return this.marked.has(e)}getReference(e){let r=this.refs.get(e);if(r!=null)return this.markRef(r),Re(r);let t=this.refs.size;return this.refs.set(e,t),P(e)?Ee(t,e):t}getStrictReference(e){let r=this.refs.get(e);if(r!=null)return this.markRef(r),Re(r);let t=this.refs.size;return this.refs.set(e,t),Ee(t,e)}isIterable(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let r=e.constructor,t=this.features;if(t&2048)switch(r){case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return!1;default:break}if((t&4104)===4104)switch(r){case BigInt64Array:case BigUint64Array:return!1;default:break}if(t&32&&r===Map||t&512&&r===Set||t&8192&&(typeof Headers!="undefined"&&r===Headers||typeof File!="undefined"&&r===File))return!1;let n=this.plugins;if(n)for(let s=0,i=n.length;s<i;s++){let o=n[s];if(o.test(e)&&o.isIterable&&o.isIterable(e))return!1}return t&1024?Symbol.iterator in e:!1}};async function xe(a){try{return[1,await a]}catch(e){return[0,e]}}function K(a){return a instanceof EvalError?1:a instanceof RangeError?2:a instanceof ReferenceError?3:a instanceof SyntaxError?4:a instanceof TypeError?5:a instanceof URIError?6:0}function Ke(a){switch(a){case"Int8Array":return Int8Array;case"Int16Array":return Int16Array;case"Int32Array":return Int32Array;case"Uint8Array":return Uint8Array;case"Uint16Array":return Uint16Array;case"Uint32Array":return Uint32Array;case"Uint8ClampedArray":return Uint8ClampedArray;case"Float32Array":return Float32Array;case"Float64Array":return Float64Array;case"BigInt64Array":return BigInt64Array;case"BigUint64Array":return BigUint64Array;default:throw new Error(`Unknown TypedArray "${a}"`)}}var lr=/^[$A-Z_][0-9A-Z_$]*$/i;function Ae(a){let e=a[0];return(e==="$"||e==="_"||e>="A"&&e<="Z"||e>="a"&&e<="z")&&lr.test(a)}function L(a){return Object.isFrozen(a)?3:Object.isSealed(a)?2:Object.isExtensible(a)?0:1}function F(a,e){let r,t=Q[K(a)];a.name!==t?r={name:a.name}:a.constructor.name!==t&&(r={name:a.constructor.name});let n=Object.getOwnPropertyNames(a);for(let s=0,i=n.length,o;s<i;s++)o=n[s],o!=="name"&&o!=="message"&&(o==="stack"?e&16&&(r=r||{},r[o]=a[o]):(r=r||{},r[o]=a[o]));return r}function U(a,e){return{t:18,i:a,s:l(e.href),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function M(a,e){return{t:19,i:a,s:l(e.toString()),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function j(a,e){return{t:39,i:a,s:l(e.message),l:void 0,c:l(e.name),m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}var O=class extends V{async parseItems(e){let r=e.length,t=[],n=[];for(let s=0,i;s<r;s++)s in e&&(i=e[s],this.isIterable(i)?n[s]=i:t[s]=await this.parse(i));for(let s=0;s<r;s++)s in n&&(t[s]=await this.parse(n[s]));return t}async parseArray(e,r){return{t:9,i:e,s:void 0,l:r.length,c:void 0,m:void 0,p:void 0,e:void 0,a:await this.parseItems(r),f:void 0,b:void 0,o:L(r)}}async parseBoxed(e,r){return{t:27,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.valueOf()),b:void 0,o:void 0}}async parseTypedArray(e,r){return{t:15,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.buffer),b:r.byteOffset,o:void 0}}async parseBigIntTypedArray(e,r){return{t:16,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.buffer),b:r.byteOffset,o:void 0}}async parseDataView(e,r){return{t:22,i:e,s:void 0,l:r.byteLength,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(r.buffer),b:r.byteOffset,o:void 0}}async parseProperties(e){let r=Object.entries(e),t=[],n=[],s=[],i=[];for(let o=0,d=r.length,c,g;o<d;o++)c=l(r[o][0]),g=r[o][1],this.isIterable(g)?(s.push(c),i.push(g)):(t.push(c),n.push(await this.parse(g)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(await this.parse(i[o]));return this.features&1024&&Symbol.iterator in e&&(t.push(0),n.push(await this.parse(Array.from(e)))),{k:t,v:n,s:t.length}}async parsePlainObject(e,r,t){return{t:t?11:10,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:await this.parseProperties(r),e:void 0,a:void 0,f:void 0,b:void 0,o:L(r)}}async parseError(e,r){let t=F(r,this.features),n=t?await this.parseProperties(t):void 0;return{t:13,i:e,s:K(r),l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async parseMap(e,r){let t=[],n=[],s=[],i=[];for(let[o,d]of r.entries())this.isIterable(o)||this.isIterable(d)?(s.push(o),i.push(d)):(t.push(await this.parse(o)),n.push(await this.parse(d)));for(let o=0,d=s.length;o<d;o++)t.push(await this.parse(s[o])),n.push(await this.parse(i[o]));return{t:8,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:n,s:r.size},a:void 0,f:void 0,b:void 0,o:void 0}}async parseSet(e,r){let t=[],n=[];for(let s of r.keys())this.isIterable(s)?n.push(s):t.push(await this.parse(s));for(let s=0,i=n.length;s<i;s++)t.push(await this.parse(n[s]));return{t:7,i:e,s:void 0,l:r.size,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}async parseBlob(e,r){return{t:23,i:e,s:void 0,l:void 0,c:l(r.type),m:void 0,p:void 0,e:void 0,f:await this.parse(await r.arrayBuffer()),a:void 0,b:void 0,o:void 0}}async parseFile(e,r){return{t:24,i:e,s:void 0,l:void 0,c:l(r.type),m:l(r.name),p:void 0,e:void 0,f:await this.parse(await r.arrayBuffer()),a:void 0,b:r.lastModified,o:void 0}}async parsePlainProperties(e){let r=e.length,t=[],n=[],s=[],i=[];for(let o=0,d,c;o<r;o++)d=l(e[o][0]),c=e[o][1],this.isIterable(c)?(s.push(d),i.push(c)):(t.push(d),n.push(await this.parse(c)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(await this.parse(i[o]));return{k:t,v:n,s:r}}async parseHeaders(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:25,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}async parseFormData(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:26,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}async parseRequest(e,r){return{t:35,i:e,s:l(r.url),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:await this.parse(de(r,r.body?await r.clone().arrayBuffer():null)),a:void 0,b:void 0,o:void 0}}async parseResponse(e,r){return{t:36,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:[r.body?await this.parse(await r.clone().arrayBuffer()):E,await this.parse(le(r))],b:void 0,o:void 0}}async parseEvent(e,r){return{t:37,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(ue(r)),b:void 0,o:void 0}}async parseCustomEvent(e,r){return{t:38,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(fe(r)),b:void 0,o:void 0}}async parseAggregateError(e,r){let t=F(r,this.features),n=t?await this.parseProperties(t):void 0;return{t:14,i:e,s:void 0,l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async parsePromise(e,r){let[t,n]=await xe(r);return{t:12,i:e,s:t,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await this.parse(n),b:void 0,o:void 0}}async parsePlugin(e,r){let t=this.plugins;if(t)for(let n=0,s=t.length;n<s;n++){let i=t[n];if(i.parse.async&&i.test(r))return D(e,i.tag,await i.parse.async(r,this,{id:e}))}}async parseObject(e,r){if(Array.isArray(r))return this.parseArray(e,r);let t=r.constructor;switch(t){case Object:return this.parsePlainObject(e,r,!1);case void 0:return this.parsePlainObject(e,r,!0);case Date:return z(e,r);case RegExp:return T(e,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return this.parseError(e,r);case Number:case Boolean:case String:case BigInt:return this.parseBoxed(e,r);default:break}let n=this.features;if(n&256&&(t===Promise||r instanceof Promise))return this.parsePromise(e,r);if(n&2048)switch(t){case ArrayBuffer:return B(e,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return this.parseTypedArray(e,r);case DataView:return this.parseDataView(e,r);default:break}if((n&4104)===4104)switch(t){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(e,r);default:break}if(n&32&&t===Map)return this.parseMap(e,r);if(n&512&&t===Set)return this.parseSet(e,r);if(n&8192)switch(t){case(typeof URL!="undefined"?URL:u):return U(e,r);case(typeof URLSearchParams!="undefined"?URLSearchParams:u):return M(e,r);case(typeof Blob!="undefined"?Blob:u):return this.parseBlob(e,r);case(typeof File!="undefined"?File:u):return this.parseFile(e,r);case(typeof Headers!="undefined"?Headers:u):return this.parseHeaders(e,r);case(typeof FormData!="undefined"?FormData:u):return this.parseFormData(e,r);case(typeof Request!="undefined"?Request:u):return this.parseRequest(e,r);case(typeof Response!="undefined"?Response:u):return this.parseResponse(e,r);case(typeof Event!="undefined"?Event:u):return this.parseEvent(e,r);case(typeof CustomEvent!="undefined"?CustomEvent:u):return this.parseCustomEvent(e,r);case(typeof DOMException!="undefined"?DOMException:u):return j(e,r);default:break}let s=await this.parsePlugin(e,r);if(s)return s;if(n&1&&typeof AggregateError!="undefined"&&(t===AggregateError||r instanceof AggregateError))return this.parseAggregateError(e,r);if(r instanceof Error)return this.parseError(e,r);if(n&1024&&Symbol.iterator in r)return this.parsePlainObject(e,r,!!t);throw new m(r)}async parse(e){switch(e){case!0:return ee;case!1:return re;case void 0:return te;case null:return E;default:break}switch(typeof e){case"string":return ae(e);case"number":return se(e);case"bigint":return S(this.features&8,new m(e)),ie(e);case"object":{let r=this.getReference(e);return typeof r=="number"?this.parseObject(r,e):r}case"symbol":{S(this.features&1024,new m(e));let r=this.getReference(e);return typeof r=="number"?oe(r,e):r}case"function":return S(P(e),new Error("Cannot serialize function without reference ID.")),this.getStrictReference(e);default:throw new m(e)}}};var _=class extends O{constructor(){super(...arguments);this.mode="vanilla"}};function Ge(a,e){switch(e){case 3:return Object.freeze(a);case 1:return Object.preventExtensions(a);case 2:return Object.seal(a);default:return a}}function ur(){let a,e;return{resolve(r){a(r)},reject(r){e(r)},promise:new Promise((r,t)=>{a=r,e=t})}}var G=class{constructor(e){this.values=new Map;this.plugins=e.plugins,this.refs=new Set(e.markedRefs)}assignIndexedValue(e,r){return this.refs.has(e)&&this.values.set(e,r),r}deserializeReference(e){return this.assignIndexedValue(e.i,qe(p(e.s)))}deserializeArray(e){let r=e.l,t=this.assignIndexedValue(e.i,new Array(r)),n;for(let s=0;s<r;s++)n=e.a[s],n&&(t[s]=this.deserialize(n));return Ge(t,e.o),t}deserializeProperties(e,r){let t=e.s;if(t){let n,s,i=e.k,o=e.v;for(let d=0;d<t;d++)switch(n=i[d],s=this.deserialize(o[d]),n){case 0:{let c=s;r[Symbol.iterator]=()=>c.values()}break;default:r[p(n)]=s;break}}return r}deserializeObject(e){let r=this.assignIndexedValue(e.i,e.t===10?{}:Object.create(null));return this.deserializeProperties(e.p,r),Ge(r,e.o),r}deserializeDate(e){return this.assignIndexedValue(e.i,new Date(e.s))}deserializeRegExp(e){return this.assignIndexedValue(e.i,new RegExp(e.c,e.m))}deserializeSet(e){let r=this.assignIndexedValue(e.i,new Set),t=e.a;for(let n=0,s=e.l;n<s;n++)r.add(this.deserialize(t[n]));return r}deserializeMap(e){let r=this.assignIndexedValue(e.i,new Map),t=e.e.k,n=e.e.v;for(let s=0,i=e.e.s;s<i;s++)r.set(this.deserialize(t[s]),this.deserialize(n[s]));return r}deserializeArrayBuffer(e){let r=new Uint8Array(e.s);return this.assignIndexedValue(e.i,r.buffer)}deserializeTypedArray(e){let r=Ke(e.c),t=this.deserialize(e.f);return this.assignIndexedValue(e.i,new r(t,e.b,e.l))}deserializeDataView(e){let r=this.deserialize(e.f);return this.assignIndexedValue(e.i,new DataView(r,e.b,e.l))}deserializeDictionary(e,r){if(e.p){let t=this.deserializeProperties(e.p,{});Object.assign(r,t)}return r}deserializeAggregateError(e){let r=this.assignIndexedValue(e.i,new AggregateError([],p(e.m)));return this.deserializeDictionary(e,r)}deserializeError(e){let r=Be[e.s],t=this.assignIndexedValue(e.i,new r(p(e.m)));return this.deserializeDictionary(e,t)}async deserializePromise(e){let r=ur(),t=this.assignIndexedValue(e.i,r.promise),n=this.deserialize(e.f);return e.s?r.resolve(n):r.reject(n),t}deserializeURL(e){return this.assignIndexedValue(e.i,new URL(p(e.s)))}deserializeURLSearchParams(e){return this.assignIndexedValue(e.i,new URLSearchParams(p(e.s)))}deserializeBlob(e){let r=this.deserialize(e.f);return this.assignIndexedValue(e.i,new Blob([r],{type:p(e.c)}))}deserializeFile(e){let r=this.deserialize(e.f);return this.assignIndexedValue(e.i,new File([r],p(e.m),{type:p(e.c),lastModified:e.b}))}deserializeHeaders(e){let r=this.assignIndexedValue(e.i,new Headers),t=e.e.k,n=e.e.v;for(let s=0,i=e.e.s;s<i;s++)r.set(p(t[s]),this.deserialize(n[s]));return r}deserializeFormData(e){let r=this.assignIndexedValue(e.i,new FormData),t=e.e.k,n=e.e.v;for(let s=0,i=e.e.s;s<i;s++)r.set(p(t[s]),this.deserialize(n[s]));return r}deserializeBoxed(e){return this.assignIndexedValue(e.i,Object(this.deserialize(e.f)))}deserializeRequest(e){return this.assignIndexedValue(e.i,new Request(p(e.s),this.deserialize(e.f)))}deserializeResponse(e){return this.assignIndexedValue(e.i,new Response(this.deserialize(e.a[0]),this.deserialize(e.a[1])))}deserializeEvent(e){return this.assignIndexedValue(e.i,new Event(p(e.s),this.deserialize(e.f)))}deserializeCustomEvent(e){return this.assignIndexedValue(e.i,new CustomEvent(p(e.s),this.deserialize(e.f)))}deserializeDOMException(e){return this.assignIndexedValue(e.i,new DOMException(p(e.s),p(e.c)))}deserializePlugin(e){let r=this.plugins;if(r)for(let t=0,n=r.length;t<n;t++){let s=r[t];if(s.tag===e.c)return s.deserialize(e.s,this,{id:e.i})}throw new Error('Missing plugin for tag "'+e.c+'".')}deserialize(e){switch(e.t){case 2:return Te[e.s];case 0:return e.s;case 1:return p(e.s);case 3:return BigInt(e.s);case 4:return this.values.get(e.i);case 20:return this.deserializeReference(e);case 9:return this.deserializeArray(e);case 10:case 11:return this.deserializeObject(e);case 5:return this.deserializeDate(e);case 6:return this.deserializeRegExp(e);case 7:return this.deserializeSet(e);case 8:return this.deserializeMap(e);case 21:return this.deserializeArrayBuffer(e);case 16:case 15:return this.deserializeTypedArray(e);case 22:return this.deserializeDataView(e);case 14:return this.deserializeAggregateError(e);case 13:return this.deserializeError(e);case 12:return this.deserializePromise(e);case 17:return ke[e.s];case 18:return this.deserializeURL(e);case 19:return this.deserializeURLSearchParams(e);case 23:return this.deserializeBlob(e);case 24:return this.deserializeFile(e);case 25:return this.deserializeHeaders(e);case 26:return this.deserializeFormData(e);case 27:return this.deserializeBoxed(e);case 35:return this.deserializeRequest(e);case 36:return this.deserializeResponse(e);case 37:return this.deserializeEvent(e);case 38:return this.deserializeCustomEvent(e);case 39:return this.deserializeDOMException(e);case 40:return this.deserializePlugin(e);default:throw new Error("invariant")}}};function W(a){switch(a.t){case"index":return a.s+"="+a.v;case"set":return a.s+".set("+a.k+","+a.v+")";case"add":return a.s+".add("+a.v+")";case"delete":return a.s+".delete("+a.k+")";default:return""}}function fr(a){let e=[],r=a[0];for(let t=1,n=a.length,s,i=r;t<n;t++)s=a[t],s.t==="index"&&s.v===i.v?r={t:"index",s:s.s,k:void 0,v:W(r)}:s.t==="set"&&s.s===i.s?r={t:"set",s:W(r),k:s.k,v:s.v}:s.t==="add"&&s.s===i.s?r={t:"add",s:W(r),k:void 0,v:s.v}:s.t==="delete"&&s.s===i.s?r={t:"delete",s:W(r),k:s.k,v:void 0}:(e.push(r),r=s),i=s;return e.push(r),e}function We(a){if(a.length){let e="",r=fr(a);for(let t=0,n=r.length;t<n;t++)e+=W(r[t])+",";return e}}var cr="Object.create(null)",pr="new Set",mr="new Map",Sr="Promise.resolve",gr="Promise.reject",$e="Symbol.iterator";var hr={0:"[]"},vr={3:"Object.freeze",2:"Object.seal",1:"Object.preventExtensions",0:void 0},I=class{constructor(e){this.stack=[];this.flags=[];this.assignments=[];this.specials=new Set;this.plugins=e.plugins,this.features=e.features,this.marked=new Set(e.markedRefs)}markRef(e){this.marked.add(e)}isMarked(e){return this.marked.has(e)}getSpecialReference(e){let r=this.getRefParam("_"+e);return this.specials.has(e)?r:(this.specials.add(e),r+"="+hr[e])}pushObjectFlag(e,r){e!==0&&(this.markRef(r),this.flags.push({type:e,value:this.getRefParam(r)}))}resolveFlags(){let e="";for(let r=0,t=this.flags,n=t.length;r<n;r++){let s=t[r];e+=vr[s.type]+"("+s.value+"),"}return e}resolvePatches(){let e=We(this.assignments),r=this.resolveFlags();return e?r?e+r:e:r}createAssignment(e,r){this.assignments.push({t:"index",s:e,k:void 0,v:r})}createAddAssignment(e,r){this.assignments.push({t:"add",s:this.getRefParam(e),k:void 0,v:r})}createSetAssignment(e,r,t){this.assignments.push({t:"set",s:this.getRefParam(e),k:r,v:t})}createDeleteAssignment(e,r){this.assignments.push({t:"delete",s:this.getRefParam(e),k:r,v:void 0})}createArrayAssign(e,r,t){this.createAssignment(this.getRefParam(e)+"["+r+"]",t)}createObjectAssign(e,r,t){this.createAssignment(this.getRefParam(e)+"."+r,t)}isIndexedValueInStack(e){return e.t===4&&this.stack.includes(e.i)}serializeReference(e){return this.assignIndexedValue(e.i,A+'.get("'+e.s+'")')}getIterableAccess(){return this.features&2?".values()":"["+$e+"]()"}serializeIterable(e){let r="["+$e+"]",t=this.stack;this.stack=[];let n=this.serialize(e)+this.getIterableAccess();return this.stack=t,this.features&4?n=":()=>"+n:this.features&64?n="(){return "+n+"}":n=":function(){return "+n+"}",r+n}serializeArrayItem(e,r,t){return r?this.isIndexedValueInStack(r)?(this.markRef(e),this.createArrayAssign(e,t,this.getRefParam(r.i)),""):this.serialize(r):""}serializeArray(e){let r=e.i;if(e.l){this.stack.push(r);let t=e.a,n=this.serializeArrayItem(r,t[0],0),s=n==="";for(let i=1,o=e.l,d;i<o;i++)d=this.serializeArrayItem(r,t[i],i),n+=","+d,s=d==="";return this.stack.pop(),this.pushObjectFlag(e.o,e.i),this.assignIndexedValue(r,"["+n+(s?",]":"]"))}return this.assignIndexedValue(r,"[]")}serializeProperty(e,r,t){switch(r){case 0:return this.serializeIterable(t);default:{let n=Number(r),s=n>=0||Ae(r);if(this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);return this.markRef(e),s&&n!==n?this.createObjectAssign(e,r,i):this.createArrayAssign(e,s?r:'"'+r+'"',i),""}return(s?r:'"'+r+'"')+":"+this.serialize(t)}}}serializeProperties(e,r){let t=r.s;if(t){this.stack.push(e);let n=r.k,s=r.v,i=this.serializeProperty(e,n[0],s[0]);for(let o=1,d=i;o<t;o++)d=this.serializeProperty(e,n[o],s[o]),i+=(d&&i&&",")+d;return this.stack.pop(),"{"+i+"}"}return"{}"}serializeObject(e){return this.pushObjectFlag(e.o,e.i),this.assignIndexedValue(e.i,this.serializeProperties(e.i,e.p))}serializeWithObjectAssign(e,r,t){let n=this.serializeProperties(r,e);return n!=="{}"?"Object.assign("+t+","+n+")":t}serializeAssignment(e,r,t,n){switch(t){case 0:{let s=this.stack;this.stack=[];let i=this.serialize(n)+this.getIterableAccess();this.stack=s;let o=this.assignments;this.assignments=r,this.createArrayAssign(e,this.getSpecialReference(0),this.features&4?"()=>"+i:"function(){return "+i+"}"),this.assignments=o}break;default:{let s=this.serialize(n),i=Number(t),o=i>=0||Ae(t);if(this.isIndexedValueInStack(n))o&&i!==i?this.createObjectAssign(e,t,s):this.createArrayAssign(e,o?t:'"'+t+'"',s);else{let d=this.assignments;this.assignments=r,o?this.createObjectAssign(e,t,s):this.createArrayAssign(e,o?t:'"'+t+'"',s),this.assignments=d}}}}serializeAssignments(e,r){let t=r.s;if(t){this.stack.push(e);let n=[],s=r.k,i=r.v;for(let o=0;o<t;o++)this.serializeAssignment(e,n,s[o],i[o]);return this.stack.pop(),We(n)}}serializeDictionary(e,r,t){if(r)if(this.features&128)t=this.serializeWithObjectAssign(r,e,t);else{this.markRef(e);let n=this.serializeAssignments(e,r);if(n)return"("+this.assignIndexedValue(e,t)+","+n+this.getRefParam(e)+")"}return this.assignIndexedValue(e,t)}serializeNullConstructor(e){return this.pushObjectFlag(e.o,e.i),this.serializeDictionary(e.i,e.p,cr)}serializeDate(e){return this.assignIndexedValue(e.i,'new Date("'+e.s+'")')}serializeRegExp(e){return this.assignIndexedValue(e.i,"/"+e.c+"/"+e.m)}serializeSetItem(e,r){return this.isIndexedValueInStack(r)?(this.markRef(e),this.createAddAssignment(e,this.getRefParam(r.i)),""):this.serialize(r)}serializeSet(e){let r=pr,t=e.l,n=e.i;if(t){let s=e.a;this.stack.push(n);let i=this.serializeSetItem(n,s[0]);for(let o=1,d=i;o<t;o++)d=this.serializeSetItem(n,s[o]),i+=(d&&i&&",")+d;this.stack.pop(),i&&(r+="(["+i+"])")}return this.assignIndexedValue(n,r)}serializeMapEntry(e,r,t){if(this.isIndexedValueInStack(r)){let n=this.getRefParam(r.i);if(this.markRef(e),this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);return this.createSetAssignment(e,n,i),""}if(t.t!==4&&t.i!=null&&this.isMarked(t.i)){let i="("+this.serialize(t)+",["+this.getSpecialReference(0)+","+this.getSpecialReference(0)+"])";return this.createSetAssignment(e,n,this.getRefParam(t.i)),this.createDeleteAssignment(e,this.getSpecialReference(0)),i}let s=this.stack;return this.stack=[],this.createSetAssignment(e,n,this.serialize(t)),this.stack=s,""}if(this.isIndexedValueInStack(t)){let n=this.getRefParam(t.i);if(this.markRef(e),r.t!==4&&r.i!=null&&this.isMarked(r.i)){let i="("+this.serialize(r)+",["+this.getSpecialReference(0)+","+this.getSpecialReference(0)+"])";return this.createSetAssignment(e,this.getRefParam(r.i),n),this.createDeleteAssignment(e,this.getSpecialReference(0)),i}let s=this.stack;return this.stack=[],this.createSetAssignment(e,this.serialize(r),n),this.stack=s,""}return"["+this.serialize(r)+","+this.serialize(t)+"]"}serializeMap(e){let r=mr,t=e.e.s,n=e.i;if(t){let s=e.e.k,i=e.e.v;this.stack.push(n);let o=this.serializeMapEntry(n,s[0],i[0]);for(let d=1,c=o;d<t;d++)c=this.serializeMapEntry(n,s[d],i[d]),o+=(c&&o&&",")+c;this.stack.pop(),o&&(r+="(["+o+"])")}return this.assignIndexedValue(n,r)}serializeArrayBuffer(e){let r="new Uint8Array(",t=e.s,n=t.length;if(n){r+="["+t[0];for(let s=1;s<n;s++)r+=","+t[s];r+="]"}return this.assignIndexedValue(e.i,r+").buffer")}serializeTypedArray(e){return this.assignIndexedValue(e.i,"new "+e.c+"("+this.serialize(e.f)+","+e.b+","+e.l+")")}serializeDataView(e){return this.assignIndexedValue(e.i,"new DataView("+this.serialize(e.f)+","+e.b+","+e.l+")")}serializeAggregateError(e){let r=e.i;this.stack.push(r);let t='new AggregateError([],"'+e.m+'")';return this.stack.pop(),this.serializeDictionary(r,e.p,t)}serializeError(e){return this.serializeDictionary(e.i,e.p,"new "+Q[e.s]+'("'+e.m+'")')}serializePromise(e){let r,t=e.f,n=e.i,s=e.s?Sr:gr;if(this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);this.features&4?e.s?r=s+"().then(()=>"+i+")":r=s+"().catch(()=>{throw "+i+"})":e.s?r=s+"().then(function(){return "+i+"})":r=s+"().catch(function(){throw "+i+"})"}else{this.stack.push(n);let i=this.serialize(t);this.stack.pop(),r=s+"("+i+")"}return this.assignIndexedValue(n,r)}serializeWKSymbol(e){return this.assignIndexedValue(e.i,Ce[e.s])}serializeURL(e){return this.assignIndexedValue(e.i,'new URL("'+e.s+'")')}serializeURLSearchParams(e){return this.assignIndexedValue(e.i,e.s?'new URLSearchParams("'+e.s+'")':"new URLSearchParams")}serializeBlob(e){return this.assignIndexedValue(e.i,"new Blob(["+this.serialize(e.f)+'],{type:"'+e.c+'"})')}serializeFile(e){return this.assignIndexedValue(e.i,"new File(["+this.serialize(e.f)+'],"'+e.m+'",{type:"'+e.c+'",lastModified:'+e.b+"})")}serializeHeaders(e){return this.assignIndexedValue(e.i,"new Headers("+this.serializeProperties(e.i,e.e)+")")}serializeFormDataEntry(e,r,t){return this.getRefParam(e)+'.append("'+r+'",'+this.serialize(t)+")"}serializeFormDataEntries(e,r){let t=e.e.k,n=e.e.v,s=e.i,i=this.serializeFormDataEntry(s,t[0],n[0]);for(let o=1;o<r;o++)i+=","+this.serializeFormDataEntry(s,t[o],n[o]);return i}serializeFormData(e){let r=e.e.s,t=e.i;r&&this.markRef(t);let n=this.assignIndexedValue(t,"new FormData()");if(r){let s=this.serializeFormDataEntries(e,r);return"("+n+","+(s?s+",":"")+this.getRefParam(t)+")"}return n}serializeBoxed(e){return this.assignIndexedValue(e.i,"Object("+this.serialize(e.f)+")")}serializeRequest(e){return this.assignIndexedValue(e.i,'new Request("'+e.s+'",'+this.serialize(e.f)+")")}serializeResponse(e){return this.assignIndexedValue(e.i,"new Response("+this.serialize(e.a[0])+","+this.serialize(e.a[1])+")")}serializeEvent(e){return this.assignIndexedValue(e.i,'new Event("'+e.s+'",'+this.serialize(e.f)+")")}serializeCustomEvent(e){return this.assignIndexedValue(e.i,'new CustomEvent("'+e.s+'",'+this.serialize(e.f)+")")}serializeDOMException(e){return this.assignIndexedValue(e.i,'new DOMException("'+e.s+'","'+e.c+'")')}serializePlugin(e){let r=this.plugins;if(r)for(let t=0,n=r.length;t<n;t++){let s=r[t];if(s.tag===e.c)return s.serialize(e.s,this,{id:e.i})}throw new Error('Missing plugin for tag "'+e.c+'".')}serialize(e){switch(e.t){case 2:return ze[e.s];case 0:return""+e.s;case 1:return'"'+e.s+'"';case 3:return e.s+"n";case 4:return this.getRefParam(e.i);case 20:return this.serializeReference(e);case 9:return this.serializeArray(e);case 10:return this.serializeObject(e);case 11:return this.serializeNullConstructor(e);case 5:return this.serializeDate(e);case 6:return this.serializeRegExp(e);case 7:return this.serializeSet(e);case 8:return this.serializeMap(e);case 21:return this.serializeArrayBuffer(e);case 16:case 15:return this.serializeTypedArray(e);case 22:return this.serializeDataView(e);case 14:return this.serializeAggregateError(e);case 13:return this.serializeError(e);case 12:return this.serializePromise(e);case 17:return this.serializeWKSymbol(e);case 18:return this.serializeURL(e);case 19:return this.serializeURLSearchParams(e);case 23:return this.serializeBlob(e);case 24:return this.serializeFile(e);case 25:return this.serializeHeaders(e);case 26:return this.serializeFormData(e);case 27:return this.serializeBoxed(e);case 28:return this.serializePromiseConstructor(e);case 29:return this.serializePromiseResolve(e);case 30:return this.serializePromiseReject(e);case 31:return this.serializeReadableStreamConstructor(e);case 32:return this.serializeReadableStreamEnqueue(e);case 34:return this.serializeReadableStreamError(e);case 33:return this.serializeReadableStreamClose(e);case 35:return this.serializeRequest(e);case 36:return this.serializeResponse(e);case 37:return this.serializeEvent(e);case 38:return this.serializeCustomEvent(e);case 39:return this.serializeDOMException(e);case 40:return this.serializePlugin(e);default:throw new Error("invariant")}}};var Je="hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_",Xe=Je.length,Ze="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_",Ye=Ze.length;function Pe(a){let e=a%Xe,r=Je[e];for(a=(a-e)/Xe;a>0;)e=a%Ye,r+=Ze[e],a=(a-e)/Ye;return r}var C=class extends I{constructor(){super(...arguments);this.mode="vanilla";this.valid=new Map;this.vars=[]}markRef(r){this.marked.add(r)}getRefParam(r){let t=this.valid.get(r);t==null&&(t=this.valid.size,this.valid.set(r,t));let n=this.vars[t];return n==null&&(n=Pe(t),this.vars[t]=n),n}assignIndexedValue(r,t){return this.isMarked(r)?this.getRefParam(r)+"="+t:t}serializePromiseConstructor(r){throw new Error('Unsupported node type "'+r.t+'".')}serializePromiseResolve(r){throw new Error('Unsupported node type "'+r.t+'".')}serializePromiseReject(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamConstructor(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamEnqueue(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamError(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeReadableStreamClose(r){throw new Error('Unsupported node type "'+r.t+'".')}serializeTop(r){let t=this.serialize(r);if(r.i!=null&&this.vars.length){let n=this.resolvePatches(),s=t;if(n){let o=this.getRefParam(r.i);s=t+","+n+o,t.startsWith(o+"=")||(s=o+"="+s)}let i=this.vars.length>1?this.vars.join(","):this.vars[0];return this.features&4?(i=this.vars.length>1||this.vars.length===0?"("+i+")":i,"("+i+"=>("+s+"))()"):"(function("+i+"){return "+s+"})()"}return r.t===10?"("+t+")":t}};var y=class extends V{parseItems(e){let r=e.length,t=[],n=[];for(let s=0,i;s<r;s++)s in e&&(i=e[s],this.isIterable(i)?n[s]=i:t[s]=this.parse(i));for(let s=0;s<r;s++)s in n&&(t[s]=this.parse(n[s]));return t}parseArray(e,r){return{t:9,i:e,s:void 0,l:r.length,c:void 0,m:void 0,p:void 0,e:void 0,a:this.parseItems(r),f:void 0,b:void 0,o:L(r)}}parseProperties(e){let r=Object.entries(e),t=[],n=[],s=[],i=[];for(let o=0,d=r.length,c,g;o<d;o++)c=l(r[o][0]),g=r[o][1],this.isIterable(g)?(s.push(c),i.push(g)):(t.push(c),n.push(this.parse(g)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(this.parse(i[o]));return this.features&1024&&Symbol.iterator in e&&(t.push(0),n.push(this.parse(Array.from(e)))),{k:t,v:n,s:t.length}}parsePlainObject(e,r,t){return{t:t?11:10,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:this.parseProperties(r),e:void 0,a:void 0,f:void 0,b:void 0,o:L(r)}}parseBoxed(e,r){return{t:27,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.valueOf()),b:void 0,o:void 0}}parseTypedArray(e,r){return{t:15,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.buffer),b:r.byteOffset,o:void 0}}parseBigIntTypedArray(e,r){return{t:16,i:e,s:void 0,l:r.length,c:r.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.buffer),b:r.byteOffset,o:void 0}}parseDataView(e,r){return{t:22,i:e,s:void 0,l:r.byteLength,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(r.buffer),b:r.byteOffset,o:void 0}}parseError(e,r){let t=F(r,this.features),n=t?this.parseProperties(t):void 0;return{t:13,i:e,s:K(r),l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parseMap(e,r){let t=[],n=[],s=[],i=[];for(let[o,d]of r.entries())this.isIterable(o)||this.isIterable(d)?(s.push(o),i.push(d)):(t.push(this.parse(o)),n.push(this.parse(d)));for(let o=0,d=s.length;o<d;o++)t.push(this.parse(s[o])),n.push(this.parse(i[o]));return{t:8,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:n,s:r.size},a:void 0,f:void 0,b:void 0,o:void 0}}parseSet(e,r){let t=[],n=[];for(let s of r.keys())this.isIterable(s)?n.push(s):t.push(this.parse(s));for(let s=0,i=n.length;s<i;s++)t.push(this.parse(n[s]));return{t:7,i:e,s:void 0,l:r.size,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}parsePlainProperties(e){let r=e.length,t=[],n=[],s=[],i=[];for(let o=0,d,c;o<r;o++)d=l(e[o][0]),c=e[o][1],this.isIterable(c)?(s.push(d),i.push(c)):(t.push(d),n.push(this.parse(c)));for(let o=0,d=s.length;o<d;o++)t.push(s[o]),n.push(this.parse(i[o]));return{k:t,v:n,s:r}}parseHeaders(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:25,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}parseFormData(e,r){let t=[];return r.forEach((n,s)=>{t.push([s,n])}),{t:26,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:this.parsePlainProperties(t),a:void 0,f:void 0,b:void 0,o:void 0}}parseEvent(e,r){return{t:37,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(ue(r)),b:void 0,o:void 0}}parseCustomEvent(e,r){return{t:38,i:e,s:l(r.type),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parse(fe(r)),b:void 0,o:void 0}}parseAggregateError(e,r){let t=F(r,this.features),n=t?this.parseProperties(t):void 0;return{t:14,i:e,s:void 0,l:void 0,c:void 0,m:l(r.message),p:n,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parsePlugin(e,r){let t=this.plugins;if(t)for(let n=0,s=t.length;n<s;n++){let i=t[n];if(i.parse.sync&&i.test(r))return D(e,i.tag,i.parse.sync(r,this,{id:e}))}}parseObject(e,r){if(Array.isArray(r))return this.parseArray(e,r);let t=r.constructor;switch(t){case Object:return this.parsePlainObject(e,r,!1);case void 0:return this.parsePlainObject(e,r,!0);case Date:return z(e,r);case RegExp:return T(e,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return this.parseError(e,r);case Number:case Boolean:case String:case BigInt:return this.parseBoxed(e,r);default:break}let n=this.features;if(n&2048)switch(t){case ArrayBuffer:return B(e,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return this.parseTypedArray(e,r);case DataView:return this.parseDataView(e,r);default:break}if((n&4104)===4104)switch(t){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(e,r);default:break}if(n&32&&t===Map)return this.parseMap(e,r);if(n&512&&t===Set)return this.parseSet(e,r);if(n&8192)switch(t){case(typeof URL!="undefined"?URL:u):return U(e,r);case(typeof URLSearchParams!="undefined"?URLSearchParams:u):return M(e,r);case(typeof Headers!="undefined"?Headers:u):return this.parseHeaders(e,r);case(typeof FormData!="undefined"?FormData:u):return this.parseFormData(e,r);case(typeof Event!="undefined"?Event:u):return this.parseEvent(e,r);case(typeof CustomEvent!="undefined"?CustomEvent:u):return this.parseCustomEvent(e,r);case(typeof DOMException!="undefined"?DOMException:u):return j(e,r);default:break}let s=this.parsePlugin(e,r);if(s)return s;if(n&1&&typeof AggregateError!="undefined"&&(t===AggregateError||r instanceof AggregateError))return this.parseAggregateError(e,r);if(r instanceof Error)return this.parseError(e,r);if(n&1024&&Symbol.iterator in r)return this.parsePlainObject(e,r,!!t);throw new m(r)}parse(e){switch(e){case!0:return ee;case!1:return re;case void 0:return te;case null:return E;default:break}switch(typeof e){case"string":return ae(e);case"number":return se(e);case"bigint":return S(this.features&8,new m(e)),ie(e);case"object":{let r=this.getReference(e);return typeof r=="number"?this.parseObject(r,e):r}case"symbol":{S(this.features&1024,new m(e));let r=this.getReference(e);return typeof r=="number"?oe(r,e):r}case"function":return S(P(e),new Error("Cannot serialize function without reference ID.")),this.getStrictReference(e);default:throw new m(e)}}};var q=class extends y{constructor(){super(...arguments);this.mode="vanilla"}};function Oe(a,e={}){let r=new q({plugins:e.plugins,disabledFeatures:e.disabledFeatures}),t=r.parse(a);return new C({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}async function br(a,e={}){let r=new _({plugins:e.plugins,disabledFeatures:e.disabledFeatures}),t=await r.parse(a);return new C({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}function yr(a){return(0,eval)(a)}function Nr(a,e={}){let r=new q({plugins:e.plugins,disabledFeatures:e.disabledFeatures});return{t:r.parse(a),f:r.features,m:Array.from(r.marked)}}async function Rr(a,e={}){let r=new _({plugins:e.plugins,disabledFeatures:e.disabledFeatures});return{t:await r.parse(a),f:r.features,m:Array.from(r.marked)}}function Er(a,e={}){return new C({plugins:e.plugins,features:a.f,markedRefs:a.m}).serializeTop(a.t)}function xr(a,e={}){return new G({plugins:e.plugins,markedRefs:a.m}).deserialize(a.t)}var $=class extends O{constructor(){super(...arguments);this.mode="cross"}};var k=class extends I{constructor(r){super(r);this.mode="cross";this.scopeId=r.scopeId}getRefParam(r){return typeof r=="string"?x+"."+r:x+"["+r+"]"}assignIndexedValue(r,t){return this.getRefParam(r)+"="+t}serializePromiseConstructor(r){return this.assignIndexedValue(r.i,b+"."+he+"()")}serializePromiseResolve(r){return b+"."+ve+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializePromiseReject(r){return b+"."+be+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializeReadableStreamConstructor(r){return this.assignIndexedValue(r.i,b+"."+ye+"()")}serializeReadableStreamEnqueue(r){return b+"."+H+"("+this.getRefParam(r.i)+",0,"+this.serialize(r.f)+")"}serializeReadableStreamError(r){return b+"."+H+"("+this.getRefParam(r.i)+",1,"+this.serialize(r.f)+")"}serializeReadableStreamClose(r){return b+"."+H+"("+this.getRefParam(r.i)+",2)"}serializeTop(r){let t=this.serialize(r),n=r.i;if(n==null)return t;let s=this.resolvePatches(),i=this.getRefParam(n),o=this.scopeId==null?"":x,d=s?t+","+s:t;if(o==="")return s?"("+d+i+")":d;let c=this.scopeId==null?"()":"("+x+'["'+l(this.scopeId)+'"])',g=d+(s?i:"");return this.features&4?"("+o+"=>("+g+"))"+c:"(function("+o+"){return "+g+"})"+c}};var X=class extends y{constructor(r){super(r);this.alive=!0;this.pending=0;this.onParseCallback=r.onParse,this.onErrorCallback=r.onError,this.onDoneCallback=r.onDone}onParse(r,t){this.onParseCallback(r,t)}onError(r){if(this.onErrorCallback)this.onErrorCallback(r);else throw r}onDone(){this.onDoneCallback&&this.onDoneCallback()}push(r){this.onParse(this.parse(r),!1)}pushPendingState(){this.pending++}popPendingState(){--this.pending<=0&&this.onDone()}pushReadableStreamReader(r,t){t.read().then(n=>{if(this.alive)if(n.done)this.onParse({t:33,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0},!1),this.popPendingState();else{let s=this.parseWithError(n.value);s&&(this.onParse({t:32,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.pushReadableStreamReader(r,t))}},n=>{if(this.alive){let s=this.parseWithError(n);s&&(this.onParse({t:34,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.popPendingState())}})}parseReadableStream(r,t){let n=t.getReader();return this.pushPendingState(),this.pushReadableStreamReader(r,n),{t:31,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parseRequest(r,t){return{t:35,i:r,s:l(t.url),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:this.parse(de(t,t.clone().body)),a:void 0,b:void 0,o:void 0}}parseResponse(r,t){return{t:36,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:void 0,a:[t.body?this.parse(t.clone().body):E,this.parse(le(t))],b:void 0,o:void 0}}parsePromise(r,t){return t.then(n=>{let s=this.parseWithError(n);s&&(this.onParse({t:29,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.popPendingState())},n=>{if(this.alive){let s=this.parseWithError(n);s&&(this.onParse({t:30,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:s,b:void 0,o:void 0},!1),this.popPendingState())}}),this.pushPendingState(),{t:28,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}parsePlugin(r,t){let n=this.plugins;if(n)for(let s=0,i=n.length;s<i;s++){let o=n[s];if(o.parse.stream&&o.test(t))return D(r,o.tag,o.parse.stream(t,this,{id:r}))}}parseObject(r,t){if(Array.isArray(t))return this.parseArray(r,t);let n=t.constructor;switch(n){case Object:return this.parsePlainObject(r,t,!1);case void 0:return this.parsePlainObject(r,t,!0);case Date:return z(r,t);case RegExp:return T(r,t);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return this.parseError(r,t);case Number:case Boolean:case String:case BigInt:return this.parseBoxed(r,t);default:break}let s=this.features;if(s&256&&(n===Promise||t instanceof Promise))return this.parsePromise(r,t);if(s&2048)switch(n){case ArrayBuffer:return B(r,t);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return this.parseTypedArray(r,t);case DataView:return this.parseDataView(r,t);default:break}if((s&4104)===4104)switch(n){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(r,t);default:break}if(s&32&&n===Map)return this.parseMap(r,t);if(s&512&&n===Set)return this.parseSet(r,t);if(s&8192)switch(n){case(typeof URL!="undefined"?URL:u):return U(r,t);case(typeof URLSearchParams!="undefined"?URLSearchParams:u):return M(r,t);case(typeof Headers!="undefined"?Headers:u):return this.parseHeaders(r,t);case(typeof FormData!="undefined"?FormData:u):return this.parseFormData(r,t);case(typeof ReadableStream!="undefined"?ReadableStream:u):return this.parseReadableStream(r,t);case(typeof Request!="undefined"?Request:u):return this.parseRequest(r,t);case(typeof Response!="undefined"?Response:u):return this.parseResponse(r,t);case(typeof Event!="undefined"?Event:u):return this.parseEvent(r,t);case(typeof CustomEvent!="undefined"?CustomEvent:u):return this.parseCustomEvent(r,t);case(typeof DOMException!="undefined"?DOMException:u):return j(r,t);default:break}let i=this.parsePlugin(r,t);if(i)return i;if(s&1&&typeof AggregateError!="undefined"&&(n===AggregateError||t instanceof AggregateError))return this.parseAggregateError(r,t);if(t instanceof Error)return this.parseError(r,t);if(s&1024&&Symbol.iterator in t)return this.parsePlainObject(r,t,!!n);throw new m(t)}parseWithError(r){try{return this.parse(r)}catch(t){this.onError(t);return}}start(r){let t=this.parseWithError(r);t&&(this.onParse(t,!0),this.pending<=0&&this.destroy())}destroy(){this.alive&&(this.onDone(),this.alive=!1)}isAlive(){return this.alive}};var Y=class extends X{constructor(){super(...arguments);this.mode="cross"}};var J=class extends y{constructor(){super(...arguments);this.mode="cross"}};function Ar(a,e={}){let r=new J({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=r.parse(a);return new k({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}).serializeTop(t)}async function wr(a,e={}){let r=new $({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=await r.parse(a);return new k({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}).serializeTop(t)}function Ie(a,e){let r=new Y({refs:e.refs,disabledFeatures:e.disabledFeatures,onParse(t,n){let s=new k({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}),i;try{i=s.serializeTop(t)}catch(o){e.onError&&e.onError(o);return}e.onSerialize(i,n)},onError:e.onError,onDone:e.onDone});return r.start(a),()=>{r.destroy()}}var Z=class{constructor(e){this.options=e;this.alive=!0;this.flushed=!1;this.done=!1;this.pending=0;this.cleanups=[];this.refs=new Map;this.keys=new Set;this.ids=0}write(e,r){this.alive&&!this.flushed&&(this.pending++,this.keys.add(e),this.cleanups.push(Ie(r,{scopeId:this.options.scopeId,refs:this.refs,disabledFeatures:this.options.disabledFeatures,onError:this.options.onError,onSerialize:(t,n)=>{this.alive&&this.options.onData(n?this.options.globalIdentifier+'["'+l(e)+'"]='+t:t)},onDone:()=>{this.alive&&(this.pending--,this.pending<=0&&this.flushed&&!this.done&&this.options.onDone&&(this.options.onDone(),this.done=!0))}})))}getNextID(){for(;this.keys.has(""+this.ids);)this.ids++;return""+this.ids}push(e){let r=this.getNextID();return this.write(r,e),r}flush(){this.alive&&(this.flushed=!0,this.pending<=0&&!this.done&&this.options.onDone&&(this.options.onDone(),this.done=!0))}close(){if(this.alive){for(let e=0,r=this.cleanups.length;e<r;e++)this.cleanups[e]();!this.done&&this.options.onDone&&(this.options.onDone(),this.done=!0),this.alive=!1}}};function Pr(a){return a}var Or=Oe;
|
|
@@ -187,12 +187,13 @@ var GLOBAL_CONTEXT_PROMISE_REJECT = "Pf";
|
|
|
187
187
|
var LOCAL_CONTEXT_STREAM_CONTROLLER = "c";
|
|
188
188
|
var GLOBAL_CONTEXT_STREAM_CONSTRUCTOR = "S";
|
|
189
189
|
var GLOBAL_CONTEXT_STREAM_EMIT = "Se";
|
|
190
|
-
var
|
|
190
|
+
var GLOBAL_CONTEXT_API_REF = `self.${GLOBAL_CONTEXT_API}`;
|
|
191
|
+
var GLOBAL_CONTEXT_API_SCRIPT = `${GLOBAL_CONTEXT_API_REF}=${GLOBAL_CONTEXT_API_REF}||{${GLOBAL_CONTEXT_PROMISE_CONSTRUCTOR}:function(s,f,p){return(p=new Promise(function(a,b){s=a,f=b})).${LOCAL_CONTEXT_PROMISE_RESOLVE}=s,p.${LOCAL_CONTEXT_PROMISE_REJECT}=f,p},uP:function(p){delete p.${LOCAL_CONTEXT_PROMISE_RESOLVE};delete p.${LOCAL_CONTEXT_PROMISE_REJECT}},${GLOBAL_CONTEXT_PROMISE_RESOLVE}:function(p,d){p.${LOCAL_CONTEXT_PROMISE_RESOLVE}(d),p.status="success",p.value=d,this.uP(p)},${GLOBAL_CONTEXT_PROMISE_REJECT}:function(p,d){p.${LOCAL_CONTEXT_PROMISE_REJECT}(d),p.status="failure",p.value=d,this.uP(p)},uS:function(s){delete s.${LOCAL_CONTEXT_STREAM_CONTROLLER}},${GLOBAL_CONTEXT_STREAM_EMIT}:function(s,t,d,c){switch(c=s.${LOCAL_CONTEXT_STREAM_CONTROLLER},t){case 0:return c.enqueue(d);case 1:return(this.uS(s),c.error(d));case 2:return(this.uS(s),c.close())}},${GLOBAL_CONTEXT_STREAM_CONSTRUCTOR}:function(s,c){return(s=new ReadableStream({start:function(x){c=x}})).${LOCAL_CONTEXT_STREAM_CONTROLLER}=c,s}}`;
|
|
191
192
|
function getCrossReferenceHeader(id) {
|
|
192
193
|
if (id == null) {
|
|
193
194
|
return `self.${GLOBAL_CONTEXT_REFERENCES}=self.${GLOBAL_CONTEXT_REFERENCES}||[];`;
|
|
194
195
|
}
|
|
195
|
-
return `(
|
|
196
|
+
return `(${GLOBAL_CONTEXT_API_REF}=${GLOBAL_CONTEXT_API_REF}||{})["${serializeString(id)}"]=[];`;
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
// src/core/reference.ts
|
|
@@ -3720,10 +3721,13 @@ var Serializer = class {
|
|
|
3720
3721
|
this.pending = 0;
|
|
3721
3722
|
this.cleanups = [];
|
|
3722
3723
|
this.refs = /* @__PURE__ */ new Map();
|
|
3724
|
+
this.keys = /* @__PURE__ */ new Set();
|
|
3725
|
+
this.ids = 0;
|
|
3723
3726
|
}
|
|
3724
3727
|
write(key, value) {
|
|
3725
3728
|
if (this.alive && !this.flushed) {
|
|
3726
3729
|
this.pending++;
|
|
3730
|
+
this.keys.add(key);
|
|
3727
3731
|
this.cleanups.push(crossSerializeStream(value, {
|
|
3728
3732
|
scopeId: this.options.scopeId,
|
|
3729
3733
|
refs: this.refs,
|
|
@@ -3748,6 +3752,17 @@ var Serializer = class {
|
|
|
3748
3752
|
}));
|
|
3749
3753
|
}
|
|
3750
3754
|
}
|
|
3755
|
+
getNextID() {
|
|
3756
|
+
while (this.keys.has("" + this.ids)) {
|
|
3757
|
+
this.ids++;
|
|
3758
|
+
}
|
|
3759
|
+
return "" + this.ids;
|
|
3760
|
+
}
|
|
3761
|
+
push(value) {
|
|
3762
|
+
const newID = this.getNextID();
|
|
3763
|
+
this.write(newID, value);
|
|
3764
|
+
return newID;
|
|
3765
|
+
}
|
|
3751
3766
|
flush() {
|
|
3752
3767
|
if (this.alive) {
|
|
3753
3768
|
this.flushed = true;
|