zion-mcp 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __nodeCreateRequire } from 'node:module';
2
2
  const require = __nodeCreateRequire(import.meta.url);
3
- import{a as K,c as _,d as Mv,e as Dt,g as d,h as g}from"./chunk-6IQ5RBSK.js";var Ua=_((Fv,KR)=>{d();var Cf=K("buffer"),ti=Cf.Buffer;function ZR(t,e){for(var r in t)e[r]=t[r]}ti.from&&ti.alloc&&ti.allocUnsafe&&ti.allocUnsafeSlow?KR.exports=Cf:(ZR(Cf,Fv),Fv.Buffer=fs);function fs(t,e,r){return ti(t,e,r)}fs.prototype=Object.create(ti.prototype);ZR(ti,fs);fs.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ti(t,e,r)};fs.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ti(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};fs.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ti(t)};fs.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Cf.SlowBuffer(t)}});var Uv=_((_De,HR)=>{d();var Df=Ua().Buffer,CJ=K("stream"),DJ=K("util");function kf(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Df.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Df.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}DJ.inherits(kf,CJ);kf.prototype.write=function(e){this.buffer=Df.concat([this.buffer,Df.from(e)]),this.emit("data",e)};kf.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};HR.exports=kf});var QR=_((EDe,WR)=>{"use strict";d();function Gv(t){var e=(t/8|0)+(t%8===0?0:1);return e}var kJ={ES256:Gv(256),ES384:Gv(384),ES512:Gv(521)};function LJ(t){var e=kJ[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}WR.exports=LJ});var nC=_((TDe,rC)=>{"use strict";d();var Lf=Ua().Buffer,YR=QR(),jf=128,XR=0,jJ=32,MJ=16,$J=2,eC=MJ|jJ|XR<<6,Mf=$J|XR<<6;function qJ(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function tC(t){if(Lf.isBuffer(t))return t;if(typeof t=="string")return Lf.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function FJ(t,e){t=tC(t);var r=YR(e),n=r+1,i=t.length,o=0;if(t[o++]!==eC)throw new Error('Could not find expected "seq"');var s=t[o++];if(s===(jf|1)&&(s=t[o++]),i-o<s)throw new Error('"seq" specified length of "'+s+'", only "'+(i-o)+'" remaining');if(t[o++]!==Mf)throw new Error('Could not find expected "int" for "r"');var a=t[o++];if(i-o-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-o-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=o;if(o+=a,t[o++]!==Mf)throw new Error('Could not find expected "int" for "s"');var u=t[o++];if(i-o!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-o)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var l=o;if(o+=u,o!==i)throw new Error('Expected to consume entire buffer, but "'+(i-o)+'" bytes remain');var p=r-a,f=r-u,h=Lf.allocUnsafe(p+a+f+u);for(o=0;o<p;++o)h[o]=0;t.copy(h,o,c+Math.max(-p,0),c+a),o=r;for(var m=o;o<m+f;++o)h[o]=0;return t.copy(h,o,l+Math.max(-f,0),l+u),h=h.toString("base64"),h=qJ(h),h}function JR(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=jf;return i&&--n,n}function UJ(t,e){t=tC(t);var r=YR(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=JR(t,0,r),o=JR(t,r,t.length),s=r-i,a=r-o,c=2+s+1+1+a,u=c<jf,l=Lf.allocUnsafe((u?2:3)+c),p=0;return l[p++]=eC,u?l[p++]=c:(l[p++]=jf|1,l[p++]=c&255),l[p++]=Mf,l[p++]=s,i<0?(l[p++]=0,p+=t.copy(l,p,0,r)):p+=t.copy(l,p,i,r),l[p++]=Mf,l[p++]=a,o<0?(l[p++]=0,t.copy(l,p,r)):t.copy(l,p,r+o),l}rC.exports={derToJose:FJ,joseToDer:UJ}});var oC=_((wDe,iC)=>{"use strict";d();var Ju=K("buffer").Buffer,zv=K("buffer").SlowBuffer;iC.exports=$f;function $f(t,e){if(!Ju.isBuffer(t)||!Ju.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}$f.install=function(){Ju.prototype.equal=zv.prototype.equal=function(e){return $f(this,e)}};var GJ=Ju.prototype.equal,zJ=zv.prototype.equal;$f.restore=function(){Ju.prototype.equal=GJ,zv.prototype.equal=zJ}});var Kv=_((ODe,hC)=>{d();var za=Ua().Buffer,on=K("crypto"),aC=nC(),sC=K("util"),VJ=`"%s" is not a valid algorithm.
3
+ import{a as K,c as _,d as Mv,e as Dt,g as d,h as g}from"./chunk-WDYV2UDT.js";var Ua=_((Fv,KR)=>{d();var Cf=K("buffer"),ti=Cf.Buffer;function ZR(t,e){for(var r in t)e[r]=t[r]}ti.from&&ti.alloc&&ti.allocUnsafe&&ti.allocUnsafeSlow?KR.exports=Cf:(ZR(Cf,Fv),Fv.Buffer=fs);function fs(t,e,r){return ti(t,e,r)}fs.prototype=Object.create(ti.prototype);ZR(ti,fs);fs.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ti(t,e,r)};fs.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ti(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};fs.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ti(t)};fs.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Cf.SlowBuffer(t)}});var Uv=_((_De,HR)=>{d();var Df=Ua().Buffer,CJ=K("stream"),DJ=K("util");function kf(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Df.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Df.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}DJ.inherits(kf,CJ);kf.prototype.write=function(e){this.buffer=Df.concat([this.buffer,Df.from(e)]),this.emit("data",e)};kf.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};HR.exports=kf});var QR=_((EDe,WR)=>{"use strict";d();function Gv(t){var e=(t/8|0)+(t%8===0?0:1);return e}var kJ={ES256:Gv(256),ES384:Gv(384),ES512:Gv(521)};function LJ(t){var e=kJ[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}WR.exports=LJ});var nC=_((TDe,rC)=>{"use strict";d();var Lf=Ua().Buffer,YR=QR(),jf=128,XR=0,jJ=32,MJ=16,$J=2,eC=MJ|jJ|XR<<6,Mf=$J|XR<<6;function qJ(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function tC(t){if(Lf.isBuffer(t))return t;if(typeof t=="string")return Lf.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function FJ(t,e){t=tC(t);var r=YR(e),n=r+1,i=t.length,o=0;if(t[o++]!==eC)throw new Error('Could not find expected "seq"');var s=t[o++];if(s===(jf|1)&&(s=t[o++]),i-o<s)throw new Error('"seq" specified length of "'+s+'", only "'+(i-o)+'" remaining');if(t[o++]!==Mf)throw new Error('Could not find expected "int" for "r"');var a=t[o++];if(i-o-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-o-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=o;if(o+=a,t[o++]!==Mf)throw new Error('Could not find expected "int" for "s"');var u=t[o++];if(i-o!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-o)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var l=o;if(o+=u,o!==i)throw new Error('Expected to consume entire buffer, but "'+(i-o)+'" bytes remain');var p=r-a,f=r-u,h=Lf.allocUnsafe(p+a+f+u);for(o=0;o<p;++o)h[o]=0;t.copy(h,o,c+Math.max(-p,0),c+a),o=r;for(var m=o;o<m+f;++o)h[o]=0;return t.copy(h,o,l+Math.max(-f,0),l+u),h=h.toString("base64"),h=qJ(h),h}function JR(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=jf;return i&&--n,n}function UJ(t,e){t=tC(t);var r=YR(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=JR(t,0,r),o=JR(t,r,t.length),s=r-i,a=r-o,c=2+s+1+1+a,u=c<jf,l=Lf.allocUnsafe((u?2:3)+c),p=0;return l[p++]=eC,u?l[p++]=c:(l[p++]=jf|1,l[p++]=c&255),l[p++]=Mf,l[p++]=s,i<0?(l[p++]=0,p+=t.copy(l,p,0,r)):p+=t.copy(l,p,i,r),l[p++]=Mf,l[p++]=a,o<0?(l[p++]=0,t.copy(l,p,r)):t.copy(l,p,r+o),l}rC.exports={derToJose:FJ,joseToDer:UJ}});var oC=_((wDe,iC)=>{"use strict";d();var Ju=K("buffer").Buffer,zv=K("buffer").SlowBuffer;iC.exports=$f;function $f(t,e){if(!Ju.isBuffer(t)||!Ju.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}$f.install=function(){Ju.prototype.equal=zv.prototype.equal=function(e){return $f(this,e)}};var GJ=Ju.prototype.equal,zJ=zv.prototype.equal;$f.restore=function(){Ju.prototype.equal=GJ,zv.prototype.equal=zJ}});var Kv=_((ODe,hC)=>{d();var za=Ua().Buffer,on=K("crypto"),aC=nC(),sC=K("util"),VJ=`"%s" is not a valid algorithm.
4
4
  Supported algorithms are:
5
5
  "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Yu="secret must be a string or buffer",Ga="key must be a string or a buffer",BJ="key must be a string, a buffer or an object",Bv=typeof on.createPublicKey=="function";Bv&&(Ga+=" or a KeyObject",Yu+="or a KeyObject");function cC(t){if(!za.isBuffer(t)&&typeof t!="string"&&(!Bv||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw xn(Ga)}function uC(t){if(!za.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw xn(BJ)}function ZJ(t){if(!za.isBuffer(t)){if(typeof t=="string")return t;if(!Bv||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw xn(Yu)}}function Zv(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lC(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}function xn(t){var e=[].slice.call(arguments,1),r=sC.format.bind(sC,t).apply(null,e);return new TypeError(r)}function KJ(t){return za.isBuffer(t)||typeof t=="string"}function Xu(t){return KJ(t)||(t=JSON.stringify(t)),t}function dC(t){return function(r,n){ZJ(n),r=Xu(r);var i=on.createHmac("sha"+t,n),o=(i.update(r),i.digest("base64"));return Zv(o)}}var Vv,HJ="timingSafeEqual"in on?function(e,r){return e.byteLength!==r.byteLength?!1:on.timingSafeEqual(e,r)}:function(e,r){return Vv||(Vv=oC()),Vv(e,r)};function WJ(t){return function(r,n,i){var o=dC(t)(r,i);return HJ(za.from(n),za.from(o))}}function pC(t){return function(r,n){uC(n),r=Xu(r);var i=on.createSign("RSA-SHA"+t),o=(i.update(r),i.sign(n,"base64"));return Zv(o)}}function fC(t){return function(r,n,i){cC(i),r=Xu(r),n=lC(n);var o=on.createVerify("RSA-SHA"+t);return o.update(r),o.verify(i,n,"base64")}}function QJ(t){return function(r,n){uC(n),r=Xu(r);var i=on.createSign("RSA-SHA"+t),o=(i.update(r),i.sign({key:n,padding:on.constants.RSA_PKCS1_PSS_PADDING,saltLength:on.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Zv(o)}}function JJ(t){return function(r,n,i){cC(i),r=Xu(r),n=lC(n);var o=on.createVerify("RSA-SHA"+t);return o.update(r),o.verify({key:i,padding:on.constants.RSA_PKCS1_PSS_PADDING,saltLength:on.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function YJ(t){var e=pC(t);return function(){var n=e.apply(null,arguments);return n=aC.derToJose(n,"ES"+t),n}}function XJ(t){var e=fC(t);return function(n,i,o){i=aC.joseToDer(i,"ES"+t).toString("base64");var s=e(n,i,o);return s}}function eY(){return function(){return""}}function tY(){return function(e,r){return r===""}}hC.exports=function(e){var r={hs:dC,rs:pC,ps:QJ,es:YJ,none:eY},n={hs:WJ,rs:fC,ps:JJ,es:XJ,none:tY},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw xn(VJ,e);var o=(i[1]||i[3]).toLowerCase(),s=i[2];return{sign:r[o](s),verify:n[o](s)}}});var Hv=_((NDe,mC)=>{d();var rY=K("buffer").Buffer;mC.exports=function(e){return typeof e=="string"?e:typeof e=="number"||rY.isBuffer(e)?e.toString():JSON.stringify(e)}});var bC=_((xDe,EC)=>{d();var nY=Ua().Buffer,gC=Uv(),iY=Kv(),oY=K("stream"),yC=Hv(),Wv=K("util");function _C(t,e){return nY.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function sY(t,e,r){r=r||"utf8";var n=_C(yC(t),"binary"),i=_C(yC(e),r);return Wv.format("%s.%s",n,i)}function vC(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,o=iY(e.alg),s=sY(e,r,i),a=o.sign(s,n);return Wv.format("%s.%s",s,a)}function qf(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new gC(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new gC(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}Wv.inherits(qf,oY);qf.prototype.sign=function(){try{var e=vC({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};qf.sign=vC;EC.exports=qf});var RC=_((CDe,xC)=>{d();var SC=Ua().Buffer,TC=Uv(),aY=Kv(),cY=K("stream"),wC=Hv(),uY=K("util"),lY=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function dY(t){return Object.prototype.toString.call(t)==="[object Object]"}function pY(t){if(dY(t))return t;try{return JSON.parse(t)}catch{return}}function IC(t){var e=t.split(".",1)[0];return pY(SC.from(e,"base64").toString("binary"))}function fY(t){return t.split(".",2).join(".")}function OC(t){return t.split(".")[2]}function hY(t,e){e=e||"utf8";var r=t.split(".")[1];return SC.from(r,"base64").toString(e)}function AC(t){return lY.test(t)&&!!IC(t)}function NC(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=wC(t);var i=OC(t),o=fY(t),s=aY(e);return s.verify(o,i,r)}function PC(t,e){if(e=e||{},t=wC(t),!AC(t))return null;var r=IC(t);if(!r)return null;var n=hY(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:OC(t)}}function Va(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new TC(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new TC(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}uY.inherits(Va,cY);Va.prototype.verify=function(){try{var e=NC(this.signature.buffer,this.algorithm,this.key.buffer),r=PC(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Va.decode=PC;Va.isValid=AC;Va.verify=NC;xC.exports=Va});var Uf=_(co=>{d();var CC=bC(),Ff=RC(),mY=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];co.ALGORITHMS=mY;co.sign=CC.sign;co.verify=Ff.verify;co.decode=Ff.decode;co.isValid=Ff.isValid;co.createSign=function(e){return new CC(e)};co.createVerify=function(e){return new Ff(e)}});var Qv=_((jDe,DC)=>{d();var gY=Uf();DC.exports=function(t,e){e=e||{};var r=gY.decode(t,e);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return e.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var el=_(($De,kC)=>{d();var Gf=function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)};Gf.prototype=Object.create(Error.prototype);Gf.prototype.constructor=Gf;kC.exports=Gf});var Jv=_((FDe,jC)=>{d();var LC=el(),zf=function(t,e){LC.call(this,t),this.name="NotBeforeError",this.date=e};zf.prototype=Object.create(LC.prototype);zf.prototype.constructor=zf;jC.exports=zf});var Yv=_((GDe,$C)=>{d();var MC=el(),Vf=function(t,e){MC.call(this,t),this.name="TokenExpiredError",this.expiredAt=e};Vf.prototype=Object.create(MC.prototype);Vf.prototype.constructor=Vf;$C.exports=Vf});var FC=_((VDe,qC)=>{d();var Ba=1e3,Za=Ba*60,Ka=Za*60,hs=Ka*24,yY=hs*7,_Y=hs*365.25;qC.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return vY(t);if(r==="number"&&isFinite(t))return e.long?bY(t):EY(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function vY(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*_Y;case"weeks":case"week":case"w":return r*yY;case"days":case"day":case"d":return r*hs;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ka;case"minutes":case"minute":case"mins":case"min":case"m":return r*Za;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ba;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function EY(t){var e=Math.abs(t);return e>=hs?Math.round(t/hs)+"d":e>=Ka?Math.round(t/Ka)+"h":e>=Za?Math.round(t/Za)+"m":e>=Ba?Math.round(t/Ba)+"s":t+"ms"}function bY(t){var e=Math.abs(t);return e>=hs?Bf(t,e,hs,"day"):e>=Ka?Bf(t,e,Ka,"hour"):e>=Za?Bf(t,e,Za,"minute"):e>=Ba?Bf(t,e,Ba,"second"):t+" ms"}function Bf(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Xv=_((ZDe,UC)=>{d();var TY=FC();UC.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=TY(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Ha=_((HDe,GC)=>{"use strict";d();var SY="2.0.0",wY=Number.MAX_SAFE_INTEGER||9007199254740991,IY=16,OY=250,AY=["major","premajor","minor","preminor","patch","prepatch","prerelease"];GC.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:IY,MAX_SAFE_BUILD_LENGTH:OY,MAX_SAFE_INTEGER:wY,RELEASE_TYPES:AY,SEMVER_SPEC_VERSION:SY,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var tl=_((QDe,zC)=>{"use strict";d();var NY=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};zC.exports=NY});var Wa=_((ri,VC)=>{"use strict";d();var{MAX_SAFE_COMPONENT_LENGTH:eE,MAX_SAFE_BUILD_LENGTH:PY,MAX_LENGTH:xY}=Ha(),RY=tl();ri=VC.exports={};var CY=ri.re=[],DY=ri.safeRe=[],B=ri.src=[],kY=ri.safeSrc=[],Z=ri.t={},LY=0,tE="[a-zA-Z0-9-]",jY=[["\\s",1],["\\d",xY],[tE,PY]],MY=t=>{for(let[e,r]of jY)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},pe=(t,e,r)=>{let n=MY(e),i=LY++;RY(t,i,e),Z[t]=i,B[i]=e,kY[i]=n,CY[i]=new RegExp(e,r?"g":void 0),DY[i]=new RegExp(n,r?"g":void 0)};pe("NUMERICIDENTIFIER","0|[1-9]\\d*");pe("NUMERICIDENTIFIERLOOSE","\\d+");pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${tE}*`);pe("MAINVERSION",`(${B[Z.NUMERICIDENTIFIER]})\\.(${B[Z.NUMERICIDENTIFIER]})\\.(${B[Z.NUMERICIDENTIFIER]})`);pe("MAINVERSIONLOOSE",`(${B[Z.NUMERICIDENTIFIERLOOSE]})\\.(${B[Z.NUMERICIDENTIFIERLOOSE]})\\.(${B[Z.NUMERICIDENTIFIERLOOSE]})`);pe("PRERELEASEIDENTIFIER",`(?:${B[Z.NONNUMERICIDENTIFIER]}|${B[Z.NUMERICIDENTIFIER]})`);pe("PRERELEASEIDENTIFIERLOOSE",`(?:${B[Z.NONNUMERICIDENTIFIER]}|${B[Z.NUMERICIDENTIFIERLOOSE]})`);pe("PRERELEASE",`(?:-(${B[Z.PRERELEASEIDENTIFIER]}(?:\\.${B[Z.PRERELEASEIDENTIFIER]})*))`);pe("PRERELEASELOOSE",`(?:-?(${B[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${B[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);pe("BUILDIDENTIFIER",`${tE}+`);pe("BUILD",`(?:\\+(${B[Z.BUILDIDENTIFIER]}(?:\\.${B[Z.BUILDIDENTIFIER]})*))`);pe("FULLPLAIN",`v?${B[Z.MAINVERSION]}${B[Z.PRERELEASE]}?${B[Z.BUILD]}?`);pe("FULL",`^${B[Z.FULLPLAIN]}$`);pe("LOOSEPLAIN",`[v=\\s]*${B[Z.MAINVERSIONLOOSE]}${B[Z.PRERELEASELOOSE]}?${B[Z.BUILD]}?`);pe("LOOSE",`^${B[Z.LOOSEPLAIN]}$`);pe("GTLT","((?:<|>)?=?)");pe("XRANGEIDENTIFIERLOOSE",`${B[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);pe("XRANGEIDENTIFIER",`${B[Z.NUMERICIDENTIFIER]}|x|X|\\*`);pe("XRANGEPLAIN",`[v=\\s]*(${B[Z.XRANGEIDENTIFIER]})(?:\\.(${B[Z.XRANGEIDENTIFIER]})(?:\\.(${B[Z.XRANGEIDENTIFIER]})(?:${B[Z.PRERELEASE]})?${B[Z.BUILD]}?)?)?`);pe("XRANGEPLAINLOOSE",`[v=\\s]*(${B[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${B[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${B[Z.XRANGEIDENTIFIERLOOSE]})(?:${B[Z.PRERELEASELOOSE]})?${B[Z.BUILD]}?)?)?`);pe("XRANGE",`^${B[Z.GTLT]}\\s*${B[Z.XRANGEPLAIN]}$`);pe("XRANGELOOSE",`^${B[Z.GTLT]}\\s*${B[Z.XRANGEPLAINLOOSE]}$`);pe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${eE}})(?:\\.(\\d{1,${eE}}))?(?:\\.(\\d{1,${eE}}))?`);pe("COERCE",`${B[Z.COERCEPLAIN]}(?:$|[^\\d])`);pe("COERCEFULL",B[Z.COERCEPLAIN]+`(?:${B[Z.PRERELEASE]})?(?:${B[Z.BUILD]})?(?:$|[^\\d])`);pe("COERCERTL",B[Z.COERCE],!0);pe("COERCERTLFULL",B[Z.COERCEFULL],!0);pe("LONETILDE","(?:~>?)");pe("TILDETRIM",`(\\s*)${B[Z.LONETILDE]}\\s+`,!0);ri.tildeTrimReplace="$1~";pe("TILDE",`^${B[Z.LONETILDE]}${B[Z.XRANGEPLAIN]}$`);pe("TILDELOOSE",`^${B[Z.LONETILDE]}${B[Z.XRANGEPLAINLOOSE]}$`);pe("LONECARET","(?:\\^)");pe("CARETTRIM",`(\\s*)${B[Z.LONECARET]}\\s+`,!0);ri.caretTrimReplace="$1^";pe("CARET",`^${B[Z.LONECARET]}${B[Z.XRANGEPLAIN]}$`);pe("CARETLOOSE",`^${B[Z.LONECARET]}${B[Z.XRANGEPLAINLOOSE]}$`);pe("COMPARATORLOOSE",`^${B[Z.GTLT]}\\s*(${B[Z.LOOSEPLAIN]})$|^$`);pe("COMPARATOR",`^${B[Z.GTLT]}\\s*(${B[Z.FULLPLAIN]})$|^$`);pe("COMPARATORTRIM",`(\\s*)${B[Z.GTLT]}\\s*(${B[Z.LOOSEPLAIN]}|${B[Z.XRANGEPLAIN]})`,!0);ri.comparatorTrimReplace="$1$2$3";pe("HYPHENRANGE",`^\\s*(${B[Z.XRANGEPLAIN]})\\s+-\\s+(${B[Z.XRANGEPLAIN]})\\s*$`);pe("HYPHENRANGELOOSE",`^\\s*(${B[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${B[Z.XRANGEPLAINLOOSE]})\\s*$`);pe("STAR","(<|>)?=?\\s*\\*");pe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");pe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Zf=_((XDe,BC)=>{"use strict";d();var $Y=Object.freeze({loose:!0}),qY=Object.freeze({}),FY=t=>t?typeof t!="object"?$Y:t:qY;BC.exports=FY});var rE=_((tke,HC)=>{"use strict";d();var ZC=/^[0-9]+$/,KC=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=ZC.test(t),n=ZC.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},UY=(t,e)=>KC(e,t);HC.exports={compareIdentifiers:KC,rcompareIdentifiers:UY}});var Wt=_((nke,QC)=>{"use strict";d();var Kf=tl(),{MAX_LENGTH:WC,MAX_SAFE_INTEGER:Hf}=Ha(),{safeRe:Wf,t:Qf}=Wa(),GY=Zf(),{compareIdentifiers:nE}=rE(),iE=class t{constructor(e,r){if(r=GY(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>WC)throw new TypeError(`version is longer than ${WC} characters`);Kf("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Wf[Qf.LOOSE]:Wf[Qf.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Hf||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hf||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hf||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<Hf)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Kf("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(Kf("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return nE(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(Kf("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return nE(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Wf[Qf.PRERELEASELOOSE]:Wf[Qf.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),nE(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};QC.exports=iE});var uo=_((oke,YC)=>{"use strict";d();var JC=Wt(),zY=(t,e,r=!1)=>{if(t instanceof JC)return t;try{return new JC(t,e)}catch(n){if(!r)return null;throw n}};YC.exports=zY});var eD=_((ake,XC)=>{"use strict";d();var VY=uo(),BY=(t,e)=>{let r=VY(t,e);return r?r.version:null};XC.exports=BY});var rD=_((uke,tD)=>{"use strict";d();var ZY=uo(),KY=(t,e)=>{let r=ZY(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};tD.exports=KY});var oD=_((dke,iD)=>{"use strict";d();var nD=Wt(),HY=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new nD(t instanceof nD?t.version:t,r).inc(e,n,i).version}catch{return null}};iD.exports=HY});var cD=_((fke,aD)=>{"use strict";d();var sD=uo(),WY=(t,e)=>{let r=sD(t,null,!0),n=sD(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};aD.exports=WY});var lD=_((mke,uD)=>{"use strict";d();var QY=Wt(),JY=(t,e)=>new QY(t,e).major;uD.exports=JY});var pD=_((yke,dD)=>{"use strict";d();var YY=Wt(),XY=(t,e)=>new YY(t,e).minor;dD.exports=XY});var hD=_((vke,fD)=>{"use strict";d();var e3=Wt(),t3=(t,e)=>new e3(t,e).patch;fD.exports=t3});var gD=_((bke,mD)=>{"use strict";d();var r3=uo(),n3=(t,e)=>{let r=r3(t,e);return r&&r.prerelease.length?r.prerelease:null};mD.exports=n3});var sn=_((Ske,_D)=>{"use strict";d();var yD=Wt(),i3=(t,e,r)=>new yD(t,r).compare(new yD(e,r));_D.exports=i3});var ED=_((Ike,vD)=>{"use strict";d();var o3=sn(),s3=(t,e,r)=>o3(e,t,r);vD.exports=s3});var TD=_((Ake,bD)=>{"use strict";d();var a3=sn(),c3=(t,e)=>a3(t,e,!0);bD.exports=c3});var Jf=_((Pke,wD)=>{"use strict";d();var SD=Wt(),u3=(t,e,r)=>{let n=new SD(t,r),i=new SD(e,r);return n.compare(i)||n.compareBuild(i)};wD.exports=u3});var OD=_((Rke,ID)=>{"use strict";d();var l3=Jf(),d3=(t,e)=>t.sort((r,n)=>l3(r,n,e));ID.exports=d3});var ND=_((Dke,AD)=>{"use strict";d();var p3=Jf(),f3=(t,e)=>t.sort((r,n)=>p3(n,r,e));AD.exports=f3});var rl=_((Lke,PD)=>{"use strict";d();var h3=sn(),m3=(t,e,r)=>h3(t,e,r)>0;PD.exports=m3});var Yf=_((Mke,xD)=>{"use strict";d();var g3=sn(),y3=(t,e,r)=>g3(t,e,r)<0;xD.exports=y3});var oE=_((qke,RD)=>{"use strict";d();var _3=sn(),v3=(t,e,r)=>_3(t,e,r)===0;RD.exports=v3});var sE=_((Uke,CD)=>{"use strict";d();var E3=sn(),b3=(t,e,r)=>E3(t,e,r)!==0;CD.exports=b3});var Xf=_((zke,DD)=>{"use strict";d();var T3=sn(),S3=(t,e,r)=>T3(t,e,r)>=0;DD.exports=S3});var eh=_((Bke,kD)=>{"use strict";d();var w3=sn(),I3=(t,e,r)=>w3(t,e,r)<=0;kD.exports=I3});var aE=_((Kke,LD)=>{"use strict";d();var O3=oE(),A3=sE(),N3=rl(),P3=Xf(),x3=Yf(),R3=eh(),C3=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return O3(t,r,n);case"!=":return A3(t,r,n);case">":return N3(t,r,n);case">=":return P3(t,r,n);case"<":return x3(t,r,n);case"<=":return R3(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};LD.exports=C3});var MD=_((Wke,jD)=>{"use strict";d();var D3=Wt(),k3=uo(),{safeRe:th,t:rh}=Wa(),L3=(t,e)=>{if(t instanceof D3)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?th[rh.COERCEFULL]:th[rh.COERCE]);else{let c=e.includePrerelease?th[rh.COERCERTLFULL]:th[rh.COERCERTL],u;for(;(u=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return k3(`${n}.${i}.${o}${s}${a}`,e)};jD.exports=L3});var qD=_((Jke,$D)=>{"use strict";d();var j3=uo(),M3=Ha(),$3=Wt(),q3=(t,e,r)=>{if(!M3.RELEASE_TYPES.includes(e))return null;let n=F3(t,r);return n&&U3(n,e)},F3=(t,e)=>{let r=t instanceof $3?t.version:t;return j3(r,e)},U3=(t,e)=>{if(G3(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},G3=t=>t.startsWith("pre");$D.exports=q3});var UD=_((Xke,FD)=>{"use strict";d();var cE=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};FD.exports=cE});var an=_((tLe,BD)=>{"use strict";d();var z3=/\s+/g,uE=class t{constructor(e,r){if(r=B3(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof lE)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(z3," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!zD(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&e6(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(X3,"");let n=((this.options.includePrerelease&&J3)|(this.options.loose&&Y3))+":"+e,i=GD.get(n);if(i)return i;let o=this.options.loose,s=o?vr[Qt.HYPHENRANGELOOSE]:vr[Qt.HYPHENRANGE];e=e.replace(s,l6(this.options.includePrerelease)),lt("hyphen replace",e),e=e.replace(vr[Qt.COMPARATORTRIM],H3),lt("comparator trim",e),e=e.replace(vr[Qt.TILDETRIM],W3),lt("tilde trim",e),e=e.replace(vr[Qt.CARETTRIM],Q3),lt("caret trim",e);let a=e.split(" ").map(p=>t6(p,this.options)).join(" ").split(/\s+/).map(p=>u6(p,this.options));o&&(a=a.filter(p=>(lt("loose invalid filter",p,this.options),!!p.match(vr[Qt.COMPARATORLOOSE])))),lt("range list",a);let c=new Map,u=a.map(p=>new lE(p,this.options));for(let p of u){if(zD(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return GD.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>VD(n,r)&&e.set.some(i=>VD(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Z3(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(d6(this.set[r],e,this.options))return!0;return!1}};BD.exports=uE;var V3=UD(),GD=new V3,B3=Zf(),lE=nl(),lt=tl(),Z3=Wt(),{safeRe:vr,src:K3,t:Qt,comparatorTrimReplace:H3,tildeTrimReplace:W3,caretTrimReplace:Q3}=Wa(),{FLAG_INCLUDE_PRERELEASE:J3,FLAG_LOOSE:Y3}=Ha(),X3=new RegExp(K3[Qt.BUILD],"g"),zD=t=>t.value==="<0.0.0-0",e6=t=>t.value==="",VD=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},t6=(t,e)=>(t=t.replace(vr[Qt.BUILD],""),lt("comp",t,e),t=i6(t,e),lt("caret",t),t=r6(t,e),lt("tildes",t),t=s6(t,e),lt("xrange",t),t=c6(t,e),lt("stars",t),t),Er=t=>!t||t.toLowerCase()==="x"||t==="*",r6=(t,e)=>t.trim().split(/\s+/).map(r=>n6(r,e)).join(" "),n6=(t,e)=>{let r=e.loose?vr[Qt.TILDELOOSE]:vr[Qt.TILDE];return t.replace(r,(n,i,o,s,a)=>{lt("tilde",t,n,i,o,s,a);let c;return Er(i)?c="":Er(o)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:Er(s)?c=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(lt("replaceTilde pr",a),c=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):c=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,lt("tilde return",c),c})},i6=(t,e)=>t.trim().split(/\s+/).map(r=>o6(r,e)).join(" "),o6=(t,e)=>{lt("caret",t,e);let r=e.loose?vr[Qt.CARETLOOSE]:vr[Qt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,c)=>{lt("caret",t,i,o,s,a,c);let u;return Er(o)?u="":Er(s)?u=`>=${o}.0.0${n} <${+o+1}.0.0-0`:Er(a)?o==="0"?u=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(lt("replaceCaret pr",c),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(lt("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),lt("caret return",u),u})},s6=(t,e)=>(lt("replaceXRanges",t,e),t.split(/\s+/).map(r=>a6(r,e)).join(" ")),a6=(t,e)=>{t=t.trim();let r=e.loose?vr[Qt.XRANGELOOSE]:vr[Qt.XRANGE];return t.replace(r,(n,i,o,s,a,c)=>{lt("xRange",t,n,i,o,s,a,c);let u=Er(o),l=u||Er(s),p=l||Er(a),f=p;return i==="="&&f&&(i=""),c=e.includePrerelease?"-0":"",u?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):l?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:p&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),lt("xRange return",n),n})},c6=(t,e)=>(lt("replaceStars",t,e),t.trim().replace(vr[Qt.STAR],"")),u6=(t,e)=>(lt("replaceGTE0",t,e),t.trim().replace(vr[e.includePrerelease?Qt.GTE0PRE:Qt.GTE0],"")),l6=t=>(e,r,n,i,o,s,a,c,u,l,p,f)=>(Er(n)?r="":Er(i)?r=`>=${n}.0.0${t?"-0":""}`:Er(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Er(u)?c="":Er(l)?c=`<${+u+1}.0.0-0`:Er(p)?c=`<${u}.${+l+1}.0-0`:f?c=`<=${u}.${l}.${p}-${f}`:t?c=`<${u}.${l}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),d6=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(lt(t[n].semver),t[n].semver!==lE.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var nl=_((nLe,JD)=>{"use strict";d();var il=Symbol("SemVer ANY"),fE=class t{static get ANY(){return il}constructor(e,r){if(r=ZD(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),pE("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===il?this.value="":this.value=this.operator+this.semver.version,pE("comp",this)}parse(e){let r=this.options.loose?KD[HD.COMPARATORLOOSE]:KD[HD.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new WD(n[2],this.options.loose):this.semver=il}toString(){return this.value}test(e){if(pE("Comparator.test",e,this.options.loose),this.semver===il||e===il)return!0;if(typeof e=="string")try{e=new WD(e,this.options)}catch{return!1}return dE(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new QD(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new QD(this.value,r).test(e.semver):(r=ZD(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||dE(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||dE(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};JD.exports=fE;var ZD=Zf(),{safeRe:KD,t:HD}=Wa(),dE=aE(),pE=tl(),WD=Wt(),QD=an()});var ol=_((oLe,YD)=>{"use strict";d();var p6=an(),f6=(t,e,r)=>{try{e=new p6(e,r)}catch{return!1}return e.test(t)};YD.exports=f6});var ek=_((aLe,XD)=>{"use strict";d();var h6=an(),m6=(t,e)=>new h6(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));XD.exports=m6});var rk=_((uLe,tk)=>{"use strict";d();var g6=Wt(),y6=an(),_6=(t,e,r)=>{let n=null,i=null,o=null;try{o=new y6(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new g6(n,r))}),n};tk.exports=_6});var ik=_((dLe,nk)=>{"use strict";d();var v6=Wt(),E6=an(),b6=(t,e,r)=>{let n=null,i=null,o=null;try{o=new E6(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new v6(n,r))}),n};nk.exports=b6});var ak=_((fLe,sk)=>{"use strict";d();var hE=Wt(),T6=an(),ok=rl(),S6=(t,e)=>{t=new T6(t,e);let r=new hE("0.0.0");if(t.test(r)||(r=new hE("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new hE(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||ok(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||ok(r,o))&&(r=o)}return r&&t.test(r)?r:null};sk.exports=S6});var uk=_((mLe,ck)=>{"use strict";d();var w6=an(),I6=(t,e)=>{try{return new w6(t,e).range||"*"}catch{return null}};ck.exports=I6});var nh=_((yLe,fk)=>{"use strict";d();var O6=Wt(),pk=nl(),{ANY:A6}=pk,N6=an(),P6=ol(),lk=rl(),dk=Yf(),x6=eh(),R6=Xf(),C6=(t,e,r,n)=>{t=new O6(t,n),e=new N6(e,n);let i,o,s,a,c;switch(r){case">":i=lk,o=x6,s=dk,a=">",c=">=";break;case"<":i=dk,o=R6,s=lk,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P6(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],p=null,f=null;if(l.forEach(h=>{h.semver===A6&&(h=new pk(">=0.0.0")),p=p||h,f=f||h,i(h.semver,p.semver,n)?p=h:s(h.semver,f.semver,n)&&(f=h)}),p.operator===a||p.operator===c||(!f.operator||f.operator===a)&&o(t,f.semver))return!1;if(f.operator===c&&s(t,f.semver))return!1}return!0};fk.exports=C6});var mk=_((vLe,hk)=>{"use strict";d();var D6=nh(),k6=(t,e,r)=>D6(t,e,">",r);hk.exports=k6});var yk=_((bLe,gk)=>{"use strict";d();var L6=nh(),j6=(t,e,r)=>L6(t,e,"<",r);gk.exports=j6});var Ek=_((SLe,vk)=>{"use strict";d();var _k=an(),M6=(t,e,r)=>(t=new _k(t,r),e=new _k(e,r),t.intersects(e,r));vk.exports=M6});var Tk=_((ILe,bk)=>{"use strict";d();var $6=ol(),q6=sn();bk.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,p)=>q6(l,p,r));for(let l of s)$6(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,p]of n)l===p?a.push(l):!p&&l===s[0]?a.push("*"):p?l===s[0]?a.push(`<=${p}`):a.push(`${l} - ${p}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var Nk=_((ALe,Ak)=>{"use strict";d();var Sk=an(),yE=nl(),{ANY:mE}=yE,gE=ol(),_E=sn(),F6=(t,e,r={})=>{if(t===e)return!0;t=new Sk(t,r),e=new Sk(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=G6(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},U6=[new yE(">=0.0.0-0")],wk=[new yE(">=0.0.0")],G6=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===mE){if(e.length===1&&e[0].semver===mE)return!0;r.includePrerelease?t=U6:t=wk}if(e.length===1&&e[0].semver===mE){if(r.includePrerelease)return!0;e=wk}let n=new Set,i,o;for(let h of t)h.operator===">"||h.operator===">="?i=Ik(i,h,r):h.operator==="<"||h.operator==="<="?o=Ok(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=_E(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let h of n){if(i&&!gE(h,String(i),r)||o&&!gE(h,String(o),r))return null;for(let m of e)if(!gE(h,String(m),r))return!1;return!0}let a,c,u,l,p=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let h of e){if(l=l||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=Ik(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(o){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator==="<"||h.operator==="<="){if(c=Ok(o,h,r),c===h&&c!==o)return!1}else if(o.operator==="<="&&!h.test(o.semver))return!1}if(!h.operator&&(o||i)&&s!==0)return!1}return!(i&&u&&!o&&s!==0||o&&l&&!i&&s!==0||f||p)},Ik=(t,e,r)=>{if(!t)return e;let n=_E(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Ok=(t,e,r)=>{if(!t)return e;let n=_E(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Ak.exports=F6});var ih=_((PLe,Rk)=>{"use strict";d();var vE=Wa(),Pk=Ha(),z6=Wt(),xk=rE(),V6=uo(),B6=eD(),Z6=rD(),K6=oD(),H6=cD(),W6=lD(),Q6=pD(),J6=hD(),Y6=gD(),X6=sn(),e5=ED(),t5=TD(),r5=Jf(),n5=OD(),i5=ND(),o5=rl(),s5=Yf(),a5=oE(),c5=sE(),u5=Xf(),l5=eh(),d5=aE(),p5=MD(),f5=qD(),h5=nl(),m5=an(),g5=ol(),y5=ek(),_5=rk(),v5=ik(),E5=ak(),b5=uk(),T5=nh(),S5=mk(),w5=yk(),I5=Ek(),O5=Tk(),A5=Nk();Rk.exports={parse:V6,valid:B6,clean:Z6,inc:K6,diff:H6,major:W6,minor:Q6,patch:J6,prerelease:Y6,compare:X6,rcompare:e5,compareLoose:t5,compareBuild:r5,sort:n5,rsort:i5,gt:o5,lt:s5,eq:a5,neq:c5,gte:u5,lte:l5,cmp:d5,coerce:p5,truncate:f5,Comparator:h5,Range:m5,satisfies:g5,toComparators:y5,maxSatisfying:_5,minSatisfying:v5,minVersion:E5,validRange:b5,outside:T5,gtr:S5,ltr:w5,intersects:I5,simplifyRange:O5,subset:A5,SemVer:z6,re:vE.re,src:vE.src,tokens:vE.t,SEMVER_SPEC_VERSION:Pk.SEMVER_SPEC_VERSION,RELEASE_TYPES:Pk.RELEASE_TYPES,compareIdentifiers:xk.compareIdentifiers,rcompareIdentifiers:xk.rcompareIdentifiers}});var Dk=_((RLe,Ck)=>{d();var N5=ih();Ck.exports=N5.satisfies(process.version,">=15.7.0")});var Lk=_((DLe,kk)=>{d();var P5=ih();kk.exports=P5.satisfies(process.version,">=16.9.0")});var EE=_((LLe,jk)=>{d();var x5=Dk(),R5=Lk(),C5={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},D5={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};jk.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=C5[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(x5)switch(r){case"ec":let i=e.asymmetricKeyDetails.namedCurve,o=D5[t];if(i!==o)throw new Error(`"alg" parameter "${t}" requires curve "${o}".`);break;case"rsa-pss":if(R5){let s=parseInt(t.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:c,saltLength:u}=e.asymmetricKeyDetails;if(a!==`sha${s}`||c!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(u!==void 0&&u>s>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var bE=_((MLe,Mk)=>{d();var k5=ih();Mk.exports=k5.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Fk=_((qLe,qk)=>{d();var st=el(),L5=Jv(),$k=Yv(),j5=Qv(),M5=Xv(),$5=EE(),q5=bE(),F5=Uf(),{KeyObject:U5,createSecretKey:G5,createPublicKey:z5}=K("crypto"),TE=["RS256","RS384","RS512"],V5=["ES256","ES384","ES512"],SE=["RS256","RS384","RS512"],B5=["HS256","HS384","HS512"];q5&&(TE.splice(TE.length,0,"PS256","PS384","PS512"),SE.splice(SE.length,0,"PS256","PS384","PS512"));qk.exports=function(t,e,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let i;if(n?i=n:i=function(l,p){if(l)throw l;return p},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new st("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new st("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new st("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return i(new st("jwt must be provided"));if(typeof t!="string")return i(new st("jwt must be a string"));let s=t.split(".");if(s.length!==3)return i(new st("jwt malformed"));let a;try{a=j5(t,{complete:!0})}catch(l){return i(l)}if(!a)return i(new st("invalid token"));let c=a.header,u;if(typeof e=="function"){if(!n)return i(new st("verify must be called asynchronous if secret or public key is provided as a callback"));u=e}else u=function(l,p){return p(null,e)};return u(c,function(l,p){if(l)return i(new st("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&p)return i(new st("jwt signature is required"));if(f&&!p)return i(new st("secret or public key must be provided"));if(!f&&!r.algorithms)return i(new st('please specify "none" in "algorithms" to verify unsigned tokens'));if(p!=null&&!(p instanceof U5))try{p=z5(p)}catch{try{p=G5(typeof p=="string"?Buffer.from(p):p)}catch{return i(new st("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(p.type==="secret"?r.algorithms=B5:["rsa","rsa-pss"].includes(p.asymmetricKeyType)?r.algorithms=SE:p.asymmetricKeyType==="ec"?r.algorithms=V5:r.algorithms=TE),r.algorithms.indexOf(a.header.alg)===-1)return i(new st("invalid algorithm"));if(c.alg.startsWith("HS")&&p.type!=="secret")return i(new st(`secretOrPublicKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)&&p.type!=="public")return i(new st(`secretOrPublicKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{$5(c.alg,p)}catch(y){return i(y)}let h;try{h=F5.verify(t,a.header.alg,p)}catch(y){return i(y)}if(!h)return i(new st("invalid signature"));let m=a.payload;if(typeof m.nbf<"u"&&!r.ignoreNotBefore){if(typeof m.nbf!="number")return i(new st("invalid nbf value"));if(m.nbf>o+(r.clockTolerance||0))return i(new L5("jwt not active",new Date(m.nbf*1e3)))}if(typeof m.exp<"u"&&!r.ignoreExpiration){if(typeof m.exp!="number")return i(new st("invalid exp value"));if(o>=m.exp+(r.clockTolerance||0))return i(new $k("jwt expired",new Date(m.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(m.aud)?m.aud:[m.aud]).some(function(T){return y.some(function(S){return S instanceof RegExp?S.test(T):S===T})}))return i(new st("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&m.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(m.iss)===-1))return i(new st("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&m.sub!==r.subject)return i(new st("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&m.jti!==r.jwtid)return i(new st("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&m.nonce!==r.nonce)return i(new st("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof m.iat!="number")return i(new st("iat required when maxAge is specified"));let y=M5(r.maxAge,m.iat);if(typeof y>"u")return i(new st('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=y+(r.clockTolerance||0))return i(new $k("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=a.signature;return i(null,{header:c,payload:m,signature:y})}return i(null,m)})}});var Zk=_((ULe,Bk)=>{d();var Uk=1/0,zk=9007199254740991,Z5=17976931348623157e292,Gk=NaN,K5="[object Arguments]",H5="[object Function]",W5="[object GeneratorFunction]",Q5="[object String]",J5="[object Symbol]",Y5=/^\s+|\s+$/g,X5=/^[-+]0x[0-9a-f]+$/i,eX=/^0b[01]+$/i,tX=/^0o[0-7]+$/i,rX=/^(?:0|[1-9]\d*)$/,nX=parseInt;function iX(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function oX(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function sX(t,e,r){if(e!==e)return oX(t,aX,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function aX(t){return t!==t}function cX(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function uX(t,e){return iX(e,function(r){return t[r]})}function lX(t,e){return function(r){return t(e(r))}}var oh=Object.prototype,IE=oh.hasOwnProperty,sh=oh.toString,dX=oh.propertyIsEnumerable,pX=lX(Object.keys,Object),fX=Math.max;function hX(t,e){var r=Vk(t)||vX(t)?cX(t.length,String):[],n=r.length,i=!!n;for(var o in t)(e||IE.call(t,o))&&!(i&&(o=="length"||gX(o,n)))&&r.push(o);return r}function mX(t){if(!yX(t))return pX(t);var e=[];for(var r in Object(t))IE.call(t,r)&&r!="constructor"&&e.push(r);return e}function gX(t,e){return e=e??zk,!!e&&(typeof t=="number"||rX.test(t))&&t>-1&&t%1==0&&t<e}function yX(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||oh;return t===r}function _X(t,e,r,n){t=OE(t)?t:PX(t),r=r&&!n?OX(r):0;var i=t.length;return r<0&&(r=fX(i+r,0)),SX(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&sX(t,e,r)>-1}function vX(t){return EX(t)&&IE.call(t,"callee")&&(!dX.call(t,"callee")||sh.call(t)==K5)}var Vk=Array.isArray;function OE(t){return t!=null&&TX(t.length)&&!bX(t)}function EX(t){return AE(t)&&OE(t)}function bX(t){var e=wE(t)?sh.call(t):"";return e==H5||e==W5}function TX(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=zk}function wE(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function AE(t){return!!t&&typeof t=="object"}function SX(t){return typeof t=="string"||!Vk(t)&&AE(t)&&sh.call(t)==Q5}function wX(t){return typeof t=="symbol"||AE(t)&&sh.call(t)==J5}function IX(t){if(!t)return t===0?t:0;if(t=AX(t),t===Uk||t===-Uk){var e=t<0?-1:1;return e*Z5}return t===t?t:0}function OX(t){var e=IX(t),r=e%1;return e===e?r?e-r:e:0}function AX(t){if(typeof t=="number")return t;if(wX(t))return Gk;if(wE(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=wE(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Y5,"");var r=eX.test(t);return r||tX.test(t)?nX(t.slice(2),r?2:8):X5.test(t)?Gk:+t}function NX(t){return OE(t)?hX(t):mX(t)}function PX(t){return t?uX(t,NX(t)):[]}Bk.exports=_X});var Hk=_((zLe,Kk)=>{d();var xX="[object Boolean]",RX=Object.prototype,CX=RX.toString;function DX(t){return t===!0||t===!1||kX(t)&&CX.call(t)==xX}function kX(t){return!!t&&typeof t=="object"}Kk.exports=DX});var Xk=_((BLe,Yk)=>{d();var Wk=1/0,LX=17976931348623157e292,Qk=NaN,jX="[object Symbol]",MX=/^\s+|\s+$/g,$X=/^[-+]0x[0-9a-f]+$/i,qX=/^0b[01]+$/i,FX=/^0o[0-7]+$/i,UX=parseInt,GX=Object.prototype,zX=GX.toString;function VX(t){return typeof t=="number"&&t==HX(t)}function Jk(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function BX(t){return!!t&&typeof t=="object"}function ZX(t){return typeof t=="symbol"||BX(t)&&zX.call(t)==jX}function KX(t){if(!t)return t===0?t:0;if(t=WX(t),t===Wk||t===-Wk){var e=t<0?-1:1;return e*LX}return t===t?t:0}function HX(t){var e=KX(t),r=e%1;return e===e?r?e-r:e:0}function WX(t){if(typeof t=="number")return t;if(ZX(t))return Qk;if(Jk(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Jk(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(MX,"");var r=qX.test(t);return r||FX.test(t)?UX(t.slice(2),r?2:8):$X.test(t)?Qk:+t}Yk.exports=VX});var tL=_((KLe,eL)=>{d();var QX="[object Number]",JX=Object.prototype,YX=JX.toString;function XX(t){return!!t&&typeof t=="object"}function e8(t){return typeof t=="number"||XX(t)&&YX.call(t)==QX}eL.exports=e8});var oL=_((WLe,iL)=>{d();var t8="[object Object]";function r8(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function n8(t,e){return function(r){return t(e(r))}}var i8=Function.prototype,rL=Object.prototype,nL=i8.toString,o8=rL.hasOwnProperty,s8=nL.call(Object),a8=rL.toString,c8=n8(Object.getPrototypeOf,Object);function u8(t){return!!t&&typeof t=="object"}function l8(t){if(!u8(t)||a8.call(t)!=t8||r8(t))return!1;var e=c8(t);if(e===null)return!0;var r=o8.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&nL.call(r)==s8}iL.exports=l8});var aL=_((JLe,sL)=>{d();var d8="[object String]",p8=Object.prototype,f8=p8.toString,h8=Array.isArray;function m8(t){return!!t&&typeof t=="object"}function g8(t){return typeof t=="string"||!h8(t)&&m8(t)&&f8.call(t)==d8}sL.exports=g8});var pL=_((XLe,dL)=>{d();var y8="Expected a function",cL=1/0,_8=17976931348623157e292,uL=NaN,v8="[object Symbol]",E8=/^\s+|\s+$/g,b8=/^[-+]0x[0-9a-f]+$/i,T8=/^0b[01]+$/i,S8=/^0o[0-7]+$/i,w8=parseInt,I8=Object.prototype,O8=I8.toString;function A8(t,e){var r;if(typeof e!="function")throw new TypeError(y8);return t=C8(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}function N8(t){return A8(2,t)}function lL(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function P8(t){return!!t&&typeof t=="object"}function x8(t){return typeof t=="symbol"||P8(t)&&O8.call(t)==v8}function R8(t){if(!t)return t===0?t:0;if(t=D8(t),t===cL||t===-cL){var e=t<0?-1:1;return e*_8}return t===t?t:0}function C8(t){var e=R8(t),r=e%1;return e===e?r?e-r:e:0}function D8(t){if(typeof t=="number")return t;if(x8(t))return uL;if(lL(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=lL(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(E8,"");var r=T8.test(t);return r||S8.test(t)?w8(t.slice(2),r?2:8):b8.test(t)?uL:+t}dL.exports=N8});var bL=_((tje,EL)=>{d();var fL=Xv(),k8=bE(),L8=EE(),hL=Uf(),j8=Zk(),ah=Hk(),mL=Xk(),NE=tL(),yL=oL(),lo=aL(),M8=pL(),{KeyObject:$8,createSecretKey:q8,createPrivateKey:F8}=K("crypto"),_L=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];k8&&_L.splice(3,0,"PS256","PS384","PS512");var U8={expiresIn:{isValid:function(t){return mL(t)||lo(t)&&t},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(t){return mL(t)||lo(t)&&t},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(t){return lo(t)||Array.isArray(t)},message:'"audience" must be a string or array'},algorithm:{isValid:j8.bind(null,_L),message:'"algorithm" must be a valid string enum value'},header:{isValid:yL,message:'"header" must be an object'},encoding:{isValid:lo,message:'"encoding" must be a string'},issuer:{isValid:lo,message:'"issuer" must be a string'},subject:{isValid:lo,message:'"subject" must be a string'},jwtid:{isValid:lo,message:'"jwtid" must be a string'},noTimestamp:{isValid:ah,message:'"noTimestamp" must be a boolean'},keyid:{isValid:lo,message:'"keyid" must be a string'},mutatePayload:{isValid:ah,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:ah,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:ah,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},G8={iat:{isValid:NE,message:'"iat" should be a number of seconds'},exp:{isValid:NE,message:'"exp" should be a number of seconds'},nbf:{isValid:NE,message:'"nbf" should be a number of seconds'}};function vL(t,e,r,n){if(!yL(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=t[i];if(!o){if(!e)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw new Error(o.message)})}function z8(t){return vL(U8,!1,t,"options")}function V8(t){return vL(G8,!0,t,"payload")}var gL={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},B8=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];EL.exports=function(t,e,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let i=typeof t=="object"&&!Buffer.isBuffer(t),o=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function s(u){if(n)return n(u);throw u}if(!e&&r.algorithm!=="none")return s(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof $8))try{e=F8(e)}catch{try{e=q8(typeof e=="string"?Buffer.from(e):e)}catch{return s(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&e.type!=="secret")return s(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(e.type!=="private")return s(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!r.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return s(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof t>"u")return s(new Error("payload is required"));if(i){try{V8(t)}catch(u){return s(u)}r.mutatePayload||(t=Object.assign({},t))}else{let u=B8.filter(function(l){return typeof r[l]<"u"});if(u.length>0)return s(new Error("invalid "+u.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return s(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return s(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{z8(r)}catch(u){return s(u)}if(!r.allowInvalidAsymmetricKeyTypes)try{L8(o.alg,e)}catch(u){return s(u)}let a=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:i&&(t.iat=a),typeof r.notBefore<"u"){try{t.nbf=fL(r.notBefore,a)}catch(u){return s(u)}if(typeof t.nbf>"u")return s(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=fL(r.expiresIn,a)}catch(u){return s(u)}if(typeof t.exp>"u")return s(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(gL).forEach(function(u){let l=gL[u];if(typeof r[u]<"u"){if(typeof t[l]<"u")return s(new Error('Bad "options.'+u+'" option. The payload already has an "'+l+'" property.'));t[l]=r[u]}});let c=r.encoding||"utf8";if(typeof n=="function")n=n&&M8(n),hL.createSign({header:o,privateKey:e,payload:t,encoding:c}).once("error",n).once("done",function(u){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&u.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));n(null,u)});else{let u=hL.sign({header:o,payload:t,secret:e,encoding:c});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&u.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return u}}});var sl=_((nje,TL)=>{d();TL.exports={decode:Qv(),verify:Fk(),sign:bL(),JsonWebTokenError:el(),NotBeforeError:Jv(),TokenExpiredError:Yv()}});var kL=_(Ja=>{"use strict";d();Object.defineProperty(Ja,"__esModule",{value:!0});Ja.versionInfo=Ja.version=void 0;var h7="15.10.2";Ja.version=h7;var m7=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});Ja.versionInfo=m7});var mh=_(jE=>{"use strict";d();Object.defineProperty(jE,"__esModule",{value:!0});jE.default=g7;function g7(t){return typeof t?.then=="function"}});var cn=_(ME=>{"use strict";d();Object.defineProperty(ME,"__esModule",{value:!0});ME.default=y7;function y7(t,e){var r=!!t;if(!r)throw new Error(e)}});var ii=_($E=>{"use strict";d();Object.defineProperty($E,"__esModule",{value:!0});$E.default=_7;function gh(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gh=function(r){return typeof r}:gh=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},gh(t)}function _7(t){return gh(t)=="object"&&t!==null}});var oi=_(fo=>{"use strict";d();Object.defineProperty(fo,"__esModule",{value:!0});fo.SYMBOL_TO_STRING_TAG=fo.SYMBOL_ASYNC_ITERATOR=fo.SYMBOL_ITERATOR=void 0;var v7=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";fo.SYMBOL_ITERATOR=v7;var E7=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";fo.SYMBOL_ASYNC_ITERATOR=E7;var b7=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";fo.SYMBOL_TO_STRING_TAG=b7});var yh=_(qE=>{"use strict";d();Object.defineProperty(qE,"__esModule",{value:!0});qE.getLocation=T7;function T7(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,o;(o=r.exec(t.body))&&o.index<e;)n+=1,i=e+1-(o.index+o[0].length);return{line:n,column:i}}});var FE=_(vh=>{"use strict";d();Object.defineProperty(vh,"__esModule",{value:!0});vh.printLocation=w7;vh.printSourceLocation=jL;var S7=yh();function w7(t){return jL(t.source,(0,S7.getLocation)(t.source,t.start))}function jL(t,e){var r=t.locationOffset.column-1,n=_h(r)+t.body,i=e.line-1,o=t.locationOffset.line-1,s=e.line+o,a=e.line===1?r:0,c=e.column+a,u="".concat(t.name,":").concat(s,":").concat(c,`
6
6
  `),l=n.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){for(var f=Math.floor(c/80),h=c%80,m=[],y=0;y<p.length;y+=80)m.push(p.slice(y,y+80));return u+LL([["".concat(s),m[0]]].concat(m.slice(1,f+1).map(function(v){return["",v]}),[[" ",_h(h-1)+"^"],["",m[f+1]]]))}return u+LL([["".concat(s-1),l[i-1]],["".concat(s),p],["",_h(c-1)+"^"],["".concat(s+1),l[i+1]]])}function LL(t){var e=t.filter(function(n){var i=n[0],o=n[1];return o!==void 0}),r=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],o=n[1];return I7(r,i)+(o?" | "+o:" |")}).join(`
@@ -1206,7 +1206,7 @@ ${String(t)}`)}catch(e){return e}},P1=t=>{if(typeof t!="object"||t===null)throw
1206
1206
  }
1207
1207
  }
1208
1208
  }
1209
- `;d();import{randomUUID as yhe}from"crypto";var dz=Dt(qU(),1);d();var she=Dt(kG(),1),ahe=Dt(gg(),1),che=Dt(Uc(),1),uhe=Dt(AI(),1),lhe=Dt(xI(),1),dhe=Dt(jI(),1),zG=Dt(Eg(),1),phe=Dt(GG(),1);var VG=zG.default;d();var BG=100*1024*1024,Tg=class{current=Promise.resolve();async run(e){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await e()}finally{n()}}},JG=async t=>{let e=await fetch(t);if(!e.ok)throw new Error(`Failed to download CRDT model: ${e.status} ${e.statusText}`);let r=e.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:c}=await r.read();if(a)break;if(i+=c.length,i>BG)throw new Error(`CRDT model is larger than ${BG} bytes`);n.push(c)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},Ad=async(t,e)=>{try{return await e()}catch(r){return G.warn(`Optional runtime package unavailable: ${t}`,r.message),null}},ZG=null,yi=async()=>(ZG??=Ad("@functorz/ztype",()=>import("./ztype-NCIQZLPO.js")).then(t=>(t?.default??t)?.com?.functorz?.ztype??null),ZG),KG=null,YG=async()=>(KG??=Ad("@functorz/ztype",()=>import("./ztype-NCIQZLPO.js")).then(t=>(t?.default??t)?.kotlin?.collections??null),KG),HG=null,XG=async()=>(HG??=yi().then(t=>t?.typesystem?.schema?.SCHEMA_VERSION??null),HG),WG=null,Sg=async()=>(WG??=Ad("@functorz/crdt-helper",()=>import("./index.cjs-2URGRL6N.js")).then(t=>t?.Crdt??t?.default?.Crdt??null),WG),QG=null,ez=async()=>(QG??=Ad("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-OET2QF2Z.js")).then(t=>t??Ad("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-BX23XHB6.js"))).then(t=>t?.Patch??t?.default?.Patch??null),QG),$I=t=>t?.lastUploadedSchema??null,qI=t=>[t?.project?.lastDeployedServerSchemaExId,t?.lastDeployedServerSchemaExId,t?.project?.latestDeployedServerSchema?.exId,t?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,FI=t=>t==null?t:structuredClone(t),tz=(t,e)=>t?.appExId?t.appExId:e?.name??"",rz=(t,e)=>{let r=t?.typesystem?.schema?.ClientType;if(r)return e==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:e==="MOBILE"?r.MOBILE??r.WEB:r.WEB},nz=t=>{let e=t?.typesystem?.schema?.Product?.[Rn];if(!e)throw new Error(`ztype runtime has no Product enum member for ${Rn}`);return e},fhe=t=>{try{return JSON.parse(JSON.stringify(t))}catch{return String(t)}},wg=t=>({componentId:t?.componentId??null,message:typeof t?.getLocalizedErrorMessage=="function"?t.getLocalizedErrorMessage("EN"):t?.message??String(t),zhMessage:typeof t?.getLocalizedErrorMessage=="function"?t.getLocalizedErrorMessage("ZH"):void 0,platform:t?.platform??null,isBackendError:!!t?.isBackendError,fullPath:fhe(t?.fullPath??[])}),Ig=t=>t.stableErrors.concat(t.betaErrors).filter(e=>!!e.isBackendError),iz=t=>Ig(t).length,oz=(t,e)=>{if(e.__typename==="DiffItem"){let r=e.pathComponents?.at(-1)?.key??"";if(e.operation==="delete"){delete t[r];return}t[r]=structuredClone(e.newValue);return}if(e.__typename==="ArrayDiffItem"){let r=e.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(t)||r<0)throw new Error("Invalid array diff target");if(e.operation==="delete"){t.splice(r,1);return}if(e.operation==="insert"){t.splice(r,0,structuredClone(e.newValue));return}t[r]=structuredClone(e.newValue)}};d();var az=Dt(sl(),1);import{createRequire as hhe}from"module";import{fileURLToPath as mhe}from"url";import sz from"path";var cz=hhe(import.meta.url),Hi=typeof g>"u"?void 0:g,uz=()=>{if(Hi)return{version:Hi.agent};try{let t=sz.resolve(sz.dirname(mhe(import.meta.url)),"../../package.json");return cz(t)}catch{return{}}},UI=()=>uz().version??"0.0.0",Og=t=>{if(Hi){if(t==="@functorz/ztype")return Hi.ztype;if(t==="@functorz/crdt-helper")return Hi.crdtHelper;if(t==="json-joy")return Hi.jsonJoy}try{return cz(`${t}/package.json`).version??"unknown"}catch{return"unavailable"}},ghe=async()=>{if(Hi)return{ztypeVersion:Hi.ztype,ztypeSchemaVersion:Hi.ztypeSchemaVersion};try{let t=await yi();return{ztypeVersion:t?.ZTypeSystem?.getZTypeVersion?.()??Og("@functorz/ztype"),ztypeSchemaVersion:t?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:Og("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function GI(){let t=uz(),e=await ghe();return{agentVersion:t.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:e.ztypeVersion,ztypeSchemaVersion:e.ztypeSchemaVersion,crdtHelperVersion:Og("@functorz/crdt-helper"),jsonJoyVersion:Og("json-joy")}}async function Kc(t,e){let[r,n,i]=await Promise.all([GI(),hi(t),t.loadCredentials()]),o=i?az.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:Xe,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:t.getWorkspaceRoot(),typeSystemMode:Qa(),startupFlags:[...e].sort()}}function lz(t,e){return JSON.stringify(t)===JSON.stringify(e)}var zI=yhe(),pz=`${Xe}/${UI()}`,_he=t=>{if(!t)return t;if(Array.isArray(t))return t.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof t=="object"&&"forEach"in t&&typeof t.forEach=="function"){let r={};return t.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let e={};for(let[r,n]of Object.entries(t))e[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return e};function VI(t){if(!Array.isArray(t)||t.length===0)return null;let e=t.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return e.length>0?e.join("; "):null}var vhe=t=>{if(typeof t=="string")return t;if(t instanceof Uint8Array)return Buffer.from(t).toString("utf8");try{return String(t)}catch{return"<unserializable body>"}},Nd=async(t,e)=>{let r=ph();G.debug(`[HTTP] Request URL: ${t.toString()}`),e?.headers&&G.debug(`[HTTP] Request Headers: ${JSON.stringify(_he(e.headers))}`),r&&e?.body!=null&&G.debug(`[GQL] Request Body: ${vhe(e.body)}`);let n=await fetch(t,e),i=null;try{i=await n.clone().text()}catch(o){G.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&G.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=VI(o);s&&G.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function BI(t,e){let r=await t.getValidToken(),n=await hi(e),i={Authorization:`Bearer ${r}`,"User-Locale":"en_US","X-SESSION-ID":zI,"X-Client":pz},o=await XG();return o&&(i["X-ZED-VERSION"]=o),process.env.REACT_APP_VERSION&&(i["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new cr(`${n.apiBaseUrl}/api/graphql`,{headers:i,fetch:Nd})}async function fz(t,e){let r=await t.getValidToken(),i=`${(await hi(e)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(o,s,a)=>{let c=ph(),u={authToken:r,"X-SESSION-ID":zI,"X-Client":pz};G.debug(`[SUB] connecting ${i} params=${JSON.stringify({...u,authToken:"Bearer <redacted>"})}`);let l=new dz.SubscriptionClient(i,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:u},VG);l.onConnected(()=>G.debug("[SUB] connected")),l.onReconnected(()=>G.debug("[SUB] reconnected")),l.onDisconnected(()=>G.debug("[SUB] disconnected")),l.onError(h=>G.debug(`[SUB] error ${h?.message??String(h)}`));let f=[{name:"onNewCrdtPatchV2",query:cF,variables:{projectExId:o.projectExId,appExId:o.appExId??null,versionExId:o.appVersionExId??null,latestPatchExIdInClient:s}},{name:"onSchemaUploadV3",query:uF,variables:{projectExId:o.projectExId,appExId:o.appExId??null,appVersionExId:o.appVersionExId??null}}].map(h=>(G.debug(`[SUB] subscribe ${h.name} vars=${JSON.stringify(h.variables)}`),l.request({query:h.query,variables:h.variables}).subscribe({next:m=>{c&&G.debug(`[SUB] ${h.name} event: ${JSON.stringify(m)}`),a()},error:m=>{G.warn("Schema subscription event failed",String(m)),a()}})));return{unsubscribe(){for(let h of f)h.unsubscribe();l.close(!1,!1)}}}}async function Ag(t,e){if(e.projectExId)return await t.saveProjectContext(e.projectExId),e.projectExId;let r=await t.loadProjectContext();if(!r?.projectExId)throw new Error("No projectExId provided and no current project is set");return r.projectExId}async function ZI(t,e,r,n){try{await t.request(EF,{projectExId:e,client:Xe,clientVersion:UI(),sessionId:n??zI,agent:r??null}),G.debug(`[agent-session] started for project ${e}`)}catch(i){G.debug(`[agent-session] skipped: ${String(i)}`)}}d();d();d();import{createHash as Ehe}from"crypto";var bhe=t=>!!(t&&typeof t=="object"&&!Array.isArray(t)),KI=t=>{if(Array.isArray(t))return t.map(r=>r===void 0?null:KI(r));if(!bhe(t))return t;let e={};for(let r of Object.keys(t).sort()){let n=t[r];n!==void 0&&(e[r]=KI(n))}return e},The=t=>JSON.stringify(KI(t)),She=t=>Ehe("sha256").update(The(t)).digest("hex"),hz=t=>({projectExId:t.projectExId,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null,schemaExId:t.schemaExId??null,lastPatchExId:t.lastPatchExId??null,snapshotHash:She(t.snapshot),deployedSchemaExId:t.deployedSchemaExId??null,checkedAt:t.checkedAt??new Date().toISOString()}),mz=(t,e)=>!t||!e?t!==e:t.schemaExId!==e.schemaExId||t.lastPatchExId!==e.lastPatchExId||t.snapshotHash!==e.snapshotHash||t.deployedSchemaExId!==e.deployedSchemaExId,Ng=t=>t.changes.length>0;var gz=null,whe=()=>(gz??=yi().then(t=>{let e=t?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof e=="function"?e:null}),gz),HI=async(t,e)=>{let r=await whe();return r?r(t,e):{changes:[]}};d();var Ihe="Functorz";function yz(t,e,r,n){let i=t?.typesystem?.settings,o=t?.typesystem?.schema,s=t?.api?.ZTypeCoreApi,a=e?.KtList,c=e?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!s||!a||!c)return null;try{let{ExtraContext:u,AIModelDescriptors:l,ActionFlowTemplateCodeDescriptor:p}=i,{CustomChatModelDescriptor:f,CustomEmbeddingModelDescriptor:h,ModelCustomParamDescriptor:m,CustomModelParam:y,CustomChatCompletionFeatures:v,Identifier:b,MediaOutputCardinality:T,Variable:S}=o,O=C=>c.fromJsMap(new Map(Object.entries(C??{}))),I=C=>typeof C=="string"?C==="single"?T.SINGLE:C==="multiple"?T.MULTIPLE:T.NONE:typeof C=="boolean"&&C?T.MULTIPLE:T.NONE,x=C=>new m(C.name,O(C.displayName),C.type,O(C.description)),j=C=>new y(x(C.serverUrl),x(C.apiToken),a.fromJsArray((C.extensionParams??[]).map(Ae=>new m(Ae.name,O(Ae.displayName),Ae.type,O(Ae.displayName))))),R=C=>C.provider===Ihe&&C.customModelIdentifier?new b(C.customModelIdentifier.id,C.customModelIdentifier.namespace):null,ie=C=>c.fromJsMap(new Map((C??[]).filter(Ae=>Ae!=null).map(Ae=>[Ae.name,new S(Ae.type,null,!Ae.required,null,null,null,null,Ae.defaultValue==null?null:s.parseDataBindingFromJsObject(Ae.defaultValue))]))),me=(r?.chatModelDescriptors??[]).map(C=>new f(C.provider,C.name,j(C.paramToConfigure),C.delisted,new v(C.features.streamResponse,C.features.multiModal,C.features.imageInput??!1,!1,C.features.videoInput??!1,C.features.imageMessageInput??!1,!1,C.features.videoMessageInput??!1,C.features.tools,C.features.reasoningContent,C.features.imageOutput,C.features.videoOutput,I(C.features.imageOutput),I(C.features.videoOutput),null,C.features.structuredOutput),R(C))),Fe=(r?.embeddingModelDescriptors??[]).map(C=>new h(C.provider,C.name,j(C.paramToConfigure),R(C),C.delisted)),A=c.fromJsMap(new Map((n??[]).map(C=>[C.exId,new p(C.exId,C.async,ie(C.inputType),ie(C.outputType))])));return new u(new l(a.fromJsArray(me),a.fromJsArray(Fe)),A)}catch{return null}}d();var Ks=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};d();function Pg(t,e,r){let n=rz(t,r?.appType);return t.api.ZTypeCoreApi.genZTypeApiContext(e,nz(t),n,tz(r,n),t?.utils?.Locale?.EN,null)}d();var _z={QUERY:"query",MUTATION:"mutation"},vz={SUCCESS:"2xx",PERMANENT_FAIL:"4xx",TEMPORARY_FAIL:"5xx"};function Ez(t){let e=r=>{if(Array.isArray(r))return r.map(e);if(r&&typeof r=="object"){let n={};for(let[i,o]of Object.entries(r))i==="operation"&&typeof o=="string"&&_z[o]!==void 0?n[i]=_z[o]:i==="responseBranch"&&typeof o=="string"&&vz[o]!==void 0?n[i]=vz[o]:n[i]=e(o);return n}return r};return t.map(e)}function bz(t){let e=r=>typeof r=="string"&&!r.startsWith("http://")&&!r.startsWith("https://");for(let r of t){let n=r;if(!n?.args||typeof n.args!="object")continue;let i=n.args,o=[];if(n.name==="UPDATE_TPA_CONFIG")o.push(i.url);else if(n.name==="ADD_TPA_CONFIGS"&&Array.isArray(i.items))for(let s of i.items)s&&typeof s=="object"&&o.push(s.url);for(let s of o)if(e(s))return`url "${s}" is not an absolute URL. A TPA config url must include the scheme and host (e.g. https://api.example.com/v1/resource) \u2014 find the API's base URL in its documentation.`}return null}d();var Un=t=>t==null,Ohe=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Tz=t=>{if(Ohe(t)){if(!Un(t.id))return{key:"id",value:t.id};if(!Un(t.uniqueId))return{key:"uniqueId",value:t.uniqueId};if(!Un(t.mRef))return{key:"mRef",value:t.mRef}}},WI=(t,e)=>{if(Un(t)&&Un(e)||t===e)return!0;if(Un(t)||Un(e)||typeof t!="object"||typeof e!="object")return!1;let r=t,n=e,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!WI(r[o],n[o]))return!1;return!0},Sz=t=>{if(t.__typename==="DiffItem")switch(t.operation){case"add":return{__typename:"DiffItem",oldValue:t.newValue,newValue:null,operation:"delete",pathComponents:t.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:t.oldValue,operation:"add",pathComponents:t.pathComponents};case"update":return{__typename:"DiffItem",oldValue:t.newValue,newValue:t.oldValue,operation:"update",pathComponents:t.pathComponents}}else switch(t.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:t.newValue,newValue:null,previousValue:t.previousValue,nextValue:t.nextValue,operation:"delete",pathComponents:t.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:t.oldValue,previousValue:t.previousValue,nextValue:t.nextValue,operation:"insert",pathComponents:t.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:t.newValue,newValue:t.oldValue,operation:"update",pathComponents:t.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(t)}`)},Ahe=t=>t.key??t.index??"",Nhe=(t,e)=>{let r=t;for(let n of e){if(r===null||typeof r!="object")return;r=r[n]}return r},Phe=(t,e)=>{if(e.__typename!=="DiffItem")return null;let r=e.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=Tz(t[r]),i=n===void 0?WI(t[r],e.oldValue):n.value===e.oldValue?.[n.key];switch(e.operation){case"add":t[r]=e.newValue;break;case"update":if(!i)return null;t[r]=e.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(t,r)||!i)return null;delete t[r];break;default:return null}return e},xhe=(t,e)=>{if(e.__typename!=="ArrayDiffItem")return null;let r=e.pathComponents.at(-1)?.index;if(r===void 0||r>t.length)return null;let n=()=>{let i=Tz(t[r]);return i===void 0?WI(t[r],e.oldValue):i.value===e.oldValue?.[i.key]};switch(e.operation){case"insert":t.splice(r,0,e.newValue);break;case"delete":if(!n())return null;t.splice(r,1);break;case"update":if(!n())return null;t.splice(r,1,e.newValue);break;default:return null}return e},wz=(t,e)=>{let r=t,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let c of s){let u=a[c];if(u!==null&&typeof u=="object"){if(!n.has(u)){let l=Array.isArray(u)?[...u]:{...u};n.add(l),a[c]=l}a=a[c]}else a=u}return a},o=[];for(let s of e)try{let c=s.pathComponents.map(Ahe).slice(0,-1);if(Un(Nhe(r,c)))continue;let u=i(c);if(Array.isArray(u)){let l=xhe(u,s);l&&o.push(l)}else if(u!==null&&typeof u=="object"){let l=Phe(u,s);l&&o.push(l)}}catch{continue}return o};d();var Rhe=3e4,xg=class{constructor(e){this.options=e}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(e=>{this.subscriptionHandle=e}).catch(e=>{G.warn("Schema subscription failed; falling back to polling",e.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},Rhe),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};d();d();var E={};Mv(E,{BRAND:()=>nme,DIRTY:()=>Hs,EMPTY_PATH:()=>Lhe,INVALID:()=>se,NEVER:()=>Fme,OK:()=>mr,ParseStatus:()=>er,Schema:()=>ve,ZodAny:()=>Mo,ZodArray:()=>Yi,ZodBigInt:()=>Qs,ZodBoolean:()=>Js,ZodBranded:()=>xd,ZodCatch:()=>ca,ZodDate:()=>Ys,ZodDefault:()=>aa,ZodDiscriminatedUnion:()=>Dg,ZodEffects:()=>vn,ZodEnum:()=>oa,ZodError:()=>jr,ZodFirstPartyTypeKind:()=>L,ZodFunction:()=>Lg,ZodIntersection:()=>ra,ZodIssueCode:()=>k,ZodLazy:()=>na,ZodLiteral:()=>ia,ZodMap:()=>Xc,ZodNaN:()=>tu,ZodNativeEnum:()=>sa,ZodNever:()=>Gn,ZodNull:()=>ea,ZodNullable:()=>Ei,ZodNumber:()=>Ws,ZodObject:()=>$r,ZodOptional:()=>Mr,ZodParsedType:()=>U,ZodPipeline:()=>Rd,ZodPromise:()=>$o,ZodReadonly:()=>ua,ZodRecord:()=>kg,ZodSchema:()=>ve,ZodSet:()=>eu,ZodString:()=>jo,ZodSymbol:()=>Jc,ZodTransformer:()=>vn,ZodTuple:()=>vi,ZodType:()=>ve,ZodUndefined:()=>Xs,ZodUnion:()=>ta,ZodUnknown:()=>Ji,ZodVoid:()=>Yc,addIssueToContext:()=>F,any:()=>pme,array:()=>gme,bigint:()=>ame,boolean:()=>Lz,coerce:()=>qme,custom:()=>Cz,date:()=>cme,datetimeRegex:()=>xz,defaultErrorMap:()=>Wi,discriminatedUnion:()=>vme,effect:()=>Rme,enum:()=>Nme,function:()=>Ime,getErrorMap:()=>Hc,getParsedType:()=>_i,instanceof:()=>ome,intersection:()=>Eme,isAborted:()=>Rg,isAsync:()=>Wc,isDirty:()=>Cg,isValid:()=>Lo,late:()=>ime,lazy:()=>Ome,literal:()=>Ame,makeIssue:()=>Pd,map:()=>Sme,nan:()=>sme,nativeEnum:()=>Pme,never:()=>hme,null:()=>dme,nullable:()=>Dme,number:()=>kz,object:()=>XI,objectUtil:()=>QI,oboolean:()=>$me,onumber:()=>Mme,optional:()=>Cme,ostring:()=>jme,pipeline:()=>Lme,preprocess:()=>kme,promise:()=>xme,quotelessJson:()=>Che,record:()=>Tme,set:()=>wme,setErrorMap:()=>khe,strictObject:()=>yme,string:()=>Dz,symbol:()=>ume,transformer:()=>Rme,tuple:()=>bme,undefined:()=>lme,union:()=>_me,unknown:()=>fme,util:()=>Ie,void:()=>mme});d();d();d();d();d();var Ie;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ie||(Ie={}));var QI;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(QI||(QI={}));var U=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var k=Ie.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Che=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),jr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};jr.create=t=>new jr(t);var Dhe=(t,e)=>{let r;switch(t.code){case k.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case k.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case k.invalid_union:r="Invalid input";break;case k.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case k.invalid_enum_value:r=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case k.invalid_arguments:r="Invalid function arguments";break;case k.invalid_return_type:r="Invalid function return type";break;case k.invalid_date:r="Invalid date";break;case k.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ie.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case k.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case k.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case k.custom:r="Invalid input";break;case k.invalid_intersection_types:r="Intersection results could not be merged";break;case k.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case k.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ie.assertNever(t)}return{message:r}},Wi=Dhe;var Iz=Wi;function khe(t){Iz=t}function Hc(){return Iz}d();var Pd=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},Lhe=[];function F(t,e){let r=Hc(),n=Pd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Wi?void 0:Wi].filter(i=>!!i)});t.common.issues.push(n)}var er=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return se;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return se;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},se=Object.freeze({status:"aborted"}),Hs=t=>({status:"dirty",value:t}),mr=t=>({status:"valid",value:t}),Rg=t=>t.status==="aborted",Cg=t=>t.status==="dirty",Lo=t=>t.status==="valid",Wc=t=>typeof Promise<"u"&&t instanceof Promise;d();d();var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var _n=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Oz=(t,e)=>{if(Lo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new jr(t.common.issues);return this._error=r,this._error}}};function he(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:i}}var ve=class{get description(){return this._def.description}_getType(e){return _i(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:_i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new er,ctx:{common:e.parent.common,data:e.data,parsedType:_i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Wc(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_i(e)},i=this._parseSync({data:e,path:n.path,parent:n});return Oz(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_i(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Lo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Lo(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_i(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(Wc(i)?i:Promise.resolve(i));return Oz(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:k.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new vn({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Mr.create(this,this._def)}nullable(){return Ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yi.create(this)}promise(){return $o.create(this,this._def)}or(e){return ta.create([this,e],this._def)}and(e){return ra.create(this,e,this._def)}transform(e){return new vn({...he(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new aa({...he(this._def),innerType:this,defaultValue:r,typeName:L.ZodDefault})}brand(){return new xd({typeName:L.ZodBranded,type:this,...he(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new ca({...he(this._def),innerType:this,catchValue:r,typeName:L.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Rd.create(this,e)}readonly(){return ua.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},jhe=/^c[^\s-]{8,}$/i,Mhe=/^[0-9a-z]+$/,$he=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qhe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Fhe=/^[a-z0-9_-]{21}$/i,Uhe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ghe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zhe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vhe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",JI,Bhe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zhe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Khe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Hhe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Whe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qhe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Nz="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Jhe=new RegExp(`^${Nz}$`);function Pz(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Yhe(t){return new RegExp(`^${Pz(t)}$`)}function xz(t){let e=`${Nz}T${Pz(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Xhe(t,e){return!!((e==="v4"||!e)&&Bhe.test(t)||(e==="v6"||!e)&&Khe.test(t))}function eme(t,e){if(!Uhe.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function tme(t,e){return!!((e==="v4"||!e)&&Zhe.test(t)||(e==="v6"||!e)&&Hhe.test(t))}var jo=class t extends ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_type,expected:U.string,received:o.parsedType}),se}let n=new er,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?F(i,{code:k.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&F(i,{code:k.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")zhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"email",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")JI||(JI=new RegExp(Vhe,"u")),JI.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"emoji",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")qhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"uuid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Fhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"nanoid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")jhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"cuid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Mhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"cuid2",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")$he.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"ulid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),F(i,{validation:"url",code:k.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"regex",code:k.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?xz(o).test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Jhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Yhe(o).test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Ghe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"duration",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Xhe(e.data,o.version)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"ip",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?eme(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"jwt",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?tme(e.data,o.version)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"cidr",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Whe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"base64",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Qhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"base64url",code:k.invalid_string,message:o.message}),n.dirty()):Ie.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:k.invalid_string,...Q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};jo.create=t=>new jo({checks:[],typeName:L.ZodString,coerce:t?.coerce??!1,...he(t)});function rme(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var Ws=class t extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_type,expected:U.number,received:o.parsedType}),se}let n,i=new er;for(let o of this._def.checks)o.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),F(n,{code:k.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?rme(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),F(n,{code:k.not_finite,message:o.message}),i.dirty()):Ie.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ie.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Ws.create=t=>new Ws({checks:[],typeName:L.ZodNumber,coerce:t?.coerce||!1,...he(t)});var Qs=class t extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let n,i=new er;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ie.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return F(r,{code:k.invalid_type,expected:U.bigint,received:r.parsedType}),se}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Qs.create=t=>new Qs({checks:[],typeName:L.ZodBigInt,coerce:t?.coerce??!1,...he(t)});var Js=class extends ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.boolean,received:n.parsedType}),se}return mr(e.data)}};Js.create=t=>new Js({typeName:L.ZodBoolean,coerce:t?.coerce||!1,...he(t)});var Ys=class t extends ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_type,expected:U.date,received:o.parsedType}),se}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_date}),se}let n=new er,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ie.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Ys.create=t=>new Ys({checks:[],coerce:t?.coerce||!1,typeName:L.ZodDate,...he(t)});var Jc=class extends ve{_parse(e){if(this._getType(e)!==U.symbol){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.symbol,received:n.parsedType}),se}return mr(e.data)}};Jc.create=t=>new Jc({typeName:L.ZodSymbol,...he(t)});var Xs=class extends ve{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.undefined,received:n.parsedType}),se}return mr(e.data)}};Xs.create=t=>new Xs({typeName:L.ZodUndefined,...he(t)});var ea=class extends ve{_parse(e){if(this._getType(e)!==U.null){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.null,received:n.parsedType}),se}return mr(e.data)}};ea.create=t=>new ea({typeName:L.ZodNull,...he(t)});var Mo=class extends ve{constructor(){super(...arguments),this._any=!0}_parse(e){return mr(e.data)}};Mo.create=t=>new Mo({typeName:L.ZodAny,...he(t)});var Ji=class extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return mr(e.data)}};Ji.create=t=>new Ji({typeName:L.ZodUnknown,...he(t)});var Gn=class extends ve{_parse(e){let r=this._getOrReturnCtx(e);return F(r,{code:k.invalid_type,expected:U.never,received:r.parsedType}),se}};Gn.create=t=>new Gn({typeName:L.ZodNever,...he(t)});var Yc=class extends ve{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.void,received:n.parsedType}),se}return mr(e.data)}};Yc.create=t=>new Yc({typeName:L.ZodVoid,...he(t)});var Yi=class t extends ve{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==U.array)return F(r,{code:k.invalid_type,expected:U.array,received:r.parsedType}),se;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(F(r,{code:s?k.too_big:k.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(F(r,{code:k.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(F(r,{code:k.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new _n(r,s,r.path,a)))).then(s=>er.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new _n(r,s,r.path,a)));return er.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};Yi.create=(t,e)=>new Yi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...he(e)});function Qc(t){if(t instanceof $r){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Mr.create(Qc(n))}return new $r({...t._def,shape:()=>e})}else return t instanceof Yi?new Yi({...t._def,type:Qc(t.element)}):t instanceof Mr?Mr.create(Qc(t.unwrap())):t instanceof Ei?Ei.create(Qc(t.unwrap())):t instanceof vi?vi.create(t.items.map(e=>Qc(e))):t}var $r=class t extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Ie.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==U.object){let u=this._getOrReturnCtx(e);return F(u,{code:k.invalid_type,expected:U.object,received:u.parsedType}),se}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Gn&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let l=o[u],p=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new _n(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Gn){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(F(i,{code:k.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let p=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new _n(i,p,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let p=await l.key,f=await l.value;u.push({key:p,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>er.mergeObjectSync(n,u)):er.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Q.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:L.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of Ie.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of Ie.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Qc(this)}partial(e){let r={};for(let n of Ie.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of Ie.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Mr;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:()=>r})}keyof(){return Rz(Ie.objectKeys(this.shape))}};$r.create=(t,e)=>new $r({shape:()=>t,unknownKeys:"strip",catchall:Gn.create(),typeName:L.ZodObject,...he(e)});$r.strictCreate=(t,e)=>new $r({shape:()=>t,unknownKeys:"strict",catchall:Gn.create(),typeName:L.ZodObject,...he(e)});$r.lazycreate=(t,e)=>new $r({shape:t,unknownKeys:"strip",catchall:Gn.create(),typeName:L.ZodObject,...he(e)});var ta=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new jr(a.ctx.common.issues));return F(r,{code:k.invalid_union,unionErrors:s}),se}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new jr(c));return F(r,{code:k.invalid_union,unionErrors:a}),se}}get options(){return this._def.options}};ta.create=(t,e)=>new ta({options:t,typeName:L.ZodUnion,...he(e)});var Qi=t=>t instanceof na?Qi(t.schema):t instanceof vn?Qi(t.innerType()):t instanceof ia?[t.value]:t instanceof oa?t.options:t instanceof sa?Ie.objectValues(t.enum):t instanceof aa?Qi(t._def.innerType):t instanceof Xs?[void 0]:t instanceof ea?[null]:t instanceof Mr?[void 0,...Qi(t.unwrap())]:t instanceof Ei?[null,...Qi(t.unwrap())]:t instanceof xd||t instanceof ua?Qi(t.unwrap()):t instanceof ca?Qi(t._def.innerType):[],Dg=class t extends ve{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return F(r,{code:k.invalid_type,expected:U.object,received:r.parsedType}),se;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(F(r,{code:k.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),se)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Qi(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:L.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...he(n)})}};function YI(t,e){let r=_i(t),n=_i(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&n===U.object){let i=Ie.objectKeys(e),o=Ie.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let c=YI(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===U.array&&n===U.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],c=YI(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===U.date&&n===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ra=class extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(Rg(o)||Rg(s))return se;let a=YI(o.value,s.value);return a.valid?((Cg(o)||Cg(s))&&r.dirty(),{status:r.value,value:a.data}):(F(n,{code:k.invalid_intersection_types}),se)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ra.create=(t,e,r)=>new ra({left:t,right:e,typeName:L.ZodIntersection,...he(r)});var vi=class t extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return F(n,{code:k.invalid_type,expected:U.array,received:n.parsedType}),se;if(n.data.length<this._def.items.length)return F(n,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),se;!this._def.rest&&n.data.length>this._def.items.length&&(F(n,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new _n(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>er.mergeArray(r,s)):er.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};vi.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vi({items:t,typeName:L.ZodTuple,rest:null,...he(e)})};var kg=class t extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return F(n,{code:k.invalid_type,expected:U.object,received:n.parsedType}),se;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new _n(n,a,n.path,a)),value:s._parse(new _n(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?er.mergeObjectAsync(r,i):er.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ve?new t({keyType:e,valueType:r,typeName:L.ZodRecord,...he(n)}):new t({keyType:jo.create(),valueType:e,typeName:L.ZodRecord,...he(r)})}},Xc=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return F(n,{code:k.invalid_type,expected:U.map,received:n.parsedType}),se;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new _n(n,a,n.path,[u,"key"])),value:o._parse(new _n(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return se;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return se;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};Xc.create=(t,e,r)=>new Xc({valueType:e,keyType:t,typeName:L.ZodMap,...he(r)});var eu=class t extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return F(n,{code:k.invalid_type,expected:U.set,received:n.parsedType}),se;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(F(n,{code:k.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(F(n,{code:k.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let u=new Set;for(let l of c){if(l.status==="aborted")return se;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new _n(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};eu.create=(t,e)=>new eu({valueType:t,minSize:null,maxSize:null,typeName:L.ZodSet,...he(e)});var Lg=class t extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return F(r,{code:k.invalid_type,expected:U.function,received:r.parsedType}),se;function n(a,c){return Pd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Wi].filter(u=>!!u),issueData:{code:k.invalid_arguments,argumentsError:c}})}function i(a,c){return Pd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Wi].filter(u=>!!u),issueData:{code:k.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof $o){let a=this;return mr(async function(...c){let u=new jr([]),l=await a._def.args.parseAsync(c,o).catch(h=>{throw u.addIssue(n(c,h)),u}),p=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(p,o).catch(h=>{throw u.addIssue(i(p,h)),u})})}else{let a=this;return mr(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new jr([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),p=a._def.returns.safeParse(l,o);if(!p.success)throw new jr([i(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:vi.create(e).rest(Ji.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||vi.create([]).rest(Ji.create()),returns:r||Ji.create(),typeName:L.ZodFunction,...he(n)})}},na=class extends ve{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};na.create=(t,e)=>new na({getter:t,typeName:L.ZodLazy,...he(e)});var ia=class extends ve{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return F(r,{received:r.data,code:k.invalid_literal,expected:this._def.value}),se}return{status:"valid",value:e.data}}get value(){return this._def.value}};ia.create=(t,e)=>new ia({value:t,typeName:L.ZodLiteral,...he(e)});function Rz(t,e){return new oa({values:t,typeName:L.ZodEnum,...he(e)})}var oa=class t extends ve{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return F(r,{expected:Ie.joinValues(n),received:r.parsedType,code:k.invalid_type}),se}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return F(r,{received:r.data,code:k.invalid_enum_value,options:n}),se}return mr(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};oa.create=Rz;var sa=class extends ve{_parse(e){let r=Ie.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){let i=Ie.objectValues(r);return F(n,{expected:Ie.joinValues(i),received:n.parsedType,code:k.invalid_type}),se}if(this._cache||(this._cache=new Set(Ie.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=Ie.objectValues(r);return F(n,{received:n.data,code:k.invalid_enum_value,options:i}),se}return mr(e.data)}get enum(){return this._def.values}};sa.create=(t,e)=>new sa({values:t,typeName:L.ZodNativeEnum,...he(e)});var $o=class extends ve{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return F(r,{code:k.invalid_type,expected:U.promise,received:r.parsedType}),se;let n=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return mr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};$o.create=(t,e)=>new $o({type:t,typeName:L.ZodPromise,...he(e)});var vn=class extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{F(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return se;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?se:c.status==="dirty"?Hs(c.value):r.value==="dirty"?Hs(c.value):c});{if(r.value==="aborted")return se;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?se:a.status==="dirty"?Hs(a.value):r.value==="dirty"?Hs(a.value):a}}if(i.type==="refinement"){let s=a=>{let c=i.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?se:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?se:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Lo(s))return se;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Lo(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):se);Ie.assertNever(i)}};vn.create=(t,e,r)=>new vn({schema:t,typeName:L.ZodEffects,effect:e,...he(r)});vn.createWithPreprocess=(t,e,r)=>new vn({schema:e,effect:{type:"preprocess",transform:t},typeName:L.ZodEffects,...he(r)});var Mr=class extends ve{_parse(e){return this._getType(e)===U.undefined?mr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:L.ZodOptional,...he(e)});var Ei=class extends ve{_parse(e){return this._getType(e)===U.null?mr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ei.create=(t,e)=>new Ei({innerType:t,typeName:L.ZodNullable,...he(e)});var aa=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};aa.create=(t,e)=>new aa({innerType:t,typeName:L.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...he(e)});var ca=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Wc(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new jr(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ca.create=(t,e)=>new ca({innerType:t,typeName:L.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...he(e)});var tu=class extends ve{_parse(e){if(this._getType(e)!==U.nan){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.nan,received:n.parsedType}),se}return{status:"valid",value:e.data}}};tu.create=t=>new tu({typeName:L.ZodNaN,...he(t)});var nme=Symbol("zod_brand"),xd=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Rd=class t extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?se:o.status==="dirty"?(r.dirty(),Hs(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?se:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:L.ZodPipeline})}},ua=class extends ve{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Lo(i)&&(i.value=Object.freeze(i.value)),i);return Wc(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};ua.create=(t,e)=>new ua({innerType:t,typeName:L.ZodReadonly,...he(e)});function Az(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Cz(t,e={},r){return t?Mo.create().superRefine((n,i)=>{let o=t(n);if(o instanceof Promise)return o.then(s=>{if(!s){let a=Az(e,n),c=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:c})}});if(!o){let s=Az(e,n),a=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:a})}}):Mo.create()}var ime={object:$r.lazycreate},L;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(L||(L={}));var ome=(t,e={message:`Input not instance of ${t.name}`})=>Cz(r=>r instanceof t,e),Dz=jo.create,kz=Ws.create,sme=tu.create,ame=Qs.create,Lz=Js.create,cme=Ys.create,ume=Jc.create,lme=Xs.create,dme=ea.create,pme=Mo.create,fme=Ji.create,hme=Gn.create,mme=Yc.create,gme=Yi.create,XI=$r.create,yme=$r.strictCreate,_me=ta.create,vme=Dg.create,Eme=ra.create,bme=vi.create,Tme=kg.create,Sme=Xc.create,wme=eu.create,Ime=Lg.create,Ome=na.create,Ame=ia.create,Nme=oa.create,Pme=sa.create,xme=$o.create,Rme=vn.create,Cme=Mr.create,Dme=Ei.create,kme=vn.createWithPreprocess,Lme=Rd.create,jme=()=>Dz().optional(),Mme=()=>kz().optional(),$me=()=>Lz().optional(),qme={string:(t=>jo.create({...t,coerce:!0})),number:(t=>Ws.create({...t,coerce:!0})),boolean:(t=>Js.create({...t,coerce:!0})),bigint:(t=>Qs.create({...t,coerce:!0})),date:(t=>Ys.create({...t,coerce:!0}))};var Fme=se;var jg=[{name:"schema_actionflow",tier:"core",description:`Action flows \u2014 flow-level (addressed by actionFlowId). Discover types via op=SELECTABLE_TYPES and ids via op=GET_DETAIL. AI nodes require isAsync=true.
1209
+ `;d();import{randomUUID as yhe}from"crypto";var dz=Dt(qU(),1);d();var she=Dt(kG(),1),ahe=Dt(gg(),1),che=Dt(Uc(),1),uhe=Dt(AI(),1),lhe=Dt(xI(),1),dhe=Dt(jI(),1),zG=Dt(Eg(),1),phe=Dt(GG(),1);var VG=zG.default;d();var BG=100*1024*1024,Tg=class{current=Promise.resolve();async run(e){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await e()}finally{n()}}},JG=async t=>{let e=await fetch(t);if(!e.ok)throw new Error(`Failed to download CRDT model: ${e.status} ${e.statusText}`);let r=e.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:c}=await r.read();if(a)break;if(i+=c.length,i>BG)throw new Error(`CRDT model is larger than ${BG} bytes`);n.push(c)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},Ad=async(t,e)=>{try{return await e()}catch(r){return G.warn(`Optional runtime package unavailable: ${t}`,r.message),null}},ZG=null,yi=async()=>(ZG??=Ad("@functorz/ztype",()=>import("./ztype-P7J5KRM3.js")).then(t=>(t?.default??t)?.com?.functorz?.ztype??null),ZG),KG=null,YG=async()=>(KG??=Ad("@functorz/ztype",()=>import("./ztype-P7J5KRM3.js")).then(t=>(t?.default??t)?.kotlin?.collections??null),KG),HG=null,XG=async()=>(HG??=yi().then(t=>t?.typesystem?.schema?.SCHEMA_VERSION??null),HG),WG=null,Sg=async()=>(WG??=Ad("@functorz/crdt-helper",()=>import("./index.cjs-S47FDOFS.js")).then(t=>t?.Crdt??t?.default?.Crdt??null),WG),QG=null,ez=async()=>(QG??=Ad("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-5KXKKZLS.js")).then(t=>t??Ad("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-F7CFHJUT.js"))).then(t=>t?.Patch??t?.default?.Patch??null),QG),$I=t=>t?.lastUploadedSchema??null,qI=t=>[t?.project?.lastDeployedServerSchemaExId,t?.lastDeployedServerSchemaExId,t?.project?.latestDeployedServerSchema?.exId,t?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,FI=t=>t==null?t:structuredClone(t),tz=(t,e)=>t?.appExId?t.appExId:e?.name??"",rz=(t,e)=>{let r=t?.typesystem?.schema?.ClientType;if(r)return e==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:e==="MOBILE"?r.MOBILE??r.WEB:r.WEB},nz=t=>{let e=t?.typesystem?.schema?.Product?.[Rn];if(!e)throw new Error(`ztype runtime has no Product enum member for ${Rn}`);return e},fhe=t=>{try{return JSON.parse(JSON.stringify(t))}catch{return String(t)}},wg=t=>({componentId:t?.componentId??null,message:typeof t?.getLocalizedErrorMessage=="function"?t.getLocalizedErrorMessage("EN"):t?.message??String(t),zhMessage:typeof t?.getLocalizedErrorMessage=="function"?t.getLocalizedErrorMessage("ZH"):void 0,platform:t?.platform??null,isBackendError:!!t?.isBackendError,fullPath:fhe(t?.fullPath??[])}),Ig=t=>t.stableErrors.concat(t.betaErrors).filter(e=>!!e.isBackendError),iz=t=>Ig(t).length,oz=(t,e)=>{if(e.__typename==="DiffItem"){let r=e.pathComponents?.at(-1)?.key??"";if(e.operation==="delete"){delete t[r];return}t[r]=structuredClone(e.newValue);return}if(e.__typename==="ArrayDiffItem"){let r=e.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(t)||r<0)throw new Error("Invalid array diff target");if(e.operation==="delete"){t.splice(r,1);return}if(e.operation==="insert"){t.splice(r,0,structuredClone(e.newValue));return}t[r]=structuredClone(e.newValue)}};d();var az=Dt(sl(),1);import{createRequire as hhe}from"module";import{fileURLToPath as mhe}from"url";import sz from"path";var cz=hhe(import.meta.url),Hi=typeof g>"u"?void 0:g,uz=()=>{if(Hi)return{version:Hi.agent};try{let t=sz.resolve(sz.dirname(mhe(import.meta.url)),"../../package.json");return cz(t)}catch{return{}}},UI=()=>uz().version??"0.0.0",Og=t=>{if(Hi){if(t==="@functorz/ztype")return Hi.ztype;if(t==="@functorz/crdt-helper")return Hi.crdtHelper;if(t==="json-joy")return Hi.jsonJoy}try{return cz(`${t}/package.json`).version??"unknown"}catch{return"unavailable"}},ghe=async()=>{if(Hi)return{ztypeVersion:Hi.ztype,ztypeSchemaVersion:Hi.ztypeSchemaVersion};try{let t=await yi();return{ztypeVersion:t?.ZTypeSystem?.getZTypeVersion?.()??Og("@functorz/ztype"),ztypeSchemaVersion:t?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:Og("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function GI(){let t=uz(),e=await ghe();return{agentVersion:t.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:e.ztypeVersion,ztypeSchemaVersion:e.ztypeSchemaVersion,crdtHelperVersion:Og("@functorz/crdt-helper"),jsonJoyVersion:Og("json-joy")}}async function Kc(t,e){let[r,n,i]=await Promise.all([GI(),hi(t),t.loadCredentials()]),o=i?az.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:Xe,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:t.getWorkspaceRoot(),typeSystemMode:Qa(),startupFlags:[...e].sort()}}function lz(t,e){return JSON.stringify(t)===JSON.stringify(e)}var zI=yhe(),pz=`${Xe}/${UI()}`,_he=t=>{if(!t)return t;if(Array.isArray(t))return t.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof t=="object"&&"forEach"in t&&typeof t.forEach=="function"){let r={};return t.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let e={};for(let[r,n]of Object.entries(t))e[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return e};function VI(t){if(!Array.isArray(t)||t.length===0)return null;let e=t.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return e.length>0?e.join("; "):null}var vhe=t=>{if(typeof t=="string")return t;if(t instanceof Uint8Array)return Buffer.from(t).toString("utf8");try{return String(t)}catch{return"<unserializable body>"}},Nd=async(t,e)=>{let r=ph();G.debug(`[HTTP] Request URL: ${t.toString()}`),e?.headers&&G.debug(`[HTTP] Request Headers: ${JSON.stringify(_he(e.headers))}`),r&&e?.body!=null&&G.debug(`[GQL] Request Body: ${vhe(e.body)}`);let n=await fetch(t,e),i=null;try{i=await n.clone().text()}catch(o){G.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&G.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=VI(o);s&&G.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function BI(t,e){let r=await t.getValidToken(),n=await hi(e),i={Authorization:`Bearer ${r}`,"User-Locale":"en_US","X-SESSION-ID":zI,"X-Client":pz},o=await XG();return o&&(i["X-ZED-VERSION"]=o),process.env.REACT_APP_VERSION&&(i["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new cr(`${n.apiBaseUrl}/api/graphql`,{headers:i,fetch:Nd})}async function fz(t,e){let r=await t.getValidToken(),i=`${(await hi(e)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(o,s,a)=>{let c=ph(),u={authToken:r,"X-SESSION-ID":zI,"X-Client":pz};G.debug(`[SUB] connecting ${i} params=${JSON.stringify({...u,authToken:"Bearer <redacted>"})}`);let l=new dz.SubscriptionClient(i,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:u},VG);l.onConnected(()=>G.debug("[SUB] connected")),l.onReconnected(()=>G.debug("[SUB] reconnected")),l.onDisconnected(()=>G.debug("[SUB] disconnected")),l.onError(h=>G.debug(`[SUB] error ${h?.message??String(h)}`));let f=[{name:"onNewCrdtPatchV2",query:cF,variables:{projectExId:o.projectExId,appExId:o.appExId??null,versionExId:o.appVersionExId??null,latestPatchExIdInClient:s}},{name:"onSchemaUploadV3",query:uF,variables:{projectExId:o.projectExId,appExId:o.appExId??null,appVersionExId:o.appVersionExId??null}}].map(h=>(G.debug(`[SUB] subscribe ${h.name} vars=${JSON.stringify(h.variables)}`),l.request({query:h.query,variables:h.variables}).subscribe({next:m=>{c&&G.debug(`[SUB] ${h.name} event: ${JSON.stringify(m)}`),a()},error:m=>{G.warn("Schema subscription event failed",String(m)),a()}})));return{unsubscribe(){for(let h of f)h.unsubscribe();l.close(!1,!1)}}}}async function Ag(t,e){if(e.projectExId)return await t.saveProjectContext(e.projectExId),e.projectExId;let r=await t.loadProjectContext();if(!r?.projectExId)throw new Error("No projectExId provided and no current project is set");return r.projectExId}async function ZI(t,e,r,n){try{await t.request(EF,{projectExId:e,client:Xe,clientVersion:UI(),sessionId:n??zI,agent:r??null}),G.debug(`[agent-session] started for project ${e}`)}catch(i){G.debug(`[agent-session] skipped: ${String(i)}`)}}d();d();d();import{createHash as Ehe}from"crypto";var bhe=t=>!!(t&&typeof t=="object"&&!Array.isArray(t)),KI=t=>{if(Array.isArray(t))return t.map(r=>r===void 0?null:KI(r));if(!bhe(t))return t;let e={};for(let r of Object.keys(t).sort()){let n=t[r];n!==void 0&&(e[r]=KI(n))}return e},The=t=>JSON.stringify(KI(t)),She=t=>Ehe("sha256").update(The(t)).digest("hex"),hz=t=>({projectExId:t.projectExId,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null,schemaExId:t.schemaExId??null,lastPatchExId:t.lastPatchExId??null,snapshotHash:She(t.snapshot),deployedSchemaExId:t.deployedSchemaExId??null,checkedAt:t.checkedAt??new Date().toISOString()}),mz=(t,e)=>!t||!e?t!==e:t.schemaExId!==e.schemaExId||t.lastPatchExId!==e.lastPatchExId||t.snapshotHash!==e.snapshotHash||t.deployedSchemaExId!==e.deployedSchemaExId,Ng=t=>t.changes.length>0;var gz=null,whe=()=>(gz??=yi().then(t=>{let e=t?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof e=="function"?e:null}),gz),HI=async(t,e)=>{let r=await whe();return r?r(t,e):{changes:[]}};d();var Ihe="Functorz";function yz(t,e,r,n){let i=t?.typesystem?.settings,o=t?.typesystem?.schema,s=t?.api?.ZTypeCoreApi,a=e?.KtList,c=e?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!s||!a||!c)return null;try{let{ExtraContext:u,AIModelDescriptors:l,ActionFlowTemplateCodeDescriptor:p}=i,{CustomChatModelDescriptor:f,CustomEmbeddingModelDescriptor:h,ModelCustomParamDescriptor:m,CustomModelParam:y,CustomChatCompletionFeatures:v,Identifier:b,MediaOutputCardinality:T,Variable:S}=o,O=C=>c.fromJsMap(new Map(Object.entries(C??{}))),I=C=>typeof C=="string"?C==="single"?T.SINGLE:C==="multiple"?T.MULTIPLE:T.NONE:typeof C=="boolean"&&C?T.MULTIPLE:T.NONE,x=C=>new m(C.name,O(C.displayName),C.type,O(C.description)),j=C=>new y(x(C.serverUrl),x(C.apiToken),a.fromJsArray((C.extensionParams??[]).map(Ae=>new m(Ae.name,O(Ae.displayName),Ae.type,O(Ae.displayName))))),R=C=>C.provider===Ihe&&C.customModelIdentifier?new b(C.customModelIdentifier.id,C.customModelIdentifier.namespace):null,ie=C=>c.fromJsMap(new Map((C??[]).filter(Ae=>Ae!=null).map(Ae=>[Ae.name,new S(Ae.type,null,!Ae.required,null,null,null,null,Ae.defaultValue==null?null:s.parseDataBindingFromJsObject(Ae.defaultValue))]))),me=(r?.chatModelDescriptors??[]).map(C=>new f(C.provider,C.name,j(C.paramToConfigure),C.delisted,new v(C.features.streamResponse,C.features.multiModal,C.features.imageInput??!1,!1,C.features.videoInput??!1,C.features.imageMessageInput??!1,!1,C.features.videoMessageInput??!1,C.features.tools,C.features.reasoningContent,C.features.imageOutput,C.features.videoOutput,I(C.features.imageOutput),I(C.features.videoOutput),null,C.features.structuredOutput),R(C))),Fe=(r?.embeddingModelDescriptors??[]).map(C=>new h(C.provider,C.name,j(C.paramToConfigure),R(C),C.delisted)),A=c.fromJsMap(new Map((n??[]).map(C=>[C.exId,new p(C.exId,C.async,ie(C.inputType),ie(C.outputType))])));return new u(new l(a.fromJsArray(me),a.fromJsArray(Fe)),A)}catch{return null}}d();var Ks=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};d();function Pg(t,e,r){let n=rz(t,r?.appType);return t.api.ZTypeCoreApi.genZTypeApiContext(e,nz(t),n,tz(r,n),t?.utils?.Locale?.EN,null)}d();var _z={QUERY:"query",MUTATION:"mutation"},vz={SUCCESS:"2xx",PERMANENT_FAIL:"4xx",TEMPORARY_FAIL:"5xx"};function Ez(t){let e=r=>{if(Array.isArray(r))return r.map(e);if(r&&typeof r=="object"){let n={};for(let[i,o]of Object.entries(r))i==="operation"&&typeof o=="string"&&_z[o]!==void 0?n[i]=_z[o]:i==="responseBranch"&&typeof o=="string"&&vz[o]!==void 0?n[i]=vz[o]:n[i]=e(o);return n}return r};return t.map(e)}function bz(t){let e=r=>typeof r=="string"&&!r.startsWith("http://")&&!r.startsWith("https://");for(let r of t){let n=r;if(!n?.args||typeof n.args!="object")continue;let i=n.args,o=[];if(n.name==="UPDATE_TPA_CONFIG")o.push(i.url);else if(n.name==="ADD_TPA_CONFIGS"&&Array.isArray(i.items))for(let s of i.items)s&&typeof s=="object"&&o.push(s.url);for(let s of o)if(e(s))return`url "${s}" is not an absolute URL. A TPA config url must include the scheme and host (e.g. https://api.example.com/v1/resource) \u2014 find the API's base URL in its documentation.`}return null}d();var Un=t=>t==null,Ohe=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Tz=t=>{if(Ohe(t)){if(!Un(t.id))return{key:"id",value:t.id};if(!Un(t.uniqueId))return{key:"uniqueId",value:t.uniqueId};if(!Un(t.mRef))return{key:"mRef",value:t.mRef}}},WI=(t,e)=>{if(Un(t)&&Un(e)||t===e)return!0;if(Un(t)||Un(e)||typeof t!="object"||typeof e!="object")return!1;let r=t,n=e,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!WI(r[o],n[o]))return!1;return!0},Sz=t=>{if(t.__typename==="DiffItem")switch(t.operation){case"add":return{__typename:"DiffItem",oldValue:t.newValue,newValue:null,operation:"delete",pathComponents:t.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:t.oldValue,operation:"add",pathComponents:t.pathComponents};case"update":return{__typename:"DiffItem",oldValue:t.newValue,newValue:t.oldValue,operation:"update",pathComponents:t.pathComponents}}else switch(t.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:t.newValue,newValue:null,previousValue:t.previousValue,nextValue:t.nextValue,operation:"delete",pathComponents:t.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:t.oldValue,previousValue:t.previousValue,nextValue:t.nextValue,operation:"insert",pathComponents:t.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:t.newValue,newValue:t.oldValue,operation:"update",pathComponents:t.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(t)}`)},Ahe=t=>t.key??t.index??"",Nhe=(t,e)=>{let r=t;for(let n of e){if(r===null||typeof r!="object")return;r=r[n]}return r},Phe=(t,e)=>{if(e.__typename!=="DiffItem")return null;let r=e.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=Tz(t[r]),i=n===void 0?WI(t[r],e.oldValue):n.value===e.oldValue?.[n.key];switch(e.operation){case"add":t[r]=e.newValue;break;case"update":if(!i)return null;t[r]=e.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(t,r)||!i)return null;delete t[r];break;default:return null}return e},xhe=(t,e)=>{if(e.__typename!=="ArrayDiffItem")return null;let r=e.pathComponents.at(-1)?.index;if(r===void 0||r>t.length)return null;let n=()=>{let i=Tz(t[r]);return i===void 0?WI(t[r],e.oldValue):i.value===e.oldValue?.[i.key]};switch(e.operation){case"insert":t.splice(r,0,e.newValue);break;case"delete":if(!n())return null;t.splice(r,1);break;case"update":if(!n())return null;t.splice(r,1,e.newValue);break;default:return null}return e},wz=(t,e)=>{let r=t,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let c of s){let u=a[c];if(u!==null&&typeof u=="object"){if(!n.has(u)){let l=Array.isArray(u)?[...u]:{...u};n.add(l),a[c]=l}a=a[c]}else a=u}return a},o=[];for(let s of e)try{let c=s.pathComponents.map(Ahe).slice(0,-1);if(Un(Nhe(r,c)))continue;let u=i(c);if(Array.isArray(u)){let l=xhe(u,s);l&&o.push(l)}else if(u!==null&&typeof u=="object"){let l=Phe(u,s);l&&o.push(l)}}catch{continue}return o};d();var Rhe=3e4,xg=class{constructor(e){this.options=e}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(e=>{this.subscriptionHandle=e}).catch(e=>{G.warn("Schema subscription failed; falling back to polling",e.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},Rhe),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};d();d();var E={};Mv(E,{BRAND:()=>nme,DIRTY:()=>Hs,EMPTY_PATH:()=>Lhe,INVALID:()=>se,NEVER:()=>Fme,OK:()=>mr,ParseStatus:()=>er,Schema:()=>ve,ZodAny:()=>Mo,ZodArray:()=>Yi,ZodBigInt:()=>Qs,ZodBoolean:()=>Js,ZodBranded:()=>xd,ZodCatch:()=>ca,ZodDate:()=>Ys,ZodDefault:()=>aa,ZodDiscriminatedUnion:()=>Dg,ZodEffects:()=>vn,ZodEnum:()=>oa,ZodError:()=>jr,ZodFirstPartyTypeKind:()=>L,ZodFunction:()=>Lg,ZodIntersection:()=>ra,ZodIssueCode:()=>k,ZodLazy:()=>na,ZodLiteral:()=>ia,ZodMap:()=>Xc,ZodNaN:()=>tu,ZodNativeEnum:()=>sa,ZodNever:()=>Gn,ZodNull:()=>ea,ZodNullable:()=>Ei,ZodNumber:()=>Ws,ZodObject:()=>$r,ZodOptional:()=>Mr,ZodParsedType:()=>U,ZodPipeline:()=>Rd,ZodPromise:()=>$o,ZodReadonly:()=>ua,ZodRecord:()=>kg,ZodSchema:()=>ve,ZodSet:()=>eu,ZodString:()=>jo,ZodSymbol:()=>Jc,ZodTransformer:()=>vn,ZodTuple:()=>vi,ZodType:()=>ve,ZodUndefined:()=>Xs,ZodUnion:()=>ta,ZodUnknown:()=>Ji,ZodVoid:()=>Yc,addIssueToContext:()=>F,any:()=>pme,array:()=>gme,bigint:()=>ame,boolean:()=>Lz,coerce:()=>qme,custom:()=>Cz,date:()=>cme,datetimeRegex:()=>xz,defaultErrorMap:()=>Wi,discriminatedUnion:()=>vme,effect:()=>Rme,enum:()=>Nme,function:()=>Ime,getErrorMap:()=>Hc,getParsedType:()=>_i,instanceof:()=>ome,intersection:()=>Eme,isAborted:()=>Rg,isAsync:()=>Wc,isDirty:()=>Cg,isValid:()=>Lo,late:()=>ime,lazy:()=>Ome,literal:()=>Ame,makeIssue:()=>Pd,map:()=>Sme,nan:()=>sme,nativeEnum:()=>Pme,never:()=>hme,null:()=>dme,nullable:()=>Dme,number:()=>kz,object:()=>XI,objectUtil:()=>QI,oboolean:()=>$me,onumber:()=>Mme,optional:()=>Cme,ostring:()=>jme,pipeline:()=>Lme,preprocess:()=>kme,promise:()=>xme,quotelessJson:()=>Che,record:()=>Tme,set:()=>wme,setErrorMap:()=>khe,strictObject:()=>yme,string:()=>Dz,symbol:()=>ume,transformer:()=>Rme,tuple:()=>bme,undefined:()=>lme,union:()=>_me,unknown:()=>fme,util:()=>Ie,void:()=>mme});d();d();d();d();d();var Ie;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ie||(Ie={}));var QI;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(QI||(QI={}));var U=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var k=Ie.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Che=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),jr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};jr.create=t=>new jr(t);var Dhe=(t,e)=>{let r;switch(t.code){case k.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case k.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case k.invalid_union:r="Invalid input";break;case k.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case k.invalid_enum_value:r=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case k.invalid_arguments:r="Invalid function arguments";break;case k.invalid_return_type:r="Invalid function return type";break;case k.invalid_date:r="Invalid date";break;case k.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ie.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case k.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case k.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case k.custom:r="Invalid input";break;case k.invalid_intersection_types:r="Intersection results could not be merged";break;case k.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case k.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ie.assertNever(t)}return{message:r}},Wi=Dhe;var Iz=Wi;function khe(t){Iz=t}function Hc(){return Iz}d();var Pd=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},Lhe=[];function F(t,e){let r=Hc(),n=Pd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Wi?void 0:Wi].filter(i=>!!i)});t.common.issues.push(n)}var er=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return se;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return se;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},se=Object.freeze({status:"aborted"}),Hs=t=>({status:"dirty",value:t}),mr=t=>({status:"valid",value:t}),Rg=t=>t.status==="aborted",Cg=t=>t.status==="dirty",Lo=t=>t.status==="valid",Wc=t=>typeof Promise<"u"&&t instanceof Promise;d();d();var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var _n=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Oz=(t,e)=>{if(Lo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new jr(t.common.issues);return this._error=r,this._error}}};function he(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:i}}var ve=class{get description(){return this._def.description}_getType(e){return _i(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:_i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new er,ctx:{common:e.parent.common,data:e.data,parsedType:_i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Wc(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_i(e)},i=this._parseSync({data:e,path:n.path,parent:n});return Oz(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_i(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Lo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Lo(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_i(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(Wc(i)?i:Promise.resolve(i));return Oz(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:k.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new vn({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Mr.create(this,this._def)}nullable(){return Ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yi.create(this)}promise(){return $o.create(this,this._def)}or(e){return ta.create([this,e],this._def)}and(e){return ra.create(this,e,this._def)}transform(e){return new vn({...he(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new aa({...he(this._def),innerType:this,defaultValue:r,typeName:L.ZodDefault})}brand(){return new xd({typeName:L.ZodBranded,type:this,...he(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new ca({...he(this._def),innerType:this,catchValue:r,typeName:L.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Rd.create(this,e)}readonly(){return ua.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},jhe=/^c[^\s-]{8,}$/i,Mhe=/^[0-9a-z]+$/,$he=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qhe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Fhe=/^[a-z0-9_-]{21}$/i,Uhe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ghe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zhe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vhe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",JI,Bhe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zhe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Khe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Hhe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Whe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qhe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Nz="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Jhe=new RegExp(`^${Nz}$`);function Pz(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Yhe(t){return new RegExp(`^${Pz(t)}$`)}function xz(t){let e=`${Nz}T${Pz(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Xhe(t,e){return!!((e==="v4"||!e)&&Bhe.test(t)||(e==="v6"||!e)&&Khe.test(t))}function eme(t,e){if(!Uhe.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function tme(t,e){return!!((e==="v4"||!e)&&Zhe.test(t)||(e==="v6"||!e)&&Hhe.test(t))}var jo=class t extends ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_type,expected:U.string,received:o.parsedType}),se}let n=new er,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?F(i,{code:k.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&F(i,{code:k.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")zhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"email",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")JI||(JI=new RegExp(Vhe,"u")),JI.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"emoji",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")qhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"uuid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Fhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"nanoid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")jhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"cuid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Mhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"cuid2",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")$he.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"ulid",code:k.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),F(i,{validation:"url",code:k.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"regex",code:k.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?xz(o).test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Jhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Yhe(o).test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:k.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Ghe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"duration",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Xhe(e.data,o.version)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"ip",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?eme(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"jwt",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?tme(e.data,o.version)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"cidr",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Whe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"base64",code:k.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Qhe.test(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{validation:"base64url",code:k.invalid_string,message:o.message}),n.dirty()):Ie.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:k.invalid_string,...Q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};jo.create=t=>new jo({checks:[],typeName:L.ZodString,coerce:t?.coerce??!1,...he(t)});function rme(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var Ws=class t extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_type,expected:U.number,received:o.parsedType}),se}let n,i=new er;for(let o of this._def.checks)o.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),F(n,{code:k.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?rme(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),F(n,{code:k.not_finite,message:o.message}),i.dirty()):Ie.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ie.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Ws.create=t=>new Ws({checks:[],typeName:L.ZodNumber,coerce:t?.coerce||!1,...he(t)});var Qs=class t extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let n,i=new er;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),F(n,{code:k.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ie.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return F(r,{code:k.invalid_type,expected:U.bigint,received:r.parsedType}),se}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Qs.create=t=>new Qs({checks:[],typeName:L.ZodBigInt,coerce:t?.coerce??!1,...he(t)});var Js=class extends ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.boolean,received:n.parsedType}),se}return mr(e.data)}};Js.create=t=>new Js({typeName:L.ZodBoolean,coerce:t?.coerce||!1,...he(t)});var Ys=class t extends ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_type,expected:U.date,received:o.parsedType}),se}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return F(o,{code:k.invalid_date}),se}let n=new er,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),F(i,{code:k.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ie.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Ys.create=t=>new Ys({checks:[],coerce:t?.coerce||!1,typeName:L.ZodDate,...he(t)});var Jc=class extends ve{_parse(e){if(this._getType(e)!==U.symbol){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.symbol,received:n.parsedType}),se}return mr(e.data)}};Jc.create=t=>new Jc({typeName:L.ZodSymbol,...he(t)});var Xs=class extends ve{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.undefined,received:n.parsedType}),se}return mr(e.data)}};Xs.create=t=>new Xs({typeName:L.ZodUndefined,...he(t)});var ea=class extends ve{_parse(e){if(this._getType(e)!==U.null){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.null,received:n.parsedType}),se}return mr(e.data)}};ea.create=t=>new ea({typeName:L.ZodNull,...he(t)});var Mo=class extends ve{constructor(){super(...arguments),this._any=!0}_parse(e){return mr(e.data)}};Mo.create=t=>new Mo({typeName:L.ZodAny,...he(t)});var Ji=class extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return mr(e.data)}};Ji.create=t=>new Ji({typeName:L.ZodUnknown,...he(t)});var Gn=class extends ve{_parse(e){let r=this._getOrReturnCtx(e);return F(r,{code:k.invalid_type,expected:U.never,received:r.parsedType}),se}};Gn.create=t=>new Gn({typeName:L.ZodNever,...he(t)});var Yc=class extends ve{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.void,received:n.parsedType}),se}return mr(e.data)}};Yc.create=t=>new Yc({typeName:L.ZodVoid,...he(t)});var Yi=class t extends ve{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==U.array)return F(r,{code:k.invalid_type,expected:U.array,received:r.parsedType}),se;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(F(r,{code:s?k.too_big:k.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(F(r,{code:k.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(F(r,{code:k.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new _n(r,s,r.path,a)))).then(s=>er.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new _n(r,s,r.path,a)));return er.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};Yi.create=(t,e)=>new Yi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...he(e)});function Qc(t){if(t instanceof $r){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Mr.create(Qc(n))}return new $r({...t._def,shape:()=>e})}else return t instanceof Yi?new Yi({...t._def,type:Qc(t.element)}):t instanceof Mr?Mr.create(Qc(t.unwrap())):t instanceof Ei?Ei.create(Qc(t.unwrap())):t instanceof vi?vi.create(t.items.map(e=>Qc(e))):t}var $r=class t extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Ie.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==U.object){let u=this._getOrReturnCtx(e);return F(u,{code:k.invalid_type,expected:U.object,received:u.parsedType}),se}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Gn&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let l=o[u],p=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new _n(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Gn){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(F(i,{code:k.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let p=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new _n(i,p,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let p=await l.key,f=await l.value;u.push({key:p,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>er.mergeObjectSync(n,u)):er.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Q.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:L.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of Ie.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of Ie.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Qc(this)}partial(e){let r={};for(let n of Ie.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of Ie.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Mr;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:()=>r})}keyof(){return Rz(Ie.objectKeys(this.shape))}};$r.create=(t,e)=>new $r({shape:()=>t,unknownKeys:"strip",catchall:Gn.create(),typeName:L.ZodObject,...he(e)});$r.strictCreate=(t,e)=>new $r({shape:()=>t,unknownKeys:"strict",catchall:Gn.create(),typeName:L.ZodObject,...he(e)});$r.lazycreate=(t,e)=>new $r({shape:t,unknownKeys:"strip",catchall:Gn.create(),typeName:L.ZodObject,...he(e)});var ta=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new jr(a.ctx.common.issues));return F(r,{code:k.invalid_union,unionErrors:s}),se}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new jr(c));return F(r,{code:k.invalid_union,unionErrors:a}),se}}get options(){return this._def.options}};ta.create=(t,e)=>new ta({options:t,typeName:L.ZodUnion,...he(e)});var Qi=t=>t instanceof na?Qi(t.schema):t instanceof vn?Qi(t.innerType()):t instanceof ia?[t.value]:t instanceof oa?t.options:t instanceof sa?Ie.objectValues(t.enum):t instanceof aa?Qi(t._def.innerType):t instanceof Xs?[void 0]:t instanceof ea?[null]:t instanceof Mr?[void 0,...Qi(t.unwrap())]:t instanceof Ei?[null,...Qi(t.unwrap())]:t instanceof xd||t instanceof ua?Qi(t.unwrap()):t instanceof ca?Qi(t._def.innerType):[],Dg=class t extends ve{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return F(r,{code:k.invalid_type,expected:U.object,received:r.parsedType}),se;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(F(r,{code:k.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),se)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Qi(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:L.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...he(n)})}};function YI(t,e){let r=_i(t),n=_i(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&n===U.object){let i=Ie.objectKeys(e),o=Ie.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let c=YI(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===U.array&&n===U.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],c=YI(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===U.date&&n===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ra=class extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(Rg(o)||Rg(s))return se;let a=YI(o.value,s.value);return a.valid?((Cg(o)||Cg(s))&&r.dirty(),{status:r.value,value:a.data}):(F(n,{code:k.invalid_intersection_types}),se)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ra.create=(t,e,r)=>new ra({left:t,right:e,typeName:L.ZodIntersection,...he(r)});var vi=class t extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return F(n,{code:k.invalid_type,expected:U.array,received:n.parsedType}),se;if(n.data.length<this._def.items.length)return F(n,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),se;!this._def.rest&&n.data.length>this._def.items.length&&(F(n,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new _n(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>er.mergeArray(r,s)):er.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};vi.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vi({items:t,typeName:L.ZodTuple,rest:null,...he(e)})};var kg=class t extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return F(n,{code:k.invalid_type,expected:U.object,received:n.parsedType}),se;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new _n(n,a,n.path,a)),value:s._parse(new _n(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?er.mergeObjectAsync(r,i):er.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ve?new t({keyType:e,valueType:r,typeName:L.ZodRecord,...he(n)}):new t({keyType:jo.create(),valueType:e,typeName:L.ZodRecord,...he(r)})}},Xc=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return F(n,{code:k.invalid_type,expected:U.map,received:n.parsedType}),se;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new _n(n,a,n.path,[u,"key"])),value:o._parse(new _n(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return se;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return se;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};Xc.create=(t,e,r)=>new Xc({valueType:e,keyType:t,typeName:L.ZodMap,...he(r)});var eu=class t extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return F(n,{code:k.invalid_type,expected:U.set,received:n.parsedType}),se;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(F(n,{code:k.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(F(n,{code:k.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let u=new Set;for(let l of c){if(l.status==="aborted")return se;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new _n(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};eu.create=(t,e)=>new eu({valueType:t,minSize:null,maxSize:null,typeName:L.ZodSet,...he(e)});var Lg=class t extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return F(r,{code:k.invalid_type,expected:U.function,received:r.parsedType}),se;function n(a,c){return Pd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Wi].filter(u=>!!u),issueData:{code:k.invalid_arguments,argumentsError:c}})}function i(a,c){return Pd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Wi].filter(u=>!!u),issueData:{code:k.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof $o){let a=this;return mr(async function(...c){let u=new jr([]),l=await a._def.args.parseAsync(c,o).catch(h=>{throw u.addIssue(n(c,h)),u}),p=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(p,o).catch(h=>{throw u.addIssue(i(p,h)),u})})}else{let a=this;return mr(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new jr([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),p=a._def.returns.safeParse(l,o);if(!p.success)throw new jr([i(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:vi.create(e).rest(Ji.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||vi.create([]).rest(Ji.create()),returns:r||Ji.create(),typeName:L.ZodFunction,...he(n)})}},na=class extends ve{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};na.create=(t,e)=>new na({getter:t,typeName:L.ZodLazy,...he(e)});var ia=class extends ve{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return F(r,{received:r.data,code:k.invalid_literal,expected:this._def.value}),se}return{status:"valid",value:e.data}}get value(){return this._def.value}};ia.create=(t,e)=>new ia({value:t,typeName:L.ZodLiteral,...he(e)});function Rz(t,e){return new oa({values:t,typeName:L.ZodEnum,...he(e)})}var oa=class t extends ve{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return F(r,{expected:Ie.joinValues(n),received:r.parsedType,code:k.invalid_type}),se}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return F(r,{received:r.data,code:k.invalid_enum_value,options:n}),se}return mr(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};oa.create=Rz;var sa=class extends ve{_parse(e){let r=Ie.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){let i=Ie.objectValues(r);return F(n,{expected:Ie.joinValues(i),received:n.parsedType,code:k.invalid_type}),se}if(this._cache||(this._cache=new Set(Ie.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=Ie.objectValues(r);return F(n,{received:n.data,code:k.invalid_enum_value,options:i}),se}return mr(e.data)}get enum(){return this._def.values}};sa.create=(t,e)=>new sa({values:t,typeName:L.ZodNativeEnum,...he(e)});var $o=class extends ve{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return F(r,{code:k.invalid_type,expected:U.promise,received:r.parsedType}),se;let n=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return mr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};$o.create=(t,e)=>new $o({type:t,typeName:L.ZodPromise,...he(e)});var vn=class extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{F(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return se;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?se:c.status==="dirty"?Hs(c.value):r.value==="dirty"?Hs(c.value):c});{if(r.value==="aborted")return se;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?se:a.status==="dirty"?Hs(a.value):r.value==="dirty"?Hs(a.value):a}}if(i.type==="refinement"){let s=a=>{let c=i.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?se:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?se:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Lo(s))return se;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Lo(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):se);Ie.assertNever(i)}};vn.create=(t,e,r)=>new vn({schema:t,typeName:L.ZodEffects,effect:e,...he(r)});vn.createWithPreprocess=(t,e,r)=>new vn({schema:e,effect:{type:"preprocess",transform:t},typeName:L.ZodEffects,...he(r)});var Mr=class extends ve{_parse(e){return this._getType(e)===U.undefined?mr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:L.ZodOptional,...he(e)});var Ei=class extends ve{_parse(e){return this._getType(e)===U.null?mr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ei.create=(t,e)=>new Ei({innerType:t,typeName:L.ZodNullable,...he(e)});var aa=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};aa.create=(t,e)=>new aa({innerType:t,typeName:L.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...he(e)});var ca=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Wc(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new jr(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ca.create=(t,e)=>new ca({innerType:t,typeName:L.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...he(e)});var tu=class extends ve{_parse(e){if(this._getType(e)!==U.nan){let n=this._getOrReturnCtx(e);return F(n,{code:k.invalid_type,expected:U.nan,received:n.parsedType}),se}return{status:"valid",value:e.data}}};tu.create=t=>new tu({typeName:L.ZodNaN,...he(t)});var nme=Symbol("zod_brand"),xd=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Rd=class t extends ve{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?se:o.status==="dirty"?(r.dirty(),Hs(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?se:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:L.ZodPipeline})}},ua=class extends ve{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Lo(i)&&(i.value=Object.freeze(i.value)),i);return Wc(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};ua.create=(t,e)=>new ua({innerType:t,typeName:L.ZodReadonly,...he(e)});function Az(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Cz(t,e={},r){return t?Mo.create().superRefine((n,i)=>{let o=t(n);if(o instanceof Promise)return o.then(s=>{if(!s){let a=Az(e,n),c=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:c})}});if(!o){let s=Az(e,n),a=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:a})}}):Mo.create()}var ime={object:$r.lazycreate},L;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(L||(L={}));var ome=(t,e={message:`Input not instance of ${t.name}`})=>Cz(r=>r instanceof t,e),Dz=jo.create,kz=Ws.create,sme=tu.create,ame=Qs.create,Lz=Js.create,cme=Ys.create,ume=Jc.create,lme=Xs.create,dme=ea.create,pme=Mo.create,fme=Ji.create,hme=Gn.create,mme=Yc.create,gme=Yi.create,XI=$r.create,yme=$r.strictCreate,_me=ta.create,vme=Dg.create,Eme=ra.create,bme=vi.create,Tme=kg.create,Sme=Xc.create,wme=eu.create,Ime=Lg.create,Ome=na.create,Ame=ia.create,Nme=oa.create,Pme=sa.create,xme=$o.create,Rme=vn.create,Cme=Mr.create,Dme=Ei.create,kme=vn.createWithPreprocess,Lme=Rd.create,jme=()=>Dz().optional(),Mme=()=>kz().optional(),$me=()=>Lz().optional(),qme={string:(t=>jo.create({...t,coerce:!0})),number:(t=>Ws.create({...t,coerce:!0})),boolean:(t=>Js.create({...t,coerce:!0})),bigint:(t=>Qs.create({...t,coerce:!0})),date:(t=>Ys.create({...t,coerce:!0}))};var Fme=se;var jg=[{name:"schema_actionflow",tier:"core",description:`Action flows \u2014 flow-level (addressed by actionFlowId). Discover types via op=SELECTABLE_TYPES and ids via op=GET_DETAIL. AI nodes require isAsync=true.
1210
1210
  Changes apply immediately; use schema_undo to revert the last change. Ops:
1211
1211
  - op=ADD (req: items)
1212
1212
  - op=ADD_GLOBAL_VARS (req: actionFlowId, items)
@@ -1484,7 +1484,7 @@ ${Ld(o)}
1484
1484
  }
1485
1485
  }
1486
1486
  `;return e.ok(Or(aO(await n.dataClient.request(s,{where:t.where??{}})),r))},oV={"runtime.graphql":Kge,"runtime.query":Hge,"runtime.insert":Wge,"runtime.update":Qge,"runtime.delete":Jge};d();var Yge=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],Xge=["INFO","WARNING","ERROR"],eye=50,tye=100,sV=5,aV=t=>`${t.toISOString().slice(0,19)}Z`,rye=t=>{if(!t)return new Date;let e=new Date(t);return Number.isNaN(e.getTime())?new Date:e},cV=(t,e)=>{if(!t)return;let r=t.map(n=>n.toUpperCase()).filter(n=>e.includes(n));return r.length>0?r:void 0},nye=async(t,e)=>{let r=await e.getProjectArgs(t),i=(await jd(e.client,r)).dataVisualizer.token;if(!i)throw new Error(`Log admin token is missing for project ${r.projectExId}`);let o=rye(Se(t.requestCreatedAt)),s={start:aV(new Date(o.getTime()-sV*6e4)),end:aV(new Date(o.getTime()+sV*6e4)),desc:!0},a=cV(la(t.types),Yge);a&&(s.type=a);let c=cV(la(t.levels),Xge);c&&(s.level=c);let u=Se(t.customQueryCondition);u&&(s.customQueryCondition=u);let l=Math.min(tye,qr(t.limit,eye)),p=dr().logApiUrlTemplate.replace("{projectExId}",r.projectExId),m=((await new cr(p,{headers:{authorization:`Bearer ${i}`},fetch:Nd}).request(bF,{queryCreation:s,paginator:{first:l}}))?.fetchLogsByPaginator?.edges??[]).map(y=>y?.node).filter(y=>!!y);return e.ok({entries:m})},uV={"logs.search":nye};d();d();d();d();import{readFileSync as pye}from"node:fs";import{dirname as fye,join as hye}from"node:path";import{fileURLToPath as mye}from"node:url";d();var Gt,qd=null;function Gg(){return(qd===null||qd.byteLength===0)&&(qd=new Uint8Array(Gt.memory.buffer)),qd}var zg=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&zg.decode();var iye=2146435072,cO=0;function oye(t,e){return cO+=e,cO>=iye&&(zg=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}},zg.decode(),cO=e),zg.decode(Gg().subarray(t,t+e))}function uO(t,e){return t=t>>>0,oye(t,e)}function lO(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){let i=t.length,o="[";i>0&&(o+=lO(t[0]));for(let s=1;s<i;s++)o+=", "+lO(t[s]);return o+="]",o}let r=/\[object ([^\]]+)\]/.exec(toString.call(t)),n;if(r&&r.length>1)n=r[1];else return toString.call(t);if(n=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
1487
- ${t.stack}`:n}var Bg=0,Vg=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},sye=typeof Vg.encodeInto=="function"?function(t,e){return Vg.encodeInto(t,e)}:function(t,e){let r=Vg.encode(t);return e.set(r),{read:t.length,written:r.length}};function lV(t,e,r){if(r===void 0){let a=Vg.encode(t),c=e(a.length,1)>>>0;return Gg().subarray(c,c+a.length).set(a),Bg=a.length,c}let n=t.length,i=e(n,1)>>>0,o=Gg(),s=0;for(;s<n;s++){let a=t.charCodeAt(s);if(a>127)break;o[i+s]=a}if(s!==n){s!==0&&(t=t.slice(s)),i=r(i,n,n=s+t.length*3,1)>>>0;let a=Gg().subarray(i+s,i+n),c=sye(t,a);s+=c.written,i=r(i,n,s,1)>>>0}return Bg=s,i}var da=null;function dO(){return(da===null||da.buffer.detached===!0||da.buffer.detached===void 0&&da.buffer!==Gt.memory.buffer)&&(da=new DataView(Gt.memory.buffer)),da}function aye(t){return t==null}function cye(t,e){t=t>>>0;let r=dO(),n=[];for(let i=t;i<t+4*e;i+=4)n.push(Gt.__wbindgen_export_2.get(r.getUint32(i,!0)));return Gt.__externref_drop_slice(t,e),n}function dV(t,e){let r=lV(t,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),n=Bg,i=Gt.cut(r,n,aye(e)?16777215:e?1:0);var o=cye(i[0],i[1]).slice();return Gt.__wbindgen_free(i[0],i[1]*4,4),o}var uye=new Set(["basic","cors","default"]);async function lye(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.ok&&uye.has(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else{let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function pV(){let t={};return t.wbg={},t.wbg.__wbg_Error_0497d5bdba9362e5=function(e,r){return Error(uO(e,r))},t.wbg.__wbg_new_07b483f72211fd66=function(){return new Object},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,r,n){e[r]=n},t.wbg.__wbindgen_bigint_from_u64=function(e){return BigInt.asUintN(64,e)},t.wbg.__wbindgen_debug_string=function(e,r){let n=lO(r),i=lV(n,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),o=Bg;dO().setInt32(e+4,o,!0),dO().setInt32(e+0,i,!0)},t.wbg.__wbindgen_init_externref_table=function(){let e=Gt.__wbindgen_export_2,r=e.grow(4);e.set(0,void 0),e.set(r+0,void 0),e.set(r+1,null),e.set(r+2,!0),e.set(r+3,!1)},t.wbg.__wbindgen_number_new=function(e){return e},t.wbg.__wbindgen_string_new=function(e,r){return uO(e,r)},t.wbg.__wbindgen_throw=function(e,r){throw new Error(uO(e,r))},t}function fV(t,e){return Gt=t.exports,dye.__wbindgen_wasm_module=e,da=null,qd=null,Gt.__wbindgen_start(),Gt}function hV(t){if(Gt!==void 0)return Gt;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=pV();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return fV(r,t)}async function dye(t){if(Gt!==void 0)return Gt;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("jieba_rs_wasm_bg.wasm",import.meta.url));let e=pV();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await lye(await t,e);return fV(r,n)}var mV=!1,gV=(t,e)=>{if(!mV){let r=hye(fye(mye(import.meta.url)),"jieba-engine.wasm");hV({module:pye(r)}),mV=!0}return dV(t,e)};var gye=new Set(["a","an","and","are","as","at","be","but","by","for","if","in","into","is","it","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]),yye=/[a-z0-9]+/g,_ye=t=>{let e=t.toLowerCase().replace(/'s\b/g,""),r=[];for(let n of e.matchAll(yye)){let i=n[0];gye.has(i)||r.push(bye(i))}return r},vye=/[㐀-鿿豈-﫿぀-ヿ가-힯]|[a-z0-9]/i,Eye=t=>gV(t.toLowerCase(),!0).filter(e=>vye.test(e)),iu=t=>{switch(Rn){case"ZION":return Eye(t);case"MOMEN":return _ye(t);default:throw new Error(`[analyzer] unknown PRODUCT '${Rn}'`)}},pa=(t,e)=>{let r=t[e];return r==="a"||r==="e"||r==="i"||r==="o"||r==="u"?!1:r==="y"?e===0?!0:!pa(t,e-1):!0},qo=t=>{let e=0,r=!1;for(let n=0;n<t.length;n+=1){let i=!pa(t,n);r&&!i&&(e+=1),r=i}return e},pO=t=>{for(let e=0;e<t.length;e+=1)if(!pa(t,e))return!0;return!1},yV=t=>{let e=t.length;return e>=2&&t[e-1]===t[e-2]&&pa(t,e-1)},_V=t=>{let e=t.length;if(e<3||!pa(t,e-1)||pa(t,e-2)||!pa(t,e-3))return!1;let r=t[e-1];return r!=="w"&&r!=="x"&&r!=="y"},Zg=(t,e,r)=>t.slice(0,t.length-e.length)+r;function bye(t){let e=t;if(e.length<=2)return e;e.endsWith("sses")?e=Zg(e,"sses","ss"):e.endsWith("ies")?e=Zg(e,"ies","i"):e.endsWith("ss")||e.endsWith("s")&&(e=e.slice(0,-1));let r=!1;e.endsWith("eed")?qo(e.slice(0,-3))>0&&(e=e.slice(0,-1)):e.endsWith("ed")&&pO(e.slice(0,-2))?(e=e.slice(0,-2),r=!0):e.endsWith("ing")&&pO(e.slice(0,-3))&&(e=e.slice(0,-3),r=!0),r&&(e.endsWith("at")||e.endsWith("bl")||e.endsWith("iz")?e+="e":yV(e)&&!/[lsz]$/.test(e)?e=e.slice(0,-1):qo(e)===1&&_V(e)&&(e+="e")),e.endsWith("y")&&pO(e.slice(0,-1))&&(e=`${e.slice(0,-1)}i`);let n=[["ational","ate"],["tional","tion"],["enci","ence"],["anci","ance"],["izer","ize"],["bli","ble"],["alli","al"],["entli","ent"],["eli","e"],["ousli","ous"],["ization","ize"],["ation","ate"],["ator","ate"],["alism","al"],["iveness","ive"],["fulness","ful"],["ousness","ous"],["aliti","al"],["iviti","ive"],["biliti","ble"],["logi","log"]];for(let[a,c]of n)if(e.endsWith(a)){qo(e.slice(0,e.length-a.length))>0&&(e=Zg(e,a,c));break}let i=[["icate","ic"],["ative",""],["alize","al"],["iciti","ic"],["ical","ic"],["ful",""],["ness",""]];for(let[a,c]of i)if(e.endsWith(a)){qo(e.slice(0,e.length-a.length))>0&&(e=Zg(e,a,c));break}let o=["al","ance","ence","er","ic","able","ible","ant","ement","ment","ent","ou","ism","ate","iti","ous","ive","ize"],s=!1;for(let a of o)if(e.endsWith(a)){let c=e.slice(0,e.length-a.length);qo(c)>1&&(e=c),s=!0;break}if(!s&&e.endsWith("ion")){let a=e.slice(0,-3);qo(a)>1&&/[st]$/.test(a)&&(e=a)}if(e.endsWith("e")){let a=e.slice(0,-1),c=qo(a);(c>1||c===1&&!_V(a))&&(e=a)}return qo(e)>1&&yV(e)&&e.endsWith("l")&&(e=e.slice(0,-1)),e}d();var vV=1.5,EV=.75,fO=t=>{let e=[],r=new Map,n=0;for(let{ref:i,tokens:o}of t){let s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let a of s.keys())r.set(a,(r.get(a)??0)+1);e.push({ref:i,tf:s,length:o.length}),n+=o.length}return{docs:e,df:r,avgdl:e.length>0?n/e.length:0}},hO=(t,e)=>{let r=[...new Set(iu(e))],n=t.docs.length;return r.length===0||n===0?[]:t.docs.map(i=>{let o=0;for(let s of r){let a=i.tf.get(s);if(!a)continue;let c=t.df.get(s)??0,u=Math.log(1+(n-c+.5)/(c+.5)),l=a+vV*(1-EV+EV*i.length/(t.avgdl||1));o+=u*(a*(vV+1)/l)}return{ref:i.ref,score:o}})};var Tye=async()=>(await import("./corpus-IM7UAUZV.js")).DOCS_CORPUS,Sye=3,bV=null,wye=t=>{let e=new Map,r=t.map(n=>{e.set(n.path,n);let i=iu(n.content),o=iu(n.title);for(let s=0;s<Sye;s+=1)i.push(...o);return{ref:n,tokens:i}});return{index:fO(r),byPath:e}},TV=async()=>(bV??=wye(await Tye()),bV),SV=async(t,e=10)=>{let{index:r}=await TV();return hO(r,t).filter(n=>n.score>0).sort((n,i)=>i.score-n.score).slice(0,Math.max(1,e)).map(n=>({path:n.ref.path,title:n.ref.title,url:n.ref.url}))},wV=async t=>{let e=t.replace(/\.mdx$/,""),r=e.startsWith("/")?e:`/${e}`;return(await TV()).byPath.get(r)??null};var Iye=async(t,e)=>{let r=Se(t.query);if(!r)throw new Error("query is required");let n=qr(t.limit,10);return e.ok({results:await SV(r,n)})},Oye=async(t,e)=>{let r=Se(t.path);if(!r)throw new Error("path is required");let n=await wV(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return e.ok(n)},IV={"docs.search":Iye,"docs.get_page":Oye};d();var Aye=async(t,e)=>{let r=Se(t.query);if(!r)throw new Error("query is required");let n=t.variables&&typeof t.variables=="object"?t.variables:{};return e.ok(await e.client.request(r,n))},OV={"platform.graphql":Aye};d();var Nye=async(t,e)=>{let n=((await e.client.request(H1)).visibleAfCustomCodeTemplates??[]).map(i=>({templateCodeId:i.exId,displayName:i.displayName,group:i.templateGroup,async:i.async,inputs:i.inputType,outputs:i.outputType}));return e.ok({templates:n})},AV={"actionflow.list_node_templates":Nye};d();var DK=Dt(gK(),1);d();function rTe(t){let e;try{e=new URL(t)}catch{throw new Error(`Unsupported or malformed URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Only http/https URLs are allowed: ${t}`);return e}async function nTe(t,e){let r=t.body?.getReader();if(!r)throw new Error(`Empty response body from ${e}`);let n=[],i=0;for(;;){let{done:o,value:s}=await r.read();if(o)break;if(i+=s.byteLength,i>10485760)throw await r.cancel(),new Error("Response exceeds size limit of 10485760 bytes");n.push(s)}return Buffer.concat(n).toString("utf8")}async function WA(t){let e=t;for(let r=0;r<=5;r++){let n=rTe(e),i=await fetch(n,{redirect:"manual",signal:AbortSignal.timeout(2e4),headers:{Accept:"application/json, application/yaml, text/yaml, text/html, */*","User-Agent":"Momen-Agent-TpaImport"}});if(i.status>=300&&i.status<400){let o=i.headers.get("location");if(await i.body?.cancel(),!o)throw new Error(`Redirect without Location from ${e}`);e=new URL(o,n).toString();continue}if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} fetching ${e}`);return{finalUrl:n.toString(),contentType:i.headers.get("content-type"),body:await nTe(i,e)}}throw new Error(`Too many redirects fetching ${t}`)}d();var iTe=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,oTe=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,sTe=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function yK(t,e){if(t&&t.toLowerCase().includes("html"))return!0;let r=e.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function _K(t){let e=t.length>4e3?t.slice(0,4e3):t;return e.includes('"openapi"')||e.includes('"swagger"')||/(^|\n)\s*openapi\s*:/.test(e)||/(^|\n)\s*swagger\s*:/.test(e)}function vK(t,e){try{return new URL(e,t).toString()}catch{return e.startsWith("http")?e:null}}var aTe=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function cTe(t){let e=t.match(aTe);return e?`https://api.swaggerhub.com/apis/${e[1]}/${e[2]}/${e[3]}`:null}function EK(t,e){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of t.matchAll(iTe)){if(r.length>=20)break;let o=i[1],s=o.toLowerCase();if(!(s.includes("openapi")||s.includes("swagger")||(s.endsWith(".json")||s.endsWith(".yaml")||s.endsWith(".yml"))&&s.includes("api")))continue;let c=vK(e,o);n(c&&cTe(c)),n(c)}return r}function bK(t,e){let r=[],n;try{n=new URL(e).host}catch{return r}for(let i of t.matchAll(/<a\b[^>]*href\s*=\s*["']([^"'#]+)[^"']*["']/gi)){if(r.length>=40)break;let o;try{o=new URL(i[1],e)}catch{continue}if(o.host!==n)continue;o.hash="";let s=o.toString(),a=o.pathname.toLowerCase(),c=a.slice(a.lastIndexOf(".")+1);sTe.has(c)||s===e||r.includes(s)||r.push(s)}return r}var uTe={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function QA(t){return t.replace(/&#x([0-9a-f]+);/gi,(e,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(e,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&([a-z]+);/gi,(e,r)=>uTe[r.toLowerCase()]??e)}var gp=t=>t.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function TK(t,e){let r=t.replace(/<!--[\s\S]*?-->/g,"").replace(oTe,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
1487
+ ${t.stack}`:n}var Bg=0,Vg=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},sye=typeof Vg.encodeInto=="function"?function(t,e){return Vg.encodeInto(t,e)}:function(t,e){let r=Vg.encode(t);return e.set(r),{read:t.length,written:r.length}};function lV(t,e,r){if(r===void 0){let a=Vg.encode(t),c=e(a.length,1)>>>0;return Gg().subarray(c,c+a.length).set(a),Bg=a.length,c}let n=t.length,i=e(n,1)>>>0,o=Gg(),s=0;for(;s<n;s++){let a=t.charCodeAt(s);if(a>127)break;o[i+s]=a}if(s!==n){s!==0&&(t=t.slice(s)),i=r(i,n,n=s+t.length*3,1)>>>0;let a=Gg().subarray(i+s,i+n),c=sye(t,a);s+=c.written,i=r(i,n,s,1)>>>0}return Bg=s,i}var da=null;function dO(){return(da===null||da.buffer.detached===!0||da.buffer.detached===void 0&&da.buffer!==Gt.memory.buffer)&&(da=new DataView(Gt.memory.buffer)),da}function aye(t){return t==null}function cye(t,e){t=t>>>0;let r=dO(),n=[];for(let i=t;i<t+4*e;i+=4)n.push(Gt.__wbindgen_export_2.get(r.getUint32(i,!0)));return Gt.__externref_drop_slice(t,e),n}function dV(t,e){let r=lV(t,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),n=Bg,i=Gt.cut(r,n,aye(e)?16777215:e?1:0);var o=cye(i[0],i[1]).slice();return Gt.__wbindgen_free(i[0],i[1]*4,4),o}var uye=new Set(["basic","cors","default"]);async function lye(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.ok&&uye.has(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else{let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function pV(){let t={};return t.wbg={},t.wbg.__wbg_Error_0497d5bdba9362e5=function(e,r){return Error(uO(e,r))},t.wbg.__wbg_new_07b483f72211fd66=function(){return new Object},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,r,n){e[r]=n},t.wbg.__wbindgen_bigint_from_u64=function(e){return BigInt.asUintN(64,e)},t.wbg.__wbindgen_debug_string=function(e,r){let n=lO(r),i=lV(n,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),o=Bg;dO().setInt32(e+4,o,!0),dO().setInt32(e+0,i,!0)},t.wbg.__wbindgen_init_externref_table=function(){let e=Gt.__wbindgen_export_2,r=e.grow(4);e.set(0,void 0),e.set(r+0,void 0),e.set(r+1,null),e.set(r+2,!0),e.set(r+3,!1)},t.wbg.__wbindgen_number_new=function(e){return e},t.wbg.__wbindgen_string_new=function(e,r){return uO(e,r)},t.wbg.__wbindgen_throw=function(e,r){throw new Error(uO(e,r))},t}function fV(t,e){return Gt=t.exports,dye.__wbindgen_wasm_module=e,da=null,qd=null,Gt.__wbindgen_start(),Gt}function hV(t){if(Gt!==void 0)return Gt;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=pV();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return fV(r,t)}async function dye(t){if(Gt!==void 0)return Gt;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("jieba_rs_wasm_bg.wasm",import.meta.url));let e=pV();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await lye(await t,e);return fV(r,n)}var mV=!1,gV=(t,e)=>{if(!mV){let r=hye(fye(mye(import.meta.url)),"jieba-engine.wasm");hV({module:pye(r)}),mV=!0}return dV(t,e)};var gye=new Set(["a","an","and","are","as","at","be","but","by","for","if","in","into","is","it","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]),yye=/[a-z0-9]+/g,_ye=t=>{let e=t.toLowerCase().replace(/'s\b/g,""),r=[];for(let n of e.matchAll(yye)){let i=n[0];gye.has(i)||r.push(bye(i))}return r},vye=/[㐀-鿿豈-﫿぀-ヿ가-힯]|[a-z0-9]/i,Eye=t=>gV(t.toLowerCase(),!0).filter(e=>vye.test(e)),iu=t=>{switch(Rn){case"ZION":return Eye(t);case"MOMEN":return _ye(t);default:throw new Error(`[analyzer] unknown PRODUCT '${Rn}'`)}},pa=(t,e)=>{let r=t[e];return r==="a"||r==="e"||r==="i"||r==="o"||r==="u"?!1:r==="y"?e===0?!0:!pa(t,e-1):!0},qo=t=>{let e=0,r=!1;for(let n=0;n<t.length;n+=1){let i=!pa(t,n);r&&!i&&(e+=1),r=i}return e},pO=t=>{for(let e=0;e<t.length;e+=1)if(!pa(t,e))return!0;return!1},yV=t=>{let e=t.length;return e>=2&&t[e-1]===t[e-2]&&pa(t,e-1)},_V=t=>{let e=t.length;if(e<3||!pa(t,e-1)||pa(t,e-2)||!pa(t,e-3))return!1;let r=t[e-1];return r!=="w"&&r!=="x"&&r!=="y"},Zg=(t,e,r)=>t.slice(0,t.length-e.length)+r;function bye(t){let e=t;if(e.length<=2)return e;e.endsWith("sses")?e=Zg(e,"sses","ss"):e.endsWith("ies")?e=Zg(e,"ies","i"):e.endsWith("ss")||e.endsWith("s")&&(e=e.slice(0,-1));let r=!1;e.endsWith("eed")?qo(e.slice(0,-3))>0&&(e=e.slice(0,-1)):e.endsWith("ed")&&pO(e.slice(0,-2))?(e=e.slice(0,-2),r=!0):e.endsWith("ing")&&pO(e.slice(0,-3))&&(e=e.slice(0,-3),r=!0),r&&(e.endsWith("at")||e.endsWith("bl")||e.endsWith("iz")?e+="e":yV(e)&&!/[lsz]$/.test(e)?e=e.slice(0,-1):qo(e)===1&&_V(e)&&(e+="e")),e.endsWith("y")&&pO(e.slice(0,-1))&&(e=`${e.slice(0,-1)}i`);let n=[["ational","ate"],["tional","tion"],["enci","ence"],["anci","ance"],["izer","ize"],["bli","ble"],["alli","al"],["entli","ent"],["eli","e"],["ousli","ous"],["ization","ize"],["ation","ate"],["ator","ate"],["alism","al"],["iveness","ive"],["fulness","ful"],["ousness","ous"],["aliti","al"],["iviti","ive"],["biliti","ble"],["logi","log"]];for(let[a,c]of n)if(e.endsWith(a)){qo(e.slice(0,e.length-a.length))>0&&(e=Zg(e,a,c));break}let i=[["icate","ic"],["ative",""],["alize","al"],["iciti","ic"],["ical","ic"],["ful",""],["ness",""]];for(let[a,c]of i)if(e.endsWith(a)){qo(e.slice(0,e.length-a.length))>0&&(e=Zg(e,a,c));break}let o=["al","ance","ence","er","ic","able","ible","ant","ement","ment","ent","ou","ism","ate","iti","ous","ive","ize"],s=!1;for(let a of o)if(e.endsWith(a)){let c=e.slice(0,e.length-a.length);qo(c)>1&&(e=c),s=!0;break}if(!s&&e.endsWith("ion")){let a=e.slice(0,-3);qo(a)>1&&/[st]$/.test(a)&&(e=a)}if(e.endsWith("e")){let a=e.slice(0,-1),c=qo(a);(c>1||c===1&&!_V(a))&&(e=a)}return qo(e)>1&&yV(e)&&e.endsWith("l")&&(e=e.slice(0,-1)),e}d();var vV=1.5,EV=.75,fO=t=>{let e=[],r=new Map,n=0;for(let{ref:i,tokens:o}of t){let s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let a of s.keys())r.set(a,(r.get(a)??0)+1);e.push({ref:i,tf:s,length:o.length}),n+=o.length}return{docs:e,df:r,avgdl:e.length>0?n/e.length:0}},hO=(t,e)=>{let r=[...new Set(iu(e))],n=t.docs.length;return r.length===0||n===0?[]:t.docs.map(i=>{let o=0;for(let s of r){let a=i.tf.get(s);if(!a)continue;let c=t.df.get(s)??0,u=Math.log(1+(n-c+.5)/(c+.5)),l=a+vV*(1-EV+EV*i.length/(t.avgdl||1));o+=u*(a*(vV+1)/l)}return{ref:i.ref,score:o}})};var Tye=async()=>(await import("./corpus-VVQP2ZI3.js")).DOCS_CORPUS,Sye=3,bV=null,wye=t=>{let e=new Map,r=t.map(n=>{e.set(n.path,n);let i=iu(n.content),o=iu(n.title);for(let s=0;s<Sye;s+=1)i.push(...o);return{ref:n,tokens:i}});return{index:fO(r),byPath:e}},TV=async()=>(bV??=wye(await Tye()),bV),SV=async(t,e=10)=>{let{index:r}=await TV();return hO(r,t).filter(n=>n.score>0).sort((n,i)=>i.score-n.score).slice(0,Math.max(1,e)).map(n=>({path:n.ref.path,title:n.ref.title,url:n.ref.url}))},wV=async t=>{let e=t.replace(/\.mdx$/,""),r=e.startsWith("/")?e:`/${e}`;return(await TV()).byPath.get(r)??null};var Iye=async(t,e)=>{let r=Se(t.query);if(!r)throw new Error("query is required");let n=qr(t.limit,10);return e.ok({results:await SV(r,n)})},Oye=async(t,e)=>{let r=Se(t.path);if(!r)throw new Error("path is required");let n=await wV(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return e.ok(n)},IV={"docs.search":Iye,"docs.get_page":Oye};d();var Aye=async(t,e)=>{let r=Se(t.query);if(!r)throw new Error("query is required");let n=t.variables&&typeof t.variables=="object"?t.variables:{};return e.ok(await e.client.request(r,n))},OV={"platform.graphql":Aye};d();var Nye=async(t,e)=>{let n=((await e.client.request(H1)).visibleAfCustomCodeTemplates??[]).map(i=>({templateCodeId:i.exId,displayName:i.displayName,group:i.templateGroup,async:i.async,inputs:i.inputType,outputs:i.outputType}));return e.ok({templates:n})},AV={"actionflow.list_node_templates":Nye};d();var DK=Dt(gK(),1);d();function rTe(t){let e;try{e=new URL(t)}catch{throw new Error(`Unsupported or malformed URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Only http/https URLs are allowed: ${t}`);return e}async function nTe(t,e){let r=t.body?.getReader();if(!r)throw new Error(`Empty response body from ${e}`);let n=[],i=0;for(;;){let{done:o,value:s}=await r.read();if(o)break;if(i+=s.byteLength,i>10485760)throw await r.cancel(),new Error("Response exceeds size limit of 10485760 bytes");n.push(s)}return Buffer.concat(n).toString("utf8")}async function WA(t){let e=t;for(let r=0;r<=5;r++){let n=rTe(e),i=await fetch(n,{redirect:"manual",signal:AbortSignal.timeout(2e4),headers:{Accept:"application/json, application/yaml, text/yaml, text/html, */*","User-Agent":"Momen-Agent-TpaImport"}});if(i.status>=300&&i.status<400){let o=i.headers.get("location");if(await i.body?.cancel(),!o)throw new Error(`Redirect without Location from ${e}`);e=new URL(o,n).toString();continue}if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} fetching ${e}`);return{finalUrl:n.toString(),contentType:i.headers.get("content-type"),body:await nTe(i,e)}}throw new Error(`Too many redirects fetching ${t}`)}d();var iTe=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,oTe=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,sTe=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function yK(t,e){if(t&&t.toLowerCase().includes("html"))return!0;let r=e.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function _K(t){let e=t.length>4e3?t.slice(0,4e3):t;return e.includes('"openapi"')||e.includes('"swagger"')||/(^|\n)\s*openapi\s*:/.test(e)||/(^|\n)\s*swagger\s*:/.test(e)}function vK(t,e){try{return new URL(e,t).toString()}catch{return e.startsWith("http")?e:null}}var aTe=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function cTe(t){let e=t.match(aTe);return e?`https://api.swaggerhub.com/apis/${e[1]}/${e[2]}/${e[3]}`:null}function EK(t,e){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of t.matchAll(iTe)){if(r.length>=20)break;let o=i[1],s=o.toLowerCase();if(!(s.includes("openapi")||s.includes("swagger")||(s.endsWith(".json")||s.endsWith(".yaml")||s.endsWith(".yml"))&&s.includes("api")))continue;let c=vK(e,o);n(c&&cTe(c)),n(c)}return r}function bK(t,e){let r=[],n;try{n=new URL(e).host}catch{return r}for(let i of t.matchAll(/<a\b[^>]*href\s*=\s*["']([^"'#]+)[^"']*["']/gi)){if(r.length>=40)break;let o;try{o=new URL(i[1],e)}catch{continue}if(o.host!==n)continue;o.hash="";let s=o.toString(),a=o.pathname.toLowerCase(),c=a.slice(a.lastIndexOf(".")+1);sTe.has(c)||s===e||r.includes(s)||r.push(s)}return r}var uTe={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function QA(t){return t.replace(/&#x([0-9a-f]+);/gi,(e,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(e,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&([a-z]+);/gi,(e,r)=>uTe[r.toLowerCase()]??e)}var gp=t=>t.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function TK(t,e){let r=t.replace(/<!--[\s\S]*?-->/g,"").replace(oTe,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
1488
1488
  \`\`\`
1489
1489
  ${QA(lTe(i))}
1490
1490
  \`\`\`