seroval 0.9.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -287
- package/dist/cjs/development/index.cjs +3529 -1140
- package/dist/cjs/development/index.cjs.map +4 -4
- package/dist/cjs/production/index.cjs +3 -3
- package/dist/esm/development/index.mjs +3533 -1142
- package/dist/esm/development/index.mjs.map +4 -4
- package/dist/esm/production/index.mjs +3 -3
- package/dist/types/core/Serializer.d.ts +15 -0
- package/dist/types/{tree → core}/UnsupportedTypeError.d.ts +4 -3
- package/dist/types/{assert.d.ts → core/assert.d.ts} +1 -1
- package/dist/types/core/assignments.d.ts +33 -0
- package/dist/types/core/base-primitives.d.ts +12 -0
- package/dist/types/{compat.d.ts → core/compat.d.ts} +22 -22
- package/dist/types/core/constants.d.ts +89 -0
- package/dist/types/core/context.d.ts +9 -0
- package/dist/types/core/cross/async.d.ts +3 -0
- package/dist/types/core/cross/context.d.ts +37 -0
- package/dist/types/core/cross/index.d.ts +8 -0
- package/dist/types/core/cross/primitives.d.ts +9 -0
- package/dist/types/core/cross/serialize.d.ts +5 -0
- package/dist/types/core/cross/stream.d.ts +3 -0
- package/dist/types/core/cross/sync.d.ts +3 -0
- package/dist/types/core/cross/web-api.d.ts +4 -0
- package/dist/types/{get-identifier.d.ts → core/get-identifier.d.ts} +1 -1
- package/dist/types/core/keys.d.ts +13 -0
- package/dist/types/{tree/constants.d.ts → core/literals.d.ts} +9 -11
- package/dist/types/core/promise-to-result.d.ts +1 -0
- package/dist/types/{tree → core}/reference.d.ts +5 -6
- package/dist/types/{tree → core}/shared.d.ts +13 -13
- package/dist/types/{string.d.ts → core/string.d.ts} +3 -3
- package/dist/types/core/tree/async.d.ts +3 -0
- package/dist/types/core/tree/context.d.ts +44 -0
- package/dist/types/core/tree/deserialize.d.ts +3 -0
- package/dist/types/core/tree/index.d.ts +14 -0
- package/dist/types/core/tree/primitives.d.ts +9 -0
- package/dist/types/core/tree/serialize.d.ts +4 -0
- package/dist/types/core/tree/sync.d.ts +3 -0
- package/dist/types/core/tree/web-api.d.ts +4 -0
- package/dist/types/{tree → core}/types.d.ts +228 -238
- package/dist/types/core/web-api.d.ts +4 -0
- package/dist/types/index.d.ts +9 -19
- package/dist/types/types.d.ts +20 -20
- package/package.json +5 -5
- package/src/core/Serializer.ts +48 -0
- package/src/{tree → core}/UnsupportedTypeError.ts +1 -1
- package/src/core/assignments.ts +159 -0
- package/src/{tree/primitives.ts → core/base-primitives.ts} +33 -136
- package/src/core/constants.ts +169 -0
- package/src/core/context.ts +15 -0
- package/src/core/cross/async.ts +614 -0
- package/src/core/cross/context.ts +102 -0
- package/src/core/cross/index.ts +169 -0
- package/src/core/cross/primitives.ts +137 -0
- package/src/core/cross/serialize.ts +847 -0
- package/src/core/cross/stream.ts +745 -0
- package/src/core/cross/sync.ts +561 -0
- package/src/core/cross/web-api.ts +55 -0
- package/src/core/header.js +61 -0
- package/src/core/keys.ts +41 -0
- package/src/core/literals.ts +28 -0
- package/src/core/promise-to-result.ts +9 -0
- package/src/{tree → core}/reference.ts +6 -7
- package/src/{tree → core}/shared.ts +4 -4
- package/src/{tree → core/tree}/async.ts +46 -34
- package/src/core/tree/context.ts +125 -0
- package/src/{tree → core/tree}/deserialize.ts +68 -55
- package/src/core/tree/index.ts +142 -0
- package/src/core/tree/primitives.ts +132 -0
- package/src/{tree → core/tree}/serialize.ts +87 -193
- package/src/{tree → core/tree}/sync.ts +50 -39
- package/src/{tree → core/tree}/web-api.ts +8 -52
- package/src/{tree → core}/types.ts +76 -60
- package/src/core/web-api.ts +51 -0
- package/src/index.ts +7 -141
- package/src/types.ts +1 -1
- package/dist/types/context.d.ts +0 -67
- package/dist/types/tree/async.d.ts +0 -3
- package/dist/types/tree/deserialize.d.ts +0 -3
- package/dist/types/tree/primitives.d.ts +0 -19
- package/dist/types/tree/serialize.d.ts +0 -4
- package/dist/types/tree/symbols.d.ts +0 -33
- package/dist/types/tree/sync.d.ts +0 -3
- package/dist/types/tree/web-api.d.ts +0 -6
- package/src/context.ts +0 -164
- package/src/tree/constants.ts +0 -73
- package/src/tree/symbols.ts +0 -65
- /package/src/{assert.ts → core/assert.ts} +0 -0
- /package/src/{compat.ts → core/compat.ts} +0 -0
- /package/src/{get-identifier.ts → core/get-identifier.ts} +0 -0
- /package/src/{string.ts → core/string.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var P=(
|
|
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
|
|
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{toString:ur}=Object.prototype,S=class extends Error{constructor(r){super('Unsupported type "'+ur.call(r)+'"')}};function O(e){return{t:2,i:void 0,s:e,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}var G=O(2),J=O(3),Z=O(1),$=O(0),he=O(4),Te=O(5),De=O(6),Ue=O(7);function je(e){switch(e.s){case 2:return"!0";case 3:return"!1";case 1:return"void 0";case 0:return"null";case 4:return"-0";case 5:return"1/0";case 6:return"-1/0";case 7:return"NaN";default:throw new Error("invariant")}}function Fe(e){switch(e.s){case 2:return!0;case 3:return!1;case 1:return;case 0:return null;case 4:return-0;case 5:return 1/0;case 6:return-1/0;case 7:return NaN;default:throw new Error("invariant")}}var me=new Map,D=new Map;function fr(e,r){return me.set(r,e),D.set(e,r),r}function B(e){return me.has(e)}function cr(e){return D.has(e)}function xe(e){return y(B(e),new Error("Missing reference id")),me.get(e)}function Le(e){return y(cr(e),new Error("Missing reference for id:"+e)),D.get(e)}var j="__SEROVAL__";typeof globalThis!==void 0?Object.defineProperty(globalThis,j,{value:D,configurable:!0,writable:!1,enumerable:!1}):typeof window!==void 0?Object.defineProperty(window,j,{value:D,configurable:!0,writable:!1,enumerable:!1}):typeof self!==void 0?Object.defineProperty(self,j,{value:D,configurable:!0,writable:!1,enumerable:!1}):typeof global!==void 0&&Object.defineProperty(global,j,{value:D,configurable:!0,writable:!1,enumerable:!1});var Ve={[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"},Se={[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},Me={[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};function q(e){switch(e){case 1/0:return Te;case-1/0:return De;default:return e!==e?Ue:Object.is(e,-0)?he:{t:0,i:void 0,s:e,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}}function Q(e){return{t:1,i:void 0,s:v(e),l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function X(e,r){return y(e.features&8,new S(r)),{t:3,i:void 0,s:""+r,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function U(e){return{t:4,i:e,s:void 0,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function ee(e,r){return{t:5,i:e,s:r.toISOString(),l:void 0,c:void 0,m:void 0,d:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function re(e,r){return{t:6,i:e,s:void 0,l:void 0,c:r.source,m:r.flags,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function H(e,r){let n=new Uint8Array(r),t=n.length,o=new Array(t);for(let a=0;a<t;a++)o[a]=n[a];return{t:21,i:e,s:o,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function F(e,r){let n=I(e,r);return e.markedRefs.has(n)?U(n):H(n,r)}function ne(e,r,n){return y(e.features&2048,new S(n)),{t:15,i:r,s:void 0,l:n.length,c:n.constructor.name,m:void 0,d:void 0,a:void 0,f:F(e,n.buffer),b:n.byteOffset,o:void 0}}var _e=4104;function te(e,r,n){return y((e.features&_e)===_e,new S(n)),{t:16,i:r,s:void 0,l:n.length,c:n.constructor.name,m:void 0,d:void 0,a:void 0,f:F(e,n.buffer),b:n.byteOffset,o:void 0}}function mr(e,r,n){return y(e.features&1024,new S(n)),y(n in Se,new Error("Only well-known symbols are supported.")),{t:17,i:r,s:Se[n],l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function x(e,r){return{t:20,i:e,s:v(xe(r)),l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function oe(e,r,n){return{t:22,i:r,s:void 0,l:n.byteLength,c:void 0,m:void 0,d:void 0,a:void 0,f:F(e,n.buffer),b:n.byteOffset,o:void 0}}function ae(e,r){let n=I(e,r);return e.markedRefs.has(n)?U(n):B(r)?x(n,r):mr(e,n,r)}function ie(e,r){y(B(r),new Error("Cannot serialize function without reference ID."));let n=I(e,r);return e.markedRefs.has(n)?U(n):x(n,r)}function W(e){return e instanceof EvalError?"EvalError":e instanceof RangeError?"RangeError":e instanceof ReferenceError?"ReferenceError":e instanceof SyntaxError?"SyntaxError":e instanceof TypeError?"TypeError":e instanceof URIError?"URIError":"Error"}function He(e){switch(e){case"Error":return Error;case"EvalError":return EvalError;case"RangeError":return RangeError;case"ReferenceError":return ReferenceError;case"SyntaxError":return SyntaxError;case"TypeError":return TypeError;case"URIError":return URIError;default:throw new Error(`Unknown Error constructor "${e}"`)}}function L(e,r){let n,t=W(r);r.name!==t?n={name:r.name}:r.constructor.name!==t&&(n={name:r.constructor.name});let o=Object.getOwnPropertyNames(r);for(let a of o)a!=="name"&&a!=="message"&&(a==="stack"?e.features&16&&(n=n||{},n[a]=r[a]):(n=n||{},n[a]=r[a]));return n}function k(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;switch(e.constructor){case Map:case Set:case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:case BigInt64Array:case BigUint64Array:return!1;default:break}return Symbol.iterator in e}function We(e){switch(e){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 "${e}"`)}}var Sr=/^[$A-Z_][0-9A-Z_$]*$/i;function ye(e){let r=e[0];return(r==="$"||r==="_"||r>="A"&&r<="Z"||r>="a"&&r<="z")&&Sr.test(e)}function V(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:Object.isExtensible(e)?0:1}function se(e,r,n){return y(e.features&8192,new S(n)),{t:18,i:r,s:v(n.href),l:void 0,c:void 0,m:void 0,d:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}function de(e,r,n){return y(e.features&8192,new S(n)),{t:19,i:r,s:v(n.toString()),l:void 0,c:void 0,m:void 0,d:void 0,f:void 0,a:void 0,b:void 0,o:void 0}}async function Ye(e,r,n){return y(e.features&8192,new S(n)),{t:23,i:r,s:void 0,l:void 0,c:v(n.type),m:void 0,d:void 0,f:F(e,await n.arrayBuffer()),a:void 0,b:void 0,o:void 0}}async function Ge(e,r,n){return y(e.features&8192,new S(n)),{t:24,i:r,s:void 0,l:void 0,c:v(n.type),m:v(n.name),d:void 0,f:F(e,await n.arrayBuffer()),a:void 0,b:n.lastModified,o:void 0}}function yr(e,r){let n=r.length,t=new Array(n),o=new Array(n),a;for(let i=0;i<n;i++)i in r&&(a=r[i],k(a)?o[i]=a:t[i]=w(e,a));for(let i=0;i<n;i++)i in o&&(t[i]=w(e,o[i]));return t}function Ze(e,r,n){return{t:9,i:r,s:void 0,l:n.length,c:void 0,m:void 0,d:void 0,a:yr(e,n),f:void 0,b:void 0,o:V(n)}}function gr(e,r,n){y(e.features&32,new S(n));let t=n.size,o=new Array(t),a=new Array(t),i=new Array(t),u=new Array(t),s=0,d=0;for(let[f,c]of n.entries())k(f)||k(c)?(i[s]=f,u[s]=c,s++):(o[d]=w(e,f),a[d]=w(e,c),d++);for(let f=0;f<s;f++)o[d+f]=w(e,i[f]),a[d+f]=w(e,u[f]);return{t:8,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:{k:o,v:a,s:t},a:void 0,f:void 0,b:void 0,o:void 0}}function pr(e,r,n){y(e.features&512,new S(n));let t=n.size,o=new Array(t),a=new Array(t),i=0,u=0;for(let s of n.keys())k(s)?a[i++]=s:o[u++]=w(e,s);for(let s=0;s<i;s++)o[u+s]=w(e,a[s]);return{t:7,i:r,s:void 0,l:t,c:void 0,m:void 0,d:void 0,a:o,f:void 0,b:void 0,o:void 0}}function Ne(e,r){let n=Object.keys(r),t=n.length,o=new Array(t),a=new Array(t),i=new Array(t),u=new Array(t),s=0,d=0,f,c;for(let l of n)f=r[l],c=v(l),k(f)?(i[s]=c,u[s]=f,s++):(o[d]=c,a[d]=w(e,f),d++);for(let l=0;l<s;l++)o[d+l]=i[l],a[d+l]=w(e,u[l]);if(e.features&1024&&Symbol.iterator in r){o[t]=0;let l=Array.from(r),R=I(e,l);a[t]=Ze(e,R,l),t++}return{k:o,v:a,s:t}}function $e(e,r){let n=Object.keys(r),t=n.length,o=new Array(t),a=new Array(t),i=new Array(t),u=new Array(t),s=0,d=0,f,c;for(let l of n)f=r[l],c=v(l),k(f)?(i[s]=c,u[s]=f,s++):(o[d]=c,a[d]=w(e,f),d++);for(let l=0;l<s;l++)o[d+l]=i[l],a[d+l]=w(e,u[l]);return{k:o,v:a,s:t}}function ge(e,r,n,t){return{t:t?11:10,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:Ne(e,n),a:void 0,f:void 0,b:void 0,o:V(n)}}function Je(e,r,n){let t=L(e,n),o=t?Ne(e,t):void 0;return{t:14,i:r,s:void 0,l:void 0,c:void 0,m:v(n.message),d:o,a:void 0,f:void 0,b:void 0,o:void 0}}function le(e,r,n){let t=L(e,n),o=t?Ne(e,t):void 0;return{t:13,i:r,s:void 0,l:void 0,c:W(n),m:v(n.message),d:o,a:void 0,f:void 0,b:void 0,o:void 0}}function Nr(e,r,n){y(e.features&8192,new S(n));let t={};return n.forEach((o,a)=>{t[a]=o}),{t:25,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:$e(e,t),a:void 0,f:void 0,b:void 0,o:void 0}}function br(e,r,n){y(e.features&8192,new S(n));let t={};return n.forEach((o,a)=>{t[a]=o}),{t:26,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:$e(e,t),a:void 0,f:void 0,b:void 0,o:void 0}}function vr(e,r,n){return{t:27,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:w(e,n.valueOf()),b:void 0,o:void 0}}function Ar(e,r){if(!r)return $;let n=I(e,r);if(e.markedRefs.has(n))return U(n);if(B(r))return x(n,r);if(Array.isArray(r))return Ze(e,n,r);switch(r.constructor){case Number:case Boolean:case String:case BigInt:case Function:case Symbol:return vr(e,n,r);case Date:return ee(n,r);case RegExp:return re(n,r);case ArrayBuffer:return H(n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return ne(e,n,r);case BigInt64Array:case BigUint64Array:return te(e,n,r);case DataView:return oe(e,n,r);case Map:return gr(e,n,r);case Set:return pr(e,n,r);case Object:return ge(e,n,r,!1);case void 0:return ge(e,n,r,!0);case AggregateError:return e.features&1?Je(e,n,r):le(e,n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return le(e,n,r);case URL:return se(e,n,r);case URLSearchParams:return de(e,n,r);case Headers:return Nr(e,n,r);case FormData:return br(e,n,r);default:break}if(r instanceof AggregateError)return e.features&1?Je(e,n,r):le(e,n,r);if(r instanceof Error)return le(e,n,r);if(Symbol.iterator in r)return ge(e,n,r,!!r.constructor);throw new S(r)}function w(e,r){switch(typeof r){case"boolean":return r?G:J;case"undefined":return Z;case"string":return Q(r);case"number":return q(r);case"bigint":return X(e,r);case"object":return Ar(e,r);case"symbol":return ae(e,r);case"function":return ie(e,r);default:throw new S(r)}}async function wr(e,r){let n=r.length,t=new Array(n),o=new Array(n),a;for(let i=0;i<n;i++)i in r&&(a=r[i],k(a)?o[i]=a:t[i]=await A(e,a));for(let i=0;i<n;i++)i in o&&(t[i]=await A(e,o[i]));return t}async function Xe(e,r,n){return{t:9,i:r,s:void 0,l:n.length,c:void 0,m:void 0,d:void 0,a:await wr(e,n),f:void 0,b:void 0,o:V(n)}}async function Er(e,r,n){y(e.features&32,new S(n));let t=n.size,o=new Array(t),a=new Array(t),i=new Array(t),u=new Array(t),s=0,d=0;for(let[f,c]of n.entries())k(f)||k(c)?(i[s]=f,u[s]=c,s++):(o[d]=await A(e,f),a[d]=await A(e,c),d++);for(let f=0;f<s;f++)o[d+f]=await A(e,i[f]),a[d+f]=await A(e,u[f]);return{t:8,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:{k:o,v:a,s:t},a:void 0,f:void 0,b:void 0,o:void 0}}async function kr(e,r,n){y(e.features&512,new S(n));let t=n.size,o=new Array(t),a=new Array(t),i=0,u=0;for(let s of n.keys())k(s)?a[i++]=s:o[u++]=await A(e,s);for(let s=0;s<i;s++)o[u+s]=await A(e,a[s]);return{t:7,i:r,s:void 0,l:t,c:void 0,m:void 0,d:void 0,a:o,f:void 0,b:void 0,o:void 0}}async function ve(e,r){let n=Object.keys(r),t=n.length,o=new Array(t),a=new Array(t),i=new Array(t),u=new Array(t),s=0,d=0,f,c;for(let l of n)f=r[l],c=v(l),k(f)?(i[s]=c,u[s]=f,s++):(o[d]=c,a[d]=await A(e,f),d++);for(let l=0;l<s;l++)o[d+l]=i[l],a[d+l]=await A(e,u[l]);if(e.features&1024&&Symbol.iterator in r){o[t]=0;let l=Array.from(r);a[t]=await Xe(e,I(e,l),l),t++}return{k:o,v:a,s:t}}async function er(e,r){let n=Object.keys(r),t=n.length,o=new Array(t),a=new Array(t),i=new Array(t),u=new Array(t),s=0,d=0,f,c;for(let l of n)f=r[l],c=v(l),k(f)?(i[s]=c,u[s]=f,s++):(o[d]=c,a[d]=await A(e,f),d++);for(let l=0;l<s;l++)o[d+l]=i[l],a[d+l]=await A(e,u[l]);return{k:o,v:a,s:t}}async function qe(e,r,n){return y(e.features&256,new S(n)),{t:12,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:await A(e,await n),b:void 0,o:void 0}}async function be(e,r,n,t){return{t:t?11:10,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:await ve(e,n),a:void 0,f:void 0,b:void 0,o:V(n)}}async function Qe(e,r,n){let t=L(e,n),o=t?await ve(e,t):void 0;return{t:14,i:r,s:void 0,l:void 0,c:void 0,m:v(n.message),d:o,a:void 0,f:void 0,b:void 0,o:void 0}}async function ue(e,r,n){let t=L(e,n),o=t?await ve(e,t):void 0;return{t:13,i:r,s:void 0,l:void 0,c:W(n),m:v(n.message),d:o,a:void 0,f:void 0,b:void 0,o:void 0}}async function Rr(e,r,n){y(e.features&8192,new S(n));let t={};return n.forEach((o,a)=>{t[a]=o}),{t:25,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:await er(e,t),a:void 0,f:void 0,b:void 0,o:void 0}}async function Cr(e,r,n){y(e.features&8192,new S(n));let t={};return n.forEach((o,a)=>{t[a]=o}),{t:26,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:await er(e,t),a:void 0,f:void 0,b:void 0,o:void 0}}async function zr(e,r,n){return{t:27,i:r,s:void 0,l:void 0,c:void 0,m:void 0,d:void 0,a:void 0,f:await A(e,n.valueOf()),b:void 0,o:void 0}}async function Ir(e,r){if(!r)return $;let n=I(e,r);if(e.markedRefs.has(n))return U(n);if(B(r))return x(n,r);if(Array.isArray(r))return Xe(e,n,r);switch(r.constructor){case Number:case Boolean:case String:case BigInt:case Function:case Symbol:return zr(e,n,r);case Date:return ee(n,r);case RegExp:return re(n,r);case Promise:return qe(e,n,r);case ArrayBuffer:return H(n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return ne(e,n,r);case BigInt64Array:case BigUint64Array:return te(e,n,r);case DataView:return oe(e,n,r);case Map:return Er(e,n,r);case Set:return kr(e,n,r);case Object:return be(e,n,r,!1);case void 0:return be(e,n,r,!0);case AggregateError:return e.features&1?Qe(e,n,r):ue(e,n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return ue(e,n,r);case URL:return se(e,n,r);case URLSearchParams:return de(e,n,r);case Blob:return Ye(e,n,r);case File:return Ge(e,n,r);case Headers:return Rr(e,n,r);case FormData:return Cr(e,n,r);default:break}if(r instanceof AggregateError)return e.features&1?Qe(e,n,r):ue(e,n,r);if(r instanceof Error)return ue(e,n,r);if(r instanceof Promise)return qe(e,n,r);if(Symbol.iterator in r)return be(e,n,r,!!r.constructor);throw new S(r)}async function A(e,r){switch(typeof r){case"boolean":return r?G:J;case"undefined":return Z;case"string":return Q(r);case"number":return q(r);case"bigint":return X(e,r);case"object":return Ir(e,r);case"symbol":return ae(e,r);case"function":return ie(e,r);default:throw new S(r)}}function rr(e,r){switch(r){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}function b(e,r,n){return e.markedRefs.has(r)&&e.valueMap.set(r,n),n}function Pr(e,r){let n=r.l,t=b(e,r.i,new Array(n)),o;for(let a=0;a<n;a++)o=r.a[a],o&&(t[a]=E(e,o));return rr(t,r.o),t}function nr(e,r,n){let t=r.s;if(t){let o,a,i=r.k,u=r.v;for(let s=0;s<t;s++)switch(o=i[s],a=E(e,u[s]),o){case 0:{let d=a;n[Symbol.iterator]=()=>d.values()}break;default:n[C(o)]=a;break}}return n}function Or(e,r){let n=b(e,r.i,r.t===10?{}:Object.create(null));return nr(e,r.d,n),rr(n,r.o),n}function Br(e,r){let n=b(e,r.i,new Set),t=r.a;for(let o=0,a=r.l;o<a;o++)n.add(E(e,t[o]));return n}function hr(e,r){let n=b(e,r.i,new Map),t=r.d.k,o=r.d.v;for(let a=0,i=r.d.s;a<i;a++)n.set(E(e,t[a]),E(e,o[a]));return n}function tr(e,r,n){if(r.d){let t=nr(e,r.d,{});Object.assign(n,t)}return n}function Tr(e,r){let n=b(e,r.i,new AggregateError([],C(r.m)));return tr(e,r,n)}function Dr(e,r){let n=He(r.c),t=b(e,r.i,new n(C(r.m)));return tr(e,r,t)}function Ur(){let e;return{resolve(r){e(r)},promise:new Promise(r=>{e=r})}}async function jr(e,r){let n=Ur(),t=b(e,r.i,n.promise);return n.resolve(E(e,r.f)),t}function Fr(e,r){let n=new Uint8Array(r.s);return b(e,r.i,n.buffer)}function xr(e,r){let n=We(r.c),t=E(e,r.f);return b(e,r.i,new n(t,r.b,r.l))}function Lr(e,r){return b(e,r.i,new Date(r.s))}function Vr(e,r){return b(e,r.i,new RegExp(r.c,r.m))}function Mr(e,r){return b(e,r.i,new URL(C(r.s)))}function _r(e,r){return b(e,r.i,new URLSearchParams(C(r.s)))}function Kr(e,r){return b(e,r.i,Le(C(r.s)))}function Hr(e,r){let n=E(e,r.f);return b(e,r.i,new DataView(n,r.b,r.l))}function Wr(e,r){let n=E(e,r.f);return b(e,r.i,new Blob([n],{type:C(r.c)}))}function Yr(e,r){let n=E(e,r.f);return b(e,r.i,new File([n],C(r.m),{type:C(r.c),lastModified:r.b}))}function Gr(e,r){let n=b(e,r.i,new Headers),t=r.d.k,o=r.d.v;for(let a=0,i=r.d.s;a<i;a++)n.set(C(t[a]),E(e,o[a]));return n}function Jr(e,r){let n=b(e,r.i,new FormData),t=r.d.k,o=r.d.v;for(let a=0,i=r.d.s;a<i;a++)n.set(C(t[a]),E(e,o[a]));return n}function Zr(e,r){return b(e,r.i,Object(E(e,r.f)))}function E(e,r){switch(r.t){case 2:return Fe(r);case 0:return r.s;case 1:return C(r.s);case 3:return BigInt(r.s);case 4:return e.valueMap.get(r.i);case 9:return Pr(e,r);case 10:case 11:return Or(e,r);case 5:return Lr(e,r);case 6:return Vr(e,r);case 7:return Br(e,r);case 8:return hr(e,r);case 21:return Fr(e,r);case 16:case 15:return xr(e,r);case 22:return Hr(e,r);case 14:return Tr(e,r);case 13:return Dr(e,r);case 12:return jr(e,r);case 17:return Me[r.s];case 18:return Mr(e,r);case 19:return _r(e,r);case 20:return Kr(e,r);case 23:return Wr(e,r);case 24:return Yr(e,r);case 25:return Gr(e,r);case 26:return Jr(e,r);case 27:return Zr(e,r);default:throw new Error("invariant")}}function fe(e){switch(e.t){case"index":return e.s+"="+e.v;case"set":return e.s+".set("+e.k+","+e.v+")";case"add":return e.s+".add("+e.v+")";case"append":return e.s+".append("+e.k+","+e.v+")";default:return""}}var $r={[3]:"Object.freeze",[2]:"Object.seal",[1]:"Object.preventExtensions",[0]:void 0};function qr(e){let r=[],n=e[0],t=n,o;for(let a=1,i=e.length;a<i;a++){if(o=e[a],o.t===t.t)switch(o.t){case"index":o.v===t.v?n={t:"index",s:o.s,k:void 0,v:fe(n)}:(r.push(n),n=o);break;case"set":o.s===t.s?n={t:"set",s:fe(n),k:o.k,v:o.v}:(r.push(n),n=o);break;case"add":o.s===t.s?n={t:"add",s:fe(n),k:void 0,v:o.v}:(r.push(n),n=o);break;case"append":r.push(n),n=o;break;default:break}else r.push(n),n=o;t=o}return r.push(n),r}function Ee(e){if(e.length){let r="",n=qr(e);for(let t=0,o=n.length;t<o;t++)r+=fe(n[t])+",";return r}}function ke(e,r,n){r!==0&&(z(e,n),e.flags.push({type:r,value:N(e,n)}))}function Qr(e){let r="";for(let n=0,t=e.flags.length;n<t;n++){let o=e.flags[n];r+=$r[o.type]+"("+o.value+"),"}return r}function or(e){let r=Ee(e.assignments),n=Qr(e);return r?n?r+n:r:n}function ar(e,r,n){e.assignments.push({t:"index",s:r,k:void 0,v:n})}function Xr(e,r,n){e.assignments.push({t:"add",s:N(e,r),k:void 0,v:n})}function Ae(e,r,n,t){e.assignments.push({t:"set",s:N(e,r),k:n,v:t})}function en(e,r,n,t){e.assignments.push({t:"append",s:N(e,r),k:n,v:t})}function Y(e,r,n,t){ar(e,N(e,r)+"["+n+"]",t)}function we(e,r,n,t){z(e,r),ar(e,N(e,r)+"."+n,t)}function p(e,r,n){return e.markedRefs.has(r)?N(e,r)+"="+n:n}function h(e,r){return r.t===4&&e.stack.includes(r.i)}function rn(e,r){let n=r.i;e.stack.push(n);let t="",o,a=!1,i=r.a;for(let u=0,s=r.l;u<s;u++)u!==0&&(t+=","),o=i[u],o?h(e,o)?(z(e,n),Y(e,n,u,N(e,o.i)),a=!0):(t+=g(e,o),a=!1):a=!0;return e.stack.pop(),ke(e,r.o,r.i),p(e,n,"["+t+(a?",]":"]"))}function ir(e){return e.features&2?".values()":"[Symbol.iterator]()"}function nn(e,r){let n=e.stack;e.stack=[];let t=g(e,r)+ir(e);return e.stack=n,e.features&4?t="[Symbol.iterator]:()=>"+t:e.features&64?t="[Symbol.iterator](){return "+t+"}":t="[Symbol.iterator]:function(){return "+t+"}",t}function Re(e,r,n){let t=n.s;if(t===0)return"{}";let o="";e.stack.push(r);let a,i,u,s,d,f=!1,c=n.k,l=n.v;for(let R=0;R<t;R++)switch(a=c[R],i=l[R],a){case 0:o+=(f?",":"")+nn(e,i),f=!0;break;default:u=Number(a),s=u>=0||ye(a),h(e,i)?(d=N(e,i.i),z(e,r),s&&Number.isNaN(u)?we(e,r,a,d):Y(e,r,s?a:'"'+a+'"',d)):(o+=(f?",":"")+(s?a:'"'+a+'"')+":"+g(e,i),f=!0);break}return e.stack.pop(),"{"+o+"}"}function tn(e,r,n,t){let o=Re(e,n,r);return o!=="{}"?"Object.assign("+t+","+o+")":t}function on(e,r,n){e.stack.push(r);let t=[],o,a,i,u=n.k,s=n.v;for(let d=0,f=n.s;d<f;d++)switch(o=u[d],a=s[d],o){case 0:{let c=e.stack;e.stack=[];let l=g(e,a)+ir(e);e.stack=c,i=e.assignments,e.assignments=t,Y(e,r,"Symbol.iterator",e.features&4?"()=>"+l:"function(){return "+l+"}"),e.assignments=i}break;default:{let c=g(e,a),l=Number(o),R=l>=0||ye(o);h(e,a)?R&&Number.isNaN(l)?we(e,r,o,c):Y(e,r,R?o:'"'+o+'"',c):(i=e.assignments,e.assignments=t,R&&Number.isNaN(l)?we(e,r,o,c):Y(e,r,R?o:'"'+o+'"',c),e.assignments=i)}}return e.stack.pop(),Ee(t)}function Ce(e,r,n,t){if(n)if(e.features&128)t=tn(e,n,r,t);else{z(e,r);let o=on(e,r,n);if(o)return"("+p(e,r,t)+","+o+N(e,r)+")"}return p(e,r,t)}var an="Object.create(null)";function sn(e,r){return ke(e,r.o,r.i),Ce(e,r.i,r.d,an)}function dn(e,r){return ke(e,r.o,r.i),p(e,r.i,Re(e,r.i,r.d))}function ln(e,r){let n="new Set",t=r.l,o=r.i;if(t){let a="",i,u=!1,s=r.a;e.stack.push(o);for(let d=0;d<t;d++)i=s[d],h(e,i)?(z(e,o),Xr(e,o,N(e,i.i))):(a+=(u?",":"")+g(e,i),u=!0);e.stack.pop(),a&&(n+="(["+a+"])")}return p(e,o,n)}function un(e,r){let n="new Map",t=r.d.s,o=r.i;if(t){let a="",i,u,s,d,f,c=!1,l=r.d.k,R=r.d.v;e.stack.push(o);for(let m=0;m<t;m++)i=l[m],u=R[m],h(e,i)?(s=N(e,o),z(e,o),h(e,u)?(d=N(e,u.i),Ae(e,o,s,d)):(f=e.stack,e.stack=[],Ae(e,o,s,g(e,u)),e.stack=f)):h(e,u)?(d=N(e,u.i),z(e,o),f=e.stack,e.stack=[],Ae(e,o,g(e,i),d),e.stack=f):(a+=(c?",[":"[")+g(e,i)+","+g(e,u)+"]",c=!0);e.stack.pop(),a&&(n+="(["+a+"])")}return p(e,o,n)}function fn(e,r){let n=r.i;e.stack.push(n);let t='new AggregateError([],"'+r.m+'")';return e.stack.pop(),Ce(e,n,r.d,t)}function cn(e,r){return Ce(e,r.i,r.d,"new "+r.c+'("'+r.m+'")')}function mn(e,r){let n,t=r.f,o=r.i;if(h(e,t)){let a=N(e,t.i);e.features&4?n="Promise.resolve().then(()=>"+a+")":n="Promise.resolve().then(function(){return "+a+"})"}else{e.stack.push(o);let a=g(e,t);e.stack.pop(),n="Promise.resolve("+a+")"}return p(e,o,n)}function Sn(e,r){let n="new Uint8Array(",t=r.s,o=t.length;if(o){n+="[";for(let a=0;a<o;a++)n+=(a>0?",":"")+t[a];n+="]"}return p(e,r.i,n+").buffer")}function yn(e,r){return p(e,r.i,"new "+r.c+"("+g(e,r.f)+","+r.b+","+r.l+")")}function gn(e,r){return p(e,r.i,'new Date("'+r.s+'")')}function pn(e,r){return p(e,r.i,"/"+r.c+"/"+r.m)}function Nn(e,r){return p(e,r.i,'new URL("'+r.s+'")')}function bn(e,r){return p(e,r.i,r.s?'new URLSearchParams("'+r.s+'")':"new URLSearchParams")}function vn(e,r){return p(e,r.i,j+'.get("'+r.s+'")')}function An(e,r){return p(e,r.i,"new DataView("+g(e,r.f)+","+r.b+","+r.l+")")}function wn(e,r){return p(e,r.i,"new Blob(["+g(e,r.f)+'],{type:"'+r.c+'"})')}function En(e,r){return p(e,r.i,"new File(["+g(e,r.f)+'],"'+r.m+'",{type:"'+r.c+'",lastModified:'+r.b+"})")}function kn(e,r){return p(e,r.i,"new Headers("+Re(e,r.i,r.d)+")")}function Rn(e,r){let n,t,o=r.d.k,a=r.d.v,i=r.i,u=[],s;e.stack.push(i);for(let d=0,f=r.d.s;d<f;d++)t=o[d],n=g(e,a[d]),s=e.assignments,e.assignments=u,en(e,i,'"'+t+'"',n),e.assignments=s;return e.stack.pop(),Ee(u)}function Cn(e,r){let n=r.d.s,t=r.i;n&&z(e,t);let o=p(e,t,"new FormData()");if(n){let a=Rn(e,r);return"("+o+","+(a==null?"":a)+N(e,t)+")"}return o}function zn(e,r){return p(e,r.i,"Object("+g(e,r.f)+")")}function In(e,r){return p(e,r.i,Ve[r.s])}function g(e,r){switch(r.t){case 0:return""+r.s;case 1:return'"'+r.s+'"';case 2:return je(r);case 3:return r.s+"n";case 4:return N(e,r.i);case 9:return rn(e,r);case 10:return dn(e,r);case 11:return sn(e,r);case 5:return gn(e,r);case 6:return pn(e,r);case 7:return ln(e,r);case 8:return un(e,r);case 21:return Sn(e,r);case 16:case 15:return yn(e,r);case 22:return An(e,r);case 14:return fn(e,r);case 13:return cn(e,r);case 12:return mn(e,r);case 17:return In(e,r);case 18:return Nn(e,r);case 19:return bn(e,r);case 20:return vn(e,r);case 23:return wn(e,r);case 24:return En(e,r);case 25:return kn(e,r);case 26:return Cn(e,r);case 27:return zn(e,r);default:throw new Error("invariant")}}function ze(e,r,n,t){if(e.vars.length){let o=or(e),a=t;if(o){let u=N(e,r);a=t+","+o+u,t.startsWith(u+"=")||(a=u+"="+a)}let i=e.vars.length>1?e.vars.join(","):e.vars[0];return e.features&4?(i=e.vars.length>1||e.vars.length===0?"("+i+")":i,"("+i+"=>("+a+"))()"):"(function("+i+"){return "+a+"})()"}return n?"("+t+")":t}function Pn(e,r){let n=M(r),t=w(n,e),o=_(n),a=g(o,t);return ze(o,K(n,e),t.t===10,a)}async function to(e,r){let n=M(r),t=await A(n,e),o=_(n),a=g(o,t);return ze(o,K(n,e),t.t===10,a)}function oo(e){return(0,eval)(e)}function ao(e,r){let n=M(r);return{t:w(n,e),r:K(n,e),f:n.features,m:Array.from(n.markedRefs)}}async function io(e,r){let n=M(r);return{t:await A(n,e),r:K(n,e),f:n.features,m:Array.from(n.markedRefs)}}function so(e){let r=_({features:e.f,markedRefs:e.m}),n=g(r,e.t);return ze(r,e.r,e.t.i===10,n)}function lo(e){let r=_({features:e.f,markedRefs:e.m});return E(r,e.t)}var uo=Pn;export{P as Feature,so as compileJSON,fr as createReference,uo as default,oo as deserialize,lo as fromJSON,Pn as serialize,to as serializeAsync,ao as toJSON,io as toJSONAsync};
|
|
1
|
+
var En=Object.defineProperty;var kn=(e,r,n)=>r in e?En(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var ke=(e,r,n)=>(kn(e,typeof r!="symbol"?r+"":r,n),n);var P=(g=>(g[g.AggregateError=1]="AggregateError",g[g.ArrayPrototypeValues=2]="ArrayPrototypeValues",g[g.ArrowFunction=4]="ArrowFunction",g[g.BigInt=8]="BigInt",g[g.ErrorPrototypeStack=16]="ErrorPrototypeStack",g[g.Map=32]="Map",g[g.MethodShorthand=64]="MethodShorthand",g[g.ObjectAssign=128]="ObjectAssign",g[g.Promise=256]="Promise",g[g.Set=512]="Set",g[g.Symbol=1024]="Symbol",g[g.TypedArray=2048]="TypedArray",g[g.BigIntTypedArray=4096]="BigIntTypedArray",g[g.WebAPI=8192]="WebAPI",g))(P||{});var Re={[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"},Ge={[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},Rr={[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};function Pe(e){switch(e.s){case 2:return"!0";case 3:return"!1";case 1:return"void 0";case 0:return"null";case 4:return"-0";case 5:return"1/0";case 6:return"-1/0";case 7:return"NaN";default:throw new Error("invariant")}}function Pr(e){switch(e.s){case 2:return!0;case 3:return!1;case 1:return;case 0:return null;case 4:return-0;case 5:return 1/0;case 6:return-1/0;case 7:return NaN;default:throw new Error("invariant")}}function S(e,r){if(!e)throw r}var Ir="hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_",zr=Ir.length,Br="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_",Or=Br.length;function $e(e){let r=e%zr,n=Ir[r];for(e=(e-r)/zr;e>0;)r=e%Or,n+=Br[r],e=(e-r)/Or;return n}function be(e={}){return{reference:{ids:new Map,marked:new Set},features:16383^(e.disabledFeatures||0)}}function Oe(e){return{stack:[],vars:[],assignments:[],reference:{valid:[],size:0,marked:new Set(e.markedRefs)},features:e.features,flags:[]}}function x(e,r){e.reference.marked.add(r)}function E(e,r){let n=e.reference.valid[r];n==null&&(n=e.reference.size++,e.reference.valid[r]=n);let o=e.vars[n];return o==null&&(o=$e(n),e.vars[n]=o),o}function K(e,r){let n=e.reference.ids.get(r);if(n==null){let o=e.reference.ids.size;return e.reference.ids.set(r,o),o}return x(e,n),n}function hr(e){return{values:new Map,refs:new Set(e.markedRefs)}}function Rn(e){switch(e){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 p(e){let r="",n=0,o;for(let t=0,a=e.length;t<a;t++)o=Rn(e[t]),o&&(r+=e.slice(n,t)+o,n=t+1);return n===0?r=e:r+=e.slice(n),r}function _(e){return e.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{toString:Pn}=Object.prototype,m=class extends Error{constructor(n){super('Unsupported type "'+Pn.call(n)+'"');this.value=n}};function te(e){return{t:2,i:void 0,s: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}}var H=te(2),W=te(3),G=te(1),$=te(0),Tr=te(4),Dr=te(5),jr=te(6),Fr=te(7);var oe="__SEROVAL_REFS__",X="_$",ne="$R",Xe="s",Ye="f",qe="P",Ze="Ps",Qe="Pf",Je="c",er="S",ve="Se",zn=`self.${X}=self.${X}||{${qe}:function(s,f,p){return(p=new Promise(function(a,b){s=a,f=b})).${Xe}=s,p.${Ye}=f,p},uP:function(p){delete p.${Xe};delete p.${Ye}},${Ze}:function(p,d){p.${Xe}(d),p.value=d,this.uP(p)},${Qe}:function(p,d){p.${Ye}(d),this.uP(p)},uS:function(s){delete s.${Je}},${ve}:function(s,t,d,c){switch(c=s.${Je},t){case 0:return c.enqueue(d);case 1:return(this.uS(s),c.error(d));case 2:return(this.uS(s),c.close())}},${er}:function(s,c){return(s=new ReadableStream({start:function(x){c=x}})).${Je}=c,s},}`;function On(e){return e==null?`self.${ne}=self.${ne}||[];`:`(self.${ne}=self.${ne}||{})["${p(e)}"]=[]`}var rr=new Map,de=new Map;function In(e,r){return rr.set(r,e),de.set(e,r),r}function I(e){return rr.has(e)}function Bn(e){return de.has(e)}function Lr(e){return S(I(e),new Error("Missing reference id")),rr.get(e)}function Ur(e){return S(Bn(e),new Error("Missing reference for id:"+e)),de.get(e)}typeof globalThis!==void 0?Object.defineProperty(globalThis,oe,{value:de,configurable:!0,writable:!1,enumerable:!1}):typeof window!==void 0?Object.defineProperty(window,oe,{value:de,configurable:!0,writable:!1,enumerable:!1}):typeof self!==void 0?Object.defineProperty(self,oe,{value:de,configurable:!0,writable:!1,enumerable:!1}):typeof global!==void 0&&Object.defineProperty(global,oe,{value:de,configurable:!0,writable:!1,enumerable:!1});function Y(e){switch(e){case 1/0:return Dr;case-1/0:return jr;default:return e!==e?Fr:Object.is(e,-0)?Tr:{t:0,i:void 0,s: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(e){return{t:1,i:void 0,s:p(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 q(e,r){return S(e.features&8,new m(r)),{t:3,i:void 0,s:""+r,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(e){return{t:4,i:e,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(e,r){return{t:5,i:e,s:r.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 Q(e,r){return{t:6,i:e,s:void 0,l:void 0,c:r.source,m:r.flags,p:void 0,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function V(e,r){let n=new Uint8Array(r),o=n.length,t=new Array(o);for(let a=0;a<o;a++)t[a]=n[a];return{t:21,i:e,s:t,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(e,r,n){return S(e.features&1024,new m(n)),S(n in Ge,new Error("Only well-known symbols are supported.")),{t:17,i:r,s:Ge[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 T(e,r){return{t:20,i:e,s:p(Lr(r)),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 le(e,r){let n=K(e,r);return e.reference.marked.has(n)?z(n):V(n,r)}function Be(e,r,n){return S(e.features&2048,new m(n)),{t:15,i:r,s:void 0,l:n.length,c:n.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:le(e,n.buffer),b:n.byteOffset,o:void 0}}var Vr=4104;function he(e,r,n){return S((e.features&Vr)===Vr,new m(n)),{t:16,i:r,s:void 0,l:n.length,c:n.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:le(e,n.buffer),b:n.byteOffset,o:void 0}}function Te(e,r,n){return{t:22,i:r,s:void 0,l:n.byteLength,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:le(e,n.buffer),b:n.byteOffset,o:void 0}}function De(e,r){let n=K(e,r);return e.reference.marked.has(n)?z(n):I(r)?T(n,r):Ie(e,n,r)}function je(e,r){S(I(r),new Error("Cannot serialize function without reference ID."));let n=K(e,r);return e.reference.marked.has(n)?z(n):T(n,r)}function M(e){return e instanceof EvalError?"EvalError":e instanceof RangeError?"RangeError":e instanceof ReferenceError?"ReferenceError":e instanceof SyntaxError?"SyntaxError":e instanceof TypeError?"TypeError":e instanceof URIError?"URIError":"Error"}function _r(e){switch(e){case"Error":return Error;case"EvalError":return EvalError;case"RangeError":return RangeError;case"ReferenceError":return ReferenceError;case"SyntaxError":return SyntaxError;case"TypeError":return TypeError;case"URIError":return URIError;default:throw new Error(`Unknown Error constructor "${e}"`)}}function L(e,r){let n,o=M(r);r.name!==o?n={name:r.name}:r.constructor.name!==o&&(n={name:r.constructor.name});let t=Object.getOwnPropertyNames(r);for(let a of t)a!=="name"&&a!=="message"&&(a==="stack"?e.features&16&&(n=n||{},n[a]=r[a]):(n=n||{},n[a]=r[a]));return n}function y(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;switch(e.constructor){case Map:case Set:case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:case BigInt64Array:case BigUint64Array:return!1;default:break}return Symbol.iterator in e}function xr(e){switch(e){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 "${e}"`)}}var hn=/^[$A-Z_][0-9A-Z_$]*$/i;function fe(e){let r=e[0];return(r==="$"||r==="_"||r>="A"&&r<="Z"||r>="a"&&r<="z")&&hn.test(e)}function U(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:Object.isExtensible(e)?0:1}async function Mr(e,r,n){return S(e.features&8192,new m(n)),{t:23,i:r,s:void 0,l:void 0,c:p(n.type),m:void 0,p:void 0,e:void 0,f:le(e,await n.arrayBuffer()),a:void 0,b:void 0,o:void 0}}async function Kr(e,r,n){return S(e.features&8192,new m(n)),{t:24,i:r,s:void 0,l:void 0,c:p(n.type),m:p(n.name),p:void 0,e:void 0,f:le(e,await n.arrayBuffer()),a:void 0,b:n.lastModified,o:void 0}}function ee(e,r,n){return S(e.features&8192,new m(n)),{t:18,i:r,s:p(n.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 re(e,r,n){return S(e.features&8192,new m(n)),{t:19,i:r,s:p(n.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}}async function Ae(e){try{return[1,await e]}catch(r){return[0,r]}}async function Tn(e,r){let n=r.length,o=new Array(n),t=new Array(n),a;for(let s=0;s<n;s++)s in r&&(a=r[s],y(a)?t[s]=a:o[s]=await O(e,a));for(let s=0;s<n;s++)s in t&&(o[s]=await O(e,t[s]));return o}async function Gr(e,r,n){return{t:9,i:r,s:void 0,l:n.length,c:void 0,m:void 0,p:void 0,e:void 0,a:await Tn(e,n),f:void 0,b:void 0,o:U(n)}}async function Dn(e,r,n){S(e.features&32,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0;for(let[l,c]of n.entries())y(l)||y(c)?(s[i]=l,f[i]=c,i++):(t[d]=await O(e,l),a[d]=await O(e,c),d++);for(let l=0;l<i;l++)t[d+l]=await O(e,s[l]),a[d+l]=await O(e,f[l]);return{t:8,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:a,s:o},a:void 0,f:void 0,b:void 0,o:void 0}}async function jn(e,r,n){S(e.features&512,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=0,f=0;for(let i of n.keys())y(i)?a[s++]=i:t[f++]=await O(e,i);for(let i=0;i<s;i++)t[f+i]=await O(e,a[i]);return{t:7,i:r,s:void 0,l:o,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}async function or(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=await O(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=await O(e,f[u]);if(e.features&1024&&Symbol.iterator in r){t[o]=0;let u=Array.from(r);a[o]=await Gr(e,K(e,u),u),o++}return{k:t,v:a,s:o}}async function $r(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=await O(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=await O(e,f[u]);return{k:t,v:a,s:o}}async function Hr(e,r,n){S(e.features&256,new m(n));let[o,t]=await Ae(n);return{t:12,i:r,s:o,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await O(e,t),b:void 0,o:void 0}}async function nr(e,r,n,o){return{t:o?11:10,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:await or(e,n),e:void 0,a:void 0,f:void 0,b:void 0,o:U(n)}}async function Wr(e,r,n){let o=L(e,n),t=o?await or(e,o):void 0;return{t:14,i:r,s:void 0,l:void 0,c:void 0,m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async function Le(e,r,n){let o=L(e,n),t=o?await or(e,o):void 0;return{t:13,i:r,s:void 0,l:void 0,c:M(n),m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async function Fn(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:25,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await $r(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}async function Ln(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:26,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await $r(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}async function Un(e,r,n){return{t:27,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await O(e,n.valueOf()),b:void 0,o:void 0}}async function Vn(e,r){if(!r)return $;let n=K(e,r);if(e.reference.marked.has(n))return z(n);if(I(r))return T(n,r);if(Array.isArray(r))return Gr(e,n,r);switch(r.constructor){case Number:case Boolean:case String:case BigInt:case Function:case Symbol:return Un(e,n,r);case Date:return Z(n,r);case RegExp:return Q(n,r);case Promise:return Hr(e,n,r);case ArrayBuffer:return V(n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return Be(e,n,r);case BigInt64Array:case BigUint64Array:return he(e,n,r);case DataView:return Te(e,n,r);case Map:return Dn(e,n,r);case Set:return jn(e,n,r);case Object:return nr(e,n,r,!1);case void 0:return nr(e,n,r,!0);case AggregateError:return e.features&1?Wr(e,n,r):Le(e,n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Le(e,n,r);case URL:return ee(e,n,r);case URLSearchParams:return re(e,n,r);case Blob:return Mr(e,n,r);case File:return Kr(e,n,r);case Headers:return Fn(e,n,r);case FormData:return Ln(e,n,r);default:break}if(r instanceof AggregateError)return e.features&1?Wr(e,n,r):Le(e,n,r);if(r instanceof Error)return Le(e,n,r);if(r instanceof Promise)return Hr(e,n,r);if(Symbol.iterator in r)return nr(e,n,r,!!r.constructor);throw new m(r)}async function O(e,r){switch(typeof r){case"boolean":return r?H:W;case"undefined":return G;case"string":return J(r);case"number":return Y(r);case"bigint":return q(e,r);case"object":return Vn(e,r);case"symbol":return De(e,r);case"function":return je(e,r);default:throw new m(r)}}function Xr(e,r){switch(r){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}function k(e,r,n){return e.refs.has(r)&&e.values.set(r,n),n}function _n(e,r){let n=r.l,o=k(e,r.i,new Array(n)),t;for(let a=0;a<n;a++)t=r.a[a],t&&(o[a]=D(e,t));return Xr(o,r.o),o}function Yr(e,r,n){let o=r.s;if(o){let t,a,s=r.k,f=r.v;for(let i=0;i<o;i++)switch(t=s[i],a=D(e,f[i]),t){case 0:{let d=a;n[Symbol.iterator]=()=>d.values()}break;default:n[_(t)]=a;break}}return n}function xn(e,r){let n=k(e,r.i,r.t===10?{}:Object.create(null));return Yr(e,r.p,n),Xr(n,r.o),n}function Mn(e,r){let n=k(e,r.i,new Set),o=r.a;for(let t=0,a=r.l;t<a;t++)n.add(D(e,o[t]));return n}function Kn(e,r){let n=k(e,r.i,new Map),o=r.e.k,t=r.e.v;for(let a=0,s=r.e.s;a<s;a++)n.set(D(e,o[a]),D(e,t[a]));return n}function Jr(e,r,n){if(r.p){let o=Yr(e,r.p,{});Object.assign(n,o)}return n}function Hn(e,r){let n=k(e,r.i,new AggregateError([],_(r.m)));return Jr(e,r,n)}function Wn(e,r){let n=_r(r.c),o=k(e,r.i,new n(_(r.m)));return Jr(e,r,o)}function Gn(){let e,r;return{resolve(n){e(n)},reject(n){r(n)},promise:new Promise((n,o)=>{e=n,r=o})}}async function $n(e,r){let n=Gn(),o=k(e,r.i,n.promise),t=D(e,r.f);return r.s?n.resolve(t):n.reject(t),o}function Xn(e,r){let n=new Uint8Array(r.s);return k(e,r.i,n.buffer)}function Yn(e,r){let n=xr(r.c),o=D(e,r.f);return k(e,r.i,new n(o,r.b,r.l))}function Jn(e,r){return k(e,r.i,new Date(r.s))}function qn(e,r){return k(e,r.i,new RegExp(r.c,r.m))}function Zn(e,r){return k(e,r.i,new URL(_(r.s)))}function Qn(e,r){return k(e,r.i,new URLSearchParams(_(r.s)))}function eo(e,r){return k(e,r.i,Ur(_(r.s)))}function ro(e,r){let n=D(e,r.f);return k(e,r.i,new DataView(n,r.b,r.l))}function no(e,r){let n=D(e,r.f);return k(e,r.i,new Blob([n],{type:_(r.c)}))}function oo(e,r){let n=D(e,r.f);return k(e,r.i,new File([n],_(r.m),{type:_(r.c),lastModified:r.b}))}function to(e,r){let n=k(e,r.i,new Headers),o=r.e.k,t=r.e.v;for(let a=0,s=r.e.s;a<s;a++)n.set(_(o[a]),D(e,t[a]));return n}function ao(e,r){let n=k(e,r.i,new FormData),o=r.e.k,t=r.e.v;for(let a=0,s=r.e.s;a<s;a++)n.set(_(o[a]),D(e,t[a]));return n}function so(e,r){return k(e,r.i,Object(D(e,r.f)))}function D(e,r){switch(r.t){case 2:return Pr(r);case 0:return r.s;case 1:return _(r.s);case 3:return BigInt(r.s);case 4:return e.values.get(r.i);case 9:return _n(e,r);case 10:case 11:return xn(e,r);case 5:return Jn(e,r);case 6:return qn(e,r);case 7:return Mn(e,r);case 8:return Kn(e,r);case 21:return Xn(e,r);case 16:case 15:return Yn(e,r);case 22:return ro(e,r);case 14:return Hn(e,r);case 13:return Wn(e,r);case 12:return $n(e,r);case 17:return Rr[r.s];case 18:return Zn(e,r);case 19:return Qn(e,r);case 20:return eo(e,r);case 23:return no(e,r);case 24:return oo(e,r);case 25:return to(e,r);case 26:return ao(e,r);case 27:return so(e,r);default:throw new Error("invariant")}}function Ue(e){switch(e.t){case"index":return e.s+"="+e.v;case"set":return e.s+".set("+e.k+","+e.v+")";case"add":return e.s+".add("+e.v+")";case"append":return e.s+".append("+e.k+","+e.v+")";default:return""}}var io={[3]:"Object.freeze",[2]:"Object.seal",[1]:"Object.preventExtensions",[0]:void 0};function uo(e){let r=[],n=e[0],o=n,t;for(let a=1,s=e.length;a<s;a++){if(t=e[a],t.t===o.t)switch(t.t){case"index":t.v===o.v?n={t:"index",s:t.s,k:void 0,v:Ue(n)}:(r.push(n),n=t);break;case"set":t.s===o.s?n={t:"set",s:Ue(n),k:t.k,v:t.v}:(r.push(n),n=t);break;case"add":t.s===o.s?n={t:"add",s:Ue(n),k:void 0,v:t.v}:(r.push(n),n=t);break;case"append":r.push(n),n=t;break;default:break}else r.push(n),n=t;o=t}return r.push(n),r}function ae(e){if(e.length){let r="",n=uo(e);for(let o=0,t=n.length;o<t;o++)r+=Ue(n[o])+",";return r}}function Ve(e){let r="";for(let n=0,o=e.length;n<o;n++){let t=e[n];r+=io[t.type]+"("+t.value+"),"}return r}function sr(e,r,n){r!==0&&(x(e,n),e.flags.push({type:r,value:E(e,n)}))}function qr(e){let r=ae(e.assignments),n=Ve(e.flags);return r?n?r+n:r:n}function Zr(e,r,n){e.assignments.push({t:"index",s:r,k:void 0,v:n})}function lo(e,r,n){e.assignments.push({t:"add",s:E(e,r),k:void 0,v:n})}function tr(e,r,n,o){e.assignments.push({t:"set",s:E(e,r),k:n,v:o})}function fo(e,r,n,o){e.assignments.push({t:"append",s:E(e,r),k:n,v:o})}function we(e,r,n,o){Zr(e,E(e,r)+"["+n+"]",o)}function ar(e,r,n,o){x(e,r),Zr(e,E(e,r)+"."+n,o)}function C(e,r,n){return e.reference.marked.has(r)?E(e,r)+"="+n:n}function se(e,r){return r.t===4&&e.stack.includes(r.i)}function co(e,r){let n=r.i;e.stack.push(n);let o="",t,a=!1,s=r.a;for(let f=0,i=r.l;f<i;f++)f!==0&&(o+=","),t=s[f],t?se(e,t)?(x(e,n),we(e,n,f,E(e,t.i)),a=!0):(o+=w(e,t),a=!1):a=!0;return e.stack.pop(),sr(e,r.o,r.i),C(e,n,"["+o+(a?",]":"]"))}function Qr(e){return e.features&2?".values()":"[Symbol.iterator]()"}function mo(e,r){let n=e.stack;e.stack=[];let o=w(e,r)+Qr(e);return e.stack=n,e.features&4?o="[Symbol.iterator]:()=>"+o:e.features&64?o="[Symbol.iterator](){return "+o+"}":o="[Symbol.iterator]:function(){return "+o+"}",o}function ir(e,r,n){let o=n.s;if(o===0)return"{}";let t="";e.stack.push(r);let a,s,f,i,d,l=!1,c=n.k,u=n.v;for(let b=0;b<o;b++)switch(a=c[b],s=u[b],a){case 0:t+=(l?",":"")+mo(e,s),l=!0;break;default:f=Number(a),i=f>=0||fe(a),se(e,s)?(d=E(e,s.i),x(e,r),i&&Number.isNaN(f)?ar(e,r,a,d):we(e,r,i?a:'"'+a+'"',d)):(t+=(l?",":"")+(i?a:'"'+a+'"')+":"+w(e,s),l=!0);break}return e.stack.pop(),"{"+t+"}"}function So(e,r,n,o){let t=ir(e,n,r);return t!=="{}"?"Object.assign("+o+","+t+")":o}function po(e,r,n){e.stack.push(r);let o=[],t,a,s,f=n.k,i=n.v;for(let d=0,l=n.s;d<l;d++)switch(t=f[d],a=i[d],t){case 0:{let c=e.stack;e.stack=[];let u=w(e,a)+Qr(e);e.stack=c,s=e.assignments,e.assignments=o,we(e,r,"Symbol.iterator",e.features&4?"()=>"+u:"function(){return "+u+"}"),e.assignments=s}break;default:{let c=w(e,a),u=Number(t),b=u>=0||fe(t);se(e,a)?b&&Number.isNaN(u)?ar(e,r,t,c):we(e,r,b?t:'"'+t+'"',c):(s=e.assignments,e.assignments=o,b&&Number.isNaN(u)?ar(e,r,t,c):we(e,r,b?t:'"'+t+'"',c),e.assignments=s)}}return e.stack.pop(),ae(o)}function dr(e,r,n,o){if(n)if(e.features&128)o=So(e,n,r,o);else{x(e,r);let t=po(e,r,n);if(t)return"("+C(e,r,o)+","+t+E(e,r)+")"}return C(e,r,o)}var go="Object.create(null)";function yo(e,r){return sr(e,r.o,r.i),dr(e,r.i,r.p,go)}function No(e,r){return sr(e,r.o,r.i),C(e,r.i,ir(e,r.i,r.p))}function bo(e,r){let n="new Set",o=r.l,t=r.i;if(o){let a="",s,f=!1,i=r.a;e.stack.push(t);for(let d=0;d<o;d++)s=i[d],se(e,s)?(x(e,t),lo(e,t,E(e,s.i))):(a+=(f?",":"")+w(e,s),f=!0);e.stack.pop(),a&&(n+="(["+a+"])")}return C(e,t,n)}function vo(e,r){let n="new Map",o=r.e.s,t=r.i;if(o){let a="",s,f,i,d,l,c=!1,u=r.e.k,b=r.e.v;e.stack.push(t);for(let g=0;g<o;g++)s=u[g],f=b[g],se(e,s)?(i=E(e,t),x(e,t),se(e,f)?(d=E(e,f.i),tr(e,t,i,d)):(l=e.stack,e.stack=[],tr(e,t,i,w(e,f)),e.stack=l)):se(e,f)?(d=E(e,f.i),x(e,t),l=e.stack,e.stack=[],tr(e,t,w(e,s),d),e.stack=l):(a+=(c?",[":"[")+w(e,s)+","+w(e,f)+"]",c=!0);e.stack.pop(),a&&(n+="(["+a+"])")}return C(e,t,n)}function Ao(e,r){let n=r.i;e.stack.push(n);let o='new AggregateError([],"'+r.m+'")';return e.stack.pop(),dr(e,n,r.p,o)}function wo(e,r){return dr(e,r.i,r.p,"new "+r.c+'("'+r.m+'")')}var Co="Promise.resolve",Eo="Promise.reject";function ko(e,r){let n,o=r.f,t=r.i,a=r.s?Co:Eo;if(se(e,o)){let s=E(e,o.i);e.features&4?r.s?n=a+"().then(()=>"+s+")":n=a+"().catch(()=>{throw "+s+"})":r.s?n=a+"().then(function(){return "+s+"})":n=a+"().catch(function(){throw "+s+"})"}else{e.stack.push(t);let s=w(e,o);e.stack.pop(),n=a+"("+s+")"}return C(e,t,n)}function Ro(e,r){let n="new Uint8Array(",o=r.s,t=o.length;if(t){n+="[";for(let a=0;a<t;a++)n+=(a>0?",":"")+o[a];n+="]"}return C(e,r.i,n+").buffer")}function Po(e,r){return C(e,r.i,"new "+r.c+"("+w(e,r.f)+","+r.b+","+r.l+")")}function zo(e,r){return C(e,r.i,'new Date("'+r.s+'")')}function Oo(e,r){return C(e,r.i,"/"+r.c+"/"+r.m)}function Io(e,r){return C(e,r.i,'new URL("'+r.s+'")')}function Bo(e,r){return C(e,r.i,r.s?'new URLSearchParams("'+r.s+'")':"new URLSearchParams")}function ho(e,r){return C(e,r.i,oe+'.get("'+r.s+'")')}function To(e,r){return C(e,r.i,"new DataView("+w(e,r.f)+","+r.b+","+r.l+")")}function Do(e,r){return C(e,r.i,"new Blob(["+w(e,r.f)+'],{type:"'+r.c+'"})')}function jo(e,r){return C(e,r.i,"new File(["+w(e,r.f)+'],"'+r.m+'",{type:"'+r.c+'",lastModified:'+r.b+"})")}function Fo(e,r){return C(e,r.i,"new Headers("+ir(e,r.i,r.e)+")")}function Lo(e,r){let n,o,t=r.e.k,a=r.e.v,s=r.i,f=[],i;e.stack.push(s);for(let d=0,l=r.e.s;d<l;d++)o=t[d],n=w(e,a[d]),i=e.assignments,e.assignments=f,fo(e,s,'"'+o+'"',n),e.assignments=i;return e.stack.pop(),ae(f)}function Uo(e,r){let n=r.e.s,o=r.i;n&&x(e,o);let t=C(e,o,"new FormData()");if(n){let a=Lo(e,r);return"("+t+","+(a==null?"":a)+E(e,o)+")"}return t}function Vo(e,r){return C(e,r.i,"Object("+w(e,r.f)+")")}function _o(e,r){return C(e,r.i,Re[r.s])}function w(e,r){switch(r.t){case 0:return""+r.s;case 1:return'"'+r.s+'"';case 2:return Pe(r);case 3:return r.s+"n";case 4:return E(e,r.i);case 9:return co(e,r);case 10:return No(e,r);case 11:return yo(e,r);case 5:return zo(e,r);case 6:return Oo(e,r);case 7:return bo(e,r);case 8:return vo(e,r);case 21:return Ro(e,r);case 16:case 15:return Po(e,r);case 22:return To(e,r);case 14:return Ao(e,r);case 13:return wo(e,r);case 12:return ko(e,r);case 17:return _o(e,r);case 18:return Io(e,r);case 19:return Bo(e,r);case 20:return ho(e,r);case 23:return Do(e,r);case 24:return jo(e,r);case 25:return Fo(e,r);case 26:return Uo(e,r);case 27:return Vo(e,r);default:throw new Error("invariant")}}function xo(e,r){let n=r.length,o=new Array(n),t=new Array(n),a;for(let s=0;s<n;s++)s in r&&(a=r[s],y(a)?t[s]=a:o[s]=B(e,a));for(let s=0;s<n;s++)s in t&&(o[s]=B(e,t[s]));return o}function rn(e,r,n){return{t:9,i:r,s:void 0,l:n.length,c:void 0,m:void 0,p:void 0,e:void 0,a:xo(e,n),f:void 0,b:void 0,o:U(n)}}function Mo(e,r,n){S(e.features&32,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0;for(let[l,c]of n.entries())y(l)||y(c)?(s[i]=l,f[i]=c,i++):(t[d]=B(e,l),a[d]=B(e,c),d++);for(let l=0;l<i;l++)t[d+l]=B(e,s[l]),a[d+l]=B(e,f[l]);return{t:8,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:a,s:o},a:void 0,f:void 0,b:void 0,o:void 0}}function Ko(e,r,n){S(e.features&512,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=0,f=0;for(let i of n.keys())y(i)?a[s++]=i:t[f++]=B(e,i);for(let i=0;i<s;i++)t[f+i]=B(e,a[i]);return{t:7,i:r,s:void 0,l:o,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}function lr(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=B(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=B(e,f[u]);if(e.features&1024&&Symbol.iterator in r){t[o]=0;let u=Array.from(r),b=K(e,u);a[o]=rn(e,b,u),o++}return{k:t,v:a,s:o}}function nn(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=B(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=B(e,f[u]);return{k:t,v:a,s:o}}function ur(e,r,n,o){return{t:o?11:10,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:lr(e,n),e:void 0,a:void 0,f:void 0,b:void 0,o:U(n)}}function en(e,r,n){let o=L(e,n),t=o?lr(e,o):void 0;return{t:14,i:r,s:void 0,l:void 0,c:void 0,m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function _e(e,r,n){let o=L(e,n),t=o?lr(e,o):void 0;return{t:13,i:r,s:void 0,l:void 0,c:M(n),m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Ho(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:25,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:nn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}function Wo(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:26,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:nn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}function Go(e,r,n){return{t:27,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:B(e,n.valueOf()),b:void 0,o:void 0}}function $o(e,r){if(!r)return $;let n=K(e,r);if(e.reference.marked.has(n))return z(n);if(I(r))return T(n,r);if(Array.isArray(r))return rn(e,n,r);switch(r.constructor){case Number:case Boolean:case String:case BigInt:case Function:case Symbol:return Go(e,n,r);case Date:return Z(n,r);case RegExp:return Q(n,r);case ArrayBuffer:return V(n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return Be(e,n,r);case BigInt64Array:case BigUint64Array:return he(e,n,r);case DataView:return Te(e,n,r);case Map:return Mo(e,n,r);case Set:return Ko(e,n,r);case Object:return ur(e,n,r,!1);case void 0:return ur(e,n,r,!0);case AggregateError:return e.features&1?en(e,n,r):_e(e,n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return _e(e,n,r);case URL:return ee(e,n,r);case URLSearchParams:return re(e,n,r);case Headers:return Ho(e,n,r);case FormData:return Wo(e,n,r);default:break}if(r instanceof AggregateError)return e.features&1?en(e,n,r):_e(e,n,r);if(r instanceof Error)return _e(e,n,r);if(Symbol.iterator in r)return ur(e,n,r,!!r.constructor);throw new m(r)}function B(e,r){switch(typeof r){case"boolean":return r?H:W;case"undefined":return G;case"string":return J(r);case"number":return Y(r);case"bigint":return q(e,r);case"object":return $o(e,r);case"symbol":return De(e,r);case"function":return je(e,r);default:throw new m(r)}}function fr(e,r,n,o){if(r!=null&&e.vars.length){let t=qr(e),a=o;if(t){let f=E(e,r);a=o+","+t+f,o.startsWith(f+"=")||(a=f+"="+a)}let s=e.vars.length>1?e.vars.join(","):e.vars[0];return e.features&4?(s=e.vars.length>1||e.vars.length===0?"("+s+")":s,"("+s+"=>("+a+"))()"):"(function("+s+"){return "+a+"})()"}return n?"("+o+")":o}function on(e,r){let n=be(r),o=B(n,e),t=Oe({markedRefs:n.reference.marked,features:n.features}),a=w(t,o);return fr(t,o.i,o.t===10,a)}async function qs(e,r){let n=be(r),o=await O(n,e),t=Oe({markedRefs:n.reference.marked,features:n.features}),a=w(t,o);return fr(t,o.i,o.t===10,a)}function Zs(e){return(0,eval)(e)}function Qs(e,r){let n=be(r);return{t:B(n,e),f:n.features,m:Array.from(n.reference.marked)}}async function ei(e,r){let n=be(r);return{t:await O(n,e),f:n.features,m:Array.from(n.reference.marked)}}function ri(e){let r=Oe({features:e.f,markedRefs:e.m}),n=w(r,e.t);return fr(r,e.t.i,e.t.i===10,n)}function ni(e){let r=hr({markedRefs:e.m});return D(r,e.t)}function cr(e={}){return{scopeId:e.scopeId,refs:e.refs||new Map,features:16383^(e.disabledFeatures||0)}}function ce(e,r){let n=e.refs.get(r);if(n==null){let o=e.refs.size;return e.refs.set(r,o),o}return n}function tn(e){return{alive:!0,pending:0,refs:e.refs||new Map,features:16383^(e.disabledFeatures||0),onParse:e.onParse,onDone(){e.onDone&&e.onDone()},scopeId:e.scopeId}}function mr(e){e.pending++}function Ce(e){--e.pending<=0&&e.onDone()}function xe(e){return{stack:[],assignments:[],features:e.features,flags:[]}}function me(e,r){let n=e.refs.get(r);if(n!=null)return z(n);let o=e.refs.size;return e.refs.set(r,o),V(o,r)}function Se(e,r,n){return S(e.features&2048,new m(n)),{t:15,i:r,s:void 0,l:n.length,c:n.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:me(e,n.buffer),b:n.byteOffset,o:void 0}}var an=4104;function pe(e,r,n){return S((e.features&an)===an,new m(n)),{t:16,i:r,s:void 0,l:n.length,c:n.constructor.name,m:void 0,p:void 0,e:void 0,a:void 0,f:me(e,n.buffer),b:n.byteOffset,o:void 0}}function ge(e,r,n){return{t:22,i:r,s:void 0,l:n.byteLength,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:me(e,n.buffer),b:n.byteOffset,o:void 0}}function ye(e,r){let n=e.refs.get(r);if(n!=null)return z(n);let o=e.refs.size;return e.refs.set(r,o),I(r)?T(o,r):Ie(e,o,r)}function Ne(e,r){S(I(r),new Error("Cannot serialize function without reference ID."));let n=e.refs.get(r);if(n!=null)return z(n);let o=e.refs.size;return e.refs.set(r,o),T(o,r)}async function sn(e,r,n){return S(e.features&8192,new m(n)),{t:23,i:r,s:void 0,l:void 0,c:p(n.type),m:void 0,p:void 0,e:void 0,f:me(e,await n.arrayBuffer()),a:void 0,b:void 0,o:void 0}}async function dn(e,r,n){return S(e.features&8192,new m(n)),{t:24,i:r,s:void 0,l:void 0,c:p(n.type),m:p(n.name),p:void 0,e:void 0,f:me(e,await n.arrayBuffer()),a:void 0,b:n.lastModified,o:void 0}}async function Xo(e,r){let n=r.length,o=new Array(n),t=new Array(n),a;for(let s=0;s<n;s++)s in r&&(a=r[s],y(a)?t[s]=a:o[s]=await h(e,a));for(let s=0;s<n;s++)s in t&&(o[s]=await h(e,t[s]));return o}async function fn(e,r,n){return{t:9,i:r,s:void 0,l:n.length,c:void 0,m:void 0,p:void 0,e:void 0,a:await Xo(e,n),f:void 0,b:void 0,o:U(n)}}async function Yo(e,r,n){S(e.features&32,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0;for(let[l,c]of n.entries())y(l)||y(c)?(s[i]=l,f[i]=c,i++):(t[d]=await h(e,l),a[d]=await h(e,c),d++);for(let l=0;l<i;l++)t[d+l]=await h(e,s[l]),a[d+l]=await h(e,f[l]);return{t:8,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:a,s:o},a:void 0,f:void 0,b:void 0,o:void 0}}async function Jo(e,r,n){S(e.features&512,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=0,f=0;for(let i of n.keys())y(i)?a[s++]=i:t[f++]=await h(e,i);for(let i=0;i<s;i++)t[f+i]=await h(e,a[i]);return{t:7,i:r,s:void 0,l:o,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}async function pr(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=await h(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=await h(e,f[u]);if(e.features&1024&&Symbol.iterator in r){t[o]=0;let u=Array.from(r);a[o]=await fn(e,ce(e,u),u),o++}return{k:t,v:a,s:o}}async function cn(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=await h(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=await h(e,f[u]);return{k:t,v:a,s:o}}async function un(e,r,n){S(e.features&256,new m(n));let[o,t]=await Ae(n);return{t:12,i:r,s:o,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await h(e,t),b:void 0,o:void 0}}async function Sr(e,r,n,o){return{t:o?11:10,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:await pr(e,n),e:void 0,a:void 0,f:void 0,b:void 0,o:U(n)}}async function ln(e,r,n){let o=L(e,n),t=o?await pr(e,o):void 0;return{t:14,i:r,s:void 0,l:void 0,c:void 0,m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async function Me(e,r,n){let o=L(e,n),t=o?await pr(e,o):void 0;return{t:13,i:r,s:void 0,l:void 0,c:M(n),m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}async function qo(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:25,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await cn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}async function Zo(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:26,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:await cn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}async function Qo(e,r,n){return{t:27,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:await h(e,n.valueOf()),b:void 0,o:void 0}}async function et(e,r){if(!r)return $;let n=e.refs.get(r);if(n!=null)return z(n);let o=e.refs.size;if(e.refs.set(r,o),I(r))return T(o,r);if(Array.isArray(r))return fn(e,o,r);switch(r.constructor){case Number:case Boolean:case String:case BigInt:case Function:case Symbol:return Qo(e,o,r);case Date:return Z(o,r);case RegExp:return Q(o,r);case Promise:return un(e,o,r);case ArrayBuffer:return V(o,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return Se(e,o,r);case BigInt64Array:case BigUint64Array:return pe(e,o,r);case DataView:return ge(e,o,r);case Map:return Yo(e,o,r);case Set:return Jo(e,o,r);case Object:return Sr(e,o,r,!1);case void 0:return Sr(e,o,r,!0);case AggregateError:return e.features&1?ln(e,o,r):Me(e,o,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Me(e,o,r);case URL:return ee(e,o,r);case URLSearchParams:return re(e,o,r);case Blob:return sn(e,o,r);case File:return dn(e,o,r);case Headers:return qo(e,o,r);case FormData:return Zo(e,o,r);default:break}if(r instanceof AggregateError)return e.features&1?ln(e,o,r):Me(e,o,r);if(r instanceof Error)return Me(e,o,r);if(r instanceof Promise)return un(e,o,r);if(Symbol.iterator in r)return Sr(e,o,r,!!r.constructor);throw new m(r)}async function h(e,r){switch(typeof r){case"boolean":return r?H:W;case"undefined":return G;case"string":return J(r);case"number":return Y(r);case"bigint":return q(e,r);case"object":return et(e,r);case"symbol":return ye(e,r);case"function":return Ne(e,r);default:throw new m(r)}}function v(e){return ne+"["+e+"]"}function Nr(e,r,n){r!==0&&e.flags.push({type:r,value:v(n)})}function mn(e){let r=ae(e.assignments),n=Ve(e.flags);return r?n?r+n:r:n}function Sn(e,r,n){e.assignments.push({t:"index",s:r,k:void 0,v:n})}function rt(e,r,n){e.assignments.push({t:"add",s:v(r),k:void 0,v:n})}function gr(e,r,n,o){e.assignments.push({t:"set",s:v(r),k:n,v:o})}function nt(e,r,n,o){e.assignments.push({t:"append",s:v(r),k:n,v:o})}function Ee(e,r,n,o){Sn(e,v(r)+"["+n+"]",o)}function yr(e,r,n,o){Sn(e,v(r)+"."+n,o)}function A(e,r){return v(e)+"="+r}function ie(e,r){return r.t===4&&e.stack.includes(r.i)}function ot(e,r){let n=r.i;e.stack.push(n);let o="",t,a=!1,s=r.a;for(let f=0,i=r.l;f<i;f++)f!==0&&(o+=","),t=s[f],t?ie(e,t)?(Ee(e,n,f,v(t.i)),a=!0):(o+=N(e,t),a=!1):a=!0;return e.stack.pop(),Nr(e,r.o,r.i),A(n,"["+o+(a?",]":"]"))}function pn(e){return e.features&2?".values()":"[Symbol.iterator]()"}function tt(e,r){let n=e.stack;e.stack=[];let o=N(e,r)+pn(e);return e.stack=n,e.features&4?o="[Symbol.iterator]:()=>"+o:e.features&64?o="[Symbol.iterator](){return "+o+"}":o="[Symbol.iterator]:function(){return "+o+"}",o}function br(e,r,n){let o=n.s;if(o===0)return"{}";let t="";e.stack.push(r);let a,s,f,i,d,l=!1,c=n.k,u=n.v;for(let b=0;b<o;b++)switch(a=c[b],s=u[b],a){case 0:t+=(l?",":"")+tt(e,s),l=!0;break;default:f=Number(a),i=f>=0||fe(a),ie(e,s)?(d=v(s.i),i&&Number.isNaN(f)?yr(e,r,a,d):Ee(e,r,i?a:'"'+a+'"',d)):(t+=(l?",":"")+(i?a:'"'+a+'"')+":"+N(e,s),l=!0);break}return e.stack.pop(),"{"+t+"}"}function at(e,r,n,o){let t=br(e,n,r);return t!=="{}"?"Object.assign("+o+","+t+")":o}function st(e,r,n){e.stack.push(r);let o=[],t,a,s,f=n.k,i=n.v;for(let d=0,l=n.s;d<l;d++)switch(t=f[d],a=i[d],t){case 0:{let c=e.stack;e.stack=[];let u=N(e,a)+pn(e);e.stack=c,s=e.assignments,e.assignments=o,Ee(e,r,"Symbol.iterator",e.features&4?"()=>"+u:"function(){return "+u+"}"),e.assignments=s}break;default:{let c=N(e,a),u=Number(t),b=u>=0||fe(t);ie(e,a)?b&&Number.isNaN(u)?yr(e,r,t,c):Ee(e,r,b?t:'"'+t+'"',c):(s=e.assignments,e.assignments=o,b&&Number.isNaN(u)?yr(e,r,t,c):Ee(e,r,b?t:'"'+t+'"',c),e.assignments=s)}}return e.stack.pop(),ae(o)}function vr(e,r,n,o){if(n)if(e.features&128)o=at(e,n,r,o);else{let t=st(e,r,n);if(t)return"("+A(r,o)+","+t+v(r)+")"}return A(r,o)}var it="Object.create(null)";function dt(e,r){return Nr(e,r.o,r.i),vr(e,r.i,r.p,it)}function ut(e,r){return Nr(e,r.o,r.i),A(r.i,br(e,r.i,r.p))}function lt(e,r){let n="new Set",o=r.l,t=r.i;if(o){let a="",s,f=!1,i=r.a;e.stack.push(t);for(let d=0;d<o;d++)s=i[d],ie(e,s)?rt(e,t,v(s.i)):(a+=(f?",":"")+N(e,s),f=!0);e.stack.pop(),a&&(n+="(["+a+"])")}return A(t,n)}function ft(e,r){let n="new Map",o=r.e.s,t=r.i;if(o){let a="",s,f,i,d,l,c=!1,u=r.e.k,b=r.e.v;e.stack.push(t);for(let g=0;g<o;g++)s=u[g],f=b[g],ie(e,s)?(i=v(t),ie(e,f)?(d=v(f.i),gr(e,t,i,d)):(l=e.stack,e.stack=[],gr(e,t,i,N(e,f)),e.stack=l)):ie(e,f)?(d=v(f.i),l=e.stack,e.stack=[],gr(e,t,N(e,s),d),e.stack=l):(a+=(c?",[":"[")+N(e,s)+","+N(e,f)+"]",c=!0);e.stack.pop(),a&&(n+="(["+a+"])")}return A(t,n)}function ct(e,r){let n=r.i;e.stack.push(n);let o='new AggregateError([],"'+r.m+'")';return e.stack.pop(),vr(e,n,r.p,o)}function mt(e,r){return vr(e,r.i,r.p,"new "+r.c+'("'+r.m+'")')}var St="Promise.resolve",pt="Promise.reject";function gt(e,r){let n,o=r.f,t=r.i,a=r.s?St:pt;if(ie(e,o)){let s=v(o.i);e.features&4?r.s?n=a+"().then(()=>"+s+")":n=a+"().catch(()=>{throw "+s+"})":r.s?n=a+"().then(function(){return "+s+"})":n=a+"().catch(function(){throw "+s+"})"}else{e.stack.push(t);let s=N(e,o);e.stack.pop(),n=a+"("+s+")"}return A(t,n)}function yt(e){let r="new Uint8Array(",n=e.s,o=n.length;if(o){r+="[";for(let t=0;t<o;t++)r+=(t>0?",":"")+n[t];r+="]"}return A(e.i,r+").buffer")}function Nt(e,r){return A(r.i,"new "+r.c+"("+N(e,r.f)+","+r.b+","+r.l+")")}function bt(e){return A(e.i,'new Date("'+e.s+'")')}function vt(e){return A(e.i,"/"+e.c+"/"+e.m)}function At(e){return A(e.i,'new URL("'+e.s+'")')}function wt(e){return A(e.i,e.s?'new URLSearchParams("'+e.s+'")':"new URLSearchParams")}function Ct(e){return A(e.i,oe+'.get("'+e.s+'")')}function Et(e,r){return A(r.i,"new DataView("+N(e,r.f)+","+r.b+","+r.l+")")}function kt(e,r){return A(r.i,"new Blob(["+N(e,r.f)+'],{type:"'+r.c+'"})')}function Rt(e,r){return A(r.i,"new File(["+N(e,r.f)+'],"'+r.m+'",{type:"'+r.c+'",lastModified:'+r.b+"})")}function Pt(e,r){return A(r.i,"new Headers("+br(e,r.i,r.e)+")")}function zt(e,r){let n,o,t=r.e.k,a=r.e.v,s=r.i,f=[],i;e.stack.push(s);for(let d=0,l=r.e.s;d<l;d++)o=t[d],n=N(e,a[d]),i=e.assignments,e.assignments=f,nt(e,s,'"'+o+'"',n),e.assignments=i;return e.stack.pop(),ae(f)}function Ot(e,r){let n=r.e.s,o=r.i,t=A(o,"new FormData()");if(n){let a=zt(e,r);return"("+t+","+(a==null?"":a)+v(o)+")"}return t}function It(e,r){return A(r.i,"Object("+N(e,r.f)+")")}function Bt(e){return A(e.i,Re[e.s])}function ht(e,r){return X+"."+Ze+"("+v(r.i)+","+N(e,r.f)+")"}function Tt(e,r){return X+"."+Qe+"("+v(r.i)+","+N(e,r.f)+")"}function Dt(e){return A(e.i,X+"."+qe+"()")}function jt(e){return X+"."+ve+"("+v(e.i)+",2)"}function Ft(e,r){return X+"."+ve+"("+v(r.i)+",0,"+N(e,r.f)+")"}function Lt(e,r){return X+"."+ve+"("+v(r.i)+",1,"+N(e,r.f)+")"}function Ut(e){return A(e.i,X+"."+er+"()")}function N(e,r){switch(r.t){case 0:return""+r.s;case 1:return'"'+r.s+'"';case 2:return Pe(r);case 3:return r.s+"n";case 4:return v(r.i);case 9:return ot(e,r);case 10:return ut(e,r);case 11:return dt(e,r);case 5:return bt(r);case 6:return vt(r);case 7:return lt(e,r);case 8:return ft(e,r);case 21:return yt(r);case 16:case 15:return Nt(e,r);case 22:return Et(e,r);case 14:return ct(e,r);case 13:return mt(e,r);case 12:return gt(e,r);case 17:return Bt(r);case 18:return At(r);case 19:return wt(r);case 20:return Ct(r);case 23:return kt(e,r);case 24:return Rt(e,r);case 25:return Pt(e,r);case 26:return Ot(e,r);case 27:return It(e,r);case 29:return ht(e,r);case 30:return Tt(e,r);case 28:return Dt(r);case 33:return jt(r);case 31:return Ut(r);case 32:return Ft(e,r);case 34:return Lt(e,r);default:throw new Error("invariant")}}function Vt(e,r){let n=r.length,o=new Array(n),t=new Array(n),a;for(let s=0;s<n;s++)s in r&&(a=r[s],y(a)?t[s]=a:o[s]=R(e,a));for(let s=0;s<n;s++)s in t&&(o[s]=R(e,t[s]));return o}function Nn(e,r,n){return{t:9,i:r,s:void 0,l:n.length,c:void 0,m:void 0,p:void 0,e:void 0,a:Vt(e,n),f:void 0,b:void 0,o:U(n)}}function _t(e,r,n){S(e.features&32,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0;for(let[l,c]of n.entries())y(l)||y(c)?(s[i]=l,f[i]=c,i++):(t[d]=R(e,l),a[d]=R(e,c),d++);for(let l=0;l<i;l++)t[d+l]=R(e,s[l]),a[d+l]=R(e,f[l]);return{t:8,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:a,s:o},a:void 0,f:void 0,b:void 0,o:void 0}}function xt(e,r,n){S(e.features&512,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=0,f=0;for(let i of n.keys())y(i)?a[s++]=i:t[f++]=R(e,i);for(let i=0;i<s;i++)t[f+i]=R(e,a[i]);return{t:7,i:r,s:void 0,l:o,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}function wr(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=R(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=R(e,f[u]);if(e.features&1024&&Symbol.iterator in r){t[o]=0;let u=Array.from(r);a[o]=Nn(e,ce(e,u),u),o++}return{k:t,v:a,s:o}}function bn(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=R(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=R(e,f[u]);return{k:t,v:a,s:o}}function gn(e,r,n){return S(e.features&256,new m(n)),n.then(o=>{e.alive&&(e.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:R(e,o),b:void 0,o:void 0},!1),Ce(e))},o=>{e.alive&&(e.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:R(e,o),b:void 0,o:void 0},!1),Ce(e))}),mr(e),{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}}function Ar(e,r,n,o){return{t:o?11:10,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:wr(e,n),e:void 0,a:void 0,f:void 0,b:void 0,o:U(n)}}function yn(e,r,n){let o=L(e,n),t=o?wr(e,o):void 0;return{t:14,i:r,s:void 0,l:void 0,c:void 0,m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Ke(e,r,n){let o=L(e,n),t=o?wr(e,o):void 0;return{t:13,i:r,s:void 0,l:void 0,c:M(n),m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Mt(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:25,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:bn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}function Kt(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:26,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:bn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}function Ht(e,r,n){return{t:27,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:R(e,n.valueOf()),b:void 0,o:void 0}}function Wt(e,r,n){S(e.features&8192,new m(n));let o=n.getReader();mr(e);function t(){o.read().then(a=>{e.alive&&(a.done?(e.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),Ce(e)):(e.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:R(e,a.value),b:void 0,o:void 0},!1),t()))},a=>{e.alive&&(e.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:R(e,a),b:void 0,o:void 0},!1),Ce(e))})}return t(),{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}}function Gt(e,r){if(!r)return $;let n=e.refs.get(r);if(n!=null)return z(n);let o=e.refs.size;if(e.refs.set(r,o),I(r))return T(o,r);if(Array.isArray(r))return Nn(e,o,r);switch(r.constructor){case Number:case Boolean:case String:case BigInt:case Function:case Symbol:return Ht(e,o,r);case Date:return Z(o,r);case RegExp:return Q(o,r);case Promise:return gn(e,o,r);case ArrayBuffer:return V(o,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return Se(e,o,r);case BigInt64Array:case BigUint64Array:return pe(e,o,r);case DataView:return ge(e,o,r);case Map:return _t(e,o,r);case Set:return xt(e,o,r);case Object:return Ar(e,o,r,!1);case void 0:return Ar(e,o,r,!0);case AggregateError:return e.features&1?yn(e,o,r):Ke(e,o,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Ke(e,o,r);case URL:return ee(e,o,r);case URLSearchParams:return re(e,o,r);case Headers:return Mt(e,o,r);case FormData:return Kt(e,o,r);case ReadableStream:return Wt(e,o,r);default:break}if(r instanceof AggregateError)return e.features&1?yn(e,o,r):Ke(e,o,r);if(r instanceof Error)return Ke(e,o,r);if(r instanceof Promise)return gn(e,o,r);if(Symbol.iterator in r)return Ar(e,o,r,!!r.constructor);throw new m(r)}function R(e,r){switch(typeof r){case"boolean":return r?H:W;case"undefined":return G;case"string":return J(r);case"number":return Y(r);case"bigint":return q(e,r);case"object":return Gt(e,r);case"symbol":return ye(e,r);case"function":return Ne(e,r);default:throw new m(r)}}function $t(e,r){let n=r.length,o=new Array(n),t=new Array(n),a;for(let s=0;s<n;s++)s in r&&(a=r[s],y(a)?t[s]=a:o[s]=j(e,a));for(let s=0;s<n;s++)s in t&&(o[s]=j(e,t[s]));return o}function An(e,r,n){return{t:9,i:r,s:void 0,l:n.length,c:void 0,m:void 0,p:void 0,e:void 0,a:$t(e,n),f:void 0,b:void 0,o:U(n)}}function Xt(e,r,n){S(e.features&32,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0;for(let[l,c]of n.entries())y(l)||y(c)?(s[i]=l,f[i]=c,i++):(t[d]=j(e,l),a[d]=j(e,c),d++);for(let l=0;l<i;l++)t[d+l]=j(e,s[l]),a[d+l]=j(e,f[l]);return{t:8,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:{k:t,v:a,s:o},a:void 0,f:void 0,b:void 0,o:void 0}}function Yt(e,r,n){S(e.features&512,new m(n));let o=n.size,t=new Array(o),a=new Array(o),s=0,f=0;for(let i of n.keys())y(i)?a[s++]=i:t[f++]=j(e,i);for(let i=0;i<s;i++)t[f+i]=j(e,a[i]);return{t:7,i:r,s:void 0,l:o,c:void 0,m:void 0,p:void 0,e:void 0,a:t,f:void 0,b:void 0,o:void 0}}function Er(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=j(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=j(e,f[u]);if(e.features&1024&&Symbol.iterator in r){t[o]=0;let u=Array.from(r);a[o]=An(e,ce(e,u),u),o++}return{k:t,v:a,s:o}}function wn(e,r){let n=Object.keys(r),o=n.length,t=new Array(o),a=new Array(o),s=new Array(o),f=new Array(o),i=0,d=0,l,c;for(let u of n)l=r[u],c=p(u),y(l)?(s[i]=c,f[i]=l,i++):(t[d]=c,a[d]=j(e,l),d++);for(let u=0;u<i;u++)t[d+u]=s[u],a[d+u]=j(e,f[u]);return{k:t,v:a,s:o}}function Cr(e,r,n,o){return{t:o?11:10,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:Er(e,n),e:void 0,a:void 0,f:void 0,b:void 0,o:U(n)}}function vn(e,r,n){let o=L(e,n),t=o?Er(e,o):void 0;return{t:14,i:r,s:void 0,l:void 0,c:void 0,m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function He(e,r,n){let o=L(e,n),t=o?Er(e,o):void 0;return{t:13,i:r,s:void 0,l:void 0,c:M(n),m:p(n.message),p:t,e:void 0,a:void 0,f:void 0,b:void 0,o:void 0}}function Jt(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:25,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:wn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}function qt(e,r,n){S(e.features&8192,new m(n));let o={};return n.forEach((t,a)=>{o[a]=t}),{t:26,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:wn(e,o),a:void 0,f:void 0,b:void 0,o:void 0}}function Zt(e,r,n){return{t:27,i:r,s:void 0,l:void 0,c:void 0,m:void 0,p:void 0,e:void 0,a:void 0,f:j(e,n.valueOf()),b:void 0,o:void 0}}function Qt(e,r){if(!r)return $;let n=e.refs.get(r);if(n!=null)return z(n);let o=e.refs.size;if(e.refs.set(r,o),I(r))return T(o,r);if(Array.isArray(r))return An(e,o,r);switch(r.constructor){case Number:case Boolean:case String:case BigInt:case Function:case Symbol:return Zt(e,o,r);case Date:return Z(o,r);case RegExp:return Q(o,r);case ArrayBuffer:return V(o,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return Se(e,o,r);case BigInt64Array:case BigUint64Array:return pe(e,o,r);case DataView:return ge(e,o,r);case Map:return Xt(e,o,r);case Set:return Yt(e,o,r);case Object:return Cr(e,o,r,!1);case void 0:return Cr(e,o,r,!0);case AggregateError:return e.features&1?vn(e,o,r):He(e,o,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return He(e,o,r);case URL:return ee(e,o,r);case URLSearchParams:return re(e,o,r);case Headers:return Jt(e,o,r);case FormData:return qt(e,o,r);default:break}if(r instanceof AggregateError)return e.features&1?vn(e,o,r):He(e,o,r);if(r instanceof Error)return He(e,o,r);if(Symbol.iterator in r)return Cr(e,o,r,!!r.constructor);throw new m(r)}function j(e,r){switch(typeof r){case"boolean":return r?H:W;case"undefined":return G;case"string":return J(r);case"number":return Y(r);case"bigint":return q(e,r);case"object":return Qt(e,r);case"symbol":return ye(e,r);case"function":return Ne(e,r);default:throw new m(r)}}function kr(e,r,n,o){if(n==null)return o;let t=mn(e),a=v(n),s=r==null?"":ne,f=t?o+","+t:o;if(s==="")return t?"("+f+a+")":f;let i=r==null?"()":"("+ne+'["'+p(r)+'"])',d=f+(t?a:"");return e.features&4?"("+s+"=>("+d+"))"+i:"(function("+s+"){return "+d+"})"+i}function kd(e,r){let n=cr(r),o=j(n,e),t=xe({features:n.features}),a=N(t,o);return kr(t,n.scopeId,o.i,a)}async function Rd(e,r){let n=cr(r),o=await h(n,e),t=xe({features:n.features}),a=N(t,o);return kr(t,n.scopeId,o.i,a)}function Cn(e,r){let n=tn({scopeId:r.scopeId,refs:r.refs,disabledFeatures:r.disabledFeatures,onParse(o,t){let a=xe({features:n.features});r.onSerialize(kr(a,n.scopeId,o.i,N(a,o)),t)},onDone:r.onDone});return n.onParse(R(n,e),!0),n.pending<=0&&(n.onDone(),n.alive=!1),()=>{n.alive&&(n.alive=!1,n.onDone())}}var We=class{constructor(r){this.options=r;ke(this,"alive",!0);ke(this,"cleanups",[]);ke(this,"refs",new Map)}write(r,n){this.alive&&this.cleanups.push(Cn(n,{scopeId:this.options.scopeId,refs:this.refs,disabledFeatures:this.options.disabledFeatures,onSerialize:(o,t)=>{this.options.onData(t?this.options.globalIdentifier+'["'+p(r)+'"]='+o:o)}}))}close(){if(this.alive){for(let r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();this.alive=!1}}};var Td=on;export{P as Feature,zn as GLOBAL_CONTEXT_API_SCRIPT,We as Serializer,ri as compileJSON,In as createReference,kd as crossSerialize,Rd as crossSerializeAsync,Cn as crossSerializeStream,Td as default,Zs as deserialize,ni as fromJSON,On as getCrossReferenceHeader,on as serialize,qs as serializeAsync,Qs as toJSON,ei as toJSONAsync};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SerializerOptions {
|
|
2
|
+
globalIdentifier: string;
|
|
3
|
+
scopeId?: string;
|
|
4
|
+
disabledFeatures?: number;
|
|
5
|
+
onData: (result: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export default class Serializer {
|
|
8
|
+
private options;
|
|
9
|
+
private alive;
|
|
10
|
+
private cleanups;
|
|
11
|
+
private refs;
|
|
12
|
+
constructor(options: SerializerOptions);
|
|
13
|
+
write(key: string, value: unknown): void;
|
|
14
|
+
close(): void;
|
|
15
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export default class UnsupportedTypeError extends Error {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default class UnsupportedTypeError extends Error {
|
|
2
|
+
value: unknown;
|
|
3
|
+
constructor(value: unknown);
|
|
4
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function assert(cond: unknown, error: Error): asserts cond;
|
|
1
|
+
export default function assert(cond: unknown, error: Error): asserts cond;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SerovalObjectFlags } from './constants';
|
|
2
|
+
interface IndexAssignment {
|
|
3
|
+
t: 'index';
|
|
4
|
+
s: string;
|
|
5
|
+
k: undefined;
|
|
6
|
+
v: string;
|
|
7
|
+
}
|
|
8
|
+
interface SetAssignment {
|
|
9
|
+
t: 'set';
|
|
10
|
+
s: string;
|
|
11
|
+
k: string;
|
|
12
|
+
v: string;
|
|
13
|
+
}
|
|
14
|
+
interface AddAssignment {
|
|
15
|
+
t: 'add';
|
|
16
|
+
s: string;
|
|
17
|
+
k: undefined;
|
|
18
|
+
v: string;
|
|
19
|
+
}
|
|
20
|
+
interface AppendAssignment {
|
|
21
|
+
t: 'append';
|
|
22
|
+
s: string;
|
|
23
|
+
k: string;
|
|
24
|
+
v: string;
|
|
25
|
+
}
|
|
26
|
+
export type Assignment = IndexAssignment | AddAssignment | SetAssignment | AppendAssignment;
|
|
27
|
+
export interface FlaggedObject {
|
|
28
|
+
type: SerovalObjectFlags;
|
|
29
|
+
value: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function resolveAssignments(assignments: Assignment[]): string | undefined;
|
|
32
|
+
export declare function resolveFlags(flags: FlaggedObject[]): string | undefined;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WellKnownSymbols } from './constants';
|
|
2
|
+
import type { BaseParserContext } from './context';
|
|
3
|
+
import type { SerovalArrayBufferNode, SerovalBigIntNode, SerovalConstantNode, SerovalDateNode, SerovalIndexedValueNode, SerovalNumberNode, SerovalReferenceNode, SerovalRegExpNode, SerovalStringNode, SerovalWKSymbolNode } from './types';
|
|
4
|
+
export declare function createNumberNode(value: number): SerovalConstantNode | SerovalNumberNode;
|
|
5
|
+
export declare function createStringNode(value: string): SerovalStringNode;
|
|
6
|
+
export declare function createBigIntNode(ctx: BaseParserContext, current: bigint): SerovalBigIntNode;
|
|
7
|
+
export declare function createIndexedValueNode(id: number): SerovalIndexedValueNode;
|
|
8
|
+
export declare function createDateNode(id: number, current: Date): SerovalDateNode;
|
|
9
|
+
export declare function createRegExpNode(id: number, current: RegExp): SerovalRegExpNode;
|
|
10
|
+
export declare function createArrayBufferNode(id: number, current: ArrayBuffer): SerovalArrayBufferNode;
|
|
11
|
+
export declare function createWKSymbolNode(ctx: BaseParserContext, id: number, current: WellKnownSymbols): SerovalWKSymbolNode;
|
|
12
|
+
export declare function createReferenceNode<T>(id: number, ref: T): SerovalReferenceNode;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* References
|
|
3
|
-
* - https://kangax.github.io/compat-table/es6/
|
|
4
|
-
* - MDN
|
|
5
|
-
*/
|
|
6
|
-
export declare const enum Feature {
|
|
7
|
-
AggregateError = 1,
|
|
8
|
-
ArrayPrototypeValues = 2,
|
|
9
|
-
ArrowFunction = 4,
|
|
10
|
-
BigInt = 8,
|
|
11
|
-
ErrorPrototypeStack = 16,
|
|
12
|
-
Map = 32,
|
|
13
|
-
MethodShorthand = 64,
|
|
14
|
-
ObjectAssign = 128,
|
|
15
|
-
Promise = 256,
|
|
16
|
-
Set = 512,
|
|
17
|
-
Symbol = 1024,
|
|
18
|
-
TypedArray = 2048,
|
|
19
|
-
BigIntTypedArray = 4096,
|
|
20
|
-
WebAPI = 8192
|
|
21
|
-
}
|
|
22
|
-
export declare const ALL_ENABLED = 16383;
|
|
1
|
+
/**
|
|
2
|
+
* References
|
|
3
|
+
* - https://kangax.github.io/compat-table/es6/
|
|
4
|
+
* - MDN
|
|
5
|
+
*/
|
|
6
|
+
export declare const enum Feature {
|
|
7
|
+
AggregateError = 1,
|
|
8
|
+
ArrayPrototypeValues = 2,
|
|
9
|
+
ArrowFunction = 4,
|
|
10
|
+
BigInt = 8,
|
|
11
|
+
ErrorPrototypeStack = 16,
|
|
12
|
+
Map = 32,
|
|
13
|
+
MethodShorthand = 64,
|
|
14
|
+
ObjectAssign = 128,
|
|
15
|
+
Promise = 256,
|
|
16
|
+
Set = 512,
|
|
17
|
+
Symbol = 1024,
|
|
18
|
+
TypedArray = 2048,
|
|
19
|
+
BigIntTypedArray = 4096,
|
|
20
|
+
WebAPI = 8192
|
|
21
|
+
}
|
|
22
|
+
export declare const ALL_ENABLED = 16383;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { SerovalConstantNode } from './types';
|
|
2
|
+
export declare const enum SerovalConstant {
|
|
3
|
+
Null = 0,
|
|
4
|
+
Undefined = 1,
|
|
5
|
+
True = 2,
|
|
6
|
+
False = 3,
|
|
7
|
+
NegativeZero = 4,
|
|
8
|
+
Infinity = 5,
|
|
9
|
+
NegativeInfinity = 6,
|
|
10
|
+
NaN = 7
|
|
11
|
+
}
|
|
12
|
+
export declare const enum SerovalNodeType {
|
|
13
|
+
Number = 0,
|
|
14
|
+
String = 1,
|
|
15
|
+
Constant = 2,
|
|
16
|
+
BigInt = 3,
|
|
17
|
+
IndexedValue = 4,
|
|
18
|
+
Date = 5,
|
|
19
|
+
RegExp = 6,
|
|
20
|
+
Set = 7,
|
|
21
|
+
Map = 8,
|
|
22
|
+
Array = 9,
|
|
23
|
+
Object = 10,
|
|
24
|
+
NullConstructor = 11,
|
|
25
|
+
Promise = 12,
|
|
26
|
+
Error = 13,
|
|
27
|
+
AggregateError = 14,
|
|
28
|
+
TypedArray = 15,
|
|
29
|
+
BigIntTypedArray = 16,
|
|
30
|
+
WKSymbol = 17,
|
|
31
|
+
URL = 18,
|
|
32
|
+
URLSearchParams = 19,
|
|
33
|
+
Reference = 20,
|
|
34
|
+
ArrayBuffer = 21,
|
|
35
|
+
DataView = 22,
|
|
36
|
+
Blob = 23,
|
|
37
|
+
File = 24,
|
|
38
|
+
Headers = 25,
|
|
39
|
+
FormData = 26,
|
|
40
|
+
Boxed = 27,
|
|
41
|
+
PromiseConstructor = 28,
|
|
42
|
+
PromiseResolve = 29,
|
|
43
|
+
PromiseReject = 30,
|
|
44
|
+
ReadableStreamConstructor = 31,
|
|
45
|
+
ReadableStreamEnqueue = 32,
|
|
46
|
+
ReadableStreamClose = 33,
|
|
47
|
+
ReadableStreamError = 34
|
|
48
|
+
}
|
|
49
|
+
export declare const enum SerovalObjectFlags {
|
|
50
|
+
None = 0,
|
|
51
|
+
NonExtensible = 1,
|
|
52
|
+
Sealed = 2,
|
|
53
|
+
Frozen = 3
|
|
54
|
+
}
|
|
55
|
+
export declare const enum Symbols {
|
|
56
|
+
AsyncIterator = 0,
|
|
57
|
+
HasInstance = 1,
|
|
58
|
+
IsConcatSpreadable = 2,
|
|
59
|
+
Iterator = 3,
|
|
60
|
+
Match = 4,
|
|
61
|
+
MatchAll = 5,
|
|
62
|
+
Replace = 6,
|
|
63
|
+
Search = 7,
|
|
64
|
+
Species = 8,
|
|
65
|
+
Split = 9,
|
|
66
|
+
ToPrimitive = 10,
|
|
67
|
+
ToStringTag = 11,
|
|
68
|
+
Unscopables = 12
|
|
69
|
+
}
|
|
70
|
+
export declare const SYMBOL_STRING: Record<Symbols, string>;
|
|
71
|
+
export declare const INV_SYMBOL_REF: {
|
|
72
|
+
[Symbol.asyncIterator]: Symbols;
|
|
73
|
+
[Symbol.hasInstance]: Symbols;
|
|
74
|
+
[Symbol.isConcatSpreadable]: Symbols;
|
|
75
|
+
[Symbol.iterator]: Symbols;
|
|
76
|
+
[Symbol.match]: Symbols;
|
|
77
|
+
[Symbol.matchAll]: Symbols;
|
|
78
|
+
[Symbol.replace]: Symbols;
|
|
79
|
+
[Symbol.search]: Symbols;
|
|
80
|
+
[Symbol.species]: Symbols;
|
|
81
|
+
[Symbol.split]: Symbols;
|
|
82
|
+
[Symbol.toPrimitive]: Symbols;
|
|
83
|
+
[Symbol.toStringTag]: Symbols;
|
|
84
|
+
[Symbol.unscopables]: Symbols;
|
|
85
|
+
};
|
|
86
|
+
export type WellKnownSymbols = keyof typeof INV_SYMBOL_REF;
|
|
87
|
+
export declare const SYMBOL_REF: Record<Symbols, WellKnownSymbols>;
|
|
88
|
+
export declare function serializeConstant(node: SerovalConstantNode): string;
|
|
89
|
+
export declare function deserializeConstant(node: SerovalConstantNode): unknown;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Assignment, FlaggedObject } from './assignments';
|
|
2
|
+
export interface BaseParserContext {
|
|
3
|
+
features: number;
|
|
4
|
+
}
|
|
5
|
+
export interface BaseSerializerContext extends BaseParserContext {
|
|
6
|
+
stack: number[];
|
|
7
|
+
flags: FlaggedObject[];
|
|
8
|
+
assignments: Assignment[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Assignment, FlaggedObject } from '../assignments';
|
|
2
|
+
import type { BaseParserContext } from '../context';
|
|
3
|
+
import type { SerovalNode } from '../types';
|
|
4
|
+
export interface CrossParserContextOptions {
|
|
5
|
+
scopeId?: string;
|
|
6
|
+
refs?: Map<unknown, number>;
|
|
7
|
+
disabledFeatures?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CrossParserContext {
|
|
10
|
+
scopeId?: string;
|
|
11
|
+
refs: Map<unknown, number>;
|
|
12
|
+
features: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function createCrossParserContext(options?: CrossParserContextOptions): CrossParserContext;
|
|
15
|
+
export declare function createCrossIndexedValue<T>(ctx: CrossParserContext, current: T): number;
|
|
16
|
+
export interface StreamingCrossParserContextOptions extends CrossParserContextOptions {
|
|
17
|
+
onParse: (node: SerovalNode, initial: boolean) => void;
|
|
18
|
+
onDone?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface StreamingCrossParserContext extends CrossParserContext {
|
|
21
|
+
alive: boolean;
|
|
22
|
+
pending: number;
|
|
23
|
+
onParse(node: SerovalNode, initial: boolean): void;
|
|
24
|
+
onDone(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function createStreamingCrossParserContext(options: StreamingCrossParserContextOptions): StreamingCrossParserContext;
|
|
27
|
+
export declare function pushPendingState(ctx: StreamingCrossParserContext): void;
|
|
28
|
+
export declare function popPendingState(ctx: StreamingCrossParserContext): void;
|
|
29
|
+
export interface CrossSerializerContext extends BaseParserContext {
|
|
30
|
+
stack: number[];
|
|
31
|
+
assignments: Assignment[];
|
|
32
|
+
flags: FlaggedObject[];
|
|
33
|
+
}
|
|
34
|
+
export interface CrossSerializerOptions {
|
|
35
|
+
features: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function createCrossSerializerContext(options: CrossSerializerOptions): CrossSerializerContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CrossParserContextOptions } from './context';
|
|
2
|
+
export declare function crossSerialize<T>(source: T, options?: CrossParserContextOptions): string;
|
|
3
|
+
export declare function crossSerializeAsync<T>(source: T, options?: CrossParserContextOptions): Promise<string>;
|
|
4
|
+
export interface CrossSerializeStreamOptions extends CrossParserContextOptions {
|
|
5
|
+
onSerialize: (data: string, initial: boolean) => void;
|
|
6
|
+
onDone?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function crossSerializeStream<T>(source: T, options: CrossSerializeStreamOptions): () => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CrossParserContext } from './context';
|
|
2
|
+
import type { BigIntTypedArrayValue, TypedArrayValue } from '../../types';
|
|
3
|
+
import type { SerovalBigIntTypedArrayNode, SerovalTypedArrayNode, SerovalDataViewNode, SerovalNode, SerovalIndexedValueNode, SerovalReferenceNode, SerovalWKSymbolNode } from '../types';
|
|
4
|
+
export declare function serializeArrayBuffer(ctx: CrossParserContext, current: ArrayBuffer): SerovalNode;
|
|
5
|
+
export declare function createTypedArrayNode(ctx: CrossParserContext, id: number, current: TypedArrayValue): SerovalTypedArrayNode;
|
|
6
|
+
export declare function createBigIntTypedArrayNode(ctx: CrossParserContext, id: number, current: BigIntTypedArrayValue): SerovalBigIntTypedArrayNode;
|
|
7
|
+
export declare function createDataViewNode(ctx: CrossParserContext, id: number, current: DataView): SerovalDataViewNode;
|
|
8
|
+
export declare function createSymbolNode(ctx: CrossParserContext, current: symbol): SerovalIndexedValueNode | SerovalReferenceNode | SerovalWKSymbolNode;
|
|
9
|
+
export declare function createFunctionNode(ctx: CrossParserContext, current: Function): SerovalIndexedValueNode | SerovalReferenceNode;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CrossSerializerContext } from './context';
|
|
2
|
+
import type { SerovalNode } from '../types';
|
|
3
|
+
export declare function getRefExpr(id: number): string;
|
|
4
|
+
export declare function resolvePatches(ctx: CrossSerializerContext): string | undefined;
|
|
5
|
+
export default function crossSerializeTree(ctx: CrossSerializerContext, node: SerovalNode): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CrossParserContext } from './context';
|
|
2
|
+
import type { SerovalBlobNode, SerovalFileNode } from '../types';
|
|
3
|
+
export declare function createBlobNode(ctx: CrossParserContext, id: number, current: Blob): Promise<SerovalBlobNode>;
|
|
4
|
+
export declare function createFileNode(ctx: CrossParserContext, id: number, current: File): Promise<SerovalFileNode>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function getIdentifier(index: number): string;
|
|
1
|
+
export default function getIdentifier(index: number): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const REFERENCES_KEY = "__SEROVAL_REFS__";
|
|
2
|
+
export declare const GLOBAL_CONTEXT_API = "_$";
|
|
3
|
+
export declare const GLOBAL_CONTEXT_REFERENCES = "$R";
|
|
4
|
+
export declare const LOCAL_CONTEXT_PROMISE_RESOLVE = "s";
|
|
5
|
+
export declare const LOCAL_CONTEXT_PROMISE_REJECT = "f";
|
|
6
|
+
export declare const GLOBAL_CONTEXT_PROMISE_CONSTRUCTOR = "P";
|
|
7
|
+
export declare const GLOBAL_CONTEXT_PROMISE_RESOLVE = "Ps";
|
|
8
|
+
export declare const GLOBAL_CONTEXT_PROMISE_REJECT = "Pf";
|
|
9
|
+
export declare const LOCAL_CONTEXT_STREAM_CONTROLLER = "c";
|
|
10
|
+
export declare const GLOBAL_CONTEXT_STREAM_CONSTRUCTOR = "S";
|
|
11
|
+
export declare const GLOBAL_CONTEXT_STREAM_EMIT = "Se";
|
|
12
|
+
export declare const GLOBAL_CONTEXT_API_SCRIPT: string;
|
|
13
|
+
export declare function getCrossReferenceHeader(id?: string): string;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { SerovalConstantNode } from './types';
|
|
2
|
-
export declare const TRUE_NODE: SerovalConstantNode;
|
|
3
|
-
export declare const FALSE_NODE: SerovalConstantNode;
|
|
4
|
-
export declare const UNDEFINED_NODE: SerovalConstantNode;
|
|
5
|
-
export declare const NULL_NODE: SerovalConstantNode;
|
|
6
|
-
export declare const NEG_ZERO_NODE: SerovalConstantNode;
|
|
7
|
-
export declare const INFINITY_NODE: SerovalConstantNode;
|
|
8
|
-
export declare const NEG_INFINITY_NODE: SerovalConstantNode;
|
|
9
|
-
export declare const NAN_NODE: SerovalConstantNode;
|
|
10
|
-
export declare function serializeConstant(node: SerovalConstantNode): string;
|
|
11
|
-
export declare function deserializeConstant(node: SerovalConstantNode): unknown;
|
|
1
|
+
import type { SerovalConstantNode } from './types';
|
|
2
|
+
export declare const TRUE_NODE: SerovalConstantNode;
|
|
3
|
+
export declare const FALSE_NODE: SerovalConstantNode;
|
|
4
|
+
export declare const UNDEFINED_NODE: SerovalConstantNode;
|
|
5
|
+
export declare const NULL_NODE: SerovalConstantNode;
|
|
6
|
+
export declare const NEG_ZERO_NODE: SerovalConstantNode;
|
|
7
|
+
export declare const INFINITY_NODE: SerovalConstantNode;
|
|
8
|
+
export declare const NEG_INFINITY_NODE: SerovalConstantNode;
|
|
9
|
+
export declare const NAN_NODE: SerovalConstantNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function promiseToResult(current: Promise<unknown>): Promise<[0 | 1, unknown]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export declare function createReference<T>(id: string, value: T): T;
|
|
2
|
-
export declare function hasReferenceID<T>(value: T): boolean;
|
|
3
|
-
export declare function hasReference(id: string): boolean;
|
|
4
|
-
export declare function getReferenceID<T>(value: T): string;
|
|
5
|
-
export declare function getReference<T>(id: string): T;
|
|
6
|
-
export declare const GLOBAL_KEY = "__SEROVAL__";
|
|
1
|
+
export declare function createReference<T>(id: string, value: T): T;
|
|
2
|
+
export declare function hasReferenceID<T>(value: T): boolean;
|
|
3
|
+
export declare function hasReference(id: string): boolean;
|
|
4
|
+
export declare function getReferenceID<T>(value: T): string;
|
|
5
|
+
export declare function getReference<T>(id: string): T;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
export declare function getErrorConstructorName(error: ErrorValue): string;
|
|
5
|
-
type ErrorConstructors = ErrorConstructor | EvalErrorConstructor | RangeErrorConstructor | ReferenceErrorConstructor | SyntaxErrorConstructor | TypeErrorConstructor | URIErrorConstructor;
|
|
6
|
-
export declare function getErrorConstructor(errorName: string): ErrorConstructors;
|
|
7
|
-
export declare function getErrorOptions(ctx:
|
|
8
|
-
export declare function isIterable(value: unknown): value is Iterable<unknown>;
|
|
9
|
-
type TypedArrayConstructor = Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Uint8ClampedArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor | BigUint64ArrayConstructor;
|
|
10
|
-
export declare function getTypedArrayConstructor(name: string): TypedArrayConstructor;
|
|
11
|
-
export declare function isValidIdentifier(name: string): boolean;
|
|
12
|
-
export declare function getObjectFlag(obj: unknown): SerovalObjectFlags;
|
|
13
|
-
export {};
|
|
1
|
+
import type { ErrorValue } from '../types';
|
|
2
|
+
import { SerovalObjectFlags } from './constants';
|
|
3
|
+
import type { BaseParserContext } from './context';
|
|
4
|
+
export declare function getErrorConstructorName(error: ErrorValue): string;
|
|
5
|
+
type ErrorConstructors = ErrorConstructor | EvalErrorConstructor | RangeErrorConstructor | ReferenceErrorConstructor | SyntaxErrorConstructor | TypeErrorConstructor | URIErrorConstructor;
|
|
6
|
+
export declare function getErrorConstructor(errorName: string): ErrorConstructors;
|
|
7
|
+
export declare function getErrorOptions(ctx: BaseParserContext, error: Error): Record<string, unknown> | undefined;
|
|
8
|
+
export declare function isIterable(value: unknown): value is Iterable<unknown>;
|
|
9
|
+
type TypedArrayConstructor = Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Uint8ClampedArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor | BigUint64ArrayConstructor;
|
|
10
|
+
export declare function getTypedArrayConstructor(name: string): TypedArrayConstructor;
|
|
11
|
+
export declare function isValidIdentifier(name: string): boolean;
|
|
12
|
+
export declare function getObjectFlag(obj: unknown): SerovalObjectFlags;
|
|
13
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function serializeChar(str: string): string | undefined;
|
|
2
|
-
export declare function serializeString(str: string): string;
|
|
3
|
-
export declare function deserializeString(str: string): string;
|
|
1
|
+
export declare function serializeChar(str: string): string | undefined;
|
|
2
|
+
export declare function serializeString(str: string): string;
|
|
3
|
+
export declare function deserializeString(str: string): string;
|