hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
12 lines • 3.44 MB
JavaScript
// @bun
var HS=Object.create;var{getPrototypeOf:LS,defineProperty:U$,getOwnPropertyNames:US}=Object;var MS=Object.prototype.hasOwnProperty;var a6=(J,Z,Y)=>{Y=J!=null?HS(LS(J)):{};let X=Z||!J||!J.__esModule?U$(Y,"default",{value:J,enumerable:!0}):Y;for(let K of US(J))if(!MS.call(X,K))U$(X,K,{get:()=>J[K],enumerable:!0});return X};var P=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var s6=(J,Z)=>{for(var Y in Z)U$(J,Y,{get:Z[Y],enumerable:!0,configurable:!0,set:(X)=>Z[Y]=()=>X})};var b=import.meta.require;var Rq=P((z$0,M$)=>{var RS=Object.prototype.hasOwnProperty,N8="~";function X4(){}if(Object.create){if(X4.prototype=Object.create(null),!new X4().__proto__)N8=!1}function wS(J,Z,Y){this.fn=J,this.context=Z,this.once=Y||!1}function Mq(J,Z,Y,X,K){if(typeof Y!=="function")throw new TypeError("The listener must be a function");var $=new wS(Y,X||J,K),Q=N8?N8+Z:Z;if(!J._events[Q])J._events[Q]=$,J._eventsCount++;else if(!J._events[Q].fn)J._events[Q].push($);else J._events[Q]=[J._events[Q],$];return J}function gJ(J,Z){if(--J._eventsCount===0)J._events=new X4;else delete J._events[Z]}function M8(){this._events=new X4,this._eventsCount=0}M8.prototype.eventNames=function J(){var Z=[],Y,X;if(this._eventsCount===0)return Z;for(X in Y=this._events)if(RS.call(Y,X))Z.push(N8?X.slice(1):X);if(Object.getOwnPropertySymbols)return Z.concat(Object.getOwnPropertySymbols(Y));return Z};M8.prototype.listeners=function J(Z){var Y=N8?N8+Z:Z,X=this._events[Y];if(!X)return[];if(X.fn)return[X.fn];for(var K=0,$=X.length,Q=new Array($);K<$;K++)Q[K]=X[K].fn;return Q};M8.prototype.listenerCount=function J(Z){var Y=N8?N8+Z:Z,X=this._events[Y];if(!X)return 0;if(X.fn)return 1;return X.length};M8.prototype.emit=function J(Z,Y,X,K,$,Q){var F=N8?N8+Z:Z;if(!this._events[F])return!1;var G=this._events[F],W=arguments.length,V,q;if(G.fn){if(G.once)this.removeListener(Z,G.fn,void 0,!0);switch(W){case 1:return G.fn.call(G.context),!0;case 2:return G.fn.call(G.context,Y),!0;case 3:return G.fn.call(G.context,Y,X),!0;case 4:return G.fn.call(G.context,Y,X,K),!0;case 5:return G.fn.call(G.context,Y,X,K,$),!0;case 6:return G.fn.call(G.context,Y,X,K,$,Q),!0}for(q=1,V=new Array(W-1);q<W;q++)V[q-1]=arguments[q];G.fn.apply(G.context,V)}else{var z=G.length,U;for(q=0;q<z;q++){if(G[q].once)this.removeListener(Z,G[q].fn,void 0,!0);switch(W){case 1:G[q].fn.call(G[q].context);break;case 2:G[q].fn.call(G[q].context,Y);break;case 3:G[q].fn.call(G[q].context,Y,X);break;case 4:G[q].fn.call(G[q].context,Y,X,K);break;default:if(!V)for(U=1,V=new Array(W-1);U<W;U++)V[U-1]=arguments[U];G[q].fn.apply(G[q].context,V)}}}return!0};M8.prototype.on=function J(Z,Y,X){return Mq(this,Z,Y,X,!1)};M8.prototype.once=function J(Z,Y,X){return Mq(this,Z,Y,X,!0)};M8.prototype.removeListener=function J(Z,Y,X,K){var $=N8?N8+Z:Z;if(!this._events[$])return this;if(!Y)return gJ(this,$),this;var Q=this._events[$];if(Q.fn){if(Q.fn===Y&&(!K||Q.once)&&(!X||Q.context===X))gJ(this,$)}else{for(var F=0,G=[],W=Q.length;F<W;F++)if(Q[F].fn!==Y||K&&!Q[F].once||X&&Q[F].context!==X)G.push(Q[F]);if(G.length)this._events[$]=G.length===1?G[0]:G;else gJ(this,$)}return this};M8.prototype.removeAllListeners=function J(Z){var Y;if(Z){if(Y=N8?N8+Z:Z,this._events[Y])gJ(this,Y)}else this._events=new X4,this._eventsCount=0;return this};M8.prototype.off=M8.prototype.removeListener;M8.prototype.addListener=M8.prototype.on;M8.prefixed=N8;M8.EventEmitter=M8;if(typeof M$!=="undefined")M$.exports=M8});var bz=P((HF0,hz)=>{hz.exports=fz;fz.sync=SI;var Sz=b("fs");function CI(J,Z){var Y=Z.pathExt!==void 0?Z.pathExt:process.env.PATHEXT;if(!Y)return!0;if(Y=Y.split(";"),Y.indexOf("")!==-1)return!0;for(var X=0;X<Y.length;X++){var K=Y[X].toLowerCase();if(K&&J.substr(-K.length).toLowerCase()===K)return!0}return!1}function Iz(J,Z,Y){if(!J.isSymbolicLink()&&!J.isFile())return!1;return CI(Z,Y)}function fz(J,Z,Y){Sz.stat(J,function(X,K){Y(X,X?!1:Iz(K,J,Z))})}function SI(J,Z){return Iz(Sz.statSync(J),J,Z)}});var cz=P((LF0,gz)=>{gz.exports=Az;Az.sync=II;var pz=b("fs");function Az(J,Z,Y){pz.stat(J,function(X,K){Y(X,X?!1:yz(K,Z))})}function II(J,Z){return yz(pz.statSync(J),Z)}function yz(J,Z){return J.isFile()&&fI(J,Z)}function fI(J,Z){var{mode:Y,uid:X,gid:K}=J,$=Z.uid!==void 0?Z.uid:process.getuid&&process.getuid(),Q=Z.gid!==void 0?Z.gid:process.getgid&&process.getgid(),F=parseInt("100",8),G=parseInt("010",8),W=parseInt("001",8),V=F|G,q=Y&W||Y&G&&K===Q||Y&F&&X===$||Y&V&&$===0;return q}});var lz=P((MF0,mz)=>{var UF0=b("fs"),bZ;if(process.platform==="win32"||global.TESTING_WINDOWS)bZ=bz();else bZ=cz();mz.exports=BQ;BQ.sync=hI;function BQ(J,Z,Y){if(typeof Z==="function")Y=Z,Z={};if(!Y){if(typeof Promise!=="function")throw new TypeError("callback not provided");return new Promise(function(X,K){BQ(J,Z||{},function($,Q){if($)K($);else X(Q)})})}bZ(J,Z||{},function(X,K){if(X){if(X.code==="EACCES"||Z&&Z.ignoreErrors)X=null,K=!1}Y(X,K)})}function hI(J,Z){try{return bZ.sync(J,Z||{})}catch(Y){if(Z&&Z.ignoreErrors||Y.code==="EACCES")return!1;else throw Y}}});var oz=P((RF0,sz)=>{var d9=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",uz=b("path"),bI=d9?";":":",dz=lz(),iz=(J)=>Object.assign(new Error(`not found: ${J}`),{code:"ENOENT"}),nz=(J,Z)=>{let Y=Z.colon||bI,X=J.match(/\//)||d9&&J.match(/\\/)?[""]:[...d9?[process.cwd()]:[],...(Z.path||process.env.PATH||"").split(Y)],K=d9?Z.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",$=d9?K.split(Y):[""];if(d9){if(J.indexOf(".")!==-1&&$[0]!=="")$.unshift("")}return{pathEnv:X,pathExt:$,pathExtExe:K}},az=(J,Z,Y)=>{if(typeof Z==="function")Y=Z,Z={};if(!Z)Z={};let{pathEnv:X,pathExt:K,pathExtExe:$}=nz(J,Z),Q=[],F=(W)=>new Promise((V,q)=>{if(W===X.length)return Z.all&&Q.length?V(Q):q(iz(J));let z=X[W],U=/^".*"$/.test(z)?z.slice(1,-1):z,M=uz.join(U,J),R=!U&&/^\.[\\\/]/.test(J)?J.slice(0,2)+M:M;V(G(R,W,0))}),G=(W,V,q)=>new Promise((z,U)=>{if(q===K.length)return z(F(V+1));let M=K[q];dz(W+M,{pathExt:$},(R,L)=>{if(!R&&L)if(Z.all)Q.push(W+M);else return z(W+M);return z(G(W,V,q+1))})});return Y?F(0).then((W)=>Y(null,W),Y):F(0)},pI=(J,Z)=>{Z=Z||{};let{pathEnv:Y,pathExt:X,pathExtExe:K}=nz(J,Z),$=[];for(let Q=0;Q<Y.length;Q++){let F=Y[Q],G=/^".*"$/.test(F)?F.slice(1,-1):F,W=uz.join(G,J),V=!G&&/^\.[\\\/]/.test(J)?J.slice(0,2)+W:W;for(let q=0;q<X.length;q++){let z=V+X[q];try{if(dz.sync(z,{pathExt:K}))if(Z.all)$.push(z);else return z}catch(U){}}}if(Z.all&&$.length)return $;if(Z.nothrow)return null;throw iz(J)};sz.exports=az;az.sync=pI});var tz=P((wF0,vQ)=>{var rz=(J={})=>{let Z=J.env||process.env;if((J.platform||process.platform)!=="win32")return"PATH";return Object.keys(Z).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"};vQ.exports=rz;vQ.exports.default=rz});var YH=P((OF0,ZH)=>{var ez=b("path"),AI=oz(),yI=tz();function JH(J,Z){let Y=J.options.env||process.env,X=process.cwd(),K=J.options.cwd!=null,$=K&&process.chdir!==void 0&&!process.chdir.disabled;if($)try{process.chdir(J.options.cwd)}catch(F){}let Q;try{Q=AI.sync(J.command,{path:Y[yI({env:Y})],pathExt:Z?ez.delimiter:void 0})}catch(F){}finally{if($)process.chdir(X)}if(Q)Q=ez.resolve(K?J.options.cwd:"",Q);return Q}function gI(J){return JH(J)||JH(J,!0)}ZH.exports=gI});var XH=P((lI,kQ)=>{var jQ=/([()\][%!^"`<>&|;, *?])/g;function cI(J){return J=J.replace(jQ,"^$1"),J}function mI(J,Z){if(J=`${J}`,J=J.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),J=J.replace(/(?=(\\+?)?)\1$/,"$1$1"),J=`"${J}"`,J=J.replace(jQ,"^$1"),Z)J=J.replace(jQ,"^$1");return J}lI.command=cI;lI.argument=mI});var $H=P((PF0,KH)=>{KH.exports=/^#!(.*)/});var FH=P((NF0,QH)=>{var iI=$H();QH.exports=(J="")=>{let Z=J.match(iI);if(!Z)return null;let[Y,X]=Z[0].replace(/#! ?/,"").split(" "),K=Y.split("/").pop();if(K==="env")return X;return X?`${K} ${X}`:K}});var WH=P((BF0,GH)=>{var xQ=b("fs"),nI=FH();function aI(J){let Y=Buffer.alloc(150),X;try{X=xQ.openSync(J,"r"),xQ.readSync(X,Y,0,150,0),xQ.closeSync(X)}catch(K){}return nI(Y.toString())}GH.exports=aI});var HH=P((vF0,zH)=>{var sI=b("path"),VH=YH(),qH=XH(),oI=WH(),rI=process.platform==="win32",tI=/\.(?:com|exe)$/i,eI=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Jf(J){J.file=VH(J);let Z=J.file&&oI(J.file);if(Z)return J.args.unshift(J.file),J.command=Z,VH(J);return J.file}function Zf(J){if(!rI)return J;let Z=Jf(J),Y=!tI.test(Z);if(J.options.forceShell||Y){let X=eI.test(Z);J.command=sI.normalize(J.command),J.command=qH.command(J.command),J.args=J.args.map(($)=>qH.argument($,X));let K=[J.command].concat(J.args).join(" ");J.args=["/d","/s","/c",`"${K}"`],J.command=process.env.comspec||"cmd.exe",J.options.windowsVerbatimArguments=!0}return J}function Yf(J,Z,Y){if(Z&&!Array.isArray(Z))Y=Z,Z=null;Z=Z?Z.slice(0):[],Y=Object.assign({},Y);let X={command:J,args:Z,options:Y,file:void 0,original:{command:J,args:Z}};return Y.shell?X:Zf(X)}zH.exports=Yf});var MH=P((jF0,UH)=>{var TQ=process.platform==="win32";function DQ(J,Z){return Object.assign(new Error(`${Z} ${J.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${Z} ${J.command}`,path:J.command,spawnargs:J.args})}function Xf(J,Z){if(!TQ)return;let Y=J.emit;J.emit=function(X,K){if(X==="exit"){let $=LH(K,Z);if($)return Y.call(J,"error",$)}return Y.apply(J,arguments)}}function LH(J,Z){if(TQ&&J===1&&!Z.file)return DQ(Z.original,"spawn");return null}function Kf(J,Z){if(TQ&&J===1&&!Z.file)return DQ(Z.original,"spawnSync");return null}UH.exports={hookChildProcess:Xf,verifyENOENT:LH,verifyENOENTSync:Kf,notFoundError:DQ}});var OH=P((kF0,i9)=>{var RH=b("child_process"),_Q=HH(),EQ=MH();function wH(J,Z,Y){let X=_Q(J,Z,Y),K=RH.spawn(X.command,X.args,X.options);return EQ.hookChildProcess(K,X),K}function $f(J,Z,Y){let X=_Q(J,Z,Y),K=RH.spawnSync(X.command,X.args,X.options);return K.error=K.error||EQ.verifyENOENTSync(K.status,X),K}i9.exports=wH;i9.exports.spawn=wH;i9.exports.sync=$f;i9.exports._parse=_Q;i9.exports._enoent=EQ});var IR=P((IU0,SR)=>{function bg(J){var Z=new Array(J);for(var Y=0;Y<J;++Y)Z[Y]=Y;return Z}SR.exports=bg});var bR=P((fU0,hR)=>{/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/hR.exports=function(J){return J!=null&&(fR(J)||pg(J)||!!J._isBuffer)};function fR(J){return!!J.constructor&&typeof J.constructor.isBuffer==="function"&&J.constructor.isBuffer(J)}function pg(J){return typeof J.readFloatLE==="function"&&typeof J.slice==="function"&&fR(J.slice(0,0))}});var AR=P((hU0,pR)=>{var Ag=IR(),yg=bR(),gg=typeof Float64Array!=="undefined";function cg(J,Z){return J[0]-Z[0]}function mg(){var J=this.stride,Z=new Array(J.length),Y;for(Y=0;Y<Z.length;++Y)Z[Y]=[Math.abs(J[Y]),Y];Z.sort(cg);var X=new Array(Z.length);for(Y=0;Y<X.length;++Y)X[Y]=Z[Y][1];return X}function lg(J,Z){var Y=["View",Z,"d",J].join("");if(Z<0)Y="View_Nil"+J;var X=J==="generic";if(Z===-1){var K="function "+Y+"(a){this.data=a;};var proto="+Y+".prototype;proto.dtype='"+J+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+Y+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+Y+"(a){return new "+Y+"(a);}",R=new Function(K);return R()}else if(Z===0){var K="function "+Y+"(a,d) {this.data = a;this.offset = d};var proto="+Y+".prototype;proto.dtype='"+J+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+Y+"_copy() {return new "+Y+"(this.data,this.offset)};proto.pick=function "+Y+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+Y+"_get(){return "+(X?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+Y+"_set(v){return "+(X?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+Y+"(a,b,c,d){return new "+Y+"(a,d)}",R=new Function("TrivialArray",K);return R(rY[J][0])}var K=["'use strict'"],$=Ag(Z),Q=$.map(function(L){return"i"+L}),F="this.offset+"+$.map(function(L){return"this.stride["+L+"]*i"+L}).join("+"),G=$.map(function(L){return"b"+L}).join(","),W=$.map(function(L){return"c"+L}).join(",");if(K.push("function "+Y+"(a,"+G+","+W+",d){this.data=a","this.shape=["+G+"]","this.stride=["+W+"]","this.offset=d|0}","var proto="+Y+".prototype","proto.dtype='"+J+"'","proto.dimension="+Z),K.push("Object.defineProperty(proto,'size',{get:function "+Y+"_size(){return "+$.map(function(L){return"this.shape["+L+"]"}).join("*"),"}})"),Z===1)K.push("proto.order=[0]");else if(K.push("Object.defineProperty(proto,'order',{get:"),Z<4){if(K.push("function "+Y+"_order(){"),Z===2)K.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})");else if(Z===3)K.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")}else K.push("ORDER})");if(K.push("proto.set=function "+Y+"_set("+Q.join(",")+",v){"),X)K.push("return this.data.set("+F+",v)}");else K.push("return this.data["+F+"]=v}");if(K.push("proto.get=function "+Y+"_get("+Q.join(",")+"){"),X)K.push("return this.data.get("+F+")}");else K.push("return this.data["+F+"]}");K.push("proto.index=function "+Y+"_index(",Q.join(),"){return "+F+"}"),K.push("proto.hi=function "+Y+"_hi("+Q.join(",")+"){return new "+Y+"(this.data,"+$.map(function(L){return["(typeof i",L,"!=='number'||i",L,"<0)?this.shape[",L,"]:i",L,"|0"].join("")}).join(",")+","+$.map(function(L){return"this.stride["+L+"]"}).join(",")+",this.offset)}");var V=$.map(function(L){return"a"+L+"=this.shape["+L+"]"}),q=$.map(function(L){return"c"+L+"=this.stride["+L+"]"});K.push("proto.lo=function "+Y+"_lo("+Q.join(",")+"){var b=this.offset,d=0,"+V.join(",")+","+q.join(","));for(var z=0;z<Z;++z)K.push("if(typeof i"+z+"==='number'&&i"+z+">=0){d=i"+z+"|0;b+=c"+z+"*d;a"+z+"-=d}");K.push("return new "+Y+"(this.data,"+$.map(function(L){return"a"+L}).join(",")+","+$.map(function(L){return"c"+L}).join(",")+",b)}"),K.push("proto.step=function "+Y+"_step("+Q.join(",")+"){var "+$.map(function(L){return"a"+L+"=this.shape["+L+"]"}).join(",")+","+$.map(function(L){return"b"+L+"=this.stride["+L+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var z=0;z<Z;++z)K.push("if(typeof i"+z+"==='number'){d=i"+z+"|0;if(d<0){c+=b"+z+"*(a"+z+"-1);a"+z+"=ceil(-a"+z+"/d)}else{a"+z+"=ceil(a"+z+"/d)}b"+z+"*=d}");K.push("return new "+Y+"(this.data,"+$.map(function(L){return"a"+L}).join(",")+","+$.map(function(L){return"b"+L}).join(",")+",c)}");var U=new Array(Z),M=new Array(Z);for(var z=0;z<Z;++z)U[z]="a[i"+z+"]",M[z]="b[i"+z+"]";K.push("proto.transpose=function "+Y+"_transpose("+Q+"){"+Q.map(function(L,O){return L+"=("+L+"===undefined?"+O+":"+L+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+Y+"(this.data,"+U.join(",")+","+M.join(",")+",this.offset)}"),K.push("proto.pick=function "+Y+"_pick("+Q+"){var a=[],b=[],c=this.offset");for(var z=0;z<Z;++z)K.push("if(typeof i"+z+"==='number'&&i"+z+">=0){c=(c+this.stride["+z+"]*i"+z+")|0}else{a.push(this.shape["+z+"]);b.push(this.stride["+z+"])}");K.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),K.push("return function construct_"+Y+"(data,shape,stride,offset){return new "+Y+"(data,"+$.map(function(L){return"shape["+L+"]"}).join(",")+","+$.map(function(L){return"stride["+L+"]"}).join(",")+",offset)}");var R=new Function("CTOR_LIST","ORDER",K.join(`
`));return R(rY[J],mg)}function ug(J){if(yg(J))return"buffer";if(gg)switch(Object.prototype.toString.call(J)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}if(Array.isArray(J))return"array";return"generic"}var rY={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function dg(J,Z,Y,X){if(J===void 0){var W=rY.array[0];return W([])}else if(typeof J==="number")J=[J];if(Z===void 0)Z=[J.length];var K=Z.length;if(Y===void 0){Y=new Array(K);for(var $=K-1,Q=1;$>=0;--$)Y[$]=Q,Q*=Z[$]}if(X===void 0){X=0;for(var $=0;$<K;++$)if(Y[$]<0)X-=(Z[$]-1)*Y[$]}var F=ug(J),G=rY[F];while(G.length<=K+1)G.push(lg(F,G.length-1));var W=G[K+1];return W(J,Z,Y,X)}pR.exports=dg});var n4=P((nR)=>{Object.defineProperty(nR,"__esModule",{value:!0});nR.regexpCode=nR.getEsmExportName=nR.getProperty=nR.safeStringify=nR.stringify=nR.strConcat=nR.addCodeArg=nR.str=nR._=nR.nil=nR._Code=nR.Name=nR.IDENTIFIER=nR._CodeOrName=void 0;class XX{}nR._CodeOrName=XX;nR.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Q5 extends XX{constructor(J){super();if(!nR.IDENTIFIER.test(J))throw new Error("CodeGen: name must be a valid identifier");this.str=J}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}nR.Name=Q5;class w6 extends XX{constructor(J){super();this._items=typeof J==="string"?[J]:J}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let J=this._items[0];return J===""||J==='""'}get str(){var J;return(J=this._str)!==null&&J!==void 0?J:this._str=this._items.reduce((Z,Y)=>`${Z}${Y}`,"")}get names(){var J;return(J=this._names)!==null&&J!==void 0?J:this._names=this._items.reduce((Z,Y)=>{if(Y instanceof Q5)Z[Y.str]=(Z[Y.str]||0)+1;return Z},{})}}nR._Code=w6;nR.nil=new w6("");function dR(J,...Z){let Y=[J[0]],X=0;while(X<Z.length)QG(Y,Z[X]),Y.push(J[++X]);return new w6(Y)}nR._=dR;var $G=new w6("+");function iR(J,...Z){let Y=[i4(J[0])],X=0;while(X<Z.length)Y.push($G),QG(Y,Z[X]),Y.push($G,i4(J[++X]));return qc(Y),new w6(Y)}nR.str=iR;function QG(J,Z){if(Z instanceof w6)J.push(...Z._items);else if(Z instanceof Q5)J.push(Z);else J.push(Lc(Z))}nR.addCodeArg=QG;function qc(J){let Z=1;while(Z<J.length-1){if(J[Z]===$G){let Y=zc(J[Z-1],J[Z+1]);if(Y!==void 0){J.splice(Z-1,3,Y);continue}J[Z++]="+"}Z++}}function zc(J,Z){if(Z==='""')return J;if(J==='""')return Z;if(typeof J=="string"){if(Z instanceof Q5||J[J.length-1]!=='"')return;if(typeof Z!="string")return`${J.slice(0,-1)}${Z}"`;if(Z[0]==='"')return J.slice(0,-1)+Z.slice(1);return}if(typeof Z=="string"&&Z[0]==='"'&&!(J instanceof Q5))return`"${J}${Z.slice(1)}`;return}function Hc(J,Z){return Z.emptyStr()?J:J.emptyStr()?Z:iR`${J}${Z}`}nR.strConcat=Hc;function Lc(J){return typeof J=="number"||typeof J=="boolean"||J===null?J:i4(Array.isArray(J)?J.join(","):J)}function Uc(J){return new w6(i4(J))}nR.stringify=Uc;function i4(J){return JSON.stringify(J).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}nR.safeStringify=i4;function Mc(J){return typeof J=="string"&&nR.IDENTIFIER.test(J)?new w6(`.${J}`):dR`[${J}]`}nR.getProperty=Mc;function Rc(J){if(typeof J=="string"&&nR.IDENTIFIER.test(J))return new w6(`${J}`);throw new Error(`CodeGen: invalid export name: ${J}, use explicit $id name mapping`)}nR.getEsmExportName=Rc;function wc(J){return new w6(J.toString())}nR.regexpCode=wc});var VG=P((rR)=>{Object.defineProperty(rR,"__esModule",{value:!0});rR.ValueScope=rR.ValueScopeName=rR.Scope=rR.varKinds=rR.UsedValueState=void 0;var f8=n4();class sR extends Error{constructor(J){super(`CodeGen: "code" for ${J} not defined`);this.value=J.value}}var $X;(function(J){J[J.Started=0]="Started",J[J.Completed=1]="Completed"})($X||(rR.UsedValueState=$X={}));rR.varKinds={const:new f8.Name("const"),let:new f8.Name("let"),var:new f8.Name("var")};class GG{constructor({prefixes:J,parent:Z}={}){this._names={},this._prefixes=J,this._parent=Z}toName(J){return J instanceof f8.Name?J:this.name(J)}name(J){return new f8.Name(this._newName(J))}_newName(J){let Z=this._names[J]||this._nameGroup(J);return`${J}${Z.index++}`}_nameGroup(J){var Z,Y;if(((Y=(Z=this._parent)===null||Z===void 0?void 0:Z._prefixes)===null||Y===void 0?void 0:Y.has(J))||this._prefixes&&!this._prefixes.has(J))throw new Error(`CodeGen: prefix "${J}" is not allowed in this scope`);return this._names[J]={prefix:J,index:0}}}rR.Scope=GG;class WG extends f8.Name{constructor(J,Z){super(Z);this.prefix=J}setValue(J,{property:Z,itemIndex:Y}){this.value=J,this.scopePath=f8._`.${new f8.Name(Z)}[${Y}]`}}rR.ValueScopeName=WG;var Cc=f8._`\n`;class oR extends GG{constructor(J){super(J);this._values={},this._scope=J.scope,this.opts={...J,_n:J.lines?Cc:f8.nil}}get(){return this._scope}name(J){return new WG(J,this._newName(J))}value(J,Z){var Y;if(Z.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let X=this.toName(J),{prefix:K}=X,$=(Y=Z.key)!==null&&Y!==void 0?Y:Z.ref,Q=this._values[K];if(Q){let W=Q.get($);if(W)return W}else Q=this._values[K]=new Map;Q.set($,X);let F=this._scope[K]||(this._scope[K]=[]),G=F.length;return F[G]=Z.ref,X.setValue(Z,{property:K,itemIndex:G}),X}getValue(J,Z){let Y=this._values[J];if(!Y)return;return Y.get(Z)}scopeRefs(J,Z=this._values){return this._reduceValues(Z,(Y)=>{if(Y.scopePath===void 0)throw new Error(`CodeGen: name "${Y}" has no value`);return f8._`${J}${Y.scopePath}`})}scopeCode(J=this._values,Z,Y){return this._reduceValues(J,(X)=>{if(X.value===void 0)throw new Error(`CodeGen: name "${X}" has no value`);return X.value.code},Z,Y)}_reduceValues(J,Z,Y={},X){let K=f8.nil;for(let $ in J){let Q=J[$];if(!Q)continue;let F=Y[$]=Y[$]||new Map;Q.forEach((G)=>{if(F.has(G))return;F.set(G,$X.Started);let W=Z(G);if(W){let V=this.opts.es5?rR.varKinds.var:rR.varKinds.const;K=f8._`${K}${V} ${G} = ${W};${this.opts._n}`}else if(W=X===null||X===void 0?void 0:X(G))K=f8._`${K}${W}${this.opts._n}`;else throw new sR(G);F.set(G,$X.Completed)})}return K}}rR.ValueScope=oR});var Z0=P((h8)=>{Object.defineProperty(h8,"__esModule",{value:!0});h8.or=h8.and=h8.not=h8.CodeGen=h8.operators=h8.varKinds=h8.ValueScopeName=h8.ValueScope=h8.Scope=h8.Name=h8.regexpCode=h8.stringify=h8.getProperty=h8.nil=h8.strConcat=h8.str=h8._=void 0;var Q0=n4(),O6=VG(),S1=n4();Object.defineProperty(h8,"_",{enumerable:!0,get:function(){return S1._}});Object.defineProperty(h8,"str",{enumerable:!0,get:function(){return S1.str}});Object.defineProperty(h8,"strConcat",{enumerable:!0,get:function(){return S1.strConcat}});Object.defineProperty(h8,"nil",{enumerable:!0,get:function(){return S1.nil}});Object.defineProperty(h8,"getProperty",{enumerable:!0,get:function(){return S1.getProperty}});Object.defineProperty(h8,"stringify",{enumerable:!0,get:function(){return S1.stringify}});Object.defineProperty(h8,"regexpCode",{enumerable:!0,get:function(){return S1.regexpCode}});Object.defineProperty(h8,"Name",{enumerable:!0,get:function(){return S1.Name}});var qX=VG();Object.defineProperty(h8,"Scope",{enumerable:!0,get:function(){return qX.Scope}});Object.defineProperty(h8,"ValueScope",{enumerable:!0,get:function(){return qX.ValueScope}});Object.defineProperty(h8,"ValueScopeName",{enumerable:!0,get:function(){return qX.ValueScopeName}});Object.defineProperty(h8,"varKinds",{enumerable:!0,get:function(){return qX.varKinds}});h8.operators={GT:new Q0._Code(">"),GTE:new Q0._Code(">="),LT:new Q0._Code("<"),LTE:new Q0._Code("<="),EQ:new Q0._Code("==="),NEQ:new Q0._Code("!=="),NOT:new Q0._Code("!"),OR:new Q0._Code("||"),AND:new Q0._Code("&&"),ADD:new Q0._Code("+")};class I1{optimizeNodes(){return this}optimizeNames(J,Z){return this}}class eR extends I1{constructor(J,Z,Y){super();this.varKind=J,this.name=Z,this.rhs=Y}render({es5:J,_n:Z}){let Y=J?O6.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${X};`+Z}optimizeNames(J,Z){if(!J[this.name.str])return;if(this.rhs)this.rhs=G5(this.rhs,J,Z);return this}get names(){return this.rhs instanceof Q0._CodeOrName?this.rhs.names:{}}}class HG extends I1{constructor(J,Z,Y){super();this.lhs=J,this.rhs=Z,this.sideEffects=Y}render({_n:J}){return`${this.lhs} = ${this.rhs};`+J}optimizeNames(J,Z){if(this.lhs instanceof Q0.Name&&!J[this.lhs.str]&&!this.sideEffects)return;return this.rhs=G5(this.rhs,J,Z),this}get names(){let J=this.lhs instanceof Q0.Name?{}:{...this.lhs.names};return VX(J,this.rhs)}}class Jw extends HG{constructor(J,Z,Y,X){super(J,Y,X);this.op=Z}render({_n:J}){return`${this.lhs} ${this.op}= ${this.rhs};`+J}}class Zw extends I1{constructor(J){super();this.label=J,this.names={}}render({_n:J}){return`${this.label}:`+J}}class Yw extends I1{constructor(J){super();this.label=J,this.names={}}render({_n:J}){return`break${this.label?` ${this.label}`:""};`+J}}class Xw extends I1{constructor(J){super();this.error=J}render({_n:J}){return`throw ${this.error};`+J}get names(){return this.error.names}}class Kw extends I1{constructor(J){super();this.code=J}render({_n:J}){return`${this.code};`+J}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(J,Z){return this.code=G5(this.code,J,Z),this}get names(){return this.code instanceof Q0._CodeOrName?this.code.names:{}}}class zX extends I1{constructor(J=[]){super();this.nodes=J}render(J){return this.nodes.reduce((Z,Y)=>Z+Y.render(J),"")}optimizeNodes(){let{nodes:J}=this,Z=J.length;while(Z--){let Y=J[Z].optimizeNodes();if(Array.isArray(Y))J.splice(Z,1,...Y);else if(Y)J[Z]=Y;else J.splice(Z,1)}return J.length>0?this:void 0}optimizeNames(J,Z){let{nodes:Y}=this,X=Y.length;while(X--){let K=Y[X];if(K.optimizeNames(J,Z))continue;hc(J,K.names),Y.splice(X,1)}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((J,Z)=>G9(J,Z.names),{})}}class f1 extends zX{render(J){return"{"+J._n+super.render(J)+"}"+J._n}}class $w extends zX{}class a4 extends f1{}a4.kind="else";class V1 extends f1{constructor(J,Z){super(Z);this.condition=J}render(J){let Z=`if(${this.condition})`+super.render(J);if(this.else)Z+="else "+this.else.render(J);return Z}optimizeNodes(){super.optimizeNodes();let J=this.condition;if(J===!0)return this.nodes;let Z=this.else;if(Z){let Y=Z.optimizeNodes();Z=this.else=Array.isArray(Y)?new a4(Y):Y}if(Z){if(J===!1)return Z instanceof V1?Z:Z.nodes;if(this.nodes.length)return this;return new V1(Vw(J),Z instanceof V1?[Z]:Z.nodes)}if(J===!1||!this.nodes.length)return;return this}optimizeNames(J,Z){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(J,Z),!(super.optimizeNames(J,Z)||this.else))return;return this.condition=G5(this.condition,J,Z),this}get names(){let J=super.names;if(VX(J,this.condition),this.else)G9(J,this.else.names);return J}}V1.kind="if";class F5 extends f1{}F5.kind="for";class Qw extends F5{constructor(J){super();this.iteration=J}render(J){return`for(${this.iteration})`+super.render(J)}optimizeNames(J,Z){if(!super.optimizeNames(J,Z))return;return this.iteration=G5(this.iteration,J,Z),this}get names(){return G9(super.names,this.iteration.names)}}class Fw extends F5{constructor(J,Z,Y,X){super();this.varKind=J,this.name=Z,this.from=Y,this.to=X}render(J){let Z=J.es5?O6.varKinds.var:this.varKind,{name:Y,from:X,to:K}=this;return`for(${Z} ${Y}=${X}; ${Y}<${K}; ${Y}++)`+super.render(J)}get names(){let J=VX(super.names,this.from);return VX(J,this.to)}}class qG extends F5{constructor(J,Z,Y,X){super();this.loop=J,this.varKind=Z,this.name=Y,this.iterable=X}render(J){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(J)}optimizeNames(J,Z){if(!super.optimizeNames(J,Z))return;return this.iterable=G5(this.iterable,J,Z),this}get names(){return G9(super.names,this.iterable.names)}}class QX extends f1{constructor(J,Z,Y){super();this.name=J,this.args=Z,this.async=Y}render(J){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(J)}}QX.kind="func";class FX extends zX{render(J){return"return "+super.render(J)}}FX.kind="return";class Gw extends f1{render(J){let Z="try"+super.render(J);if(this.catch)Z+=this.catch.render(J);if(this.finally)Z+=this.finally.render(J);return Z}optimizeNodes(){var J,Z;return super.optimizeNodes(),(J=this.catch)===null||J===void 0||J.optimizeNodes(),(Z=this.finally)===null||Z===void 0||Z.optimizeNodes(),this}optimizeNames(J,Z){var Y,X;return super.optimizeNames(J,Z),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(J,Z),(X=this.finally)===null||X===void 0||X.optimizeNames(J,Z),this}get names(){let J=super.names;if(this.catch)G9(J,this.catch.names);if(this.finally)G9(J,this.finally.names);return J}}class GX extends f1{constructor(J){super();this.error=J}render(J){return`catch(${this.error})`+super.render(J)}}GX.kind="catch";class WX extends f1{render(J){return"finally"+super.render(J)}}WX.kind="finally";class Ww{constructor(J,Z={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Z,_n:Z.lines?`
`:""},this._extScope=J,this._scope=new O6.Scope({parent:J}),this._nodes=[new $w]}toString(){return this._root.render(this.opts)}name(J){return this._scope.name(J)}scopeName(J){return this._extScope.name(J)}scopeValue(J,Z){let Y=this._extScope.value(J,Z);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}getScopeValue(J,Z){return this._extScope.getValue(J,Z)}scopeRefs(J){return this._extScope.scopeRefs(J,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(J,Z,Y,X){let K=this._scope.toName(Z);if(Y!==void 0&&X)this._constants[K.str]=Y;return this._leafNode(new eR(J,K,Y)),K}const(J,Z,Y){return this._def(O6.varKinds.const,J,Z,Y)}let(J,Z,Y){return this._def(O6.varKinds.let,J,Z,Y)}var(J,Z,Y){return this._def(O6.varKinds.var,J,Z,Y)}assign(J,Z,Y){return this._leafNode(new HG(J,Z,Y))}add(J,Z){return this._leafNode(new Jw(J,h8.operators.ADD,Z))}code(J){if(typeof J=="function")J();else if(J!==Q0.nil)this._leafNode(new Kw(J));return this}object(...J){let Z=["{"];for(let[Y,X]of J){if(Z.length>1)Z.push(",");if(Z.push(Y),Y!==X||this.opts.es5)Z.push(":"),Q0.addCodeArg(Z,X)}return Z.push("}"),new Q0._Code(Z)}if(J,Z,Y){if(this._blockNode(new V1(J)),Z&&Y)this.code(Z).else().code(Y).endIf();else if(Z)this.code(Z).endIf();else if(Y)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(J){return this._elseNode(new V1(J))}else(){return this._elseNode(new a4)}endIf(){return this._endBlockNode(V1,a4)}_for(J,Z){if(this._blockNode(J),Z)this.code(Z).endFor();return this}for(J,Z){return this._for(new Qw(J),Z)}forRange(J,Z,Y,X,K=this.opts.es5?O6.varKinds.var:O6.varKinds.let){let $=this._scope.toName(J);return this._for(new Fw(K,$,Z,Y),()=>X($))}forOf(J,Z,Y,X=O6.varKinds.const){let K=this._scope.toName(J);if(this.opts.es5){let $=Z instanceof Q0.Name?Z:this.var("_arr",Z);return this.forRange("_i",0,Q0._`${$}.length`,(Q)=>{this.var(K,Q0._`${$}[${Q}]`),Y(K)})}return this._for(new qG("of",X,K,Z),()=>Y(K))}forIn(J,Z,Y,X=this.opts.es5?O6.varKinds.var:O6.varKinds.const){if(this.opts.ownProperties)return this.forOf(J,Q0._`Object.keys(${Z})`,Y);let K=this._scope.toName(J);return this._for(new qG("in",X,K,Z),()=>Y(K))}endFor(){return this._endBlockNode(F5)}label(J){return this._leafNode(new Zw(J))}break(J){return this._leafNode(new Yw(J))}return(J){let Z=new FX;if(this._blockNode(Z),this.code(J),Z.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(FX)}try(J,Z,Y){if(!Z&&!Y)throw new Error('CodeGen: "try" without "catch" and "finally"');let X=new Gw;if(this._blockNode(X),this.code(J),Z){let K=this.name("e");this._currNode=X.catch=new GX(K),Z(K)}if(Y)this._currNode=X.finally=new WX,this.code(Y);return this._endBlockNode(GX,WX)}throw(J){return this._leafNode(new Xw(J))}block(J,Z){if(this._blockStarts.push(this._nodes.length),J)this.code(J).endBlock(Z);return this}endBlock(J){let Z=this._blockStarts.pop();if(Z===void 0)throw new Error("CodeGen: not in self-balancing block");let Y=this._nodes.length-Z;if(Y<0||J!==void 0&&Y!==J)throw new Error(`CodeGen: wrong number of nodes: ${Y} vs ${J} expected`);return this._nodes.length=Z,this}func(J,Z=Q0.nil,Y,X){if(this._blockNode(new QX(J,Z,Y)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(QX)}optimize(J=1){while(J-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(J){return this._currNode.nodes.push(J),this}_blockNode(J){this._currNode.nodes.push(J),this._nodes.push(J)}_endBlockNode(J,Z){let Y=this._currNode;if(Y instanceof J||Z&&Y instanceof Z)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${Z?`${J.kind}/${Z.kind}`:J.kind}"`)}_elseNode(J){let Z=this._currNode;if(!(Z instanceof V1))throw new Error('CodeGen: "else" without "if"');return this._currNode=Z.else=J,this}get _root(){return this._nodes[0]}get _currNode(){let J=this._nodes;return J[J.length-1]}set _currNode(J){let Z=this._nodes;Z[Z.length-1]=J}}h8.CodeGen=Ww;function G9(J,Z){for(let Y in Z)J[Y]=(J[Y]||0)+(Z[Y]||0);return J}function VX(J,Z){return Z instanceof Q0._CodeOrName?G9(J,Z.names):J}function G5(J,Z,Y){if(J instanceof Q0.Name)return X(J);if(!K(J))return J;return new Q0._Code(J._items.reduce(($,Q)=>{if(Q instanceof Q0.Name)Q=X(Q);if(Q instanceof Q0._Code)$.push(...Q._items);else $.push(Q);return $},[]));function X($){let Q=Y[$.str];if(Q===void 0||Z[$.str]!==1)return $;return delete Z[$.str],Q}function K($){return $ instanceof Q0._Code&&$._items.some((Q)=>Q instanceof Q0.Name&&Z[Q.str]===1&&Y[Q.str]!==void 0)}}function hc(J,Z){for(let Y in Z)J[Y]=(J[Y]||0)-(Z[Y]||0)}function Vw(J){return typeof J=="boolean"||typeof J=="number"||J===null?!J:Q0._`!${zG(J)}`}h8.not=Vw;var bc=qw(h8.operators.AND);function pc(...J){return J.reduce(bc)}h8.and=pc;var Ac=qw(h8.operators.OR);function yc(...J){return J.reduce(Ac)}h8.or=yc;function qw(J){return(Z,Y)=>Z===Q0.nil?Y:Y===Q0.nil?Z:Q0._`${zG(Z)} ${J} ${zG(Y)}`}function zG(J){return J instanceof Q0.Name?J:Q0._`(${J})`}});var z0=P((Pw)=>{Object.defineProperty(Pw,"__esModule",{value:!0});Pw.checkStrictMode=Pw.getErrorPath=Pw.Type=Pw.useFunc=Pw.setEvaluated=Pw.evaluatedPropsToName=Pw.mergeEvaluated=Pw.eachItem=Pw.unescapeJsonPointer=Pw.escapeJsonPointer=Pw.escapeFragment=Pw.unescapeFragment=Pw.schemaRefOrVal=Pw.schemaHasRulesButRef=Pw.schemaHasRules=Pw.checkUnknownRules=Pw.alwaysValidSchema=Pw.toHash=void 0;var T0=Z0(),lc=n4();function uc(J){let Z={};for(let Y of J)Z[Y]=!0;return Z}Pw.toHash=uc;function dc(J,Z){if(typeof Z=="boolean")return Z;if(Object.keys(Z).length===0)return!0;return Uw(J,Z),!Mw(Z,J.self.RULES.all)}Pw.alwaysValidSchema=dc;function Uw(J,Z=J.schema){let{opts:Y,self:X}=J;if(!Y.strictSchema)return;if(typeof Z==="boolean")return;let K=X.RULES.keywords;for(let $ in Z)if(!K[$])Ow(J,`unknown keyword: "${$}"`)}Pw.checkUnknownRules=Uw;function Mw(J,Z){if(typeof J=="boolean")return!J;for(let Y in J)if(Z[Y])return!0;return!1}Pw.schemaHasRules=Mw;function ic(J,Z){if(typeof J=="boolean")return!J;for(let Y in J)if(Y!=="$ref"&&Z.all[Y])return!0;return!1}Pw.schemaHasRulesButRef=ic;function nc({topSchemaRef:J,schemaPath:Z},Y,X,K){if(!K){if(typeof Y=="number"||typeof Y=="boolean")return Y;if(typeof Y=="string")return T0._`${Y}`}return T0._`${J}${Z}${T0.getProperty(X)}`}Pw.schemaRefOrVal=nc;function ac(J){return Rw(decodeURIComponent(J))}Pw.unescapeFragment=ac;function sc(J){return encodeURIComponent(UG(J))}Pw.escapeFragment=sc;function UG(J){if(typeof J=="number")return`${J}`;return J.replace(/~/g,"~0").replace(/\//g,"~1")}Pw.escapeJsonPointer=UG;function Rw(J){return J.replace(/~1/g,"/").replace(/~0/g,"~")}Pw.unescapeJsonPointer=Rw;function oc(J,Z){if(Array.isArray(J))for(let Y of J)Z(Y);else Z(J)}Pw.eachItem=oc;function Hw({mergeNames:J,mergeToName:Z,mergeValues:Y,resultToName:X}){return(K,$,Q,F)=>{let G=Q===void 0?$:Q instanceof T0.Name?($ instanceof T0.Name?J(K,$,Q):Z(K,$,Q),Q):$ instanceof T0.Name?(Z(K,Q,$),$):Y($,Q);return F===T0.Name&&!(G instanceof T0.Name)?X(K,G):G}}Pw.mergeEvaluated={props:Hw({mergeNames:(J,Z,Y)=>J.if(T0._`${Y} !== true && ${Z} !== undefined`,()=>{J.if(T0._`${Z} === true`,()=>J.assign(Y,!0),()=>J.assign(Y,T0._`${Y} || {}`).code(T0._`Object.assign(${Y}, ${Z})`))}),mergeToName:(J,Z,Y)=>J.if(T0._`${Y} !== true`,()=>{if(Z===!0)J.assign(Y,!0);else J.assign(Y,T0._`${Y} || {}`),MG(J,Y,Z)}),mergeValues:(J,Z)=>J===!0?!0:{...J,...Z},resultToName:ww}),items:Hw({mergeNames:(J,Z,Y)=>J.if(T0._`${Y} !== true && ${Z} !== undefined`,()=>J.assign(Y,T0._`${Z} === true ? true : ${Y} > ${Z} ? ${Y} : ${Z}`)),mergeToName:(J,Z,Y)=>J.if(T0._`${Y} !== true`,()=>J.assign(Y,Z===!0?!0:T0._`${Y} > ${Z} ? ${Y} : ${Z}`)),mergeValues:(J,Z)=>J===!0?!0:Math.max(J,Z),resultToName:(J,Z)=>J.var("items",Z)})};function ww(J,Z){if(Z===!0)return J.var("props",!0);let Y=J.var("props",T0._`{}`);if(Z!==void 0)MG(J,Y,Z);return Y}Pw.evaluatedPropsToName=ww;function MG(J,Z,Y){Object.keys(Y).forEach((X)=>J.assign(T0._`${Z}${T0.getProperty(X)}`,!0))}Pw.setEvaluated=MG;var Lw={};function rc(J,Z){return J.scopeValue("func",{ref:Z,code:Lw[Z.code]||(Lw[Z.code]=new lc._Code(Z.code))})}Pw.useFunc=rc;var LG;(function(J){J[J.Num=0]="Num",J[J.Str=1]="Str"})(LG||(Pw.Type=LG={}));function tc(J,Z,Y){if(J instanceof T0.Name){let X=Z===LG.Num;return Y?X?T0._`"[" + ${J} + "]"`:T0._`"['" + ${J} + "']"`:X?T0._`"/" + ${J}`:T0._`"/" + ${J}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Y?T0.getProperty(J).toString():"/"+UG(J)}Pw.getErrorPath=tc;function Ow(J,Z,Y=J.opts.strictSchema){if(!Y)return;if(Z=`strict mode: ${Z}`,Y===!0)throw new Error(Z);J.self.logger.warn(Z)}Pw.checkStrictMode=Ow});var q1=P((Bw)=>{Object.defineProperty(Bw,"__esModule",{value:!0});var w8=Z0(),Mm={data:new w8.Name("data"),valCxt:new w8.Name("valCxt"),instancePath:new w8.Name("instancePath"),parentData:new w8.Name("parentData"),parentDataProperty:new w8.Name("parentDataProperty"),rootData:new w8.Name("rootData"),dynamicAnchors:new w8.Name("dynamicAnchors"),vErrors:new w8.Name("vErrors"),errors:new w8.Name("errors"),this:new w8.Name("this"),self:new w8.Name("self"),scope:new w8.Name("scope"),json:new w8.Name("json"),jsonPos:new w8.Name("jsonPos"),jsonLen:new w8.Name("jsonLen"),jsonPart:new w8.Name("jsonPart")};Bw.default=Mm});var s4=P((xw)=>{Object.defineProperty(xw,"__esModule",{value:!0});xw.extendErrors=xw.resetErrorsCount=xw.reportExtraError=xw.reportError=xw.keyword$DataError=xw.keywordError=void 0;var V0=Z0(),LX=z0(),v8=q1();xw.keywordError={message:({keyword:J})=>V0.str`must pass "${J}" keyword validation`};xw.keyword$DataError={message:({keyword:J,schemaType:Z})=>Z?V0.str`"${J}" keyword must be ${Z} ($data)`:V0.str`"${J}" keyword is invalid ($data)`};function wm(J,Z=xw.keywordError,Y,X){let{it:K}=J,{gen:$,compositeRule:Q,allErrors:F}=K,G=kw(J,Z,Y);if(X!==null&&X!==void 0?X:Q||F)vw($,G);else jw(K,V0._`[${G}]`)}xw.reportError=wm;function Om(J,Z=xw.keywordError,Y){let{it:X}=J,{gen:K,compositeRule:$,allErrors:Q}=X,F=kw(J,Z,Y);if(vw(K,F),!($||Q))jw(X,v8.default.vErrors)}xw.reportExtraError=Om;function Pm(J,Z){J.assign(v8.default.errors,Z),J.if(V0._`${v8.default.vErrors} !== null`,()=>J.if(Z,()=>J.assign(V0._`${v8.default.vErrors}.length`,Z),()=>J.assign(v8.default.vErrors,null)))}xw.resetErrorsCount=Pm;function Nm({gen:J,keyword:Z,schemaValue:Y,data:X,errsCount:K,it:$}){if(K===void 0)throw new Error("ajv implementation error");let Q=J.name("err");J.forRange("i",K,v8.default.errors,(F)=>{if(J.const(Q,V0._`${v8.default.vErrors}[${F}]`),J.if(V0._`${Q}.instancePath === undefined`,()=>J.assign(V0._`${Q}.instancePath`,V0.strConcat(v8.default.instancePath,$.errorPath))),J.assign(V0._`${Q}.schemaPath`,V0.str`${$.errSchemaPath}/${Z}`),$.opts.verbose)J.assign(V0._`${Q}.schema`,Y),J.assign(V0._`${Q}.data`,X)})}xw.extendErrors=Nm;function vw(J,Z){let Y=J.const("err",Z);J.if(V0._`${v8.default.vErrors} === null`,()=>J.assign(v8.default.vErrors,V0._`[${Y}]`),V0._`${v8.default.vErrors}.push(${Y})`),J.code(V0._`${v8.default.errors}++`)}function jw(J,Z){let{gen:Y,validateName:X,schemaEnv:K}=J;if(K.$async)Y.throw(V0._`new ${J.ValidationError}(${Z})`);else Y.assign(V0._`${X}.errors`,Z),Y.return(!1)}var W9={keyword:new V0.Name("keyword"),schemaPath:new V0.Name("schemaPath"),params:new V0.Name("params"),propertyName:new V0.Name("propertyName"),message:new V0.Name("message"),schema:new V0.Name("schema"),parentSchema:new V0.Name("parentSchema")};function kw(J,Z,Y){let{createErrors:X}=J.it;if(X===!1)return V0._`{}`;return Bm(J,Z,Y)}function Bm(J,Z,Y={}){let{gen:X,it:K}=J,$=[vm(K,Y),jm(J,Y)];return km(J,Z,$),X.object(...$)}function vm({errorPath:J},{instancePath:Z}){let Y=Z?V0.str`${J}${LX.getErrorPath(Z,LX.Type.Str)}`:J;return[v8.default.instancePath,V0.strConcat(v8.default.instancePath,Y)]}function jm({keyword:J,it:{errSchemaPath:Z}},{schemaPath:Y,parentSchema:X}){let K=X?Z:V0.str`${Z}/${J}`;if(Y)K=V0.str`${K}${LX.getErrorPath(Y,LX.Type.Str)}`;return[W9.schemaPath,K]}function km(J,{params:Z,message:Y},X){let{keyword:K,data:$,schemaValue:Q,it:F}=J,{opts:G,propertyName:W,topSchemaRef:V,schemaPath:q}=F;if(X.push([W9.keyword,K],[W9.params,typeof Z=="function"?Z(J):Z||V0._`{}`]),G.messages)X.push([W9.message,typeof Y=="function"?Y(J):Y]);if(G.verbose)X.push([W9.schema,Q],[W9.parentSchema,V0._`${V}${q}`],[v8.default.data,$]);if(W)X.push([W9.propertyName,W])}});var Cw=P((_w)=>{Object.defineProperty(_w,"__esModule",{value:!0});_w.boolOrEmptySchema=_w.topBoolOrEmptySchema=void 0;var Em=s4(),Cm=Z0(),Sm=q1(),Im={message:"boolean schema is false"};function fm(J){let{gen:Z,schema:Y,validateName:X}=J;if(Y===!1)Dw(J,!1);else if(typeof Y=="object"&&Y.$async===!0)Z.return(Sm.default.data);else Z.assign(Cm._`${X}.errors`,null),Z.return(!0)}_w.topBoolOrEmptySchema=fm;function hm(J,Z){let{gen:Y,schema:X}=J;if(X===!1)Y.var(Z,!1),Dw(J);else Y.var(Z,!0)}_w.boolOrEmptySchema=hm;function Dw(J,Z){let{gen:Y,data:X}=J,K={gen:Y,keyword:"false schema",data:X,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:J};Em.reportError(K,Im,void 0,Z)}});var wG=P((Sw)=>{Object.defineProperty(Sw,"__esModule",{value:!0});Sw.getRules=Sw.isJSONType=void 0;var pm=["string","number","integer","boolean","null","object","array"],Am=new Set(pm);function ym(J){return typeof J=="string"&&Am.has(J)}Sw.isJSONType=ym;function gm(){let J={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...J,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},J.number,J.string,J.array,J.object],post:{rules:[]},all:{},keywords:{}}}Sw.getRules=gm});var OG=P((bw)=>{Object.defineProperty(bw,"__esModule",{value:!0});bw.shouldUseRule=bw.shouldUseGroup=bw.schemaHasRulesForType=void 0;function mm({schema:J,self:Z},Y){let X=Z.RULES.types[Y];return X&&X!==!0&&fw(J,X)}bw.schemaHasRulesForType=mm;function fw(J,Z){return Z.rules.some((Y)=>hw(J,Y))}bw.shouldUseGroup=fw;function hw(J,Z){var Y;return J[Z.keyword]!==void 0||((Y=Z.definition.implements)===null||Y===void 0?void 0:Y.some((X)=>J[X]!==void 0))}bw.shouldUseRule=hw});var o4=P((cw)=>{Object.defineProperty(cw,"__esModule",{value:!0});cw.reportTypeError=cw.checkDataTypes=cw.checkDataType=cw.coerceAndCheckDataType=cw.getJSONTypes=cw.getSchemaTypes=cw.DataType=void 0;var dm=wG(),im=OG(),nm=s4(),t=Z0(),Aw=z0(),W5;(function(J){J[J.Correct=0]="Correct",J[J.Wrong=1]="Wrong"})(W5||(cw.DataType=W5={}));function am(J){let Z=yw(J.type);if(Z.includes("null")){if(J.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!Z.length&&J.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');if(J.nullable===!0)Z.push("null")}return Z}cw.getSchemaTypes=am;function yw(J){let Z=Array.isArray(J)?J:J?[J]:[];if(Z.every(dm.isJSONType))return Z;throw new Error("type must be JSONType or JSONType[]: "+Z.join(","))}cw.getJSONTypes=yw;function sm(J,Z){let{gen:Y,data:X,opts:K}=J,$=om(Z,K.coerceTypes),Q=Z.length>0&&!($.length===0&&Z.length===1&&im.schemaHasRulesForType(J,Z[0]));if(Q){let F=NG(Z,X,K.strictNumbers,W5.Wrong);Y.if(F,()=>{if($.length)rm(J,Z,$);else BG(J)})}return Q}cw.coerceAndCheckDataType=sm;var gw=new Set(["string","number","integer","boolean","null"]);function om(J,Z){return Z?J.filter((Y)=>gw.has(Y)||Z==="array"&&Y==="array"):[]}function rm(J,Z,Y){let{gen:X,data:K,opts:$}=J,Q=X.let("dataType",t._`typeof ${K}`),F=X.let("coerced",t._`undefined`);if($.coerceTypes==="array")X.if(t._`${Q} == 'object' && Array.isArray(${K}) && ${K}.length == 1`,()=>X.assign(K,t._`${K}[0]`).assign(Q,t._`typeof ${K}`).if(NG(Z,K,$.strictNumbers),()=>X.assign(F,K)));X.if(t._`${F} !== undefined`);for(let W of Y)if(gw.has(W)||W==="array"&&$.coerceTypes==="array")G(W);X.else(),BG(J),X.endIf(),X.if(t._`${F} !== undefined`,()=>{X.assign(K,F),tm(J,F)});function G(W){switch(W){case"string":X.elseIf(t._`${Q} == "number" || ${Q} == "boolean"`).assign(F,t._`"" + ${K}`).elseIf(t._`${K} === null`).assign(F,t._`""`);return;case"number":X.elseIf(t._`${Q} == "boolean" || ${K} === null
|| (${Q} == "string" && ${K} && ${K} == +${K})`).assign(F,t._`+${K}`);return;case"integer":X.elseIf(t._`${Q} === "boolean" || ${K} === null
|| (${Q} === "string" && ${K} && ${K} == +${K} && !(${K} % 1))`).assign(F,t._`+${K}`);return;case"boolean":X.elseIf(t._`${K} === "false" || ${K} === 0 || ${K} === null`).assign(F,!1).elseIf(t._`${K} === "true" || ${K} === 1`).assign(F,!0);return;case"null":X.elseIf(t._`${K} === "" || ${K} === 0 || ${K} === false`),X.assign(F,null);return;case"array":X.elseIf(t._`${Q} === "string" || ${Q} === "number"
|| ${Q} === "boolean" || ${K} === null`).assign(F,t._`[${K}]`)}}}function tm({gen:J,parentData:Z,parentDataProperty:Y},X){J.if(t._`${Z} !== undefined`,()=>J.assign(t._`${Z}[${Y}]`,X))}function PG(J,Z,Y,X=W5.Correct){let K=X===W5.Correct?t.operators.EQ:t.operators.NEQ,$;switch(J){case"null":return t._`${Z} ${K} null`;case"array":$=t._`Array.isArray(${Z})`;break;case"object":$=t._`${Z} && typeof ${Z} == "object" && !Array.isArray(${Z})`;break;case"integer":$=Q(t._`!(${Z} % 1) && !isNaN(${Z})`);break;case"number":$=Q();break;default:return t._`typeof ${Z} ${K} ${J}`}return X===W5.Correct?$:t.not($);function Q(F=t.nil){return t.and(t._`typeof ${Z} == "number"`,F,Y?t._`isFinite(${Z})`:t.nil)}}cw.checkDataType=PG;function NG(J,Z,Y,X){if(J.length===1)return PG(J[0],Z,Y,X);let K,$=Aw.toHash(J);if($.array&&$.object){let Q=t._`typeof ${Z} != "object"`;K=$.null?Q:t._`!${Z} || ${Q}`,delete $.null,delete $.array,delete $.object}else K=t.nil;if($.number)delete $.integer;for(let Q in $)K=t.and(K,PG(Q,Z,Y,X));return K}cw.checkDataTypes=NG;var em={message:({schema:J})=>`must be ${J}`,params:({schema:J,schemaValue:Z})=>typeof J=="string"?t._`{type: ${J}}`:t._`{type: ${Z}}`};function BG(J){let Z=Jl(J);nm.reportError(Z,em)}cw.reportTypeError=BG;function Jl(J){let{gen:Z,data:Y,schema:X}=J,K=Aw.schemaRefOrVal(J,X,"type");return{gen:Z,keyword:"type",data:Y,schema:X.type,schemaCode:K,schemaValue:K,parentSchema:X,params:{},it:J}}});var iw=P((uw)=>{Object.defineProperty(uw,"__esModule",{value:!0});uw.assignDefaults=void 0;var V5=Z0(),Fl=z0();function Gl(J,Z){let{properties:Y,items:X}=J.schema;if(Z==="object"&&Y)for(let K in Y)lw(J,K,Y[K].default);else if(Z==="array"&&Array.isArray(X))X.forEach((K,$)=>lw(J,$,K.default))}uw.assignDefaults=Gl;function lw(J,Z,Y){let{gen:X,compositeRule:K,data:$,opts:Q}=J;if(Y===void 0)return;let F=V5._`${$}${V5.getProperty(Z)}`;if(K){Fl.checkStrictMode(J,`default is ignored for: ${F}`);return}let G=V5._`${F} === undefined`;if(Q.useDefaults==="empty")G=V5._`${G} || ${F} === null || ${F} === ""`;X.if(G,V5._`${F} = ${V5.stringify(Y)}`)}});var Y6=P((sw)=>{Object.defineProperty(sw,"__esModule",{value:!0});sw.validateUnion=sw.validateArray=sw.usePattern=sw.callValidateCode=sw.schemaProperties=sw.allSchemaProperties=sw.noPropertyInData=sw.propertyInData=sw.isOwnProperty=sw.hasPropFunc=sw.reportMissingProp=sw.checkMissingProp=sw.checkReportMissingProp=void 0;var I0=Z0(),vG=z0(),h1=q1(),Wl=z0();function Vl(J,Z){let{gen:Y,data:X,it:K}=J;Y.if(kG(Y,X,Z,K.opts.ownProperties),()=>{J.setParams({missingProperty:I0._`${Z}`},!0),J.error()})}sw.checkReportMissingProp=Vl;function ql({gen:J,data:Z,it:{opts:Y}},X,K){return I0.or(...X.map(($)=>I0.and(kG(J,Z,$,Y.ownProperties),I0._`${K} = ${$}`)))}sw.checkMissingProp=ql;function zl(J,Z){J.setParams({missingProperty:Z},!0),J.error()}sw.reportMissingProp=zl;function nw(J){return J.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:I0._`Object.prototype.hasOwnProperty`})}sw.hasPropFunc=nw;function jG(J,Z,Y){return I0._`${nw(J)}.call(${Z}, ${Y})`}sw.isOwnProperty=jG;function Hl(J,Z,Y,X){let K=I0._`${Z}${I0.getProperty(Y)} !== undefined`;return X?I0._`${K} && ${jG(J,Z,Y)}`:K}sw.propertyInData=Hl;function kG(J,Z,Y,X){let K=I0._`${Z}${I0.getProperty(Y)} === undefined`;return X?I0.or(K,I0.not(jG(J,Z,Y))):K}sw.noPropertyInData=kG;function aw(J){return J?Object.keys(J).filter((Z)=>Z!=="__proto__"):[]}sw.allSchemaProperties=aw;function Ll(J,Z){return aw(Z).filter((Y)=>!vG.alwaysValidSchema(J,Z[Y]))}sw.schemaProperties=Ll;function Ul({schemaCode:J,data:Z,it:{gen:Y,topSchemaRef:X,schemaPath:K,errorPath:$},it:Q},F,G,W){let V=W?I0._`${J}, ${Z}, ${X}${K}`:Z,q=[[h1.default.instancePath,I0.strConcat(h1.default.instancePath,$)],[h1.default.parentData,Q.parentData],[h1.default.parentDataProperty,Q.parentDataProperty],[h1.default.rootData,h1.default.rootData]];if(Q.opts.dynamicRef)q.push([h1.default.dynamicAnchors,h1.default.dynamicAnchors]);let z=I0._`${V}, ${Y.object(...q)}`;return G!==I0.nil?I0._`${F}.call(${G}, ${z})`:I0._`${F}(${z})`}sw.callValidateCode=Ul;var Ml=I0._`new RegExp`;function Rl({gen:J,it:{opts:Z}},Y){let X=Z.unicodeRegExp?"u":"",{regExp:K}=Z.code,$=K(Y,X);return J.scopeValue("pattern",{key:$.toString(),ref:$,code:I0._`${K.code==="new RegExp"?Ml:Wl.useFunc(J,K)}(${Y}, ${X})`})}sw.usePattern=Rl;function wl(J){let{gen:Z,data:Y,keyword:X,it:K}=J,$=Z.name("valid");if(K.allErrors){let F=Z.let("valid",!0);return Q(()=>Z.assign(F,!1)),F}return Z.var($,!0),Q(()=>Z.break()),$;function Q(F){let G=Z.const("len",I0._`${Y}.length`);Z.forRange("i",0,G,(W)=>{J.subschema({keyword:X,dataProp:W,dataPropType:vG.Type.Num},$),Z.if(I0.not($),F)})}}sw.validateArray=wl;functio