seroval 0.12.3 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/cjs/development/index.cjs +1432 -958
  2. package/dist/cjs/development/index.cjs.map +3 -3
  3. package/dist/cjs/production/index.cjs +3 -3
  4. package/dist/esm/development/index.mjs +1432 -958
  5. package/dist/esm/development/index.mjs.map +3 -3
  6. package/dist/esm/production/index.mjs +3 -3
  7. package/dist/types/core/Serializer.d.ts +2 -1
  8. package/dist/types/core/Serializer.d.ts.map +1 -1
  9. package/dist/types/core/base-primitives.d.ts +12 -1
  10. package/dist/types/core/base-primitives.d.ts.map +1 -1
  11. package/dist/types/core/compat.d.ts +0 -2
  12. package/dist/types/core/compat.d.ts.map +1 -1
  13. package/dist/types/core/constants.d.ts +8 -2
  14. package/dist/types/core/constants.d.ts.map +1 -1
  15. package/dist/types/core/{tree/deserialize.d.ts → context/deserializer.d.ts} +19 -13
  16. package/dist/types/core/context/deserializer.d.ts.map +1 -0
  17. package/dist/types/core/{base → context/parser}/async.d.ts +6 -5
  18. package/dist/types/core/context/parser/async.d.ts.map +1 -0
  19. package/dist/types/core/{base → context/parser}/stream.d.ts +2 -1
  20. package/dist/types/core/context/parser/stream.d.ts.map +1 -0
  21. package/dist/types/core/{base → context/parser}/sync.d.ts +7 -9
  22. package/dist/types/core/context/parser/sync.d.ts.map +1 -0
  23. package/dist/types/core/context/parser.d.ts +27 -0
  24. package/dist/types/core/context/parser.d.ts.map +1 -0
  25. package/dist/types/core/{serializer-context.old.d.ts → context/serializer.d.ts} +21 -22
  26. package/dist/types/core/context/serializer.d.ts.map +1 -0
  27. package/dist/types/core/cross/async.d.ts +2 -2
  28. package/dist/types/core/cross/async.d.ts.map +1 -1
  29. package/dist/types/core/cross/deserializer.d.ts +9 -0
  30. package/dist/types/core/cross/deserializer.d.ts.map +1 -0
  31. package/dist/types/core/cross/index.d.ts +11 -1
  32. package/dist/types/core/cross/index.d.ts.map +1 -1
  33. package/dist/types/core/cross/parser.d.ts +6 -0
  34. package/dist/types/core/cross/parser.d.ts.map +1 -0
  35. package/dist/types/core/cross/{serialize.d.ts → serializer.d.ts} +6 -5
  36. package/dist/types/core/cross/serializer.d.ts.map +1 -0
  37. package/dist/types/core/cross/stream.d.ts +2 -2
  38. package/dist/types/core/cross/stream.d.ts.map +1 -1
  39. package/dist/types/core/cross/sync.d.ts +2 -2
  40. package/dist/types/core/cross/sync.d.ts.map +1 -1
  41. package/dist/types/core/keys.d.ts +3 -1
  42. package/dist/types/core/keys.d.ts.map +1 -1
  43. package/dist/types/core/plugin.d.ts +6 -7
  44. package/dist/types/core/plugin.d.ts.map +1 -1
  45. package/dist/types/core/special-reference.d.ts +6 -0
  46. package/dist/types/core/special-reference.d.ts.map +1 -0
  47. package/dist/types/core/tree/async.d.ts +2 -2
  48. package/dist/types/core/tree/async.d.ts.map +1 -1
  49. package/dist/types/core/tree/deserializer.d.ts +13 -0
  50. package/dist/types/core/tree/deserializer.d.ts.map +1 -0
  51. package/dist/types/core/tree/{serialize.d.ts → serializer.d.ts} +4 -4
  52. package/dist/types/core/tree/serializer.d.ts.map +1 -0
  53. package/dist/types/core/tree/sync.d.ts +2 -2
  54. package/dist/types/core/tree/sync.d.ts.map +1 -1
  55. package/dist/types/core/types.d.ts +47 -6
  56. package/dist/types/core/types.d.ts.map +1 -1
  57. package/dist/types/core/utils/assert.d.ts.map +1 -0
  58. package/dist/types/core/utils/constructors.d.ts.map +1 -0
  59. package/dist/types/core/utils/deferred.d.ts +14 -0
  60. package/dist/types/core/utils/deferred.d.ts.map +1 -0
  61. package/dist/types/core/utils/error.d.ts +5 -0
  62. package/dist/types/core/utils/error.d.ts.map +1 -0
  63. package/dist/types/core/utils/get-identifier.d.ts.map +1 -0
  64. package/dist/types/core/utils/get-object-flag.d.ts +3 -0
  65. package/dist/types/core/utils/get-object-flag.d.ts.map +1 -0
  66. package/dist/types/core/utils/is-valid-identifier.d.ts +2 -0
  67. package/dist/types/core/utils/is-valid-identifier.d.ts.map +1 -0
  68. package/dist/types/core/utils/iterator-to-sequence.d.ts +20 -0
  69. package/dist/types/core/utils/iterator-to-sequence.d.ts.map +1 -0
  70. package/dist/types/core/utils/promise-to-result.d.ts.map +1 -0
  71. package/dist/types/core/utils/typed-array.d.ts +4 -0
  72. package/dist/types/core/utils/typed-array.d.ts.map +1 -0
  73. package/dist/types/core/web-api.d.ts +4 -1
  74. package/dist/types/core/web-api.d.ts.map +1 -1
  75. package/package.json +2 -2
  76. package/src/core/Serializer.ts +3 -1
  77. package/src/core/base-primitives.ts +229 -1
  78. package/src/core/compat.ts +0 -2
  79. package/src/core/constants.ts +7 -2
  80. package/src/core/{tree/deserialize.ts → context/deserializer.ts} +159 -66
  81. package/src/core/{base → context/parser}/async.ts +181 -309
  82. package/src/core/{base → context/parser}/stream.ts +86 -11
  83. package/src/core/{base → context/parser}/sync.ts +120 -281
  84. package/src/core/context/parser.ts +259 -0
  85. package/src/core/{serializer-context.old.ts → context/serializer.ts} +241 -166
  86. package/src/core/cross/async.ts +2 -2
  87. package/src/core/cross/deserializer.ts +19 -0
  88. package/src/core/cross/index.ts +68 -47
  89. package/src/core/cross/parser.ts +7 -0
  90. package/src/core/cross/{serialize.ts → serializer.ts} +31 -12
  91. package/src/core/cross/stream.ts +2 -2
  92. package/src/core/cross/sync.ts +2 -2
  93. package/src/core/is-serializable.new.ts +1 -1
  94. package/src/core/keys.ts +8 -2
  95. package/src/core/plugin.ts +7 -7
  96. package/src/core/reference.ts +1 -1
  97. package/src/core/special-reference.ts +9 -0
  98. package/src/core/tree/async.ts +2 -2
  99. package/src/core/tree/deserializer.ts +31 -0
  100. package/src/core/tree/index.ts +2 -2
  101. package/src/core/tree/{serialize.ts → serializer.ts} +5 -16
  102. package/src/core/tree/sync.ts +2 -2
  103. package/src/core/types.ts +60 -7
  104. package/src/core/utils/deferred.ts +49 -0
  105. package/src/core/{shared.ts → utils/error.ts} +3 -60
  106. package/src/core/utils/get-object-flag.ts +14 -0
  107. package/src/core/utils/is-valid-identifier.ts +11 -0
  108. package/src/core/utils/iterator-to-sequence.ts +238 -0
  109. package/src/core/utils/typed-array.ts +30 -0
  110. package/src/core/web-api.ts +75 -1
  111. package/src/example.ts +0 -3
  112. package/dist/types/core/assert.d.ts.map +0 -1
  113. package/dist/types/core/base/async.d.ts.map +0 -1
  114. package/dist/types/core/base/stream.d.ts.map +0 -1
  115. package/dist/types/core/base/sync.d.ts.map +0 -1
  116. package/dist/types/core/constructors.d.ts.map +0 -1
  117. package/dist/types/core/cross/cross-parser.d.ts +0 -8
  118. package/dist/types/core/cross/cross-parser.d.ts.map +0 -1
  119. package/dist/types/core/cross/serialize.d.ts.map +0 -1
  120. package/dist/types/core/get-identifier.d.ts.map +0 -1
  121. package/dist/types/core/parser-context.d.ts +0 -23
  122. package/dist/types/core/parser-context.d.ts.map +0 -1
  123. package/dist/types/core/promise-to-result.d.ts.map +0 -1
  124. package/dist/types/core/serializer-context.old.d.ts.map +0 -1
  125. package/dist/types/core/shared.d.ts +0 -10
  126. package/dist/types/core/shared.d.ts.map +0 -1
  127. package/dist/types/core/tree/deserialize.d.ts.map +0 -1
  128. package/dist/types/core/tree/serialize.d.ts.map +0 -1
  129. package/src/core/cross/cross-parser.ts +0 -9
  130. package/src/core/parser-context.ts +0 -131
  131. package/src/core/serializer-context.new.ts +0 -1168
  132. package/src/core/tree/parser.ts +0 -45
  133. /package/dist/types/core/{assert.d.ts → utils/assert.d.ts} +0 -0
  134. /package/dist/types/core/{constructors.d.ts → utils/constructors.d.ts} +0 -0
  135. /package/dist/types/core/{get-identifier.d.ts → utils/get-identifier.d.ts} +0 -0
  136. /package/dist/types/core/{promise-to-result.d.ts → utils/promise-to-result.d.ts} +0 -0
  137. /package/src/core/{assert.ts → utils/assert.ts} +0 -0
  138. /package/src/core/{constructors.ts → utils/constructors.ts} +0 -0
  139. /package/src/core/{get-identifier.ts → utils/get-identifier.ts} +0 -0
  140. /package/src/core/{promise-to-result.ts → utils/promise-to-result.ts} +0 -0
@@ -1,3 +1,3 @@
1
- "use strict";var ce=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var rr=Object.getOwnPropertyNames;var tr=Object.prototype.hasOwnProperty;var nr=(a,e)=>{for(var r in e)ce(a,r,{get:e[r],enumerable:!0})},sr=(a,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of rr(e))!tr.call(a,n)&&n!==r&&ce(a,n,{get:()=>e[n],enumerable:!(t=er(e,n))||t.enumerable});return a};var ar=a=>sr(ce({},"__esModule",{value:!0}),a);var Cr={};nr(Cr,{Feature:()=>h,GLOBAL_CONTEXT_API_SCRIPT:()=>Me,Serializer:()=>Z,compileJSON:()=>xr,createPlugin:()=>Or,createReference:()=>_e,crossSerialize:()=>wr,crossSerializeAsync:()=>Pr,crossSerializeStream:()=>Ie,default:()=>Ir,deserialize:()=>Nr,fromJSON:()=>Ar,getCrossReferenceHeader:()=>je,serialize:()=>Oe,serializeAsync:()=>yr,toJSON:()=>Rr,toJSONAsync:()=>Er});module.exports=ar(Cr);var{toString:ir}=Object.prototype,m=class extends Error{constructor(r){super('Unsupported type "'+ir.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 or(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=or(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 x="__SEROVAL_REFS__",b="_$",k="$R",me="s",Se="f",he="P",ve="Ps",be="Pf",ge="c",ye="S",H="Se",Ue=`self.${b}`,Me=`${Ue}=${Ue}||{${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}}`,ne=`self.${k}`;function je(a){return a==null?`${ne}=${ne}||[];`:`(${ne}=${ne}||{})["${l(a)}"]=[];`}var Ne=new Map,A=new Map;function _e(a,e){return Ne.set(e,a),A.set(a,e),e}function w(a){return Ne.has(a)}function dr(a){return A.has(a)}function qe(a){return S(w(a),new Error("Missing reference id")),Ne.get(a)}function He(a){return S(dr(a),new Error("Missing reference for id:"+a)),A.get(a)}typeof globalThis!==void 0?Object.defineProperty(globalThis,x,{value:A,configurable:!0,writable:!1,enumerable:!1}):typeof window!==void 0?Object.defineProperty(window,x,{value:A,configurable:!0,writable:!1,enumerable:!1}):typeof self!==void 0?Object.defineProperty(self,x,{value:A,configurable:!0,writable:!1,enumerable:!1}):typeof global!==void 0&&Object.defineProperty(global,x,{value:A,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(qe(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),w(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 Ge(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 ur=/^[$A-Z_][0-9A-Z_$]*$/i;function Ae(a){let e=a[0];return(e==="$"||e==="_"||e>="A"&&e<="Z"||e>="a"&&e<="z")&&ur.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 P=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(w(e),new Error("Cannot serialize function without reference ID.")),this.getStrictReference(e);default:throw new m(e)}}};var _=class extends P{constructor(){super(...arguments);this.mode="vanilla"}};function We(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 fr(){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,He(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 We(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),We(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=Ge(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=fr(),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 cr(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 $e(a){if(a.length){let e="",r=cr(a);for(let t=0,n=r.length;t<n;t++)e+=W(r[t])+",";return e}}var pr="Object.create(null)",mr="new Set",Sr="new Map",gr="Promise.resolve",hr="Promise.reject",Xe="Symbol.iterator";var vr={0:"[]"},br={3:"Object.freeze",2:"Object.seal",1:"Object.preventExtensions",0:void 0},O=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+"="+vr[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+=br[s.type]+"("+s.value+"),"}return e}resolvePatches(){let e=$e(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,x+'.get("'+e.s+'")')}getIterableAccess(){return this.features&2?".values()":"["+Xe+"]()"}serializeIterable(e){let r="["+Xe+"]",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(),$e(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,pr)}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=mr,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=Sr,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?gr:hr;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 Ze="hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_",Ye=Ze.length,Qe="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_",Je=Qe.length;function Pe(a){let e=a%Ye,r=Ze[e];for(a=(a-e)/Ye;a>0;)e=a%Je,r+=Qe[e],a=(a-e)/Je;return r}var I=class extends O{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(w(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 I({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}async function yr(a,e={}){let r=new _({plugins:e.plugins,disabledFeatures:e.disabledFeatures}),t=await r.parse(a);return new I({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}function Nr(a){return(0,eval)(a)}function Rr(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 Er(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 xr(a,e={}){return new I({plugins:e.plugins,features:a.f,markedRefs:a.m}).serializeTop(a.t)}function Ar(a,e={}){return new G({plugins:e.plugins,markedRefs:a.m}).deserialize(a.t)}var $=class extends P{constructor(){super(...arguments);this.mode="cross"}};var C=class extends O{constructor(r){super(r);this.mode="cross";this.scopeId=r.scopeId}getRefParam(r){return typeof r=="string"?k+"."+r:k+"["+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?"":k,d=s?t+","+s:t;if(o==="")return s?"("+d+i+")":d;let c=this.scopeId==null?"()":"("+k+'["'+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 wr(a,e={}){let r=new J({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=r.parse(a);return new C({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}).serializeTop(t)}async function Pr(a,e={}){let r=new $({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=await r.parse(a);return new C({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 C({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 Or(a){return a}var Ir=Oe;
1
+ "use strict";var ze=Object.defineProperty;var Cr=Object.getOwnPropertyDescriptor;var zr=Object.getOwnPropertyNames;var kr=Object.prototype.hasOwnProperty;var Tr=(n,e)=>{for(var r in e)ze(n,r,{get:e[r],enumerable:!0})},Dr=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of zr(e))!kr.call(n,s)&&s!==r&&ze(n,s,{get:()=>e[s],enumerable:!(t=Cr(e,s))||t.enumerable});return n};var Fr=n=>Dr(ze({},"__esModule",{value:!0}),n);var dt={};Tr(dt,{Feature:()=>h,GLOBAL_CONTEXT_API_SCRIPT:()=>dr,Serializer:()=>ae,compileJSON:()=>Zr,createPlugin:()=>it,createReference:()=>ur,crossSerialize:()=>et,crossSerializeAsync:()=>rt,crossSerializeStream:()=>Ye,default:()=>ot,deserialize:()=>Xr,fromCrossJSON:()=>at,fromJSON:()=>Qr,getCrossReferenceHeader:()=>lr,serialize:()=>Je,serializeAsync:()=>$r,toCrossJSON:()=>tt,toCrossJSONAsync:()=>nt,toCrossJSONStream:()=>st,toJSON:()=>Jr,toJSONAsync:()=>Yr});module.exports=Fr(dt);var{toString:Br}=Object.prototype,m=class extends Error{constructor(r){super('Unsupported type "'+Br.call(r)+'"');this.value=r}};function f(n,e){if(!n)throw e}var Ze={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"},B={[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},Qe={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},er={2:"!0",3:"!1",1:"void 0",0:"null",4:"-0",5:"1/0",6:"-1/0",7:"0/0"},rr={2:!0,3:!1,1:void 0,0:null,4:-0,5:1/0,6:-1/0,7:NaN};var ie={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},tr={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function v(n){return{t:2,i:void 0,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}}var b=v(2),N=v(3),oe=v(1),I=v(0),nr=v(4),sr=v(5),ar=v(6),ir=v(7);function Vr(n){switch(n){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 d(n){let e="",r=0,t;for(let s=0,a=n.length;s<a;s++)t=Vr(n[s]),t&&(e+=n.slice(r,s)+t,r=s+1);return r===0?e=n:e+=n.slice(r),e}function p(n){return n.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 w="__SEROVAL_REFS__",g="_$",V="$R",ke="s",Te="f",De="P",Fe="Ps",Be="Pf",ee="c",Ve="S",Me="Se",Le="St",_e="Sc",or=`self.${g}`,dr=`${or}=${or}||{${De}:function(s,f,p){return(p=new Promise(function(a,b){s=a,f=b})).${ke}=s,p.${Te}=f,p},uP:function(p){delete p.${ke};delete p.${Te}},${Fe}:function(p,d){p.${ke}(d),p.status="success",p.value=d,this.uP(p)},${Be}:function(p,d){p.${Te}(d),p.status="failure",p.value=d,this.uP(p)},uS:function(s){delete s.${ee}},${_e}:function(s){s.${ee}.close(),this.uS(s)},${Le}:function(s,e){s.${ee}.error(e),this.uS(s)},${Me}:function(s,d){s.${ee}.enqueue(d)},${Ve}:function(s,c){return(s=new ReadableStream({start:function(x){c=x}})).${ee}=c,s}}`,de=`self.${V}`;function lr(n){return n==null?`${de}=${de}||[];`:`(${de}=${de}||{})["${d(n)}"]=[];`}var Ue=new Map,P=new Map;function ur(n,e){return Ue.set(e,n),P.set(n,e),e}function O(n){return Ue.has(n)}function Mr(n){return P.has(n)}function cr(n){return f(O(n),new Error("Missing reference id")),Ue.get(n)}function fr(n){return f(Mr(n),new Error("Missing reference for id:"+n)),P.get(n)}typeof globalThis!==void 0?Object.defineProperty(globalThis,w,{value:P,configurable:!0,writable:!1,enumerable:!1}):typeof window!==void 0?Object.defineProperty(window,w,{value:P,configurable:!0,writable:!1,enumerable:!1}):typeof self!==void 0?Object.defineProperty(self,w,{value:P,configurable:!0,writable:!1,enumerable:!1}):typeof global!==void 0&&Object.defineProperty(global,w,{value:P,configurable:!0,writable:!1,enumerable:!1});var h=(u=>(u[u.AggregateError=1]="AggregateError",u[u.ArrowFunction=4]="ArrowFunction",u[u.BigInt=8]="BigInt",u[u.ErrorPrototypeStack=16]="ErrorPrototypeStack",u[u.Map=32]="Map",u[u.ObjectAssign=128]="ObjectAssign",u[u.Promise=256]="Promise",u[u.Set=512]="Set",u[u.Symbol=1024]="Symbol",u[u.TypedArray=2048]="TypedArray",u[u.BigIntTypedArray=4096]="BigIntTypedArray",u[u.WebAPI=8192]="WebAPI",u))(h||{});function le(n){return n instanceof EvalError?1:n instanceof RangeError?2:n instanceof ReferenceError?3:n instanceof SyntaxError?4:n instanceof TypeError?5:n instanceof URIError?6:0}function M(n,e){let r,t=ie[le(n)];n.name!==t?r={name:n.name}:n.constructor.name!==t&&(r={name:n.constructor.name});let s=Object.getOwnPropertyNames(n);for(let a=0,i=s.length,o;a<i;a++)o=s[a],o!=="name"&&o!=="message"&&(o==="stack"?e&16&&(r=r||{},r[o]=n[o]):(r=r||{},r[o]=n[o]));return r}function ue(n){return Object.isFrozen(n)?3:Object.isSealed(n)?2:Object.isExtensible(n)?0:1}function ce(n){switch(n){case 1/0:return sr;case-1/0:return ar;default:return n!==n?ir:Object.is(n,-0)?nr:{t:0,i:void 0,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 R(n){return{t:1,i:void 0,s:d(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 fe(n){return{t:3,i:void 0,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 E(n){return{t:4,i:n,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 L(n,e){return{t:5,i:n,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 _(n,e){return{t:6,i:n,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 U(n,e){let r=new Uint8Array(e),t=r.length,s=new Array(t);for(let a=0;a<t;a++)s[a]=r[a];return{t:21,i:n,s,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 pe(n,e){return f(e in B,new Error("Only well-known symbols are supported.")),{t:17,i:n,s:B[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 me(n,e){return{t:20,i:n,s:d(cr(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 j(n,e,r){return{t:40,i:n,s:r,l:void 0,c:d(e),m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Se(n,e,r){return{t:9,i:n,s:void 0,l:e.length,c:void 0,m:void 0,p:void 0,e:void 0,a:r,f:void 0,b:void 0,o:ue(e)}}function ge(n,e){return{t:27,i:n,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:e,b:void 0,o:void 0}}function he(n,e,r){return{t:15,i:n,s:void 0,l:e.length,c:e.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:r,b:e.byteOffset,o:void 0}}function ye(n,e,r){return{t:16,i:n,s:void 0,l:e.length,c:e.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:r,b:e.byteOffset,o:void 0}}function ve(n,e,r){return{t:22,i:n,s:void 0,l:e.byteLength,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:r,b:e.byteOffset,o:void 0}}function be(n,e,r){return{t:13,i:n,s:le(e),l:void 0,c:void 0,m:d(e.message),p:r,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Ne(n,e,r){return{t:14,i:n,s:le(e),l:void 0,c:void 0,m:d(e.message),p:r,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Re(n,e,r){return{t:7,i:n,s:void 0,l:e,c:void 0,m:void 0,p:void 0,e:void 0,a:r,f:void 0,b:void 0,o:void 0}}function q(n,e){return{t:43,i:void 0,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:[n,e],f:void 0,b:void 0,o:void 0}}function Ee(n,e){return{t:45,i:void 0,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:[n,e],f:void 0,b:void 0,o:void 0}}function xe(n,e){return{body:e,cache:n.cache,credentials:n.credentials,headers:n.headers,integrity:n.integrity,keepalive:n.keepalive,method:n.method,mode:n.mode,redirect:n.redirect,referrer:n.referrer,referrerPolicy:n.referrerPolicy}}function Ae(n){return{headers:n.headers,status:n.status,statusText:n.statusText}}function Ie(n){return{bubbles:n.bubbles,cancelable:n.cancelable,composed:n.composed}}function we(n){return{detail:n.detail,bubbles:n.bubbles,cancelable:n.cancelable,composed:n.composed}}function W(n){let e=[],r=-1,t=-1,s=n[Symbol.iterator]();for(;;)try{let a=s.next();if(e.push(a.value),a.done){t=e.length-1;break}}catch(a){r=e.length,e.push(a)}return{v:e,t:r,d:t}}function mr(n){return()=>{let e=0;return{[Symbol.iterator](){return this},next(){if(e>n.d)return{done:!0,value:void 0};let r=e++,t=n.v[r];if(r===n.t)throw t;return{done:r===n.d,value:t}}}}}async function Sr(n){let e=[],r=-1,t=-1,s=n[Symbol.asyncIterator]();for(;;)try{let a=await s.next();if(e.push(a.value),a.done){t=e.length-1;break}}catch(a){r=e.length,e.push(a)}return{v:e,t:r,d:t}}function gr(n){return()=>{let e=0;return{[Symbol.asyncIterator](){return this},async next(){if(e>n.d)return{done:!0,value:void 0};let r=e++,t=n.v[r];if(r===n.t)throw t;return Promise.resolve({done:r===n.d,value:t})}}}}function hr(n,e){return new ReadableStream({async start(r){let t=n[Symbol.asyncIterator]();for(;e.isAlive();)try{let s=await t.next();if(r.enqueue([s.done?2:0,s.value]),s.done){r.close();return}}catch(s){r.enqueue([1,s])}r.close()}})}function yr(n){let e=n;return()=>{let[r,t]=e.tee(),s=r;e=t;let a=s.getReader();return{[Symbol.asyncIterator](){return this},async next(){let i=await a.read();if(i.done)return{done:!0,value:void 0};let[o,c]=i.value;if(o===1)throw c;return{done:o===2,value:c}}}}}async function vr(n){let e=[],r=-1,t=-1,s=n.getReader();for(;;)try{let a=await s.read();if(e.push(a.value),a.done){t=e.length-1;break}}catch(a){r=e.length,t=r,e.push(a);break}return{v:e,t:r,d:t}}function br(n){return new ReadableStream({start(e){for(let r=0;r<n.d;r++)e.enqueue(n.v[r]);n.t===-1?e.close():e.error(n.v[n.t])}})}var je={},qe={},We={},Ke={},l={};var K=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),E(r);let t=this.refs.size;return this.refs.set(e,t),O(e)?me(t,e):t}getStrictReference(e){let r=this.refs.get(e);if(r!=null)return this.markRef(r),E(r);let t=this.refs.size;return this.refs.set(e,t),me(t,e)}parseFunction(e){return f(O(e),new Error("Cannot serialize function without reference ID.")),this.getStrictReference(e)}parseWKSymbol(e){f(this.features&1024,new m(e));let r=this.refs.get(e);if(r!=null)return this.markRef(r),E(r);let t=e in B;f(e in B||O(e),new Error("Cannot serialize symbol without reference ID."));let s=this.refs.size;return this.refs.set(e,s),t?pe(s,e):me(s,e)}parseMapSentinel(){let e=this.refs.get(je);if(e!=null)return this.markRef(e),E(e);let r=this.refs.size;return this.refs.set(je,r),{t:41,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}}parseIteratorFactory(){let e=this.refs.get(qe);if(e!=null)return this.markRef(e),E(e);let r=this.refs.size;return this.refs.set(qe,r),{t:42,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parseWKSymbol(Symbol.iterator),b:void 0,o:void 0}}parseAsyncIteratorFactory(){let e=this.refs.get(We);if(e!=null)return this.markRef(e),E(e);let r=this.refs.size;return this.refs.set(We,r),{t:44,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:this.parseWKSymbol(Symbol.asyncIterator),b:void 0,o:void 0}}createObjectNode(e,r,t,s){return{t:t?11:10,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:s,e:void 0,a:void 0,f:void 0,b:void 0,o:ue(r)}}createMapNode(e,r,t,s){return{t:8,i:e,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:r,v:t,s},a:void 0,f:this.parseMapSentinel(),b:void 0,o:void 0}}parseReadableStreamFactory(){let e=this.refs.get(Ke);if(e!=null)return this.markRef(e),E(e);let r=this.refs.size;return this.refs.set(Ke,r),{t:47,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}}};async function He(n){try{return[1,await n]}catch(e){return[0,e]}}function H(n,e){return{t:18,i:n,s:d(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 G(n,e){return{t:19,i:n,s:d(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 $(n,e){return{t:39,i:n,s:d(e.message),l:void 0,c:d(e.name),m:void 0,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Pe(n,e,r){return{t:37,i:n,s:d(e),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:r,b:void 0,o:void 0}}function Oe(n,e,r){return{t:38,i:n,s:d(e),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:r,b:void 0,o:void 0}}function Nr(n,e,r){return{t:46,i:n,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:[e,r],f:void 0,b:void 0,o:void 0}}var C=class extends K{async parseItems(e){let r=[];for(let t=0,s=e.length;t<s;t++)t in e&&(r[t]=await this.parse(e[t]));return r}async parseArray(e,r){return Se(e,r,await this.parseItems(r))}async parseProperties(e){let r=Object.entries(e),t=[],s=[];for(let a=0,i=r.length;a<i;a++)t.push(d(r[a][0])),s.push(await this.parse(r[a][1]));if(this.features&1024){let a=Symbol.iterator;a in e&&(t.push(this.parseWKSymbol(a)),s.push(q(this.parseIteratorFactory(),await this.parse(W(e))))),a=Symbol.asyncIterator,a in e&&(t.push(this.parseWKSymbol(a)),s.push(Ee(this.parseAsyncIteratorFactory(),await this.parse(await Sr(e))))),a=Symbol.toStringTag,a in e&&(t.push(this.parseWKSymbol(a)),s.push(R(e[a]))),a=Symbol.isConcatSpreadable,a in e&&(t.push(this.parseWKSymbol(a)),s.push(e[a]?b:N))}return{k:t,v:s,s:t.length}}async parsePlainObject(e,r,t){return this.createObjectNode(e,r,t,await this.parseProperties(r))}async parseBoxed(e,r){return ge(e,await this.parse(r.valueOf()))}async parseTypedArray(e,r){return he(e,r,await this.parse(r.buffer))}async parseBigIntTypedArray(e,r){return ye(e,r,await this.parse(r.buffer))}async parseDataView(e,r){return ve(e,r,await this.parse(r.buffer))}async parseError(e,r){let t=M(r,this.features);return be(e,r,t?await this.parseProperties(t):void 0)}async parseAggregateError(e,r){let t=M(r,this.features);return Ne(e,r,t?await this.parseProperties(t):void 0)}async parseMap(e,r){let t=[],s=[];for(let[a,i]of r.entries())t.push(await this.parse(a)),s.push(await this.parse(i));return this.createMapNode(e,t,s,r.size)}async parseSet(e,r){let t=[];for(let s of r.keys())t.push(await this.parse(s));return Re(e,r.size,t)}async parseBlob(e,r){return{t:23,i:e,s:void 0,l:void 0,c:d(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:d(r.type),m:d(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=[],s=[];for(let a=0;a<r;a++)t.push(d(e[a][0])),s.push(await this.parse(e[a][1]));return{k:t,v:s,s:r}}async parseHeaders(e,r){let t=[];return r.forEach((s,a)=>{t.push([a,s])}),{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((s,a)=>{t.push([a,s])}),{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:d(r.url),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:await this.parse(xe(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()):I,await this.parse(Ae(r))],b:void 0,o:void 0}}async parseEvent(e,r){return Pe(e,r.type,await this.parse(Ie(r)))}async parseCustomEvent(e,r){return Oe(e,r.type,await this.parse(we(r)))}async parsePromise(e,r){let[t,s]=await He(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(s),b:void 0,o:void 0}}async parsePlugin(e,r){let t=this.plugins;if(t)for(let s=0,a=t.length;s<a;s++){let i=t[s];if(i.parse.async&&i.test(r))return j(e,i.tag,await i.parse.async(r,this,{id:e}))}}async parseReadableStream(e,r){return Nr(e,this.parseReadableStreamFactory(),await this.parse(await vr(r)))}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 L(e,r);case RegExp:return _(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 s=this.features;if(s&256&&(t===Promise||r instanceof Promise))return this.parsePromise(e,r);if(s&2048)switch(t){case ArrayBuffer:return U(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((s&4104)===4104)switch(t){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(e,r);default:break}if(s&32&&t===Map)return this.parseMap(e,r);if(s&512&&t===Set)return this.parseSet(e,r);if(s&8192)switch(t){case(typeof URL!="undefined"?URL:l):return H(e,r);case(typeof URLSearchParams!="undefined"?URLSearchParams:l):return G(e,r);case(typeof Blob!="undefined"?Blob:l):return this.parseBlob(e,r);case(typeof File!="undefined"?File:l):return this.parseFile(e,r);case(typeof Headers!="undefined"?Headers:l):return this.parseHeaders(e,r);case(typeof FormData!="undefined"?FormData:l):return this.parseFormData(e,r);case(typeof Request!="undefined"?Request:l):return this.parseRequest(e,r);case(typeof Response!="undefined"?Response:l):return this.parseResponse(e,r);case(typeof Event!="undefined"?Event:l):return this.parseEvent(e,r);case(typeof CustomEvent!="undefined"?CustomEvent:l):return this.parseCustomEvent(e,r);case(typeof DOMException!="undefined"?DOMException:l):return $(e,r);case(typeof ReadableStream!="undefined"?ReadableStream:l):return this.parseReadableStream(e,r);default:break}let a=await this.parsePlugin(e,r);if(a)return a;if(s&1&&typeof AggregateError!="undefined"&&(t===AggregateError||r instanceof AggregateError))return this.parseAggregateError(e,r);if(r instanceof Error)return this.parseError(e,r);if(s&1024&&(Symbol.iterator in r||Symbol.asyncIterator in r))return this.parsePlainObject(e,r,!!t);throw new m(r)}async parse(e){switch(e){case!0:return b;case!1:return N;case void 0:return oe;case null:return I;default:break}switch(typeof e){case"string":return R(e);case"number":return ce(e);case"bigint":return f(this.features&8,new m(e)),fe(e);case"object":{let r=this.getReference(e);return typeof r=="number"?this.parseObject(r,e):r}case"symbol":return this.parseWKSymbol(e);case"function":return this.parseFunction(e);default:throw new m(e)}}};var X=class extends C{constructor(){super(...arguments);this.mode="vanilla"}};function Rr(n){switch(n){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 "${n}"`)}}function Ge(){let n,e;return{promise:new Promise((r,t)=>{n=r,e=t}),resolve(r){n(r)},reject(r){e(r)}}}function Er(){let n;return{stream:new ReadableStream({start(e){n=e}}),close(){n.close()},enqueue(e){n.enqueue(e)},error(e){n.error(e)}}}function xr(n,e){switch(e){case 3:return Object.freeze(n);case 1:return Object.preventExtensions(n);case 2:return Object.seal(n);default:return n}}var z=class{constructor(e){this.plugins=e.plugins,this.refs=e.refs||new Map}deserializeReference(e){return this.assignIndexedValue(e.i,fr(p(e.s)))}deserializeArray(e){let r=e.l,t=this.assignIndexedValue(e.i,new Array(r)),s;for(let a=0;a<r;a++)s=e.a[a],s&&(t[a]=this.deserialize(s));return xr(t,e.o),t}deserializeProperties(e,r){let t=e.s;if(t){let s=e.k,a=e.v;for(let i=0,o;i<t;i++)o=s[i],typeof o=="string"?r[p(o)]=this.deserialize(a[i]):r[this.deserialize(o)]=this.deserialize(a[i])}return r}deserializeObject(e){let r=this.assignIndexedValue(e.i,e.t===10?{}:Object.create(null));return this.deserializeProperties(e.p,r),xr(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 s=0,a=e.l;s<a;s++)r.add(this.deserialize(t[s]));return r}deserializeMap(e){let r=this.assignIndexedValue(e.i,new Map),t=e.e.k,s=e.e.v;for(let a=0,i=e.e.s;a<i;a++)r.set(this.deserialize(t[a]),this.deserialize(s[a]));return r}deserializeArrayBuffer(e){let r=new Uint8Array(e.s);return this.assignIndexedValue(e.i,r.buffer)}deserializeTypedArray(e){let r=Rr(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=tr[e.s],t=this.assignIndexedValue(e.i,new r(p(e.m)));return this.deserializeDictionary(e,t)}async deserializePromise(e){let r=Ge(),t=this.assignIndexedValue(e.i,r),s=this.deserialize(e.f);return e.s?r.resolve(s):r.reject(s),t.promise}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,s=e.e.v;for(let a=0,i=e.e.s;a<i;a++)r.set(p(t[a]),this.deserialize(s[a]));return r}deserializeFormData(e){let r=this.assignIndexedValue(e.i,new FormData),t=e.e.k,s=e.e.v;for(let a=0,i=e.e.s;a<i;a++)r.set(p(t[a]),this.deserialize(s[a]));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,s=r.length;t<s;t++){let a=r[t];if(a.tag===e.c)return this.assignIndexedValue(e.i,a.deserialize(e.s,this,{id:e.i}))}throw new Error('Missing plugin for tag "'+e.c+'".')}deserializePromiseConstructor(e){return this.assignIndexedValue(e.i,Ge()).promise}deserializePromiseResolve(e){let r=this.refs.get(e.i);f(r,new Error("Missing Promise instance.")),r.resolve(this.deserialize(e.f))}deserializePromiseReject(e){let r=this.refs.get(e.i);f(r,new Error("Missing Promise instance.")),r.reject(this.deserialize(e.f))}deserializeReadableStreamConstructor(e){return this.assignIndexedValue(e.i,Er()).stream}deserializeReadableStreamEnqueue(e){let r=this.refs.get(e.i);f(r,new Error("Missing ReadableStream instance.")),r.enqueue(this.deserialize(e.f))}deserializeReadableStreamError(e){let r=this.refs.get(e.i);f(r,new Error("Missing Promise instance.")),r.error(this.deserialize(e.f))}deserializeReadableStreamClose(e){let r=this.refs.get(e.i);f(r,new Error("Missing Promise instance.")),r.close()}deserializeIteratorFactoryInstance(e){let r=this.deserialize(e.a[1]);return mr(r)}deserializeAsyncIteratorFactoryInstance(e){let r=this.deserialize(e.a[1]);return r.constructor===ReadableStream?yr(r):gr(r)}deserializeReadableStream(e){return this.assignIndexedValue(e.i,br(this.deserialize(e.a[1])))}deserialize(e){switch(e.t){case 2:return rr[e.s];case 0:return e.s;case 1:return p(e.s);case 3:return BigInt(e.s);case 4:return this.refs.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 Qe[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);case 28:return this.deserializePromiseConstructor(e);case 29:return this.deserializePromiseResolve(e);case 30:return this.deserializePromiseReject(e);case 31:return this.deserializeReadableStreamConstructor(e);case 32:return this.deserializeReadableStreamEnqueue(e);case 34:return this.deserializeReadableStreamError(e);case 33:return this.deserializeReadableStreamClose(e);case 43:return this.deserializeIteratorFactoryInstance(e);case 45:return this.deserializeAsyncIteratorFactoryInstance(e);case 46:return this.deserializeReadableStream(e);case 41:case 42:case 44:case 47:default:throw new Error("invariant")}}};var re=class extends z{constructor(r){super({plugins:r.plugins,refs:void 0});this.mode="vanilla";this.marked=new Set(r.markedRefs)}assignIndexedValue(r,t){return this.marked.has(r)&&this.refs.set(r,t),t}};var _r=/^[$A-Z_][0-9A-Z_$]*$/i;function $e(n){let e=n[0];return(e==="$"||e==="_"||e>="A"&&e<="Z"||e>="a"&&e<="z")&&_r.test(n)}function te(n){switch(n.t){case"index":return n.s+"="+n.v;case"set":return n.s+".set("+n.k+","+n.v+")";case"add":return n.s+".add("+n.v+")";case"delete":return n.s+".delete("+n.k+")";default:return""}}function Ur(n){let e=[],r=n[0];for(let t=1,s=n.length,a,i=r;t<s;t++)a=n[t],a.t==="index"&&a.v===i.v?r={t:"index",s:a.s,k:void 0,v:te(r)}:a.t==="set"&&a.s===i.s?r={t:"set",s:te(r),k:a.k,v:a.v}:a.t==="add"&&a.s===i.s?r={t:"add",s:te(r),k:void 0,v:a.v}:a.t==="delete"&&a.s===i.s?r={t:"delete",s:te(r),k:a.k,v:void 0}:(e.push(r),r=a),i=a;return e.push(r),e}function Ar(n){if(n.length){let e="",r=Ur(n);for(let t=0,s=r.length;t<s;t++)e+=te(r[t])+",";return e}}var jr="Object.create(null)",qr="new Set",Wr="new Map",Kr="Promise.resolve",Hr="Promise.reject",Gr={3:"Object.freeze",2:"Object.seal",1:"Object.preventExtensions",0:void 0},k=class{constructor(e){this.stack=[];this.flags=[];this.assignments=[];this.plugins=e.plugins,this.features=e.features,this.marked=new Set(e.markedRefs)}createFunction(e,r){return this.features&4?(e.length===1?e[0]:"("+e.join(",")+")")+"=>"+r:"function("+e.join(",")+"){return "+r+"}"}createEffectfulFunction(e,r){return this.features&4?(e.length===1?e[0]:"("+e.join(",")+")")+"=>{"+r+"}":"function("+e.join(",")+"){"+r+"}"}markRef(e){this.marked.add(e)}isMarked(e){return this.marked.has(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,s=t.length;r<s;r++){let a=t[r];e+=Gr[a.type]+"("+a.value+"),"}return e}resolvePatches(){let e=Ar(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,w+'.get("'+e.s+'")')}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,s=this.serializeArrayItem(r,t[0],0),a=s==="";for(let i=1,o=e.l,c;i<o;i++)c=this.serializeArrayItem(r,t[i],i),s+=","+c,a=c==="";return this.stack.pop(),this.pushObjectFlag(e.o,e.i),this.assignIndexedValue(r,"["+s+(a?",]":"]"))}return this.assignIndexedValue(r,"[]")}serializeProperty(e,r,t){if(typeof r=="string"){let s=Number(r),a=s>=0||$e(r);if(this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);return this.markRef(e.i),a&&s!==s?this.createObjectAssign(e.i,r,i):this.createArrayAssign(e.i,a?r:'"'+r+'"',i),""}return(a?r:'"'+r+'"')+":"+this.serialize(t)}return"["+this.serialize(r)+"]:"+this.serialize(t)}serializeProperties(e,r){let t=r.s;if(t){this.stack.push(e.i);let s=r.k,a=r.v,i=this.serializeProperty(e,s[0],a[0]);for(let o=1,c=i;o<t;o++)c=this.serializeProperty(e,s[o],a[o]),i+=(c&&i&&",")+c;return this.stack.pop(),"{"+i+"}"}return"{}"}serializeObject(e){return this.pushObjectFlag(e.o,e.i),this.assignIndexedValue(e.i,this.serializeProperties(e,e.p))}serializeWithObjectAssign(e,r,t){let s=this.serializeProperties(e,r);return s!=="{}"?"Object.assign("+t+","+s+")":t}serializeAssignment(e,r,t,s){if(typeof t=="string"){let a=this.serialize(s),i=Number(t),o=i>=0||$e(t);if(this.isIndexedValueInStack(s))o&&i!==i?this.createObjectAssign(e.i,t,a):this.createArrayAssign(e.i,o?t:'"'+t+'"',a);else{let c=this.assignments;this.assignments=r,o?this.createObjectAssign(e.i,t,a):this.createArrayAssign(e.i,o?t:'"'+t+'"',a),this.assignments=c}}else{let a=this.stack;this.stack=[];let i=this.serialize(s);this.stack=a;let o=this.assignments;this.assignments=r,this.createArrayAssign(e.i,this.serialize(t),i),this.assignments=o}}serializeAssignments(e,r){let t=r.s;if(t){this.stack.push(e.i);let s=[],a=r.k,i=r.v;for(let o=0;o<t;o++)this.serializeAssignment(e,s,a[o],i[o]);return this.stack.pop(),Ar(s)}}serializeDictionary(e,r){if(e.p)if(this.features&128)r=this.serializeWithObjectAssign(e,e.p,r);else{this.markRef(e.i);let t=this.serializeAssignments(e,e.p);if(t)return"("+this.assignIndexedValue(e.i,r)+","+t+this.getRefParam(e.i)+")"}return this.assignIndexedValue(e.i,r)}serializeNullConstructor(e){return this.pushObjectFlag(e.o,e.i),this.serializeDictionary(e,jr)}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=qr,t=e.l,s=e.i;if(t){let a=e.a;this.stack.push(s);let i=this.serializeSetItem(s,a[0]);for(let o=1,c=i;o<t;o++)c=this.serializeSetItem(s,a[o]),i+=(c&&i&&",")+c;this.stack.pop(),i&&(r+="(["+i+"])")}return this.assignIndexedValue(s,r)}serializeMapEntry(e,r,t,s){if(this.isIndexedValueInStack(r)){let a=this.getRefParam(r.i);if(this.markRef(e),this.isIndexedValueInStack(t)){let o=this.getRefParam(t.i);return this.createSetAssignment(e,a,o),""}if(t.t!==4&&t.i!=null&&this.isMarked(t.i)){let o="("+this.serialize(t)+",["+s+","+s+"])";return this.createSetAssignment(e,a,this.getRefParam(t.i)),this.createDeleteAssignment(e,s),o}let i=this.stack;return this.stack=[],this.createSetAssignment(e,a,this.serialize(t)),this.stack=i,""}if(this.isIndexedValueInStack(t)){let a=this.getRefParam(t.i);if(this.markRef(e),r.t!==4&&r.i!=null&&this.isMarked(r.i)){let o="("+this.serialize(r)+",["+s+","+s+"])";return this.createSetAssignment(e,this.getRefParam(r.i),a),this.createDeleteAssignment(e,s),o}let i=this.stack;return this.stack=[],this.createSetAssignment(e,this.serialize(r),a),this.stack=i,""}return"["+this.serialize(r)+","+this.serialize(t)+"]"}serializeMap(e){let r=Wr,t=e.e.s,s=e.i,a=e.f,i=this.getRefParam(a.i);if(t){let o=e.e.k,c=e.e.v;this.stack.push(s);let A=this.serializeMapEntry(s,o[0],c[0],i);for(let F=1,Ce=A;F<t;F++)Ce=this.serializeMapEntry(s,o[F],c[F],i),A+=(Ce&&A&&",")+Ce;this.stack.pop(),A&&(r+="(["+A+"])")}return a.t===41&&(this.markRef(a.i),r="("+this.serialize(a)+","+r+")"),this.assignIndexedValue(s,r)}serializeArrayBuffer(e){let r="new Uint8Array(",t=e.s,s=t.length;if(s){r+="["+t[0];for(let a=1;a<s;a++)r+=","+t[a];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(e,t)}serializeError(e){return this.serializeDictionary(e,"new "+ie[e.s]+'("'+e.m+'")')}serializePromise(e){let r,t=e.f,s=e.i,a=e.s?Kr:Hr;if(this.isIndexedValueInStack(t)){let i=this.getRefParam(t.i);r=a+(e.s?"().then("+this.createFunction([],i)+")":"().catch("+this.createEffectfulFunction([],"throw "+i)+")")}else{this.stack.push(s);let i=this.serialize(t);this.stack.pop(),r=a+"("+i+")"}return this.assignIndexedValue(s,r)}serializeWKSymbol(e){return this.assignIndexedValue(e.i,Ze[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,e.e)+")")}serializeFormDataEntry(e,r,t){return this.getRefParam(e)+'.append("'+r+'",'+this.serialize(t)+")"}serializeFormDataEntries(e,r){let t=e.e.k,s=e.e.v,a=e.i,i=this.serializeFormDataEntry(a,t[0],s[0]);for(let o=1;o<r;o++)i+=","+this.serializeFormDataEntry(a,t[o],s[o]);return i}serializeFormData(e){let r=e.e.s,t=e.i;r&&this.markRef(t);let s=this.assignIndexedValue(t,"new FormData()");if(r){let a=this.serializeFormDataEntries(e,r);return"("+s+","+(a?a+",":"")+this.getRefParam(t)+")"}return s}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,s=r.length;t<s;t++){let a=r[t];if(a.tag===e.c)return this.assignIndexedValue(e.i,a.serialize(e.s,this,{id:e.i}))}throw new Error('Missing plugin for tag "'+e.c+'".')}serializeMapSentinel(e){return this.assignIndexedValue(e.i,"[]")}serializeIteratorFactory(e){return this.assignIndexedValue(e.i,this.createFunction(["s"],this.createFunction(["i","c","d","t"],"(i=0,t={["+this.serialize(e.f)+"]:"+this.createFunction([],"t")+",next:"+this.createEffectfulFunction([],"if(i>s.d)return{done:!0,value:void 0};c=i++,d=s.v[c];if(c===s.t)throw d;return{done:c===s.d,value:d}")+"})")))}serializeIteratorFactoryInstance(e){return"("+this.serialize(e.a[0])+")("+this.serialize(e.a[1])+")"}serializeAsyncIteratorFactory(e){return this.assignIndexedValue(e.i,this.createFunction(["s"],this.createFunction(["i","t"],"(i=0,t={["+this.serialize(e.f)+"]:"+this.createFunction([],"t")+",next:"+this.createFunction([],"Promise.resolve().then("+this.createEffectfulFunction(["c","d"],"if(i>s.d)return{done:!0,value:void 0};c=i++,d=s.v[c];if(c===s.t)throw d;return{done:c===s.d,value:d}")+")")+"})")))}serializeAsyncIteratorFactoryInstance(e){return"("+this.serialize(e.a[0])+")("+this.serialize(e.a[1])+")"}serializeReadableStream(e){this.stack.push(e.i);let r="("+this.serialize(e.a[0])+")("+this.serialize(e.a[1])+")";return this.stack.pop(),this.assignIndexedValue(e.i,r)}serializeReadableStreamFactory(e){return this.assignIndexedValue(e.i,this.createFunction(["s"],"new ReadableStream({start:"+this.createFunction(["c"],"Promise.resolve().then("+this.createEffectfulFunction(["i","v"],"for(i=0;i<s.d;i++)c.enqueue(s.v[i]);(s.t===-1)?c.close():c.error(s.v[i])")+")")+"})"))}serialize(e){switch(e.t){case 2:return er[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);case 41:return this.serializeMapSentinel(e);case 42:return this.serializeIteratorFactory(e);case 43:return this.serializeIteratorFactoryInstance(e);case 44:return this.serializeAsyncIteratorFactory(e);case 45:return this.serializeAsyncIteratorFactoryInstance(e);case 46:return this.serializeReadableStream(e);case 47:return this.serializeReadableStreamFactory(e);default:throw new Error("invariant")}}};var Pr="hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_",Ir=Pr.length,Or="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_",wr=Or.length;function Xe(n){let e=n%Ir,r=Pr[e];for(n=(n-e)/Ir;n>0;)e=n%wr,r+=Or[e],n=(n-e)/wr;return r}var T=class extends k{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 s=this.vars[t];return s==null&&(s=Xe(t),this.vars[t]=s),s}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 s=this.resolvePatches(),a=t;if(s){let i=this.getRefParam(r.i);a=t+","+s+i,t.startsWith(i+"=")||(a=i+"="+a)}return"("+this.createFunction(this.vars,"("+a+")")+")()"}return r.t===10?"("+t+")":t}};var y=class extends K{parseItems(e){let r=[];for(let t=0,s=e.length;t<s;t++)t in e&&(r[t]=this.parse(e[t]));return r}parseArray(e,r){return Se(e,r,this.parseItems(r))}parseProperties(e){let r=Object.entries(e),t=[],s=[];for(let a=0,i=r.length;a<i;a++)t.push(d(r[a][0])),s.push(this.parse(r[a][1]));if(this.features&1024){let a=Symbol.iterator;a in e&&(t.push(this.parseWKSymbol(a)),s.push(q(this.parseIteratorFactory(),this.parse(W(e))))),a=Symbol.toStringTag,a in e&&(t.push(this.parseWKSymbol(a)),s.push(R(e[a]))),a=Symbol.isConcatSpreadable,a in e&&(t.push(this.parseWKSymbol(a)),s.push(e[a]?b:N))}return{k:t,v:s,s:t.length}}parsePlainObject(e,r,t){return this.createObjectNode(e,r,t,this.parseProperties(r))}parseBoxed(e,r){return ge(e,this.parse(r.valueOf()))}parseTypedArray(e,r){return he(e,r,this.parse(r.buffer))}parseBigIntTypedArray(e,r){return ye(e,r,this.parse(r.buffer))}parseDataView(e,r){return ve(e,r,this.parse(r.buffer))}parseError(e,r){let t=M(r,this.features);return be(e,r,t?this.parseProperties(t):void 0)}parseAggregateError(e,r){let t=M(r,this.features);return Ne(e,r,t?this.parseProperties(t):void 0)}parseMap(e,r){let t=[],s=[];for(let[a,i]of r.entries())t.push(this.parse(a)),s.push(this.parse(i));return this.createMapNode(e,t,s,r.size)}parseSet(e,r){let t=[];for(let s of r.keys())t.push(this.parse(s));return Re(e,r.size,t)}parsePlainProperties(e){let r=e.length,t=[],s=[];for(let a=0;a<r;a++)t.push(d(e[a][0])),s.push(this.parse(e[a][1]));return{k:t,v:s,s:r}}parseHeaders(e,r){let t=[];return r.forEach((s,a)=>{t.push([a,s])}),{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((s,a)=>{t.push([a,s])}),{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 Pe(e,r.type,this.parse(Ie(r)))}parseCustomEvent(e,r){return Oe(e,r.type,this.parse(we(r)))}parsePlugin(e,r){let t=this.plugins;if(t)for(let s=0,a=t.length;s<a;s++){let i=t[s];if(i.parse.sync&&i.test(r))return j(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 L(e,r);case RegExp:return _(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 s=this.features;if(s&2048)switch(t){case ArrayBuffer:return U(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((s&4104)===4104)switch(t){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(e,r);default:break}if(s&32&&t===Map)return this.parseMap(e,r);if(s&512&&t===Set)return this.parseSet(e,r);if(s&8192)switch(t){case(typeof URL!="undefined"?URL:l):return H(e,r);case(typeof URLSearchParams!="undefined"?URLSearchParams:l):return G(e,r);case(typeof Headers!="undefined"?Headers:l):return this.parseHeaders(e,r);case(typeof FormData!="undefined"?FormData:l):return this.parseFormData(e,r);case(typeof Event!="undefined"?Event:l):return this.parseEvent(e,r);case(typeof CustomEvent!="undefined"?CustomEvent:l):return this.parseCustomEvent(e,r);case(typeof DOMException!="undefined"?DOMException:l):return $(e,r);default:break}let a=this.parsePlugin(e,r);if(a)return a;if(s&1&&typeof AggregateError!="undefined"&&(t===AggregateError||r instanceof AggregateError))return this.parseAggregateError(e,r);if(r instanceof Error)return this.parseError(e,r);if(s&1024&&Symbol.iterator in r)return this.parsePlainObject(e,r,!!t);throw new m(r)}parse(e){switch(e){case!0:return b;case!1:return N;case void 0:return oe;case null:return I;default:break}switch(typeof e){case"string":return R(e);case"number":return ce(e);case"bigint":return f(this.features&8,new m(e)),fe(e);case"object":{let r=this.getReference(e);return typeof r=="number"?this.parseObject(r,e):r}case"symbol":{f(this.features&1024,new m(e));let r=this.getReference(e);return typeof r=="number"?pe(r,e):r}case"function":return f(O(e),new Error("Cannot serialize function without reference ID.")),this.getStrictReference(e);default:throw new m(e)}}};var J=class extends y{constructor(){super(...arguments);this.mode="vanilla"}};function Je(n,e={}){let r=new J({plugins:e.plugins,disabledFeatures:e.disabledFeatures}),t=r.parse(n);return new T({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}async function $r(n,e={}){let r=new X({plugins:e.plugins,disabledFeatures:e.disabledFeatures}),t=await r.parse(n);return new T({plugins:e.plugins,features:r.features,markedRefs:r.marked}).serializeTop(t)}function Xr(n){return(0,eval)(n)}function Jr(n,e={}){let r=new J({plugins:e.plugins,disabledFeatures:e.disabledFeatures});return{t:r.parse(n),f:r.features,m:Array.from(r.marked)}}async function Yr(n,e={}){let r=new X({plugins:e.plugins,disabledFeatures:e.disabledFeatures});return{t:await r.parse(n),f:r.features,m:Array.from(r.marked)}}function Zr(n,e={}){return new T({plugins:e.plugins,features:n.f,markedRefs:n.m}).serializeTop(n.t)}function Qr(n,e={}){return new re({plugins:e.plugins,markedRefs:n.m}).deserialize(n.t)}var Y=class extends C{constructor(){super(...arguments);this.mode="cross"}};var ne=class extends z{constructor(){super(...arguments);this.mode="cross"}assignIndexedValue(r,t){return this.refs.has(r)||this.refs.set(r,t),t}};var D=class extends k{constructor(r){super(r);this.mode="cross";this.scopeId=r.scopeId}getRefParam(r){return typeof r=="string"?V+"."+r:V+"["+r+"]"}assignIndexedValue(r,t){return this.getRefParam(r)+"="+t}serializePromiseConstructor(r){return this.assignIndexedValue(r.i,g+"."+De+"()")}serializePromiseResolve(r){return g+"."+Fe+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializePromiseReject(r){return g+"."+Be+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializeReadableStreamConstructor(r){return this.assignIndexedValue(r.i,g+"."+Ve+"()")}serializeReadableStreamEnqueue(r){return g+"."+Me+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializeReadableStreamError(r){return g+"."+Le+"("+this.getRefParam(r.i)+","+this.serialize(r.f)+")"}serializeReadableStreamClose(r){return g+"."+_e+"("+this.getRefParam(r.i)+")"}serializeAsyncIteratorFactory(r){return this.assignIndexedValue(r.i,this.createFunction(["s"],this.createFunction(["b","t"],"(b=s.tee(),s=b[0],b=b[1].getReader(),t={["+this.serialize(r.f)+"]:"+this.createFunction([],"t")+",next:"+this.createFunction([],"b.read().then("+this.createEffectfulFunction(["d"],"if(d.done)return{done:!0,value:void 0};d=d.value;if(d[0]===1)throw d[1];return{done:d[0]===2,value:d[1]}")+")")+"})")))}serializeTop(r){let t=this.serialize(r),s=r.i;if(s==null)return t;let a=this.resolvePatches(),i=this.getRefParam(s),o=this.scopeId==null?"":V,c=a?t+","+a:t;if(o==="")return a?"("+c+i+")":c;let A=this.scopeId==null?"()":"("+V+'["'+d(this.scopeId)+'"])',F=c+(a?i:"");return"("+this.createFunction([o],F)+")"+A}};var se=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()}parseProperties(r){let t=Object.entries(r),s=[],a=[];for(let i=0,o=t.length;i<o;i++)s.push(d(t[i][0])),a.push(this.parse(t[i][1]));if(this.features&1024){let i=Symbol.iterator;i in r&&(s.push(this.parseWKSymbol(i)),a.push(q(this.parseIteratorFactory(),this.parse(W(r))))),i=Symbol.asyncIterator,i in r&&(s.push(this.parseWKSymbol(i)),a.push(Ee(this.parseAsyncIteratorFactory(),this.parse(hr(r,this))))),i=Symbol.toStringTag,i in r&&(s.push(this.parseWKSymbol(i)),a.push(R(r[i]))),i=Symbol.isConcatSpreadable,i in r&&(s.push(this.parseWKSymbol(i)),a.push(r[i]?b:N))}return{k:s,v:a,s:s.length}}pushReadableStreamReader(r,t){t.read().then(s=>{if(this.alive)if(s.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 a=this.parseWithError(s.value);a&&(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:a,b:void 0,o:void 0},!1),this.pushReadableStreamReader(r,t))}},s=>{if(this.alive){let a=this.parseWithError(s);a&&(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:a,b:void 0,o:void 0},!1),this.popPendingState())}})}parseReadableStream(r,t){let s=t.getReader();return this.pushPendingState(),this.pushReadableStreamReader(r,s),{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:d(t.url),l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,f:this.parse(xe(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):I,this.parse(Ae(t))],b:void 0,o:void 0}}parsePromise(r,t){return t.then(s=>{let a=this.parseWithError(s);a&&(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:a,b:void 0,o:void 0},!1),this.popPendingState())},s=>{if(this.alive){let a=this.parseWithError(s);a&&(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:a,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 s=this.plugins;if(s)for(let a=0,i=s.length;a<i;a++){let o=s[a];if(o.parse.stream&&o.test(t))return j(r,o.tag,o.parse.stream(t,this,{id:r}))}}parseObject(r,t){if(Array.isArray(t))return this.parseArray(r,t);let s=t.constructor;switch(s){case Object:return this.parsePlainObject(r,t,!1);case void 0:return this.parsePlainObject(r,t,!0);case Date:return L(r,t);case RegExp:return _(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 a=this.features;if(a&256&&(s===Promise||t instanceof Promise))return this.parsePromise(r,t);if(a&2048)switch(s){case ArrayBuffer:return U(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((a&4104)===4104)switch(s){case BigInt64Array:case BigUint64Array:return this.parseBigIntTypedArray(r,t);default:break}if(a&32&&s===Map)return this.parseMap(r,t);if(a&512&&s===Set)return this.parseSet(r,t);if(a&8192)switch(s){case(typeof URL!="undefined"?URL:l):return H(r,t);case(typeof URLSearchParams!="undefined"?URLSearchParams:l):return G(r,t);case(typeof Headers!="undefined"?Headers:l):return this.parseHeaders(r,t);case(typeof FormData!="undefined"?FormData:l):return this.parseFormData(r,t);case(typeof ReadableStream!="undefined"?ReadableStream:l):return this.parseReadableStream(r,t);case(typeof Request!="undefined"?Request:l):return this.parseRequest(r,t);case(typeof Response!="undefined"?Response:l):return this.parseResponse(r,t);case(typeof Event!="undefined"?Event:l):return this.parseEvent(r,t);case(typeof CustomEvent!="undefined"?CustomEvent:l):return this.parseCustomEvent(r,t);case(typeof DOMException!="undefined"?DOMException:l):return $(r,t);default:break}let i=this.parsePlugin(r,t);if(i)return i;if(a&1&&typeof AggregateError!="undefined"&&(s===AggregateError||t instanceof AggregateError))return this.parseAggregateError(r,t);if(t instanceof Error)return this.parseError(r,t);if(a&1024&&(Symbol.iterator in t||Symbol.asyncIterator in t))return this.parsePlainObject(r,t,!!s);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 Z=class extends se{constructor(){super(...arguments);this.mode="cross"}};var Q=class extends y{constructor(){super(...arguments);this.mode="cross"}};function et(n,e={}){let r=new Q({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=r.parse(n);return new D({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}).serializeTop(t)}async function rt(n,e={}){let r=new Y({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}),t=await r.parse(n);return new D({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}).serializeTop(t)}function tt(n,e={}){return new Q({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}).parse(n)}async function nt(n,e={}){return new Y({plugins:e.plugins,disabledFeatures:e.disabledFeatures,refs:e.refs}).parse(n)}function Ye(n,e){let r=new Z({plugins:e.plugins,refs:e.refs,disabledFeatures:e.disabledFeatures,onParse(t,s){let a=new D({plugins:e.plugins,features:r.features,scopeId:e.scopeId,markedRefs:r.marked}),i;try{i=a.serializeTop(t)}catch(o){e.onError&&e.onError(o);return}e.onSerialize(i,s)},onError:e.onError,onDone:e.onDone});return r.start(n),()=>{r.destroy()}}function st(n,e){let r=new Z({plugins:e.plugins,refs:e.refs,disabledFeatures:e.disabledFeatures,onParse:e.onParse,onError:e.onError,onDone:e.onDone});return r.start(n),()=>{r.destroy()}}function at(n,e){return new ne({plugins:e.plugins,refs:e.refs}).deserialize(n)}var ae=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(Ye(r,{plugins:this.options.plugins,scopeId:this.options.scopeId,refs:this.refs,disabledFeatures:this.options.disabledFeatures,onError:this.options.onError,onSerialize:(t,s)=>{this.alive&&this.options.onData(s?this.options.globalIdentifier+'["'+d(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 it(n){return n}var ot=Je;