From 54ef1496d20bcd12c6d367349ac7be36e4ed0701 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Sun, 23 Nov 2025 16:14:53 -0500 Subject: [PATCH] fix: Refresh in-memory session project when updated in database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Problem:** - Summaries created with empty project names even after database fix - 13 summaries had empty project, couldn't appear in context-hook - In-memory sessions cached stale empty project value **Root Cause:** SessionManager caches ActiveSession objects in memory. When reusing an existing session, it never refreshed the project field from the database. Even though createSDKSession() now updates the DB with the correct project, the in-memory session.project remained empty, causing summaries to be stored with empty project. **Flow:** 1. Session created with empty project (cached in memory) 2. new-hook UPDATE fixes project in database 3. SessionManager reuses cached session (stale project="") 4. Summary stored with session.project (empty) 5. Context-hook can't find summary (WHERE project = 'claude-mem') **Solution:** When SessionManager.initializeSession() reuses an existing session, refresh the project field from the database. This ensures summaries and observations always use the latest project value. **Impact:** - Future summaries will have correct project name - Backfilled 13 historical summaries with project='claude-mem' - Context injection will now show recent summaries - Both observations AND summaries fixed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- plugin/scripts/worker-service.cjs | 18 +++++++++--------- src/services/worker/SessionManager.ts | 13 +++++++++++++ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/plugin/scripts/worker-service.cjs b/plugin/scripts/worker-service.cjs index bbd9b27a..27a38f5f 100755 --- a/plugin/scripts/worker-service.cjs +++ b/plugin/scripts/worker-service.cjs @@ -39,7 +39,7 @@ return fn.apply(this, arguments) `}function MC(a,e){return e?e instanceof Error?Wu(a,e,{expose:!1}):Wu(a,e):Wu(a)}function FC(a){try{return decodeURIComponent(a)}catch{return-1}}function LC(a){return typeof a.getHeaderNames!="function"?Object.keys(a._headers||{}):a.getHeaderNames()}function jy(a,e){var r=typeof a.listenerCount!="function"?a.listeners(e).length:a.listenerCount(e);return r>0}function UC(a){return typeof a.headersSent!="boolean"?!!a._header:a.headersSent}function Xu(a,e){for(var r=[].concat(a||[]),t=0;t{"use strict";Ny.exports=BC;function BC(a){if(!a)throw new TypeError("argument req is required");var e=GC(a.headers["x-forwarded-for"]||""),r=VC(a),t=[r].concat(e);return t}function VC(a){return a.socket?a.socket.remoteAddress:a.connection.remoteAddress}function GC(a){for(var e=a.length,r=[],t=a.length,s=a.length-1;s>=0;s--)switch(a.charCodeAt(s)){case 32:t===e&&(t=e=s);break;case 44:t!==e&&r.push(a.substring(t,e)),t=e=s;break;default:t=s;break}return t!==e&&r.push(a.substring(t,e)),r}});var qy=M(($y,gi)=>{(function(){var a,e,r,t,s,i,n,o,l;e={},o=this,typeof gi<"u"&&gi!==null&&gi.exports?gi.exports=e:o.ipaddr=e,n=function(c,u,p,m){var f,h;if(c.length!==u.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(f=0;m>0;){if(h=p-m,h<0&&(h=0),c[f]>>h!==u[f]>>h)return!1;m-=p,f+=1}return!0},e.subnetMatch=function(c,u,p){var m,f,h,d,v;p==null&&(p="unicast");for(h in u)for(d=u[h],d[0]&&!(d[0]instanceof Array)&&(d=[d]),m=0,f=d.length;m=0;p=m+=-1)if(f=this.octets[p],f in v){if(d=v[f],h&&d!==0)return null;d!==8&&(h=!0),u+=d}else return null;return 32-u},c})(),r="(0?\\d+|0x[a-f0-9]+)",t={fourOctet:new RegExp("^"+r+"\\."+r+"\\."+r+"\\."+r+"$","i"),longValue:new RegExp("^"+r+"$","i")},e.IPv4.parser=function(c){var u,p,m,f,h;if(p=function(d){return d[0]==="0"&&d[1]!=="x"?parseInt(d,8):parseInt(d)},u=c.match(t.fourOctet))return(function(){var d,v,x,b;for(x=u.slice(1,6),b=[],d=0,v=x.length;d4294967295||h<0)throw new Error("ipaddr: address outside defined range");return(function(){var d,v;for(v=[],f=d=0;d<=24;f=d+=8)v.push(h>>f&255);return v})().reverse()}else return null},e.IPv6=(function(){function c(u,p){var m,f,h,d,v,x;if(u.length===16)for(this.parts=[],m=f=0;f<=14;m=f+=2)this.parts.push(u[m]<<8|u[m+1]);else if(u.length===8)this.parts=u;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(x=this.parts,h=0,d=x.length;hp&&(u=m.index,p=m[0].length);return p<0?h:h.substring(0,u)+"::"+h.substring(u+p)},c.prototype.toByteArray=function(){var u,p,m,f,h;for(u=[],h=this.parts,p=0,m=h.length;p>8),u.push(f&255);return u},c.prototype.toNormalizedString=function(){var u,p,m;return u=(function(){var f,h,d,v;for(d=this.parts,v=[],f=0,h=d.length;f>8,u&255,p>>8,p&255])},c.prototype.prefixLengthFromSubnetMask=function(){var u,p,m,f,h,d,v;for(v={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},u=0,h=!1,p=m=7;m>=0;p=m+=-1)if(f=this.parts[p],f in v){if(d=v[f],h&&d!==0)return null;d!==16&&(h=!0),u+=d}else return null;return 128-u},c})(),s="(?:[0-9a-f]+::?)+",l="%[0-9a-z]{1,}",i={zoneIndex:new RegExp(l,"i"),native:new RegExp("^(::)?("+s+")?([0-9a-f]+)?(::)?("+l+")?$","i"),transitional:new RegExp("^((?:"+s+")|(?:::)(?:"+s+")?)"+(r+"\\."+r+"\\."+r+"\\."+r)+("("+l+")?$"),"i")},a=function(c,u){var p,m,f,h,d,v;if(c.indexOf("::")!==c.lastIndexOf("::"))return null;for(v=(c.match(i.zoneIndex)||[])[0],v&&(v=v.substring(1),c=c.replace(/%.+$/,"")),p=0,m=-1;(m=c.indexOf(":",m+1))>=0;)p++;if(c.substr(0,2)==="::"&&p--,c.substr(-2,2)==="::"&&p--,p>u)return null;for(d=u-p,h=":";d--;)h+="0:";return c=c.replace("::",h),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),u=(function(){var x,b,E,k;for(E=c.split(":"),k=[],x=0,b=E.length;x=0&&u<=32))return m=[this.parse(p[1]),u],Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m;throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},e.IPv4.subnetMaskFromPrefixLength=function(c){var u,p,m;if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(m=[0,0,0,0],p=0,u=Math.floor(c/8);p=0&&u<=128))return m=[this.parse(p[1]),u],Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},e.isValid=function(c){return e.IPv6.isValid(c)||e.IPv4.isValid(c)},e.parse=function(c){if(e.IPv6.isValid(c))return e.IPv6.parse(c);if(e.IPv4.isValid(c))return e.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},e.parseCIDR=function(c){var u;try{return e.IPv6.parseCIDR(c)}catch(p){u=p;try{return e.IPv4.parseCIDR(c)}catch(m){throw u=m,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},e.fromByteArray=function(c){var u;if(u=c.length,u===4)return new e.IPv4(c);if(u===16)return new e.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},e.process=function(c){var u;return u=this.parse(c),u.kind()==="ipv6"&&u.isIPv4MappedAddress()?u.toIPv4Address():u}}).call($y)});var ep=M((zM,Vo)=>{"use strict";Vo.exports=YC;Vo.exports.all=Ly;Vo.exports.compile=Uy;var ZC=Dy(),Fy=qy(),WC=/^[0-9]+$/,Ho=Fy.isValid,Bo=Fy.parse,My={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function Ly(a,e){var r=ZC(a);if(!e)return r;typeof e!="function"&&(e=Uy(e));for(var t=0;ts)throw new TypeError("invalid range on address: "+a);return[t,i]}function JC(a){var e=Bo(a),r=e.kind();return r==="ipv4"?e.prefixLengthFromSubnetMask():null}function YC(a,e){if(!a)throw new TypeError("req argument is required");if(!e)throw new TypeError("trust argument is required");var r=Ly(a,e),t=r[r.length-1];return t}function e4(){return!1}function t4(a){return function(r){if(!Ho(r))return!1;for(var t=Bo(r),s,i=t.kind(),n=0;n{"use strict";var zy=qo().Buffer,a4=Bu(),Hy=Ln(),By=Or()("express"),s4=fi(),n4=zo().mime,i4=Vu(),o4=ep(),c4=To(),l4=require("querystring");kt.etag=Vy({weak:!1});kt.wetag=Vy({weak:!0});kt.isAbsolute=function(a){if(a[0]==="/"||a[1]===":"&&(a[2]==="\\"||a[2]==="/")||a.substring(0,2)==="\\\\")return!0};kt.flatten=By.function(s4,"utils.flatten: use array-flatten npm module instead");kt.normalizeType=function(a){return~a.indexOf("/")?u4(a):{value:n4.lookup(a),params:{}}};kt.normalizeTypes=function(a){for(var e=[],r=0;r{"use strict";var f4=Rg(),m4=Lu(),rp=Ao(),h4=Jg(),v4=Uu(),Go=tr()("express:application"),g4=sy(),y4=require("http"),b4=xa().compileETag,x4=xa().compileQueryParser,_4=xa().compileTrust,E4=Or()("express"),w4=fi(),tp=mi(),S4=require("path").resolve,cn=Un(),P4=Object.prototype.hasOwnProperty,sp=Array.prototype.slice,mt=Gy=Zy.exports={},ap="@@symbol:trust_proxy_default";mt.init=function(){this.cache={},this.engines={},this.settings={},this.defaultConfiguration()};mt.defaultConfiguration=function(){var e=process.env.NODE_ENV||"development";this.enable("x-powered-by"),this.set("etag","weak"),this.set("env",e),this.set("query parser","extended"),this.set("subdomain offset",2),this.set("trust proxy",!1),Object.defineProperty(this.settings,ap,{configurable:!0,value:!0}),Go("booting in %s mode",e),this.on("mount",function(t){this.settings[ap]===!0&&typeof t.settings["trust proxy fn"]=="function"&&(delete this.settings["trust proxy"],delete this.settings["trust proxy fn"]),cn(this.request,t.request),cn(this.response,t.response),cn(this.engines,t.engines),cn(this.settings,t.settings)}),this.locals=Object.create(null),this.mountpath="/",this.locals.settings=this.settings,this.set("view",g4),this.set("views",S4("views")),this.set("jsonp callback name","callback"),e==="production"&&this.enable("view cache"),Object.defineProperty(this,"router",{get:function(){throw new Error(`'app.router' is deprecated! -Please see the 3.x to 4.x migration guide for details on how to update your app.`)}})};mt.lazyrouter=function(){this._router||(this._router=new m4({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")}),this._router.use(v4(this.get("query parser fn"))),this._router.use(h4.init(this)))};mt.handle=function(e,r,t){var s=this._router,i=t||f4(e,r,{env:this.get("env"),onerror:R4.bind(this)});if(!s){Go("no routes defined on app"),i();return}s.handle(e,r,i)};mt.use=function(e){var r=0,t="/";if(typeof e!="function"){for(var s=e;Array.isArray(s)&&s.length!==0;)s=s[0];typeof s!="function"&&(r=1,t=e)}var i=w4(sp.call(arguments,r));if(i.length===0)throw new TypeError("app.use() requires a middleware function");this.lazyrouter();var n=this._router;return i.forEach(function(o){if(!o||!o.handle||!o.set)return n.use(t,o);Go(".use app under %s",t),o.mountpath=t,o.parent=this,n.use(t,function(c,u,p){var m=c.app;o.handle(c,u,function(f){cn(c,m.request),cn(u,m.response),p(f)})}),o.emit("mount",this)},this),this};mt.route=function(e){return this.lazyrouter(),this._router.route(e)};mt.engine=function(e,r){if(typeof r!="function")throw new Error("callback function required");var t=e[0]!=="."?"."+e:e;return this.engines[t]=r,this};mt.param=function(e,r){if(this.lazyrouter(),Array.isArray(e)){for(var t=0;t1?'directories "'+c.root.slice(0,-1).join('", "')+'" or "'+c.root[c.root.length-1]+'"':'directory "'+c.root+'"',m=new Error('Failed to lookup view "'+e+'" in views '+p);return m.view=c,i(m)}l.cache&&(s[e]=c)}T4(c,l,i)};mt.listen=function(){var e=y4.createServer(this);return e.listen.apply(e,arguments)};function R4(a){this.get("env")!=="test"&&console.error(a.stack||a.toString())}function T4(a,e,r){try{a.render(e,r)}catch(t){r(t)}}});var Jy=M((BM,np)=>{"use strict";np.exports=Xy;np.exports.preferredCharsets=Xy;var k4=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function O4(a){for(var e=a.split(","),r=0,t=0;r0}});var ab=M((VM,ip)=>{"use strict";ip.exports=rb;ip.exports.preferredEncodings=rb;var N4=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function D4(a){for(var e=a.split(","),r=!1,t=1,s=0,i=0;s0}});var cb=M((GM,op)=>{"use strict";op.exports=ob;op.exports.preferredLanguages=ob;var F4=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function L4(a){for(var e=a.split(","),r=0,t=0;r0}});var mb=M((ZM,cp)=>{"use strict";cp.exports=db;cp.exports.preferredMediaTypes=db;var B4=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function V4(a){for(var e=Q4(a),r=0,t=0;r0)if(i.every(function(n){return e.params[n]=="*"||(e.params[n]||"").toLowerCase()==(t.params[n]||"").toLowerCase()}))s|=1;else return null;return{i:r,o:e.i,q:e.q,s}}function db(a,e){var r=V4(a===void 0?"*/*":a||"");if(!e)return r.filter(ub).sort(lb).map(W4);var t=e.map(function(i,n){return G4(i,r,n)});return t.filter(ub).sort(lb).map(function(i){return e[t.indexOf(i)]})}function lb(a,e){return e.q-a.q||e.s-a.s||a.o-e.o||a.i-e.i||0}function W4(a){return a.type+"/"+a.subtype}function ub(a){return a.q>0}function fb(a){for(var e=0,r=0;(r=a.indexOf('"',r))!==-1;)e++,r++;return e}function K4(a){var e=a.indexOf("="),r,t;return e===-1?r=a:(r=a.substr(0,e),t=a.substr(e+1)),[r,t]}function Q4(a){for(var e=a.split(","),r=1,t=0;r{"use strict";var J4=Jy(),Y4=ab(),eI=cb(),tI=mb();lp.exports=rt;lp.exports.Negotiator=rt;function rt(a){if(!(this instanceof rt))return new rt(a);this.request=a}rt.prototype.charset=function(e){var r=this.charsets(e);return r&&r[0]};rt.prototype.charsets=function(e){return J4(this.request.headers["accept-charset"],e)};rt.prototype.encoding=function(e){var r=this.encodings(e);return r&&r[0]};rt.prototype.encodings=function(e){return Y4(this.request.headers["accept-encoding"],e)};rt.prototype.language=function(e){var r=this.languages(e);return r&&r[0]};rt.prototype.languages=function(e){return eI(this.request.headers["accept-language"],e)};rt.prototype.mediaType=function(e){var r=this.mediaTypes(e);return r&&r[0]};rt.prototype.mediaTypes=function(e){return tI(this.request.headers.accept,e)};rt.prototype.preferredCharset=rt.prototype.charset;rt.prototype.preferredCharsets=rt.prototype.charsets;rt.prototype.preferredEncoding=rt.prototype.encoding;rt.prototype.preferredEncodings=rt.prototype.encodings;rt.prototype.preferredLanguage=rt.prototype.language;rt.prototype.preferredLanguages=rt.prototype.languages;rt.prototype.preferredMediaType=rt.prototype.mediaType;rt.prototype.preferredMediaTypes=rt.prototype.mediaTypes});var gb=M((KM,vb)=>{"use strict";var rI=hb(),aI=nu();vb.exports=Wt;function Wt(a){if(!(this instanceof Wt))return new Wt(a);this.headers=a.headers,this.negotiator=new rI(a)}Wt.prototype.type=Wt.prototype.types=function(a){var e=a;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;r{"use strict";var Zo=gb(),yi=Or()("express"),iI=require("net").isIP,oI=Vs(),cI=require("http"),lI=Gu(),uI=Zu(),pI=Ys(),yb=ep(),at=Object.create(cI.IncomingMessage.prototype);bb.exports=at;at.get=at.header=function(e){if(!e)throw new TypeError("name argument is required to req.get");if(typeof e!="string")throw new TypeError("name must be a string to req.get");var r=e.toLowerCase();switch(r){case"referer":case"referrer":return this.headers.referrer||this.headers.referer;default:return this.headers[r]}};at.accepts=function(){var a=Zo(this);return a.types.apply(a,arguments)};at.acceptsEncodings=function(){var a=Zo(this);return a.encodings.apply(a,arguments)};at.acceptsEncoding=yi.function(at.acceptsEncodings,"req.acceptsEncoding: Use acceptsEncodings instead");at.acceptsCharsets=function(){var a=Zo(this);return a.charsets.apply(a,arguments)};at.acceptsCharset=yi.function(at.acceptsCharsets,"req.acceptsCharset: Use acceptsCharsets instead");at.acceptsLanguages=function(){var a=Zo(this);return a.languages.apply(a,arguments)};at.acceptsLanguage=yi.function(at.acceptsLanguages,"req.acceptsLanguage: Use acceptsLanguages instead");at.range=function(e,r){var t=this.get("Range");if(t)return uI(e,t,r)};at.param=function(e,r){var t=this.params||{},s=this.body||{},i=this.query||{},n=arguments.length===1?"name":"name, default";return yi("req.param("+n+"): Use req.params, req.body, or req.query instead"),t[e]!=null&&t.hasOwnProperty(e)?t[e]:s[e]!=null?s[e]:i[e]!=null?i[e]:r};at.is=function(e){var r=e;if(!Array.isArray(e)){r=new Array(arguments.length);for(var t=0;t=200&&r<300||r===304?lI(this.headers,{etag:e.get("ETag"),"last-modified":e.get("Last-Modified")}):!1});Er(at,"stale",function(){return!this.fresh});Er(at,"xhr",function(){var e=this.get("X-Requested-With")||"";return e.toLowerCase()==="xmlhttprequest"});function Er(a,e,r){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:r})}});var wb=M(Wo=>{var Eb=require("crypto");Wo.sign=function(a,e){if(typeof a!="string")throw new TypeError("Cookie value must be provided as a string.");if(typeof e!="string")throw new TypeError("Secret string must be provided.");return a+"."+Eb.createHmac("sha256",e).update(a).digest("base64").replace(/\=+$/,"")};Wo.unsign=function(a,e){if(typeof a!="string")throw new TypeError("Signed cookie string must be provided.");if(typeof e!="string")throw new TypeError("Secret string must be provided.");var r=a.slice(0,a.lastIndexOf(".")),t=Wo.sign(r,e);return _b(t)==_b(a)?r:!1};function _b(a){return Eb.createHash("sha1").update(a).digest("hex")}});var Rb=M(up=>{"use strict";up.parse=gI;up.serialize=yI;var dI=Object.prototype.toString,fI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,mI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,hI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,vI=/^[\u0020-\u003A\u003D-\u007E]*$/;function gI(a,e){if(typeof a!="string")throw new TypeError("argument str must be a string");var r={},t=a.length;if(t<2)return r;var s=e&&e.decode||bI,i=0,n=0,o=0;do{if(n=a.indexOf("=",i),n===-1)break;if(o=a.indexOf(";",i),o===-1)o=t;else if(n>o){i=a.lastIndexOf(";",n-1)+1;continue}var l=Sb(a,i,n),c=Pb(a,n,l),u=a.slice(l,c);if(!r.hasOwnProperty(u)){var p=Sb(a,n+1,o),m=Pb(a,o,p);a.charCodeAt(p)===34&&a.charCodeAt(m-1)===34&&(p++,m--);var f=a.slice(p,m);r[u]=_I(f,s)}i=o+1}while(ir;){var t=a.charCodeAt(--e);if(t!==32&&t!==9)return e+1}return r}function yI(a,e,r){var t=r&&r.encode||encodeURIComponent;if(typeof t!="function")throw new TypeError("option encode is invalid");if(!fI.test(a))throw new TypeError("argument name is invalid");var s=t(e);if(!mI.test(s))throw new TypeError("argument val is invalid");var i=a+"="+s;if(!r)return i;if(r.maxAge!=null){var n=Math.floor(r.maxAge);if(!isFinite(n))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+n}if(r.domain){if(!hI.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain="+r.domain}if(r.path){if(!vI.test(r.path))throw new TypeError("option path is invalid");i+="; Path="+r.path}if(r.expires){var o=r.expires;if(!xI(o)||isNaN(o.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+o.toUTCString()}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.partitioned&&(i+="; Partitioned"),r.priority){var l=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(l){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var c=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i}function bI(a){return a.indexOf("%")!==-1?decodeURIComponent(a):a}function xI(a){return dI.call(a)==="[object Date]"}function _I(a,e){try{return e(a)}catch{return a}}});var dp=M((YM,pp)=>{"use strict";pp.exports=wI;pp.exports.append=kb;var EI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function kb(a,e){if(typeof a!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var r=Array.isArray(e)?e:Tb(String(e)),t=0;t{"use strict";var bi=qo().Buffer,Ob=Bu(),SI=Da(),$t=Or()("express"),PI=Co(),RI=di(),TI=require("http"),kI=xa().isAbsolute,OI=Xn(),Cb=require("path"),Ko=zn(),Ib=mi(),CI=wb().sign,II=xa().normalizeType,AI=xa().normalizeTypes,jI=xa().setCharset,NI=Rb(),fp=zo(),DI=Cb.extname,Ab=fp.mime,$I=Cb.resolve,qI=dp(),nt=Object.create(TI.ServerResponse.prototype);Db.exports=nt;var MI=/;\s*charset\s*=/;nt.status=function(e){return(typeof e=="string"||Math.floor(e)!==e)&&e>99&&e<1e3&&$t("res.status("+JSON.stringify(e)+"): use res.status("+Math.floor(e)+") instead"),this.statusCode=e,this};nt.links=function(a){var e=this.get("Link")||"";return e&&(e+=", "),this.set("Link",e+Object.keys(a).map(function(r){return"<"+a[r]+'>; rel="'+r+'"'}).join(", "))};nt.send=function(e){var r=e,t,s=this.req,i,n=this.app;switch(arguments.length===2&&(typeof arguments[0]!="number"&&typeof arguments[1]=="number"?($t("res.send(body, status): Use res.status(status).send(body) instead"),this.statusCode=arguments[1]):($t("res.send(status, body): Use res.status(status).send(body) instead"),this.statusCode=arguments[0],r=arguments[1])),typeof r=="number"&&arguments.length===1&&(this.get("Content-Type")||this.type("txt"),$t("res.send(status): Use res.sendStatus(status) instead"),this.statusCode=r,r=Ko.message[r]),typeof r){case"string":this.get("Content-Type")||this.type("html");break;case"boolean":case"number":case"object":if(r===null)r="";else if(bi.isBuffer(r))this.get("Content-Type")||this.type("bin");else return this.json(r);break}typeof r=="string"&&(t="utf8",i=this.get("Content-Type"),typeof i=="string"&&this.set("Content-Type",jI(i,"utf-8")));var o=n.get("etag fn"),l=!this.get("ETag")&&typeof o=="function",c;r!==void 0&&(bi.isBuffer(r)?c=r.length:!l&&r.length<1e3?c=bi.byteLength(r,t):(r=bi.from(r,t),t=void 0,c=r.length),this.set("Content-Length",c));var u;return l&&c!==void 0&&(u=o(r,t))&&this.set("ETag",u),s.fresh&&(this.statusCode=304),(this.statusCode===204||this.statusCode===304)&&(this.removeHeader("Content-Type"),this.removeHeader("Content-Length"),this.removeHeader("Transfer-Encoding"),r=""),this.statusCode===205&&(this.set("Content-Length","0"),this.removeHeader("Transfer-Encoding"),r=""),s.method==="HEAD"?this.end():this.end(r,t),this};nt.json=function(e){var r=e;arguments.length===2&&(typeof arguments[1]=="number"?($t("res.json(obj, status): Use res.status(status).json(obj) instead"),this.statusCode=arguments[1]):($t("res.json(status, obj): Use res.status(status).json(obj) instead"),this.statusCode=arguments[0],r=arguments[1]));var t=this.app,s=t.get("json escape"),i=t.get("json replacer"),n=t.get("json spaces"),o=Nb(r,i,n,s);return this.get("Content-Type")||this.set("Content-Type","application/json"),this.send(o)};nt.jsonp=function(e){var r=e;arguments.length===2&&(typeof arguments[1]=="number"?($t("res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[1]):($t("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[0],r=arguments[1]));var t=this.app,s=t.get("json escape"),i=t.get("json replacer"),n=t.get("json spaces"),o=Nb(r,i,n,s),l=this.req.query[t.get("jsonp callback name")];return this.get("Content-Type")||(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","application/json")),Array.isArray(l)&&(l=l[0]),typeof l=="string"&&l.length!==0&&(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","text/javascript"),l=l.replace(/[^\[\]\w$.]/g,""),o===void 0?o="":typeof o=="string"&&(o=o.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")),o="/**/ typeof "+l+" === 'function' && "+l+"("+o+");"),this.send(o)};nt.sendStatus=function(e){var r=Ko.message[e]||String(e);return this.statusCode=e,this.type("txt"),this.send(r)};nt.sendFile=function(e,r,t){var s=t,i=this.req,n=this,o=i.next,l=r||{};if(!e)throw new TypeError("path argument is required to res.sendFile");if(typeof e!="string")throw new TypeError("path must be a string to res.sendFile");if(typeof r=="function"&&(s=r,l={}),!l.root&&!kI(e))throw new TypeError("path must be absolute or specify root to res.sendFile");var c=encodeURI(e),u=fp(i,c,l);jb(n,u,l,function(p){if(s)return s(p);if(p&&p.code==="EISDIR")return o();p&&p.code!=="ECONNABORTED"&&p.syscall!=="write"&&o(p)})};nt.sendfile=function(a,e,r){var t=r,s=this.req,i=this,n=s.next,o=e||{};typeof e=="function"&&(t=e,o={});var l=fp(s,a,o);jb(i,l,o,function(c){if(t)return t(c);if(c&&c.code==="EISDIR")return n();c&&c.code!=="ECONNABORTED"&&c.syscall!=="write"&&n(c)})};nt.sendfile=$t.function(nt.sendfile,"res.sendfile: Use res.sendFile instead");nt.download=function(e,r,t,s){var i=s,n=r,o=t||null;typeof r=="function"?(i=r,n=null,o=null):typeof t=="function"&&(i=t,o=null),typeof r=="object"&&(typeof t=="function"||t===void 0)&&(n=null,o=r);var l={"Content-Disposition":Ob(n||e)};if(o&&o.headers)for(var c=Object.keys(o.headers),u=0;u0?e.accepts(t):!1;return this.vary("Accept"),s?(this.set("Content-Type",II(s).value),a[s](e,this,r)):a.default?a.default(e,this,r):r(SI(406,{types:AI(t).map(function(i){return i.value})})),this};nt.attachment=function(e){return e&&this.type(DI(e)),this.set("Content-Disposition",Ob(e)),this};nt.append=function(e,r){var t=this.get(e),s=r;return t&&(s=Array.isArray(t)?t.concat(r):Array.isArray(r)?[t].concat(r):[t,r]),this.set(e,s)};nt.set=nt.header=function(e,r){if(arguments.length===2){var t=Array.isArray(r)?r.map(String):String(r);if(e.toLowerCase()==="content-type"){if(Array.isArray(t))throw new TypeError("Content-Type cannot be set to an Array");if(!MI.test(t)){var s=Ab.charsets.lookup(t.split(";")[0]);s&&(t+="; charset="+s.toLowerCase())}}this.setHeader(e,t)}else for(var i in e)this.set(i,e[i]);return this};nt.get=function(a){return this.getHeader(a)};nt.clearCookie=function(e,r){r&&(r.maxAge&&$t('res.clearCookie: Passing "options.maxAge" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'),r.expires&&$t('res.clearCookie: Passing "options.expires" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'));var t=Ib({expires:new Date(1),path:"/"},r);return this.cookie(e,"",t)};nt.cookie=function(a,e,r){var t=Ib({},r),s=this.req.secret,i=t.signed;if(i&&!s)throw new Error('cookieParser("secret") required for signed cookies');var n=typeof e=="object"?"j:"+JSON.stringify(e):String(e);if(i&&(n="s:"+CI(n,s)),t.maxAge!=null){var o=t.maxAge-0;isNaN(o)||(t.expires=new Date(Date.now()+o),t.maxAge=Math.floor(o/1e3))}return t.path==null&&(t.path="/"),this.append("Set-Cookie",NI.serialize(a,String(n),t)),this};nt.location=function(e){var r;return e==="back"?($t('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices'),r=this.req.get("Referrer")||"/"):r=String(e),this.set("Location",PI(r))};nt.redirect=function(e){var r=e,t,s=302;arguments.length===2&&(typeof arguments[0]=="number"?(s=arguments[0],r=arguments[1]):($t("res.redirect(url, status): Use res.redirect(status, url) instead"),s=arguments[1])),r=this.location(r).get("Location"),this.format({text:function(){t=Ko.message[s]+". Redirecting to "+r},html:function(){var i=RI(r);t="

"+Ko.message[s]+". Redirecting to "+i+"

"},default:function(){t=""}}),this.statusCode=s,this.set("Content-Length",bi.byteLength(t)),this.req.method==="HEAD"?this.end():this.end(t)};nt.vary=function(a){return!a||Array.isArray(a)&&!a.length?($t("res.vary(): Provide a field name"),this):(qI(this,a),this)};nt.render=function(e,r,t){var s=this.req.app,i=t,n=r||{},o=this.req,l=this;typeof r=="function"&&(i=r,n={}),n._locals=l.locals,i=i||function(c,u){if(c)return o.next(c);l.send(u)},s.render(e,n,i)};function jb(a,e,r,t){var s=!1,i;function n(){if(!s){s=!0;var f=new Error("Request aborted");f.code="ECONNABORTED",t(f)}}function o(){if(!s){s=!0;var f=new Error("EISDIR, read");f.code="EISDIR",t(f)}}function l(f){s||(s=!0,t(f))}function c(){s||(s=!0,t())}function u(){i=!1}function p(f){if(f&&f.code==="ECONNRESET")return n();if(f)return l(f);s||setImmediate(function(){if(i!==!1&&!s){n();return}s||(s=!0,t())})}function m(){i=!0}e.on("directory",o),e.on("end",c),e.on("error",l),e.on("file",u),e.on("stream",m),OI(a,p),r.headers&&e.on("headers",function(h){for(var d=r.headers,v=Object.keys(d),x=0;x&]/g,function(i){switch(i.charCodeAt(0)){case 60:return"\\u003c";case 62:return"\\u003e";case 38:return"\\u0026";default:return i}})),s}});var Mb=M((tF,hp)=>{"use strict";var FI=Co(),LI=di(),mp=Ys(),UI=require("path").resolve,qb=zo(),zI=require("url");hp.exports=HI;hp.exports.mime=qb.mime;function HI(a,e){if(!a)throw new TypeError("root path required");if(typeof a!="string")throw new TypeError("root path must be a string");var r=Object.create(e||null),t=r.fallthrough!==!1,s=r.redirect!==!1,i=r.setHeaders;if(i&&typeof i!="function")throw new TypeError("option setHeaders must be function");r.maxage=r.maxage||r.maxAge||0,r.root=UI(a);var n=s?ZI():GI();return function(l,c,u){if(l.method!=="GET"&&l.method!=="HEAD"){if(t)return u();c.statusCode=405,c.setHeader("Allow","GET, HEAD"),c.setHeader("Content-Length","0"),c.end();return}var p=!t,m=mp.original(l),f=mp(l).pathname;f==="/"&&m.pathname.substr(-1)!=="/"&&(f="");var h=qb(l,f,r);h.on("directory",n),i&&h.on("headers",i),t&&h.on("file",function(){p=!0}),h.on("error",function(v){if(p||!(v.statusCode<500)){u(v);return}u()}),h.pipe(c)}}function BI(a){for(var e=0;e1?"/"+a.substr(e):a}function VI(a,e){return` +Please see the 3.x to 4.x migration guide for details on how to update your app.`)}})};mt.lazyrouter=function(){this._router||(this._router=new m4({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")}),this._router.use(v4(this.get("query parser fn"))),this._router.use(h4.init(this)))};mt.handle=function(e,r,t){var s=this._router,i=t||f4(e,r,{env:this.get("env"),onerror:R4.bind(this)});if(!s){Go("no routes defined on app"),i();return}s.handle(e,r,i)};mt.use=function(e){var r=0,t="/";if(typeof e!="function"){for(var s=e;Array.isArray(s)&&s.length!==0;)s=s[0];typeof s!="function"&&(r=1,t=e)}var i=w4(sp.call(arguments,r));if(i.length===0)throw new TypeError("app.use() requires a middleware function");this.lazyrouter();var n=this._router;return i.forEach(function(o){if(!o||!o.handle||!o.set)return n.use(t,o);Go(".use app under %s",t),o.mountpath=t,o.parent=this,n.use(t,function(c,u,p){var m=c.app;o.handle(c,u,function(f){cn(c,m.request),cn(u,m.response),p(f)})}),o.emit("mount",this)},this),this};mt.route=function(e){return this.lazyrouter(),this._router.route(e)};mt.engine=function(e,r){if(typeof r!="function")throw new Error("callback function required");var t=e[0]!=="."?"."+e:e;return this.engines[t]=r,this};mt.param=function(e,r){if(this.lazyrouter(),Array.isArray(e)){for(var t=0;t1?'directories "'+c.root.slice(0,-1).join('", "')+'" or "'+c.root[c.root.length-1]+'"':'directory "'+c.root+'"',m=new Error('Failed to lookup view "'+e+'" in views '+p);return m.view=c,i(m)}l.cache&&(s[e]=c)}T4(c,l,i)};mt.listen=function(){var e=y4.createServer(this);return e.listen.apply(e,arguments)};function R4(a){this.get("env")!=="test"&&console.error(a.stack||a.toString())}function T4(a,e,r){try{a.render(e,r)}catch(t){r(t)}}});var Jy=M((BM,np)=>{"use strict";np.exports=Xy;np.exports.preferredCharsets=Xy;var k4=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function O4(a){for(var e=a.split(","),r=0,t=0;r0}});var ab=M((VM,ip)=>{"use strict";ip.exports=rb;ip.exports.preferredEncodings=rb;var N4=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function D4(a){for(var e=a.split(","),r=!1,t=1,s=0,i=0;s0}});var cb=M((GM,op)=>{"use strict";op.exports=ob;op.exports.preferredLanguages=ob;var F4=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function L4(a){for(var e=a.split(","),r=0,t=0;r0}});var mb=M((ZM,cp)=>{"use strict";cp.exports=db;cp.exports.preferredMediaTypes=db;var B4=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function V4(a){for(var e=Q4(a),r=0,t=0;r0)if(i.every(function(n){return e.params[n]=="*"||(e.params[n]||"").toLowerCase()==(t.params[n]||"").toLowerCase()}))s|=1;else return null;return{i:r,o:e.i,q:e.q,s}}function db(a,e){var r=V4(a===void 0?"*/*":a||"");if(!e)return r.filter(ub).sort(lb).map(W4);var t=e.map(function(i,n){return G4(i,r,n)});return t.filter(ub).sort(lb).map(function(i){return e[t.indexOf(i)]})}function lb(a,e){return e.q-a.q||e.s-a.s||a.o-e.o||a.i-e.i||0}function W4(a){return a.type+"/"+a.subtype}function ub(a){return a.q>0}function fb(a){for(var e=0,r=0;(r=a.indexOf('"',r))!==-1;)e++,r++;return e}function K4(a){var e=a.indexOf("="),r,t;return e===-1?r=a:(r=a.substr(0,e),t=a.substr(e+1)),[r,t]}function Q4(a){for(var e=a.split(","),r=1,t=0;r{"use strict";var J4=Jy(),Y4=ab(),eI=cb(),tI=mb();lp.exports=rt;lp.exports.Negotiator=rt;function rt(a){if(!(this instanceof rt))return new rt(a);this.request=a}rt.prototype.charset=function(e){var r=this.charsets(e);return r&&r[0]};rt.prototype.charsets=function(e){return J4(this.request.headers["accept-charset"],e)};rt.prototype.encoding=function(e){var r=this.encodings(e);return r&&r[0]};rt.prototype.encodings=function(e){return Y4(this.request.headers["accept-encoding"],e)};rt.prototype.language=function(e){var r=this.languages(e);return r&&r[0]};rt.prototype.languages=function(e){return eI(this.request.headers["accept-language"],e)};rt.prototype.mediaType=function(e){var r=this.mediaTypes(e);return r&&r[0]};rt.prototype.mediaTypes=function(e){return tI(this.request.headers.accept,e)};rt.prototype.preferredCharset=rt.prototype.charset;rt.prototype.preferredCharsets=rt.prototype.charsets;rt.prototype.preferredEncoding=rt.prototype.encoding;rt.prototype.preferredEncodings=rt.prototype.encodings;rt.prototype.preferredLanguage=rt.prototype.language;rt.prototype.preferredLanguages=rt.prototype.languages;rt.prototype.preferredMediaType=rt.prototype.mediaType;rt.prototype.preferredMediaTypes=rt.prototype.mediaTypes});var gb=M((KM,vb)=>{"use strict";var rI=hb(),aI=nu();vb.exports=Kt;function Kt(a){if(!(this instanceof Kt))return new Kt(a);this.headers=a.headers,this.negotiator=new rI(a)}Kt.prototype.type=Kt.prototype.types=function(a){var e=a;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;r{"use strict";var Zo=gb(),yi=Or()("express"),iI=require("net").isIP,oI=Vs(),cI=require("http"),lI=Gu(),uI=Zu(),pI=Ys(),yb=ep(),at=Object.create(cI.IncomingMessage.prototype);bb.exports=at;at.get=at.header=function(e){if(!e)throw new TypeError("name argument is required to req.get");if(typeof e!="string")throw new TypeError("name must be a string to req.get");var r=e.toLowerCase();switch(r){case"referer":case"referrer":return this.headers.referrer||this.headers.referer;default:return this.headers[r]}};at.accepts=function(){var a=Zo(this);return a.types.apply(a,arguments)};at.acceptsEncodings=function(){var a=Zo(this);return a.encodings.apply(a,arguments)};at.acceptsEncoding=yi.function(at.acceptsEncodings,"req.acceptsEncoding: Use acceptsEncodings instead");at.acceptsCharsets=function(){var a=Zo(this);return a.charsets.apply(a,arguments)};at.acceptsCharset=yi.function(at.acceptsCharsets,"req.acceptsCharset: Use acceptsCharsets instead");at.acceptsLanguages=function(){var a=Zo(this);return a.languages.apply(a,arguments)};at.acceptsLanguage=yi.function(at.acceptsLanguages,"req.acceptsLanguage: Use acceptsLanguages instead");at.range=function(e,r){var t=this.get("Range");if(t)return uI(e,t,r)};at.param=function(e,r){var t=this.params||{},s=this.body||{},i=this.query||{},n=arguments.length===1?"name":"name, default";return yi("req.param("+n+"): Use req.params, req.body, or req.query instead"),t[e]!=null&&t.hasOwnProperty(e)?t[e]:s[e]!=null?s[e]:i[e]!=null?i[e]:r};at.is=function(e){var r=e;if(!Array.isArray(e)){r=new Array(arguments.length);for(var t=0;t=200&&r<300||r===304?lI(this.headers,{etag:e.get("ETag"),"last-modified":e.get("Last-Modified")}):!1});Er(at,"stale",function(){return!this.fresh});Er(at,"xhr",function(){var e=this.get("X-Requested-With")||"";return e.toLowerCase()==="xmlhttprequest"});function Er(a,e,r){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:r})}});var wb=M(Wo=>{var Eb=require("crypto");Wo.sign=function(a,e){if(typeof a!="string")throw new TypeError("Cookie value must be provided as a string.");if(typeof e!="string")throw new TypeError("Secret string must be provided.");return a+"."+Eb.createHmac("sha256",e).update(a).digest("base64").replace(/\=+$/,"")};Wo.unsign=function(a,e){if(typeof a!="string")throw new TypeError("Signed cookie string must be provided.");if(typeof e!="string")throw new TypeError("Secret string must be provided.");var r=a.slice(0,a.lastIndexOf(".")),t=Wo.sign(r,e);return _b(t)==_b(a)?r:!1};function _b(a){return Eb.createHash("sha1").update(a).digest("hex")}});var Rb=M(up=>{"use strict";up.parse=gI;up.serialize=yI;var dI=Object.prototype.toString,fI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,mI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,hI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,vI=/^[\u0020-\u003A\u003D-\u007E]*$/;function gI(a,e){if(typeof a!="string")throw new TypeError("argument str must be a string");var r={},t=a.length;if(t<2)return r;var s=e&&e.decode||bI,i=0,n=0,o=0;do{if(n=a.indexOf("=",i),n===-1)break;if(o=a.indexOf(";",i),o===-1)o=t;else if(n>o){i=a.lastIndexOf(";",n-1)+1;continue}var l=Sb(a,i,n),c=Pb(a,n,l),u=a.slice(l,c);if(!r.hasOwnProperty(u)){var p=Sb(a,n+1,o),m=Pb(a,o,p);a.charCodeAt(p)===34&&a.charCodeAt(m-1)===34&&(p++,m--);var f=a.slice(p,m);r[u]=_I(f,s)}i=o+1}while(ir;){var t=a.charCodeAt(--e);if(t!==32&&t!==9)return e+1}return r}function yI(a,e,r){var t=r&&r.encode||encodeURIComponent;if(typeof t!="function")throw new TypeError("option encode is invalid");if(!fI.test(a))throw new TypeError("argument name is invalid");var s=t(e);if(!mI.test(s))throw new TypeError("argument val is invalid");var i=a+"="+s;if(!r)return i;if(r.maxAge!=null){var n=Math.floor(r.maxAge);if(!isFinite(n))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+n}if(r.domain){if(!hI.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain="+r.domain}if(r.path){if(!vI.test(r.path))throw new TypeError("option path is invalid");i+="; Path="+r.path}if(r.expires){var o=r.expires;if(!xI(o)||isNaN(o.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+o.toUTCString()}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.partitioned&&(i+="; Partitioned"),r.priority){var l=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(l){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var c=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i}function bI(a){return a.indexOf("%")!==-1?decodeURIComponent(a):a}function xI(a){return dI.call(a)==="[object Date]"}function _I(a,e){try{return e(a)}catch{return a}}});var dp=M((YM,pp)=>{"use strict";pp.exports=wI;pp.exports.append=kb;var EI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function kb(a,e){if(typeof a!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var r=Array.isArray(e)?e:Tb(String(e)),t=0;t{"use strict";var bi=qo().Buffer,Ob=Bu(),SI=Da(),$t=Or()("express"),PI=Co(),RI=di(),TI=require("http"),kI=xa().isAbsolute,OI=Xn(),Cb=require("path"),Ko=zn(),Ib=mi(),CI=wb().sign,II=xa().normalizeType,AI=xa().normalizeTypes,jI=xa().setCharset,NI=Rb(),fp=zo(),DI=Cb.extname,Ab=fp.mime,$I=Cb.resolve,qI=dp(),nt=Object.create(TI.ServerResponse.prototype);Db.exports=nt;var MI=/;\s*charset\s*=/;nt.status=function(e){return(typeof e=="string"||Math.floor(e)!==e)&&e>99&&e<1e3&&$t("res.status("+JSON.stringify(e)+"): use res.status("+Math.floor(e)+") instead"),this.statusCode=e,this};nt.links=function(a){var e=this.get("Link")||"";return e&&(e+=", "),this.set("Link",e+Object.keys(a).map(function(r){return"<"+a[r]+'>; rel="'+r+'"'}).join(", "))};nt.send=function(e){var r=e,t,s=this.req,i,n=this.app;switch(arguments.length===2&&(typeof arguments[0]!="number"&&typeof arguments[1]=="number"?($t("res.send(body, status): Use res.status(status).send(body) instead"),this.statusCode=arguments[1]):($t("res.send(status, body): Use res.status(status).send(body) instead"),this.statusCode=arguments[0],r=arguments[1])),typeof r=="number"&&arguments.length===1&&(this.get("Content-Type")||this.type("txt"),$t("res.send(status): Use res.sendStatus(status) instead"),this.statusCode=r,r=Ko.message[r]),typeof r){case"string":this.get("Content-Type")||this.type("html");break;case"boolean":case"number":case"object":if(r===null)r="";else if(bi.isBuffer(r))this.get("Content-Type")||this.type("bin");else return this.json(r);break}typeof r=="string"&&(t="utf8",i=this.get("Content-Type"),typeof i=="string"&&this.set("Content-Type",jI(i,"utf-8")));var o=n.get("etag fn"),l=!this.get("ETag")&&typeof o=="function",c;r!==void 0&&(bi.isBuffer(r)?c=r.length:!l&&r.length<1e3?c=bi.byteLength(r,t):(r=bi.from(r,t),t=void 0,c=r.length),this.set("Content-Length",c));var u;return l&&c!==void 0&&(u=o(r,t))&&this.set("ETag",u),s.fresh&&(this.statusCode=304),(this.statusCode===204||this.statusCode===304)&&(this.removeHeader("Content-Type"),this.removeHeader("Content-Length"),this.removeHeader("Transfer-Encoding"),r=""),this.statusCode===205&&(this.set("Content-Length","0"),this.removeHeader("Transfer-Encoding"),r=""),s.method==="HEAD"?this.end():this.end(r,t),this};nt.json=function(e){var r=e;arguments.length===2&&(typeof arguments[1]=="number"?($t("res.json(obj, status): Use res.status(status).json(obj) instead"),this.statusCode=arguments[1]):($t("res.json(status, obj): Use res.status(status).json(obj) instead"),this.statusCode=arguments[0],r=arguments[1]));var t=this.app,s=t.get("json escape"),i=t.get("json replacer"),n=t.get("json spaces"),o=Nb(r,i,n,s);return this.get("Content-Type")||this.set("Content-Type","application/json"),this.send(o)};nt.jsonp=function(e){var r=e;arguments.length===2&&(typeof arguments[1]=="number"?($t("res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[1]):($t("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[0],r=arguments[1]));var t=this.app,s=t.get("json escape"),i=t.get("json replacer"),n=t.get("json spaces"),o=Nb(r,i,n,s),l=this.req.query[t.get("jsonp callback name")];return this.get("Content-Type")||(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","application/json")),Array.isArray(l)&&(l=l[0]),typeof l=="string"&&l.length!==0&&(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","text/javascript"),l=l.replace(/[^\[\]\w$.]/g,""),o===void 0?o="":typeof o=="string"&&(o=o.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")),o="/**/ typeof "+l+" === 'function' && "+l+"("+o+");"),this.send(o)};nt.sendStatus=function(e){var r=Ko.message[e]||String(e);return this.statusCode=e,this.type("txt"),this.send(r)};nt.sendFile=function(e,r,t){var s=t,i=this.req,n=this,o=i.next,l=r||{};if(!e)throw new TypeError("path argument is required to res.sendFile");if(typeof e!="string")throw new TypeError("path must be a string to res.sendFile");if(typeof r=="function"&&(s=r,l={}),!l.root&&!kI(e))throw new TypeError("path must be absolute or specify root to res.sendFile");var c=encodeURI(e),u=fp(i,c,l);jb(n,u,l,function(p){if(s)return s(p);if(p&&p.code==="EISDIR")return o();p&&p.code!=="ECONNABORTED"&&p.syscall!=="write"&&o(p)})};nt.sendfile=function(a,e,r){var t=r,s=this.req,i=this,n=s.next,o=e||{};typeof e=="function"&&(t=e,o={});var l=fp(s,a,o);jb(i,l,o,function(c){if(t)return t(c);if(c&&c.code==="EISDIR")return n();c&&c.code!=="ECONNABORTED"&&c.syscall!=="write"&&n(c)})};nt.sendfile=$t.function(nt.sendfile,"res.sendfile: Use res.sendFile instead");nt.download=function(e,r,t,s){var i=s,n=r,o=t||null;typeof r=="function"?(i=r,n=null,o=null):typeof t=="function"&&(i=t,o=null),typeof r=="object"&&(typeof t=="function"||t===void 0)&&(n=null,o=r);var l={"Content-Disposition":Ob(n||e)};if(o&&o.headers)for(var c=Object.keys(o.headers),u=0;u0?e.accepts(t):!1;return this.vary("Accept"),s?(this.set("Content-Type",II(s).value),a[s](e,this,r)):a.default?a.default(e,this,r):r(SI(406,{types:AI(t).map(function(i){return i.value})})),this};nt.attachment=function(e){return e&&this.type(DI(e)),this.set("Content-Disposition",Ob(e)),this};nt.append=function(e,r){var t=this.get(e),s=r;return t&&(s=Array.isArray(t)?t.concat(r):Array.isArray(r)?[t].concat(r):[t,r]),this.set(e,s)};nt.set=nt.header=function(e,r){if(arguments.length===2){var t=Array.isArray(r)?r.map(String):String(r);if(e.toLowerCase()==="content-type"){if(Array.isArray(t))throw new TypeError("Content-Type cannot be set to an Array");if(!MI.test(t)){var s=Ab.charsets.lookup(t.split(";")[0]);s&&(t+="; charset="+s.toLowerCase())}}this.setHeader(e,t)}else for(var i in e)this.set(i,e[i]);return this};nt.get=function(a){return this.getHeader(a)};nt.clearCookie=function(e,r){r&&(r.maxAge&&$t('res.clearCookie: Passing "options.maxAge" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'),r.expires&&$t('res.clearCookie: Passing "options.expires" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'));var t=Ib({expires:new Date(1),path:"/"},r);return this.cookie(e,"",t)};nt.cookie=function(a,e,r){var t=Ib({},r),s=this.req.secret,i=t.signed;if(i&&!s)throw new Error('cookieParser("secret") required for signed cookies');var n=typeof e=="object"?"j:"+JSON.stringify(e):String(e);if(i&&(n="s:"+CI(n,s)),t.maxAge!=null){var o=t.maxAge-0;isNaN(o)||(t.expires=new Date(Date.now()+o),t.maxAge=Math.floor(o/1e3))}return t.path==null&&(t.path="/"),this.append("Set-Cookie",NI.serialize(a,String(n),t)),this};nt.location=function(e){var r;return e==="back"?($t('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices'),r=this.req.get("Referrer")||"/"):r=String(e),this.set("Location",PI(r))};nt.redirect=function(e){var r=e,t,s=302;arguments.length===2&&(typeof arguments[0]=="number"?(s=arguments[0],r=arguments[1]):($t("res.redirect(url, status): Use res.redirect(status, url) instead"),s=arguments[1])),r=this.location(r).get("Location"),this.format({text:function(){t=Ko.message[s]+". Redirecting to "+r},html:function(){var i=RI(r);t="

"+Ko.message[s]+". Redirecting to "+i+"

"},default:function(){t=""}}),this.statusCode=s,this.set("Content-Length",bi.byteLength(t)),this.req.method==="HEAD"?this.end():this.end(t)};nt.vary=function(a){return!a||Array.isArray(a)&&!a.length?($t("res.vary(): Provide a field name"),this):(qI(this,a),this)};nt.render=function(e,r,t){var s=this.req.app,i=t,n=r||{},o=this.req,l=this;typeof r=="function"&&(i=r,n={}),n._locals=l.locals,i=i||function(c,u){if(c)return o.next(c);l.send(u)},s.render(e,n,i)};function jb(a,e,r,t){var s=!1,i;function n(){if(!s){s=!0;var f=new Error("Request aborted");f.code="ECONNABORTED",t(f)}}function o(){if(!s){s=!0;var f=new Error("EISDIR, read");f.code="EISDIR",t(f)}}function l(f){s||(s=!0,t(f))}function c(){s||(s=!0,t())}function u(){i=!1}function p(f){if(f&&f.code==="ECONNRESET")return n();if(f)return l(f);s||setImmediate(function(){if(i!==!1&&!s){n();return}s||(s=!0,t())})}function m(){i=!0}e.on("directory",o),e.on("end",c),e.on("error",l),e.on("file",u),e.on("stream",m),OI(a,p),r.headers&&e.on("headers",function(h){for(var d=r.headers,v=Object.keys(d),x=0;x&]/g,function(i){switch(i.charCodeAt(0)){case 60:return"\\u003c";case 62:return"\\u003e";case 38:return"\\u0026";default:return i}})),s}});var Mb=M((tF,hp)=>{"use strict";var FI=Co(),LI=di(),mp=Ys(),UI=require("path").resolve,qb=zo(),zI=require("url");hp.exports=HI;hp.exports.mime=qb.mime;function HI(a,e){if(!a)throw new TypeError("root path required");if(typeof a!="string")throw new TypeError("root path must be a string");var r=Object.create(e||null),t=r.fallthrough!==!1,s=r.redirect!==!1,i=r.setHeaders;if(i&&typeof i!="function")throw new TypeError("option setHeaders must be function");r.maxage=r.maxage||r.maxAge||0,r.root=UI(a);var n=s?ZI():GI();return function(l,c,u){if(l.method!=="GET"&&l.method!=="HEAD"){if(t)return u();c.statusCode=405,c.setHeader("Allow","GET, HEAD"),c.setHeader("Content-Length","0"),c.end();return}var p=!t,m=mp.original(l),f=mp(l).pathname;f==="/"&&m.pathname.substr(-1)!=="/"&&(f="");var h=qb(l,f,r);h.on("directory",n),i&&h.on("headers",i),t&&h.on("file",function(){p=!0}),h.on("error",function(v){if(p||!(v.statusCode<500)){u(v);return}u()}),h.pipe(c)}}function BI(a){for(var e=0;e1?"/"+a.substr(e):a}function VI(a,e){return` @@ -49,11 +49,11 @@ Please see the 3.x to 4.x migration guide for details on how to update your app.
`+e+`
-`}function GI(){return function(){this.error(404)}}function ZI(){return function(e){if(this.hasTrailingSlash()){this.error(404);return}var r=mp.original(this.req);r.path=null,r.pathname=BI(r.pathname+"/");var t=FI(zI.format(r)),s=VI("Redirecting","Redirecting to "+LI(t));e.statusCode=301,e.setHeader("Content-Type","text/html; charset=UTF-8"),e.setHeader("Content-Length",Buffer.byteLength(s)),e.setHeader("Content-Security-Policy","default-src 'none'"),e.setHeader("X-Content-Type-Options","nosniff"),e.setHeader("Location",t),e.end(s)}}});var Bb=M((qt,Hb)=>{"use strict";var Qo=dg(),WI=require("events").EventEmitter,Fb=mg(),Lb=Wy(),KI=Mu(),QI=Lu(),Ub=xb(),zb=$b();qt=Hb.exports=XI;function XI(){var a=function(e,r,t){a.handle(e,r,t)};return Fb(a,WI.prototype,!1),Fb(a,Lb,!1),a.request=Object.create(Ub,{app:{configurable:!0,enumerable:!0,writable:!0,value:a}}),a.response=Object.create(zb,{app:{configurable:!0,enumerable:!0,writable:!0,value:a}}),a.init(),a}qt.application=Lb;qt.request=Ub;qt.response=zb;qt.Route=KI;qt.Router=QI;qt.json=Qo.json;qt.query=Uu();qt.raw=Qo.raw;qt.static=Mb();qt.text=Qo.text;qt.urlencoded=Qo.urlencoded;var JI=["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"];JI.forEach(function(a){Object.defineProperty(qt,a,{get:function(){throw new Error("Most middleware (like "+a+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})})});var Gb=M((rF,Vb)=>{"use strict";Vb.exports=Bb()});var Kb=M((aF,Wb)=>{"use strict";var Zb=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,eA=Object.prototype.propertyIsEnumerable;function tA(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function rA(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var t=Object.getOwnPropertyNames(e).map(function(i){return e[i]});if(t.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(i){s[i]=i}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Wb.exports=rA()?Object.assign:function(a,e){for(var r,t=tA(a),s,i=1;i{(function(){"use strict";var a=Kb(),e=dp(),r={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function t(h){return typeof h=="string"||h instanceof String}function s(h,d){if(Array.isArray(d)){for(var v=0;v{(function(a,e){typeof hc=="object"&&typeof Ix<"u"?e(hc):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{})})(hc,(function(a){"use strict";function e(){for(var N=arguments.length,T=Array(N),y=0;y1){T[0]=T[0].slice(0,-1);for(var g=T.length-1,S=1;S= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=f-h,F=Math.floor,q=String.fromCharCode;function C(N){throw new RangeError($[N])}function R(N,T){for(var y=[],g=N.length;g--;)y[g]=T(N[g]);return y}function j(N,T){var y=N.split("@"),g="";y.length>1&&(g=y[0]+"@",N=y[1]),N=N.replace(I,".");var S=N.split("."),D=R(S,T).join(".");return g+D}function z(N){for(var T=[],y=0,g=N.length;y=55296&&S<=56319&&y>1,T+=F(T/y);T>A*d>>1;S+=f)T=F(T/A);return F(S+(A+1)*T/(T+v))},V=function(T){var y=[],g=T.length,S=0,D=E,L=b,K=T.lastIndexOf(k);K<0&&(K=0);for(var ne=0;ne=128&&C("not-basic"),y.push(T.charCodeAt(ne));for(var ge=K>0?K+1:0;ge=g&&C("invalid-input");var Re=G(T.charCodeAt(ge++));(Re>=f||Re>F((m-S)/Ae))&&C("overflow"),S+=Re*Ae;var ye=ve<=L?h:ve>=L+d?d:ve-L;if(ReF(m/Te)&&C("overflow"),Ae*=Te}var de=y.length+1;L=X(S-pe,de,pe==0),F(S/de)>m-D&&C("overflow"),D+=F(S/de),S%=de,y.splice(S++,0,D)}return String.fromCodePoint.apply(String,y)},re=function(T){var y=[];T=z(T);var g=T.length,S=E,D=0,L=b,K=!0,ne=!1,ge=void 0;try{for(var pe=T[Symbol.iterator](),Ae;!(K=(Ae=pe.next()).done);K=!0){var ve=Ae.value;ve<128&&y.push(q(ve))}}catch(At){ne=!0,ge=At}finally{try{!K&&pe.return&&pe.return()}finally{if(ne)throw ge}}var Re=y.length,ye=Re;for(Re&&y.push(k);ye=S&&stF((m-D)/Fe)&&C("overflow"),D+=(Te-S)*Fe,S=Te;var it=!0,dt=!1,ft=void 0;try{for(var Ht=T[Symbol.iterator](),It;!(it=(It=Ht.next()).done);it=!0){var Tr=It.value;if(Trm&&C("overflow"),Tr==S){for(var vr=D,gr=f;;gr+=f){var St=gr<=L?h:gr>=L+d?d:gr-L;if(vr>6|192).toString(16).toUpperCase()+"%"+(T&63|128).toString(16).toUpperCase():y="%"+(T>>12|224).toString(16).toUpperCase()+"%"+(T>>6&63|128).toString(16).toUpperCase()+"%"+(T&63|128).toString(16).toUpperCase(),y}function Oe(N){for(var T="",y=0,g=N.length;y=194&&S<224){if(g-y>=6){var D=parseInt(N.substr(y+4,2),16);T+=String.fromCharCode((S&31)<<6|D&63)}else T+=N.substr(y,6);y+=6}else if(S>=224){if(g-y>=9){var L=parseInt(N.substr(y+4,2),16),K=parseInt(N.substr(y+7,2),16);T+=String.fromCharCode((S&15)<<12|(L&63)<<6|K&63)}else T+=N.substr(y,9);y+=9}else T+=N.substr(y,3),y+=3}return T}function U(N,T){function y(g){var S=Oe(g);return S.match(T.UNRESERVED)?S:g}return N.scheme&&(N.scheme=String(N.scheme).replace(T.PCT_ENCODED,y).toLowerCase().replace(T.NOT_SCHEME,"")),N.userinfo!==void 0&&(N.userinfo=String(N.userinfo).replace(T.PCT_ENCODED,y).replace(T.NOT_USERINFO,xe).replace(T.PCT_ENCODED,s)),N.host!==void 0&&(N.host=String(N.host).replace(T.PCT_ENCODED,y).toLowerCase().replace(T.NOT_HOST,xe).replace(T.PCT_ENCODED,s)),N.path!==void 0&&(N.path=String(N.path).replace(T.PCT_ENCODED,y).replace(N.scheme?T.NOT_PATH:T.NOT_PATH_NOSCHEME,xe).replace(T.PCT_ENCODED,s)),N.query!==void 0&&(N.query=String(N.query).replace(T.PCT_ENCODED,y).replace(T.NOT_QUERY,xe).replace(T.PCT_ENCODED,s)),N.fragment!==void 0&&(N.fragment=String(N.fragment).replace(T.PCT_ENCODED,y).replace(T.NOT_FRAGMENT,xe).replace(T.PCT_ENCODED,s)),N}function Z(N){return N.replace(/^0*(.*)/,"$1")||"0"}function ee(N,T){var y=N.match(T.IPV4ADDRESS)||[],g=u(y,2),S=g[1];return S?S.split(".").map(Z).join("."):N}function ue(N,T){var y=N.match(T.IPV6ADDRESS)||[],g=u(y,3),S=g[1],D=g[2];if(S){for(var L=S.toLowerCase().split("::").reverse(),K=u(L,2),ne=K[0],ge=K[1],pe=ge?ge.split(":").map(Z):[],Ae=ne.split(":").map(Z),ve=T.IPV4ADDRESS.test(Ae[Ae.length-1]),Re=ve?7:8,ye=Ae.length-Re,Te=Array(Re),de=0;de1){var Me=Te.slice(0,Ne.index),st=Te.slice(Ne.index+Ne.length);pt=Me.join(":")+"::"+st.join(":")}else pt=Te.join(":");return D&&(pt+="%"+D),pt}else return N}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Q="".match(/(){0}/)[1]===void 0;function ie(N){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={},g=T.iri!==!1?c:l;T.reference==="suffix"&&(N=(T.scheme?T.scheme+":":"")+"//"+N);var S=N.match(W);if(S){Q?(y.scheme=S[1],y.userinfo=S[3],y.host=S[4],y.port=parseInt(S[5],10),y.path=S[6]||"",y.query=S[7],y.fragment=S[8],isNaN(y.port)&&(y.port=S[5])):(y.scheme=S[1]||void 0,y.userinfo=N.indexOf("@")!==-1?S[3]:void 0,y.host=N.indexOf("//")!==-1?S[4]:void 0,y.port=parseInt(S[5],10),y.path=S[6]||"",y.query=N.indexOf("?")!==-1?S[7]:void 0,y.fragment=N.indexOf("#")!==-1?S[8]:void 0,isNaN(y.port)&&(y.port=N.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?S[4]:void 0)),y.host&&(y.host=ue(ee(y.host,g),g)),y.scheme===void 0&&y.userinfo===void 0&&y.host===void 0&&y.port===void 0&&!y.path&&y.query===void 0?y.reference="same-document":y.scheme===void 0?y.reference="relative":y.fragment===void 0?y.reference="absolute":y.reference="uri",T.reference&&T.reference!=="suffix"&&T.reference!==y.reference&&(y.error=y.error||"URI is not a "+T.reference+" reference.");var D=qe[(T.scheme||y.scheme||"").toLowerCase()];if(!T.unicodeSupport&&(!D||!D.unicodeSupport)){if(y.host&&(T.domainHost||D&&D.domainHost))try{y.host=be.toASCII(y.host.replace(g.PCT_ENCODED,Oe).toLowerCase())}catch(L){y.error=y.error||"Host's domain name can not be converted to ASCII via punycode: "+L}U(y,l)}else U(y,g);D&&D.parse&&D.parse(y,T)}else y.error=y.error||"URI can not be parsed.";return y}function Ie(N,T){var y=T.iri!==!1?c:l,g=[];return N.userinfo!==void 0&&(g.push(N.userinfo),g.push("@")),N.host!==void 0&&g.push(ue(ee(String(N.host),y),y).replace(y.IPV6ADDRESS,function(S,D,L){return"["+D+(L?"%25"+L:"")+"]"})),(typeof N.port=="number"||typeof N.port=="string")&&(g.push(":"),g.push(String(N.port))),g.length?g.join(""):void 0}var he=/^\.\.?\//,Ze=/^\/\.(\/|$)/,We=/^\/\.\.(\/|$)/,Ee=/^\/?(?:.|\n)*?(?=\/|$)/;function Ye(N){for(var T=[];N.length;)if(N.match(he))N=N.replace(he,"");else if(N.match(Ze))N=N.replace(Ze,"/");else if(N.match(We))N=N.replace(We,"/"),T.pop();else if(N==="."||N==="..")N="";else{var y=N.match(Ee);if(y){var g=y[0];N=N.slice(g.length),T.push(g)}else throw new Error("Unexpected dot segment condition")}return T.join("")}function Ue(N){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=T.iri?c:l,g=[],S=qe[(T.scheme||N.scheme||"").toLowerCase()];if(S&&S.serialize&&S.serialize(N,T),N.host&&!y.IPV6ADDRESS.test(N.host)){if(T.domainHost||S&&S.domainHost)try{N.host=T.iri?be.toUnicode(N.host):be.toASCII(N.host.replace(y.PCT_ENCODED,Oe).toLowerCase())}catch(K){N.error=N.error||"Host's domain name can not be converted to "+(T.iri?"Unicode":"ASCII")+" via punycode: "+K}}U(N,y),T.reference!=="suffix"&&N.scheme&&(g.push(N.scheme),g.push(":"));var D=Ie(N,T);if(D!==void 0&&(T.reference!=="suffix"&&g.push("//"),g.push(D),N.path&&N.path.charAt(0)!=="/"&&g.push("/")),N.path!==void 0){var L=N.path;!T.absolutePath&&(!S||!S.absolutePath)&&(L=Ye(L)),D===void 0&&(L=L.replace(/^\/\//,"/%2F")),g.push(L)}return N.query!==void 0&&(g.push("?"),g.push(N.query)),N.fragment!==void 0&&(g.push("#"),g.push(N.fragment)),g.join("")}function Qe(N,T){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},g=arguments[3],S={};return g||(N=ie(Ue(N,y),y),T=ie(Ue(T,y),y)),y=y||{},!y.tolerant&&T.scheme?(S.scheme=T.scheme,S.userinfo=T.userinfo,S.host=T.host,S.port=T.port,S.path=Ye(T.path||""),S.query=T.query):(T.userinfo!==void 0||T.host!==void 0||T.port!==void 0?(S.userinfo=T.userinfo,S.host=T.host,S.port=T.port,S.path=Ye(T.path||""),S.query=T.query):(T.path?(T.path.charAt(0)==="/"?S.path=Ye(T.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?S.path="/"+T.path:N.path?S.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+T.path:S.path=T.path,S.path=Ye(S.path)),S.query=T.query):(S.path=N.path,T.query!==void 0?S.query=T.query:S.query=N.query),S.userinfo=N.userinfo,S.host=N.host,S.port=N.port),S.scheme=N.scheme),S.fragment=T.fragment,S}function Ve(N,T,y){var g=n({scheme:"null"},y);return Ue(Qe(ie(N,g),ie(T,g),g,!0),g)}function Ke(N,T){return typeof N=="string"?N=Ue(ie(N,T),T):t(N)==="object"&&(N=ie(Ue(N,T),T)),N}function bt(N,T,y){return typeof N=="string"?N=Ue(ie(N,y),y):t(N)==="object"&&(N=Ue(N,y)),typeof T=="string"?T=Ue(ie(T,y),y):t(T)==="object"&&(T=Ue(T,y)),N===T}function xt(N,T){return N&&N.toString().replace(!T||!T.iri?l.ESCAPE:c.ESCAPE,xe)}function wt(N,T){return N&&N.toString().replace(!T||!T.iri?l.PCT_ENCODED:c.PCT_ENCODED,Oe)}var Br={scheme:"http",domainHost:!0,parse:function(T,y){return T.host||(T.error=T.error||"HTTP URIs must have a host."),T},serialize:function(T,y){var g=String(T.scheme).toLowerCase()==="https";return(T.port===(g?443:80)||T.port==="")&&(T.port=void 0),T.path||(T.path="/"),T}},Ct={scheme:"https",domainHost:Br.domainHost,parse:Br.parse,serialize:Br.serialize};function ia(N){return typeof N.secure=="boolean"?N.secure:String(N.scheme).toLowerCase()==="wss"}var oa={scheme:"ws",domainHost:!0,parse:function(T,y){var g=T;return g.secure=ia(g),g.resourceName=(g.path||"/")+(g.query?"?"+g.query:""),g.path=void 0,g.query=void 0,g},serialize:function(T,y){if((T.port===(ia(T)?443:80)||T.port==="")&&(T.port=void 0),typeof T.secure=="boolean"&&(T.scheme=T.secure?"wss":"ws",T.secure=void 0),T.resourceName){var g=T.resourceName.split("?"),S=u(g,2),D=S[0],L=S[1];T.path=D&&D!=="/"?D:void 0,T.query=L,T.resourceName=void 0}return T.fragment=void 0,T}},Nn={scheme:"wss",domainHost:oa.domainHost,parse:oa.parse,serialize:oa.serialize},Ia={},qi=!0,Mi="[A-Za-z0-9\\-\\.\\_\\~"+(qi?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Jt="[0-9A-Fa-f]",Fi=r(r("%[EFef]"+Jt+"%"+Jt+Jt+"%"+Jt+Jt)+"|"+r("%[89A-Fa-f]"+Jt+"%"+Jt+Jt)+"|"+r("%"+Jt+Jt)),Yt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ol="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",cl=e(ol,'[\\"\\\\]'),ll="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",ul=new RegExp(Mi,"g"),ca=new RegExp(Fi,"g"),pl=new RegExp(e("[^]",Yt,"[\\.]",'[\\"]',cl),"g"),Vr=new RegExp(e("[^]",Mi,ll),"g"),dl=Vr;function js(N){var T=Oe(N);return T.match(ul)?T:N}var Li={scheme:"mailto",parse:function(T,y){var g=T,S=g.to=g.path?g.path.split(","):[];if(g.path=void 0,g.query){for(var D=!1,L={},K=g.query.split("&"),ne=0,ge=K.length;ne{"use strict";jx.exports=function a(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var t,s,i;if(Array.isArray(e)){if(t=e.length,t!=r.length)return!1;for(s=t;s--!==0;)if(!a(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),t=i.length,t!==Object.keys(r).length)return!1;for(s=t;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=t;s--!==0;){var n=i[s];if(!a(e[n],r[n]))return!1}return!0}return e!==e&&r!==r}});var Dx=M((aL,Nx)=>{"use strict";Nx.exports=function(e){for(var r=0,t=e.length,s=0,i;s=55296&&i<=56319&&s{"use strict";Mx.exports={copy:d8,checkDataType:Mp,checkDataTypes:f8,coerceToTypes:m8,toHash:Lp,getProperty:Up,escapeQuotes:zp,equal:vc(),ucs2length:Dx(),varOccurences:g8,varReplace:y8,schemaHasRules:b8,schemaHasRulesExcept:x8,schemaUnknownRules:_8,toQuotedString:Fp,getPathExpr:E8,getPath:w8,getData:R8,unescapeFragment:T8,unescapeJsonPointer:Bp,escapeFragment:k8,escapeJsonPointer:Hp};function d8(a,e){e=e||{};for(var r in a)e[r]=a[r];return e}function Mp(a,e,r,t){var s=t?" !== ":" === ",i=t?" || ":" && ",n=t?"!":"",o=t?"":"!";switch(a){case"null":return e+s+"null";case"array":return n+"Array.isArray("+e+")";case"object":return"("+n+e+i+"typeof "+e+s+'"object"'+i+o+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+s+'"number"'+i+o+"("+e+" % 1)"+i+e+s+e+(r?i+n+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+s+'"'+a+'"'+(r?i+n+"isFinite("+e+")":"")+")";default:return"typeof "+e+s+'"'+a+'"'}}function f8(a,e,r){switch(a.length){case 1:return Mp(a[0],e,r,!0);default:var t="",s=Lp(a);s.array&&s.object&&(t=s.null?"(":"(!"+e+" || ",t+="typeof "+e+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer;for(var i in s)t+=(t?" && ":"")+Mp(i,e,r,!0);return t}}var $x=Lp(["string","number","integer","boolean","null"]);function m8(a,e){if(Array.isArray(e)){for(var r=[],t=0;t=e)throw new Error("Cannot access property/index "+t+" levels up, current level is "+e);return r[e-t]}if(t>e)throw new Error("Cannot access data "+t+" levels up, current level is "+e);if(i="data"+(e-t||""),!s)return i}for(var o=i,l=s.split("/"),c=0;c{"use strict";var O8=fs();Fx.exports=C8;function C8(a){O8.copy(a,this)}});var Ux=M((iL,Lx)=>{"use strict";var Pa=Lx.exports=function(a,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var t=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};gc(e,t,s,a,"",a)};Pa.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};Pa.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Pa.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Pa.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function gc(a,e,r,t,s,i,n,o,l,c){if(t&&typeof t=="object"&&!Array.isArray(t)){e(t,s,i,n,o,l,c);for(var u in t){var p=t[u];if(Array.isArray(p)){if(u in Pa.arrayKeywords)for(var m=0;m{"use strict";var Ri=Ax(),zx=vc(),_c=fs(),yc=Vp(),A8=Ux();Vx.exports=Ta;Ta.normalizeId=Ra;Ta.fullPath=bc;Ta.url=xc;Ta.ids=q8;Ta.inlineRef=Gp;Ta.schema=Ec;function Ta(a,e,r){var t=this._refs[r];if(typeof t=="string")if(this._refs[t])t=this._refs[t];else return Ta.call(this,a,e,t);if(t=t||this._schemas[r],t instanceof yc)return Gp(t.schema,this._opts.inlineRefs)?t.schema:t.validate||this._compile(t);var s=Ec.call(this,e,r),i,n,o;return s&&(i=s.schema,e=s.root,o=s.baseId),i instanceof yc?n=i.validate||a.call(this,i.schema,e,void 0,o):i!==void 0&&(n=Gp(i,this._opts.inlineRefs)?i:a.call(this,i,e,void 0,o)),n}function Ec(a,e){var r=Ri.parse(e),t=Bx(r),s=bc(this._getId(a.schema));if(Object.keys(a.schema).length===0||t!==s){var i=Ra(t),n=this._refs[i];if(typeof n=="string")return j8.call(this,a,n,r);if(n instanceof yc)n.validate||this._compile(n),a=n;else if(n=this._schemas[i],n instanceof yc){if(n.validate||this._compile(n),i==Ra(e))return{schema:n,root:a,baseId:s};a=n}else return;if(!a.schema)return;s=bc(this._getId(a.schema))}return Hx.call(this,r,s,a.schema,a)}function j8(a,e,r){var t=Ec.call(this,a,e);if(t){var s=t.schema,i=t.baseId;a=t.root;var n=this._getId(s);return n&&(i=xc(i,n)),Hx.call(this,r,i,s,a)}}var N8=_c.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Hx(a,e,r,t){if(a.fragment=a.fragment||"",a.fragment.slice(0,1)=="/"){for(var s=a.fragment.split("/"),i=1;i{"use strict";var Kp=wc();Zx.exports={Validation:Gx(M8),MissingRef:Gx(Qp)};function M8(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}Qp.message=function(a,e){return"can't resolve reference "+e+" from id "+a};function Qp(a,e,r){this.message=r||Qp.message(a,e),this.missingRef=Kp.url(a,e),this.missingSchema=Kp.normalizeId(Kp.fullPath(this.missingRef))}function Gx(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var Xp=M((lL,Wx)=>{"use strict";Wx.exports=function(a,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,t=e.cmp&&(function(i){return function(n){return function(o,l){var c={key:o,value:n[o]},u={key:l,value:n[l]};return i(c,u)}}})(e.cmp),s=[];return(function i(n){if(n&&n.toJSON&&typeof n.toJSON=="function"&&(n=n.toJSON()),n!==void 0){if(typeof n=="number")return isFinite(n)?""+n:"null";if(typeof n!="object")return JSON.stringify(n);var o,l;if(Array.isArray(n)){for(l="[",o=0;o{"use strict";Kx.exports=function(e,r,t){var s="",i=e.schema.$async===!0,n=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var l=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(l){var c="unknown keyword: "+l;if(e.opts.strictKeywords==="log")e.logger.warn(c);else throw new Error(c)}}if(e.isTop&&(s+=" var validate = ",i&&(e.async=!0,s+="async "),s+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(s+=" "+("/*# sourceURL="+o+" */")+" ")),typeof e.schema=="boolean"||!(n||e.schema.$ref)){var r="false schema",u=e.level,p=e.dataLevel,m=e.schema[r],f=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,O=!e.opts.allErrors,$,d="data"+(p||""),k="valid"+u;if(e.schema===!1){e.isTop?O=!0:s+=" var "+k+" = false; ";var v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+($||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'boolean schema is false' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var x=s;s=v.pop(),!e.compositeRule&&O?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i?s+=" return data; ":s+=" validate.errors = null; return true; ":s+=" var "+k+" = true; ";return e.isTop&&(s+=" }; return validate; "),s}if(e.isTop){var b=e.isTop,u=e.level=0,p=e.dataLevel=0,d="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var E="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(E);else throw new Error(E)}s+=" var vErrors = null; ",s+=" var errors = 0; ",s+=" if (rootData === undefined) rootData = data; "}else{var u=e.level,p=e.dataLevel,d="data"+(p||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),i&&!e.async)throw new Error("async schema in sync schema");s+=" var errs_"+u+" = errors;"}var k="valid"+u,O=!e.opts.allErrors,P="",I="",$,A=e.schema.type,F=Array.isArray(A);if(A&&e.opts.nullable&&e.schema.nullable===!0&&(F?A.indexOf("null")==-1&&(A=A.concat("null")):A!="null"&&(A=[A,"null"],F=!0)),F&&A.length==1&&(A=A[0],F=!1),e.schema.$ref&&n){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(n=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(s+=" "+e.RULES.all.$comment.code(e,"$comment")),A){if(e.opts.coerceTypes)var q=e.util.coerceToTypes(e.opts.coerceTypes,A);var C=e.RULES.types[A];if(q||F||C===!0||C&&!Ee(C)){var f=e.schemaPath+".type",h=e.errSchemaPath+"/type",f=e.schemaPath+".type",h=e.errSchemaPath+"/type",R=F?"checkDataTypes":"checkDataType";if(s+=" if ("+e.util[R](A,d,e.opts.strictNumbers,!0)+") { ",q){var j="dataType"+u,z="coerced"+u;s+=" var "+j+" = typeof "+d+"; var "+z+" = undefined; ",e.opts.coerceTypes=="array"&&(s+=" if ("+j+" == 'object' && Array.isArray("+d+") && "+d+".length == 1) { "+d+" = "+d+"[0]; "+j+" = typeof "+d+"; if ("+e.util.checkDataType(e.schema.type,d,e.opts.strictNumbers)+") "+z+" = "+d+"; } "),s+=" if ("+z+" !== undefined) ; ";var B=q;if(B)for(var G,te=-1,X=B.length-1;te{"use strict";var Pc=wc(),Tc=fs(),Xx=Sc(),F8=Xp(),Qx=Jp(),L8=Tc.ucs2length,U8=vc(),z8=Xx.Validation;Yx.exports=Yp;function Yp(a,e,r,t){var s=this,i=this._opts,n=[void 0],o={},l=[],c={},u=[],p={},m=[];e=e||{schema:a,refVal:n,refs:o};var f=H8.call(this,a,e,t),h=this._compilations[f.index];if(f.compiling)return h.callValidate=E;var d=this._formats,v=this.RULES;try{var x=k(a,e,r,t);h.validate=x;var b=h.callValidate;return b&&(b.schema=x.schema,b.errors=null,b.refs=x.refs,b.refVal=x.refVal,b.root=x.root,b.$async=x.$async,i.sourceCode&&(b.source=x.source)),x}finally{B8.call(this,a,e,t)}function E(){var R=h.validate,j=R.apply(this,arguments);return E.errors=R.errors,j}function k(R,j,z,B){var G=!j||j&&j.schema==R;if(j.schema!=e.schema)return Yp.call(s,R,j,z,B);var te=R.$async===!0,X=Qx({isTop:!0,schema:R,isRoot:G,baseId:B,root:j,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Xx.MissingRef,RULES:v,validate:Qx,util:Tc,resolve:Pc,resolveRef:O,usePattern:F,useDefault:q,useCustomRule:C,opts:i,formats:d,logger:s.logger,self:s});X=Rc(n,Z8)+Rc(l,V8)+Rc(u,G8)+Rc(m,W8)+X,i.processCode&&(X=i.processCode(X,R));var V;try{var re=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",X);V=re(s,v,d,e,n,u,m,U8,L8,z8),n[0]=V}catch(ce){throw s.logger.error("Error compiling schema, function code:",X),ce}return V.schema=R,V.errors=null,V.refs=o,V.refVal=n,V.root=G?V:j,te&&(V.$async=!0),i.sourceCode===!0&&(V.source={code:X,patterns:l,defaults:u}),V}function O(R,j,z){j=Pc.url(R,j);var B=o[j],G,te;if(B!==void 0)return G=n[B],te="refVal["+B+"]",A(G,te);if(!z&&e.refs){var X=e.refs[j];if(X!==void 0)return G=e.refVal[X],te=P(j,G),A(G,te)}te=P(j);var V=Pc.call(s,k,e,j);if(V===void 0){var re=r&&r[j];re&&(V=Pc.inlineRef(re,i.inlineRefs)?re:Yp.call(s,re,e,r,R))}if(V===void 0)I(j);else return $(j,V),A(V,te)}function P(R,j){var z=n.length;return n[z]=j,o[R]=z,"refVal"+z}function I(R){delete o[R]}function $(R,j){var z=o[R];n[z]=j}function A(R,j){return typeof R=="object"||typeof R=="boolean"?{code:j,schema:R,inline:!0}:{code:j,$async:R&&!!R.$async}}function F(R){var j=c[R];return j===void 0&&(j=c[R]=l.length,l[j]=R),"pattern"+j}function q(R){switch(typeof R){case"boolean":case"number":return""+R;case"string":return Tc.toQuotedString(R);case"object":if(R===null)return"null";var j=F8(R),z=p[j];return z===void 0&&(z=p[j]=u.length,u[z]=R),"default"+z}}function C(R,j,z,B){if(s._opts.validateSchema!==!1){var G=R.definition.dependencies;if(G&&!G.every(function(xe){return Object.prototype.hasOwnProperty.call(z,xe)}))throw new Error("parent schema must have all required keywords: "+G.join(","));var te=R.definition.validateSchema;if(te){var X=te(j);if(!X){var V="keyword schema is invalid: "+s.errorsText(te.errors);if(s._opts.validateSchema=="log")s.logger.error(V);else throw new Error(V)}}}var re=R.definition.compile,ce=R.definition.inline,Be=R.definition.macro,be;if(re)be=re.call(s,j,z,B);else if(Be)be=Be.call(s,j,z,B),i.validateSchema!==!1&&s.validateSchema(be,!0);else if(ce)be=ce.call(s,B,R.keyword,j,z);else if(be=R.definition.validate,!be)return;if(be===void 0)throw new Error('custom keyword "'+R.keyword+'"failed to compile');var qe=m.length;return m[qe]=be,{code:"customRule"+qe,validate:be}}}function H8(a,e,r){var t=Jx.call(this,a,e,r);return t>=0?{index:t,compiling:!0}:(t=this._compilations.length,this._compilations[t]={schema:a,root:e,baseId:r},{index:t,compiling:!1})}function B8(a,e,r){var t=Jx.call(this,a,e,r);t>=0&&this._compilations.splice(t,1)}function Jx(a,e,r){for(var t=0;t{"use strict";var kc=t0.exports=function(){this._cache={}};kc.prototype.put=function(e,r){this._cache[e]=r};kc.prototype.get=function(e){return this._cache[e]};kc.prototype.del=function(e){delete this._cache[e]};kc.prototype.clear=function(){this._cache={}}});var m0=M((fL,f0)=>{"use strict";var K8=fs(),Q8=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,X8=[0,31,28,31,30,31,30,31,31,30,31,30,31],J8=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a0=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Y8=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,e9=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,s0=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,n0=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,i0=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,o0=/^(?:\/(?:[^~/]|~0|~1)*)*$/,c0=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,l0=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;f0.exports=Oc;function Oc(a){return a=a=="full"?"full":"fast",K8.copy(Oc[a])}Oc.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":s0,url:n0,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a0,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:d0,uuid:i0,"json-pointer":o0,"json-pointer-uri-fragment":c0,"relative-json-pointer":l0};Oc.full={date:u0,time:p0,"date-time":a9,uri:n9,"uri-reference":e9,"uri-template":s0,url:n0,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a0,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:d0,uuid:i0,"json-pointer":o0,"json-pointer-uri-fragment":c0,"relative-json-pointer":l0};function t9(a){return a%4===0&&(a%100!==0||a%400===0)}function u0(a){var e=a.match(Q8);if(!e)return!1;var r=+e[1],t=+e[2],s=+e[3];return t>=1&&t<=12&&s>=1&&s<=(t==2&&t9(r)?29:X8[t])}function p0(a,e){var r=a.match(J8);if(!r)return!1;var t=r[1],s=r[2],i=r[3],n=r[5];return(t<=23&&s<=59&&i<=59||t==23&&s==59&&i==60)&&(!e||n)}var r9=/t|\s/i;function a9(a){var e=a.split(r9);return e.length==2&&u0(e[0])&&p0(e[1],!0)}var s9=/\/|:/;function n9(a){return s9.test(a)&&Y8.test(a)}var i9=/[^\\]\\Z/;function d0(a){if(i9.test(a))return!1;try{return new RegExp(a),!0}catch{return!1}}});var v0=M((mL,h0)=>{"use strict";h0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(n||""),p="valid"+i,m,f;if(o=="#"||o=="#/")e.isRoot?(m=e.async,f="validate"):(m=e.root.schema.$async===!0,f="root.refVal[0]");else{var h=e.resolveRef(e.baseId,o,e.isRoot);if(h===void 0){var d=e.MissingRefError.message(e.baseId,o);if(e.opts.missingRefs=="fail"){e.logger.error(d);var v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(o)+"' } ",e.opts.messages!==!1&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(o)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(o)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var x=s;s=v.pop(),!e.compositeRule&&c?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(s+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(d),c&&(s+=" if (true) { ");else throw new e.MissingRefError(e.baseId,o,d)}else if(h.inline){var b=e.util.copy(e);b.level++;var E="valid"+b.level;b.schema=h.schema,b.schemaPath="",b.errSchemaPath=o;var k=e.validate(b).replace(/validate\.schema/g,h.code);s+=" "+k+" ",c&&(s+=" if ("+E+") { ")}else m=h.$async===!0||e.async&&h.$async!==!1,f=h.code}if(f){var v=v||[];v.push(s),s="",e.opts.passContext?s+=" "+f+".call(this, ":s+=" "+f+"( ",s+=" "+u+", (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var O=n?"data"+(n-1||""):"parentData",P=n?e.dataPathArr[n]:"parentDataProperty";s+=" , "+O+" , "+P+", rootData) ";var I=s;if(s=v.pop(),m){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(s+=" var "+p+"; "),s+=" try { await "+I+"; ",c&&(s+=" "+p+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(s+=" "+p+" = false; "),s+=" } ",c&&(s+=" if ("+p+") { ")}else s+=" if (!"+I+") { if (vErrors === null) vErrors = "+f+".errors; else vErrors = vErrors.concat("+f+".errors); errors = vErrors.length; } ",c&&(s+=" else { ")}return s}});var y0=M((hL,g0)=>{"use strict";g0.exports=function(e,r,t){var s=" ",i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var p="valid"+c.level,m=c.baseId,f=!0,h=i;if(h)for(var d,v=-1,x=h.length-1;v0||d===!1:e.util.schemaHasRules(d,e.RULES.all))&&(f=!1,c.schema=d,c.schemaPath=n+"["+v+"]",c.errSchemaPath=o+"/"+v,s+=" "+e.validate(c)+" ",c.baseId=m,l&&(s+=" if ("+p+") { ",u+="}"));return l&&(f?s+=" if (true) { ":s+=" "+u.slice(0,-1)+" "),s}});var x0=M((vL,b0)=>{"use strict";b0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x=o.every(function($){return e.opts.strictKeywords?typeof $=="object"&&Object.keys($).length>0||$===!1:e.util.schemaHasRules($,e.RULES.all)});if(x){var b=h.baseId;s+=" var "+f+" = errors; var "+m+" = false; ";var E=e.compositeRule;e.compositeRule=h.compositeRule=!0;var k=o;if(k)for(var O,P=-1,I=k.length-1;P{"use strict";_0.exports=function(e,r,t){var s=" ",i=e.schema[r],n=e.errSchemaPath+"/"+r,o=!e.opts.allErrors,l=e.util.toQuotedString(i);return e.opts.$comment===!0?s+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(s+=" self._opts.$comment("+l+", "+e.util.toQuotedString(n)+", validate.root.schema);"),s}});var S0=M((yL,w0)=>{"use strict";w0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o,f||(s+=" var schema"+i+" = validate.schema"+l+";"),s+="var "+m+" = equal("+p+", schema"+i+"); if (!"+m+") { ";var d=d||[];d.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to constant' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var v=s;return s=d.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",u&&(s+=" else { "),s}});var R0=M((bL,P0)=>{"use strict";P0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x="i"+i,b=h.dataLevel=e.dataLevel+1,E="data"+b,k=e.baseId,O=e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all);if(s+="var "+f+" = errors;var "+m+";",O){var P=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=l,h.errSchemaPath=c,s+=" var "+v+" = false; for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var I=p+"["+x+"]";h.dataPathArr[b]=x;var $=e.validate(h);h.baseId=k,e.util.varOccurences($,E)<2?s+=" "+e.util.varReplace($,E,I)+" ":s+=" var "+E+" = "+I+"; "+$+" ",s+=" if ("+v+") break; } ",e.compositeRule=h.compositeRule=P,s+=" "+d+" if (!"+v+") {"}else s+=" if ("+p+".length == 0) {";var A=A||[];A.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should contain a valid item' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var F=s;return s=A.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+F+"]); ":s+=" validate.errors = ["+F+"]; return false; ":s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { ",O&&(s+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } "),e.opts.allErrors&&(s+=" } "),s}});var k0=M((xL,T0)=>{"use strict";T0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level,v={},x={},b=e.opts.ownProperties;for(P in o)if(P!="__proto__"){var E=o[P],k=Array.isArray(E)?x:v;k[P]=E}s+="var "+m+" = errors;";var O=e.errorPath;s+="var missing"+i+";";for(var P in x)if(k=x[P],k.length){if(s+=" if ( "+p+e.util.getProperty(P)+" !== undefined ",b&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(P)+"') "),u){s+=" && ( ";var I=k;if(I)for(var $,A=-1,F=I.length-1;A0||E===!1:e.util.schemaHasRules(E,e.RULES.all))&&(s+=" "+d+" = true; if ( "+p+e.util.getProperty(P)+" !== undefined ",b&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(P)+"') "),s+=") { ",f.schema=E,f.schemaPath=l+e.util.getProperty(P),f.errSchemaPath=c+"/"+e.util.escapeFragment(P),s+=" "+e.validate(f)+" ",f.baseId=V,s+=" } ",u&&(s+=" if ("+d+") { ",h+="}"))}return u&&(s+=" "+h+" if ("+m+" == errors) {"),s}});var C0=M((_L,O0)=>{"use strict";O0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o;var d="i"+i,v="schema"+i;f||(s+=" var "+v+" = validate.schema"+l+";"),s+="var "+m+";",f&&(s+=" if (schema"+i+" === undefined) "+m+" = true; else if (!Array.isArray(schema"+i+")) "+m+" = false; else {"),s+=""+m+" = false;for (var "+d+"=0; "+d+"<"+v+".length; "+d+"++) if (equal("+p+", "+v+"["+d+"])) { "+m+" = true; break; }",f&&(s+=" } "),s+=" if (!"+m+") { ";var x=x||[];x.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var b=s;return s=x.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+b+"]); ":s+=" validate.errors = ["+b+"]; return false; ":s+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",u&&(s+=" else { "),s}});var A0=M((EL,I0)=>{"use strict";I0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||"");if(e.opts.format===!1)return u&&(s+=" if (true) { "),s;var m=e.opts.$data&&o&&o.$data,f;m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o;var h=e.opts.unknownFormats,d=Array.isArray(h);if(m){var v="format"+i,x="isObject"+i,b="formatType"+i;s+=" var "+v+" = formats["+f+"]; var "+x+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+b+" = "+x+" && "+v+".type || 'string'; if ("+x+") { ",e.async&&(s+=" var async"+i+" = "+v+".async; "),s+=" "+v+" = "+v+".validate; } if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),s+=" (",h!="ignore"&&(s+=" ("+f+" && !"+v+" ",d&&(s+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),s+=") || "),s+=" ("+v+" && "+b+" == '"+t+"' && !(typeof "+v+" == 'function' ? ",e.async?s+=" (async"+i+" ? await "+v+"("+p+") : "+v+"("+p+")) ":s+=" "+v+"("+p+") ",s+=" : "+v+".test("+p+"))))) {"}else{var v=e.formats[o];if(!v){if(h=="ignore")return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(s+=" if (true) { "),s;if(d&&h.indexOf(o)>=0)return u&&(s+=" if (true) { "),s;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var x=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,b=x&&v.type||"string";if(x){var E=v.async===!0;v=v.validate}if(b!=t)return u&&(s+=" if (true) { "),s;if(E){if(!e.async)throw new Error("async format in sync schema");var k="formats"+e.util.getProperty(o)+".validate";s+=" if (!(await "+k+"("+p+"))) { "}else{s+=" if (! ";var k="formats"+e.util.getProperty(o);x&&(k+=".validate"),typeof v=="function"?s+=" "+k+"("+p+") ":s+=" "+k+".test("+p+") ",s+=") { "}}var O=O||[];O.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",m?s+=""+f:s+=""+e.util.toQuotedString(o),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match format "`,m?s+="' + "+f+" + '":s+=""+e.util.escapeQuotes(o),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var P=s;return s=O.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+P+"]); ":s+=" validate.errors = ["+P+"]; return false; ":s+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}});var N0=M((wL,j0)=>{"use strict";j0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e);h.level++;var d="valid"+h.level,v=e.schema.then,x=e.schema.else,b=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),E=x!==void 0&&(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all)),k=h.baseId;if(b||E){var O;h.createErrors=!1,h.schema=o,h.schemaPath=l,h.errSchemaPath=c,s+=" var "+f+" = errors; var "+m+" = true; ";var P=e.compositeRule;e.compositeRule=h.compositeRule=!0,s+=" "+e.validate(h)+" ",h.baseId=k,h.createErrors=!0,s+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=P,b?(s+=" if ("+d+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",s+=" "+e.validate(h)+" ",h.baseId=k,s+=" "+m+" = "+d+"; ",b&&E?(O="ifClause"+i,s+=" var "+O+" = 'then'; "):O="'then'",s+=" } ",E&&(s+=" else { ")):s+=" if (!"+d+") { ",E&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",s+=" "+e.validate(h)+" ",h.baseId=k,s+=" "+m+" = "+d+"; ",b&&E?(O="ifClause"+i,s+=" var "+O+" = 'else'; "):O="'else'",s+=" } "),s+=" if (!"+m+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+O+" } ",e.opts.messages!==!1&&(s+=` , message: 'should match "' + `+O+` + '" schema' `),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}});var $0=M((SL,D0)=>{"use strict";D0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x="i"+i,b=h.dataLevel=e.dataLevel+1,E="data"+b,k=e.baseId;if(s+="var "+f+" = errors;var "+m+";",Array.isArray(o)){var O=e.schema.additionalItems;if(O===!1){s+=" "+m+" = "+p+".length <= "+o.length+"; ";var P=c;c=e.errSchemaPath+"/additionalItems",s+=" if (!"+m+") { ";var I=I||[];I.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+o.length+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var $=s;s=I.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+$+"]); ":s+=" validate.errors = ["+$+"]; return false; ":s+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",c=P,u&&(d+="}",s+=" else { ")}var A=o;if(A){for(var F,q=-1,C=A.length-1;q0||F===!1:e.util.schemaHasRules(F,e.RULES.all)){s+=" "+v+" = true; if ("+p+".length > "+q+") { ";var R=p+"["+q+"]";h.schema=F,h.schemaPath=l+"["+q+"]",h.errSchemaPath=c+"/"+q,h.errorPath=e.util.getPathExpr(e.errorPath,q,e.opts.jsonPointers,!0),h.dataPathArr[b]=q;var j=e.validate(h);h.baseId=k,e.util.varOccurences(j,E)<2?s+=" "+e.util.varReplace(j,E,R)+" ":s+=" var "+E+" = "+R+"; "+j+" ",s+=" } ",u&&(s+=" if ("+v+") { ",d+="}")}}if(typeof O=="object"&&(e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all))){h.schema=O,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",s+=" "+v+" = true; if ("+p+".length > "+o.length+") { for (var "+x+" = "+o.length+"; "+x+" < "+p+".length; "+x+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var R=p+"["+x+"]";h.dataPathArr[b]=x;var j=e.validate(h);h.baseId=k,e.util.varOccurences(j,E)<2?s+=" "+e.util.varReplace(j,E,R)+" ":s+=" var "+E+" = "+R+"; "+j+" ",u&&(s+=" if (!"+v+") break; "),s+=" } } ",u&&(s+=" if ("+v+") { ",d+="}")}}else if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=l,h.errSchemaPath=c,s+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var R=p+"["+x+"]";h.dataPathArr[b]=x;var j=e.validate(h);h.baseId=k,e.util.varOccurences(j,E)<2?s+=" "+e.util.varReplace(j,E,R)+" ":s+=" var "+E+" = "+R+"; "+j+" ",u&&(s+=" if (!"+v+") break; "),s+=" }"}return u&&(s+=" "+d+" if ("+f+" == errors) {"),s}});var ed=M((PL,q0)=>{"use strict";q0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,k,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o;var h=r=="maximum",d=h?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[d],x=e.opts.$data&&v&&v.$data,b=h?"<":">",E=h?">":"<",k=void 0;if(!(m||typeof o=="number"||o===void 0))throw new Error(r+" must be number");if(!(x||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(d+" must be number or boolean");if(x){var O=e.util.getData(v.$data,n,e.dataPathArr),P="exclusive"+i,I="exclType"+i,$="exclIsNumber"+i,A="op"+i,F="' + "+A+" + '";s+=" var schemaExcl"+i+" = "+O+"; ",O="schemaExcl"+i,s+=" var "+P+"; var "+I+" = typeof "+O+"; if ("+I+" != 'boolean' && "+I+" != 'undefined' && "+I+" != 'number') { ";var k=d,q=q||[];q.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(k||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var C=s;s=q.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" "+I+" == 'number' ? ( ("+P+" = "+f+" === undefined || "+O+" "+b+"= "+f+") ? "+p+" "+E+"= "+O+" : "+p+" "+E+" "+f+" ) : ( ("+P+" = "+O+" === true) ? "+p+" "+E+"= "+f+" : "+p+" "+E+" "+f+" ) || "+p+" !== "+p+") { var op"+i+" = "+P+" ? '"+b+"' : '"+b+"='; ",o===void 0&&(k=d,c=e.errSchemaPath+"/"+d,f=O,m=x)}else{var $=typeof v=="number",F=b;if($&&m){var A="'"+F+"'";s+=" if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" ( "+f+" === undefined || "+v+" "+b+"= "+f+" ? "+p+" "+E+"= "+v+" : "+p+" "+E+" "+f+" ) || "+p+" !== "+p+") { "}else{$&&o===void 0?(P=!0,k=d,c=e.errSchemaPath+"/"+d,f=v,E+="="):($&&(f=Math[h?"min":"max"](v,o)),v===($?f:!0)?(P=!0,k=d,c=e.errSchemaPath+"/"+d,E+="="):(P=!1,F+="="));var A="'"+F+"'";s+=" if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" "+p+" "+E+" "+f+" || "+p+" !== "+p+") { "}}k=k||r;var q=q||[];q.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(k||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+A+", limit: "+f+", exclusive: "+P+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be "+F+" ",m?s+="' + "+f:s+=""+f+"'"),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var C=s;return s=q.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}});var td=M((RL,M0)=>{"use strict";M0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");var h=r=="maxItems"?">":"<";s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" "+p+".length "+h+" "+f+") { ";var d=r,v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",r=="maxItems"?s+="more":s+="fewer",s+=" than ",m?s+="' + "+f+" + '":s+=""+o,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var x=s;return s=v.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var rd=M((TL,F0)=>{"use strict";F0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");var h=r=="maxLength"?">":"<";s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),e.opts.unicode===!1?s+=" "+p+".length ":s+=" ucs2length("+p+") ",s+=" "+h+" "+f+") { ";var d=r,v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be ",r=="maxLength"?s+="longer":s+="shorter",s+=" than ",m?s+="' + "+f+" + '":s+=""+o,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var x=s;return s=v.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var ad=M((kL,L0)=>{"use strict";L0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");var h=r=="maxProperties"?">":"<";s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" Object.keys("+p+").length "+h+" "+f+") { ";var d=r,v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",r=="maxProperties"?s+="more":s+="fewer",s+=" than ",m?s+="' + "+f+" + '":s+=""+o,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var x=s;return s=v.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var z0=M((OL,U0)=>{"use strict";U0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");s+="var division"+i+";if (",m&&(s+=" "+f+" !== undefined && ( typeof "+f+" != 'number' || "),s+=" (division"+i+" = "+p+" / "+f+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",m&&(s+=" ) "),s+=" ) { ";var h=h||[];h.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be multiple of ",m?s+="' + "+f:s+=""+f+"'"),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var d=s;return s=h.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+d+"]); ":s+=" validate.errors = ["+d+"]; return false; ":s+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var B0=M((CL,H0)=>{"use strict";H0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e);f.level++;var h="valid"+f.level;if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=l,f.errSchemaPath=c,s+=" var "+m+" = errors; ";var d=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.createErrors=!1;var v;f.opts.allErrors&&(v=f.opts.allErrors,f.opts.allErrors=!1),s+=" "+e.validate(f)+" ",f.createErrors=!0,v&&(f.opts.allErrors=v),e.compositeRule=f.compositeRule=d,s+=" if ("+h+") { ";var x=x||[];x.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var b=s;s=x.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+b+"]); ":s+=" validate.errors = ["+b+"]; return false; ":s+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } ",e.opts.allErrors&&(s+=" } ")}else s+=" var err = ",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(s+=" if (false) { ");return s}});var G0=M((IL,V0)=>{"use strict";V0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x=h.baseId,b="prevValid"+i,E="passingSchemas"+i;s+="var "+f+" = errors , "+b+" = false , "+m+" = false , "+E+" = null; ";var k=e.compositeRule;e.compositeRule=h.compositeRule=!0;var O=o;if(O)for(var P,I=-1,$=O.length-1;I<$;)P=O[I+=1],(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))?(h.schema=P,h.schemaPath=l+"["+I+"]",h.errSchemaPath=c+"/"+I,s+=" "+e.validate(h)+" ",h.baseId=x):s+=" var "+v+" = true; ",I&&(s+=" if ("+v+" && "+b+") { "+m+" = false; "+E+" = ["+E+", "+I+"]; } else { ",d+="}"),s+=" if ("+v+") { "+m+" = "+b+" = true; "+E+" = "+I+"; }";return e.compositeRule=h.compositeRule=k,s+=""+d+"if (!"+m+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+E+" } ",e.opts.messages!==!1&&(s+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+="} else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; }",e.opts.allErrors&&(s+=" } "),s}});var W0=M((AL,Z0)=>{"use strict";Z0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o;var h=m?"(new RegExp("+f+"))":e.usePattern(o);s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),s+=" !"+h+".test("+p+") ) { ";var d=d||[];d.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",m?s+=""+f:s+=""+e.util.toQuotedString(o),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match pattern "`,m?s+="' + "+f+" + '":s+=""+e.util.escapeQuotes(o),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var v=s;return s=d.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var Q0=M((jL,K0)=>{"use strict";K0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level,v="key"+i,x="idx"+i,b=f.dataLevel=e.dataLevel+1,E="data"+b,k="dataProperties"+i,O=Object.keys(o||{}).filter(te),P=e.schema.patternProperties||{},I=Object.keys(P).filter(te),$=e.schema.additionalProperties,A=O.length||I.length,F=$===!1,q=typeof $=="object"&&Object.keys($).length,C=e.opts.removeAdditional,R=F||q||C,j=e.opts.ownProperties,z=e.baseId,B=e.schema.required;if(B&&!(e.opts.$data&&B.$data)&&B.length8)s+=" || validate.schema"+l+".hasOwnProperty("+v+") ";else{var X=O;if(X)for(var V,re=-1,ce=X.length-1;re0||Ee===!1:e.util.schemaHasRules(Ee,e.RULES.all)){var Ye=e.util.getProperty(V),Q=p+Ye,Ue=Ie&&Ee.default!==void 0;f.schema=Ee,f.schemaPath=l+Ye,f.errSchemaPath=c+"/"+e.util.escapeFragment(V),f.errorPath=e.util.getPath(e.errorPath,V,e.opts.jsonPointers),f.dataPathArr[b]=e.util.toQuotedString(V);var ie=e.validate(f);if(f.baseId=z,e.util.varOccurences(ie,E)<2){ie=e.util.varReplace(ie,E,Q);var Qe=Q}else{var Qe=E;s+=" var "+E+" = "+Q+"; "}if(Ue)s+=" "+ie+" ";else{if(G&&G[V]){s+=" if ( "+Qe+" === undefined ",j&&(s+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(V)+"') "),s+=") { "+d+" = false; ";var Oe=e.errorPath,Z=c,Ve=e.util.escapeQuotes(V);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Oe,V,e.opts.jsonPointers)),c=e.errSchemaPath+"/required";var ee=ee||[];ee.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+Ve+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+Ve+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var ue=s;s=ee.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+ue+"]); ":s+=" validate.errors = ["+ue+"]; return false; ":s+=" var err = "+ue+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=Z,e.errorPath=Oe,s+=" } else { "}else u?(s+=" if ( "+Qe+" === undefined ",j&&(s+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(V)+"') "),s+=") { "+d+" = true; } else { "):(s+=" if ("+Qe+" !== undefined ",j&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(V)+"') "),s+=" ) { ");s+=" "+ie+" } "}}u&&(s+=" if ("+d+") { ",h+="}")}}if(I.length){var Ke=I;if(Ke)for(var be,bt=-1,xt=Ke.length-1;bt0||Ee===!1:e.util.schemaHasRules(Ee,e.RULES.all)){f.schema=Ee,f.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(be),f.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(be),j?s+=" "+k+" = "+k+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+k+".length; "+x+"++) { var "+v+" = "+k+"["+x+"]; ":s+=" for (var "+v+" in "+p+") { ",s+=" if ("+e.usePattern(be)+".test("+v+")) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Q=p+"["+v+"]";f.dataPathArr[b]=v;var ie=e.validate(f);f.baseId=z,e.util.varOccurences(ie,E)<2?s+=" "+e.util.varReplace(ie,E,Q)+" ":s+=" var "+E+" = "+Q+"; "+ie+" ",u&&(s+=" if (!"+d+") break; "),s+=" } ",u&&(s+=" else "+d+" = true; "),s+=" } ",u&&(s+=" if ("+d+") { ",h+="}")}}}return u&&(s+=" "+h+" if ("+m+" == errors) {"),s}});var J0=M((NL,X0)=>{"use strict";X0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level;if(s+="var "+m+" = errors;",e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=l,f.errSchemaPath=c;var v="key"+i,x="idx"+i,b="i"+i,E="' + "+v+" + '",k=f.dataLevel=e.dataLevel+1,O="data"+k,P="dataProperties"+i,I=e.opts.ownProperties,$=e.baseId;I&&(s+=" var "+P+" = undefined; "),I?s+=" "+P+" = "+P+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+P+".length; "+x+"++) { var "+v+" = "+P+"["+x+"]; ":s+=" for (var "+v+" in "+p+") { ",s+=" var startErrs"+i+" = errors; ";var A=v,F=e.compositeRule;e.compositeRule=f.compositeRule=!0;var q=e.validate(f);f.baseId=$,e.util.varOccurences(q,O)<2?s+=" "+e.util.varReplace(q,O,A)+" ":s+=" var "+O+" = "+A+"; "+q+" ",e.compositeRule=f.compositeRule=F,s+=" if (!"+d+") { for (var "+b+"=startErrs"+i+"; "+b+"{"use strict";Y0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o;var d="schema"+i;if(!f)if(o.length0||O===!1:e.util.schemaHasRules(O,e.RULES.all))||(v[v.length]=b)}}else var v=o;if(f||v.length){var P=e.errorPath,I=f||v.length>=e.opts.loopRequired,$=e.opts.ownProperties;if(u)if(s+=" var missing"+i+"; ",I){f||(s+=" var "+d+" = validate.schema"+l+"; ");var A="i"+i,F="schema"+i+"["+A+"]",q="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,F,e.opts.jsonPointers)),s+=" var "+m+" = true; ",f&&(s+=" if (schema"+i+" === undefined) "+m+" = true; else if (!Array.isArray(schema"+i+")) "+m+" = false; else {"),s+=" for (var "+A+" = 0; "+A+" < "+d+".length; "+A+"++) { "+m+" = "+p+"["+d+"["+A+"]] !== undefined ",$&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", "+d+"["+A+"]) "),s+="; if (!"+m+") break; } ",f&&(s+=" } "),s+=" if (!"+m+") { ";var C=C||[];C.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+q+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+q+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var R=s;s=C.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+R+"]); ":s+=" validate.errors = ["+R+"]; return false; ":s+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { "}else{s+=" if ( ";var j=v;if(j)for(var z,A=-1,B=j.length-1;A{"use strict";t_.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;if(f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o,(o||f)&&e.opts.uniqueItems!==!1){f&&(s+=" var "+m+"; if ("+h+" === false || "+h+" === undefined) "+m+" = true; else if (typeof "+h+" != 'boolean') "+m+" = false; else { "),s+=" var i = "+p+".length , "+m+" = true , j; if (i > 1) { ";var d=e.schema.items&&e.schema.items.type,v=Array.isArray(d);if(!d||d=="object"||d=="array"||v&&(d.indexOf("object")>=0||d.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+m+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var x="checkDataType"+(v?"s":"");s+=" if ("+e.util[x](d,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(s+=` if (typeof item == 'string') item = '"' + item; `),s+=" if (typeof itemIndices[item] == 'number') { "+m+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",f&&(s+=" } "),s+=" if (!"+m+") { ";var b=b||[];b.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",f?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var E=s;s=b.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+E+"]); ":s+=" validate.errors = ["+E+"]; return false; ":s+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}});var s_=M((qL,a_)=>{"use strict";a_.exports={$ref:v0(),allOf:y0(),anyOf:x0(),$comment:E0(),const:S0(),contains:R0(),dependencies:k0(),enum:C0(),format:A0(),if:N0(),items:$0(),maximum:ed(),minimum:ed(),maxItems:td(),minItems:td(),maxLength:rd(),minLength:rd(),maxProperties:ad(),minProperties:ad(),multipleOf:z0(),not:B0(),oneOf:G0(),pattern:W0(),properties:Q0(),propertyNames:J0(),required:e_(),uniqueItems:r_(),validate:Jp()}});var o_=M((ML,i_)=>{"use strict";var n_=s_(),sd=fs().toHash;i_.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],t=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],s=["number","integer","string","array","object","boolean","null"];return e.all=sd(r),e.types=sd(s),e.forEach(function(i){i.rules=i.rules.map(function(n){var o;if(typeof n=="object"){var l=Object.keys(n)[0];o=n[l],n=l,o.forEach(function(u){r.push(u),e.all[u]=!0})}r.push(n);var c=e.all[n]={keyword:n,code:n_[n],implements:o};return c}),e.all.$comment={keyword:"$comment",code:n_.$comment},i.type&&(e.types[i.type]=i)}),e.keywords=sd(r.concat(t)),e.custom={},e}});var u_=M((FL,l_)=>{"use strict";var c_=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];l_.exports=function(a,e){for(var r=0;r{"use strict";var o9=Sc().MissingRef;d_.exports=p_;function p_(a,e,r){var t=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(r=e,e=void 0);var s=i(a).then(function(){var o=t._addSchema(a,void 0,e);return o.validate||n(o)});return r&&s.then(function(o){r(null,o)},r),s;function i(o){var l=o.$schema;return l&&!t.getSchema(l)?p_.call(t,{$ref:l},!0):Promise.resolve()}function n(o){try{return t._compile(o)}catch(c){if(c instanceof o9)return l(c);throw c}function l(c){var u=c.missingSchema;if(f(u))throw new Error("Schema "+u+" is loaded but "+c.missingRef+" cannot be resolved");var p=t._loadingSchemas[u];return p||(p=t._loadingSchemas[u]=t._opts.loadSchema(u),p.then(m,m)),p.then(function(h){if(!f(u))return i(h).then(function(){f(u)||t.addSchema(h,u,void 0,e)})}).then(function(){return n(o)});function m(){delete t._loadingSchemas[u]}function f(h){return t._refs[h]||t._schemas[h]}}}}});var h_=M((UL,m_)=>{"use strict";m_.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p,m="data"+(n||""),f="valid"+i,h="errs__"+i,d=e.opts.$data&&o&&o.$data,v;d?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",v="schema"+i):v=o;var x=this,b="definition"+i,E=x.definition,k="",O,P,I,$,A;if(d&&E.$data){A="keywordValidate"+i;var F=E.validateSchema;s+=" var "+b+" = RULES.custom['"+r+"'].definition; var "+A+" = "+b+".validate;"}else{if($=e.useCustomRule(x,o,e.schema,e),!$)return;v="validate.schema"+l,A=$.code,O=E.compile,P=E.inline,I=E.macro}var q=A+".errors",C="i"+i,R="ruleErr"+i,j=E.async;if(j&&!e.async)throw new Error("async keyword in sync schema");if(P||I||(s+=""+q+" = null;"),s+="var "+h+" = errors;var "+f+";",d&&E.$data&&(k+="}",s+=" if ("+v+" === undefined) { "+f+" = true; } else { ",F&&(k+="}",s+=" "+f+" = "+b+".validateSchema("+v+"); if ("+f+") { ")),P)E.statements?s+=" "+$.validate+" ":s+=" "+f+" = "+$.validate+"; ";else if(I){var z=e.util.copy(e),k="";z.level++;var B="valid"+z.level;z.schema=$.validate,z.schemaPath="";var G=e.compositeRule;e.compositeRule=z.compositeRule=!0;var te=e.validate(z).replace(/validate\.schema/g,A);e.compositeRule=z.compositeRule=G,s+=" "+te}else{var X=X||[];X.push(s),s="",s+=" "+A+".call( ",e.opts.passContext?s+="this":s+="self",O||E.schema===!1?s+=" , "+m+" ":s+=" , "+v+" , "+m+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var V=n?"data"+(n-1||""):"parentData",re=n?e.dataPathArr[n]:"parentDataProperty";s+=" , "+V+" , "+re+" , rootData ) ";var ce=s;s=X.pop(),E.errors===!1?(s+=" "+f+" = ",j&&(s+="await "),s+=""+ce+"; "):j?(q="customErrors"+i,s+=" var "+q+" = null; try { "+f+" = await "+ce+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+q+" = e.errors; else throw e; } "):s+=" "+q+" = null; "+f+" = "+ce+"; "}if(E.modifying&&(s+=" if ("+V+") "+m+" = "+V+"["+re+"];"),s+=""+k,E.valid)u&&(s+=" if (true) { ");else{s+=" if ( ",E.valid===void 0?(s+=" !",I?s+=""+B:s+=""+f):s+=" "+!E.valid+" ",s+=") { ",p=x.keyword;var X=X||[];X.push(s),s="";var X=X||[];X.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(s+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),s+=" } "):s+=" {} ";var Be=s;s=X.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+Be+"]); ":s+=" validate.errors = ["+Be+"]; return false; ":s+=" var err = "+Be+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var be=s;s=X.pop(),P?E.errors?E.errors!="full"&&(s+=" for (var "+C+"="+h+"; "+C+"{c9.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var y_=M((HL,g_)=>{"use strict";var v_=nd();g_.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:v_.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:v_.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var x_=M((BL,b_)=>{"use strict";var l9=/^[a-z_$][a-z0-9_$-]*$/i,u9=h_(),p9=y_();b_.exports={add:d9,get:f9,remove:m9,validate:id};function d9(a,e){var r=this.RULES;if(r.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!l9.test(a))throw new Error("Keyword "+a+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var t=e.type;if(Array.isArray(t))for(var s=0;s{h9.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var I_=M((GL,C_)=>{"use strict";var w_=e0(),ms=wc(),v9=r0(),S_=Vp(),g9=Xp(),y9=m0(),b9=o_(),P_=u_(),R_=fs();C_.exports=ut;ut.prototype.validate=_9;ut.prototype.compile=E9;ut.prototype.addSchema=w9;ut.prototype.addMetaSchema=S9;ut.prototype.validateSchema=P9;ut.prototype.getSchema=T9;ut.prototype.removeSchema=O9;ut.prototype.addFormat=q9;ut.prototype.errorsText=$9;ut.prototype._addSchema=C9;ut.prototype._compile=I9;ut.prototype.compileAsync=f_();var Ac=x_();ut.prototype.addKeyword=Ac.add;ut.prototype.getKeyword=Ac.get;ut.prototype.removeKeyword=Ac.remove;ut.prototype.validateKeyword=Ac.validate;var T_=Sc();ut.ValidationError=T_.Validation;ut.MissingRefError=T_.MissingRef;ut.$dataMetaSchema=P_;var Ic="http://json-schema.org/draft-07/schema",E_=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],x9=["/properties"];function ut(a){if(!(this instanceof ut))return new ut(a);a=this._opts=R_.copy(a)||{},H9(this),this._schemas={},this._refs={},this._fragments={},this._formats=y9(a.format),this._cache=a.cache||new v9,this._loadingSchemas={},this._compilations=[],this.RULES=b9(),this._getId=A9(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=!0),a.serialize===void 0&&(a.serialize=g9),this._metaOpts=z9(this),a.formats&&L9(this),a.keywords&&U9(this),M9(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),F9(this)}function _9(a,e){var r;if(typeof a=="string"){if(r=this.getSchema(a),!r)throw new Error('no schema with key or ref "'+a+'"')}else{var t=this._addSchema(a);r=t.validate||this._compile(t)}var s=r(e);return r.$async!==!0&&(this.errors=r.errors),s}function E9(a,e){var r=this._addSchema(a,void 0,e);return r.validate||this._compile(r)}function w9(a,e,r,t){if(Array.isArray(a)){for(var s=0;s{$_.exports=D_;D_.sync=V9;var j_=require("fs");function B9(a,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var t=0;t{U_.exports=F_;F_.sync=G9;var M_=require("fs");function F_(a,e,r){M_.stat(a,function(t,s){r(t,t?!1:L_(s,e))})}function G9(a,e){return L_(M_.statSync(a),e)}function L_(a,e){return a.isFile()&&Z9(a,e)}function Z9(a,e){var r=a.mode,t=a.uid,s=a.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),n=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),o=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=o|l,p=r&c||r&l&&s===n||r&o&&t===i||r&u&&i===0;return p}});var B_=M((YL,H_)=>{var JL=require("fs"),jc;process.platform==="win32"||global.TESTING_WINDOWS?jc=q_():jc=z_();H_.exports=cd;cd.sync=W9;function cd(a,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(t,s){cd(a,e||{},function(i,n){i?s(i):t(n)})})}jc(a,e||{},function(t,s){t&&(t.code==="EACCES"||e&&e.ignoreErrors)&&(t=null,s=!1),r(t,s)})}function W9(a,e){try{return jc.sync(a,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var X_=M((e3,Q_)=>{var yn=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",V_=require("path"),K9=yn?";":":",G_=B_(),Z_=a=>Object.assign(new Error(`not found: ${a}`),{code:"ENOENT"}),W_=(a,e)=>{let r=e.colon||K9,t=a.match(/\//)||yn&&a.match(/\\/)?[""]:[...yn?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],s=yn?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=yn?s.split(r):[""];return yn&&a.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:t,pathExt:i,pathExtExe:s}},K_=(a,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:t,pathExt:s,pathExtExe:i}=W_(a,e),n=[],o=c=>new Promise((u,p)=>{if(c===t.length)return e.all&&n.length?u(n):p(Z_(a));let m=t[c],f=/^".*"$/.test(m)?m.slice(1,-1):m,h=V_.join(f,a),d=!f&&/^\.[\\\/]/.test(a)?a.slice(0,2)+h:h;u(l(d,c,0))}),l=(c,u,p)=>new Promise((m,f)=>{if(p===s.length)return m(o(u+1));let h=s[p];G_(c+h,{pathExt:i},(d,v)=>{if(!d&&v)if(e.all)n.push(c+h);else return m(c+h);return m(l(c,u,p+1))})});return r?o(0).then(c=>r(null,c),r):o(0)},Q9=(a,e)=>{e=e||{};let{pathEnv:r,pathExt:t,pathExtExe:s}=W_(a,e),i=[];for(let n=0;n{"use strict";var J_=(a={})=>{let e=a.env||process.env;return(a.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(t=>t.toUpperCase()==="PATH")||"Path"};ld.exports=J_;ld.exports.default=J_});var aE=M((r3,rE)=>{"use strict";var eE=require("path"),X9=X_(),J9=Y_();function tE(a,e){let r=a.options.env||process.env,t=process.cwd(),s=a.options.cwd!=null,i=s&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(a.options.cwd)}catch{}let n;try{n=X9.sync(a.command,{path:r[J9({env:r})],pathExt:e?eE.delimiter:void 0})}catch{}finally{i&&process.chdir(t)}return n&&(n=eE.resolve(s?a.options.cwd:"",n)),n}function Y9(a){return tE(a)||tE(a,!0)}rE.exports=Y9});var sE=M((a3,pd)=>{"use strict";var ud=/([()\][%!^"`<>&|;, *?])/g;function ej(a){return a=a.replace(ud,"^$1"),a}function tj(a,e){return a=`${a}`,a=a.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),a=a.replace(/(?=(\\+?)?)\1$/,"$1$1"),a=`"${a}"`,a=a.replace(ud,"^$1"),e&&(a=a.replace(ud,"^$1")),a}pd.exports.command=ej;pd.exports.argument=tj});var iE=M((s3,nE)=>{"use strict";nE.exports=/^#!(.*)/});var cE=M((n3,oE)=>{"use strict";var rj=iE();oE.exports=(a="")=>{let e=a.match(rj);if(!e)return null;let[r,t]=e[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?t:t?`${s} ${t}`:s}});var uE=M((i3,lE)=>{"use strict";var dd=require("fs"),aj=cE();function sj(a){let r=Buffer.alloc(150),t;try{t=dd.openSync(a,"r"),dd.readSync(t,r,0,150,0),dd.closeSync(t)}catch{}return aj(r.toString())}lE.exports=sj});var mE=M((o3,fE)=>{"use strict";var nj=require("path"),pE=aE(),dE=sE(),ij=uE(),oj=process.platform==="win32",cj=/\.(?:com|exe)$/i,lj=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function uj(a){a.file=pE(a);let e=a.file&&ij(a.file);return e?(a.args.unshift(a.file),a.command=e,pE(a)):a.file}function pj(a){if(!oj)return a;let e=uj(a),r=!cj.test(e);if(a.options.forceShell||r){let t=lj.test(e);a.command=nj.normalize(a.command),a.command=dE.command(a.command),a.args=a.args.map(i=>dE.argument(i,t));let s=[a.command].concat(a.args).join(" ");a.args=["/d","/s","/c",`"${s}"`],a.command=process.env.comspec||"cmd.exe",a.options.windowsVerbatimArguments=!0}return a}function dj(a,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let t={command:a,args:e,options:r,file:void 0,original:{command:a,args:e}};return r.shell?t:pj(t)}fE.exports=dj});var gE=M((c3,vE)=>{"use strict";var fd=process.platform==="win32";function md(a,e){return Object.assign(new Error(`${e} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${a.command}`,path:a.command,spawnargs:a.args})}function fj(a,e){if(!fd)return;let r=a.emit;a.emit=function(t,s){if(t==="exit"){let i=hE(s,e);if(i)return r.call(a,"error",i)}return r.apply(a,arguments)}}function hE(a,e){return fd&&a===1&&!e.file?md(e.original,"spawn"):null}function mj(a,e){return fd&&a===1&&!e.file?md(e.original,"spawnSync"):null}vE.exports={hookChildProcess:fj,verifyENOENT:hE,verifyENOENTSync:mj,notFoundError:md}});var xE=M((l3,bn)=>{"use strict";var yE=require("child_process"),hd=mE(),vd=gE();function bE(a,e,r){let t=hd(a,e,r),s=yE.spawn(t.command,t.args,t.options);return vd.hookChildProcess(s,t),s}function hj(a,e,r){let t=hd(a,e,r),s=yE.spawnSync(t.command,t.args,t.options);return s.error=s.error||vd.verifyENOENTSync(s.status,t),s}bn.exports=bE;bn.exports.spawn=bE;bn.exports.sync=hj;bn.exports._parse=hd;bn.exports._enoent=vd});var T$={};Hd(T$,{WorkerService:()=>$i,default:()=>R$});module.exports=tw(T$);var nl=jt(Gb(),1),B1=jt(Xb(),1),Rr=jt(require("path"),1),vt=require("fs"),il=require("os");var _t=require("path"),vp=require("os"),gp=require("fs");var Jb=require("url"),nA={};function aA(){return typeof __dirname<"u"?__dirname:(0,_t.dirname)((0,Jb.fileURLToPath)(nA.url))}var sA=aA(),wr=process.env.CLAUDE_MEM_DATA_DIR||(0,_t.join)((0,vp.homedir)(),".claude-mem"),yp=process.env.CLAUDE_CONFIG_DIR||(0,_t.join)((0,vp.homedir)(),".claude"),iF=(0,_t.join)(wr,"archives"),oF=(0,_t.join)(wr,"logs"),cF=(0,_t.join)(wr,"trash"),lF=(0,_t.join)(wr,"backups"),uF=(0,_t.join)(wr,"settings.json"),Xo=(0,_t.join)(wr,"claude-mem.db"),pF=(0,_t.join)(wr,"vector-db"),dF=(0,_t.join)(yp,"settings.json"),fF=(0,_t.join)(yp,"commands"),mF=(0,_t.join)(yp,"CLAUDE.md");function Jo(a){(0,gp.mkdirSync)(a,{recursive:!0})}function Ka(){return(0,_t.join)(sA,"..","..")}var Yb=jt(require("path"),1),ex=require("os"),Yo=require("fs");function ec(){try{let a=Yb.default.join((0,ex.homedir)(),".claude-mem","settings.json");if((0,Yo.existsSync)(a)){let e=JSON.parse((0,Yo.readFileSync)(a,"utf-8")),r=parseInt(e.env?.CLAUDE_MEM_WORKER_PORT,10);if(!isNaN(r))return r}}catch{}return parseInt(process.env.CLAUDE_MEM_WORKER_PORT||"37777",10)}var bp=(i=>(i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.SILENT=4]="SILENT",i))(bp||{}),xp=class{level;useColor;constructor(){let e=process.env.CLAUDE_MEM_LOG_LEVEL?.toUpperCase()||"INFO";this.level=bp[e]??1,this.useColor=process.stdout.isTTY??!1}correlationId(e,r){return`obs-${e}-${r}`}sessionId(e){return`session-${e}`}formatData(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="object"){if(e instanceof Error)return this.level===0?`${e.message} +`}function GI(){return function(){this.error(404)}}function ZI(){return function(e){if(this.hasTrailingSlash()){this.error(404);return}var r=mp.original(this.req);r.path=null,r.pathname=BI(r.pathname+"/");var t=FI(zI.format(r)),s=VI("Redirecting","Redirecting to "+LI(t));e.statusCode=301,e.setHeader("Content-Type","text/html; charset=UTF-8"),e.setHeader("Content-Length",Buffer.byteLength(s)),e.setHeader("Content-Security-Policy","default-src 'none'"),e.setHeader("X-Content-Type-Options","nosniff"),e.setHeader("Location",t),e.end(s)}}});var Bb=M((qt,Hb)=>{"use strict";var Qo=dg(),WI=require("events").EventEmitter,Fb=mg(),Lb=Wy(),KI=Mu(),QI=Lu(),Ub=xb(),zb=$b();qt=Hb.exports=XI;function XI(){var a=function(e,r,t){a.handle(e,r,t)};return Fb(a,WI.prototype,!1),Fb(a,Lb,!1),a.request=Object.create(Ub,{app:{configurable:!0,enumerable:!0,writable:!0,value:a}}),a.response=Object.create(zb,{app:{configurable:!0,enumerable:!0,writable:!0,value:a}}),a.init(),a}qt.application=Lb;qt.request=Ub;qt.response=zb;qt.Route=KI;qt.Router=QI;qt.json=Qo.json;qt.query=Uu();qt.raw=Qo.raw;qt.static=Mb();qt.text=Qo.text;qt.urlencoded=Qo.urlencoded;var JI=["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"];JI.forEach(function(a){Object.defineProperty(qt,a,{get:function(){throw new Error("Most middleware (like "+a+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})})});var Gb=M((rF,Vb)=>{"use strict";Vb.exports=Bb()});var Kb=M((aF,Wb)=>{"use strict";var Zb=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,eA=Object.prototype.propertyIsEnumerable;function tA(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function rA(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var t=Object.getOwnPropertyNames(e).map(function(i){return e[i]});if(t.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(i){s[i]=i}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Wb.exports=rA()?Object.assign:function(a,e){for(var r,t=tA(a),s,i=1;i{(function(){"use strict";var a=Kb(),e=dp(),r={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function t(h){return typeof h=="string"||h instanceof String}function s(h,d){if(Array.isArray(d)){for(var v=0;v{(function(a,e){typeof hc=="object"&&typeof Ix<"u"?e(hc):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{})})(hc,(function(a){"use strict";function e(){for(var N=arguments.length,T=Array(N),y=0;y1){T[0]=T[0].slice(0,-1);for(var g=T.length-1,S=1;S= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=f-h,F=Math.floor,q=String.fromCharCode;function C(N){throw new RangeError($[N])}function R(N,T){for(var y=[],g=N.length;g--;)y[g]=T(N[g]);return y}function j(N,T){var y=N.split("@"),g="";y.length>1&&(g=y[0]+"@",N=y[1]),N=N.replace(I,".");var S=N.split("."),D=R(S,T).join(".");return g+D}function z(N){for(var T=[],y=0,g=N.length;y=55296&&S<=56319&&y>1,T+=F(T/y);T>A*d>>1;S+=f)T=F(T/A);return F(S+(A+1)*T/(T+v))},V=function(T){var y=[],g=T.length,S=0,D=E,L=b,K=T.lastIndexOf(k);K<0&&(K=0);for(var ne=0;ne=128&&C("not-basic"),y.push(T.charCodeAt(ne));for(var ge=K>0?K+1:0;ge=g&&C("invalid-input");var Re=G(T.charCodeAt(ge++));(Re>=f||Re>F((m-S)/Ae))&&C("overflow"),S+=Re*Ae;var ye=ve<=L?h:ve>=L+d?d:ve-L;if(ReF(m/Te)&&C("overflow"),Ae*=Te}var de=y.length+1;L=X(S-pe,de,pe==0),F(S/de)>m-D&&C("overflow"),D+=F(S/de),S%=de,y.splice(S++,0,D)}return String.fromCodePoint.apply(String,y)},re=function(T){var y=[];T=z(T);var g=T.length,S=E,D=0,L=b,K=!0,ne=!1,ge=void 0;try{for(var pe=T[Symbol.iterator](),Ae;!(K=(Ae=pe.next()).done);K=!0){var ve=Ae.value;ve<128&&y.push(q(ve))}}catch(At){ne=!0,ge=At}finally{try{!K&&pe.return&&pe.return()}finally{if(ne)throw ge}}var Re=y.length,ye=Re;for(Re&&y.push(k);ye=S&&stF((m-D)/Fe)&&C("overflow"),D+=(Te-S)*Fe,S=Te;var it=!0,dt=!1,ft=void 0;try{for(var Bt=T[Symbol.iterator](),It;!(it=(It=Bt.next()).done);it=!0){var Tr=It.value;if(Trm&&C("overflow"),Tr==S){for(var vr=D,gr=f;;gr+=f){var St=gr<=L?h:gr>=L+d?d:gr-L;if(vr>6|192).toString(16).toUpperCase()+"%"+(T&63|128).toString(16).toUpperCase():y="%"+(T>>12|224).toString(16).toUpperCase()+"%"+(T>>6&63|128).toString(16).toUpperCase()+"%"+(T&63|128).toString(16).toUpperCase(),y}function Oe(N){for(var T="",y=0,g=N.length;y=194&&S<224){if(g-y>=6){var D=parseInt(N.substr(y+4,2),16);T+=String.fromCharCode((S&31)<<6|D&63)}else T+=N.substr(y,6);y+=6}else if(S>=224){if(g-y>=9){var L=parseInt(N.substr(y+4,2),16),K=parseInt(N.substr(y+7,2),16);T+=String.fromCharCode((S&15)<<12|(L&63)<<6|K&63)}else T+=N.substr(y,9);y+=9}else T+=N.substr(y,3),y+=3}return T}function U(N,T){function y(g){var S=Oe(g);return S.match(T.UNRESERVED)?S:g}return N.scheme&&(N.scheme=String(N.scheme).replace(T.PCT_ENCODED,y).toLowerCase().replace(T.NOT_SCHEME,"")),N.userinfo!==void 0&&(N.userinfo=String(N.userinfo).replace(T.PCT_ENCODED,y).replace(T.NOT_USERINFO,xe).replace(T.PCT_ENCODED,s)),N.host!==void 0&&(N.host=String(N.host).replace(T.PCT_ENCODED,y).toLowerCase().replace(T.NOT_HOST,xe).replace(T.PCT_ENCODED,s)),N.path!==void 0&&(N.path=String(N.path).replace(T.PCT_ENCODED,y).replace(N.scheme?T.NOT_PATH:T.NOT_PATH_NOSCHEME,xe).replace(T.PCT_ENCODED,s)),N.query!==void 0&&(N.query=String(N.query).replace(T.PCT_ENCODED,y).replace(T.NOT_QUERY,xe).replace(T.PCT_ENCODED,s)),N.fragment!==void 0&&(N.fragment=String(N.fragment).replace(T.PCT_ENCODED,y).replace(T.NOT_FRAGMENT,xe).replace(T.PCT_ENCODED,s)),N}function Z(N){return N.replace(/^0*(.*)/,"$1")||"0"}function ee(N,T){var y=N.match(T.IPV4ADDRESS)||[],g=u(y,2),S=g[1];return S?S.split(".").map(Z).join("."):N}function ue(N,T){var y=N.match(T.IPV6ADDRESS)||[],g=u(y,3),S=g[1],D=g[2];if(S){for(var L=S.toLowerCase().split("::").reverse(),K=u(L,2),ne=K[0],ge=K[1],pe=ge?ge.split(":").map(Z):[],Ae=ne.split(":").map(Z),ve=T.IPV4ADDRESS.test(Ae[Ae.length-1]),Re=ve?7:8,ye=Ae.length-Re,Te=Array(Re),de=0;de1){var Me=Te.slice(0,Ne.index),st=Te.slice(Ne.index+Ne.length);pt=Me.join(":")+"::"+st.join(":")}else pt=Te.join(":");return D&&(pt+="%"+D),pt}else return N}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Q="".match(/(){0}/)[1]===void 0;function ie(N){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={},g=T.iri!==!1?c:l;T.reference==="suffix"&&(N=(T.scheme?T.scheme+":":"")+"//"+N);var S=N.match(W);if(S){Q?(y.scheme=S[1],y.userinfo=S[3],y.host=S[4],y.port=parseInt(S[5],10),y.path=S[6]||"",y.query=S[7],y.fragment=S[8],isNaN(y.port)&&(y.port=S[5])):(y.scheme=S[1]||void 0,y.userinfo=N.indexOf("@")!==-1?S[3]:void 0,y.host=N.indexOf("//")!==-1?S[4]:void 0,y.port=parseInt(S[5],10),y.path=S[6]||"",y.query=N.indexOf("?")!==-1?S[7]:void 0,y.fragment=N.indexOf("#")!==-1?S[8]:void 0,isNaN(y.port)&&(y.port=N.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?S[4]:void 0)),y.host&&(y.host=ue(ee(y.host,g),g)),y.scheme===void 0&&y.userinfo===void 0&&y.host===void 0&&y.port===void 0&&!y.path&&y.query===void 0?y.reference="same-document":y.scheme===void 0?y.reference="relative":y.fragment===void 0?y.reference="absolute":y.reference="uri",T.reference&&T.reference!=="suffix"&&T.reference!==y.reference&&(y.error=y.error||"URI is not a "+T.reference+" reference.");var D=qe[(T.scheme||y.scheme||"").toLowerCase()];if(!T.unicodeSupport&&(!D||!D.unicodeSupport)){if(y.host&&(T.domainHost||D&&D.domainHost))try{y.host=be.toASCII(y.host.replace(g.PCT_ENCODED,Oe).toLowerCase())}catch(L){y.error=y.error||"Host's domain name can not be converted to ASCII via punycode: "+L}U(y,l)}else U(y,g);D&&D.parse&&D.parse(y,T)}else y.error=y.error||"URI can not be parsed.";return y}function Ie(N,T){var y=T.iri!==!1?c:l,g=[];return N.userinfo!==void 0&&(g.push(N.userinfo),g.push("@")),N.host!==void 0&&g.push(ue(ee(String(N.host),y),y).replace(y.IPV6ADDRESS,function(S,D,L){return"["+D+(L?"%25"+L:"")+"]"})),(typeof N.port=="number"||typeof N.port=="string")&&(g.push(":"),g.push(String(N.port))),g.length?g.join(""):void 0}var he=/^\.\.?\//,Ze=/^\/\.(\/|$)/,We=/^\/\.\.(\/|$)/,Ee=/^\/?(?:.|\n)*?(?=\/|$)/;function Ye(N){for(var T=[];N.length;)if(N.match(he))N=N.replace(he,"");else if(N.match(Ze))N=N.replace(Ze,"/");else if(N.match(We))N=N.replace(We,"/"),T.pop();else if(N==="."||N==="..")N="";else{var y=N.match(Ee);if(y){var g=y[0];N=N.slice(g.length),T.push(g)}else throw new Error("Unexpected dot segment condition")}return T.join("")}function Ue(N){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=T.iri?c:l,g=[],S=qe[(T.scheme||N.scheme||"").toLowerCase()];if(S&&S.serialize&&S.serialize(N,T),N.host&&!y.IPV6ADDRESS.test(N.host)){if(T.domainHost||S&&S.domainHost)try{N.host=T.iri?be.toUnicode(N.host):be.toASCII(N.host.replace(y.PCT_ENCODED,Oe).toLowerCase())}catch(K){N.error=N.error||"Host's domain name can not be converted to "+(T.iri?"Unicode":"ASCII")+" via punycode: "+K}}U(N,y),T.reference!=="suffix"&&N.scheme&&(g.push(N.scheme),g.push(":"));var D=Ie(N,T);if(D!==void 0&&(T.reference!=="suffix"&&g.push("//"),g.push(D),N.path&&N.path.charAt(0)!=="/"&&g.push("/")),N.path!==void 0){var L=N.path;!T.absolutePath&&(!S||!S.absolutePath)&&(L=Ye(L)),D===void 0&&(L=L.replace(/^\/\//,"/%2F")),g.push(L)}return N.query!==void 0&&(g.push("?"),g.push(N.query)),N.fragment!==void 0&&(g.push("#"),g.push(N.fragment)),g.join("")}function Qe(N,T){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},g=arguments[3],S={};return g||(N=ie(Ue(N,y),y),T=ie(Ue(T,y),y)),y=y||{},!y.tolerant&&T.scheme?(S.scheme=T.scheme,S.userinfo=T.userinfo,S.host=T.host,S.port=T.port,S.path=Ye(T.path||""),S.query=T.query):(T.userinfo!==void 0||T.host!==void 0||T.port!==void 0?(S.userinfo=T.userinfo,S.host=T.host,S.port=T.port,S.path=Ye(T.path||""),S.query=T.query):(T.path?(T.path.charAt(0)==="/"?S.path=Ye(T.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?S.path="/"+T.path:N.path?S.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+T.path:S.path=T.path,S.path=Ye(S.path)),S.query=T.query):(S.path=N.path,T.query!==void 0?S.query=T.query:S.query=N.query),S.userinfo=N.userinfo,S.host=N.host,S.port=N.port),S.scheme=N.scheme),S.fragment=T.fragment,S}function Ve(N,T,y){var g=n({scheme:"null"},y);return Ue(Qe(ie(N,g),ie(T,g),g,!0),g)}function Ke(N,T){return typeof N=="string"?N=Ue(ie(N,T),T):t(N)==="object"&&(N=ie(Ue(N,T),T)),N}function bt(N,T,y){return typeof N=="string"?N=Ue(ie(N,y),y):t(N)==="object"&&(N=Ue(N,y)),typeof T=="string"?T=Ue(ie(T,y),y):t(T)==="object"&&(T=Ue(T,y)),N===T}function xt(N,T){return N&&N.toString().replace(!T||!T.iri?l.ESCAPE:c.ESCAPE,xe)}function wt(N,T){return N&&N.toString().replace(!T||!T.iri?l.PCT_ENCODED:c.PCT_ENCODED,Oe)}var Br={scheme:"http",domainHost:!0,parse:function(T,y){return T.host||(T.error=T.error||"HTTP URIs must have a host."),T},serialize:function(T,y){var g=String(T.scheme).toLowerCase()==="https";return(T.port===(g?443:80)||T.port==="")&&(T.port=void 0),T.path||(T.path="/"),T}},Ct={scheme:"https",domainHost:Br.domainHost,parse:Br.parse,serialize:Br.serialize};function ia(N){return typeof N.secure=="boolean"?N.secure:String(N.scheme).toLowerCase()==="wss"}var oa={scheme:"ws",domainHost:!0,parse:function(T,y){var g=T;return g.secure=ia(g),g.resourceName=(g.path||"/")+(g.query?"?"+g.query:""),g.path=void 0,g.query=void 0,g},serialize:function(T,y){if((T.port===(ia(T)?443:80)||T.port==="")&&(T.port=void 0),typeof T.secure=="boolean"&&(T.scheme=T.secure?"wss":"ws",T.secure=void 0),T.resourceName){var g=T.resourceName.split("?"),S=u(g,2),D=S[0],L=S[1];T.path=D&&D!=="/"?D:void 0,T.query=L,T.resourceName=void 0}return T.fragment=void 0,T}},Nn={scheme:"wss",domainHost:oa.domainHost,parse:oa.parse,serialize:oa.serialize},Ia={},qi=!0,Mi="[A-Za-z0-9\\-\\.\\_\\~"+(qi?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Jt="[0-9A-Fa-f]",Fi=r(r("%[EFef]"+Jt+"%"+Jt+Jt+"%"+Jt+Jt)+"|"+r("%[89A-Fa-f]"+Jt+"%"+Jt+Jt)+"|"+r("%"+Jt+Jt)),Yt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ol="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",cl=e(ol,'[\\"\\\\]'),ll="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",ul=new RegExp(Mi,"g"),ca=new RegExp(Fi,"g"),pl=new RegExp(e("[^]",Yt,"[\\.]",'[\\"]',cl),"g"),Vr=new RegExp(e("[^]",Mi,ll),"g"),dl=Vr;function js(N){var T=Oe(N);return T.match(ul)?T:N}var Li={scheme:"mailto",parse:function(T,y){var g=T,S=g.to=g.path?g.path.split(","):[];if(g.path=void 0,g.query){for(var D=!1,L={},K=g.query.split("&"),ne=0,ge=K.length;ne{"use strict";jx.exports=function a(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var t,s,i;if(Array.isArray(e)){if(t=e.length,t!=r.length)return!1;for(s=t;s--!==0;)if(!a(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),t=i.length,t!==Object.keys(r).length)return!1;for(s=t;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=t;s--!==0;){var n=i[s];if(!a(e[n],r[n]))return!1}return!0}return e!==e&&r!==r}});var Dx=M((aL,Nx)=>{"use strict";Nx.exports=function(e){for(var r=0,t=e.length,s=0,i;s=55296&&i<=56319&&s{"use strict";Mx.exports={copy:d8,checkDataType:Mp,checkDataTypes:f8,coerceToTypes:m8,toHash:Lp,getProperty:Up,escapeQuotes:zp,equal:vc(),ucs2length:Dx(),varOccurences:g8,varReplace:y8,schemaHasRules:b8,schemaHasRulesExcept:x8,schemaUnknownRules:_8,toQuotedString:Fp,getPathExpr:E8,getPath:w8,getData:R8,unescapeFragment:T8,unescapeJsonPointer:Bp,escapeFragment:k8,escapeJsonPointer:Hp};function d8(a,e){e=e||{};for(var r in a)e[r]=a[r];return e}function Mp(a,e,r,t){var s=t?" !== ":" === ",i=t?" || ":" && ",n=t?"!":"",o=t?"":"!";switch(a){case"null":return e+s+"null";case"array":return n+"Array.isArray("+e+")";case"object":return"("+n+e+i+"typeof "+e+s+'"object"'+i+o+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+s+'"number"'+i+o+"("+e+" % 1)"+i+e+s+e+(r?i+n+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+s+'"'+a+'"'+(r?i+n+"isFinite("+e+")":"")+")";default:return"typeof "+e+s+'"'+a+'"'}}function f8(a,e,r){switch(a.length){case 1:return Mp(a[0],e,r,!0);default:var t="",s=Lp(a);s.array&&s.object&&(t=s.null?"(":"(!"+e+" || ",t+="typeof "+e+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer;for(var i in s)t+=(t?" && ":"")+Mp(i,e,r,!0);return t}}var $x=Lp(["string","number","integer","boolean","null"]);function m8(a,e){if(Array.isArray(e)){for(var r=[],t=0;t=e)throw new Error("Cannot access property/index "+t+" levels up, current level is "+e);return r[e-t]}if(t>e)throw new Error("Cannot access data "+t+" levels up, current level is "+e);if(i="data"+(e-t||""),!s)return i}for(var o=i,l=s.split("/"),c=0;c{"use strict";var O8=fs();Fx.exports=C8;function C8(a){O8.copy(a,this)}});var Ux=M((iL,Lx)=>{"use strict";var Pa=Lx.exports=function(a,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var t=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};gc(e,t,s,a,"",a)};Pa.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};Pa.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Pa.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Pa.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function gc(a,e,r,t,s,i,n,o,l,c){if(t&&typeof t=="object"&&!Array.isArray(t)){e(t,s,i,n,o,l,c);for(var u in t){var p=t[u];if(Array.isArray(p)){if(u in Pa.arrayKeywords)for(var m=0;m{"use strict";var Ri=Ax(),zx=vc(),_c=fs(),yc=Vp(),A8=Ux();Vx.exports=Ta;Ta.normalizeId=Ra;Ta.fullPath=bc;Ta.url=xc;Ta.ids=q8;Ta.inlineRef=Gp;Ta.schema=Ec;function Ta(a,e,r){var t=this._refs[r];if(typeof t=="string")if(this._refs[t])t=this._refs[t];else return Ta.call(this,a,e,t);if(t=t||this._schemas[r],t instanceof yc)return Gp(t.schema,this._opts.inlineRefs)?t.schema:t.validate||this._compile(t);var s=Ec.call(this,e,r),i,n,o;return s&&(i=s.schema,e=s.root,o=s.baseId),i instanceof yc?n=i.validate||a.call(this,i.schema,e,void 0,o):i!==void 0&&(n=Gp(i,this._opts.inlineRefs)?i:a.call(this,i,e,void 0,o)),n}function Ec(a,e){var r=Ri.parse(e),t=Bx(r),s=bc(this._getId(a.schema));if(Object.keys(a.schema).length===0||t!==s){var i=Ra(t),n=this._refs[i];if(typeof n=="string")return j8.call(this,a,n,r);if(n instanceof yc)n.validate||this._compile(n),a=n;else if(n=this._schemas[i],n instanceof yc){if(n.validate||this._compile(n),i==Ra(e))return{schema:n,root:a,baseId:s};a=n}else return;if(!a.schema)return;s=bc(this._getId(a.schema))}return Hx.call(this,r,s,a.schema,a)}function j8(a,e,r){var t=Ec.call(this,a,e);if(t){var s=t.schema,i=t.baseId;a=t.root;var n=this._getId(s);return n&&(i=xc(i,n)),Hx.call(this,r,i,s,a)}}var N8=_c.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Hx(a,e,r,t){if(a.fragment=a.fragment||"",a.fragment.slice(0,1)=="/"){for(var s=a.fragment.split("/"),i=1;i{"use strict";var Kp=wc();Zx.exports={Validation:Gx(M8),MissingRef:Gx(Qp)};function M8(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}Qp.message=function(a,e){return"can't resolve reference "+e+" from id "+a};function Qp(a,e,r){this.message=r||Qp.message(a,e),this.missingRef=Kp.url(a,e),this.missingSchema=Kp.normalizeId(Kp.fullPath(this.missingRef))}function Gx(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var Xp=M((lL,Wx)=>{"use strict";Wx.exports=function(a,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,t=e.cmp&&(function(i){return function(n){return function(o,l){var c={key:o,value:n[o]},u={key:l,value:n[l]};return i(c,u)}}})(e.cmp),s=[];return(function i(n){if(n&&n.toJSON&&typeof n.toJSON=="function"&&(n=n.toJSON()),n!==void 0){if(typeof n=="number")return isFinite(n)?""+n:"null";if(typeof n!="object")return JSON.stringify(n);var o,l;if(Array.isArray(n)){for(l="[",o=0;o{"use strict";Kx.exports=function(e,r,t){var s="",i=e.schema.$async===!0,n=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var l=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(l){var c="unknown keyword: "+l;if(e.opts.strictKeywords==="log")e.logger.warn(c);else throw new Error(c)}}if(e.isTop&&(s+=" var validate = ",i&&(e.async=!0,s+="async "),s+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(s+=" "+("/*# sourceURL="+o+" */")+" ")),typeof e.schema=="boolean"||!(n||e.schema.$ref)){var r="false schema",u=e.level,p=e.dataLevel,m=e.schema[r],f=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,O=!e.opts.allErrors,$,d="data"+(p||""),k="valid"+u;if(e.schema===!1){e.isTop?O=!0:s+=" var "+k+" = false; ";var v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+($||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'boolean schema is false' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var x=s;s=v.pop(),!e.compositeRule&&O?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i?s+=" return data; ":s+=" validate.errors = null; return true; ":s+=" var "+k+" = true; ";return e.isTop&&(s+=" }; return validate; "),s}if(e.isTop){var b=e.isTop,u=e.level=0,p=e.dataLevel=0,d="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var E="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(E);else throw new Error(E)}s+=" var vErrors = null; ",s+=" var errors = 0; ",s+=" if (rootData === undefined) rootData = data; "}else{var u=e.level,p=e.dataLevel,d="data"+(p||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),i&&!e.async)throw new Error("async schema in sync schema");s+=" var errs_"+u+" = errors;"}var k="valid"+u,O=!e.opts.allErrors,P="",I="",$,A=e.schema.type,F=Array.isArray(A);if(A&&e.opts.nullable&&e.schema.nullable===!0&&(F?A.indexOf("null")==-1&&(A=A.concat("null")):A!="null"&&(A=[A,"null"],F=!0)),F&&A.length==1&&(A=A[0],F=!1),e.schema.$ref&&n){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(n=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(s+=" "+e.RULES.all.$comment.code(e,"$comment")),A){if(e.opts.coerceTypes)var q=e.util.coerceToTypes(e.opts.coerceTypes,A);var C=e.RULES.types[A];if(q||F||C===!0||C&&!Ee(C)){var f=e.schemaPath+".type",h=e.errSchemaPath+"/type",f=e.schemaPath+".type",h=e.errSchemaPath+"/type",R=F?"checkDataTypes":"checkDataType";if(s+=" if ("+e.util[R](A,d,e.opts.strictNumbers,!0)+") { ",q){var j="dataType"+u,z="coerced"+u;s+=" var "+j+" = typeof "+d+"; var "+z+" = undefined; ",e.opts.coerceTypes=="array"&&(s+=" if ("+j+" == 'object' && Array.isArray("+d+") && "+d+".length == 1) { "+d+" = "+d+"[0]; "+j+" = typeof "+d+"; if ("+e.util.checkDataType(e.schema.type,d,e.opts.strictNumbers)+") "+z+" = "+d+"; } "),s+=" if ("+z+" !== undefined) ; ";var B=q;if(B)for(var G,te=-1,X=B.length-1;te{"use strict";var Pc=wc(),Tc=fs(),Xx=Sc(),F8=Xp(),Qx=Jp(),L8=Tc.ucs2length,U8=vc(),z8=Xx.Validation;Yx.exports=Yp;function Yp(a,e,r,t){var s=this,i=this._opts,n=[void 0],o={},l=[],c={},u=[],p={},m=[];e=e||{schema:a,refVal:n,refs:o};var f=H8.call(this,a,e,t),h=this._compilations[f.index];if(f.compiling)return h.callValidate=E;var d=this._formats,v=this.RULES;try{var x=k(a,e,r,t);h.validate=x;var b=h.callValidate;return b&&(b.schema=x.schema,b.errors=null,b.refs=x.refs,b.refVal=x.refVal,b.root=x.root,b.$async=x.$async,i.sourceCode&&(b.source=x.source)),x}finally{B8.call(this,a,e,t)}function E(){var R=h.validate,j=R.apply(this,arguments);return E.errors=R.errors,j}function k(R,j,z,B){var G=!j||j&&j.schema==R;if(j.schema!=e.schema)return Yp.call(s,R,j,z,B);var te=R.$async===!0,X=Qx({isTop:!0,schema:R,isRoot:G,baseId:B,root:j,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Xx.MissingRef,RULES:v,validate:Qx,util:Tc,resolve:Pc,resolveRef:O,usePattern:F,useDefault:q,useCustomRule:C,opts:i,formats:d,logger:s.logger,self:s});X=Rc(n,Z8)+Rc(l,V8)+Rc(u,G8)+Rc(m,W8)+X,i.processCode&&(X=i.processCode(X,R));var V;try{var re=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",X);V=re(s,v,d,e,n,u,m,U8,L8,z8),n[0]=V}catch(ce){throw s.logger.error("Error compiling schema, function code:",X),ce}return V.schema=R,V.errors=null,V.refs=o,V.refVal=n,V.root=G?V:j,te&&(V.$async=!0),i.sourceCode===!0&&(V.source={code:X,patterns:l,defaults:u}),V}function O(R,j,z){j=Pc.url(R,j);var B=o[j],G,te;if(B!==void 0)return G=n[B],te="refVal["+B+"]",A(G,te);if(!z&&e.refs){var X=e.refs[j];if(X!==void 0)return G=e.refVal[X],te=P(j,G),A(G,te)}te=P(j);var V=Pc.call(s,k,e,j);if(V===void 0){var re=r&&r[j];re&&(V=Pc.inlineRef(re,i.inlineRefs)?re:Yp.call(s,re,e,r,R))}if(V===void 0)I(j);else return $(j,V),A(V,te)}function P(R,j){var z=n.length;return n[z]=j,o[R]=z,"refVal"+z}function I(R){delete o[R]}function $(R,j){var z=o[R];n[z]=j}function A(R,j){return typeof R=="object"||typeof R=="boolean"?{code:j,schema:R,inline:!0}:{code:j,$async:R&&!!R.$async}}function F(R){var j=c[R];return j===void 0&&(j=c[R]=l.length,l[j]=R),"pattern"+j}function q(R){switch(typeof R){case"boolean":case"number":return""+R;case"string":return Tc.toQuotedString(R);case"object":if(R===null)return"null";var j=F8(R),z=p[j];return z===void 0&&(z=p[j]=u.length,u[z]=R),"default"+z}}function C(R,j,z,B){if(s._opts.validateSchema!==!1){var G=R.definition.dependencies;if(G&&!G.every(function(xe){return Object.prototype.hasOwnProperty.call(z,xe)}))throw new Error("parent schema must have all required keywords: "+G.join(","));var te=R.definition.validateSchema;if(te){var X=te(j);if(!X){var V="keyword schema is invalid: "+s.errorsText(te.errors);if(s._opts.validateSchema=="log")s.logger.error(V);else throw new Error(V)}}}var re=R.definition.compile,ce=R.definition.inline,Be=R.definition.macro,be;if(re)be=re.call(s,j,z,B);else if(Be)be=Be.call(s,j,z,B),i.validateSchema!==!1&&s.validateSchema(be,!0);else if(ce)be=ce.call(s,B,R.keyword,j,z);else if(be=R.definition.validate,!be)return;if(be===void 0)throw new Error('custom keyword "'+R.keyword+'"failed to compile');var qe=m.length;return m[qe]=be,{code:"customRule"+qe,validate:be}}}function H8(a,e,r){var t=Jx.call(this,a,e,r);return t>=0?{index:t,compiling:!0}:(t=this._compilations.length,this._compilations[t]={schema:a,root:e,baseId:r},{index:t,compiling:!1})}function B8(a,e,r){var t=Jx.call(this,a,e,r);t>=0&&this._compilations.splice(t,1)}function Jx(a,e,r){for(var t=0;t{"use strict";var kc=t0.exports=function(){this._cache={}};kc.prototype.put=function(e,r){this._cache[e]=r};kc.prototype.get=function(e){return this._cache[e]};kc.prototype.del=function(e){delete this._cache[e]};kc.prototype.clear=function(){this._cache={}}});var m0=M((fL,f0)=>{"use strict";var K8=fs(),Q8=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,X8=[0,31,28,31,30,31,30,31,31,30,31,30,31],J8=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a0=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Y8=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,ej=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,s0=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,n0=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,i0=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,o0=/^(?:\/(?:[^~/]|~0|~1)*)*$/,c0=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,l0=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;f0.exports=Oc;function Oc(a){return a=a=="full"?"full":"fast",K8.copy(Oc[a])}Oc.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":s0,url:n0,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a0,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:d0,uuid:i0,"json-pointer":o0,"json-pointer-uri-fragment":c0,"relative-json-pointer":l0};Oc.full={date:u0,time:p0,"date-time":aj,uri:nj,"uri-reference":ej,"uri-template":s0,url:n0,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a0,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:d0,uuid:i0,"json-pointer":o0,"json-pointer-uri-fragment":c0,"relative-json-pointer":l0};function tj(a){return a%4===0&&(a%100!==0||a%400===0)}function u0(a){var e=a.match(Q8);if(!e)return!1;var r=+e[1],t=+e[2],s=+e[3];return t>=1&&t<=12&&s>=1&&s<=(t==2&&tj(r)?29:X8[t])}function p0(a,e){var r=a.match(J8);if(!r)return!1;var t=r[1],s=r[2],i=r[3],n=r[5];return(t<=23&&s<=59&&i<=59||t==23&&s==59&&i==60)&&(!e||n)}var rj=/t|\s/i;function aj(a){var e=a.split(rj);return e.length==2&&u0(e[0])&&p0(e[1],!0)}var sj=/\/|:/;function nj(a){return sj.test(a)&&Y8.test(a)}var ij=/[^\\]\\Z/;function d0(a){if(ij.test(a))return!1;try{return new RegExp(a),!0}catch{return!1}}});var v0=M((mL,h0)=>{"use strict";h0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(n||""),p="valid"+i,m,f;if(o=="#"||o=="#/")e.isRoot?(m=e.async,f="validate"):(m=e.root.schema.$async===!0,f="root.refVal[0]");else{var h=e.resolveRef(e.baseId,o,e.isRoot);if(h===void 0){var d=e.MissingRefError.message(e.baseId,o);if(e.opts.missingRefs=="fail"){e.logger.error(d);var v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(o)+"' } ",e.opts.messages!==!1&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(o)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(o)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var x=s;s=v.pop(),!e.compositeRule&&c?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(s+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(d),c&&(s+=" if (true) { ");else throw new e.MissingRefError(e.baseId,o,d)}else if(h.inline){var b=e.util.copy(e);b.level++;var E="valid"+b.level;b.schema=h.schema,b.schemaPath="",b.errSchemaPath=o;var k=e.validate(b).replace(/validate\.schema/g,h.code);s+=" "+k+" ",c&&(s+=" if ("+E+") { ")}else m=h.$async===!0||e.async&&h.$async!==!1,f=h.code}if(f){var v=v||[];v.push(s),s="",e.opts.passContext?s+=" "+f+".call(this, ":s+=" "+f+"( ",s+=" "+u+", (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var O=n?"data"+(n-1||""):"parentData",P=n?e.dataPathArr[n]:"parentDataProperty";s+=" , "+O+" , "+P+", rootData) ";var I=s;if(s=v.pop(),m){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(s+=" var "+p+"; "),s+=" try { await "+I+"; ",c&&(s+=" "+p+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(s+=" "+p+" = false; "),s+=" } ",c&&(s+=" if ("+p+") { ")}else s+=" if (!"+I+") { if (vErrors === null) vErrors = "+f+".errors; else vErrors = vErrors.concat("+f+".errors); errors = vErrors.length; } ",c&&(s+=" else { ")}return s}});var y0=M((hL,g0)=>{"use strict";g0.exports=function(e,r,t){var s=" ",i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var p="valid"+c.level,m=c.baseId,f=!0,h=i;if(h)for(var d,v=-1,x=h.length-1;v0||d===!1:e.util.schemaHasRules(d,e.RULES.all))&&(f=!1,c.schema=d,c.schemaPath=n+"["+v+"]",c.errSchemaPath=o+"/"+v,s+=" "+e.validate(c)+" ",c.baseId=m,l&&(s+=" if ("+p+") { ",u+="}"));return l&&(f?s+=" if (true) { ":s+=" "+u.slice(0,-1)+" "),s}});var x0=M((vL,b0)=>{"use strict";b0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x=o.every(function($){return e.opts.strictKeywords?typeof $=="object"&&Object.keys($).length>0||$===!1:e.util.schemaHasRules($,e.RULES.all)});if(x){var b=h.baseId;s+=" var "+f+" = errors; var "+m+" = false; ";var E=e.compositeRule;e.compositeRule=h.compositeRule=!0;var k=o;if(k)for(var O,P=-1,I=k.length-1;P{"use strict";_0.exports=function(e,r,t){var s=" ",i=e.schema[r],n=e.errSchemaPath+"/"+r,o=!e.opts.allErrors,l=e.util.toQuotedString(i);return e.opts.$comment===!0?s+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(s+=" self._opts.$comment("+l+", "+e.util.toQuotedString(n)+", validate.root.schema);"),s}});var S0=M((yL,w0)=>{"use strict";w0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o,f||(s+=" var schema"+i+" = validate.schema"+l+";"),s+="var "+m+" = equal("+p+", schema"+i+"); if (!"+m+") { ";var d=d||[];d.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to constant' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var v=s;return s=d.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",u&&(s+=" else { "),s}});var R0=M((bL,P0)=>{"use strict";P0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x="i"+i,b=h.dataLevel=e.dataLevel+1,E="data"+b,k=e.baseId,O=e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all);if(s+="var "+f+" = errors;var "+m+";",O){var P=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=l,h.errSchemaPath=c,s+=" var "+v+" = false; for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var I=p+"["+x+"]";h.dataPathArr[b]=x;var $=e.validate(h);h.baseId=k,e.util.varOccurences($,E)<2?s+=" "+e.util.varReplace($,E,I)+" ":s+=" var "+E+" = "+I+"; "+$+" ",s+=" if ("+v+") break; } ",e.compositeRule=h.compositeRule=P,s+=" "+d+" if (!"+v+") {"}else s+=" if ("+p+".length == 0) {";var A=A||[];A.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should contain a valid item' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var F=s;return s=A.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+F+"]); ":s+=" validate.errors = ["+F+"]; return false; ":s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { ",O&&(s+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } "),e.opts.allErrors&&(s+=" } "),s}});var k0=M((xL,T0)=>{"use strict";T0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level,v={},x={},b=e.opts.ownProperties;for(P in o)if(P!="__proto__"){var E=o[P],k=Array.isArray(E)?x:v;k[P]=E}s+="var "+m+" = errors;";var O=e.errorPath;s+="var missing"+i+";";for(var P in x)if(k=x[P],k.length){if(s+=" if ( "+p+e.util.getProperty(P)+" !== undefined ",b&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(P)+"') "),u){s+=" && ( ";var I=k;if(I)for(var $,A=-1,F=I.length-1;A0||E===!1:e.util.schemaHasRules(E,e.RULES.all))&&(s+=" "+d+" = true; if ( "+p+e.util.getProperty(P)+" !== undefined ",b&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(P)+"') "),s+=") { ",f.schema=E,f.schemaPath=l+e.util.getProperty(P),f.errSchemaPath=c+"/"+e.util.escapeFragment(P),s+=" "+e.validate(f)+" ",f.baseId=V,s+=" } ",u&&(s+=" if ("+d+") { ",h+="}"))}return u&&(s+=" "+h+" if ("+m+" == errors) {"),s}});var C0=M((_L,O0)=>{"use strict";O0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o;var d="i"+i,v="schema"+i;f||(s+=" var "+v+" = validate.schema"+l+";"),s+="var "+m+";",f&&(s+=" if (schema"+i+" === undefined) "+m+" = true; else if (!Array.isArray(schema"+i+")) "+m+" = false; else {"),s+=""+m+" = false;for (var "+d+"=0; "+d+"<"+v+".length; "+d+"++) if (equal("+p+", "+v+"["+d+"])) { "+m+" = true; break; }",f&&(s+=" } "),s+=" if (!"+m+") { ";var x=x||[];x.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var b=s;return s=x.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+b+"]); ":s+=" validate.errors = ["+b+"]; return false; ":s+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",u&&(s+=" else { "),s}});var A0=M((EL,I0)=>{"use strict";I0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||"");if(e.opts.format===!1)return u&&(s+=" if (true) { "),s;var m=e.opts.$data&&o&&o.$data,f;m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o;var h=e.opts.unknownFormats,d=Array.isArray(h);if(m){var v="format"+i,x="isObject"+i,b="formatType"+i;s+=" var "+v+" = formats["+f+"]; var "+x+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+b+" = "+x+" && "+v+".type || 'string'; if ("+x+") { ",e.async&&(s+=" var async"+i+" = "+v+".async; "),s+=" "+v+" = "+v+".validate; } if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),s+=" (",h!="ignore"&&(s+=" ("+f+" && !"+v+" ",d&&(s+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),s+=") || "),s+=" ("+v+" && "+b+" == '"+t+"' && !(typeof "+v+" == 'function' ? ",e.async?s+=" (async"+i+" ? await "+v+"("+p+") : "+v+"("+p+")) ":s+=" "+v+"("+p+") ",s+=" : "+v+".test("+p+"))))) {"}else{var v=e.formats[o];if(!v){if(h=="ignore")return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(s+=" if (true) { "),s;if(d&&h.indexOf(o)>=0)return u&&(s+=" if (true) { "),s;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var x=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,b=x&&v.type||"string";if(x){var E=v.async===!0;v=v.validate}if(b!=t)return u&&(s+=" if (true) { "),s;if(E){if(!e.async)throw new Error("async format in sync schema");var k="formats"+e.util.getProperty(o)+".validate";s+=" if (!(await "+k+"("+p+"))) { "}else{s+=" if (! ";var k="formats"+e.util.getProperty(o);x&&(k+=".validate"),typeof v=="function"?s+=" "+k+"("+p+") ":s+=" "+k+".test("+p+") ",s+=") { "}}var O=O||[];O.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",m?s+=""+f:s+=""+e.util.toQuotedString(o),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match format "`,m?s+="' + "+f+" + '":s+=""+e.util.escapeQuotes(o),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var P=s;return s=O.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+P+"]); ":s+=" validate.errors = ["+P+"]; return false; ":s+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}});var N0=M((wL,j0)=>{"use strict";j0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e);h.level++;var d="valid"+h.level,v=e.schema.then,x=e.schema.else,b=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),E=x!==void 0&&(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all)),k=h.baseId;if(b||E){var O;h.createErrors=!1,h.schema=o,h.schemaPath=l,h.errSchemaPath=c,s+=" var "+f+" = errors; var "+m+" = true; ";var P=e.compositeRule;e.compositeRule=h.compositeRule=!0,s+=" "+e.validate(h)+" ",h.baseId=k,h.createErrors=!0,s+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=P,b?(s+=" if ("+d+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",s+=" "+e.validate(h)+" ",h.baseId=k,s+=" "+m+" = "+d+"; ",b&&E?(O="ifClause"+i,s+=" var "+O+" = 'then'; "):O="'then'",s+=" } ",E&&(s+=" else { ")):s+=" if (!"+d+") { ",E&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",s+=" "+e.validate(h)+" ",h.baseId=k,s+=" "+m+" = "+d+"; ",b&&E?(O="ifClause"+i,s+=" var "+O+" = 'else'; "):O="'else'",s+=" } "),s+=" if (!"+m+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+O+" } ",e.opts.messages!==!1&&(s+=` , message: 'should match "' + `+O+` + '" schema' `),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}});var $0=M((SL,D0)=>{"use strict";D0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x="i"+i,b=h.dataLevel=e.dataLevel+1,E="data"+b,k=e.baseId;if(s+="var "+f+" = errors;var "+m+";",Array.isArray(o)){var O=e.schema.additionalItems;if(O===!1){s+=" "+m+" = "+p+".length <= "+o.length+"; ";var P=c;c=e.errSchemaPath+"/additionalItems",s+=" if (!"+m+") { ";var I=I||[];I.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+o.length+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var $=s;s=I.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+$+"]); ":s+=" validate.errors = ["+$+"]; return false; ":s+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",c=P,u&&(d+="}",s+=" else { ")}var A=o;if(A){for(var F,q=-1,C=A.length-1;q0||F===!1:e.util.schemaHasRules(F,e.RULES.all)){s+=" "+v+" = true; if ("+p+".length > "+q+") { ";var R=p+"["+q+"]";h.schema=F,h.schemaPath=l+"["+q+"]",h.errSchemaPath=c+"/"+q,h.errorPath=e.util.getPathExpr(e.errorPath,q,e.opts.jsonPointers,!0),h.dataPathArr[b]=q;var j=e.validate(h);h.baseId=k,e.util.varOccurences(j,E)<2?s+=" "+e.util.varReplace(j,E,R)+" ":s+=" var "+E+" = "+R+"; "+j+" ",s+=" } ",u&&(s+=" if ("+v+") { ",d+="}")}}if(typeof O=="object"&&(e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all))){h.schema=O,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",s+=" "+v+" = true; if ("+p+".length > "+o.length+") { for (var "+x+" = "+o.length+"; "+x+" < "+p+".length; "+x+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var R=p+"["+x+"]";h.dataPathArr[b]=x;var j=e.validate(h);h.baseId=k,e.util.varOccurences(j,E)<2?s+=" "+e.util.varReplace(j,E,R)+" ":s+=" var "+E+" = "+R+"; "+j+" ",u&&(s+=" if (!"+v+") break; "),s+=" } } ",u&&(s+=" if ("+v+") { ",d+="}")}}else if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=l,h.errSchemaPath=c,s+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var R=p+"["+x+"]";h.dataPathArr[b]=x;var j=e.validate(h);h.baseId=k,e.util.varOccurences(j,E)<2?s+=" "+e.util.varReplace(j,E,R)+" ":s+=" var "+E+" = "+R+"; "+j+" ",u&&(s+=" if (!"+v+") break; "),s+=" }"}return u&&(s+=" "+d+" if ("+f+" == errors) {"),s}});var ed=M((PL,q0)=>{"use strict";q0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,k,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o;var h=r=="maximum",d=h?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[d],x=e.opts.$data&&v&&v.$data,b=h?"<":">",E=h?">":"<",k=void 0;if(!(m||typeof o=="number"||o===void 0))throw new Error(r+" must be number");if(!(x||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(d+" must be number or boolean");if(x){var O=e.util.getData(v.$data,n,e.dataPathArr),P="exclusive"+i,I="exclType"+i,$="exclIsNumber"+i,A="op"+i,F="' + "+A+" + '";s+=" var schemaExcl"+i+" = "+O+"; ",O="schemaExcl"+i,s+=" var "+P+"; var "+I+" = typeof "+O+"; if ("+I+" != 'boolean' && "+I+" != 'undefined' && "+I+" != 'number') { ";var k=d,q=q||[];q.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(k||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var C=s;s=q.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" "+I+" == 'number' ? ( ("+P+" = "+f+" === undefined || "+O+" "+b+"= "+f+") ? "+p+" "+E+"= "+O+" : "+p+" "+E+" "+f+" ) : ( ("+P+" = "+O+" === true) ? "+p+" "+E+"= "+f+" : "+p+" "+E+" "+f+" ) || "+p+" !== "+p+") { var op"+i+" = "+P+" ? '"+b+"' : '"+b+"='; ",o===void 0&&(k=d,c=e.errSchemaPath+"/"+d,f=O,m=x)}else{var $=typeof v=="number",F=b;if($&&m){var A="'"+F+"'";s+=" if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" ( "+f+" === undefined || "+v+" "+b+"= "+f+" ? "+p+" "+E+"= "+v+" : "+p+" "+E+" "+f+" ) || "+p+" !== "+p+") { "}else{$&&o===void 0?(P=!0,k=d,c=e.errSchemaPath+"/"+d,f=v,E+="="):($&&(f=Math[h?"min":"max"](v,o)),v===($?f:!0)?(P=!0,k=d,c=e.errSchemaPath+"/"+d,E+="="):(P=!1,F+="="));var A="'"+F+"'";s+=" if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" "+p+" "+E+" "+f+" || "+p+" !== "+p+") { "}}k=k||r;var q=q||[];q.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(k||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+A+", limit: "+f+", exclusive: "+P+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be "+F+" ",m?s+="' + "+f:s+=""+f+"'"),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var C=s;return s=q.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}});var td=M((RL,M0)=>{"use strict";M0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");var h=r=="maxItems"?">":"<";s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" "+p+".length "+h+" "+f+") { ";var d=r,v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",r=="maxItems"?s+="more":s+="fewer",s+=" than ",m?s+="' + "+f+" + '":s+=""+o,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var x=s;return s=v.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var rd=M((TL,F0)=>{"use strict";F0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");var h=r=="maxLength"?">":"<";s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),e.opts.unicode===!1?s+=" "+p+".length ":s+=" ucs2length("+p+") ",s+=" "+h+" "+f+") { ";var d=r,v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be ",r=="maxLength"?s+="longer":s+="shorter",s+=" than ",m?s+="' + "+f+" + '":s+=""+o,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var x=s;return s=v.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var ad=M((kL,L0)=>{"use strict";L0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");var h=r=="maxProperties"?">":"<";s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'number') || "),s+=" Object.keys("+p+").length "+h+" "+f+") { ";var d=r,v=v||[];v.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",r=="maxProperties"?s+="more":s+="fewer",s+=" than ",m?s+="' + "+f+" + '":s+=""+o,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var x=s;return s=v.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var z0=M((OL,U0)=>{"use strict";U0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;if(m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o,!(m||typeof o=="number"))throw new Error(r+" must be number");s+="var division"+i+";if (",m&&(s+=" "+f+" !== undefined && ( typeof "+f+" != 'number' || "),s+=" (division"+i+" = "+p+" / "+f+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",m&&(s+=" ) "),s+=" ) { ";var h=h||[];h.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+f+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be multiple of ",m?s+="' + "+f:s+=""+f+"'"),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var d=s;return s=h.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+d+"]); ":s+=" validate.errors = ["+d+"]; return false; ":s+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var B0=M((CL,H0)=>{"use strict";H0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e);f.level++;var h="valid"+f.level;if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=l,f.errSchemaPath=c,s+=" var "+m+" = errors; ";var d=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.createErrors=!1;var v;f.opts.allErrors&&(v=f.opts.allErrors,f.opts.allErrors=!1),s+=" "+e.validate(f)+" ",f.createErrors=!0,v&&(f.opts.allErrors=v),e.compositeRule=f.compositeRule=d,s+=" if ("+h+") { ";var x=x||[];x.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var b=s;s=x.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+b+"]); ":s+=" validate.errors = ["+b+"]; return false; ":s+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } ",e.opts.allErrors&&(s+=" } ")}else s+=" var err = ",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(s+=" if (false) { ");return s}});var G0=M((IL,V0)=>{"use strict";V0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f="errs__"+i,h=e.util.copy(e),d="";h.level++;var v="valid"+h.level,x=h.baseId,b="prevValid"+i,E="passingSchemas"+i;s+="var "+f+" = errors , "+b+" = false , "+m+" = false , "+E+" = null; ";var k=e.compositeRule;e.compositeRule=h.compositeRule=!0;var O=o;if(O)for(var P,I=-1,$=O.length-1;I<$;)P=O[I+=1],(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))?(h.schema=P,h.schemaPath=l+"["+I+"]",h.errSchemaPath=c+"/"+I,s+=" "+e.validate(h)+" ",h.baseId=x):s+=" var "+v+" = true; ",I&&(s+=" if ("+v+" && "+b+") { "+m+" = false; "+E+" = ["+E+", "+I+"]; } else { ",d+="}"),s+=" if ("+v+") { "+m+" = "+b+" = true; "+E+" = "+I+"; }";return e.compositeRule=h.compositeRule=k,s+=""+d+"if (!"+m+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+E+" } ",e.opts.messages!==!1&&(s+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+="} else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; }",e.opts.allErrors&&(s+=" } "),s}});var W0=M((AL,Z0)=>{"use strict";Z0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m=e.opts.$data&&o&&o.$data,f;m?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",f="schema"+i):f=o;var h=m?"(new RegExp("+f+"))":e.usePattern(o);s+="if ( ",m&&(s+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),s+=" !"+h+".test("+p+") ) { ";var d=d||[];d.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",m?s+=""+f:s+=""+e.util.toQuotedString(o),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match pattern "`,m?s+="' + "+f+" + '":s+=""+e.util.escapeQuotes(o),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",m?s+="validate.schema"+l:s+=""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var v=s;return s=d.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}});var Q0=M((jL,K0)=>{"use strict";K0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level,v="key"+i,x="idx"+i,b=f.dataLevel=e.dataLevel+1,E="data"+b,k="dataProperties"+i,O=Object.keys(o||{}).filter(te),P=e.schema.patternProperties||{},I=Object.keys(P).filter(te),$=e.schema.additionalProperties,A=O.length||I.length,F=$===!1,q=typeof $=="object"&&Object.keys($).length,C=e.opts.removeAdditional,R=F||q||C,j=e.opts.ownProperties,z=e.baseId,B=e.schema.required;if(B&&!(e.opts.$data&&B.$data)&&B.length8)s+=" || validate.schema"+l+".hasOwnProperty("+v+") ";else{var X=O;if(X)for(var V,re=-1,ce=X.length-1;re0||Ee===!1:e.util.schemaHasRules(Ee,e.RULES.all)){var Ye=e.util.getProperty(V),Q=p+Ye,Ue=Ie&&Ee.default!==void 0;f.schema=Ee,f.schemaPath=l+Ye,f.errSchemaPath=c+"/"+e.util.escapeFragment(V),f.errorPath=e.util.getPath(e.errorPath,V,e.opts.jsonPointers),f.dataPathArr[b]=e.util.toQuotedString(V);var ie=e.validate(f);if(f.baseId=z,e.util.varOccurences(ie,E)<2){ie=e.util.varReplace(ie,E,Q);var Qe=Q}else{var Qe=E;s+=" var "+E+" = "+Q+"; "}if(Ue)s+=" "+ie+" ";else{if(G&&G[V]){s+=" if ( "+Qe+" === undefined ",j&&(s+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(V)+"') "),s+=") { "+d+" = false; ";var Oe=e.errorPath,Z=c,Ve=e.util.escapeQuotes(V);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Oe,V,e.opts.jsonPointers)),c=e.errSchemaPath+"/required";var ee=ee||[];ee.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+Ve+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+Ve+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var ue=s;s=ee.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+ue+"]); ":s+=" validate.errors = ["+ue+"]; return false; ":s+=" var err = "+ue+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=Z,e.errorPath=Oe,s+=" } else { "}else u?(s+=" if ( "+Qe+" === undefined ",j&&(s+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(V)+"') "),s+=") { "+d+" = true; } else { "):(s+=" if ("+Qe+" !== undefined ",j&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(V)+"') "),s+=" ) { ");s+=" "+ie+" } "}}u&&(s+=" if ("+d+") { ",h+="}")}}if(I.length){var Ke=I;if(Ke)for(var be,bt=-1,xt=Ke.length-1;bt0||Ee===!1:e.util.schemaHasRules(Ee,e.RULES.all)){f.schema=Ee,f.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(be),f.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(be),j?s+=" "+k+" = "+k+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+k+".length; "+x+"++) { var "+v+" = "+k+"["+x+"]; ":s+=" for (var "+v+" in "+p+") { ",s+=" if ("+e.usePattern(be)+".test("+v+")) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Q=p+"["+v+"]";f.dataPathArr[b]=v;var ie=e.validate(f);f.baseId=z,e.util.varOccurences(ie,E)<2?s+=" "+e.util.varReplace(ie,E,Q)+" ":s+=" var "+E+" = "+Q+"; "+ie+" ",u&&(s+=" if (!"+d+") break; "),s+=" } ",u&&(s+=" else "+d+" = true; "),s+=" } ",u&&(s+=" if ("+d+") { ",h+="}")}}}return u&&(s+=" "+h+" if ("+m+" == errors) {"),s}});var J0=M((NL,X0)=>{"use strict";X0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="errs__"+i,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level;if(s+="var "+m+" = errors;",e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=l,f.errSchemaPath=c;var v="key"+i,x="idx"+i,b="i"+i,E="' + "+v+" + '",k=f.dataLevel=e.dataLevel+1,O="data"+k,P="dataProperties"+i,I=e.opts.ownProperties,$=e.baseId;I&&(s+=" var "+P+" = undefined; "),I?s+=" "+P+" = "+P+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+P+".length; "+x+"++) { var "+v+" = "+P+"["+x+"]; ":s+=" for (var "+v+" in "+p+") { ",s+=" var startErrs"+i+" = errors; ";var A=v,F=e.compositeRule;e.compositeRule=f.compositeRule=!0;var q=e.validate(f);f.baseId=$,e.util.varOccurences(q,O)<2?s+=" "+e.util.varReplace(q,O,A)+" ":s+=" var "+O+" = "+A+"; "+q+" ",e.compositeRule=f.compositeRule=F,s+=" if (!"+d+") { for (var "+b+"=startErrs"+i+"; "+b+"{"use strict";Y0.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o;var d="schema"+i;if(!f)if(o.length0||O===!1:e.util.schemaHasRules(O,e.RULES.all))||(v[v.length]=b)}}else var v=o;if(f||v.length){var P=e.errorPath,I=f||v.length>=e.opts.loopRequired,$=e.opts.ownProperties;if(u)if(s+=" var missing"+i+"; ",I){f||(s+=" var "+d+" = validate.schema"+l+"; ");var A="i"+i,F="schema"+i+"["+A+"]",q="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,F,e.opts.jsonPointers)),s+=" var "+m+" = true; ",f&&(s+=" if (schema"+i+" === undefined) "+m+" = true; else if (!Array.isArray(schema"+i+")) "+m+" = false; else {"),s+=" for (var "+A+" = 0; "+A+" < "+d+".length; "+A+"++) { "+m+" = "+p+"["+d+"["+A+"]] !== undefined ",$&&(s+=" && Object.prototype.hasOwnProperty.call("+p+", "+d+"["+A+"]) "),s+="; if (!"+m+") break; } ",f&&(s+=" } "),s+=" if (!"+m+") { ";var C=C||[];C.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+q+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+q+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var R=s;s=C.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+R+"]); ":s+=" validate.errors = ["+R+"]; return false; ":s+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { "}else{s+=" if ( ";var j=v;if(j)for(var z,A=-1,B=j.length-1;A{"use strict";t_.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p="data"+(n||""),m="valid"+i,f=e.opts.$data&&o&&o.$data,h;if(f?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",h="schema"+i):h=o,(o||f)&&e.opts.uniqueItems!==!1){f&&(s+=" var "+m+"; if ("+h+" === false || "+h+" === undefined) "+m+" = true; else if (typeof "+h+" != 'boolean') "+m+" = false; else { "),s+=" var i = "+p+".length , "+m+" = true , j; if (i > 1) { ";var d=e.schema.items&&e.schema.items.type,v=Array.isArray(d);if(!d||d=="object"||d=="array"||v&&(d.indexOf("object")>=0||d.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+m+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var x="checkDataType"+(v?"s":"");s+=" if ("+e.util[x](d,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(s+=` if (typeof item == 'string') item = '"' + item; `),s+=" if (typeof itemIndices[item] == 'number') { "+m+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",f&&(s+=" } "),s+=" if (!"+m+") { ";var b=b||[];b.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",f?s+="validate.schema"+l:s+=""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var E=s;s=b.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+E+"]); ":s+=" validate.errors = ["+E+"]; return false; ":s+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}});var s_=M((qL,a_)=>{"use strict";a_.exports={$ref:v0(),allOf:y0(),anyOf:x0(),$comment:E0(),const:S0(),contains:R0(),dependencies:k0(),enum:C0(),format:A0(),if:N0(),items:$0(),maximum:ed(),minimum:ed(),maxItems:td(),minItems:td(),maxLength:rd(),minLength:rd(),maxProperties:ad(),minProperties:ad(),multipleOf:z0(),not:B0(),oneOf:G0(),pattern:W0(),properties:Q0(),propertyNames:J0(),required:e_(),uniqueItems:r_(),validate:Jp()}});var o_=M((ML,i_)=>{"use strict";var n_=s_(),sd=fs().toHash;i_.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],t=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],s=["number","integer","string","array","object","boolean","null"];return e.all=sd(r),e.types=sd(s),e.forEach(function(i){i.rules=i.rules.map(function(n){var o;if(typeof n=="object"){var l=Object.keys(n)[0];o=n[l],n=l,o.forEach(function(u){r.push(u),e.all[u]=!0})}r.push(n);var c=e.all[n]={keyword:n,code:n_[n],implements:o};return c}),e.all.$comment={keyword:"$comment",code:n_.$comment},i.type&&(e.types[i.type]=i)}),e.keywords=sd(r.concat(t)),e.custom={},e}});var u_=M((FL,l_)=>{"use strict";var c_=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];l_.exports=function(a,e){for(var r=0;r{"use strict";var oj=Sc().MissingRef;d_.exports=p_;function p_(a,e,r){var t=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(r=e,e=void 0);var s=i(a).then(function(){var o=t._addSchema(a,void 0,e);return o.validate||n(o)});return r&&s.then(function(o){r(null,o)},r),s;function i(o){var l=o.$schema;return l&&!t.getSchema(l)?p_.call(t,{$ref:l},!0):Promise.resolve()}function n(o){try{return t._compile(o)}catch(c){if(c instanceof oj)return l(c);throw c}function l(c){var u=c.missingSchema;if(f(u))throw new Error("Schema "+u+" is loaded but "+c.missingRef+" cannot be resolved");var p=t._loadingSchemas[u];return p||(p=t._loadingSchemas[u]=t._opts.loadSchema(u),p.then(m,m)),p.then(function(h){if(!f(u))return i(h).then(function(){f(u)||t.addSchema(h,u,void 0,e)})}).then(function(){return n(o)});function m(){delete t._loadingSchemas[u]}function f(h){return t._refs[h]||t._schemas[h]}}}}});var h_=M((UL,m_)=>{"use strict";m_.exports=function(e,r,t){var s=" ",i=e.level,n=e.dataLevel,o=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,p,m="data"+(n||""),f="valid"+i,h="errs__"+i,d=e.opts.$data&&o&&o.$data,v;d?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",v="schema"+i):v=o;var x=this,b="definition"+i,E=x.definition,k="",O,P,I,$,A;if(d&&E.$data){A="keywordValidate"+i;var F=E.validateSchema;s+=" var "+b+" = RULES.custom['"+r+"'].definition; var "+A+" = "+b+".validate;"}else{if($=e.useCustomRule(x,o,e.schema,e),!$)return;v="validate.schema"+l,A=$.code,O=E.compile,P=E.inline,I=E.macro}var q=A+".errors",C="i"+i,R="ruleErr"+i,j=E.async;if(j&&!e.async)throw new Error("async keyword in sync schema");if(P||I||(s+=""+q+" = null;"),s+="var "+h+" = errors;var "+f+";",d&&E.$data&&(k+="}",s+=" if ("+v+" === undefined) { "+f+" = true; } else { ",F&&(k+="}",s+=" "+f+" = "+b+".validateSchema("+v+"); if ("+f+") { ")),P)E.statements?s+=" "+$.validate+" ":s+=" "+f+" = "+$.validate+"; ";else if(I){var z=e.util.copy(e),k="";z.level++;var B="valid"+z.level;z.schema=$.validate,z.schemaPath="";var G=e.compositeRule;e.compositeRule=z.compositeRule=!0;var te=e.validate(z).replace(/validate\.schema/g,A);e.compositeRule=z.compositeRule=G,s+=" "+te}else{var X=X||[];X.push(s),s="",s+=" "+A+".call( ",e.opts.passContext?s+="this":s+="self",O||E.schema===!1?s+=" , "+m+" ":s+=" , "+v+" , "+m+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var V=n?"data"+(n-1||""):"parentData",re=n?e.dataPathArr[n]:"parentDataProperty";s+=" , "+V+" , "+re+" , rootData ) ";var ce=s;s=X.pop(),E.errors===!1?(s+=" "+f+" = ",j&&(s+="await "),s+=""+ce+"; "):j?(q="customErrors"+i,s+=" var "+q+" = null; try { "+f+" = await "+ce+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+q+" = e.errors; else throw e; } "):s+=" "+q+" = null; "+f+" = "+ce+"; "}if(E.modifying&&(s+=" if ("+V+") "+m+" = "+V+"["+re+"];"),s+=""+k,E.valid)u&&(s+=" if (true) { ");else{s+=" if ( ",E.valid===void 0?(s+=" !",I?s+=""+B:s+=""+f):s+=" "+!E.valid+" ",s+=") { ",p=x.keyword;var X=X||[];X.push(s),s="";var X=X||[];X.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(s+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),s+=" } "):s+=" {} ";var Be=s;s=X.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+Be+"]); ":s+=" validate.errors = ["+Be+"]; return false; ":s+=" var err = "+Be+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var be=s;s=X.pop(),P?E.errors?E.errors!="full"&&(s+=" for (var "+C+"="+h+"; "+C+"{cj.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var y_=M((HL,g_)=>{"use strict";var v_=nd();g_.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:v_.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:v_.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var x_=M((BL,b_)=>{"use strict";var lj=/^[a-z_$][a-z0-9_$-]*$/i,uj=h_(),pj=y_();b_.exports={add:dj,get:fj,remove:mj,validate:id};function dj(a,e){var r=this.RULES;if(r.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!lj.test(a))throw new Error("Keyword "+a+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var t=e.type;if(Array.isArray(t))for(var s=0;s{hj.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var I_=M((GL,C_)=>{"use strict";var w_=e0(),ms=wc(),vj=r0(),S_=Vp(),gj=Xp(),yj=m0(),bj=o_(),P_=u_(),R_=fs();C_.exports=ut;ut.prototype.validate=_j;ut.prototype.compile=Ej;ut.prototype.addSchema=wj;ut.prototype.addMetaSchema=Sj;ut.prototype.validateSchema=Pj;ut.prototype.getSchema=Tj;ut.prototype.removeSchema=Oj;ut.prototype.addFormat=qj;ut.prototype.errorsText=$j;ut.prototype._addSchema=Cj;ut.prototype._compile=Ij;ut.prototype.compileAsync=f_();var Ac=x_();ut.prototype.addKeyword=Ac.add;ut.prototype.getKeyword=Ac.get;ut.prototype.removeKeyword=Ac.remove;ut.prototype.validateKeyword=Ac.validate;var T_=Sc();ut.ValidationError=T_.Validation;ut.MissingRefError=T_.MissingRef;ut.$dataMetaSchema=P_;var Ic="http://json-schema.org/draft-07/schema",E_=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],xj=["/properties"];function ut(a){if(!(this instanceof ut))return new ut(a);a=this._opts=R_.copy(a)||{},Hj(this),this._schemas={},this._refs={},this._fragments={},this._formats=yj(a.format),this._cache=a.cache||new vj,this._loadingSchemas={},this._compilations=[],this.RULES=bj(),this._getId=Aj(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=!0),a.serialize===void 0&&(a.serialize=gj),this._metaOpts=zj(this),a.formats&&Lj(this),a.keywords&&Uj(this),Mj(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),Fj(this)}function _j(a,e){var r;if(typeof a=="string"){if(r=this.getSchema(a),!r)throw new Error('no schema with key or ref "'+a+'"')}else{var t=this._addSchema(a);r=t.validate||this._compile(t)}var s=r(e);return r.$async!==!0&&(this.errors=r.errors),s}function Ej(a,e){var r=this._addSchema(a,void 0,e);return r.validate||this._compile(r)}function wj(a,e,r,t){if(Array.isArray(a)){for(var s=0;s{$_.exports=D_;D_.sync=Vj;var j_=require("fs");function Bj(a,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var t=0;t{U_.exports=F_;F_.sync=Gj;var M_=require("fs");function F_(a,e,r){M_.stat(a,function(t,s){r(t,t?!1:L_(s,e))})}function Gj(a,e){return L_(M_.statSync(a),e)}function L_(a,e){return a.isFile()&&Zj(a,e)}function Zj(a,e){var r=a.mode,t=a.uid,s=a.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),n=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),o=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=o|l,p=r&c||r&l&&s===n||r&o&&t===i||r&u&&i===0;return p}});var B_=M((YL,H_)=>{var JL=require("fs"),jc;process.platform==="win32"||global.TESTING_WINDOWS?jc=q_():jc=z_();H_.exports=cd;cd.sync=Wj;function cd(a,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(t,s){cd(a,e||{},function(i,n){i?s(i):t(n)})})}jc(a,e||{},function(t,s){t&&(t.code==="EACCES"||e&&e.ignoreErrors)&&(t=null,s=!1),r(t,s)})}function Wj(a,e){try{return jc.sync(a,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var X_=M((e3,Q_)=>{var yn=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",V_=require("path"),Kj=yn?";":":",G_=B_(),Z_=a=>Object.assign(new Error(`not found: ${a}`),{code:"ENOENT"}),W_=(a,e)=>{let r=e.colon||Kj,t=a.match(/\//)||yn&&a.match(/\\/)?[""]:[...yn?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],s=yn?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=yn?s.split(r):[""];return yn&&a.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:t,pathExt:i,pathExtExe:s}},K_=(a,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:t,pathExt:s,pathExtExe:i}=W_(a,e),n=[],o=c=>new Promise((u,p)=>{if(c===t.length)return e.all&&n.length?u(n):p(Z_(a));let m=t[c],f=/^".*"$/.test(m)?m.slice(1,-1):m,h=V_.join(f,a),d=!f&&/^\.[\\\/]/.test(a)?a.slice(0,2)+h:h;u(l(d,c,0))}),l=(c,u,p)=>new Promise((m,f)=>{if(p===s.length)return m(o(u+1));let h=s[p];G_(c+h,{pathExt:i},(d,v)=>{if(!d&&v)if(e.all)n.push(c+h);else return m(c+h);return m(l(c,u,p+1))})});return r?o(0).then(c=>r(null,c),r):o(0)},Qj=(a,e)=>{e=e||{};let{pathEnv:r,pathExt:t,pathExtExe:s}=W_(a,e),i=[];for(let n=0;n{"use strict";var J_=(a={})=>{let e=a.env||process.env;return(a.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(t=>t.toUpperCase()==="PATH")||"Path"};ld.exports=J_;ld.exports.default=J_});var aE=M((r3,rE)=>{"use strict";var eE=require("path"),Xj=X_(),Jj=Y_();function tE(a,e){let r=a.options.env||process.env,t=process.cwd(),s=a.options.cwd!=null,i=s&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(a.options.cwd)}catch{}let n;try{n=Xj.sync(a.command,{path:r[Jj({env:r})],pathExt:e?eE.delimiter:void 0})}catch{}finally{i&&process.chdir(t)}return n&&(n=eE.resolve(s?a.options.cwd:"",n)),n}function Yj(a){return tE(a)||tE(a,!0)}rE.exports=Yj});var sE=M((a3,pd)=>{"use strict";var ud=/([()\][%!^"`<>&|;, *?])/g;function e9(a){return a=a.replace(ud,"^$1"),a}function t9(a,e){return a=`${a}`,a=a.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),a=a.replace(/(?=(\\+?)?)\1$/,"$1$1"),a=`"${a}"`,a=a.replace(ud,"^$1"),e&&(a=a.replace(ud,"^$1")),a}pd.exports.command=e9;pd.exports.argument=t9});var iE=M((s3,nE)=>{"use strict";nE.exports=/^#!(.*)/});var cE=M((n3,oE)=>{"use strict";var r9=iE();oE.exports=(a="")=>{let e=a.match(r9);if(!e)return null;let[r,t]=e[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?t:t?`${s} ${t}`:s}});var uE=M((i3,lE)=>{"use strict";var dd=require("fs"),a9=cE();function s9(a){let r=Buffer.alloc(150),t;try{t=dd.openSync(a,"r"),dd.readSync(t,r,0,150,0),dd.closeSync(t)}catch{}return a9(r.toString())}lE.exports=s9});var mE=M((o3,fE)=>{"use strict";var n9=require("path"),pE=aE(),dE=sE(),i9=uE(),o9=process.platform==="win32",c9=/\.(?:com|exe)$/i,l9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u9(a){a.file=pE(a);let e=a.file&&i9(a.file);return e?(a.args.unshift(a.file),a.command=e,pE(a)):a.file}function p9(a){if(!o9)return a;let e=u9(a),r=!c9.test(e);if(a.options.forceShell||r){let t=l9.test(e);a.command=n9.normalize(a.command),a.command=dE.command(a.command),a.args=a.args.map(i=>dE.argument(i,t));let s=[a.command].concat(a.args).join(" ");a.args=["/d","/s","/c",`"${s}"`],a.command=process.env.comspec||"cmd.exe",a.options.windowsVerbatimArguments=!0}return a}function d9(a,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let t={command:a,args:e,options:r,file:void 0,original:{command:a,args:e}};return r.shell?t:p9(t)}fE.exports=d9});var gE=M((c3,vE)=>{"use strict";var fd=process.platform==="win32";function md(a,e){return Object.assign(new Error(`${e} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${a.command}`,path:a.command,spawnargs:a.args})}function f9(a,e){if(!fd)return;let r=a.emit;a.emit=function(t,s){if(t==="exit"){let i=hE(s,e);if(i)return r.call(a,"error",i)}return r.apply(a,arguments)}}function hE(a,e){return fd&&a===1&&!e.file?md(e.original,"spawn"):null}function m9(a,e){return fd&&a===1&&!e.file?md(e.original,"spawnSync"):null}vE.exports={hookChildProcess:f9,verifyENOENT:hE,verifyENOENTSync:m9,notFoundError:md}});var xE=M((l3,bn)=>{"use strict";var yE=require("child_process"),hd=mE(),vd=gE();function bE(a,e,r){let t=hd(a,e,r),s=yE.spawn(t.command,t.args,t.options);return vd.hookChildProcess(s,t),s}function h9(a,e,r){let t=hd(a,e,r),s=yE.spawnSync(t.command,t.args,t.options);return s.error=s.error||vd.verifyENOENTSync(s.status,t),s}bn.exports=bE;bn.exports.spawn=bE;bn.exports.sync=h9;bn.exports._parse=hd;bn.exports._enoent=vd});var T$={};Hd(T$,{WorkerService:()=>$i,default:()=>R$});module.exports=tw(T$);var nl=jt(Gb(),1),B1=jt(Xb(),1),Rr=jt(require("path"),1),vt=require("fs"),il=require("os");var _t=require("path"),vp=require("os"),gp=require("fs");var Jb=require("url"),nA={};function aA(){return typeof __dirname<"u"?__dirname:(0,_t.dirname)((0,Jb.fileURLToPath)(nA.url))}var sA=aA(),wr=process.env.CLAUDE_MEM_DATA_DIR||(0,_t.join)((0,vp.homedir)(),".claude-mem"),yp=process.env.CLAUDE_CONFIG_DIR||(0,_t.join)((0,vp.homedir)(),".claude"),iF=(0,_t.join)(wr,"archives"),oF=(0,_t.join)(wr,"logs"),cF=(0,_t.join)(wr,"trash"),lF=(0,_t.join)(wr,"backups"),uF=(0,_t.join)(wr,"settings.json"),Xo=(0,_t.join)(wr,"claude-mem.db"),pF=(0,_t.join)(wr,"vector-db"),dF=(0,_t.join)(yp,"settings.json"),fF=(0,_t.join)(yp,"commands"),mF=(0,_t.join)(yp,"CLAUDE.md");function Jo(a){(0,gp.mkdirSync)(a,{recursive:!0})}function Ka(){return(0,_t.join)(sA,"..","..")}var Yb=jt(require("path"),1),ex=require("os"),Yo=require("fs");function ec(){try{let a=Yb.default.join((0,ex.homedir)(),".claude-mem","settings.json");if((0,Yo.existsSync)(a)){let e=JSON.parse((0,Yo.readFileSync)(a,"utf-8")),r=parseInt(e.env?.CLAUDE_MEM_WORKER_PORT,10);if(!isNaN(r))return r}}catch{}return parseInt(process.env.CLAUDE_MEM_WORKER_PORT||"37777",10)}var bp=(i=>(i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.SILENT=4]="SILENT",i))(bp||{}),xp=class{level;useColor;constructor(){let e=process.env.CLAUDE_MEM_LOG_LEVEL?.toUpperCase()||"INFO";this.level=bp[e]??1,this.useColor=process.stdout.isTTY??!1}correlationId(e,r){return`obs-${e}-${r}`}sessionId(e){return`session-${e}`}formatData(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="object"){if(e instanceof Error)return this.level===0?`${e.message} ${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let r=Object.keys(e);return r.length===0?"{}":r.length<=3?JSON.stringify(e):`{${r.length} keys: ${r.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,r){if(!r)return e;try{let t=typeof r=="string"?JSON.parse(r):r;if(e==="Bash"&&t.command){let s=t.command.length>50?t.command.substring(0,50)+"...":t.command;return`${e}(${s})`}if(e==="Read"&&t.file_path){let s=t.file_path.split("/").pop()||t.file_path;return`${e}(${s})`}if(e==="Edit"&&t.file_path){let s=t.file_path.split("/").pop()||t.file_path;return`${e}(${s})`}if(e==="Write"&&t.file_path){let s=t.file_path.split("/").pop()||t.file_path;return`${e}(${s})`}return e}catch{return e}}log(e,r,t,s,i){if(e0&&(p=` {${Object.entries(v).map(([b,E])=>`${b}=${E}`).join(", ")}}`)}let m=`[${n}] [${o}] [${l}] ${c}${t}${p}${u}`;e===3?console.error(m):console.log(m)}debug(e,r,t,s){this.log(0,e,r,t,s)}info(e,r,t,s){this.log(1,e,r,t,s)}warn(e,r,t,s){this.log(2,e,r,t,s)}error(e,r,t,s){this.log(3,e,r,t,s)}dataIn(e,r,t,s){this.info(e,`\u2192 ${r}`,t,s)}dataOut(e,r,t,s){this.info(e,`\u2190 ${r}`,t,s)}success(e,r,t,s){this.info(e,`\u2713 ${r}`,t,s)}failure(e,r,t,s){this.error(e,`\u2717 ${r}`,t,s)}timing(e,r,t,s){this.info(e,`\u23F1 ${r}`,s,{duration:`${t}ms`})}},H=new xp;var _={};Hd(_,{BRAND:()=>IA,DIRTY:()=>Qa,EMPTY_PATH:()=>lA,INVALID:()=>_e,NEVER:()=>h2,OK:()=>Pt,ParseStatus:()=>Et,Schema:()=>Le,ZodAny:()=>wa,ZodArray:()=>Yr,ZodBigInt:()=>Ja,ZodBoolean:()=>Ya,ZodBranded:()=>_i,ZodCatch:()=>us,ZodDate:()=>es,ZodDefault:()=>ls,ZodDiscriminatedUnion:()=>ac,ZodEffects:()=>or,ZodEnum:()=>os,ZodError:()=>Mt,ZodFirstPartyTypeKind:()=>Se,ZodFunction:()=>nc,ZodIntersection:()=>ss,ZodIssueCode:()=>J,ZodLazy:()=>ns,ZodLiteral:()=>is,ZodMap:()=>mn,ZodNaN:()=>vn,ZodNativeEnum:()=>cs,ZodNever:()=>Sr,ZodNull:()=>rs,ZodNullable:()=>Mr,ZodNumber:()=>Xa,ZodObject:()=>Ft,ZodOptional:()=>nr,ZodParsedType:()=>oe,ZodPipeline:()=>Ei,ZodPromise:()=>Sa,ZodReadonly:()=>ps,ZodRecord:()=>sc,ZodSchema:()=>Le,ZodSet:()=>hn,ZodString:()=>Ea,ZodSymbol:()=>dn,ZodTransformer:()=>or,ZodTuple:()=>qr,ZodType:()=>Le,ZodUndefined:()=>ts,ZodUnion:()=>as,ZodUnknown:()=>Jr,ZodVoid:()=>fn,addIssueToContext:()=>ae,any:()=>LA,array:()=>BA,bigint:()=>DA,boolean:()=>px,coerce:()=>m2,custom:()=>cx,date:()=>$A,datetimeRegex:()=>ix,defaultErrorMap:()=>Qr,discriminatedUnion:()=>WA,effect:()=>i2,enum:()=>a2,function:()=>e2,getErrorMap:()=>ln,getParsedType:()=>$r,instanceof:()=>jA,intersection:()=>KA,isAborted:()=>tc,isAsync:()=>un,isDirty:()=>rc,isValid:()=>_a,late:()=>AA,lazy:()=>t2,literal:()=>r2,makeIssue:()=>xi,map:()=>JA,nan:()=>NA,nativeEnum:()=>s2,never:()=>zA,null:()=>FA,nullable:()=>c2,number:()=>ux,object:()=>VA,objectUtil:()=>_p,oboolean:()=>f2,onumber:()=>d2,optional:()=>o2,ostring:()=>p2,pipeline:()=>u2,preprocess:()=>l2,promise:()=>n2,quotelessJson:()=>iA,record:()=>XA,set:()=>YA,setErrorMap:()=>cA,strictObject:()=>GA,string:()=>lx,symbol:()=>qA,transformer:()=>i2,tuple:()=>QA,undefined:()=>MA,union:()=>ZA,unknown:()=>UA,util:()=>He,void:()=>HA});var He;(function(a){a.assertEqual=s=>{};function e(s){}a.assertIs=e;function r(s){throw new Error}a.assertNever=r,a.arrayToEnum=s=>{let i={};for(let n of s)i[n]=n;return i},a.getValidEnumValues=s=>{let i=a.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),n={};for(let o of i)n[o]=s[o];return a.objectValues(n)},a.objectValues=s=>a.objectKeys(s).map(function(i){return s[i]}),a.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let n in s)Object.prototype.hasOwnProperty.call(s,n)&&i.push(n);return i},a.find=(s,i)=>{for(let n of s)if(i(n))return n},a.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function t(s,i=" | "){return s.map(n=>typeof n=="string"?`'${n}'`:n).join(i)}a.joinValues=t,a.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(He||(He={}));var _p;(function(a){a.mergeShapes=(e,r)=>({...e,...r})})(_p||(_p={}));var oe=He.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$r=a=>{switch(typeof a){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return Number.isNaN(a)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(a)?oe.array:a===null?oe.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?oe.promise:typeof Map<"u"&&a instanceof Map?oe.map:typeof Set<"u"&&a instanceof Set?oe.set:typeof Date<"u"&&a instanceof Date?oe.date:oe.object;default:return oe.unknown}};var J=He.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"]),iA=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),Mt=class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};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(i){return i.message},t={_errors:[]},s=i=>{for(let n of i.issues)if(n.code==="invalid_union")n.unionErrors.map(s);else if(n.code==="invalid_return_type")s(n.returnTypeError);else if(n.code==="invalid_arguments")s(n.argumentsError);else if(n.path.length===0)t._errors.push(r(n));else{let o=t,l=0;for(;lr.message){let r={},t=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else t.push(e(s));return{formErrors:t,fieldErrors:r}}get formErrors(){return this.flatten()}};Mt.create=a=>new Mt(a);var oA=(a,e)=>{let r;switch(a.code){case J.invalid_type:a.received===oe.undefined?r="Required":r=`Expected ${a.expected}, received ${a.received}`;break;case J.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(a.expected,He.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:r=`Unrecognized key(s) in object: ${He.joinValues(a.keys,", ")}`;break;case J.invalid_union:r="Invalid input";break;case J.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${He.joinValues(a.options)}`;break;case J.invalid_enum_value:r=`Invalid enum value. Expected ${He.joinValues(a.options)}, received '${a.received}'`;break;case J.invalid_arguments:r="Invalid function arguments";break;case J.invalid_return_type:r="Invalid function return type";break;case J.invalid_date:r="Invalid date";break;case J.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(r=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?r=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?r=`Invalid input: must end with "${a.validation.endsWith}"`:He.assertNever(a.validation):a.validation!=="regex"?r=`Invalid ${a.validation}`:r="Invalid";break;case J.too_small:a.type==="array"?r=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?r=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?r=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?r=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?r=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:r="Invalid input";break;case J.too_big:a.type==="array"?r=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?r=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?r=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?r=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?r=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:r="Invalid input";break;case J.custom:r="Invalid input";break;case J.invalid_intersection_types:r="Intersection results could not be merged";break;case J.not_multiple_of:r=`Number must be a multiple of ${a.multipleOf}`;break;case J.not_finite:r="Number must be finite";break;default:r=e.defaultError,He.assertNever(a)}return{message:r}},Qr=oA;var tx=Qr;function cA(a){tx=a}function ln(){return tx}var xi=a=>{let{data:e,path:r,errorMaps:t,issueData:s}=a,i=[...r,...s.path||[]],n={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="",l=t.filter(c=>!!c).slice().reverse();for(let c of l)o=c(n,{data:e,defaultError:o}).message;return{...s,path:i,message:o}},lA=[];function ae(a,e){let r=ln(),t=xi({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,r,r===Qr?void 0:Qr].filter(s=>!!s)});a.common.issues.push(t)}var Et=class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let t=[];for(let s of r){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),t.push(s.value)}return{status:e.value,value:t}}static async mergeObjectAsync(e,r){let t=[];for(let s of r){let i=await s.key,n=await s.value;t.push({key:i,value:n})}return a.mergeObjectSync(e,t)}static mergeObjectSync(e,r){let t={};for(let s of r){let{key:i,value:n}=s;if(i.status==="aborted"||n.status==="aborted")return _e;i.status==="dirty"&&e.dirty(),n.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof n.value<"u"||s.alwaysSet)&&(t[i.value]=n.value)}return{status:e.value,value:t}}},_e=Object.freeze({status:"aborted"}),Qa=a=>({status:"dirty",value:a}),Pt=a=>({status:"valid",value:a}),tc=a=>a.status==="aborted",rc=a=>a.status==="dirty",_a=a=>a.status==="valid",un=a=>typeof Promise<"u"&&a instanceof Promise;var fe;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(fe||(fe={}));var ir=class{constructor(e,r,t,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=t,this._key=s}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}},rx=(a,e)=>{if(_a(e))return{success:!0,data:e.value};if(!a.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 Mt(a.common.issues);return this._error=r,this._error}}};function De(a){if(!a)return{};let{errorMap:e,invalid_type_error:r,required_error:t,description:s}=a;if(e&&(r||t))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(n,o)=>{let{message:l}=a;return n.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??t??o.defaultError}:n.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},description:s}}var Le=class{get description(){return this._def.description}_getType(e){return $r(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Et,ctx:{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(un(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 t=this.safeParse(e,r);if(t.success)return t.data;throw t.error}safeParse(e,r){let t={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)},s=this._parseSync({data:e,path:t.path,parent:t});return rx(t,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:r});return _a(t)?{value:t.value}:{issues:r.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(t=>_a(t)?{value:t.value}:{issues:r.common.issues})}async parseAsync(e,r){let t=await this.safeParseAsync(e,r);if(t.success)return t.data;throw t.error}async safeParseAsync(e,r){let t={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)},s=this._parse({data:e,path:t.path,parent:t}),i=await(un(s)?s:Promise.resolve(s));return rx(t,i)}refine(e,r){let t=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let n=e(s),o=()=>i.addIssue({code:J.custom,...t(s)});return typeof Promise<"u"&&n instanceof Promise?n.then(l=>l?!0:(o(),!1)):n?!0:(o(),!1)})}refinement(e,r){return this._refinement((t,s)=>e(t)?!0:(s.addIssue(typeof r=="function"?r(t,s):r),!1))}_refinement(e){return new or({schema:this,typeName:Se.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 nr.create(this,this._def)}nullable(){return Mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yr.create(this)}promise(){return Sa.create(this,this._def)}or(e){return as.create([this,e],this._def)}and(e){return ss.create(this,e,this._def)}transform(e){return new or({...De(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ls({...De(this._def),innerType:this,defaultValue:r,typeName:Se.ZodDefault})}brand(){return new _i({typeName:Se.ZodBranded,type:this,...De(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new us({...De(this._def),innerType:this,catchValue:r,typeName:Se.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ei.create(this,e)}readonly(){return ps.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},uA=/^c[^\s-]{8,}$/i,pA=/^[0-9a-z]+$/,dA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,fA=/^[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,mA=/^[a-z0-9_-]{21}$/i,hA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vA=/^[-+]?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)?)??$/,gA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ep,bA=/^(?:(?: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])$/,xA=/^(?:(?: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])$/,_A=/^(([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]))$/,EA=/^(([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])$/,wA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,SA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,sx="((\\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])))",PA=new RegExp(`^${sx}$`);function nx(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);let r=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function RA(a){return new RegExp(`^${nx(a)}$`)}function ix(a){let e=`${sx}T${nx(a)}`,r=[];return r.push(a.local?"Z?":"Z"),a.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function TA(a,e){return!!((e==="v4"||!e)&&bA.test(a)||(e==="v6"||!e)&&_A.test(a))}function kA(a,e){if(!hA.test(a))return!1;try{let[r]=a.split(".");if(!r)return!1;let t=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(t));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function OA(a,e){return!!((e==="v4"||!e)&&xA.test(a)||(e==="v6"||!e)&&EA.test(a))}var Ea=class a extends Le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){let i=this._getOrReturnCtx(e);return ae(i,{code:J.invalid_type,expected:oe.string,received:i.parsedType}),_e}let t=new Et,s;for(let i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(s=this._getOrReturnCtx(e,s),ae(s,{code:J.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind==="length"){let n=e.data.length>i.value,o=e.data.lengthe.test(s),{validation:r,code:J.invalid_string,...fe.errToObj(t)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...fe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...fe.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,...fe.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,...fe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...fe.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...fe.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...fe.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...fe.errToObj(r)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...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.valuenew Ea({checks:[],typeName:Se.ZodString,coerce:a?.coerce??!1,...De(a)});function CA(a,e){let r=(a.toString().split(".")[1]||"").length,t=(e.toString().split(".")[1]||"").length,s=r>t?r:t,i=Number.parseInt(a.toFixed(s).replace(".","")),n=Number.parseInt(e.toFixed(s).replace(".",""));return i%n/10**s}var Xa=class a extends Le{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)!==oe.number){let i=this._getOrReturnCtx(e);return ae(i,{code:J.invalid_type,expected:oe.number,received:i.parsedType}),_e}let t,s=new Et;for(let i of this._def.checks)i.kind==="int"?He.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ae(t,{code:J.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),ae(t,{code:J.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?CA(e.data,i.value)!==0&&(t=this._getOrReturnCtx(e,t),ae(t,{code:J.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ae(t,{code:J.not_finite,message:i.message}),s.dirty()):He.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,fe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,fe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,fe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,fe.toString(r))}setLimit(e,r,t,s){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:t,message:fe.toString(s)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.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.valuee.kind==="int"||e.kind==="multipleOf"&&He.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let t of this._def.checks){if(t.kind==="finite"||t.kind==="int"||t.kind==="multipleOf")return!0;t.kind==="min"?(r===null||t.value>r)&&(r=t.value):t.kind==="max"&&(e===null||t.valuenew Xa({checks:[],typeName:Se.ZodNumber,coerce:a?.coerce||!1,...De(a)});var Ja=class a extends Le{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)!==oe.bigint)return this._getInvalidInput(e);let t,s=new Et;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),ae(t,{code:J.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),ae(t,{code:J.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):He.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ae(r,{code:J.invalid_type,expected:oe.bigint,received:r.parsedType}),_e}gte(e,r){return this.setLimit("min",e,!0,fe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,fe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,fe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,fe.toString(r))}setLimit(e,r,t,s){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:t,message:fe.toString(s)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:fe.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.valuenew Ja({checks:[],typeName:Se.ZodBigInt,coerce:a?.coerce??!1,...De(a)});var Ya=class extends Le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){let t=this._getOrReturnCtx(e);return ae(t,{code:J.invalid_type,expected:oe.boolean,received:t.parsedType}),_e}return Pt(e.data)}};Ya.create=a=>new Ya({typeName:Se.ZodBoolean,coerce:a?.coerce||!1,...De(a)});var es=class a extends Le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){let i=this._getOrReturnCtx(e);return ae(i,{code:J.invalid_type,expected:oe.date,received:i.parsedType}),_e}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return ae(i,{code:J.invalid_date}),_e}let t=new Et,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(s=this._getOrReturnCtx(e,s),ae(s,{code:J.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):He.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:fe.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.valuenew es({checks:[],coerce:a?.coerce||!1,typeName:Se.ZodDate,...De(a)});var dn=class extends Le{_parse(e){if(this._getType(e)!==oe.symbol){let t=this._getOrReturnCtx(e);return ae(t,{code:J.invalid_type,expected:oe.symbol,received:t.parsedType}),_e}return Pt(e.data)}};dn.create=a=>new dn({typeName:Se.ZodSymbol,...De(a)});var ts=class extends Le{_parse(e){if(this._getType(e)!==oe.undefined){let t=this._getOrReturnCtx(e);return ae(t,{code:J.invalid_type,expected:oe.undefined,received:t.parsedType}),_e}return Pt(e.data)}};ts.create=a=>new ts({typeName:Se.ZodUndefined,...De(a)});var rs=class extends Le{_parse(e){if(this._getType(e)!==oe.null){let t=this._getOrReturnCtx(e);return ae(t,{code:J.invalid_type,expected:oe.null,received:t.parsedType}),_e}return Pt(e.data)}};rs.create=a=>new rs({typeName:Se.ZodNull,...De(a)});var wa=class extends Le{constructor(){super(...arguments),this._any=!0}_parse(e){return Pt(e.data)}};wa.create=a=>new wa({typeName:Se.ZodAny,...De(a)});var Jr=class extends Le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Pt(e.data)}};Jr.create=a=>new Jr({typeName:Se.ZodUnknown,...De(a)});var Sr=class extends Le{_parse(e){let r=this._getOrReturnCtx(e);return ae(r,{code:J.invalid_type,expected:oe.never,received:r.parsedType}),_e}};Sr.create=a=>new Sr({typeName:Se.ZodNever,...De(a)});var fn=class extends Le{_parse(e){if(this._getType(e)!==oe.undefined){let t=this._getOrReturnCtx(e);return ae(t,{code:J.invalid_type,expected:oe.void,received:t.parsedType}),_e}return Pt(e.data)}};fn.create=a=>new fn({typeName:Se.ZodVoid,...De(a)});var Yr=class a extends Le{_parse(e){let{ctx:r,status:t}=this._processInputParams(e),s=this._def;if(r.parsedType!==oe.array)return ae(r,{code:J.invalid_type,expected:oe.array,received:r.parsedType}),_e;if(s.exactLength!==null){let n=r.data.length>s.exactLength.value,o=r.data.lengths.maxLength.value&&(ae(r,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),t.dirty()),r.common.async)return Promise.all([...r.data].map((n,o)=>s.type._parseAsync(new ir(r,n,r.path,o)))).then(n=>Et.mergeArray(t,n));let i=[...r.data].map((n,o)=>s.type._parseSync(new ir(r,n,r.path,o)));return Et.mergeArray(t,i)}get element(){return this._def.type}min(e,r){return new a({...this._def,minLength:{value:e,message:fe.toString(r)}})}max(e,r){return new a({...this._def,maxLength:{value:e,message:fe.toString(r)}})}length(e,r){return new a({...this._def,exactLength:{value:e,message:fe.toString(r)}})}nonempty(e){return this.min(1,e)}};Yr.create=(a,e)=>new Yr({type:a,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...De(e)});function pn(a){if(a instanceof Ft){let e={};for(let r in a.shape){let t=a.shape[r];e[r]=nr.create(pn(t))}return new Ft({...a._def,shape:()=>e})}else return a instanceof Yr?new Yr({...a._def,type:pn(a.element)}):a instanceof nr?nr.create(pn(a.unwrap())):a instanceof Mr?Mr.create(pn(a.unwrap())):a instanceof qr?qr.create(a.items.map(e=>pn(e))):a}var Ft=class a extends Le{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=He.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==oe.object){let c=this._getOrReturnCtx(e);return ae(c,{code:J.invalid_type,expected:oe.object,received:c.parsedType}),_e}let{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),o=[];if(!(this._def.catchall instanceof Sr&&this._def.unknownKeys==="strip"))for(let c in s.data)n.includes(c)||o.push(c);let l=[];for(let c of n){let u=i[c],p=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ir(s,p,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Sr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")o.length>0&&(ae(s,{code:J.unrecognized_keys,keys:o}),t.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of o){let p=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ir(s,p,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let p=await u.key,m=await u.value;c.push({key:p,value:m,alwaysSet:u.alwaysSet})}return c}).then(c=>Et.mergeObjectSync(t,c)):Et.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,t)=>{let s=this._def.errorMap?.(r,t).message??t.defaultError;return r.code==="unrecognized_keys"?{message:fe.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new a({...this._def,unknownKeys:"strip"})}passthrough(){return new a({...this._def,unknownKeys:"passthrough"})}extend(e){return new a({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new a({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Se.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new a({...this._def,catchall:e})}pick(e){let r={};for(let t of He.objectKeys(e))e[t]&&this.shape[t]&&(r[t]=this.shape[t]);return new a({...this._def,shape:()=>r})}omit(e){let r={};for(let t of He.objectKeys(this.shape))e[t]||(r[t]=this.shape[t]);return new a({...this._def,shape:()=>r})}deepPartial(){return pn(this)}partial(e){let r={};for(let t of He.objectKeys(this.shape)){let s=this.shape[t];e&&!e[t]?r[t]=s:r[t]=s.optional()}return new a({...this._def,shape:()=>r})}required(e){let r={};for(let t of He.objectKeys(this.shape))if(e&&!e[t])r[t]=this.shape[t];else{let i=this.shape[t];for(;i instanceof nr;)i=i._def.innerType;r[t]=i}return new a({...this._def,shape:()=>r})}keyof(){return ox(He.objectKeys(this.shape))}};Ft.create=(a,e)=>new Ft({shape:()=>a,unknownKeys:"strip",catchall:Sr.create(),typeName:Se.ZodObject,...De(e)});Ft.strictCreate=(a,e)=>new Ft({shape:()=>a,unknownKeys:"strict",catchall:Sr.create(),typeName:Se.ZodObject,...De(e)});Ft.lazycreate=(a,e)=>new Ft({shape:a,unknownKeys:"strip",catchall:Sr.create(),typeName:Se.ZodObject,...De(e)});var as=class extends Le{_parse(e){let{ctx:r}=this._processInputParams(e),t=this._def.options;function s(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let n=i.map(o=>new Mt(o.ctx.common.issues));return ae(r,{code:J.invalid_union,unionErrors:n}),_e}if(r.common.async)return Promise.all(t.map(async i=>{let n={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:n}),ctx:n}})).then(s);{let i,n=[];for(let l of t){let c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&n.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let o=n.map(l=>new Mt(l));return ae(r,{code:J.invalid_union,unionErrors:o}),_e}}get options(){return this._def.options}};as.create=(a,e)=>new as({options:a,typeName:Se.ZodUnion,...De(e)});var Xr=a=>a instanceof ns?Xr(a.schema):a instanceof or?Xr(a.innerType()):a instanceof is?[a.value]:a instanceof os?a.options:a instanceof cs?He.objectValues(a.enum):a instanceof ls?Xr(a._def.innerType):a instanceof ts?[void 0]:a instanceof rs?[null]:a instanceof nr?[void 0,...Xr(a.unwrap())]:a instanceof Mr?[null,...Xr(a.unwrap())]:a instanceof _i||a instanceof ps?Xr(a.unwrap()):a instanceof us?Xr(a._def.innerType):[],ac=class a extends Le{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return ae(r,{code:J.invalid_type,expected:oe.object,received:r.parsedType}),_e;let t=this.discriminator,s=r.data[t],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ae(r,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,t){let s=new Map;for(let i of r){let n=Xr(i.shape[e]);if(!n.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of n){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,i)}}return new a({typeName:Se.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...De(t)})}};function wp(a,e){let r=$r(a),t=$r(e);if(a===e)return{valid:!0,data:a};if(r===oe.object&&t===oe.object){let s=He.objectKeys(e),i=He.objectKeys(a).filter(o=>s.indexOf(o)!==-1),n={...a,...e};for(let o of i){let l=wp(a[o],e[o]);if(!l.valid)return{valid:!1};n[o]=l.data}return{valid:!0,data:n}}else if(r===oe.array&&t===oe.array){if(a.length!==e.length)return{valid:!1};let s=[];for(let i=0;i{if(tc(i)||tc(n))return _e;let o=wp(i.value,n.value);return o.valid?((rc(i)||rc(n))&&r.dirty(),{status:r.value,value:o.data}):(ae(t,{code:J.invalid_intersection_types}),_e)};return t.common.async?Promise.all([this._def.left._parseAsync({data:t.data,path:t.path,parent:t}),this._def.right._parseAsync({data:t.data,path:t.path,parent:t})]).then(([i,n])=>s(i,n)):s(this._def.left._parseSync({data:t.data,path:t.path,parent:t}),this._def.right._parseSync({data:t.data,path:t.path,parent:t}))}};ss.create=(a,e,r)=>new ss({left:a,right:e,typeName:Se.ZodIntersection,...De(r)});var qr=class a extends Le{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==oe.array)return ae(t,{code:J.invalid_type,expected:oe.array,received:t.parsedType}),_e;if(t.data.lengththis._def.items.length&&(ae(t,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...t.data].map((n,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new ir(t,n,t.path,o)):null}).filter(n=>!!n);return t.common.async?Promise.all(i).then(n=>Et.mergeArray(r,n)):Et.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};qr.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qr({items:a,typeName:Se.ZodTuple,rest:null,...De(e)})};var sc=class a extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==oe.object)return ae(t,{code:J.invalid_type,expected:oe.object,received:t.parsedType}),_e;let s=[],i=this._def.keyType,n=this._def.valueType;for(let o in t.data)s.push({key:i._parse(new ir(t,o,t.path,o)),value:n._parse(new ir(t,t.data[o],t.path,o)),alwaysSet:o in t.data});return t.common.async?Et.mergeObjectAsync(r,s):Et.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,t){return r instanceof Le?new a({keyType:e,valueType:r,typeName:Se.ZodRecord,...De(t)}):new a({keyType:Ea.create(),valueType:e,typeName:Se.ZodRecord,...De(r)})}},mn=class extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==oe.map)return ae(t,{code:J.invalid_type,expected:oe.map,received:t.parsedType}),_e;let s=this._def.keyType,i=this._def.valueType,n=[...t.data.entries()].map(([o,l],c)=>({key:s._parse(new ir(t,o,t.path,[c,"key"])),value:i._parse(new ir(t,l,t.path,[c,"value"]))}));if(t.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of n){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of n){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}}}};mn.create=(a,e,r)=>new mn({valueType:e,keyType:a,typeName:Se.ZodMap,...De(r)});var hn=class a extends Le{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==oe.set)return ae(t,{code:J.invalid_type,expected:oe.set,received:t.parsedType}),_e;let s=this._def;s.minSize!==null&&t.data.sizes.maxSize.value&&(ae(t,{code:J.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function n(l){let c=new Set;for(let u of l){if(u.status==="aborted")return _e;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}let o=[...t.data.values()].map((l,c)=>i._parse(new ir(t,l,t.path,c)));return t.common.async?Promise.all(o).then(l=>n(l)):n(o)}min(e,r){return new a({...this._def,minSize:{value:e,message:fe.toString(r)}})}max(e,r){return new a({...this._def,maxSize:{value:e,message:fe.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};hn.create=(a,e)=>new hn({valueType:a,minSize:null,maxSize:null,typeName:Se.ZodSet,...De(e)});var nc=class a extends Le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.function)return ae(r,{code:J.invalid_type,expected:oe.function,received:r.parsedType}),_e;function t(o,l){return xi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ln(),Qr].filter(c=>!!c),issueData:{code:J.invalid_arguments,argumentsError:l}})}function s(o,l){return xi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ln(),Qr].filter(c=>!!c),issueData:{code:J.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},n=r.data;if(this._def.returns instanceof Sa){let o=this;return Pt(async function(...l){let c=new Mt([]),u=await o._def.args.parseAsync(l,i).catch(f=>{throw c.addIssue(t(l,f)),c}),p=await Reflect.apply(n,this,u);return await o._def.returns._def.type.parseAsync(p,i).catch(f=>{throw c.addIssue(s(p,f)),c})})}else{let o=this;return Pt(function(...l){let c=o._def.args.safeParse(l,i);if(!c.success)throw new Mt([t(l,c.error)]);let u=Reflect.apply(n,this,c.data),p=o._def.returns.safeParse(u,i);if(!p.success)throw new Mt([s(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:qr.create(e).rest(Jr.create())})}returns(e){return new a({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,t){return new a({args:e||qr.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:Se.ZodFunction,...De(t)})}},ns=class extends Le{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})}};ns.create=(a,e)=>new ns({getter:a,typeName:Se.ZodLazy,...De(e)});var is=class extends Le{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ae(r,{received:r.data,code:J.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}};is.create=(a,e)=>new is({value:a,typeName:Se.ZodLiteral,...De(e)});function ox(a,e){return new os({values:a,typeName:Se.ZodEnum,...De(e)})}var os=class a extends Le{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),t=this._def.values;return ae(r,{expected:He.joinValues(t),received:r.parsedType,code:J.invalid_type}),_e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),t=this._def.values;return ae(r,{received:r.data,code:J.invalid_enum_value,options:t}),_e}return Pt(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 a.create(e,{...this._def,...r})}exclude(e,r=this._def){return a.create(this.options.filter(t=>!e.includes(t)),{...this._def,...r})}};os.create=ox;var cs=class extends Le{_parse(e){let r=He.getValidEnumValues(this._def.values),t=this._getOrReturnCtx(e);if(t.parsedType!==oe.string&&t.parsedType!==oe.number){let s=He.objectValues(r);return ae(t,{expected:He.joinValues(s),received:t.parsedType,code:J.invalid_type}),_e}if(this._cache||(this._cache=new Set(He.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=He.objectValues(r);return ae(t,{received:t.data,code:J.invalid_enum_value,options:s}),_e}return Pt(e.data)}get enum(){return this._def.values}};cs.create=(a,e)=>new cs({values:a,typeName:Se.ZodNativeEnum,...De(e)});var Sa=class extends Le{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.promise&&r.common.async===!1)return ae(r,{code:J.invalid_type,expected:oe.promise,received:r.parsedType}),_e;let t=r.parsedType===oe.promise?r.data:Promise.resolve(r.data);return Pt(t.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Sa.create=(a,e)=>new Sa({type:a,typeName:Se.ZodPromise,...De(e)});var or=class extends Le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:t}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:n=>{ae(t,n),n.fatal?r.abort():r.dirty()},get path(){return t.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let n=s.transform(t.data,i);if(t.common.async)return Promise.resolve(n).then(async o=>{if(r.value==="aborted")return _e;let l=await this._def.schema._parseAsync({data:o,path:t.path,parent:t});return l.status==="aborted"?_e:l.status==="dirty"?Qa(l.value):r.value==="dirty"?Qa(l.value):l});{if(r.value==="aborted")return _e;let o=this._def.schema._parseSync({data:n,path:t.path,parent:t});return o.status==="aborted"?_e:o.status==="dirty"?Qa(o.value):r.value==="dirty"?Qa(o.value):o}}if(s.type==="refinement"){let n=o=>{let l=s.refinement(o,i);if(t.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(t.common.async===!1){let o=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});return o.status==="aborted"?_e:(o.status==="dirty"&&r.dirty(),n(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(o=>o.status==="aborted"?_e:(o.status==="dirty"&&r.dirty(),n(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(t.common.async===!1){let n=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});if(!_a(n))return _e;let o=s.transform(n.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(n=>_a(n)?Promise.resolve(s.transform(n.value,i)).then(o=>({status:r.value,value:o})):_e);He.assertNever(s)}};or.create=(a,e,r)=>new or({schema:a,typeName:Se.ZodEffects,effect:e,...De(r)});or.createWithPreprocess=(a,e,r)=>new or({schema:e,effect:{type:"preprocess",transform:a},typeName:Se.ZodEffects,...De(r)});var nr=class extends Le{_parse(e){return this._getType(e)===oe.undefined?Pt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};nr.create=(a,e)=>new nr({innerType:a,typeName:Se.ZodOptional,...De(e)});var Mr=class extends Le{_parse(e){return this._getType(e)===oe.null?Pt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(a,e)=>new Mr({innerType:a,typeName:Se.ZodNullable,...De(e)});var ls=class extends Le{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return r.parsedType===oe.undefined&&(t=this._def.defaultValue()),this._def.innerType._parse({data:t,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ls.create=(a,e)=>new ls({innerType:a,typeName:Se.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...De(e)});var us=class extends Le{_parse(e){let{ctx:r}=this._processInputParams(e),t={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t}});return un(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Mt(t.common.issues)},input:t.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Mt(t.common.issues)},input:t.data})}}removeCatch(){return this._def.innerType}};us.create=(a,e)=>new us({innerType:a,typeName:Se.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...De(e)});var vn=class extends Le{_parse(e){if(this._getType(e)!==oe.nan){let t=this._getOrReturnCtx(e);return ae(t,{code:J.invalid_type,expected:oe.nan,received:t.parsedType}),_e}return{status:"valid",value:e.data}}};vn.create=a=>new vn({typeName:Se.ZodNaN,...De(a)});var IA=Symbol("zod_brand"),_i=class extends Le{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return this._def.type._parse({data:t,path:r.path,parent:r})}unwrap(){return this._def.type}},Ei=class a extends Le{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return i.status==="aborted"?_e:i.status==="dirty"?(r.dirty(),Qa(i.value)):this._def.out._parseAsync({data:i.value,path:t.path,parent:t})})();{let s=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return s.status==="aborted"?_e:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:t.path,parent:t})}}static create(e,r){return new a({in:e,out:r,typeName:Se.ZodPipeline})}},ps=class extends Le{_parse(e){let r=this._def.innerType._parse(e),t=s=>(_a(s)&&(s.value=Object.freeze(s.value)),s);return un(r)?r.then(s=>t(s)):t(r)}unwrap(){return this._def.innerType}};ps.create=(a,e)=>new ps({innerType:a,typeName:Se.ZodReadonly,...De(e)});function ax(a,e){let r=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof r=="string"?{message:r}:r}function cx(a,e={},r){return a?wa.create().superRefine((t,s)=>{let i=a(t);if(i instanceof Promise)return i.then(n=>{if(!n){let o=ax(e,t),l=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:l})}});if(!i){let n=ax(e,t),o=n.fatal??r??!0;s.addIssue({code:"custom",...n,fatal:o})}}):wa.create()}var AA={object:Ft.lazycreate},Se;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(Se||(Se={}));var jA=(a,e={message:`Input not instance of ${a.name}`})=>cx(r=>r instanceof a,e),lx=Ea.create,ux=Xa.create,NA=vn.create,DA=Ja.create,px=Ya.create,$A=es.create,qA=dn.create,MA=ts.create,FA=rs.create,LA=wa.create,UA=Jr.create,zA=Sr.create,HA=fn.create,BA=Yr.create,VA=Ft.create,GA=Ft.strictCreate,ZA=as.create,WA=ac.create,KA=ss.create,QA=qr.create,XA=sc.create,JA=mn.create,YA=hn.create,e2=nc.create,t2=ns.create,r2=is.create,a2=os.create,s2=cs.create,n2=Sa.create,i2=or.create,o2=nr.create,c2=Mr.create,l2=or.createWithPreprocess,u2=Ei.create,p2=()=>lx().optional(),d2=()=>ux().optional(),f2=()=>px().optional(),m2={string:(a=>Ea.create({...a,coerce:!0})),number:(a=>Xa.create({...a,coerce:!0})),boolean:(a=>Ya.create({...a,coerce:!0})),bigint:(a=>Ja.create({...a,coerce:!0})),date:(a=>es.create({...a,coerce:!0}))};var h2=_e;var Sp="2025-06-18";var dx=[Sp,"2025-03-26","2024-11-05","2024-10-07"],ic="2.0",fx=_.union([_.string(),_.number().int()]),mx=_.string(),v2=_.object({progressToken:_.optional(fx)}).passthrough(),ur=_.object({_meta:_.optional(v2)}).passthrough(),Lt=_.object({method:_.string(),params:_.optional(ur)}),wi=_.object({_meta:_.optional(_.object({}).passthrough())}).passthrough(),Fr=_.object({method:_.string(),params:_.optional(wi)}),pr=_.object({_meta:_.optional(_.object({}).passthrough())}).passthrough(),oc=_.union([_.string(),_.number().int()]),hx=_.object({jsonrpc:_.literal(ic),id:oc}).merge(Lt).strict(),vx=a=>hx.safeParse(a).success,gx=_.object({jsonrpc:_.literal(ic)}).merge(Fr).strict(),yx=a=>gx.safeParse(a).success,bx=_.object({jsonrpc:_.literal(ic),id:oc,result:pr}).strict(),Pp=a=>bx.safeParse(a).success,cr;(function(a){a[a.ConnectionClosed=-32e3]="ConnectionClosed",a[a.RequestTimeout=-32001]="RequestTimeout",a[a.ParseError=-32700]="ParseError",a[a.InvalidRequest=-32600]="InvalidRequest",a[a.MethodNotFound=-32601]="MethodNotFound",a[a.InvalidParams=-32602]="InvalidParams",a[a.InternalError=-32603]="InternalError"})(cr||(cr={}));var xx=_.object({jsonrpc:_.literal(ic),id:oc,error:_.object({code:_.number().int(),message:_.string(),data:_.optional(_.unknown())})}).strict(),_x=a=>xx.safeParse(a).success,Ex=_.union([hx,gx,bx,xx]),ds=pr.strict(),cc=Fr.extend({method:_.literal("notifications/cancelled"),params:wi.extend({requestId:oc,reason:_.string().optional()})}),g2=_.object({src:_.string(),mimeType:_.optional(_.string()),sizes:_.optional(_.array(_.string()))}).passthrough(),Si=_.object({icons:_.array(g2).optional()}).passthrough(),Pi=_.object({name:_.string(),title:_.optional(_.string())}).passthrough(),wx=Pi.extend({version:_.string(),websiteUrl:_.optional(_.string())}).merge(Si),y2=_.object({experimental:_.optional(_.object({}).passthrough()),sampling:_.optional(_.object({}).passthrough()),elicitation:_.optional(_.object({}).passthrough()),roots:_.optional(_.object({listChanged:_.optional(_.boolean())}).passthrough())}).passthrough(),b2=Lt.extend({method:_.literal("initialize"),params:ur.extend({protocolVersion:_.string(),capabilities:y2,clientInfo:wx})});var x2=_.object({experimental:_.optional(_.object({}).passthrough()),logging:_.optional(_.object({}).passthrough()),completions:_.optional(_.object({}).passthrough()),prompts:_.optional(_.object({listChanged:_.optional(_.boolean())}).passthrough()),resources:_.optional(_.object({subscribe:_.optional(_.boolean()),listChanged:_.optional(_.boolean())}).passthrough()),tools:_.optional(_.object({listChanged:_.optional(_.boolean())}).passthrough())}).passthrough(),Rp=pr.extend({protocolVersion:_.string(),capabilities:x2,serverInfo:wx,instructions:_.optional(_.string())}),_2=Fr.extend({method:_.literal("notifications/initialized")});var lc=Lt.extend({method:_.literal("ping")}),E2=_.object({progress:_.number(),total:_.optional(_.number()),message:_.optional(_.string())}).passthrough(),uc=Fr.extend({method:_.literal("notifications/progress"),params:wi.merge(E2).extend({progressToken:fx})}),pc=Lt.extend({params:ur.extend({cursor:_.optional(mx)}).optional()}),dc=pr.extend({nextCursor:_.optional(mx)}),Sx=_.object({uri:_.string(),mimeType:_.optional(_.string()),_meta:_.optional(_.object({}).passthrough())}).passthrough(),Px=Sx.extend({text:_.string()}),Tp=_.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),Rx=Sx.extend({blob:Tp}),Tx=Pi.extend({uri:_.string(),description:_.optional(_.string()),mimeType:_.optional(_.string()),_meta:_.optional(_.object({}).passthrough())}).merge(Si),w2=Pi.extend({uriTemplate:_.string(),description:_.optional(_.string()),mimeType:_.optional(_.string()),_meta:_.optional(_.object({}).passthrough())}).merge(Si),S2=pc.extend({method:_.literal("resources/list")}),kp=dc.extend({resources:_.array(Tx)}),P2=pc.extend({method:_.literal("resources/templates/list")}),Op=dc.extend({resourceTemplates:_.array(w2)}),R2=Lt.extend({method:_.literal("resources/read"),params:ur.extend({uri:_.string()})}),Cp=pr.extend({contents:_.array(_.union([Px,Rx]))}),T2=Fr.extend({method:_.literal("notifications/resources/list_changed")}),k2=Lt.extend({method:_.literal("resources/subscribe"),params:ur.extend({uri:_.string()})}),O2=Lt.extend({method:_.literal("resources/unsubscribe"),params:ur.extend({uri:_.string()})}),C2=Fr.extend({method:_.literal("notifications/resources/updated"),params:wi.extend({uri:_.string()})}),I2=_.object({name:_.string(),description:_.optional(_.string()),required:_.optional(_.boolean())}).passthrough(),A2=Pi.extend({description:_.optional(_.string()),arguments:_.optional(_.array(I2)),_meta:_.optional(_.object({}).passthrough())}).merge(Si),j2=pc.extend({method:_.literal("prompts/list")}),Ip=dc.extend({prompts:_.array(A2)}),N2=Lt.extend({method:_.literal("prompts/get"),params:ur.extend({name:_.string(),arguments:_.optional(_.record(_.string()))})}),Ap=_.object({type:_.literal("text"),text:_.string(),_meta:_.optional(_.object({}).passthrough())}).passthrough(),jp=_.object({type:_.literal("image"),data:Tp,mimeType:_.string(),_meta:_.optional(_.object({}).passthrough())}).passthrough(),Np=_.object({type:_.literal("audio"),data:Tp,mimeType:_.string(),_meta:_.optional(_.object({}).passthrough())}).passthrough(),D2=_.object({type:_.literal("resource"),resource:_.union([Px,Rx]),_meta:_.optional(_.object({}).passthrough())}).passthrough(),$2=Tx.extend({type:_.literal("resource_link")}),kx=_.union([Ap,jp,Np,$2,D2]),q2=_.object({role:_.enum(["user","assistant"]),content:kx}).passthrough(),Dp=pr.extend({description:_.optional(_.string()),messages:_.array(q2)}),M2=Fr.extend({method:_.literal("notifications/prompts/list_changed")}),F2=_.object({title:_.optional(_.string()),readOnlyHint:_.optional(_.boolean()),destructiveHint:_.optional(_.boolean()),idempotentHint:_.optional(_.boolean()),openWorldHint:_.optional(_.boolean())}).passthrough(),L2=Pi.extend({description:_.optional(_.string()),inputSchema:_.object({type:_.literal("object"),properties:_.optional(_.object({}).passthrough()),required:_.optional(_.array(_.string()))}).passthrough(),outputSchema:_.optional(_.object({type:_.literal("object"),properties:_.optional(_.object({}).passthrough()),required:_.optional(_.array(_.string()))}).passthrough()),annotations:_.optional(F2),_meta:_.optional(_.object({}).passthrough())}).merge(Si),U2=pc.extend({method:_.literal("tools/list")}),$p=dc.extend({tools:_.array(L2)}),fc=pr.extend({content:_.array(kx).default([]),structuredContent:_.object({}).passthrough().optional(),isError:_.optional(_.boolean())}),GF=fc.or(pr.extend({toolResult:_.unknown()})),z2=Lt.extend({method:_.literal("tools/call"),params:ur.extend({name:_.string(),arguments:_.optional(_.record(_.unknown()))})}),H2=Fr.extend({method:_.literal("notifications/tools/list_changed")}),Ox=_.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),B2=Lt.extend({method:_.literal("logging/setLevel"),params:ur.extend({level:Ox})}),V2=Fr.extend({method:_.literal("notifications/message"),params:wi.extend({level:Ox,logger:_.optional(_.string()),data:_.unknown()})}),G2=_.object({name:_.string().optional()}).passthrough(),Z2=_.object({hints:_.optional(_.array(G2)),costPriority:_.optional(_.number().min(0).max(1)),speedPriority:_.optional(_.number().min(0).max(1)),intelligencePriority:_.optional(_.number().min(0).max(1))}).passthrough(),W2=_.object({role:_.enum(["user","assistant"]),content:_.union([Ap,jp,Np])}).passthrough(),K2=Lt.extend({method:_.literal("sampling/createMessage"),params:ur.extend({messages:_.array(W2),systemPrompt:_.optional(_.string()),includeContext:_.optional(_.enum(["none","thisServer","allServers"])),temperature:_.optional(_.number()),maxTokens:_.number().int(),stopSequences:_.optional(_.array(_.string())),metadata:_.optional(_.object({}).passthrough()),modelPreferences:_.optional(Z2)})}),Q2=pr.extend({model:_.string(),stopReason:_.optional(_.enum(["endTurn","stopSequence","maxTokens"]).or(_.string())),role:_.enum(["user","assistant"]),content:_.discriminatedUnion("type",[Ap,jp,Np])}),X2=_.object({type:_.literal("boolean"),title:_.optional(_.string()),description:_.optional(_.string()),default:_.optional(_.boolean())}).passthrough(),J2=_.object({type:_.literal("string"),title:_.optional(_.string()),description:_.optional(_.string()),minLength:_.optional(_.number()),maxLength:_.optional(_.number()),format:_.optional(_.enum(["email","uri","date","date-time"]))}).passthrough(),Y2=_.object({type:_.enum(["number","integer"]),title:_.optional(_.string()),description:_.optional(_.string()),minimum:_.optional(_.number()),maximum:_.optional(_.number())}).passthrough(),e8=_.object({type:_.literal("string"),title:_.optional(_.string()),description:_.optional(_.string()),enum:_.array(_.string()),enumNames:_.optional(_.array(_.string()))}).passthrough(),t8=_.union([X2,J2,Y2,e8]),r8=Lt.extend({method:_.literal("elicitation/create"),params:ur.extend({message:_.string(),requestedSchema:_.object({type:_.literal("object"),properties:_.record(_.string(),t8),required:_.optional(_.array(_.string()))}).passthrough()})}),a8=pr.extend({action:_.enum(["accept","decline","cancel"]),content:_.optional(_.record(_.string(),_.unknown()))}),s8=_.object({type:_.literal("ref/resource"),uri:_.string()}).passthrough();var n8=_.object({type:_.literal("ref/prompt"),name:_.string()}).passthrough(),i8=Lt.extend({method:_.literal("completion/complete"),params:ur.extend({ref:_.union([n8,s8]),argument:_.object({name:_.string(),value:_.string()}).passthrough(),context:_.optional(_.object({arguments:_.optional(_.record(_.string(),_.string()))}))})}),qp=pr.extend({completion:_.object({values:_.array(_.string()).max(100),total:_.optional(_.number().int()),hasMore:_.optional(_.boolean())}).passthrough()}),o8=_.object({uri:_.string().startsWith("file://"),name:_.optional(_.string()),_meta:_.optional(_.object({}).passthrough())}).passthrough(),c8=Lt.extend({method:_.literal("roots/list")}),l8=pr.extend({roots:_.array(o8)}),u8=Fr.extend({method:_.literal("notifications/roots/list_changed")}),ZF=_.union([lc,b2,i8,B2,N2,j2,S2,P2,R2,k2,O2,z2,U2]),WF=_.union([cc,uc,_2,u8]),KF=_.union([ds,Q2,a8,l8]),QF=_.union([lc,K2,r8,c8]),XF=_.union([cc,uc,V2,C2,T2,H2,M2]),JF=_.union([ds,Rp,qp,Dp,Ip,kp,Op,Cp,fc,$p]),lr=class extends Error{constructor(e,r,t){super(`MCP error ${e}: ${r}`),this.code=e,this.data=t,this.name="McpError"}};var p8=6e4,mc=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(cc,r=>{let t=this._requestHandlerAbortControllers.get(r.params.requestId);t?.abort(r.params.reason)}),this.setNotificationHandler(uc,r=>{this._onprogress(r)}),this.setRequestHandler(lc,r=>({}))}_setupTimeout(e,r,t,s,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(s,r),startTime:Date.now(),timeout:r,maxTotalTimeout:t,resetTimeoutOnProgress:i,onTimeout:s})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let t=Date.now()-r.startTime;if(r.maxTotalTimeout&&t>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),new lr(cr.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:t});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var r,t,s;this._transport=e;let i=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{i?.(),this._onclose()};let n=(t=this.transport)===null||t===void 0?void 0:t.onerror;this._transport.onerror=l=>{n?.(l),this._onerror(l)};let o=(s=this._transport)===null||s===void 0?void 0:s.onmessage;this._transport.onmessage=(l,c)=>{o?.(l,c),Pp(l)||_x(l)?this._onresponse(l):vx(l)?this._onrequest(l,c):yx(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){var e;let r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let t=new lr(cr.ConnectionClosed,"Connection closed");for(let s of r.values())s(t)}_onerror(e){var r;(r=this.onerror)===null||r===void 0||r.call(this,e)}_onnotification(e){var r;let t=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,r){var t,s;let i=(t=this._requestHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackRequestHandler,n=this._transport;if(i===void 0){n?.send({jsonrpc:"2.0",id:e.id,error:{code:cr.MethodNotFound,message:"Method not found"}}).catch(c=>this._onerror(new Error(`Failed to send an error response: ${c}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let l={signal:o.signal,sessionId:n?.sessionId,_meta:(s=e.params)===null||s===void 0?void 0:s._meta,sendNotification:c=>this.notification(c,{relatedRequestId:e.id}),sendRequest:(c,u,p)=>this.request(c,u,{...p,relatedRequestId:e.id}),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo};Promise.resolve().then(()=>i(e,l)).then(c=>{if(!o.signal.aborted)return n?.send({result:c,jsonrpc:"2.0",id:e.id})},c=>{var u;if(!o.signal.aborted)return n?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(c.code)?c.code:cr.InternalError,message:(u=c.message)!==null&&u!==void 0?u:"Internal error"}})}).catch(c=>this._onerror(new Error(`Failed to send response: ${c}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...t}=e.params,s=Number(r),i=this._progressHandlers.get(s);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let n=this._responseHandlers.get(s),o=this._timeoutInfo.get(s);if(o&&n&&o.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(l){n(l);return}i(t)}_onresponse(e){let r=Number(e.id),t=this._responseHandlers.get(r);if(t===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),Pp(e))t(e);else{let s=new lr(e.error.code,e.error.message,e.error.data);t(s)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,r,t){let{relatedRequestId:s,resumptionToken:i,onresumptiontoken:n}=t??{};return new Promise((o,l)=>{var c,u,p,m,f,h;if(!this._transport){l(new Error("Not connected"));return}((c=this._options)===null||c===void 0?void 0:c.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(u=t?.signal)===null||u===void 0||u.throwIfAborted();let d=this._requestMessageId++,v={...e,jsonrpc:"2.0",id:d};t?.onprogress&&(this._progressHandlers.set(d,t.onprogress),v.params={...e.params,_meta:{...((p=e.params)===null||p===void 0?void 0:p._meta)||{},progressToken:d}});let x=k=>{var O;this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),(O=this._transport)===null||O===void 0||O.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(k)}},{relatedRequestId:s,resumptionToken:i,onresumptiontoken:n}).catch(P=>this._onerror(new Error(`Failed to send cancellation: ${P}`))),l(k)};this._responseHandlers.set(d,k=>{var O;if(!(!((O=t?.signal)===null||O===void 0)&&O.aborted)){if(k instanceof Error)return l(k);try{let P=r.parse(k.result);o(P)}catch(P){l(P)}}}),(m=t?.signal)===null||m===void 0||m.addEventListener("abort",()=>{var k;x((k=t?.signal)===null||k===void 0?void 0:k.reason)});let b=(f=t?.timeout)!==null&&f!==void 0?f:p8,E=()=>x(new lr(cr.RequestTimeout,"Request timed out",{timeout:b}));this._setupTimeout(d,b,t?.maxTotalTimeout,E,(h=t?.resetTimeoutOnProgress)!==null&&h!==void 0?h:!1),this._transport.send(v,{relatedRequestId:s,resumptionToken:i,onresumptiontoken:n}).catch(k=>{this._cleanupTimeout(d),l(k)})})}async notification(e,r){var t,s;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((s=(t=this._options)===null||t===void 0?void 0:t.debouncedNotificationMethods)!==null&&s!==void 0?s:[]).includes(e.method)&&!e.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var l;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};(l=this._transport)===null||l===void 0||l.send(c,r).catch(u=>this._onerror(u))});return}let o={...e,jsonrpc:"2.0"};await this._transport.send(o,r)}setRequestHandler(e,r){let t=e.shape.method.value;this.assertRequestHandlerCapability(t),this._requestHandlers.set(t,(s,i)=>Promise.resolve(r(e.parse(s),i)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){this._notificationHandlers.set(e.shape.method.value,t=>Promise.resolve(r(e.parse(t))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Cx(a,e){return Object.entries(e).reduce((r,[t,s])=>(s&&typeof s=="object"?r[t]=r[t]?{...r[t],...s}:s:r[t]=s,r),{...a})}var A_=jt(I_(),1),gn=class extends mc{constructor(e,r){var t;super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(t=r?.capabilities)!==null&&t!==void 0?t:{},this._ajv=new A_.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Cx(this._capabilities,e)}assertCapability(e,r){var t;if(!(!((t=this._serverCapabilities)===null||t===void 0)&&t[e]))throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let t=await this.request({method:"initialize",params:{protocolVersion:Sp,capabilities:this._capabilities,clientInfo:this._clientInfo}},Rp,r);if(t===void 0)throw new Error(`Server sent invalid initialize result: ${t}`);if(!dx.includes(t.protocolVersion))throw new Error(`Server's protocol version is not supported: ${t.protocolVersion}`);this._serverCapabilities=t.capabilities,this._serverVersion=t.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(t.protocolVersion),this._instructions=t.instructions,await this.notification({method:"notifications/initialized"})}catch(t){throw this.close(),t}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var r,t,s,i,n;switch(e){case"logging/setLevel":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((t=this._serverCapabilities)===null||t===void 0)&&t.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((i=this._serverCapabilities)===null||i===void 0)&&i.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var r;switch(e){case"notifications/roots/list_changed":if(!(!((r=this._capabilities.roots)===null||r===void 0)&&r.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},ds,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},qp,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},ds,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},Dp,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Ip,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},kp,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Op,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Cp,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},ds,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},ds,r)}async callTool(e,r=fc,t){let s=await this.request({method:"tools/call",params:e},r,t),i=this.getToolOutputValidator(e.name);if(i){if(!s.structuredContent&&!s.isError)throw new lr(cr.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(s.structuredContent)try{if(!i(s.structuredContent))throw new lr(cr.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(i.errors)}`)}catch(n){throw n instanceof lr?n:new lr(cr.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return s}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let r of e)if(r.outputSchema)try{let t=this._ajv.compile(r.outputSchema);this._cachedToolOutputValidators.set(r.name,t)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let t=await this.request({method:"tools/list",params:e},$p,r);return this.cacheToolOutputSchemas(t.tools),t}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var EE=jt(xE(),1),Ti=jt(require("node:process"),1),wE=require("node:stream");var Nc=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(` -`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),vj(r)}clear(){this._buffer=void 0}};function vj(a){return Ex.parse(JSON.parse(a))}function _E(a){return JSON.stringify(a)+` -`}var gj=Ti.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function yj(){let a={};for(let e of gj){let r=Ti.default.env[e];r!==void 0&&(r.startsWith("()")||(a[e]=r))}return a}var xn=class{constructor(e){this._abortController=new AbortController,this._readBuffer=new Nc,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new wE.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{var t,s,i,n,o;this._process=(0,EE.default)(this._serverParams.command,(t=this._serverParams.args)!==null&&t!==void 0?t:[],{env:{...yj(),...this._serverParams.env},stdio:["pipe","pipe",(s=this._serverParams.stderr)!==null&&s!==void 0?s:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:Ti.default.platform==="win32"&&bj(),cwd:this._serverParams.cwd}),this._process.on("error",l=>{var c,u;if(l.name==="AbortError"){(c=this.onclose)===null||c===void 0||c.call(this);return}r(l),(u=this.onerror)===null||u===void 0||u.call(this,l)}),this._process.on("spawn",()=>{e()}),this._process.on("close",l=>{var c;this._process=void 0,(c=this.onclose)===null||c===void 0||c.call(this)}),(i=this._process.stdin)===null||i===void 0||i.on("error",l=>{var c;(c=this.onerror)===null||c===void 0||c.call(this,l)}),(n=this._process.stdout)===null||n===void 0||n.on("data",l=>{this._readBuffer.append(l),this.processReadBuffer()}),(o=this._process.stdout)===null||o===void 0||o.on("error",l=>{var c;(c=this.onerror)===null||c===void 0||c.call(this,l)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){var e,r;return this._stderrStream?this._stderrStream:(r=(e=this._process)===null||e===void 0?void 0:e.stderr)!==null&&r!==void 0?r:null}get pid(){var e,r;return(r=(e=this._process)===null||e===void 0?void 0:e.pid)!==null&&r!==void 0?r:null}processReadBuffer(){for(var e,r;;)try{let t=this._readBuffer.readMessage();if(t===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,t)}catch(t){(r=this.onerror)===null||r===void 0||r.call(this,t)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(e){return new Promise(r=>{var t;if(!(!((t=this._process)===null||t===void 0)&&t.stdin))throw new Error("Not connected");let s=_E(e);this._process.stdin.write(s)?r():this._process.stdin.once("drain",r)})}};function bj(){return"type"in Ti.default}var SE=jt(require("better-sqlite3"),1);var _n=class{db;constructor(){Jo(wr),this.db=new SE.default(Xo),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("foreign_keys = ON"),this.initializeSchema(),this.ensureWorkerPortColumn(),this.ensurePromptTrackingColumns(),this.removeSessionSummariesUniqueConstraint(),this.addObservationHierarchicalFields(),this.makeObservationsTextNullable(),this.createUserPromptsTable(),this.ensureDiscoveryTokensColumn()}initializeSchema(){try{this.db.exec(` +`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),v9(r)}clear(){this._buffer=void 0}};function v9(a){return Ex.parse(JSON.parse(a))}function _E(a){return JSON.stringify(a)+` +`}var g9=Ti.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function y9(){let a={};for(let e of g9){let r=Ti.default.env[e];r!==void 0&&(r.startsWith("()")||(a[e]=r))}return a}var xn=class{constructor(e){this._abortController=new AbortController,this._readBuffer=new Nc,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new wE.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{var t,s,i,n,o;this._process=(0,EE.default)(this._serverParams.command,(t=this._serverParams.args)!==null&&t!==void 0?t:[],{env:{...y9(),...this._serverParams.env},stdio:["pipe","pipe",(s=this._serverParams.stderr)!==null&&s!==void 0?s:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:Ti.default.platform==="win32"&&b9(),cwd:this._serverParams.cwd}),this._process.on("error",l=>{var c,u;if(l.name==="AbortError"){(c=this.onclose)===null||c===void 0||c.call(this);return}r(l),(u=this.onerror)===null||u===void 0||u.call(this,l)}),this._process.on("spawn",()=>{e()}),this._process.on("close",l=>{var c;this._process=void 0,(c=this.onclose)===null||c===void 0||c.call(this)}),(i=this._process.stdin)===null||i===void 0||i.on("error",l=>{var c;(c=this.onerror)===null||c===void 0||c.call(this,l)}),(n=this._process.stdout)===null||n===void 0||n.on("data",l=>{this._readBuffer.append(l),this.processReadBuffer()}),(o=this._process.stdout)===null||o===void 0||o.on("error",l=>{var c;(c=this.onerror)===null||c===void 0||c.call(this,l)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){var e,r;return this._stderrStream?this._stderrStream:(r=(e=this._process)===null||e===void 0?void 0:e.stderr)!==null&&r!==void 0?r:null}get pid(){var e,r;return(r=(e=this._process)===null||e===void 0?void 0:e.pid)!==null&&r!==void 0?r:null}processReadBuffer(){for(var e,r;;)try{let t=this._readBuffer.readMessage();if(t===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,t)}catch(t){(r=this.onerror)===null||r===void 0||r.call(this,t)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(e){return new Promise(r=>{var t;if(!(!((t=this._process)===null||t===void 0)&&t.stdin))throw new Error("Not connected");let s=_E(e);this._process.stdin.write(s)?r():this._process.stdin.once("drain",r)})}};function b9(){return"type"in Ti.default}var SE=jt(require("better-sqlite3"),1);var _n=class{db;constructor(){Jo(wr),this.db=new SE.default(Xo),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("foreign_keys = ON"),this.initializeSchema(),this.ensureWorkerPortColumn(),this.ensurePromptTrackingColumns(),this.removeSessionSummariesUniqueConstraint(),this.addObservationHierarchicalFields(),this.makeObservationsTextNullable(),this.createUserPromptsTable(),this.ensureDiscoveryTokensColumn()}initializeSchema(){try{this.db.exec(` CREATE TABLE IF NOT EXISTS schema_versions ( id INTEGER PRIMARY KEY, version INTEGER UNIQUE NOT NULL, @@ -603,9 +603,9 @@ ${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let r=Obje FROM user_prompts up JOIN sdk_sessions s ON up.claude_session_id = s.claude_session_id WHERE s.project = ? - `).get(this.project);H.info("CHROMA_SYNC","Backfilling user prompts",{project:this.project,missing:d.length,existing:e.prompts.size,total:v.count});let x=[];for(let b of d)x.push(this.formatUserPromptDoc(b));for(let b=0;b{H.error("DB","Chroma backfill failed (non-fatal)",{},e)}),H.info("DB","Database initialized")}async close(){if(this.chromaSync)try{await this.chromaSync.close(),this.chromaSync=null}catch(e){H.error("DB","Failed to close ChromaSync",{},e)}this.sessionStore&&(this.sessionStore.close(),this.sessionStore=null),this.sessionSearch&&(this.sessionSearch.close(),this.sessionSearch=null),H.info("DB","Database closed")}getSessionStore(){if(!this.sessionStore)throw new Error("Database not initialized");return this.sessionStore}getSessionSearch(){if(!this.sessionSearch)throw new Error("Database not initialized");return this.sessionSearch}getChromaSync(){if(!this.chromaSync)throw new Error("ChromaSync not initialized");return this.chromaSync}getSessionById(e){let r=this.getSessionStore().getSessionById(e);if(!r)throw new Error(`Session ${e} not found`);return r}markSessionComplete(e){this.getSessionStore().markSessionCompleted(e)}};var IE=require("events");var kE=require("fs"),OE=require("os"),CE=require("path"),xj=(0,CE.join)((0,OE.homedir)(),".claude-mem","silent.log");function Kt(a,e,r=""){let t=new Date().toISOString(),o=((new Error().stack||"").split(` + `).get(this.project);H.info("CHROMA_SYNC","Backfilling user prompts",{project:this.project,missing:d.length,existing:e.prompts.size,total:v.count});let x=[];for(let b of d)x.push(this.formatUserPromptDoc(b));for(let b=0;b{H.error("DB","Chroma backfill failed (non-fatal)",{},e)}),H.info("DB","Database initialized")}async close(){if(this.chromaSync)try{await this.chromaSync.close(),this.chromaSync=null}catch(e){H.error("DB","Failed to close ChromaSync",{},e)}this.sessionStore&&(this.sessionStore.close(),this.sessionStore=null),this.sessionSearch&&(this.sessionSearch.close(),this.sessionSearch=null),H.info("DB","Database closed")}getSessionStore(){if(!this.sessionStore)throw new Error("Database not initialized");return this.sessionStore}getSessionSearch(){if(!this.sessionSearch)throw new Error("Database not initialized");return this.sessionSearch}getChromaSync(){if(!this.chromaSync)throw new Error("ChromaSync not initialized");return this.chromaSync}getSessionById(e){let r=this.getSessionStore().getSessionById(e);if(!r)throw new Error(`Session ${e} not found`);return r}markSessionComplete(e){this.getSessionStore().markSessionCompleted(e)}};var IE=require("events");var kE=require("fs"),OE=require("os"),CE=require("path"),x9=(0,CE.join)((0,OE.homedir)(),".claude-mem","silent.log");function Ut(a,e,r=""){let t=new Date().toISOString(),o=((new Error().stack||"").split(` `)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),l=o?`${o[1].split("/").pop()}:${o[2]}`:"unknown",c=`[${t}] [${l}] ${a}`;if(e!==void 0)try{c+=` ${JSON.stringify(e)}`}catch(u){c+=` [stringify error: ${u}]`}c+=` -`;try{(0,kE.appendFileSync)(xj,c)}catch(u){console.error("[silent-debug] Failed to write to log:",u)}return r}var Mc=class{dbManager;sessions=new Map;sessionQueues=new Map;onSessionDeletedCallback;constructor(e){this.dbManager=e}setOnSessionDeleted(e){this.onSessionDeletedCallback=e}initializeSession(e,r,t){let s=this.sessions.get(e);if(s)return r?(Kt("[SessionManager] Updating userPrompt for continuation",{sessionDbId:e,promptNumber:t,oldPrompt:s.userPrompt.substring(0,80),newPrompt:r.substring(0,80)}),s.userPrompt=r,s.lastPromptNumber=t||s.lastPromptNumber):Kt("[SessionManager] No currentUserPrompt provided for existing session",{sessionDbId:e,promptNumber:t,usingCachedPrompt:s.userPrompt.substring(0,80)}),s;let i=this.dbManager.getSessionById(e),n=r||i.user_prompt;r?Kt("[SessionManager] Initializing session with fresh userPrompt",{sessionDbId:e,promptNumber:t,userPrompt:r.substring(0,80)}):Kt("[SessionManager] No currentUserPrompt provided for new session, using database",{sessionDbId:e,promptNumber:t,dbPrompt:i.user_prompt.substring(0,80)}),s={sessionDbId:e,claudeSessionId:i.claude_session_id,sdkSessionId:null,project:i.project,userPrompt:n,pendingMessages:[],abortController:new AbortController,generatorPromise:null,lastPromptNumber:t||this.dbManager.getSessionStore().getPromptCounter(e),startTime:Date.now(),cumulativeInputTokens:0,cumulativeOutputTokens:0},this.sessions.set(e,s);let o=new IE.EventEmitter;return this.sessionQueues.set(e,o),H.info("SESSION","Session initialized",{sessionId:e,project:s.project,claudeSessionId:s.claudeSessionId,queueDepth:0,hasGenerator:!1}),s}getSession(e){return this.sessions.get(e)}queueObservation(e,r){let t=this.sessions.get(e);t||(t=this.initializeSession(e));let s=t.pendingMessages.length;t.pendingMessages.push({type:"observation",tool_name:r.tool_name,tool_input:r.tool_input,tool_response:r.tool_response,prompt_number:r.prompt_number,cwd:r.cwd});let i=t.pendingMessages.length;this.sessionQueues.get(e)?.emit("message");let o=H.formatTool(r.tool_name,r.tool_input);H.info("SESSION",`Observation queued (${s}\u2192${i})`,{sessionId:e,tool:o,hasGenerator:!!t.generatorPromise})}queueSummarize(e,r,t){let s=this.sessions.get(e);s||(s=this.initializeSession(e));let i=s.pendingMessages.length;s.pendingMessages.push({type:"summarize",last_user_message:r,last_assistant_message:t});let n=s.pendingMessages.length;this.sessionQueues.get(e)?.emit("message"),H.info("SESSION",`Summarize queued (${i}\u2192${n})`,{sessionId:e,hasGenerator:!!s.generatorPromise})}async deleteSession(e){let r=this.sessions.get(e);if(!r)return;let t=Date.now()-r.startTime;r.abortController.abort(),r.generatorPromise&&await r.generatorPromise.catch(()=>{}),this.sessions.delete(e),this.sessionQueues.delete(e),H.info("SESSION","Session deleted",{sessionId:e,duration:`${(t/1e3).toFixed(1)}s`,project:r.project}),this.onSessionDeletedCallback&&this.onSessionDeletedCallback()}async shutdownAll(){let e=Array.from(this.sessions.keys());await Promise.all(e.map(r=>this.deleteSession(r)))}hasPendingMessages(){return Array.from(this.sessions.values()).some(e=>e.pendingMessages.length>0)}getActiveSessionCount(){return this.sessions.size}getTotalQueueDepth(){let e=0;for(let r of this.sessions.values())e+=r.pendingMessages.length;return e}getTotalActiveWork(){let e=0;for(let r of this.sessions.values())e+=r.pendingMessages.length,r.generatorPromise!==null&&(e+=1);return e}isAnySessionProcessing(){for(let e of this.sessions.values())if(e.pendingMessages.length>0||e.generatorPromise!==null)return!0;return!1}async*getMessageIterator(e){let r=this.sessions.get(e);r||(r=this.initializeSession(e));let t=this.sessionQueues.get(e);if(!t)throw new Error(`No emitter for session ${e}`);for(;!r.abortController.signal.aborted;)for(r.pendingMessages.length===0&&await new Promise(s=>{let i=()=>s();t.once("message",i),r.abortController.signal.addEventListener("abort",()=>{t.off("message",i),s()},{once:!0})});r.pendingMessages.length>0;){let s=r.pendingMessages.shift();if(yield s,s.type==="summarize"){H.info("SESSION","Summary yielded - ending generator",{sessionId:e});return}}}};var Fc=class{sseClients=new Set;addClient(e){this.sseClients.add(e),H.debug("WORKER","Client connected",{total:this.sseClients.size}),e.on("close",()=>{this.removeClient(e)}),this.sendToClient(e,{type:"connected",timestamp:Date.now()})}removeClient(e){this.sseClients.delete(e),H.debug("WORKER","Client disconnected",{total:this.sseClients.size})}broadcast(e){if(this.sseClients.size===0){H.debug("WORKER","SSE broadcast skipped (no clients)",{eventType:e.type});return}let r={...e,timestamp:Date.now()},t=`data: ${JSON.stringify(r)} +`;try{(0,kE.appendFileSync)(x9,c)}catch(u){console.error("[silent-debug] Failed to write to log:",u)}return r}var Mc=class{dbManager;sessions=new Map;sessionQueues=new Map;onSessionDeletedCallback;constructor(e){this.dbManager=e}setOnSessionDeleted(e){this.onSessionDeletedCallback=e}initializeSession(e,r,t){let s=this.sessions.get(e);if(s){let l=this.dbManager.getSessionById(e);return l.project&&l.project!==s.project&&(Ut("[SessionManager] Updating project from database",{sessionDbId:e,oldProject:s.project,newProject:l.project}),s.project=l.project),r?(Ut("[SessionManager] Updating userPrompt for continuation",{sessionDbId:e,promptNumber:t,oldPrompt:s.userPrompt.substring(0,80),newPrompt:r.substring(0,80)}),s.userPrompt=r,s.lastPromptNumber=t||s.lastPromptNumber):Ut("[SessionManager] No currentUserPrompt provided for existing session",{sessionDbId:e,promptNumber:t,usingCachedPrompt:s.userPrompt.substring(0,80)}),s}let i=this.dbManager.getSessionById(e),n=r||i.user_prompt;r?Ut("[SessionManager] Initializing session with fresh userPrompt",{sessionDbId:e,promptNumber:t,userPrompt:r.substring(0,80)}):Ut("[SessionManager] No currentUserPrompt provided for new session, using database",{sessionDbId:e,promptNumber:t,dbPrompt:i.user_prompt.substring(0,80)}),s={sessionDbId:e,claudeSessionId:i.claude_session_id,sdkSessionId:null,project:i.project,userPrompt:n,pendingMessages:[],abortController:new AbortController,generatorPromise:null,lastPromptNumber:t||this.dbManager.getSessionStore().getPromptCounter(e),startTime:Date.now(),cumulativeInputTokens:0,cumulativeOutputTokens:0},this.sessions.set(e,s);let o=new IE.EventEmitter;return this.sessionQueues.set(e,o),H.info("SESSION","Session initialized",{sessionId:e,project:s.project,claudeSessionId:s.claudeSessionId,queueDepth:0,hasGenerator:!1}),s}getSession(e){return this.sessions.get(e)}queueObservation(e,r){let t=this.sessions.get(e);t||(t=this.initializeSession(e));let s=t.pendingMessages.length;t.pendingMessages.push({type:"observation",tool_name:r.tool_name,tool_input:r.tool_input,tool_response:r.tool_response,prompt_number:r.prompt_number,cwd:r.cwd});let i=t.pendingMessages.length;this.sessionQueues.get(e)?.emit("message");let o=H.formatTool(r.tool_name,r.tool_input);H.info("SESSION",`Observation queued (${s}\u2192${i})`,{sessionId:e,tool:o,hasGenerator:!!t.generatorPromise})}queueSummarize(e,r,t){let s=this.sessions.get(e);s||(s=this.initializeSession(e));let i=s.pendingMessages.length;s.pendingMessages.push({type:"summarize",last_user_message:r,last_assistant_message:t});let n=s.pendingMessages.length;this.sessionQueues.get(e)?.emit("message"),H.info("SESSION",`Summarize queued (${i}\u2192${n})`,{sessionId:e,hasGenerator:!!s.generatorPromise})}async deleteSession(e){let r=this.sessions.get(e);if(!r)return;let t=Date.now()-r.startTime;r.abortController.abort(),r.generatorPromise&&await r.generatorPromise.catch(()=>{}),this.sessions.delete(e),this.sessionQueues.delete(e),H.info("SESSION","Session deleted",{sessionId:e,duration:`${(t/1e3).toFixed(1)}s`,project:r.project}),this.onSessionDeletedCallback&&this.onSessionDeletedCallback()}async shutdownAll(){let e=Array.from(this.sessions.keys());await Promise.all(e.map(r=>this.deleteSession(r)))}hasPendingMessages(){return Array.from(this.sessions.values()).some(e=>e.pendingMessages.length>0)}getActiveSessionCount(){return this.sessions.size}getTotalQueueDepth(){let e=0;for(let r of this.sessions.values())e+=r.pendingMessages.length;return e}getTotalActiveWork(){let e=0;for(let r of this.sessions.values())e+=r.pendingMessages.length,r.generatorPromise!==null&&(e+=1);return e}isAnySessionProcessing(){for(let e of this.sessions.values())if(e.pendingMessages.length>0||e.generatorPromise!==null)return!0;return!1}async*getMessageIterator(e){let r=this.sessions.get(e);r||(r=this.initializeSession(e));let t=this.sessionQueues.get(e);if(!t)throw new Error(`No emitter for session ${e}`);for(;!r.abortController.signal.aborted;)for(r.pendingMessages.length===0&&await new Promise(s=>{let i=()=>s();t.once("message",i),r.abortController.signal.addEventListener("abort",()=>{t.off("message",i),s()},{once:!0})});r.pendingMessages.length>0;){let s=r.pendingMessages.shift();if(yield s,s.type==="summarize"){H.info("SESSION","Summary yielded - ending generator",{sessionId:e});return}}}};var Fc=class{sseClients=new Set;addClient(e){this.sseClients.add(e),H.debug("WORKER","Client connected",{total:this.sseClients.size}),e.on("close",()=>{this.removeClient(e)}),this.sendToClient(e,{type:"connected",timestamp:Date.now()})}removeClient(e){this.sseClients.delete(e),H.debug("WORKER","Client disconnected",{total:this.sseClients.size})}broadcast(e){if(this.sseClients.size===0){H.debug("WORKER","SSE broadcast skipped (no clients)",{eventType:e.type});return}let r={...e,timestamp:Date.now()},t=`data: ${JSON.stringify(r)} `;H.debug("WORKER","SSE broadcast sent",{eventType:e.type,clients:this.sseClients.size});for(let s of this.sseClients)try{s.write(t)}catch{this.sseClients.delete(s),H.debug("WORKER","Client removed due to write error")}}getClientCount(){return this.sseClients.size}sendToClient(e,r){let t=`data: ${JSON.stringify(r)} @@ -829,7 +829,7 @@ Never reference yourself or your own actions. Do not output anything other than Remember that we record these observations as a way of helping us stay on track with our progress, and to help us keep important decisions and changes at the forefront of our minds! :) Thank you so much for your continued help! MEMORY PROCESSING CONTINUED -===========================`}var xd=require("path"),r1=require("url"),a1=require("events"),n1=require("child_process"),i1=require("readline"),ke=jt(require("fs"),1),o1=require("fs/promises"),f1=require("path"),m1=require("os"),vs=require("path"),Sd=require("process"),h1=require("crypto"),P$={},_j=Object.create,Ej=Object.getPrototypeOf,bd=Object.defineProperty,wj=Object.getOwnPropertyNames,Sj=Object.prototype.hasOwnProperty,Pj=(a,e,r)=>{r=a!=null?_j(Ej(a)):{};let t=e||!a||!a.__esModule?bd(r,"default",{value:a,enumerable:!0}):r;for(let s of wj(a))Sj.call(t,s)||bd(t,s,{get:()=>a[s],enumerable:!0});return t},Ce=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),Rj=(a,e)=>{for(var r in e)bd(a,r,{get:e[r],enumerable:!0,configurable:!0,set:t=>e[r]=()=>t})},Tj=Ce((a,e)=>{(function(r,t){typeof a=="object"&&typeof e<"u"?t(a):typeof define=="function"&&define.amd?define(["exports"],t):t(r.URI=r.URI||{})})(a,function(r){function t(){for(var y=arguments.length,g=Array(y),S=0;S1){g[0]=g[0].slice(0,-1);for(var D=g.length-1,L=1;L= 0x80 (not a basic code point)","invalid-input":"Invalid input"},q=d-v,C=Math.floor,R=String.fromCharCode;function j(y){throw new RangeError(F[y])}function z(y,g){for(var S=[],D=y.length;D--;)S[D]=g(y[D]);return S}function B(y,g){var S=y.split("@"),D="";S.length>1&&(D=S[0]+"@",y=S[1]),y=y.replace(A,".");var L=y.split("."),K=z(L,g).join(".");return D+K}function G(y){for(var g=[],S=0,D=y.length;S=55296&&L<=56319&&S>1,g+=C(g/S);g>q*x>>1;L+=d)g=C(g/q);return C(L+(q+1)*g/(g+b))},ce=function(g){var S=[],D=g.length,L=0,K=O,ne=k,ge=g.lastIndexOf(P);ge<0&&(ge=0);for(var pe=0;pe=128&&j("not-basic"),S.push(g.charCodeAt(pe));for(var Ae=ge>0?ge+1:0;Ae=D&&j("invalid-input");var Te=X(g.charCodeAt(Ae++));(Te>=d||Te>C((h-L)/Re))&&j("overflow"),L+=Te*Re;var de=ye<=ne?v:ye>=ne+x?x:ye-ne;if(TeC(h/Xe)&&j("overflow"),Re*=Xe}var Ne=S.length+1;ne=re(L-ve,Ne,ve==0),C(L/Ne)>h-K&&j("overflow"),K+=C(L/Ne),L%=Ne,S.splice(L++,0,K)}return String.fromCodePoint.apply(String,S)},Be=function(g){var S=[];g=G(g);var D=g.length,L=O,K=0,ne=k,ge=!0,pe=!1,Ae=void 0;try{for(var ve=g[Symbol.iterator](),Re;!(ge=(Re=ve.next()).done);ge=!0){var ye=Re.value;ye<128&&S.push(R(ye))}}catch(Gr){pe=!0,Ae=Gr}finally{try{!ge&&ve.return&&ve.return()}finally{if(pe)throw Ae}}var Te=S.length,de=Te;for(Te&&S.push(P);de=L&&itC((h-K)/dt)&&j("overflow"),K+=(Xe-L)*dt,L=Xe;var ft=!0,Ht=!1,It=void 0;try{for(var Tr=g[Symbol.iterator](),vr;!(ft=(vr=Tr.next()).done);ft=!0){var gr=vr.value;if(grh&&j("overflow"),gr==L){for(var St=K,Bt=d;;Bt+=d){var Vt=Bt<=ne?v:Bt>=ne+x?x:Bt-ne;if(St>6|192).toString(16).toUpperCase()+"%"+(g&63|128).toString(16).toUpperCase():S="%"+(g>>12|224).toString(16).toUpperCase()+"%"+(g>>6&63|128).toString(16).toUpperCase()+"%"+(g&63|128).toString(16).toUpperCase(),S}function Z(y){for(var g="",S=0,D=y.length;S=194&&L<224){if(D-S>=6){var K=parseInt(y.substr(S+4,2),16);g+=String.fromCharCode((L&31)<<6|K&63)}else g+=y.substr(S,6);S+=6}else if(L>=224){if(D-S>=9){var ne=parseInt(y.substr(S+4,2),16),ge=parseInt(y.substr(S+7,2),16);g+=String.fromCharCode((L&15)<<12|(ne&63)<<6|ge&63)}else g+=y.substr(S,9);S+=9}else g+=y.substr(S,3),S+=3}return g}function ee(y,g){function S(D){var L=Z(D);return L.match(g.UNRESERVED)?L:D}return y.scheme&&(y.scheme=String(y.scheme).replace(g.PCT_ENCODED,S).toLowerCase().replace(g.NOT_SCHEME,"")),y.userinfo!==void 0&&(y.userinfo=String(y.userinfo).replace(g.PCT_ENCODED,S).replace(g.NOT_USERINFO,U).replace(g.PCT_ENCODED,n)),y.host!==void 0&&(y.host=String(y.host).replace(g.PCT_ENCODED,S).toLowerCase().replace(g.NOT_HOST,U).replace(g.PCT_ENCODED,n)),y.path!==void 0&&(y.path=String(y.path).replace(g.PCT_ENCODED,S).replace(y.scheme?g.NOT_PATH:g.NOT_PATH_NOSCHEME,U).replace(g.PCT_ENCODED,n)),y.query!==void 0&&(y.query=String(y.query).replace(g.PCT_ENCODED,S).replace(g.NOT_QUERY,U).replace(g.PCT_ENCODED,n)),y.fragment!==void 0&&(y.fragment=String(y.fragment).replace(g.PCT_ENCODED,S).replace(g.NOT_FRAGMENT,U).replace(g.PCT_ENCODED,n)),y}function ue(y){return y.replace(/^0*(.*)/,"$1")||"0"}function W(y,g){var S=y.match(g.IPV4ADDRESS)||[],D=m(S,2),L=D[1];return L?L.split(".").map(ue).join("."):y}function Q(y,g){var S=y.match(g.IPV6ADDRESS)||[],D=m(S,3),L=D[1],K=D[2];if(L){for(var ne=L.toLowerCase().split("::").reverse(),ge=m(ne,2),pe=ge[0],Ae=ge[1],ve=Ae?Ae.split(":").map(ue):[],Re=pe.split(":").map(ue),ye=g.IPV4ADDRESS.test(Re[Re.length-1]),Te=ye?7:8,de=Re.length-Te,Xe=Array(Te),Ne=0;Ne1){var Fe=Xe.slice(0,Me.index),it=Xe.slice(Me.index+Me.length);st=Fe.join(":")+"::"+it.join(":")}else st=Xe.join(":");return K&&(st+="%"+K),st}else return y}var ie=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ie="".match(/(){0}/)[1]===void 0;function he(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S={},D=g.iri!==!1?p:u;g.reference==="suffix"&&(y=(g.scheme?g.scheme+":":"")+"//"+y);var L=y.match(ie);if(L){Ie?(S.scheme=L[1],S.userinfo=L[3],S.host=L[4],S.port=parseInt(L[5],10),S.path=L[6]||"",S.query=L[7],S.fragment=L[8],isNaN(S.port)&&(S.port=L[5])):(S.scheme=L[1]||void 0,S.userinfo=y.indexOf("@")!==-1?L[3]:void 0,S.host=y.indexOf("//")!==-1?L[4]:void 0,S.port=parseInt(L[5],10),S.path=L[6]||"",S.query=y.indexOf("?")!==-1?L[7]:void 0,S.fragment=y.indexOf("#")!==-1?L[8]:void 0,isNaN(S.port)&&(S.port=y.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?L[4]:void 0)),S.host&&(S.host=Q(W(S.host,D),D)),S.scheme===void 0&&S.userinfo===void 0&&S.host===void 0&&S.port===void 0&&!S.path&&S.query===void 0?S.reference="same-document":S.scheme===void 0?S.reference="relative":S.fragment===void 0?S.reference="absolute":S.reference="uri",g.reference&&g.reference!=="suffix"&&g.reference!==S.reference&&(S.error=S.error||"URI is not a "+g.reference+" reference.");var K=Oe[(g.scheme||S.scheme||"").toLowerCase()];if(!g.unicodeSupport&&(!K||!K.unicodeSupport)){if(S.host&&(g.domainHost||K&&K.domainHost))try{S.host=xe.toASCII(S.host.replace(D.PCT_ENCODED,Z).toLowerCase())}catch(ne){S.error=S.error||"Host's domain name can not be converted to ASCII via punycode: "+ne}ee(S,u)}else ee(S,D);K&&K.parse&&K.parse(S,g)}else S.error=S.error||"URI can not be parsed.";return S}function Ze(y,g){var S=g.iri!==!1?p:u,D=[];return y.userinfo!==void 0&&(D.push(y.userinfo),D.push("@")),y.host!==void 0&&D.push(Q(W(String(y.host),S),S).replace(S.IPV6ADDRESS,function(L,K,ne){return"["+K+(ne?"%25"+ne:"")+"]"})),(typeof y.port=="number"||typeof y.port=="string")&&(D.push(":"),D.push(String(y.port))),D.length?D.join(""):void 0}var We=/^\.\.?\//,Ee=/^\/\.(\/|$)/,Ye=/^\/\.\.(\/|$)/,Ue=/^\/?(?:.|\n)*?(?=\/|$)/;function Qe(y){for(var g=[];y.length;)if(y.match(We))y=y.replace(We,"");else if(y.match(Ee))y=y.replace(Ee,"/");else if(y.match(Ye))y=y.replace(Ye,"/"),g.pop();else if(y==="."||y==="..")y="";else{var S=y.match(Ue);if(S){var D=S[0];y=y.slice(D.length),g.push(D)}else throw new Error("Unexpected dot segment condition")}return g.join("")}function Ve(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=g.iri?p:u,D=[],L=Oe[(g.scheme||y.scheme||"").toLowerCase()];if(L&&L.serialize&&L.serialize(y,g),y.host&&!S.IPV6ADDRESS.test(y.host)){if(g.domainHost||L&&L.domainHost)try{y.host=g.iri?xe.toUnicode(y.host):xe.toASCII(y.host.replace(S.PCT_ENCODED,Z).toLowerCase())}catch(ge){y.error=y.error||"Host's domain name can not be converted to "+(g.iri?"Unicode":"ASCII")+" via punycode: "+ge}}ee(y,S),g.reference!=="suffix"&&y.scheme&&(D.push(y.scheme),D.push(":"));var K=Ze(y,g);if(K!==void 0&&(g.reference!=="suffix"&&D.push("//"),D.push(K),y.path&&y.path.charAt(0)!=="/"&&D.push("/")),y.path!==void 0){var ne=y.path;!g.absolutePath&&(!L||!L.absolutePath)&&(ne=Qe(ne)),K===void 0&&(ne=ne.replace(/^\/\//,"/%2F")),D.push(ne)}return y.query!==void 0&&(D.push("?"),D.push(y.query)),y.fragment!==void 0&&(D.push("#"),D.push(y.fragment)),D.join("")}function Ke(y,g){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=arguments[3],L={};return D||(y=he(Ve(y,S),S),g=he(Ve(g,S),S)),S=S||{},!S.tolerant&&g.scheme?(L.scheme=g.scheme,L.userinfo=g.userinfo,L.host=g.host,L.port=g.port,L.path=Qe(g.path||""),L.query=g.query):(g.userinfo!==void 0||g.host!==void 0||g.port!==void 0?(L.userinfo=g.userinfo,L.host=g.host,L.port=g.port,L.path=Qe(g.path||""),L.query=g.query):(g.path?(g.path.charAt(0)==="/"?L.path=Qe(g.path):((y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)&&!y.path?L.path="/"+g.path:y.path?L.path=y.path.slice(0,y.path.lastIndexOf("/")+1)+g.path:L.path=g.path,L.path=Qe(L.path)),L.query=g.query):(L.path=y.path,g.query!==void 0?L.query=g.query:L.query=y.query),L.userinfo=y.userinfo,L.host=y.host,L.port=y.port),L.scheme=y.scheme),L.fragment=g.fragment,L}function bt(y,g,S){var D=l({scheme:"null"},S);return Ve(Ke(he(y,D),he(g,D),D,!0),D)}function xt(y,g){return typeof y=="string"?y=Ve(he(y,g),g):i(y)==="object"&&(y=he(Ve(y,g),g)),y}function wt(y,g,S){return typeof y=="string"?y=Ve(he(y,S),S):i(y)==="object"&&(y=Ve(y,S)),typeof g=="string"?g=Ve(he(g,S),S):i(g)==="object"&&(g=Ve(g,S)),y===g}function Br(y,g){return y&&y.toString().replace(!g||!g.iri?u.ESCAPE:p.ESCAPE,U)}function Ct(y,g){return y&&y.toString().replace(!g||!g.iri?u.PCT_ENCODED:p.PCT_ENCODED,Z)}var ia={scheme:"http",domainHost:!0,parse:function(g,S){return g.host||(g.error=g.error||"HTTP URIs must have a host."),g},serialize:function(g,S){var D=String(g.scheme).toLowerCase()==="https";return(g.port===(D?443:80)||g.port==="")&&(g.port=void 0),g.path||(g.path="/"),g}},oa={scheme:"https",domainHost:ia.domainHost,parse:ia.parse,serialize:ia.serialize};function Nn(y){return typeof y.secure=="boolean"?y.secure:String(y.scheme).toLowerCase()==="wss"}var Ia={scheme:"ws",domainHost:!0,parse:function(g,S){var D=g;return D.secure=Nn(D),D.resourceName=(D.path||"/")+(D.query?"?"+D.query:""),D.path=void 0,D.query=void 0,D},serialize:function(g,S){if((g.port===(Nn(g)?443:80)||g.port==="")&&(g.port=void 0),typeof g.secure=="boolean"&&(g.scheme=g.secure?"wss":"ws",g.secure=void 0),g.resourceName){var D=g.resourceName.split("?"),L=m(D,2),K=L[0],ne=L[1];g.path=K&&K!=="/"?K:void 0,g.query=ne,g.resourceName=void 0}return g.fragment=void 0,g}},qi={scheme:"wss",domainHost:Ia.domainHost,parse:Ia.parse,serialize:Ia.serialize},Mi={},Jt=!0,Fi="[A-Za-z0-9\\-\\.\\_\\~"+(Jt?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Yt="[0-9A-Fa-f]",ol=s(s("%[EFef]"+Yt+"%"+Yt+Yt+"%"+Yt+Yt)+"|"+s("%[89A-Fa-f]"+Yt+"%"+Yt+Yt)+"|"+s("%"+Yt+Yt)),cl="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ll="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ul=t(ll,'[\\"\\\\]'),ca="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",pl=new RegExp(Fi,"g"),Vr=new RegExp(ol,"g"),dl=new RegExp(t("[^]",cl,"[\\.]",'[\\"]',ul),"g"),js=new RegExp(t("[^]",Fi,ca),"g"),Li=js;function Dn(y){var g=Z(y);return g.match(pl)?g:y}var $n={scheme:"mailto",parse:function(g,S){var D=g,L=D.to=D.path?D.path.split(","):[];if(D.path=void 0,D.query){for(var K=!1,ne={},ge=D.query.split("&"),pe=0,Ae=ge.length;pe{e.exports=function r(t,s){if(t===s)return!0;if(t&&s&&typeof t=="object"&&typeof s=="object"){if(t.constructor!==s.constructor)return!1;var i,n,o;if(Array.isArray(t)){if(i=t.length,i!=s.length)return!1;for(n=i;n--!==0;)if(!r(t[n],s[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(s).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(s,o[n]))return!1;for(n=i;n--!==0;){var l=o[n];if(!r(t[l],s[l]))return!1}return!0}return t!==t&&s!==s}}),kj=Ce((a,e)=>{e.exports=function(t){for(var s=0,i=t.length,n=0,o;n=55296&&o<=56319&&n{e.exports={copy:r,checkDataType:t,checkDataTypes:s,coerceToTypes:n,toHash:o,getProperty:u,escapeQuotes:p,equal:Id(),ucs2length:kj(),varOccurences:m,varReplace:f,schemaHasRules:h,schemaHasRulesExcept:d,schemaUnknownRules:v,toQuotedString:x,getPathExpr:b,getPath:E,getData:P,unescapeFragment:$,unescapeJsonPointer:q,escapeFragment:A,escapeJsonPointer:F};function r(C,R){R=R||{};for(var j in C)R[j]=C[j];return R}function t(C,R,j,z){var B=z?" !== ":" === ",G=z?" || ":" && ",te=z?"!":"",X=z?"":"!";switch(C){case"null":return R+B+"null";case"array":return te+"Array.isArray("+R+")";case"object":return"("+te+R+G+"typeof "+R+B+'"object"'+G+X+"Array.isArray("+R+"))";case"integer":return"(typeof "+R+B+'"number"'+G+X+"("+R+" % 1)"+G+R+B+R+(j?G+te+"isFinite("+R+")":"")+")";case"number":return"(typeof "+R+B+'"'+C+'"'+(j?G+te+"isFinite("+R+")":"")+")";default:return"typeof "+R+B+'"'+C+'"'}}function s(C,R,j){switch(C.length){case 1:return t(C[0],R,j,!0);default:var z="",B=o(C);B.array&&B.object&&(z=B.null?"(":"(!"+R+" || ",z+="typeof "+R+' !== "object")',delete B.null,delete B.array,delete B.object),B.number&&delete B.integer;for(var G in B)z+=(z?" && ":"")+t(G,R,j,!0);return z}}var i=o(["string","number","integer","boolean","null"]);function n(C,R){if(Array.isArray(R)){for(var j=[],z=0;z=R)throw new Error("Cannot access property/index "+z+" levels up, current level is "+R);return j[R-z]}if(z>R)throw new Error("Cannot access data "+z+" levels up, current level is "+R);if(G="data"+(R-z||""),!B)return G}for(var X=G,V=B.split("/"),re=0;re{var r=Cn();e.exports=t;function t(s){r.copy(s,this)}}),Oj=Ce((a,e)=>{var r=e.exports=function(i,n,o){typeof n=="function"&&(o=n,n={}),o=n.cb||o;var l=typeof o=="function"?o:o.pre||function(){},c=o.post||function(){};t(n,l,c,i,"",i)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(i,n,o,l,c,u,p,m,f,h){if(l&&typeof l=="object"&&!Array.isArray(l)){n(l,c,u,p,m,f,h);for(var d in l){var v=l[d];if(Array.isArray(v)){if(d in r.arrayKeywords)for(var x=0;x{var r=Tj(),t=Id(),s=Cn(),i=JE(),n=Oj();e.exports=o,o.normalizeId=E,o.fullPath=v,o.url=k,o.ids=O,o.inlineRef=f,o.schema=l;function o(P,I,$){var A=this._refs[$];if(typeof A=="string")if(this._refs[A])A=this._refs[A];else return o.call(this,P,I,A);if(A=A||this._schemas[$],A instanceof i)return f(A.schema,this._opts.inlineRefs)?A.schema:A.validate||this._compile(A);var F=l.call(this,I,$),q,C,R;return F&&(q=F.schema,I=F.root,R=F.baseId),q instanceof i?C=q.validate||P.call(this,q.schema,I,void 0,R):q!==void 0&&(C=f(q,this._opts.inlineRefs)?q:P.call(this,q,I,void 0,R)),C}function l(P,I){var $=r.parse(I),A=x($),F=v(this._getId(P.schema));if(Object.keys(P.schema).length===0||A!==F){var q=E(A),C=this._refs[q];if(typeof C=="string")return c.call(this,P,C,$);if(C instanceof i)C.validate||this._compile(C),P=C;else if(C=this._schemas[q],C instanceof i){if(C.validate||this._compile(C),q==E(I))return{schema:C,root:P,baseId:F};P=C}else return;if(!P.schema)return;F=v(this._getId(P.schema))}return p.call(this,$,F,P.schema,P)}function c(P,I,$){var A=l.call(this,P,I);if(A){var F=A.schema,q=A.baseId;P=A.root;var C=this._getId(F);return C&&(q=k(q,C)),p.call(this,$,q,F,P)}}var u=s.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function p(P,I,$,A){if(P.fragment=P.fragment||"",P.fragment.slice(0,1)=="/"){for(var F=P.fragment.split("/"),q=1;q{var r=Ad();e.exports={Validation:i(t),MissingRef:i(s)};function t(n){this.message="validation failed",this.errors=n,this.ajv=this.validation=!0}s.message=function(n,o){return"can't resolve reference "+o+" from id "+n};function s(n,o,l){this.message=l||s.message(n,o),this.missingRef=r.url(n,o),this.missingSchema=r.normalizeId(r.fullPath(this.missingRef))}function i(n){return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}}),YE=Ce((a,e)=>{e.exports=function(r,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var s=typeof t.cycles=="boolean"?t.cycles:!1,i=t.cmp&&(function(o){return function(l){return function(c,u){var p={key:c,value:l[c]},m={key:u,value:l[u]};return o(p,m)}}})(t.cmp),n=[];return(function o(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var c,u;if(Array.isArray(l)){for(u="[",c=0;c{e.exports=function(t,s,i){var n="",o=t.schema.$async===!0,l=t.util.schemaHasRulesExcept(t.schema,t.RULES.all,"$ref"),c=t.self._getId(t.schema);if(t.opts.strictKeywords){var u=t.util.schemaUnknownRules(t.schema,t.RULES.keywords);if(u){var p="unknown keyword: "+u;if(t.opts.strictKeywords==="log")t.logger.warn(p);else throw new Error(p)}}if(t.isTop&&(n+=" var validate = ",o&&(t.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",c&&(t.opts.sourceCode||t.opts.processCode)&&(n+=" "+("/*# sourceURL="+c+" */")+" ")),typeof t.schema=="boolean"||!(l||t.schema.$ref)){var s="false schema",m=t.level,f=t.dataLevel,h=t.schema[s],d=t.schemaPath+t.util.getProperty(s),v=t.errSchemaPath+"/"+s,I=!t.opts.allErrors,F,x="data"+(f||""),P="valid"+m;if(t.schema===!1){t.isTop?I=!0:n+=" var "+P+" = false; ";var b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(F||"false schema")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(v)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'boolean schema is false' "),t.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+x+" "),n+=" } "):n+=" {} ";var E=n;n=b.pop(),!t.compositeRule&&I?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t.isTop?o?n+=" return data; ":n+=" validate.errors = null; return true; ":n+=" var "+P+" = true; ";return t.isTop&&(n+=" }; return validate; "),n}if(t.isTop){var k=t.isTop,m=t.level=0,f=t.dataLevel=0,x="data";if(t.rootId=t.resolve.fullPath(t.self._getId(t.root.schema)),t.baseId=t.baseId||t.rootId,delete t.isTop,t.dataPathArr=[""],t.schema.default!==void 0&&t.opts.useDefaults&&t.opts.strictDefaults){var O="default is ignored in the schema root";if(t.opts.strictDefaults==="log")t.logger.warn(O);else throw new Error(O)}n+=" var vErrors = null; ",n+=" var errors = 0; ",n+=" if (rootData === undefined) rootData = data; "}else{var{level:m,dataLevel:f}=t,x="data"+(f||"");if(c&&(t.baseId=t.resolve.url(t.baseId,c)),o&&!t.async)throw new Error("async schema in sync schema");n+=" var errs_"+m+" = errors;"}var P="valid"+m,I=!t.opts.allErrors,$="",A="",F,q=t.schema.type,C=Array.isArray(q);if(q&&t.opts.nullable&&t.schema.nullable===!0&&(C?q.indexOf("null")==-1&&(q=q.concat("null")):q!="null"&&(q=[q,"null"],C=!0)),C&&q.length==1&&(q=q[0],C=!1),t.schema.$ref&&l){if(t.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+t.errSchemaPath+'" (see option extendRefs)');t.opts.extendRefs!==!0&&(l=!1,t.logger.warn('$ref: keywords ignored in schema at path "'+t.errSchemaPath+'"'))}if(t.schema.$comment&&t.opts.$comment&&(n+=" "+t.RULES.all.$comment.code(t,"$comment")),q){if(t.opts.coerceTypes)var R=t.util.coerceToTypes(t.opts.coerceTypes,q);var j=t.RULES.types[q];if(R||C||j===!0||j&&!Ue(j)){var d=t.schemaPath+".type",v=t.errSchemaPath+"/type",d=t.schemaPath+".type",v=t.errSchemaPath+"/type",z=C?"checkDataTypes":"checkDataType";if(n+=" if ("+t.util[z](q,x,t.opts.strictNumbers,!0)+") { ",R){var B="dataType"+m,G="coerced"+m;n+=" var "+B+" = typeof "+x+"; var "+G+" = undefined; ",t.opts.coerceTypes=="array"&&(n+=" if ("+B+" == 'object' && Array.isArray("+x+") && "+x+".length == 1) { "+x+" = "+x+"[0]; "+B+" = typeof "+x+"; if ("+t.util.checkDataType(t.schema.type,x,t.opts.strictNumbers)+") "+G+" = "+x+"; } "),n+=" if ("+G+" !== undefined) ; ";var te=R;if(te)for(var X,V=-1,re=te.length-1;V{var r=Ad(),t=Cn(),s=jd(),i=YE(),n=e1(),o=t.ucs2length,l=Id(),c=s.Validation;e.exports=u;function u(E,k,O,P){var I=this,$=this._opts,A=[void 0],F={},q=[],C={},R=[],j={},z=[];k=k||{schema:E,refVal:A,refs:F};var B=p.call(this,E,k,P),G=this._compilations[B.index];if(B.compiling)return G.callValidate=ce;var te=this._formats,X=this.RULES;try{var V=Be(E,k,O,P);G.validate=V;var re=G.callValidate;return re&&(re.schema=V.schema,re.errors=null,re.refs=V.refs,re.refVal=V.refVal,re.root=V.root,re.$async=V.$async,$.sourceCode&&(re.source=V.source)),V}finally{m.call(this,E,k,P)}function ce(){var W=G.validate,Q=W.apply(this,arguments);return ce.errors=W.errors,Q}function Be(W,Q,ie,Ie){var he=!Q||Q&&Q.schema==W;if(Q.schema!=k.schema)return u.call(I,W,Q,ie,Ie);var Ze=W.$async===!0,We=n({isTop:!0,schema:W,isRoot:he,baseId:Ie,root:Q,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:s.MissingRef,RULES:X,validate:n,util:t,resolve:r,resolveRef:be,usePattern:Z,useDefault:ee,useCustomRule:ue,opts:$,formats:te,logger:I.logger,self:I});We=b(A,v)+b(q,h)+b(R,d)+b(z,x)+We,$.processCode&&(We=$.processCode(We,W));var Ee;try{var Ye=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",We);Ee=Ye(I,X,te,k,A,R,z,l,o,c),A[0]=Ee}catch(Ue){throw I.logger.error("Error compiling schema, function code:",We),Ue}return Ee.schema=W,Ee.errors=null,Ee.refs=F,Ee.refVal=A,Ee.root=he?Ee:Q,Ze&&(Ee.$async=!0),$.sourceCode===!0&&(Ee.source={code:We,patterns:q,defaults:R}),Ee}function be(W,Q,ie){Q=r.url(W,Q);var Ie=F[Q],he,Ze;if(Ie!==void 0)return he=A[Ie],Ze="refVal["+Ie+"]",U(he,Ze);if(!ie&&k.refs){var We=k.refs[Q];if(We!==void 0)return he=k.refVal[We],Ze=qe(Q,he),U(he,Ze)}Ze=qe(Q);var Ee=r.call(I,Be,k,Q);if(Ee===void 0){var Ye=O&&O[Q];Ye&&(Ee=r.inlineRef(Ye,$.inlineRefs)?Ye:u.call(I,Ye,k,O,W))}if(Ee===void 0)xe(Q);else return Oe(Q,Ee),U(Ee,Ze)}function qe(W,Q){var ie=A.length;return A[ie]=Q,F[W]=ie,"refVal"+ie}function xe(W){delete F[W]}function Oe(W,Q){var ie=F[W];A[ie]=Q}function U(W,Q){return typeof W=="object"||typeof W=="boolean"?{code:Q,schema:W,inline:!0}:{code:Q,$async:W&&!!W.$async}}function Z(W){var Q=C[W];return Q===void 0&&(Q=C[W]=q.length,q[Q]=W),"pattern"+Q}function ee(W){switch(typeof W){case"boolean":case"number":return""+W;case"string":return t.toQuotedString(W);case"object":if(W===null)return"null";var Q=i(W),ie=j[Q];return ie===void 0&&(ie=j[Q]=R.length,R[ie]=W),"default"+ie}}function ue(W,Q,ie,Ie){if(I._opts.validateSchema!==!1){var he=W.definition.dependencies;if(he&&!he.every(function(bt){return Object.prototype.hasOwnProperty.call(ie,bt)}))throw new Error("parent schema must have all required keywords: "+he.join(","));var Ze=W.definition.validateSchema;if(Ze){var We=Ze(Q);if(!We){var Ee="keyword schema is invalid: "+I.errorsText(Ze.errors);if(I._opts.validateSchema=="log")I.logger.error(Ee);else throw new Error(Ee)}}}var Ye=W.definition.compile,Ue=W.definition.inline,Qe=W.definition.macro,Ve;if(Ye)Ve=Ye.call(I,Q,ie,Ie);else if(Qe)Ve=Qe.call(I,Q,ie,Ie),$.validateSchema!==!1&&I.validateSchema(Ve,!0);else if(Ue)Ve=Ue.call(I,Ie,W.keyword,Q,ie);else if(Ve=W.definition.validate,!Ve)return;if(Ve===void 0)throw new Error('custom keyword "'+W.keyword+'"failed to compile');var Ke=z.length;return z[Ke]=Ve,{code:"customRule"+Ke,validate:Ve}}}function p(E,k,O){var P=f.call(this,E,k,O);return P>=0?{index:P,compiling:!0}:(P=this._compilations.length,this._compilations[P]={schema:E,root:k,baseId:O},{index:P,compiling:!1})}function m(E,k,O){var P=f.call(this,E,k,O);P>=0&&this._compilations.splice(P,1)}function f(E,k,O){for(var P=0;P{var r=e.exports=function(){this._cache={}};r.prototype.put=function(s,i){this._cache[s]=i},r.prototype.get=function(s){return this._cache[s]},r.prototype.del=function(s){delete this._cache[s]},r.prototype.clear=function(){this._cache={}}}),Aj=Ce((a,e)=>{var r=Cn(),t=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31],i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,n=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,o=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,m=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,h=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;e.exports=d;function d(A){return A=A=="full"?"full":"fast",r.copy(d[A])}d.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:$,uuid:p,"json-pointer":m,"json-pointer-uri-fragment":f,"relative-json-pointer":h},d.full={date:x,time:b,"date-time":k,uri:P,"uri-reference":l,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:$,uuid:p,"json-pointer":m,"json-pointer-uri-fragment":f,"relative-json-pointer":h};function v(A){return A%4===0&&(A%100!==0||A%400===0)}function x(A){var F=A.match(t);if(!F)return!1;var q=+F[1],C=+F[2],R=+F[3];return C>=1&&C<=12&&R>=1&&R<=(C==2&&v(q)?29:s[C])}function b(A,F){var q=A.match(i);if(!q)return!1;var C=q[1],R=q[2],j=q[3],z=q[5];return(C<=23&&R<=59&&j<=59||C==23&&R==59&&j==60)&&(!F||z)}var E=/t|\s/i;function k(A){var F=A.split(E);return F.length==2&&x(F[0])&&b(F[1],!0)}var O=/\/|:/;function P(A){return O.test(A)&&o.test(A)}var I=/[^\\]\\Z/;function $(A){if(I.test(A))return!1;try{return new RegExp(A),!0}catch{return!1}}}),jj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.errSchemaPath+"/"+s,p=!t.opts.allErrors,m="data"+(l||""),f="valid"+o,h,d;if(c=="#"||c=="#/")t.isRoot?(h=t.async,d="validate"):(h=t.root.schema.$async===!0,d="root.refVal[0]");else{var v=t.resolveRef(t.baseId,c,t.isRoot);if(v===void 0){var x=t.MissingRefError.message(t.baseId,c);if(t.opts.missingRefs=="fail"){t.logger.error(x);var b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { ref: '"+t.util.escapeQuotes(c)+"' } ",t.opts.messages!==!1&&(n+=" , message: 'can\\'t resolve reference "+t.util.escapeQuotes(c)+"' "),t.opts.verbose&&(n+=" , schema: "+t.util.toQuotedString(c)+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";var E=n;n=b.pop(),!t.compositeRule&&p?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(n+=" if (false) { ")}else if(t.opts.missingRefs=="ignore")t.logger.warn(x),p&&(n+=" if (true) { ");else throw new t.MissingRefError(t.baseId,c,x)}else if(v.inline){var k=t.util.copy(t);k.level++;var O="valid"+k.level;k.schema=v.schema,k.schemaPath="",k.errSchemaPath=c;var P=t.validate(k).replace(/validate\.schema/g,v.code);n+=" "+P+" ",p&&(n+=" if ("+O+") { ")}else h=v.$async===!0||t.async&&v.$async!==!1,d=v.code}if(d){var b=b||[];b.push(n),n="",t.opts.passContext?n+=" "+d+".call(this, ":n+=" "+d+"( ",n+=" "+m+", (dataPath || '')",t.errorPath!='""'&&(n+=" + "+t.errorPath);var I=l?"data"+(l-1||""):"parentData",$=l?t.dataPathArr[l]:"parentDataProperty";n+=" , "+I+" , "+$+", rootData) ";var A=n;if(n=b.pop(),h){if(!t.async)throw new Error("async schema referenced by sync schema");p&&(n+=" var "+f+"; "),n+=" try { await "+A+"; ",p&&(n+=" "+f+" = true; "),n+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",p&&(n+=" "+f+" = false; "),n+=" } ",p&&(n+=" if ("+f+") { ")}else n+=" if (!"+A+") { if (vErrors === null) vErrors = "+d+".errors; else vErrors = vErrors.concat("+d+".errors); errors = vErrors.length; } ",p&&(n+=" else { ")}return n}}),Nj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.schema[s],l=t.schemaPath+t.util.getProperty(s),c=t.errSchemaPath+"/"+s,u=!t.opts.allErrors,p=t.util.copy(t),m="";p.level++;var f="valid"+p.level,h=p.baseId,d=!0,v=o;if(v)for(var x,b=-1,E=v.length-1;b0||x===!1:t.util.schemaHasRules(x,t.RULES.all))&&(d=!1,p.schema=x,p.schemaPath=l+"["+b+"]",p.errSchemaPath=c+"/"+b,n+=" "+t.validate(p)+" ",p.baseId=h,u&&(n+=" if ("+f+") { ",m+="}"));return u&&(d?n+=" if (true) { ":n+=" "+m.slice(0,-1)+" "),n}}),Dj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E=c.every(function(F){return t.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:t.util.schemaHasRules(F,t.RULES.all)});if(E){var k=v.baseId;n+=" var "+d+" = errors; var "+h+" = false; ";var O=t.compositeRule;t.compositeRule=v.compositeRule=!0;var P=c;if(P)for(var I,$=-1,A=P.length-1;${e.exports=function(t,s,i){var n=" ",o=t.schema[s],l=t.errSchemaPath+"/"+s,c=!t.opts.allErrors,u=t.util.toQuotedString(o);return t.opts.$comment===!0?n+=" console.log("+u+");":typeof t.opts.$comment=="function"&&(n+=" self._opts.$comment("+u+", "+t.util.toQuotedString(l)+", validate.root.schema);"),n}}),qj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c,d||(n+=" var schema"+o+" = validate.schema"+u+";"),n+="var "+h+" = equal("+f+", schema"+o+"); if (!"+h+") { ";var x=x||[];x.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { allowedValue: schema"+o+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be equal to constant' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var b=n;return n=x.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",m&&(n+=" else { "),n}}),Mj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E="i"+o,k=v.dataLevel=t.dataLevel+1,O="data"+k,P=t.baseId,I=t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all);if(n+="var "+d+" = errors;var "+h+";",I){var $=t.compositeRule;t.compositeRule=v.compositeRule=!0,v.schema=c,v.schemaPath=u,v.errSchemaPath=p,n+=" var "+b+" = false; for (var "+E+" = 0; "+E+" < "+f+".length; "+E+"++) { ",v.errorPath=t.util.getPathExpr(t.errorPath,E,t.opts.jsonPointers,!0);var A=f+"["+E+"]";v.dataPathArr[k]=E;var F=t.validate(v);v.baseId=P,t.util.varOccurences(F,O)<2?n+=" "+t.util.varReplace(F,O,A)+" ":n+=" var "+O+" = "+A+"; "+F+" ",n+=" if ("+b+") break; } ",t.compositeRule=v.compositeRule=$,n+=" "+x+" if (!"+b+") {"}else n+=" if ("+f+".length == 0) {";var q=q||[];q.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'should contain a valid item' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var C=n;return n=q.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+C+"]); ":n+=" validate.errors = ["+C+"]; return false; ":n+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",I&&(n+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),t.opts.allErrors&&(n+=" } "),n}}),Fj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t),v="";d.level++;var x="valid"+d.level,b={},E={},k=t.opts.ownProperties;for($ in c)if($!="__proto__"){var O=c[$],P=Array.isArray(O)?E:b;P[$]=O}n+="var "+h+" = errors;";var I=t.errorPath;n+="var missing"+o+";";for(var $ in E)if(P=E[$],P.length){if(n+=" if ( "+f+t.util.getProperty($)+" !== undefined ",k&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes($)+"') "),m){n+=" && ( ";var A=P;if(A)for(var F,q=-1,C=A.length-1;q0||O===!1:t.util.schemaHasRules(O,t.RULES.all))&&(n+=" "+x+" = true; if ( "+f+t.util.getProperty($)+" !== undefined ",k&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes($)+"') "),n+=") { ",d.schema=O,d.schemaPath=u+t.util.getProperty($),d.errSchemaPath=p+"/"+t.util.escapeFragment($),n+=" "+t.validate(d)+" ",d.baseId=ce,n+=" } ",m&&(n+=" if ("+x+") { ",v+="}"))}return m&&(n+=" "+v+" if ("+h+" == errors) {"),n}}),Lj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c;var x="i"+o,b="schema"+o;d||(n+=" var "+b+" = validate.schema"+u+";"),n+="var "+h+";",d&&(n+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),n+=""+h+" = false;for (var "+x+"=0; "+x+"<"+b+".length; "+x+"++) if (equal("+f+", "+b+"["+x+"])) { "+h+" = true; break; }",d&&(n+=" } "),n+=" if (!"+h+") { ";var E=E||[];E.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { allowedValues: schema"+o+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be equal to one of the allowed values' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var k=n;return n=E.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+k+"]); ":n+=" validate.errors = ["+k+"]; return false; ":n+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",m&&(n+=" else { "),n}}),Uj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||"");if(t.opts.format===!1)return m&&(n+=" if (true) { "),n;var h=t.opts.$data&&c&&c.$data,d;h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c;var v=t.opts.unknownFormats,x=Array.isArray(v);if(h){var b="format"+o,E="isObject"+o,k="formatType"+o;n+=" var "+b+" = formats["+d+"]; var "+E+" = typeof "+b+" == 'object' && !("+b+" instanceof RegExp) && "+b+".validate; var "+k+" = "+E+" && "+b+".type || 'string'; if ("+E+") { ",t.async&&(n+=" var async"+o+" = "+b+".async; "),n+=" "+b+" = "+b+".validate; } if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),n+=" (",v!="ignore"&&(n+=" ("+d+" && !"+b+" ",x&&(n+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),n+=") || "),n+=" ("+b+" && "+k+" == '"+i+"' && !(typeof "+b+" == 'function' ? ",t.async?n+=" (async"+o+" ? await "+b+"("+f+") : "+b+"("+f+")) ":n+=" "+b+"("+f+") ",n+=" : "+b+".test("+f+"))))) {"}else{var b=t.formats[c];if(!b){if(v=="ignore")return t.logger.warn('unknown format "'+c+'" ignored in schema at path "'+t.errSchemaPath+'"'),m&&(n+=" if (true) { "),n;if(x&&v.indexOf(c)>=0)return m&&(n+=" if (true) { "),n;throw new Error('unknown format "'+c+'" is used in schema at path "'+t.errSchemaPath+'"')}var E=typeof b=="object"&&!(b instanceof RegExp)&&b.validate,k=E&&b.type||"string";if(E){var O=b.async===!0;b=b.validate}if(k!=i)return m&&(n+=" if (true) { "),n;if(O){if(!t.async)throw new Error("async format in sync schema");var P="formats"+t.util.getProperty(c)+".validate";n+=" if (!(await "+P+"("+f+"))) { "}else{n+=" if (! ";var P="formats"+t.util.getProperty(c);E&&(P+=".validate"),typeof b=="function"?n+=" "+P+"("+f+") ":n+=" "+P+".test("+f+") ",n+=") { "}}var I=I||[];I.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { format: ",h?n+=""+d:n+=""+t.util.toQuotedString(c),n+=" } ",t.opts.messages!==!1&&(n+=` , message: 'should match format "`,h?n+="' + "+d+" + '":n+=""+t.util.escapeQuotes(c),n+=`"' `),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+t.util.toQuotedString(c),n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var $=n;return n=I.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+$+"]); ":n+=" validate.errors = ["+$+"]; return false; ":n+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",m&&(n+=" else { "),n}}),zj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t);v.level++;var x="valid"+v.level,b=t.schema.then,E=t.schema.else,k=b!==void 0&&(t.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:t.util.schemaHasRules(b,t.RULES.all)),O=E!==void 0&&(t.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:t.util.schemaHasRules(E,t.RULES.all)),P=v.baseId;if(k||O){var I;v.createErrors=!1,v.schema=c,v.schemaPath=u,v.errSchemaPath=p,n+=" var "+d+" = errors; var "+h+" = true; ";var $=t.compositeRule;t.compositeRule=v.compositeRule=!0,n+=" "+t.validate(v)+" ",v.baseId=P,v.createErrors=!0,n+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",t.compositeRule=v.compositeRule=$,k?(n+=" if ("+x+") { ",v.schema=t.schema.then,v.schemaPath=t.schemaPath+".then",v.errSchemaPath=t.errSchemaPath+"/then",n+=" "+t.validate(v)+" ",v.baseId=P,n+=" "+h+" = "+x+"; ",k&&O?(I="ifClause"+o,n+=" var "+I+" = 'then'; "):I="'then'",n+=" } ",O&&(n+=" else { ")):n+=" if (!"+x+") { ",O&&(v.schema=t.schema.else,v.schemaPath=t.schemaPath+".else",v.errSchemaPath=t.errSchemaPath+"/else",n+=" "+t.validate(v)+" ",v.baseId=P,n+=" "+h+" = "+x+"; ",k&&O?(I="ifClause"+o,n+=" var "+I+" = 'else'; "):I="'else'",n+=" } "),n+=" if (!"+h+") { var err = ",t.createErrors!==!1?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { failingKeyword: "+I+" } ",t.opts.messages!==!1&&(n+=` , message: 'should match "' + `+I+` + '" schema' `),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&m&&(t.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",m&&(n+=" else { ")}else m&&(n+=" if (true) { ");return n}}),Hj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E="i"+o,k=v.dataLevel=t.dataLevel+1,O="data"+k,P=t.baseId;if(n+="var "+d+" = errors;var "+h+";",Array.isArray(c)){var I=t.schema.additionalItems;if(I===!1){n+=" "+h+" = "+f+".length <= "+c.length+"; ";var $=p;p=t.errSchemaPath+"/additionalItems",n+=" if (!"+h+") { ";var A=A||[];A.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+c.length+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have more than "+c.length+" items' "),t.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var F=n;n=A.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+F+"]); ":n+=" validate.errors = ["+F+"]; return false; ":n+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",p=$,m&&(x+="}",n+=" else { ")}var q=c;if(q){for(var C,R=-1,j=q.length-1;R0||C===!1:t.util.schemaHasRules(C,t.RULES.all)){n+=" "+b+" = true; if ("+f+".length > "+R+") { ";var z=f+"["+R+"]";v.schema=C,v.schemaPath=u+"["+R+"]",v.errSchemaPath=p+"/"+R,v.errorPath=t.util.getPathExpr(t.errorPath,R,t.opts.jsonPointers,!0),v.dataPathArr[k]=R;var B=t.validate(v);v.baseId=P,t.util.varOccurences(B,O)<2?n+=" "+t.util.varReplace(B,O,z)+" ":n+=" var "+O+" = "+z+"; "+B+" ",n+=" } ",m&&(n+=" if ("+b+") { ",x+="}")}}if(typeof I=="object"&&(t.opts.strictKeywords?typeof I=="object"&&Object.keys(I).length>0||I===!1:t.util.schemaHasRules(I,t.RULES.all))){v.schema=I,v.schemaPath=t.schemaPath+".additionalItems",v.errSchemaPath=t.errSchemaPath+"/additionalItems",n+=" "+b+" = true; if ("+f+".length > "+c.length+") { for (var "+E+" = "+c.length+"; "+E+" < "+f+".length; "+E+"++) { ",v.errorPath=t.util.getPathExpr(t.errorPath,E,t.opts.jsonPointers,!0);var z=f+"["+E+"]";v.dataPathArr[k]=E;var B=t.validate(v);v.baseId=P,t.util.varOccurences(B,O)<2?n+=" "+t.util.varReplace(B,O,z)+" ":n+=" var "+O+" = "+z+"; "+B+" ",m&&(n+=" if (!"+b+") break; "),n+=" } } ",m&&(n+=" if ("+b+") { ",x+="}")}}else if(t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all)){v.schema=c,v.schemaPath=u,v.errSchemaPath=p,n+=" for (var "+E+" = 0; "+E+" < "+f+".length; "+E+"++) { ",v.errorPath=t.util.getPathExpr(t.errorPath,E,t.opts.jsonPointers,!0);var z=f+"["+E+"]";v.dataPathArr[k]=E;var B=t.validate(v);v.baseId=P,t.util.varOccurences(B,O)<2?n+=" "+t.util.varReplace(B,O,z)+" ":n+=" var "+O+" = "+z+"; "+B+" ",m&&(n+=" if (!"+b+") break; "),n+=" }"}return m&&(n+=" "+x+" if ("+d+" == errors) {"),n}}),ME=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,P,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c;var v=s=="maximum",x=v?"exclusiveMaximum":"exclusiveMinimum",b=t.schema[x],E=t.opts.$data&&b&&b.$data,k=v?"<":">",O=v?">":"<",P=void 0;if(!(h||typeof c=="number"||c===void 0))throw new Error(s+" must be number");if(!(E||b===void 0||typeof b=="number"||typeof b=="boolean"))throw new Error(x+" must be number or boolean");if(E){var I=t.util.getData(b.$data,l,t.dataPathArr),$="exclusive"+o,A="exclType"+o,F="exclIsNumber"+o,q="op"+o,C="' + "+q+" + '";n+=" var schemaExcl"+o+" = "+I+"; ",I="schemaExcl"+o,n+=" var "+$+"; var "+A+" = typeof "+I+"; if ("+A+" != 'boolean' && "+A+" != 'undefined' && "+A+" != 'number') { ";var P=x,R=R||[];R.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: '"+x+" should be boolean' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var j=n;n=R.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+j+"]); ":n+=" validate.errors = ["+j+"]; return false; ":n+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" "+A+" == 'number' ? ( ("+$+" = "+d+" === undefined || "+I+" "+k+"= "+d+") ? "+f+" "+O+"= "+I+" : "+f+" "+O+" "+d+" ) : ( ("+$+" = "+I+" === true) ? "+f+" "+O+"= "+d+" : "+f+" "+O+" "+d+" ) || "+f+" !== "+f+") { var op"+o+" = "+$+" ? '"+k+"' : '"+k+"='; ",c===void 0&&(P=x,p=t.errSchemaPath+"/"+x,d=I,h=E)}else{var F=typeof b=="number",C=k;if(F&&h){var q="'"+C+"'";n+=" if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" ( "+d+" === undefined || "+b+" "+k+"= "+d+" ? "+f+" "+O+"= "+b+" : "+f+" "+O+" "+d+" ) || "+f+" !== "+f+") { "}else{F&&c===void 0?($=!0,P=x,p=t.errSchemaPath+"/"+x,d=b,O+="="):(F&&(d=Math[v?"min":"max"](b,c)),b===(F?d:!0)?($=!0,P=x,p=t.errSchemaPath+"/"+x,O+="="):($=!1,C+="="));var q="'"+C+"'";n+=" if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" "+f+" "+O+" "+d+" || "+f+" !== "+f+") { "}}P=P||s;var R=R||[];R.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { comparison: "+q+", limit: "+d+", exclusive: "+$+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be "+C+" ",h?n+="' + "+d:n+=""+d+"'"),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var j=n;return n=R.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+j+"]); ":n+=" validate.errors = ["+j+"]; return false; ":n+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",m&&(n+=" else { "),n}}),FE=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,x,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");var v=s=="maxItems"?">":"<";n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" "+f+".length "+v+" "+d+") { ";var x=s,b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(x||"_limitItems")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have ",s=="maxItems"?n+="more":n+="fewer",n+=" than ",h?n+="' + "+d+" + '":n+=""+c,n+=" items' "),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var E=n;return n=b.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),LE=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,x,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");var v=s=="maxLength"?">":"<";n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),t.opts.unicode===!1?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+v+" "+d+") { ";var x=s,b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(x||"_limitLength")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT be ",s=="maxLength"?n+="longer":n+="shorter",n+=" than ",h?n+="' + "+d+" + '":n+=""+c,n+=" characters' "),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var E=n;return n=b.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),UE=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,x,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");var v=s=="maxProperties"?">":"<";n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" Object.keys("+f+").length "+v+" "+d+") { ";var x=s,b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(x||"_limitProperties")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have ",s=="maxProperties"?n+="more":n+="fewer",n+=" than ",h?n+="' + "+d+" + '":n+=""+c,n+=" properties' "),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var E=n;return n=b.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),Bj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");n+="var division"+o+";if (",h&&(n+=" "+d+" !== undefined && ( typeof "+d+" != 'number' || "),n+=" (division"+o+" = "+f+" / "+d+", ",t.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+t.opts.multipleOfPrecision+" ":n+=" division"+o+" !== parseInt(division"+o+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var v=v||[];v.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { multipleOf: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be multiple of ",h?n+="' + "+d:n+=""+d+"'"),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var x=n;return n=v.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+x+"]); ":n+=" validate.errors = ["+x+"]; return false; ":n+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),Vj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t);d.level++;var v="valid"+d.level;if(t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all)){d.schema=c,d.schemaPath=u,d.errSchemaPath=p,n+=" var "+h+" = errors; ";var x=t.compositeRule;t.compositeRule=d.compositeRule=!0,d.createErrors=!1;var b;d.opts.allErrors&&(b=d.opts.allErrors,d.opts.allErrors=!1),n+=" "+t.validate(d)+" ",d.createErrors=!0,b&&(d.opts.allErrors=b),t.compositeRule=d.compositeRule=x,n+=" if ("+v+") { ";var E=E||[];E.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var k=n;n=E.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+k+"]); ":n+=" validate.errors = ["+k+"]; return false; ":n+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",t.opts.allErrors&&(n+=" } ")}else n+=" var err = ",t.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",m&&(n+=" if (false) { ");return n}}),Gj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E=v.baseId,k="prevValid"+o,O="passingSchemas"+o;n+="var "+d+" = errors , "+k+" = false , "+h+" = false , "+O+" = null; ";var P=t.compositeRule;t.compositeRule=v.compositeRule=!0;var I=c;if(I)for(var $,A=-1,F=I.length-1;A0||$===!1:t.util.schemaHasRules($,t.RULES.all))?(v.schema=$,v.schemaPath=u+"["+A+"]",v.errSchemaPath=p+"/"+A,n+=" "+t.validate(v)+" ",v.baseId=E):n+=" var "+b+" = true; ",A&&(n+=" if ("+b+" && "+k+") { "+h+" = false; "+O+" = ["+O+", "+A+"]; } else { ",x+="}"),n+=" if ("+b+") { "+h+" = "+k+" = true; "+O+" = "+A+"; }";return t.compositeRule=v.compositeRule=P,n+=""+x+"if (!"+h+") { var err = ",t.createErrors!==!1?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { passingSchemas: "+O+" } ",t.opts.messages!==!1&&(n+=" , message: 'should match exactly one schema in oneOf' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&m&&(t.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",t.opts.allErrors&&(n+=" } "),n}}),Zj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c;var v=h?"(new RegExp("+d+"))":t.usePattern(c);n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),n+=" !"+v+".test("+f+") ) { ";var x=x||[];x.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { pattern: ",h?n+=""+d:n+=""+t.util.toQuotedString(c),n+=" } ",t.opts.messages!==!1&&(n+=` , message: 'should match pattern "`,h?n+="' + "+d+" + '":n+=""+t.util.escapeQuotes(c),n+=`"' `),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+t.util.toQuotedString(c),n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var b=n;return n=x.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),Wj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t),v="";d.level++;var x="valid"+d.level,b="key"+o,E="idx"+o,k=d.dataLevel=t.dataLevel+1,O="data"+k,P="dataProperties"+o,I=Object.keys(c||{}).filter(V),$=t.schema.patternProperties||{},A=Object.keys($).filter(V),F=t.schema.additionalProperties,q=I.length||A.length,C=F===!1,R=typeof F=="object"&&Object.keys(F).length,j=t.opts.removeAdditional,z=C||R||j,B=t.opts.ownProperties,G=t.baseId,te=t.schema.required;if(te&&!(t.opts.$data&&te.$data)&&te.length8)n+=" || validate.schema"+u+".hasOwnProperty("+b+") ";else{var re=I;if(re)for(var ce,Be=-1,be=re.length-1;Be0||Ue===!1:t.util.schemaHasRules(Ue,t.RULES.all)){var Qe=t.util.getProperty(ce),Ie=f+Qe,Ve=Ze&&Ue.default!==void 0;d.schema=Ue,d.schemaPath=u+Qe,d.errSchemaPath=p+"/"+t.util.escapeFragment(ce),d.errorPath=t.util.getPath(t.errorPath,ce,t.opts.jsonPointers),d.dataPathArr[k]=t.util.toQuotedString(ce);var he=t.validate(d);if(d.baseId=G,t.util.varOccurences(he,O)<2){he=t.util.varReplace(he,O,Ie);var Ke=Ie}else{var Ke=O;n+=" var "+O+" = "+Ie+"; "}if(Ve)n+=" "+he+" ";else{if(X&&X[ce]){n+=" if ( "+Ke+" === undefined ",B&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes(ce)+"') "),n+=") { "+x+" = false; ";var Z=t.errorPath,ue=p,bt=t.util.escapeQuotes(ce);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(Z,ce,t.opts.jsonPointers)),p=t.errSchemaPath+"/required";var W=W||[];W.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { missingProperty: '"+bt+"' } ",t.opts.messages!==!1&&(n+=" , message: '",t.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+bt+"\\'",n+="' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var Q=n;n=W.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+Q+"]); ":n+=" validate.errors = ["+Q+"]; return false; ":n+=" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p=ue,t.errorPath=Z,n+=" } else { "}else m?(n+=" if ( "+Ke+" === undefined ",B&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes(ce)+"') "),n+=") { "+x+" = true; } else { "):(n+=" if ("+Ke+" !== undefined ",B&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes(ce)+"') "),n+=" ) { ");n+=" "+he+" } "}}m&&(n+=" if ("+x+") { ",v+="}")}}if(A.length){var xt=A;if(xt)for(var xe,wt=-1,Br=xt.length-1;wt0||Ue===!1:t.util.schemaHasRules(Ue,t.RULES.all)){d.schema=Ue,d.schemaPath=t.schemaPath+".patternProperties"+t.util.getProperty(xe),d.errSchemaPath=t.errSchemaPath+"/patternProperties/"+t.util.escapeFragment(xe),B?n+=" "+P+" = "+P+" || Object.keys("+f+"); for (var "+E+"=0; "+E+"<"+P+".length; "+E+"++) { var "+b+" = "+P+"["+E+"]; ":n+=" for (var "+b+" in "+f+") { ",n+=" if ("+t.usePattern(xe)+".test("+b+")) { ",d.errorPath=t.util.getPathExpr(t.errorPath,b,t.opts.jsonPointers);var Ie=f+"["+b+"]";d.dataPathArr[k]=b;var he=t.validate(d);d.baseId=G,t.util.varOccurences(he,O)<2?n+=" "+t.util.varReplace(he,O,Ie)+" ":n+=" var "+O+" = "+Ie+"; "+he+" ",m&&(n+=" if (!"+x+") break; "),n+=" } ",m&&(n+=" else "+x+" = true; "),n+=" } ",m&&(n+=" if ("+x+") { ",v+="}")}}}return m&&(n+=" "+v+" if ("+h+" == errors) {"),n}}),Kj=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t),v="";d.level++;var x="valid"+d.level;if(n+="var "+h+" = errors;",t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all)){d.schema=c,d.schemaPath=u,d.errSchemaPath=p;var b="key"+o,E="idx"+o,k="i"+o,O="' + "+b+" + '",P=d.dataLevel=t.dataLevel+1,I="data"+P,$="dataProperties"+o,A=t.opts.ownProperties,F=t.baseId;A&&(n+=" var "+$+" = undefined; "),A?n+=" "+$+" = "+$+" || Object.keys("+f+"); for (var "+E+"=0; "+E+"<"+$+".length; "+E+"++) { var "+b+" = "+$+"["+E+"]; ":n+=" for (var "+b+" in "+f+") { ",n+=" var startErrs"+o+" = errors; ";var q=b,C=t.compositeRule;t.compositeRule=d.compositeRule=!0;var R=t.validate(d);d.baseId=F,t.util.varOccurences(R,I)<2?n+=" "+t.util.varReplace(R,I,q)+" ":n+=" var "+I+" = "+q+"; "+R+" ",t.compositeRule=d.compositeRule=C,n+=" if (!"+x+") { for (var "+k+"=startErrs"+o+"; "+k+"{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c;var x="schema"+o;if(!d)if(c.length0||I===!1:t.util.schemaHasRules(I,t.RULES.all))||(b[b.length]=k)}}else var b=c;if(d||b.length){var $=t.errorPath,A=d||b.length>=t.opts.loopRequired,F=t.opts.ownProperties;if(m)if(n+=" var missing"+o+"; ",A){d||(n+=" var "+x+" = validate.schema"+u+"; ");var q="i"+o,C="schema"+o+"["+q+"]",R="' + "+C+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr($,C,t.opts.jsonPointers)),n+=" var "+h+" = true; ",d&&(n+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),n+=" for (var "+q+" = 0; "+q+" < "+x+".length; "+q+"++) { "+h+" = "+f+"["+x+"["+q+"]] !== undefined ",F&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", "+x+"["+q+"]) "),n+="; if (!"+h+") break; } ",d&&(n+=" } "),n+=" if (!"+h+") { ";var j=j||[];j.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { missingProperty: '"+R+"' } ",t.opts.messages!==!1&&(n+=" , message: '",t.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+R+"\\'",n+="' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var z=n;n=j.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+z+"]); ":n+=" validate.errors = ["+z+"]; return false; ":n+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var B=b;if(B)for(var G,q=-1,te=B.length-1;q{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;if(d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c,(c||d)&&t.opts.uniqueItems!==!1){d&&(n+=" var "+h+"; if ("+v+" === false || "+v+" === undefined) "+h+" = true; else if (typeof "+v+" != 'boolean') "+h+" = false; else { "),n+=" var i = "+f+".length , "+h+" = true , j; if (i > 1) { ";var x=t.schema.items&&t.schema.items.type,b=Array.isArray(x);if(!x||x=="object"||x=="array"||b&&(x.indexOf("object")>=0||x.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var E="checkDataType"+(b?"s":"");n+=" if ("+t.util[E](x,"item",t.opts.strictNumbers,!0)+") continue; ",b&&(n+=` if (typeof item == 'string') item = '"' + item; `),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",d&&(n+=" } "),n+=" if (!"+h+") { ";var k=k||[];k.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { i: i, j: j } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),t.opts.verbose&&(n+=" , schema: ",d?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var O=n;n=k.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+O+"]); ":n+=" validate.errors = ["+O+"]; return false; ":n+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",m&&(n+=" else { ")}else m&&(n+=" if (true) { ");return n}}),Jj=Ce((a,e)=>{e.exports={$ref:jj(),allOf:Nj(),anyOf:Dj(),$comment:$j(),const:qj(),contains:Mj(),dependencies:Fj(),enum:Lj(),format:Uj(),if:zj(),items:Hj(),maximum:ME(),minimum:ME(),maxItems:FE(),minItems:FE(),maxLength:LE(),minLength:LE(),maxProperties:UE(),minProperties:UE(),multipleOf:Bj(),not:Vj(),oneOf:Gj(),pattern:Zj(),properties:Wj(),propertyNames:Kj(),required:Qj(),uniqueItems:Xj(),validate:e1()}}),Yj=Ce((a,e)=>{var r=Jj(),t=Cn().toHash;e.exports=function(){var i=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],n=["type","$comment"],o=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],l=["number","integer","string","array","object","boolean","null"];return i.all=t(n),i.types=t(l),i.forEach(function(c){c.rules=c.rules.map(function(u){var p;if(typeof u=="object"){var m=Object.keys(u)[0];p=u[m],u=m,p.forEach(function(h){n.push(h),i.all[h]=!0})}n.push(u);var f=i.all[u]={keyword:u,code:r[u],implements:p};return f}),i.all.$comment={keyword:"$comment",code:r.$comment},c.type&&(i.types[c.type]=c)}),i.keywords=t(n.concat(o)),i.custom={},i}}),eN=Ce((a,e)=>{var r=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(t,s){for(var i=0;i{var r=jd().MissingRef;e.exports=t;function t(s,i,n){var o=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof i=="function"&&(n=i,i=void 0);var l=c(s).then(function(){var p=o._addSchema(s,void 0,i);return p.validate||u(p)});return n&&l.then(function(p){n(null,p)},n),l;function c(p){var m=p.$schema;return m&&!o.getSchema(m)?t.call(o,{$ref:m},!0):Promise.resolve()}function u(p){try{return o._compile(p)}catch(f){if(f instanceof r)return m(f);throw f}function m(f){var h=f.missingSchema;if(x(h))throw new Error("Schema "+h+" is loaded but "+f.missingRef+" cannot be resolved");var d=o._loadingSchemas[h];return d||(d=o._loadingSchemas[h]=o._opts.loadSchema(h),d.then(v,v)),d.then(function(b){if(!x(h))return c(b).then(function(){x(h)||o.addSchema(b,h,void 0,i)})}).then(function(){return u(p)});function v(){delete o._loadingSchemas[h]}function x(b){return o._refs[b]||o._schemas[b]}}}}}),rN=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f,h="data"+(l||""),d="valid"+o,v="errs__"+o,x=t.opts.$data&&c&&c.$data,b;x?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",b="schema"+o):b=c;var E=this,k="definition"+o,O=E.definition,P="",I,$,A,F,q;if(x&&O.$data){q="keywordValidate"+o;var C=O.validateSchema;n+=" var "+k+" = RULES.custom['"+s+"'].definition; var "+q+" = "+k+".validate;"}else{if(F=t.useCustomRule(E,c,t.schema,t),!F)return;b="validate.schema"+u,q=F.code,I=O.compile,$=O.inline,A=O.macro}var R=q+".errors",j="i"+o,z="ruleErr"+o,B=O.async;if(B&&!t.async)throw new Error("async keyword in sync schema");if($||A||(n+=""+R+" = null;"),n+="var "+v+" = errors;var "+d+";",x&&O.$data&&(P+="}",n+=" if ("+b+" === undefined) { "+d+" = true; } else { ",C&&(P+="}",n+=" "+d+" = "+k+".validateSchema("+b+"); if ("+d+") { ")),$)O.statements?n+=" "+F.validate+" ":n+=" "+d+" = "+F.validate+"; ";else if(A){var G=t.util.copy(t),P="";G.level++;var te="valid"+G.level;G.schema=F.validate,G.schemaPath="";var X=t.compositeRule;t.compositeRule=G.compositeRule=!0;var V=t.validate(G).replace(/validate\.schema/g,q);t.compositeRule=G.compositeRule=X,n+=" "+V}else{var re=re||[];re.push(n),n="",n+=" "+q+".call( ",t.opts.passContext?n+="this":n+="self",I||O.schema===!1?n+=" , "+h+" ":n+=" , "+b+" , "+h+" , validate.schema"+t.schemaPath+" ",n+=" , (dataPath || '')",t.errorPath!='""'&&(n+=" + "+t.errorPath);var ce=l?"data"+(l-1||""):"parentData",Be=l?t.dataPathArr[l]:"parentDataProperty";n+=" , "+ce+" , "+Be+" , rootData ) ";var be=n;n=re.pop(),O.errors===!1?(n+=" "+d+" = ",B&&(n+="await "),n+=""+be+"; "):B?(R="customErrors"+o,n+=" var "+R+" = null; try { "+d+" = await "+be+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+R+" = e.errors; else throw e; } "):n+=" "+R+" = null; "+d+" = "+be+"; "}if(O.modifying&&(n+=" if ("+ce+") "+h+" = "+ce+"["+Be+"];"),n+=""+P,O.valid)m&&(n+=" if (true) { ");else{n+=" if ( ",O.valid===void 0?(n+=" !",A?n+=""+te:n+=""+d):n+=" "+!O.valid+" ",n+=") { ",f=E.keyword;var re=re||[];re.push(n),n="";var re=re||[];re.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { keyword: '"+E.keyword+"' } ",t.opts.messages!==!1&&(n+=` , message: 'should pass "`+E.keyword+`" keyword validation' `),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var qe=n;n=re.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+qe+"]); ":n+=" validate.errors = ["+qe+"]; return false; ":n+=" var err = "+qe+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var xe=n;n=re.pop(),$?O.errors?O.errors!="full"&&(n+=" for (var "+j+"="+v+"; "+j+"{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),aN=Ce((a,e)=>{var r=t1();e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:r.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:r.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),sN=Ce((a,e)=>{var r=/^[a-z_$][a-z0-9_$-]*$/i,t=rN(),s=aN();e.exports={add:i,get:n,remove:o,validate:l};function i(c,u){var p=this.RULES;if(p.keywords[c])throw new Error("Keyword "+c+" is already defined");if(!r.test(c))throw new Error("Keyword "+c+" is not a valid identifier");if(u){this.validateKeyword(u,!0);var m=u.type;if(Array.isArray(m))for(var f=0;f{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),iN=Ce((a,e)=>{var r=Cj(),t=Ad(),s=Ij(),i=JE(),n=YE(),o=Aj(),l=Yj(),c=eN(),u=Cn();e.exports=v,v.prototype.validate=x,v.prototype.compile=b,v.prototype.addSchema=E,v.prototype.addMetaSchema=k,v.prototype.validateSchema=O,v.prototype.getSchema=I,v.prototype.removeSchema=F,v.prototype.addFormat=X,v.prototype.errorsText=te,v.prototype._addSchema=C,v.prototype._compile=R,v.prototype.compileAsync=tN();var p=sN();v.prototype.addKeyword=p.add,v.prototype.getKeyword=p.get,v.prototype.removeKeyword=p.remove,v.prototype.validateKeyword=p.validate;var m=jd();v.ValidationError=m.Validation,v.MissingRefError=m.MissingRef,v.$dataMetaSchema=c;var f="http://json-schema.org/draft-07/schema",h=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],d=["/properties"];function v(U){if(!(this instanceof v))return new v(U);U=this._opts=u.copy(U)||{},xe(this),this._schemas={},this._refs={},this._fragments={},this._formats=o(U.format),this._cache=U.cache||new s,this._loadingSchemas={},this._compilations=[],this.RULES=l(),this._getId=j(U),U.loopRequired=U.loopRequired||1/0,U.errorDataPath=="property"&&(U._errorDataPathProperty=!0),U.serialize===void 0&&(U.serialize=n),this._metaOpts=qe(this),U.formats&&ce(this),U.keywords&&Be(this),V(this),typeof U.meta=="object"&&this.addMetaSchema(U.meta),U.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),re(this)}function x(U,Z){var ee;if(typeof U=="string"){if(ee=this.getSchema(U),!ee)throw new Error('no schema with key or ref "'+U+'"')}else{var ue=this._addSchema(U);ee=ue.validate||this._compile(ue)}var W=ee(Z);return ee.$async!==!0&&(this.errors=ee.errors),W}function b(U,Z){var ee=this._addSchema(U,void 0,Z);return ee.validate||this._compile(ee)}function E(U,Z,ee,ue){if(Array.isArray(U)){for(var W=0;W0&&R.push("--allowedTools",P.join(",")),I.length>0&&R.push("--disallowedTools",I.join(",")),$&&Object.keys($).length>0&&R.push("--mcp-config",JSON.stringify({mcpServers:$})),r&&Object.keys(r).length>0&&R.push("--agents",JSON.stringify(r)),O&&R.push("--setting-sources",O.join(",")),A&&R.push("--strict-mcp-config"),v&&R.push("--permission-mode",v),x&&R.push("--allow-dangerously-skip-permissions"),d){if(h&&d===h)throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");R.push("--fallback-model",d)}q&&R.push("--include-partial-messages");for(let V of e)R.push("--add-dir",V);if(C&&C.length>0)for(let V of C)if(V.type==="local")R.push("--plugin-dir",V.path);else throw new Error(`Unsupported plugin type: ${V.type}`);this.options.forkSession&&R.push("--fork-session"),this.options.resumeSessionAt&&R.push("--resume-session-at",this.options.resumeSessionAt);for(let[V,re]of Object.entries(n))re===null?R.push(`--${V}`):R.push(`--${V}`,re);if(l.CLAUDE_CODE_ENTRYPOINT||(l.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),!aa().existsSync(o)){let V=zE(o)?`Claude Code native binary not found at ${o}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${o}. Is options.pathToClaudeCodeExecutable set?`;throw new ReferenceError(V)}let z=zE(o),B=z?o:s,G=z?[...i,...R]:[...i,o,...R];this.logForDebugging(z?`Spawning Claude Code native binary: ${B} ${G.join(" ")}`:`Spawning Claude Code process: ${B} ${G.join(" ")}`);let te=l.DEBUG||c?"pipe":"ignore";this.child=(0,n1.spawn)(B,G,{cwd:t,stdio:["pipe","pipe",te],signal:this.abortController.signal,env:l}),this.childStdin=this.child.stdin,this.childStdout=this.child.stdout,(l.DEBUG||c)&&this.child.stderr.on("data",V=>{this.logForDebugging(V.toString())});let X=()=>{this.child&&!this.child.killed&&this.child.kill("SIGTERM")};this.processExitHandler=X,this.abortHandler=X,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.child.on("error",V=>{this.ready=!1,this.abortController.signal.aborted?this.exitError=new hs("Claude Code process aborted by user"):(this.exitError=new Error(`Failed to spawn Claude Code process: ${V.message}`),this.logForDebugging(this.exitError.message))}),this.child.on("close",(V,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new hs("Claude Code process aborted by user");else{let ce=this.getProcessExitError(V,re);ce&&(this.exitError=ce,this.logForDebugging(ce.message))}}),this.ready=!0}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return new Error(`Claude Code process exited with code ${e}`);if(r)return new Error(`Claude Code process terminated by signal ${r}`)}logForDebugging(e){process.env.DEBUG&&process.stderr.write(`${e} +===========================`}var xd=require("path"),r1=require("url"),a1=require("events"),n1=require("child_process"),i1=require("readline"),ke=jt(require("fs"),1),o1=require("fs/promises"),f1=require("path"),m1=require("os"),vs=require("path"),Sd=require("process"),h1=require("crypto"),P$={},_9=Object.create,E9=Object.getPrototypeOf,bd=Object.defineProperty,w9=Object.getOwnPropertyNames,S9=Object.prototype.hasOwnProperty,P9=(a,e,r)=>{r=a!=null?_9(E9(a)):{};let t=e||!a||!a.__esModule?bd(r,"default",{value:a,enumerable:!0}):r;for(let s of w9(a))S9.call(t,s)||bd(t,s,{get:()=>a[s],enumerable:!0});return t},Ce=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),R9=(a,e)=>{for(var r in e)bd(a,r,{get:e[r],enumerable:!0,configurable:!0,set:t=>e[r]=()=>t})},T9=Ce((a,e)=>{(function(r,t){typeof a=="object"&&typeof e<"u"?t(a):typeof define=="function"&&define.amd?define(["exports"],t):t(r.URI=r.URI||{})})(a,function(r){function t(){for(var y=arguments.length,g=Array(y),S=0;S1){g[0]=g[0].slice(0,-1);for(var D=g.length-1,L=1;L= 0x80 (not a basic code point)","invalid-input":"Invalid input"},q=d-v,C=Math.floor,R=String.fromCharCode;function j(y){throw new RangeError(F[y])}function z(y,g){for(var S=[],D=y.length;D--;)S[D]=g(y[D]);return S}function B(y,g){var S=y.split("@"),D="";S.length>1&&(D=S[0]+"@",y=S[1]),y=y.replace(A,".");var L=y.split("."),K=z(L,g).join(".");return D+K}function G(y){for(var g=[],S=0,D=y.length;S=55296&&L<=56319&&S>1,g+=C(g/S);g>q*x>>1;L+=d)g=C(g/q);return C(L+(q+1)*g/(g+b))},ce=function(g){var S=[],D=g.length,L=0,K=O,ne=k,ge=g.lastIndexOf(P);ge<0&&(ge=0);for(var pe=0;pe=128&&j("not-basic"),S.push(g.charCodeAt(pe));for(var Ae=ge>0?ge+1:0;Ae=D&&j("invalid-input");var Te=X(g.charCodeAt(Ae++));(Te>=d||Te>C((h-L)/Re))&&j("overflow"),L+=Te*Re;var de=ye<=ne?v:ye>=ne+x?x:ye-ne;if(TeC(h/Xe)&&j("overflow"),Re*=Xe}var Ne=S.length+1;ne=re(L-ve,Ne,ve==0),C(L/Ne)>h-K&&j("overflow"),K+=C(L/Ne),L%=Ne,S.splice(L++,0,K)}return String.fromCodePoint.apply(String,S)},Be=function(g){var S=[];g=G(g);var D=g.length,L=O,K=0,ne=k,ge=!0,pe=!1,Ae=void 0;try{for(var ve=g[Symbol.iterator](),Re;!(ge=(Re=ve.next()).done);ge=!0){var ye=Re.value;ye<128&&S.push(R(ye))}}catch(Gr){pe=!0,Ae=Gr}finally{try{!ge&&ve.return&&ve.return()}finally{if(pe)throw Ae}}var Te=S.length,de=Te;for(Te&&S.push(P);de=L&&itC((h-K)/dt)&&j("overflow"),K+=(Xe-L)*dt,L=Xe;var ft=!0,Bt=!1,It=void 0;try{for(var Tr=g[Symbol.iterator](),vr;!(ft=(vr=Tr.next()).done);ft=!0){var gr=vr.value;if(grh&&j("overflow"),gr==L){for(var St=K,Vt=d;;Vt+=d){var Gt=Vt<=ne?v:Vt>=ne+x?x:Vt-ne;if(St>6|192).toString(16).toUpperCase()+"%"+(g&63|128).toString(16).toUpperCase():S="%"+(g>>12|224).toString(16).toUpperCase()+"%"+(g>>6&63|128).toString(16).toUpperCase()+"%"+(g&63|128).toString(16).toUpperCase(),S}function Z(y){for(var g="",S=0,D=y.length;S=194&&L<224){if(D-S>=6){var K=parseInt(y.substr(S+4,2),16);g+=String.fromCharCode((L&31)<<6|K&63)}else g+=y.substr(S,6);S+=6}else if(L>=224){if(D-S>=9){var ne=parseInt(y.substr(S+4,2),16),ge=parseInt(y.substr(S+7,2),16);g+=String.fromCharCode((L&15)<<12|(ne&63)<<6|ge&63)}else g+=y.substr(S,9);S+=9}else g+=y.substr(S,3),S+=3}return g}function ee(y,g){function S(D){var L=Z(D);return L.match(g.UNRESERVED)?L:D}return y.scheme&&(y.scheme=String(y.scheme).replace(g.PCT_ENCODED,S).toLowerCase().replace(g.NOT_SCHEME,"")),y.userinfo!==void 0&&(y.userinfo=String(y.userinfo).replace(g.PCT_ENCODED,S).replace(g.NOT_USERINFO,U).replace(g.PCT_ENCODED,n)),y.host!==void 0&&(y.host=String(y.host).replace(g.PCT_ENCODED,S).toLowerCase().replace(g.NOT_HOST,U).replace(g.PCT_ENCODED,n)),y.path!==void 0&&(y.path=String(y.path).replace(g.PCT_ENCODED,S).replace(y.scheme?g.NOT_PATH:g.NOT_PATH_NOSCHEME,U).replace(g.PCT_ENCODED,n)),y.query!==void 0&&(y.query=String(y.query).replace(g.PCT_ENCODED,S).replace(g.NOT_QUERY,U).replace(g.PCT_ENCODED,n)),y.fragment!==void 0&&(y.fragment=String(y.fragment).replace(g.PCT_ENCODED,S).replace(g.NOT_FRAGMENT,U).replace(g.PCT_ENCODED,n)),y}function ue(y){return y.replace(/^0*(.*)/,"$1")||"0"}function W(y,g){var S=y.match(g.IPV4ADDRESS)||[],D=m(S,2),L=D[1];return L?L.split(".").map(ue).join("."):y}function Q(y,g){var S=y.match(g.IPV6ADDRESS)||[],D=m(S,3),L=D[1],K=D[2];if(L){for(var ne=L.toLowerCase().split("::").reverse(),ge=m(ne,2),pe=ge[0],Ae=ge[1],ve=Ae?Ae.split(":").map(ue):[],Re=pe.split(":").map(ue),ye=g.IPV4ADDRESS.test(Re[Re.length-1]),Te=ye?7:8,de=Re.length-Te,Xe=Array(Te),Ne=0;Ne1){var Fe=Xe.slice(0,Me.index),it=Xe.slice(Me.index+Me.length);st=Fe.join(":")+"::"+it.join(":")}else st=Xe.join(":");return K&&(st+="%"+K),st}else return y}var ie=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ie="".match(/(){0}/)[1]===void 0;function he(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S={},D=g.iri!==!1?p:u;g.reference==="suffix"&&(y=(g.scheme?g.scheme+":":"")+"//"+y);var L=y.match(ie);if(L){Ie?(S.scheme=L[1],S.userinfo=L[3],S.host=L[4],S.port=parseInt(L[5],10),S.path=L[6]||"",S.query=L[7],S.fragment=L[8],isNaN(S.port)&&(S.port=L[5])):(S.scheme=L[1]||void 0,S.userinfo=y.indexOf("@")!==-1?L[3]:void 0,S.host=y.indexOf("//")!==-1?L[4]:void 0,S.port=parseInt(L[5],10),S.path=L[6]||"",S.query=y.indexOf("?")!==-1?L[7]:void 0,S.fragment=y.indexOf("#")!==-1?L[8]:void 0,isNaN(S.port)&&(S.port=y.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?L[4]:void 0)),S.host&&(S.host=Q(W(S.host,D),D)),S.scheme===void 0&&S.userinfo===void 0&&S.host===void 0&&S.port===void 0&&!S.path&&S.query===void 0?S.reference="same-document":S.scheme===void 0?S.reference="relative":S.fragment===void 0?S.reference="absolute":S.reference="uri",g.reference&&g.reference!=="suffix"&&g.reference!==S.reference&&(S.error=S.error||"URI is not a "+g.reference+" reference.");var K=Oe[(g.scheme||S.scheme||"").toLowerCase()];if(!g.unicodeSupport&&(!K||!K.unicodeSupport)){if(S.host&&(g.domainHost||K&&K.domainHost))try{S.host=xe.toASCII(S.host.replace(D.PCT_ENCODED,Z).toLowerCase())}catch(ne){S.error=S.error||"Host's domain name can not be converted to ASCII via punycode: "+ne}ee(S,u)}else ee(S,D);K&&K.parse&&K.parse(S,g)}else S.error=S.error||"URI can not be parsed.";return S}function Ze(y,g){var S=g.iri!==!1?p:u,D=[];return y.userinfo!==void 0&&(D.push(y.userinfo),D.push("@")),y.host!==void 0&&D.push(Q(W(String(y.host),S),S).replace(S.IPV6ADDRESS,function(L,K,ne){return"["+K+(ne?"%25"+ne:"")+"]"})),(typeof y.port=="number"||typeof y.port=="string")&&(D.push(":"),D.push(String(y.port))),D.length?D.join(""):void 0}var We=/^\.\.?\//,Ee=/^\/\.(\/|$)/,Ye=/^\/\.\.(\/|$)/,Ue=/^\/?(?:.|\n)*?(?=\/|$)/;function Qe(y){for(var g=[];y.length;)if(y.match(We))y=y.replace(We,"");else if(y.match(Ee))y=y.replace(Ee,"/");else if(y.match(Ye))y=y.replace(Ye,"/"),g.pop();else if(y==="."||y==="..")y="";else{var S=y.match(Ue);if(S){var D=S[0];y=y.slice(D.length),g.push(D)}else throw new Error("Unexpected dot segment condition")}return g.join("")}function Ve(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=g.iri?p:u,D=[],L=Oe[(g.scheme||y.scheme||"").toLowerCase()];if(L&&L.serialize&&L.serialize(y,g),y.host&&!S.IPV6ADDRESS.test(y.host)){if(g.domainHost||L&&L.domainHost)try{y.host=g.iri?xe.toUnicode(y.host):xe.toASCII(y.host.replace(S.PCT_ENCODED,Z).toLowerCase())}catch(ge){y.error=y.error||"Host's domain name can not be converted to "+(g.iri?"Unicode":"ASCII")+" via punycode: "+ge}}ee(y,S),g.reference!=="suffix"&&y.scheme&&(D.push(y.scheme),D.push(":"));var K=Ze(y,g);if(K!==void 0&&(g.reference!=="suffix"&&D.push("//"),D.push(K),y.path&&y.path.charAt(0)!=="/"&&D.push("/")),y.path!==void 0){var ne=y.path;!g.absolutePath&&(!L||!L.absolutePath)&&(ne=Qe(ne)),K===void 0&&(ne=ne.replace(/^\/\//,"/%2F")),D.push(ne)}return y.query!==void 0&&(D.push("?"),D.push(y.query)),y.fragment!==void 0&&(D.push("#"),D.push(y.fragment)),D.join("")}function Ke(y,g){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=arguments[3],L={};return D||(y=he(Ve(y,S),S),g=he(Ve(g,S),S)),S=S||{},!S.tolerant&&g.scheme?(L.scheme=g.scheme,L.userinfo=g.userinfo,L.host=g.host,L.port=g.port,L.path=Qe(g.path||""),L.query=g.query):(g.userinfo!==void 0||g.host!==void 0||g.port!==void 0?(L.userinfo=g.userinfo,L.host=g.host,L.port=g.port,L.path=Qe(g.path||""),L.query=g.query):(g.path?(g.path.charAt(0)==="/"?L.path=Qe(g.path):((y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)&&!y.path?L.path="/"+g.path:y.path?L.path=y.path.slice(0,y.path.lastIndexOf("/")+1)+g.path:L.path=g.path,L.path=Qe(L.path)),L.query=g.query):(L.path=y.path,g.query!==void 0?L.query=g.query:L.query=y.query),L.userinfo=y.userinfo,L.host=y.host,L.port=y.port),L.scheme=y.scheme),L.fragment=g.fragment,L}function bt(y,g,S){var D=l({scheme:"null"},S);return Ve(Ke(he(y,D),he(g,D),D,!0),D)}function xt(y,g){return typeof y=="string"?y=Ve(he(y,g),g):i(y)==="object"&&(y=he(Ve(y,g),g)),y}function wt(y,g,S){return typeof y=="string"?y=Ve(he(y,S),S):i(y)==="object"&&(y=Ve(y,S)),typeof g=="string"?g=Ve(he(g,S),S):i(g)==="object"&&(g=Ve(g,S)),y===g}function Br(y,g){return y&&y.toString().replace(!g||!g.iri?u.ESCAPE:p.ESCAPE,U)}function Ct(y,g){return y&&y.toString().replace(!g||!g.iri?u.PCT_ENCODED:p.PCT_ENCODED,Z)}var ia={scheme:"http",domainHost:!0,parse:function(g,S){return g.host||(g.error=g.error||"HTTP URIs must have a host."),g},serialize:function(g,S){var D=String(g.scheme).toLowerCase()==="https";return(g.port===(D?443:80)||g.port==="")&&(g.port=void 0),g.path||(g.path="/"),g}},oa={scheme:"https",domainHost:ia.domainHost,parse:ia.parse,serialize:ia.serialize};function Nn(y){return typeof y.secure=="boolean"?y.secure:String(y.scheme).toLowerCase()==="wss"}var Ia={scheme:"ws",domainHost:!0,parse:function(g,S){var D=g;return D.secure=Nn(D),D.resourceName=(D.path||"/")+(D.query?"?"+D.query:""),D.path=void 0,D.query=void 0,D},serialize:function(g,S){if((g.port===(Nn(g)?443:80)||g.port==="")&&(g.port=void 0),typeof g.secure=="boolean"&&(g.scheme=g.secure?"wss":"ws",g.secure=void 0),g.resourceName){var D=g.resourceName.split("?"),L=m(D,2),K=L[0],ne=L[1];g.path=K&&K!=="/"?K:void 0,g.query=ne,g.resourceName=void 0}return g.fragment=void 0,g}},qi={scheme:"wss",domainHost:Ia.domainHost,parse:Ia.parse,serialize:Ia.serialize},Mi={},Jt=!0,Fi="[A-Za-z0-9\\-\\.\\_\\~"+(Jt?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Yt="[0-9A-Fa-f]",ol=s(s("%[EFef]"+Yt+"%"+Yt+Yt+"%"+Yt+Yt)+"|"+s("%[89A-Fa-f]"+Yt+"%"+Yt+Yt)+"|"+s("%"+Yt+Yt)),cl="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ll="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ul=t(ll,'[\\"\\\\]'),ca="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",pl=new RegExp(Fi,"g"),Vr=new RegExp(ol,"g"),dl=new RegExp(t("[^]",cl,"[\\.]",'[\\"]',ul),"g"),js=new RegExp(t("[^]",Fi,ca),"g"),Li=js;function Dn(y){var g=Z(y);return g.match(pl)?g:y}var $n={scheme:"mailto",parse:function(g,S){var D=g,L=D.to=D.path?D.path.split(","):[];if(D.path=void 0,D.query){for(var K=!1,ne={},ge=D.query.split("&"),pe=0,Ae=ge.length;pe{e.exports=function r(t,s){if(t===s)return!0;if(t&&s&&typeof t=="object"&&typeof s=="object"){if(t.constructor!==s.constructor)return!1;var i,n,o;if(Array.isArray(t)){if(i=t.length,i!=s.length)return!1;for(n=i;n--!==0;)if(!r(t[n],s[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(s).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(s,o[n]))return!1;for(n=i;n--!==0;){var l=o[n];if(!r(t[l],s[l]))return!1}return!0}return t!==t&&s!==s}}),k9=Ce((a,e)=>{e.exports=function(t){for(var s=0,i=t.length,n=0,o;n=55296&&o<=56319&&n{e.exports={copy:r,checkDataType:t,checkDataTypes:s,coerceToTypes:n,toHash:o,getProperty:u,escapeQuotes:p,equal:Id(),ucs2length:k9(),varOccurences:m,varReplace:f,schemaHasRules:h,schemaHasRulesExcept:d,schemaUnknownRules:v,toQuotedString:x,getPathExpr:b,getPath:E,getData:P,unescapeFragment:$,unescapeJsonPointer:q,escapeFragment:A,escapeJsonPointer:F};function r(C,R){R=R||{};for(var j in C)R[j]=C[j];return R}function t(C,R,j,z){var B=z?" !== ":" === ",G=z?" || ":" && ",te=z?"!":"",X=z?"":"!";switch(C){case"null":return R+B+"null";case"array":return te+"Array.isArray("+R+")";case"object":return"("+te+R+G+"typeof "+R+B+'"object"'+G+X+"Array.isArray("+R+"))";case"integer":return"(typeof "+R+B+'"number"'+G+X+"("+R+" % 1)"+G+R+B+R+(j?G+te+"isFinite("+R+")":"")+")";case"number":return"(typeof "+R+B+'"'+C+'"'+(j?G+te+"isFinite("+R+")":"")+")";default:return"typeof "+R+B+'"'+C+'"'}}function s(C,R,j){switch(C.length){case 1:return t(C[0],R,j,!0);default:var z="",B=o(C);B.array&&B.object&&(z=B.null?"(":"(!"+R+" || ",z+="typeof "+R+' !== "object")',delete B.null,delete B.array,delete B.object),B.number&&delete B.integer;for(var G in B)z+=(z?" && ":"")+t(G,R,j,!0);return z}}var i=o(["string","number","integer","boolean","null"]);function n(C,R){if(Array.isArray(R)){for(var j=[],z=0;z=R)throw new Error("Cannot access property/index "+z+" levels up, current level is "+R);return j[R-z]}if(z>R)throw new Error("Cannot access data "+z+" levels up, current level is "+R);if(G="data"+(R-z||""),!B)return G}for(var X=G,V=B.split("/"),re=0;re{var r=Cn();e.exports=t;function t(s){r.copy(s,this)}}),O9=Ce((a,e)=>{var r=e.exports=function(i,n,o){typeof n=="function"&&(o=n,n={}),o=n.cb||o;var l=typeof o=="function"?o:o.pre||function(){},c=o.post||function(){};t(n,l,c,i,"",i)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(i,n,o,l,c,u,p,m,f,h){if(l&&typeof l=="object"&&!Array.isArray(l)){n(l,c,u,p,m,f,h);for(var d in l){var v=l[d];if(Array.isArray(v)){if(d in r.arrayKeywords)for(var x=0;x{var r=T9(),t=Id(),s=Cn(),i=JE(),n=O9();e.exports=o,o.normalizeId=E,o.fullPath=v,o.url=k,o.ids=O,o.inlineRef=f,o.schema=l;function o(P,I,$){var A=this._refs[$];if(typeof A=="string")if(this._refs[A])A=this._refs[A];else return o.call(this,P,I,A);if(A=A||this._schemas[$],A instanceof i)return f(A.schema,this._opts.inlineRefs)?A.schema:A.validate||this._compile(A);var F=l.call(this,I,$),q,C,R;return F&&(q=F.schema,I=F.root,R=F.baseId),q instanceof i?C=q.validate||P.call(this,q.schema,I,void 0,R):q!==void 0&&(C=f(q,this._opts.inlineRefs)?q:P.call(this,q,I,void 0,R)),C}function l(P,I){var $=r.parse(I),A=x($),F=v(this._getId(P.schema));if(Object.keys(P.schema).length===0||A!==F){var q=E(A),C=this._refs[q];if(typeof C=="string")return c.call(this,P,C,$);if(C instanceof i)C.validate||this._compile(C),P=C;else if(C=this._schemas[q],C instanceof i){if(C.validate||this._compile(C),q==E(I))return{schema:C,root:P,baseId:F};P=C}else return;if(!P.schema)return;F=v(this._getId(P.schema))}return p.call(this,$,F,P.schema,P)}function c(P,I,$){var A=l.call(this,P,I);if(A){var F=A.schema,q=A.baseId;P=A.root;var C=this._getId(F);return C&&(q=k(q,C)),p.call(this,$,q,F,P)}}var u=s.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function p(P,I,$,A){if(P.fragment=P.fragment||"",P.fragment.slice(0,1)=="/"){for(var F=P.fragment.split("/"),q=1;q{var r=Ad();e.exports={Validation:i(t),MissingRef:i(s)};function t(n){this.message="validation failed",this.errors=n,this.ajv=this.validation=!0}s.message=function(n,o){return"can't resolve reference "+o+" from id "+n};function s(n,o,l){this.message=l||s.message(n,o),this.missingRef=r.url(n,o),this.missingSchema=r.normalizeId(r.fullPath(this.missingRef))}function i(n){return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}}),YE=Ce((a,e)=>{e.exports=function(r,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var s=typeof t.cycles=="boolean"?t.cycles:!1,i=t.cmp&&(function(o){return function(l){return function(c,u){var p={key:c,value:l[c]},m={key:u,value:l[u]};return o(p,m)}}})(t.cmp),n=[];return(function o(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var c,u;if(Array.isArray(l)){for(u="[",c=0;c{e.exports=function(t,s,i){var n="",o=t.schema.$async===!0,l=t.util.schemaHasRulesExcept(t.schema,t.RULES.all,"$ref"),c=t.self._getId(t.schema);if(t.opts.strictKeywords){var u=t.util.schemaUnknownRules(t.schema,t.RULES.keywords);if(u){var p="unknown keyword: "+u;if(t.opts.strictKeywords==="log")t.logger.warn(p);else throw new Error(p)}}if(t.isTop&&(n+=" var validate = ",o&&(t.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",c&&(t.opts.sourceCode||t.opts.processCode)&&(n+=" "+("/*# sourceURL="+c+" */")+" ")),typeof t.schema=="boolean"||!(l||t.schema.$ref)){var s="false schema",m=t.level,f=t.dataLevel,h=t.schema[s],d=t.schemaPath+t.util.getProperty(s),v=t.errSchemaPath+"/"+s,I=!t.opts.allErrors,F,x="data"+(f||""),P="valid"+m;if(t.schema===!1){t.isTop?I=!0:n+=" var "+P+" = false; ";var b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(F||"false schema")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(v)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'boolean schema is false' "),t.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+x+" "),n+=" } "):n+=" {} ";var E=n;n=b.pop(),!t.compositeRule&&I?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t.isTop?o?n+=" return data; ":n+=" validate.errors = null; return true; ":n+=" var "+P+" = true; ";return t.isTop&&(n+=" }; return validate; "),n}if(t.isTop){var k=t.isTop,m=t.level=0,f=t.dataLevel=0,x="data";if(t.rootId=t.resolve.fullPath(t.self._getId(t.root.schema)),t.baseId=t.baseId||t.rootId,delete t.isTop,t.dataPathArr=[""],t.schema.default!==void 0&&t.opts.useDefaults&&t.opts.strictDefaults){var O="default is ignored in the schema root";if(t.opts.strictDefaults==="log")t.logger.warn(O);else throw new Error(O)}n+=" var vErrors = null; ",n+=" var errors = 0; ",n+=" if (rootData === undefined) rootData = data; "}else{var{level:m,dataLevel:f}=t,x="data"+(f||"");if(c&&(t.baseId=t.resolve.url(t.baseId,c)),o&&!t.async)throw new Error("async schema in sync schema");n+=" var errs_"+m+" = errors;"}var P="valid"+m,I=!t.opts.allErrors,$="",A="",F,q=t.schema.type,C=Array.isArray(q);if(q&&t.opts.nullable&&t.schema.nullable===!0&&(C?q.indexOf("null")==-1&&(q=q.concat("null")):q!="null"&&(q=[q,"null"],C=!0)),C&&q.length==1&&(q=q[0],C=!1),t.schema.$ref&&l){if(t.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+t.errSchemaPath+'" (see option extendRefs)');t.opts.extendRefs!==!0&&(l=!1,t.logger.warn('$ref: keywords ignored in schema at path "'+t.errSchemaPath+'"'))}if(t.schema.$comment&&t.opts.$comment&&(n+=" "+t.RULES.all.$comment.code(t,"$comment")),q){if(t.opts.coerceTypes)var R=t.util.coerceToTypes(t.opts.coerceTypes,q);var j=t.RULES.types[q];if(R||C||j===!0||j&&!Ue(j)){var d=t.schemaPath+".type",v=t.errSchemaPath+"/type",d=t.schemaPath+".type",v=t.errSchemaPath+"/type",z=C?"checkDataTypes":"checkDataType";if(n+=" if ("+t.util[z](q,x,t.opts.strictNumbers,!0)+") { ",R){var B="dataType"+m,G="coerced"+m;n+=" var "+B+" = typeof "+x+"; var "+G+" = undefined; ",t.opts.coerceTypes=="array"&&(n+=" if ("+B+" == 'object' && Array.isArray("+x+") && "+x+".length == 1) { "+x+" = "+x+"[0]; "+B+" = typeof "+x+"; if ("+t.util.checkDataType(t.schema.type,x,t.opts.strictNumbers)+") "+G+" = "+x+"; } "),n+=" if ("+G+" !== undefined) ; ";var te=R;if(te)for(var X,V=-1,re=te.length-1;V{var r=Ad(),t=Cn(),s=jd(),i=YE(),n=e1(),o=t.ucs2length,l=Id(),c=s.Validation;e.exports=u;function u(E,k,O,P){var I=this,$=this._opts,A=[void 0],F={},q=[],C={},R=[],j={},z=[];k=k||{schema:E,refVal:A,refs:F};var B=p.call(this,E,k,P),G=this._compilations[B.index];if(B.compiling)return G.callValidate=ce;var te=this._formats,X=this.RULES;try{var V=Be(E,k,O,P);G.validate=V;var re=G.callValidate;return re&&(re.schema=V.schema,re.errors=null,re.refs=V.refs,re.refVal=V.refVal,re.root=V.root,re.$async=V.$async,$.sourceCode&&(re.source=V.source)),V}finally{m.call(this,E,k,P)}function ce(){var W=G.validate,Q=W.apply(this,arguments);return ce.errors=W.errors,Q}function Be(W,Q,ie,Ie){var he=!Q||Q&&Q.schema==W;if(Q.schema!=k.schema)return u.call(I,W,Q,ie,Ie);var Ze=W.$async===!0,We=n({isTop:!0,schema:W,isRoot:he,baseId:Ie,root:Q,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:s.MissingRef,RULES:X,validate:n,util:t,resolve:r,resolveRef:be,usePattern:Z,useDefault:ee,useCustomRule:ue,opts:$,formats:te,logger:I.logger,self:I});We=b(A,v)+b(q,h)+b(R,d)+b(z,x)+We,$.processCode&&(We=$.processCode(We,W));var Ee;try{var Ye=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",We);Ee=Ye(I,X,te,k,A,R,z,l,o,c),A[0]=Ee}catch(Ue){throw I.logger.error("Error compiling schema, function code:",We),Ue}return Ee.schema=W,Ee.errors=null,Ee.refs=F,Ee.refVal=A,Ee.root=he?Ee:Q,Ze&&(Ee.$async=!0),$.sourceCode===!0&&(Ee.source={code:We,patterns:q,defaults:R}),Ee}function be(W,Q,ie){Q=r.url(W,Q);var Ie=F[Q],he,Ze;if(Ie!==void 0)return he=A[Ie],Ze="refVal["+Ie+"]",U(he,Ze);if(!ie&&k.refs){var We=k.refs[Q];if(We!==void 0)return he=k.refVal[We],Ze=qe(Q,he),U(he,Ze)}Ze=qe(Q);var Ee=r.call(I,Be,k,Q);if(Ee===void 0){var Ye=O&&O[Q];Ye&&(Ee=r.inlineRef(Ye,$.inlineRefs)?Ye:u.call(I,Ye,k,O,W))}if(Ee===void 0)xe(Q);else return Oe(Q,Ee),U(Ee,Ze)}function qe(W,Q){var ie=A.length;return A[ie]=Q,F[W]=ie,"refVal"+ie}function xe(W){delete F[W]}function Oe(W,Q){var ie=F[W];A[ie]=Q}function U(W,Q){return typeof W=="object"||typeof W=="boolean"?{code:Q,schema:W,inline:!0}:{code:Q,$async:W&&!!W.$async}}function Z(W){var Q=C[W];return Q===void 0&&(Q=C[W]=q.length,q[Q]=W),"pattern"+Q}function ee(W){switch(typeof W){case"boolean":case"number":return""+W;case"string":return t.toQuotedString(W);case"object":if(W===null)return"null";var Q=i(W),ie=j[Q];return ie===void 0&&(ie=j[Q]=R.length,R[ie]=W),"default"+ie}}function ue(W,Q,ie,Ie){if(I._opts.validateSchema!==!1){var he=W.definition.dependencies;if(he&&!he.every(function(bt){return Object.prototype.hasOwnProperty.call(ie,bt)}))throw new Error("parent schema must have all required keywords: "+he.join(","));var Ze=W.definition.validateSchema;if(Ze){var We=Ze(Q);if(!We){var Ee="keyword schema is invalid: "+I.errorsText(Ze.errors);if(I._opts.validateSchema=="log")I.logger.error(Ee);else throw new Error(Ee)}}}var Ye=W.definition.compile,Ue=W.definition.inline,Qe=W.definition.macro,Ve;if(Ye)Ve=Ye.call(I,Q,ie,Ie);else if(Qe)Ve=Qe.call(I,Q,ie,Ie),$.validateSchema!==!1&&I.validateSchema(Ve,!0);else if(Ue)Ve=Ue.call(I,Ie,W.keyword,Q,ie);else if(Ve=W.definition.validate,!Ve)return;if(Ve===void 0)throw new Error('custom keyword "'+W.keyword+'"failed to compile');var Ke=z.length;return z[Ke]=Ve,{code:"customRule"+Ke,validate:Ve}}}function p(E,k,O){var P=f.call(this,E,k,O);return P>=0?{index:P,compiling:!0}:(P=this._compilations.length,this._compilations[P]={schema:E,root:k,baseId:O},{index:P,compiling:!1})}function m(E,k,O){var P=f.call(this,E,k,O);P>=0&&this._compilations.splice(P,1)}function f(E,k,O){for(var P=0;P{var r=e.exports=function(){this._cache={}};r.prototype.put=function(s,i){this._cache[s]=i},r.prototype.get=function(s){return this._cache[s]},r.prototype.del=function(s){delete this._cache[s]},r.prototype.clear=function(){this._cache={}}}),A9=Ce((a,e)=>{var r=Cn(),t=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31],i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,n=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,o=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,m=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,h=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;e.exports=d;function d(A){return A=A=="full"?"full":"fast",r.copy(d[A])}d.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:$,uuid:p,"json-pointer":m,"json-pointer-uri-fragment":f,"relative-json-pointer":h},d.full={date:x,time:b,"date-time":k,uri:P,"uri-reference":l,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:$,uuid:p,"json-pointer":m,"json-pointer-uri-fragment":f,"relative-json-pointer":h};function v(A){return A%4===0&&(A%100!==0||A%400===0)}function x(A){var F=A.match(t);if(!F)return!1;var q=+F[1],C=+F[2],R=+F[3];return C>=1&&C<=12&&R>=1&&R<=(C==2&&v(q)?29:s[C])}function b(A,F){var q=A.match(i);if(!q)return!1;var C=q[1],R=q[2],j=q[3],z=q[5];return(C<=23&&R<=59&&j<=59||C==23&&R==59&&j==60)&&(!F||z)}var E=/t|\s/i;function k(A){var F=A.split(E);return F.length==2&&x(F[0])&&b(F[1],!0)}var O=/\/|:/;function P(A){return O.test(A)&&o.test(A)}var I=/[^\\]\\Z/;function $(A){if(I.test(A))return!1;try{return new RegExp(A),!0}catch{return!1}}}),j9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.errSchemaPath+"/"+s,p=!t.opts.allErrors,m="data"+(l||""),f="valid"+o,h,d;if(c=="#"||c=="#/")t.isRoot?(h=t.async,d="validate"):(h=t.root.schema.$async===!0,d="root.refVal[0]");else{var v=t.resolveRef(t.baseId,c,t.isRoot);if(v===void 0){var x=t.MissingRefError.message(t.baseId,c);if(t.opts.missingRefs=="fail"){t.logger.error(x);var b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { ref: '"+t.util.escapeQuotes(c)+"' } ",t.opts.messages!==!1&&(n+=" , message: 'can\\'t resolve reference "+t.util.escapeQuotes(c)+"' "),t.opts.verbose&&(n+=" , schema: "+t.util.toQuotedString(c)+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";var E=n;n=b.pop(),!t.compositeRule&&p?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(n+=" if (false) { ")}else if(t.opts.missingRefs=="ignore")t.logger.warn(x),p&&(n+=" if (true) { ");else throw new t.MissingRefError(t.baseId,c,x)}else if(v.inline){var k=t.util.copy(t);k.level++;var O="valid"+k.level;k.schema=v.schema,k.schemaPath="",k.errSchemaPath=c;var P=t.validate(k).replace(/validate\.schema/g,v.code);n+=" "+P+" ",p&&(n+=" if ("+O+") { ")}else h=v.$async===!0||t.async&&v.$async!==!1,d=v.code}if(d){var b=b||[];b.push(n),n="",t.opts.passContext?n+=" "+d+".call(this, ":n+=" "+d+"( ",n+=" "+m+", (dataPath || '')",t.errorPath!='""'&&(n+=" + "+t.errorPath);var I=l?"data"+(l-1||""):"parentData",$=l?t.dataPathArr[l]:"parentDataProperty";n+=" , "+I+" , "+$+", rootData) ";var A=n;if(n=b.pop(),h){if(!t.async)throw new Error("async schema referenced by sync schema");p&&(n+=" var "+f+"; "),n+=" try { await "+A+"; ",p&&(n+=" "+f+" = true; "),n+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",p&&(n+=" "+f+" = false; "),n+=" } ",p&&(n+=" if ("+f+") { ")}else n+=" if (!"+A+") { if (vErrors === null) vErrors = "+d+".errors; else vErrors = vErrors.concat("+d+".errors); errors = vErrors.length; } ",p&&(n+=" else { ")}return n}}),N9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.schema[s],l=t.schemaPath+t.util.getProperty(s),c=t.errSchemaPath+"/"+s,u=!t.opts.allErrors,p=t.util.copy(t),m="";p.level++;var f="valid"+p.level,h=p.baseId,d=!0,v=o;if(v)for(var x,b=-1,E=v.length-1;b0||x===!1:t.util.schemaHasRules(x,t.RULES.all))&&(d=!1,p.schema=x,p.schemaPath=l+"["+b+"]",p.errSchemaPath=c+"/"+b,n+=" "+t.validate(p)+" ",p.baseId=h,u&&(n+=" if ("+f+") { ",m+="}"));return u&&(d?n+=" if (true) { ":n+=" "+m.slice(0,-1)+" "),n}}),D9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E=c.every(function(F){return t.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:t.util.schemaHasRules(F,t.RULES.all)});if(E){var k=v.baseId;n+=" var "+d+" = errors; var "+h+" = false; ";var O=t.compositeRule;t.compositeRule=v.compositeRule=!0;var P=c;if(P)for(var I,$=-1,A=P.length-1;${e.exports=function(t,s,i){var n=" ",o=t.schema[s],l=t.errSchemaPath+"/"+s,c=!t.opts.allErrors,u=t.util.toQuotedString(o);return t.opts.$comment===!0?n+=" console.log("+u+");":typeof t.opts.$comment=="function"&&(n+=" self._opts.$comment("+u+", "+t.util.toQuotedString(l)+", validate.root.schema);"),n}}),q9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c,d||(n+=" var schema"+o+" = validate.schema"+u+";"),n+="var "+h+" = equal("+f+", schema"+o+"); if (!"+h+") { ";var x=x||[];x.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { allowedValue: schema"+o+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be equal to constant' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var b=n;return n=x.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",m&&(n+=" else { "),n}}),M9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E="i"+o,k=v.dataLevel=t.dataLevel+1,O="data"+k,P=t.baseId,I=t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all);if(n+="var "+d+" = errors;var "+h+";",I){var $=t.compositeRule;t.compositeRule=v.compositeRule=!0,v.schema=c,v.schemaPath=u,v.errSchemaPath=p,n+=" var "+b+" = false; for (var "+E+" = 0; "+E+" < "+f+".length; "+E+"++) { ",v.errorPath=t.util.getPathExpr(t.errorPath,E,t.opts.jsonPointers,!0);var A=f+"["+E+"]";v.dataPathArr[k]=E;var F=t.validate(v);v.baseId=P,t.util.varOccurences(F,O)<2?n+=" "+t.util.varReplace(F,O,A)+" ":n+=" var "+O+" = "+A+"; "+F+" ",n+=" if ("+b+") break; } ",t.compositeRule=v.compositeRule=$,n+=" "+x+" if (!"+b+") {"}else n+=" if ("+f+".length == 0) {";var q=q||[];q.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'should contain a valid item' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var C=n;return n=q.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+C+"]); ":n+=" validate.errors = ["+C+"]; return false; ":n+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",I&&(n+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),t.opts.allErrors&&(n+=" } "),n}}),F9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t),v="";d.level++;var x="valid"+d.level,b={},E={},k=t.opts.ownProperties;for($ in c)if($!="__proto__"){var O=c[$],P=Array.isArray(O)?E:b;P[$]=O}n+="var "+h+" = errors;";var I=t.errorPath;n+="var missing"+o+";";for(var $ in E)if(P=E[$],P.length){if(n+=" if ( "+f+t.util.getProperty($)+" !== undefined ",k&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes($)+"') "),m){n+=" && ( ";var A=P;if(A)for(var F,q=-1,C=A.length-1;q0||O===!1:t.util.schemaHasRules(O,t.RULES.all))&&(n+=" "+x+" = true; if ( "+f+t.util.getProperty($)+" !== undefined ",k&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes($)+"') "),n+=") { ",d.schema=O,d.schemaPath=u+t.util.getProperty($),d.errSchemaPath=p+"/"+t.util.escapeFragment($),n+=" "+t.validate(d)+" ",d.baseId=ce,n+=" } ",m&&(n+=" if ("+x+") { ",v+="}"))}return m&&(n+=" "+v+" if ("+h+" == errors) {"),n}}),L9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c;var x="i"+o,b="schema"+o;d||(n+=" var "+b+" = validate.schema"+u+";"),n+="var "+h+";",d&&(n+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),n+=""+h+" = false;for (var "+x+"=0; "+x+"<"+b+".length; "+x+"++) if (equal("+f+", "+b+"["+x+"])) { "+h+" = true; break; }",d&&(n+=" } "),n+=" if (!"+h+") { ";var E=E||[];E.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { allowedValues: schema"+o+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be equal to one of the allowed values' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var k=n;return n=E.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+k+"]); ":n+=" validate.errors = ["+k+"]; return false; ":n+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",m&&(n+=" else { "),n}}),U9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||"");if(t.opts.format===!1)return m&&(n+=" if (true) { "),n;var h=t.opts.$data&&c&&c.$data,d;h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c;var v=t.opts.unknownFormats,x=Array.isArray(v);if(h){var b="format"+o,E="isObject"+o,k="formatType"+o;n+=" var "+b+" = formats["+d+"]; var "+E+" = typeof "+b+" == 'object' && !("+b+" instanceof RegExp) && "+b+".validate; var "+k+" = "+E+" && "+b+".type || 'string'; if ("+E+") { ",t.async&&(n+=" var async"+o+" = "+b+".async; "),n+=" "+b+" = "+b+".validate; } if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),n+=" (",v!="ignore"&&(n+=" ("+d+" && !"+b+" ",x&&(n+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),n+=") || "),n+=" ("+b+" && "+k+" == '"+i+"' && !(typeof "+b+" == 'function' ? ",t.async?n+=" (async"+o+" ? await "+b+"("+f+") : "+b+"("+f+")) ":n+=" "+b+"("+f+") ",n+=" : "+b+".test("+f+"))))) {"}else{var b=t.formats[c];if(!b){if(v=="ignore")return t.logger.warn('unknown format "'+c+'" ignored in schema at path "'+t.errSchemaPath+'"'),m&&(n+=" if (true) { "),n;if(x&&v.indexOf(c)>=0)return m&&(n+=" if (true) { "),n;throw new Error('unknown format "'+c+'" is used in schema at path "'+t.errSchemaPath+'"')}var E=typeof b=="object"&&!(b instanceof RegExp)&&b.validate,k=E&&b.type||"string";if(E){var O=b.async===!0;b=b.validate}if(k!=i)return m&&(n+=" if (true) { "),n;if(O){if(!t.async)throw new Error("async format in sync schema");var P="formats"+t.util.getProperty(c)+".validate";n+=" if (!(await "+P+"("+f+"))) { "}else{n+=" if (! ";var P="formats"+t.util.getProperty(c);E&&(P+=".validate"),typeof b=="function"?n+=" "+P+"("+f+") ":n+=" "+P+".test("+f+") ",n+=") { "}}var I=I||[];I.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { format: ",h?n+=""+d:n+=""+t.util.toQuotedString(c),n+=" } ",t.opts.messages!==!1&&(n+=` , message: 'should match format "`,h?n+="' + "+d+" + '":n+=""+t.util.escapeQuotes(c),n+=`"' `),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+t.util.toQuotedString(c),n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var $=n;return n=I.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+$+"]); ":n+=" validate.errors = ["+$+"]; return false; ":n+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",m&&(n+=" else { "),n}}),z9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t);v.level++;var x="valid"+v.level,b=t.schema.then,E=t.schema.else,k=b!==void 0&&(t.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:t.util.schemaHasRules(b,t.RULES.all)),O=E!==void 0&&(t.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:t.util.schemaHasRules(E,t.RULES.all)),P=v.baseId;if(k||O){var I;v.createErrors=!1,v.schema=c,v.schemaPath=u,v.errSchemaPath=p,n+=" var "+d+" = errors; var "+h+" = true; ";var $=t.compositeRule;t.compositeRule=v.compositeRule=!0,n+=" "+t.validate(v)+" ",v.baseId=P,v.createErrors=!0,n+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",t.compositeRule=v.compositeRule=$,k?(n+=" if ("+x+") { ",v.schema=t.schema.then,v.schemaPath=t.schemaPath+".then",v.errSchemaPath=t.errSchemaPath+"/then",n+=" "+t.validate(v)+" ",v.baseId=P,n+=" "+h+" = "+x+"; ",k&&O?(I="ifClause"+o,n+=" var "+I+" = 'then'; "):I="'then'",n+=" } ",O&&(n+=" else { ")):n+=" if (!"+x+") { ",O&&(v.schema=t.schema.else,v.schemaPath=t.schemaPath+".else",v.errSchemaPath=t.errSchemaPath+"/else",n+=" "+t.validate(v)+" ",v.baseId=P,n+=" "+h+" = "+x+"; ",k&&O?(I="ifClause"+o,n+=" var "+I+" = 'else'; "):I="'else'",n+=" } "),n+=" if (!"+h+") { var err = ",t.createErrors!==!1?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { failingKeyword: "+I+" } ",t.opts.messages!==!1&&(n+=` , message: 'should match "' + `+I+` + '" schema' `),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&m&&(t.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",m&&(n+=" else { ")}else m&&(n+=" if (true) { ");return n}}),H9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E="i"+o,k=v.dataLevel=t.dataLevel+1,O="data"+k,P=t.baseId;if(n+="var "+d+" = errors;var "+h+";",Array.isArray(c)){var I=t.schema.additionalItems;if(I===!1){n+=" "+h+" = "+f+".length <= "+c.length+"; ";var $=p;p=t.errSchemaPath+"/additionalItems",n+=" if (!"+h+") { ";var A=A||[];A.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+c.length+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have more than "+c.length+" items' "),t.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var F=n;n=A.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+F+"]); ":n+=" validate.errors = ["+F+"]; return false; ":n+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",p=$,m&&(x+="}",n+=" else { ")}var q=c;if(q){for(var C,R=-1,j=q.length-1;R0||C===!1:t.util.schemaHasRules(C,t.RULES.all)){n+=" "+b+" = true; if ("+f+".length > "+R+") { ";var z=f+"["+R+"]";v.schema=C,v.schemaPath=u+"["+R+"]",v.errSchemaPath=p+"/"+R,v.errorPath=t.util.getPathExpr(t.errorPath,R,t.opts.jsonPointers,!0),v.dataPathArr[k]=R;var B=t.validate(v);v.baseId=P,t.util.varOccurences(B,O)<2?n+=" "+t.util.varReplace(B,O,z)+" ":n+=" var "+O+" = "+z+"; "+B+" ",n+=" } ",m&&(n+=" if ("+b+") { ",x+="}")}}if(typeof I=="object"&&(t.opts.strictKeywords?typeof I=="object"&&Object.keys(I).length>0||I===!1:t.util.schemaHasRules(I,t.RULES.all))){v.schema=I,v.schemaPath=t.schemaPath+".additionalItems",v.errSchemaPath=t.errSchemaPath+"/additionalItems",n+=" "+b+" = true; if ("+f+".length > "+c.length+") { for (var "+E+" = "+c.length+"; "+E+" < "+f+".length; "+E+"++) { ",v.errorPath=t.util.getPathExpr(t.errorPath,E,t.opts.jsonPointers,!0);var z=f+"["+E+"]";v.dataPathArr[k]=E;var B=t.validate(v);v.baseId=P,t.util.varOccurences(B,O)<2?n+=" "+t.util.varReplace(B,O,z)+" ":n+=" var "+O+" = "+z+"; "+B+" ",m&&(n+=" if (!"+b+") break; "),n+=" } } ",m&&(n+=" if ("+b+") { ",x+="}")}}else if(t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all)){v.schema=c,v.schemaPath=u,v.errSchemaPath=p,n+=" for (var "+E+" = 0; "+E+" < "+f+".length; "+E+"++) { ",v.errorPath=t.util.getPathExpr(t.errorPath,E,t.opts.jsonPointers,!0);var z=f+"["+E+"]";v.dataPathArr[k]=E;var B=t.validate(v);v.baseId=P,t.util.varOccurences(B,O)<2?n+=" "+t.util.varReplace(B,O,z)+" ":n+=" var "+O+" = "+z+"; "+B+" ",m&&(n+=" if (!"+b+") break; "),n+=" }"}return m&&(n+=" "+x+" if ("+d+" == errors) {"),n}}),ME=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,P,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c;var v=s=="maximum",x=v?"exclusiveMaximum":"exclusiveMinimum",b=t.schema[x],E=t.opts.$data&&b&&b.$data,k=v?"<":">",O=v?">":"<",P=void 0;if(!(h||typeof c=="number"||c===void 0))throw new Error(s+" must be number");if(!(E||b===void 0||typeof b=="number"||typeof b=="boolean"))throw new Error(x+" must be number or boolean");if(E){var I=t.util.getData(b.$data,l,t.dataPathArr),$="exclusive"+o,A="exclType"+o,F="exclIsNumber"+o,q="op"+o,C="' + "+q+" + '";n+=" var schemaExcl"+o+" = "+I+"; ",I="schemaExcl"+o,n+=" var "+$+"; var "+A+" = typeof "+I+"; if ("+A+" != 'boolean' && "+A+" != 'undefined' && "+A+" != 'number') { ";var P=x,R=R||[];R.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: '"+x+" should be boolean' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var j=n;n=R.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+j+"]); ":n+=" validate.errors = ["+j+"]; return false; ":n+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" "+A+" == 'number' ? ( ("+$+" = "+d+" === undefined || "+I+" "+k+"= "+d+") ? "+f+" "+O+"= "+I+" : "+f+" "+O+" "+d+" ) : ( ("+$+" = "+I+" === true) ? "+f+" "+O+"= "+d+" : "+f+" "+O+" "+d+" ) || "+f+" !== "+f+") { var op"+o+" = "+$+" ? '"+k+"' : '"+k+"='; ",c===void 0&&(P=x,p=t.errSchemaPath+"/"+x,d=I,h=E)}else{var F=typeof b=="number",C=k;if(F&&h){var q="'"+C+"'";n+=" if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" ( "+d+" === undefined || "+b+" "+k+"= "+d+" ? "+f+" "+O+"= "+b+" : "+f+" "+O+" "+d+" ) || "+f+" !== "+f+") { "}else{F&&c===void 0?($=!0,P=x,p=t.errSchemaPath+"/"+x,d=b,O+="="):(F&&(d=Math[v?"min":"max"](b,c)),b===(F?d:!0)?($=!0,P=x,p=t.errSchemaPath+"/"+x,O+="="):($=!1,C+="="));var q="'"+C+"'";n+=" if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" "+f+" "+O+" "+d+" || "+f+" !== "+f+") { "}}P=P||s;var R=R||[];R.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { comparison: "+q+", limit: "+d+", exclusive: "+$+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be "+C+" ",h?n+="' + "+d:n+=""+d+"'"),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var j=n;return n=R.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+j+"]); ":n+=" validate.errors = ["+j+"]; return false; ":n+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",m&&(n+=" else { "),n}}),FE=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,x,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");var v=s=="maxItems"?">":"<";n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" "+f+".length "+v+" "+d+") { ";var x=s,b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(x||"_limitItems")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have ",s=="maxItems"?n+="more":n+="fewer",n+=" than ",h?n+="' + "+d+" + '":n+=""+c,n+=" items' "),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var E=n;return n=b.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),LE=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,x,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");var v=s=="maxLength"?">":"<";n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),t.opts.unicode===!1?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+v+" "+d+") { ";var x=s,b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(x||"_limitLength")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT be ",s=="maxLength"?n+="longer":n+="shorter",n+=" than ",h?n+="' + "+d+" + '":n+=""+c,n+=" characters' "),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var E=n;return n=b.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),UE=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,x,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");var v=s=="maxProperties"?">":"<";n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),n+=" Object.keys("+f+").length "+v+" "+d+") { ";var x=s,b=b||[];b.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(x||"_limitProperties")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { limit: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have ",s=="maxProperties"?n+="more":n+="fewer",n+=" than ",h?n+="' + "+d+" + '":n+=""+c,n+=" properties' "),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var E=n;return n=b.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),B9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;if(h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c,!(h||typeof c=="number"))throw new Error(s+" must be number");n+="var division"+o+";if (",h&&(n+=" "+d+" !== undefined && ( typeof "+d+" != 'number' || "),n+=" (division"+o+" = "+f+" / "+d+", ",t.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+t.opts.multipleOfPrecision+" ":n+=" division"+o+" !== parseInt(division"+o+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var v=v||[];v.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { multipleOf: "+d+" } ",t.opts.messages!==!1&&(n+=" , message: 'should be multiple of ",h?n+="' + "+d:n+=""+d+"'"),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var x=n;return n=v.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+x+"]); ":n+=" validate.errors = ["+x+"]; return false; ":n+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),V9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t);d.level++;var v="valid"+d.level;if(t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all)){d.schema=c,d.schemaPath=u,d.errSchemaPath=p,n+=" var "+h+" = errors; ";var x=t.compositeRule;t.compositeRule=d.compositeRule=!0,d.createErrors=!1;var b;d.opts.allErrors&&(b=d.opts.allErrors,d.opts.allErrors=!1),n+=" "+t.validate(d)+" ",d.createErrors=!0,b&&(d.opts.allErrors=b),t.compositeRule=d.compositeRule=x,n+=" if ("+v+") { ";var E=E||[];E.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var k=n;n=E.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+k+"]); ":n+=" validate.errors = ["+k+"]; return false; ":n+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",t.opts.allErrors&&(n+=" } ")}else n+=" var err = ",t.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",t.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",m&&(n+=" if (false) { ");return n}}),G9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d="errs__"+o,v=t.util.copy(t),x="";v.level++;var b="valid"+v.level,E=v.baseId,k="prevValid"+o,O="passingSchemas"+o;n+="var "+d+" = errors , "+k+" = false , "+h+" = false , "+O+" = null; ";var P=t.compositeRule;t.compositeRule=v.compositeRule=!0;var I=c;if(I)for(var $,A=-1,F=I.length-1;A0||$===!1:t.util.schemaHasRules($,t.RULES.all))?(v.schema=$,v.schemaPath=u+"["+A+"]",v.errSchemaPath=p+"/"+A,n+=" "+t.validate(v)+" ",v.baseId=E):n+=" var "+b+" = true; ",A&&(n+=" if ("+b+" && "+k+") { "+h+" = false; "+O+" = ["+O+", "+A+"]; } else { ",x+="}"),n+=" if ("+b+") { "+h+" = "+k+" = true; "+O+" = "+A+"; }";return t.compositeRule=v.compositeRule=P,n+=""+x+"if (!"+h+") { var err = ",t.createErrors!==!1?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { passingSchemas: "+O+" } ",t.opts.messages!==!1&&(n+=" , message: 'should match exactly one schema in oneOf' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&m&&(t.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",t.opts.allErrors&&(n+=" } "),n}}),Z9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h=t.opts.$data&&c&&c.$data,d;h?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",d="schema"+o):d=c;var v=h?"(new RegExp("+d+"))":t.usePattern(c);n+="if ( ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),n+=" !"+v+".test("+f+") ) { ";var x=x||[];x.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { pattern: ",h?n+=""+d:n+=""+t.util.toQuotedString(c),n+=" } ",t.opts.messages!==!1&&(n+=` , message: 'should match pattern "`,h?n+="' + "+d+" + '":n+=""+t.util.escapeQuotes(c),n+=`"' `),t.opts.verbose&&(n+=" , schema: ",h?n+="validate.schema"+u:n+=""+t.util.toQuotedString(c),n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var b=n;return n=x.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",m&&(n+=" else { "),n}}),W9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t),v="";d.level++;var x="valid"+d.level,b="key"+o,E="idx"+o,k=d.dataLevel=t.dataLevel+1,O="data"+k,P="dataProperties"+o,I=Object.keys(c||{}).filter(V),$=t.schema.patternProperties||{},A=Object.keys($).filter(V),F=t.schema.additionalProperties,q=I.length||A.length,C=F===!1,R=typeof F=="object"&&Object.keys(F).length,j=t.opts.removeAdditional,z=C||R||j,B=t.opts.ownProperties,G=t.baseId,te=t.schema.required;if(te&&!(t.opts.$data&&te.$data)&&te.length8)n+=" || validate.schema"+u+".hasOwnProperty("+b+") ";else{var re=I;if(re)for(var ce,Be=-1,be=re.length-1;Be0||Ue===!1:t.util.schemaHasRules(Ue,t.RULES.all)){var Qe=t.util.getProperty(ce),Ie=f+Qe,Ve=Ze&&Ue.default!==void 0;d.schema=Ue,d.schemaPath=u+Qe,d.errSchemaPath=p+"/"+t.util.escapeFragment(ce),d.errorPath=t.util.getPath(t.errorPath,ce,t.opts.jsonPointers),d.dataPathArr[k]=t.util.toQuotedString(ce);var he=t.validate(d);if(d.baseId=G,t.util.varOccurences(he,O)<2){he=t.util.varReplace(he,O,Ie);var Ke=Ie}else{var Ke=O;n+=" var "+O+" = "+Ie+"; "}if(Ve)n+=" "+he+" ";else{if(X&&X[ce]){n+=" if ( "+Ke+" === undefined ",B&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes(ce)+"') "),n+=") { "+x+" = false; ";var Z=t.errorPath,ue=p,bt=t.util.escapeQuotes(ce);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(Z,ce,t.opts.jsonPointers)),p=t.errSchemaPath+"/required";var W=W||[];W.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { missingProperty: '"+bt+"' } ",t.opts.messages!==!1&&(n+=" , message: '",t.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+bt+"\\'",n+="' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var Q=n;n=W.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+Q+"]); ":n+=" validate.errors = ["+Q+"]; return false; ":n+=" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p=ue,t.errorPath=Z,n+=" } else { "}else m?(n+=" if ( "+Ke+" === undefined ",B&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes(ce)+"') "),n+=") { "+x+" = true; } else { "):(n+=" if ("+Ke+" !== undefined ",B&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+t.util.escapeQuotes(ce)+"') "),n+=" ) { ");n+=" "+he+" } "}}m&&(n+=" if ("+x+") { ",v+="}")}}if(A.length){var xt=A;if(xt)for(var xe,wt=-1,Br=xt.length-1;wt0||Ue===!1:t.util.schemaHasRules(Ue,t.RULES.all)){d.schema=Ue,d.schemaPath=t.schemaPath+".patternProperties"+t.util.getProperty(xe),d.errSchemaPath=t.errSchemaPath+"/patternProperties/"+t.util.escapeFragment(xe),B?n+=" "+P+" = "+P+" || Object.keys("+f+"); for (var "+E+"=0; "+E+"<"+P+".length; "+E+"++) { var "+b+" = "+P+"["+E+"]; ":n+=" for (var "+b+" in "+f+") { ",n+=" if ("+t.usePattern(xe)+".test("+b+")) { ",d.errorPath=t.util.getPathExpr(t.errorPath,b,t.opts.jsonPointers);var Ie=f+"["+b+"]";d.dataPathArr[k]=b;var he=t.validate(d);d.baseId=G,t.util.varOccurences(he,O)<2?n+=" "+t.util.varReplace(he,O,Ie)+" ":n+=" var "+O+" = "+Ie+"; "+he+" ",m&&(n+=" if (!"+x+") break; "),n+=" } ",m&&(n+=" else "+x+" = true; "),n+=" } ",m&&(n+=" if ("+x+") { ",v+="}")}}}return m&&(n+=" "+v+" if ("+h+" == errors) {"),n}}),K9=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="errs__"+o,d=t.util.copy(t),v="";d.level++;var x="valid"+d.level;if(n+="var "+h+" = errors;",t.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:t.util.schemaHasRules(c,t.RULES.all)){d.schema=c,d.schemaPath=u,d.errSchemaPath=p;var b="key"+o,E="idx"+o,k="i"+o,O="' + "+b+" + '",P=d.dataLevel=t.dataLevel+1,I="data"+P,$="dataProperties"+o,A=t.opts.ownProperties,F=t.baseId;A&&(n+=" var "+$+" = undefined; "),A?n+=" "+$+" = "+$+" || Object.keys("+f+"); for (var "+E+"=0; "+E+"<"+$+".length; "+E+"++) { var "+b+" = "+$+"["+E+"]; ":n+=" for (var "+b+" in "+f+") { ",n+=" var startErrs"+o+" = errors; ";var q=b,C=t.compositeRule;t.compositeRule=d.compositeRule=!0;var R=t.validate(d);d.baseId=F,t.util.varOccurences(R,I)<2?n+=" "+t.util.varReplace(R,I,q)+" ":n+=" var "+I+" = "+q+"; "+R+" ",t.compositeRule=d.compositeRule=C,n+=" if (!"+x+") { for (var "+k+"=startErrs"+o+"; "+k+"{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c;var x="schema"+o;if(!d)if(c.length0||I===!1:t.util.schemaHasRules(I,t.RULES.all))||(b[b.length]=k)}}else var b=c;if(d||b.length){var $=t.errorPath,A=d||b.length>=t.opts.loopRequired,F=t.opts.ownProperties;if(m)if(n+=" var missing"+o+"; ",A){d||(n+=" var "+x+" = validate.schema"+u+"; ");var q="i"+o,C="schema"+o+"["+q+"]",R="' + "+C+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr($,C,t.opts.jsonPointers)),n+=" var "+h+" = true; ",d&&(n+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),n+=" for (var "+q+" = 0; "+q+" < "+x+".length; "+q+"++) { "+h+" = "+f+"["+x+"["+q+"]] !== undefined ",F&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", "+x+"["+q+"]) "),n+="; if (!"+h+") break; } ",d&&(n+=" } "),n+=" if (!"+h+") { ";var j=j||[];j.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { missingProperty: '"+R+"' } ",t.opts.messages!==!1&&(n+=" , message: '",t.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+R+"\\'",n+="' "),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var z=n;n=j.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+z+"]); ":n+=" validate.errors = ["+z+"]; return false; ":n+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var B=b;if(B)for(var G,q=-1,te=B.length-1;q{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f="data"+(l||""),h="valid"+o,d=t.opts.$data&&c&&c.$data,v;if(d?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",v="schema"+o):v=c,(c||d)&&t.opts.uniqueItems!==!1){d&&(n+=" var "+h+"; if ("+v+" === false || "+v+" === undefined) "+h+" = true; else if (typeof "+v+" != 'boolean') "+h+" = false; else { "),n+=" var i = "+f+".length , "+h+" = true , j; if (i > 1) { ";var x=t.schema.items&&t.schema.items.type,b=Array.isArray(x);if(!x||x=="object"||x=="array"||b&&(x.indexOf("object")>=0||x.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var E="checkDataType"+(b?"s":"");n+=" if ("+t.util[E](x,"item",t.opts.strictNumbers,!0)+") continue; ",b&&(n+=` if (typeof item == 'string') item = '"' + item; `),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",d&&(n+=" } "),n+=" if (!"+h+") { ";var k=k||[];k.push(n),n="",t.createErrors!==!1?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { i: i, j: j } ",t.opts.messages!==!1&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),t.opts.verbose&&(n+=" , schema: ",d?n+="validate.schema"+u:n+=""+c,n+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var O=n;n=k.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+O+"]); ":n+=" validate.errors = ["+O+"]; return false; ":n+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",m&&(n+=" else { ")}else m&&(n+=" if (true) { ");return n}}),J9=Ce((a,e)=>{e.exports={$ref:j9(),allOf:N9(),anyOf:D9(),$comment:$9(),const:q9(),contains:M9(),dependencies:F9(),enum:L9(),format:U9(),if:z9(),items:H9(),maximum:ME(),minimum:ME(),maxItems:FE(),minItems:FE(),maxLength:LE(),minLength:LE(),maxProperties:UE(),minProperties:UE(),multipleOf:B9(),not:V9(),oneOf:G9(),pattern:Z9(),properties:W9(),propertyNames:K9(),required:Q9(),uniqueItems:X9(),validate:e1()}}),Y9=Ce((a,e)=>{var r=J9(),t=Cn().toHash;e.exports=function(){var i=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],n=["type","$comment"],o=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],l=["number","integer","string","array","object","boolean","null"];return i.all=t(n),i.types=t(l),i.forEach(function(c){c.rules=c.rules.map(function(u){var p;if(typeof u=="object"){var m=Object.keys(u)[0];p=u[m],u=m,p.forEach(function(h){n.push(h),i.all[h]=!0})}n.push(u);var f=i.all[u]={keyword:u,code:r[u],implements:p};return f}),i.all.$comment={keyword:"$comment",code:r.$comment},c.type&&(i.types[c.type]=c)}),i.keywords=t(n.concat(o)),i.custom={},i}}),eN=Ce((a,e)=>{var r=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(t,s){for(var i=0;i{var r=jd().MissingRef;e.exports=t;function t(s,i,n){var o=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof i=="function"&&(n=i,i=void 0);var l=c(s).then(function(){var p=o._addSchema(s,void 0,i);return p.validate||u(p)});return n&&l.then(function(p){n(null,p)},n),l;function c(p){var m=p.$schema;return m&&!o.getSchema(m)?t.call(o,{$ref:m},!0):Promise.resolve()}function u(p){try{return o._compile(p)}catch(f){if(f instanceof r)return m(f);throw f}function m(f){var h=f.missingSchema;if(x(h))throw new Error("Schema "+h+" is loaded but "+f.missingRef+" cannot be resolved");var d=o._loadingSchemas[h];return d||(d=o._loadingSchemas[h]=o._opts.loadSchema(h),d.then(v,v)),d.then(function(b){if(!x(h))return c(b).then(function(){x(h)||o.addSchema(b,h,void 0,i)})}).then(function(){return u(p)});function v(){delete o._loadingSchemas[h]}function x(b){return o._refs[b]||o._schemas[b]}}}}}),rN=Ce((a,e)=>{e.exports=function(t,s,i){var n=" ",o=t.level,l=t.dataLevel,c=t.schema[s],u=t.schemaPath+t.util.getProperty(s),p=t.errSchemaPath+"/"+s,m=!t.opts.allErrors,f,h="data"+(l||""),d="valid"+o,v="errs__"+o,x=t.opts.$data&&c&&c.$data,b;x?(n+=" var schema"+o+" = "+t.util.getData(c.$data,l,t.dataPathArr)+"; ",b="schema"+o):b=c;var E=this,k="definition"+o,O=E.definition,P="",I,$,A,F,q;if(x&&O.$data){q="keywordValidate"+o;var C=O.validateSchema;n+=" var "+k+" = RULES.custom['"+s+"'].definition; var "+q+" = "+k+".validate;"}else{if(F=t.useCustomRule(E,c,t.schema,t),!F)return;b="validate.schema"+u,q=F.code,I=O.compile,$=O.inline,A=O.macro}var R=q+".errors",j="i"+o,z="ruleErr"+o,B=O.async;if(B&&!t.async)throw new Error("async keyword in sync schema");if($||A||(n+=""+R+" = null;"),n+="var "+v+" = errors;var "+d+";",x&&O.$data&&(P+="}",n+=" if ("+b+" === undefined) { "+d+" = true; } else { ",C&&(P+="}",n+=" "+d+" = "+k+".validateSchema("+b+"); if ("+d+") { ")),$)O.statements?n+=" "+F.validate+" ":n+=" "+d+" = "+F.validate+"; ";else if(A){var G=t.util.copy(t),P="";G.level++;var te="valid"+G.level;G.schema=F.validate,G.schemaPath="";var X=t.compositeRule;t.compositeRule=G.compositeRule=!0;var V=t.validate(G).replace(/validate\.schema/g,q);t.compositeRule=G.compositeRule=X,n+=" "+V}else{var re=re||[];re.push(n),n="",n+=" "+q+".call( ",t.opts.passContext?n+="this":n+="self",I||O.schema===!1?n+=" , "+h+" ":n+=" , "+b+" , "+h+" , validate.schema"+t.schemaPath+" ",n+=" , (dataPath || '')",t.errorPath!='""'&&(n+=" + "+t.errorPath);var ce=l?"data"+(l-1||""):"parentData",Be=l?t.dataPathArr[l]:"parentDataProperty";n+=" , "+ce+" , "+Be+" , rootData ) ";var be=n;n=re.pop(),O.errors===!1?(n+=" "+d+" = ",B&&(n+="await "),n+=""+be+"; "):B?(R="customErrors"+o,n+=" var "+R+" = null; try { "+d+" = await "+be+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+R+" = e.errors; else throw e; } "):n+=" "+R+" = null; "+d+" = "+be+"; "}if(O.modifying&&(n+=" if ("+ce+") "+h+" = "+ce+"["+Be+"];"),n+=""+P,O.valid)m&&(n+=" if (true) { ");else{n+=" if ( ",O.valid===void 0?(n+=" !",A?n+=""+te:n+=""+d):n+=" "+!O.valid+" ",n+=") { ",f=E.keyword;var re=re||[];re.push(n),n="";var re=re||[];re.push(n),n="",t.createErrors!==!1?(n+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: { keyword: '"+E.keyword+"' } ",t.opts.messages!==!1&&(n+=` , message: 'should pass "`+E.keyword+`" keyword validation' `),t.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var qe=n;n=re.pop(),!t.compositeRule&&m?t.async?n+=" throw new ValidationError(["+qe+"]); ":n+=" validate.errors = ["+qe+"]; return false; ":n+=" var err = "+qe+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var xe=n;n=re.pop(),$?O.errors?O.errors!="full"&&(n+=" for (var "+j+"="+v+"; "+j+"{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),aN=Ce((a,e)=>{var r=t1();e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:r.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:r.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),sN=Ce((a,e)=>{var r=/^[a-z_$][a-z0-9_$-]*$/i,t=rN(),s=aN();e.exports={add:i,get:n,remove:o,validate:l};function i(c,u){var p=this.RULES;if(p.keywords[c])throw new Error("Keyword "+c+" is already defined");if(!r.test(c))throw new Error("Keyword "+c+" is not a valid identifier");if(u){this.validateKeyword(u,!0);var m=u.type;if(Array.isArray(m))for(var f=0;f{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),iN=Ce((a,e)=>{var r=C9(),t=Ad(),s=I9(),i=JE(),n=YE(),o=A9(),l=Y9(),c=eN(),u=Cn();e.exports=v,v.prototype.validate=x,v.prototype.compile=b,v.prototype.addSchema=E,v.prototype.addMetaSchema=k,v.prototype.validateSchema=O,v.prototype.getSchema=I,v.prototype.removeSchema=F,v.prototype.addFormat=X,v.prototype.errorsText=te,v.prototype._addSchema=C,v.prototype._compile=R,v.prototype.compileAsync=tN();var p=sN();v.prototype.addKeyword=p.add,v.prototype.getKeyword=p.get,v.prototype.removeKeyword=p.remove,v.prototype.validateKeyword=p.validate;var m=jd();v.ValidationError=m.Validation,v.MissingRefError=m.MissingRef,v.$dataMetaSchema=c;var f="http://json-schema.org/draft-07/schema",h=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],d=["/properties"];function v(U){if(!(this instanceof v))return new v(U);U=this._opts=u.copy(U)||{},xe(this),this._schemas={},this._refs={},this._fragments={},this._formats=o(U.format),this._cache=U.cache||new s,this._loadingSchemas={},this._compilations=[],this.RULES=l(),this._getId=j(U),U.loopRequired=U.loopRequired||1/0,U.errorDataPath=="property"&&(U._errorDataPathProperty=!0),U.serialize===void 0&&(U.serialize=n),this._metaOpts=qe(this),U.formats&&ce(this),U.keywords&&Be(this),V(this),typeof U.meta=="object"&&this.addMetaSchema(U.meta),U.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),re(this)}function x(U,Z){var ee;if(typeof U=="string"){if(ee=this.getSchema(U),!ee)throw new Error('no schema with key or ref "'+U+'"')}else{var ue=this._addSchema(U);ee=ue.validate||this._compile(ue)}var W=ee(Z);return ee.$async!==!0&&(this.errors=ee.errors),W}function b(U,Z){var ee=this._addSchema(U,void 0,Z);return ee.validate||this._compile(ee)}function E(U,Z,ee,ue){if(Array.isArray(U)){for(var W=0;W0&&R.push("--allowedTools",P.join(",")),I.length>0&&R.push("--disallowedTools",I.join(",")),$&&Object.keys($).length>0&&R.push("--mcp-config",JSON.stringify({mcpServers:$})),r&&Object.keys(r).length>0&&R.push("--agents",JSON.stringify(r)),O&&R.push("--setting-sources",O.join(",")),A&&R.push("--strict-mcp-config"),v&&R.push("--permission-mode",v),x&&R.push("--allow-dangerously-skip-permissions"),d){if(h&&d===h)throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");R.push("--fallback-model",d)}q&&R.push("--include-partial-messages");for(let V of e)R.push("--add-dir",V);if(C&&C.length>0)for(let V of C)if(V.type==="local")R.push("--plugin-dir",V.path);else throw new Error(`Unsupported plugin type: ${V.type}`);this.options.forkSession&&R.push("--fork-session"),this.options.resumeSessionAt&&R.push("--resume-session-at",this.options.resumeSessionAt);for(let[V,re]of Object.entries(n))re===null?R.push(`--${V}`):R.push(`--${V}`,re);if(l.CLAUDE_CODE_ENTRYPOINT||(l.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),!aa().existsSync(o)){let V=zE(o)?`Claude Code native binary not found at ${o}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${o}. Is options.pathToClaudeCodeExecutable set?`;throw new ReferenceError(V)}let z=zE(o),B=z?o:s,G=z?[...i,...R]:[...i,o,...R];this.logForDebugging(z?`Spawning Claude Code native binary: ${B} ${G.join(" ")}`:`Spawning Claude Code process: ${B} ${G.join(" ")}`);let te=l.DEBUG||c?"pipe":"ignore";this.child=(0,n1.spawn)(B,G,{cwd:t,stdio:["pipe","pipe",te],signal:this.abortController.signal,env:l}),this.childStdin=this.child.stdin,this.childStdout=this.child.stdout,(l.DEBUG||c)&&this.child.stderr.on("data",V=>{this.logForDebugging(V.toString())});let X=()=>{this.child&&!this.child.killed&&this.child.kill("SIGTERM")};this.processExitHandler=X,this.abortHandler=X,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.child.on("error",V=>{this.ready=!1,this.abortController.signal.aborted?this.exitError=new hs("Claude Code process aborted by user"):(this.exitError=new Error(`Failed to spawn Claude Code process: ${V.message}`),this.logForDebugging(this.exitError.message))}),this.child.on("close",(V,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new hs("Claude Code process aborted by user");else{let ce=this.getProcessExitError(V,re);ce&&(this.exitError=ce,this.logForDebugging(ce.message))}}),this.ready=!0}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return new Error(`Claude Code process exited with code ${e}`);if(r)return new Error(`Claude Code process terminated by signal ${r}`)}logForDebugging(e){process.env.DEBUG&&process.stderr.write(`${e} `),this.options.stderr&&this.options.stderr(e)}write(e){if(this.abortController.signal.aborted)throw new hs("Operation aborted");if(!this.ready||!this.childStdin)throw new Error("ProcessTransport is not ready for writing");if(this.child?.killed||this.child?.exitCode!==null)throw new Error("Cannot write to terminated process");if(this.exitError)throw new Error(`Cannot write to process that exited with error: ${this.exitError.message}`);process.env.DEBUG_SDK&&process.stderr.write(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)} `);try{!this.childStdin.write(e)&&process.env.DEBUG_SDK&&console.warn("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,new Error(`Failed to write to process stdin: ${r.message}`)}}close(){this.childStdin&&(this.childStdin.end(),this.childStdin=void 0),this.processExitHandler&&(process.off("exit",this.processExitHandler),this.processExitHandler=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:e}of this.exitListeners)this.child?.off("exit",e);this.exitListeners=[],this.child&&!this.child.killed&&(this.child.kill("SIGTERM"),setTimeout(()=>{this.child&&!this.child.killed&&this.child.kill("SIGKILL")},5e3)),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.childStdout)throw new Error("ProcessTransport output stream not available");let e=(0,i1.createInterface)({input:this.childStdout});try{for await(let r of e)r.trim()&&(yield JSON.parse(r));await this.waitForExit()}catch(r){throw r}finally{e.close()}}endInput(){this.childStdin&&this.childStdin.end()}getInputStream(){return this.childStdin}onExit(e){if(!this.child)return()=>{};let r=(t,s)=>{let i=this.getProcessExitError(t,s);e(i)};return this.child.on("exit",r),this.exitListeners.push({callback:e,handler:r}),()=>{this.child&&this.child.off("exit",r);let t=this.exitListeners.findIndex(s=>s.handler===r);t!==-1&&this.exitListeners.splice(t,1)}}async waitForExit(){if(!this.child){if(this.exitError)throw this.exitError;return}if(this.child.exitCode!==null||this.child.killed){if(this.exitError)throw this.exitError;return}return new Promise((e,r)=>{let t=(i,n)=>{if(this.abortController.signal.aborted){r(new hs("Operation aborted"));return}let o=this.getProcessExitError(i,n);o?r(o):e()};this.child.once("exit",t);let s=i=>{this.child.off("exit",t),r(i)};this.child.once("error",s),this.child.once("exit",()=>{this.child.off("error",s)})})}};function zE(a){return![".js",".mjs",".tsx",".ts",".jsx"].some(r=>a.endsWith(r))}var Ed=class{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw new Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,r)=>{this.readResolve=e,this.readReject=r})}enqueue(e){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}},wd=class{sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw new Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},uN=typeof global=="object"&&global&&global.Object===Object&&global,pN=uN,dN=typeof self=="object"&&self&&self.Object===Object&&self,fN=pN||dN||Function("return this")(),Nd=fN,mN=Nd.Symbol,zc=mN,l1=Object.prototype,hN=l1.hasOwnProperty,vN=l1.toString,ki=zc?zc.toStringTag:void 0;function gN(a){var e=hN.call(a,ki),r=a[ki];try{a[ki]=void 0;var t=!0}catch{}var s=vN.call(a);return t&&(e?a[ki]=r:delete a[ki]),s}var yN=gN,bN=Object.prototype,xN=bN.toString;function _N(a){return xN.call(a)}var EN=_N,wN="[object Null]",SN="[object Undefined]",HE=zc?zc.toStringTag:void 0;function PN(a){return a==null?a===void 0?SN:wN:HE&&HE in Object(a)?yN(a):EN(a)}var RN=PN;function TN(a){var e=typeof a;return a!=null&&(e=="object"||e=="function")}var u1=TN,kN="[object AsyncFunction]",ON="[object Function]",CN="[object GeneratorFunction]",IN="[object Proxy]";function AN(a){if(!u1(a))return!1;var e=RN(a);return e==ON||e==CN||e==kN||e==IN}var jN=AN,NN=Nd["__core-js_shared__"],gd=NN,BE=(function(){var a=/[^.]+$/.exec(gd&&gd.keys&&gd.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function DN(a){return!!BE&&BE in a}var $N=DN,qN=Function.prototype,MN=qN.toString;function FN(a){if(a!=null){try{return MN.call(a)}catch{}try{return a+""}catch{}}return""}var LN=FN,UN=/[\\^$.*+?()[\]{}|]/g,zN=/^\[object .+?Constructor\]$/,HN=Function.prototype,BN=Object.prototype,VN=HN.toString,GN=BN.hasOwnProperty,ZN=RegExp("^"+VN.call(GN).replace(UN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function WN(a){if(!u1(a)||$N(a))return!1;var e=jN(a)?ZN:zN;return e.test(LN(a))}var KN=WN;function QN(a,e){return a?.[e]}var XN=QN;function JN(a,e){var r=XN(a,e);return KN(r)?r:void 0}var p1=JN;function YN(a,e){return a===e||a!==a&&e!==e}var eD=YN,tD=p1(Object,"create"),Oi=tD;function rD(){this.__data__=Oi?Oi(null):{},this.size=0}var aD=rD;function sD(a){var e=this.has(a)&&delete this.__data__[a];return this.size-=e?1:0,e}var nD=sD,iD="__lodash_hash_undefined__",oD=Object.prototype,cD=oD.hasOwnProperty;function lD(a){var e=this.__data__;if(Oi){var r=e[a];return r===iD?void 0:r}return cD.call(e,a)?e[a]:void 0}var uD=lD,pD=Object.prototype,dD=pD.hasOwnProperty;function fD(a){var e=this.__data__;return Oi?e[a]!==void 0:dD.call(e,a)}var mD=fD,hD="__lodash_hash_undefined__";function vD(a,e){var r=this.__data__;return this.size+=this.has(a)?0:1,r[a]=Oi&&e===void 0?hD:e,this}var gD=vD;function In(a){var e=-1,r=a==null?0:a.length;for(this.clear();++e-1}var kD=TD;function OD(a,e){var r=this.__data__,t=Kc(r,a);return t<0?(++this.size,r.push([a,e])):r[t][1]=e,this}var CD=OD;function An(a){var e=-1,r=a==null?0:a.length;for(this.clear();++e{if(!a||a.trim()==="")return null;let e=a.split(",").map(i=>i.trim()).filter(Boolean);if(e.length===0)return null;let r=e.some(i=>i.startsWith("!")),t=e.some(i=>!i.startsWith("!"));if(r&&t)return null;let s=e.map(i=>i.replace(/^!/,"").toLowerCase());return{include:r?[]:s,exclude:r?s:[],isExclusive:r}});function QD(a){let e=[],r=a.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])e.push("mcp"),e.push(r[1].toLowerCase());else{let i=a.match(/^([^:[]+):/);i&&i[1]&&e.push(i[1].trim().toLowerCase())}let t=a.match(/^\[([^\]]+)]/);t&&t[1]&&e.push(t[1].trim().toLowerCase()),a.toLowerCase().includes("statsig event:")&&e.push("statsig");let s=a.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(s&&s[1]){let i=s[1].trim().toLowerCase();i.length<30&&!i.includes(" ")&&e.push(i)}return Array.from(new Set(e))}function XD(a,e){return e?a.length===0?!1:e.isExclusive?!a.some(r=>e.exclude.includes(r)):a.some(r=>e.include.includes(r)):!0}function JD(a,e){if(!e)return!0;let r=QD(a);return XD(r,e)}function YD(){return process.env.CLAUDE_CONFIG_DIR??(0,f1.join)((0,m1.homedir)(),".claude")}function ZE(a){if(!a)return!1;if(typeof a=="boolean")return a;let e=a.toLowerCase().trim();return["1","true","yes","on"].includes(e)}var e5={name:"BASH_MAX_OUTPUT_LENGTH",default:3e4,validate:a=>{if(!a)return{effective:3e4,status:"valid"};let t=parseInt(a,10);return isNaN(t)||t<=0?{effective:3e4,status:"invalid",message:`Invalid value "${a}" (using default: 30000)`}:t>15e4?{effective:15e4,status:"capped",message:`Capped from ${t} to 150000`}:{effective:t,status:"valid"}}},t5={name:"CLAUDE_CODE_MAX_OUTPUT_TOKENS",default:32e3,validate:a=>{if(!a)return{effective:32e3,status:"valid"};let e=parseInt(a,10);return isNaN(e)||e<=0?{effective:32e3,status:"invalid",message:`Invalid value "${a}" (using default: 32000)`}:e>32e3?{effective:32e3,status:"capped",message:`Capped from ${e} to 32000`}:{effective:e,status:"valid"}}};function r5(){return{originalCwd:(0,Sd.cwd)(),totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:(0,Sd.cwd)(),modelUsage:{},mainLoopModelOverride:void 0,maxRateLimitFallbackActive:!1,initialMainLoopModel:null,modelStrings:null,isNonInteractiveSession:!0,isInteractive:!1,clientType:"cli",sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,sessionId:(0,h1.randomUUID)(),loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,envVarValidators:[e5,t5],lastAPIRequest:null,inMemoryErrorLog:[],inlinePlugins:[]}}var a5=r5();function s5(){return a5.sessionId}var F3=ji(()=>ZE(process.env.DEBUG)||ZE(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||v1()||process.argv.some(a=>a.startsWith("--debug="))),n5=ji(()=>{let a=process.argv.find(r=>r.startsWith("--debug="));if(!a)return null;let e=a.substring(8);return KD(e)}),v1=ji(()=>process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e"));function i5(a){if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=n5();return JD(a,e)}var o5=!1;function ea(a,{level:e}={level:"debug"}){if(!i5(a))return;o5&&a.includes(` `)&&(a=JSON.stringify(a));let r=`[${e.toUpperCase()}] ${a.trim()} @@ -837,9 +837,9 @@ MEMORY PROCESSING CONTINUED `))}catch(t){let s={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:t.message||String(t)}};await Promise.resolve(this.transport.write(JSON.stringify(s)+` `))}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let r=this.cancelControllers.get(e.request_id);r&&(r.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,r){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw new Error("canUseTool callback is not provided.");return this.canUseTool(e.request.tool_name,e.request.input,{signal:r,suggestions:e.request.permission_suggestions})}else{if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,r);if(e.request.subtype==="mcp_message"){let t=e.request,s=this.sdkMcpTransports.get(t.server_name);if(!s)throw new Error(`SDK MCP server not found: ${t.server_name}`);return"method"in t.message&&"id"in t.message&&t.message.id!==null?{mcp_response:await this.handleMcpControlRequest(t.server_name,t,s)}:(s.onmessage&&s.onmessage(t.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}}throw new Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){for await(let e of this.inputStream)yield e}async initialize(){let e;if(this.hooks){e={};for(let[i,n]of Object.entries(this.hooks))n.length>0&&(e[i]=n.map(o=>{let l=[];for(let c of o.hooks){let u=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(u,c),l.push(u)}return{matcher:o.matcher,hookCallbackIds:l}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,t={subtype:"initialize",hooks:e,sdkMcpServers:r};return(await this.request(t)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}request(e){let r=Math.random().toString(36).substring(2,15),t={request_id:r,type:"control_request",request:e};return new Promise((s,i)=>{this.pendingControlResponses.set(r,n=>{n.subtype==="success"?s(n):i(new Error(n.error))}),Promise.resolve(this.transport.write(JSON.stringify(t)+` `))})}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async accountInfo(){return(await this.initialization).account}async streamInput(e){ea("[Query.streamInput] Starting to process input stream"),ea(`[Query.streamInput] this.sdkMcpTransports.size = ${this.sdkMcpTransports.size}`);try{let r=0;for await(let t of e){if(r++,ea(`[Query.streamInput] Processing message ${r}: ${t.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(JSON.stringify(t)+` -`))}if(ea(`[Query.streamInput] Finished processing ${r} messages from input stream`),ea(`[Query.streamInput] About to check MCP servers. this.sdkMcpTransports.size = ${this.sdkMcpTransports.size}`),this.sdkMcpTransports.size>0&&this.firstResultReceivedPromise){ea("[Query.streamInput] Entering Promise.race to wait for result");let t=1e4,s;await Promise.race([this.firstResultReceivedPromise.then(()=>{ea("[Query.streamInput] Received first result, closing input stream"),s&&clearTimeout(s)}),new Promise(i=>{s=setTimeout(()=>{ea("[Query.streamInput] Timed out waiting for first result, closing input stream"),i()},t)})]),s&&clearTimeout(s)}ea("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof hs))throw r}}handleHookCallbacks(e,r,t,s){let i=this.hookCallbacks.get(e);if(!i)throw new Error(`No hook callback found for ID: ${e}`);return i(r,t,{signal:s})}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let t=`${e}:${r.id}`,s=this.pendingMcpResponses.get(t);if(s){s.resolve(r),this.pendingMcpResponses.delete(t);return}}throw new Error("No pending request found")}handleMcpControlRequest(e,r,t){let s="id"in r.message?r.message.id:null,i=`${e}:${s}`;return new Promise((n,o)=>{let l=null,c=()=>{l&&clearTimeout(l),this.pendingMcpResponses.delete(i)},u=m=>{c(),n(m)},p=m=>{c(),o(m)};if(this.pendingMcpResponses.set(i,{resolve:u,reject:p}),t.onmessage)t.onmessage(r.message);else{c(),o(new Error("No message handler registered"));return}l=setTimeout(()=>{this.pendingMcpResponses.has(i)&&(c(),o(new Error("Request timeout")))},3e4)})}},w={};Rj(w,{void:()=>G5,util:()=>Ge,unknown:()=>B5,union:()=>Q5,undefined:()=>U5,tuple:()=>Y5,transformer:()=>QE,symbol:()=>L5,string:()=>w1,strictObject:()=>K5,setErrorMap:()=>p5,set:()=>r6,record:()=>e6,quotelessJson:()=>l5,promise:()=>c6,preprocess:()=>p6,pipeline:()=>d6,ostring:()=>f6,optional:()=>l6,onumber:()=>m6,oboolean:()=>h6,objectUtil:()=>Rd,object:()=>W5,number:()=>S1,nullable:()=>u6,null:()=>z5,never:()=>V5,nativeEnum:()=>o6,nan:()=>q5,map:()=>t6,makeIssue:()=>Bc,literal:()=>n6,lazy:()=>s6,late:()=>D5,isValid:()=>gs,isDirty:()=>kd,isAsync:()=>Ci,isAborted:()=>Td,intersection:()=>J5,instanceof:()=>$5,getParsedType:()=>ra,getErrorMap:()=>Hc,function:()=>a6,enum:()=>i6,effect:()=>QE,discriminatedUnion:()=>X5,defaultErrorMap:()=>Sn,datetimeRegex:()=>x1,date:()=>F5,custom:()=>E1,coerce:()=>v6,boolean:()=>P1,bigint:()=>M5,array:()=>Z5,any:()=>H5,addIssueToContext:()=>se,ZodVoid:()=>Rn,ZodUnknown:()=>sa,ZodUnion:()=>Ss,ZodUndefined:()=>Es,ZodType:()=>je,ZodTuple:()=>Ur,ZodTransformer:()=>Xt,ZodSymbol:()=>Pn,ZodString:()=>ka,ZodSet:()=>kn,ZodSchema:()=>je,ZodRecord:()=>Gc,ZodReadonly:()=>As,ZodPromise:()=>Ca,ZodPipeline:()=>Ai,ZodParsedType:()=>le,ZodOptional:()=>dr,ZodObject:()=>Ut,ZodNumber:()=>ys,ZodNullable:()=>zr,ZodNull:()=>ws,ZodNever:()=>Pr,ZodNativeEnum:()=>Os,ZodNaN:()=>On,ZodMap:()=>Tn,ZodLiteral:()=>Ts,ZodLazy:()=>Rs,ZodIssueCode:()=>Y,ZodIntersection:()=>Ps,ZodFunction:()=>Zc,ZodFirstPartyTypeKind:()=>Pe,ZodError:()=>Qt,ZodEnum:()=>ks,ZodEffects:()=>Xt,ZodDiscriminatedUnion:()=>Vc,ZodDefault:()=>Cs,ZodDate:()=>_s,ZodCatch:()=>Is,ZodBranded:()=>Ii,ZodBoolean:()=>xs,ZodBigInt:()=>bs,ZodArray:()=>na,ZodAny:()=>Oa,Schema:()=>je,ParseStatus:()=>Rt,OK:()=>Ot,NEVER:()=>g6,INVALID:()=>we,EMPTY_PATH:()=>d5,DIRTY:()=>wn,BRAND:()=>N5});var Ge;(function(a){a.assertEqual=s=>{};function e(s){}a.assertIs=e;function r(s){throw new Error}a.assertNever=r,a.arrayToEnum=s=>{let i={};for(let n of s)i[n]=n;return i},a.getValidEnumValues=s=>{let i=a.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),n={};for(let o of i)n[o]=s[o];return a.objectValues(n)},a.objectValues=s=>a.objectKeys(s).map(function(i){return s[i]}),a.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let n in s)Object.prototype.hasOwnProperty.call(s,n)&&i.push(n);return i},a.find=(s,i)=>{for(let n of s)if(i(n))return n},a.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function t(s,i=" | "){return s.map(n=>typeof n=="string"?`'${n}'`:n).join(i)}a.joinValues=t,a.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ge||(Ge={}));var Rd;(function(a){a.mergeShapes=(e,r)=>({...e,...r})})(Rd||(Rd={}));var le=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ra=a=>{switch(typeof a){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(a)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(a)?le.array:a===null?le.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?le.promise:typeof Map<"u"&&a instanceof Map?le.map:typeof Set<"u"&&a instanceof Set?le.set:typeof Date<"u"&&a instanceof Date?le.date:le.object;default:return le.unknown}},Y=Ge.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"]),l5=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),Qt=class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};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(i){return i.message},t={_errors:[]},s=i=>{for(let n of i.issues)if(n.code==="invalid_union")n.unionErrors.map(s);else if(n.code==="invalid_return_type")s(n.returnTypeError);else if(n.code==="invalid_arguments")s(n.argumentsError);else if(n.path.length===0)t._errors.push(r(n));else{let o=t,l=0;for(;lr.message){let r={},t=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else t.push(e(s));return{formErrors:t,fieldErrors:r}}get formErrors(){return this.flatten()}};Qt.create=a=>new Qt(a);var u5=(a,e)=>{let r;switch(a.code){case Y.invalid_type:a.received===le.undefined?r="Required":r=`Expected ${a.expected}, received ${a.received}`;break;case Y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(a.expected,Ge.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ge.joinValues(a.keys,", ")}`;break;case Y.invalid_union:r="Invalid input";break;case Y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ge.joinValues(a.options)}`;break;case Y.invalid_enum_value:r=`Invalid enum value. Expected ${Ge.joinValues(a.options)}, received '${a.received}'`;break;case Y.invalid_arguments:r="Invalid function arguments";break;case Y.invalid_return_type:r="Invalid function return type";break;case Y.invalid_date:r="Invalid date";break;case Y.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(r=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?r=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?r=`Invalid input: must end with "${a.validation.endsWith}"`:Ge.assertNever(a.validation):a.validation!=="regex"?r=`Invalid ${a.validation}`:r="Invalid";break;case Y.too_small:a.type==="array"?r=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?r=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?r=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?r=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?r=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:r="Invalid input";break;case Y.too_big:a.type==="array"?r=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?r=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?r=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?r=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?r=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:r="Invalid input";break;case Y.custom:r="Invalid input";break;case Y.invalid_intersection_types:r="Intersection results could not be merged";break;case Y.not_multiple_of:r=`Number must be a multiple of ${a.multipleOf}`;break;case Y.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ge.assertNever(a)}return{message:r}},Sn=u5,g1=Sn;function p5(a){g1=a}function Hc(){return g1}var Bc=a=>{let{data:e,path:r,errorMaps:t,issueData:s}=a,i=[...r,...s.path||[]],n={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="",l=t.filter(c=>!!c).slice().reverse();for(let c of l)o=c(n,{data:e,defaultError:o}).message;return{...s,path:i,message:o}},d5=[];function se(a,e){let r=Hc(),t=Bc({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,r,r===Sn?void 0:Sn].filter(s=>!!s)});a.common.issues.push(t)}var Rt=class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let t=[];for(let s of r){if(s.status==="aborted")return we;s.status==="dirty"&&e.dirty(),t.push(s.value)}return{status:e.value,value:t}}static async mergeObjectAsync(e,r){let t=[];for(let s of r){let i=await s.key,n=await s.value;t.push({key:i,value:n})}return a.mergeObjectSync(e,t)}static mergeObjectSync(e,r){let t={};for(let s of r){let{key:i,value:n}=s;if(i.status==="aborted"||n.status==="aborted")return we;i.status==="dirty"&&e.dirty(),n.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof n.value<"u"||s.alwaysSet)&&(t[i.value]=n.value)}return{status:e.value,value:t}}},we=Object.freeze({status:"aborted"}),wn=a=>({status:"dirty",value:a}),Ot=a=>({status:"valid",value:a}),Td=a=>a.status==="aborted",kd=a=>a.status==="dirty",gs=a=>a.status==="valid",Ci=a=>typeof Promise<"u"&&a instanceof Promise,me;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(me||(me={}));var fr=class{constructor(e,r,t,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=t,this._key=s}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}},WE=(a,e)=>{if(gs(e))return{success:!0,data:e.value};if(!a.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 Qt(a.common.issues);return this._error=r,this._error}}};function $e(a){if(!a)return{};let{errorMap:e,invalid_type_error:r,required_error:t,description:s}=a;if(e&&(r||t))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(n,o)=>{let{message:l}=a;return n.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??t??o.defaultError}:n.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},description:s}}var je=class{get description(){return this._def.description}_getType(e){return ra(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ra(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Rt,ctx:{common:e.parent.common,data:e.data,parsedType:ra(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ci(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 t=this.safeParse(e,r);if(t.success)return t.data;throw t.error}safeParse(e,r){let t={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ra(e)},s=this._parseSync({data:e,path:t.path,parent:t});return WE(t,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ra(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:r});return gs(t)?{value:t.value}:{issues:r.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(t=>gs(t)?{value:t.value}:{issues:r.common.issues})}async parseAsync(e,r){let t=await this.safeParseAsync(e,r);if(t.success)return t.data;throw t.error}async safeParseAsync(e,r){let t={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ra(e)},s=this._parse({data:e,path:t.path,parent:t}),i=await(Ci(s)?s:Promise.resolve(s));return WE(t,i)}refine(e,r){let t=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let n=e(s),o=()=>i.addIssue({code:Y.custom,...t(s)});return typeof Promise<"u"&&n instanceof Promise?n.then(l=>l?!0:(o(),!1)):n?!0:(o(),!1)})}refinement(e,r){return this._refinement((t,s)=>e(t)?!0:(s.addIssue(typeof r=="function"?r(t,s):r),!1))}_refinement(e){return new Xt({schema:this,typeName:Pe.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 dr.create(this,this._def)}nullable(){return zr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Ca.create(this,this._def)}or(e){return Ss.create([this,e],this._def)}and(e){return Ps.create(this,e,this._def)}transform(e){return new Xt({...$e(this._def),schema:this,typeName:Pe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Cs({...$e(this._def),innerType:this,defaultValue:r,typeName:Pe.ZodDefault})}brand(){return new Ii({typeName:Pe.ZodBranded,type:this,...$e(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Is({...$e(this._def),innerType:this,catchValue:r,typeName:Pe.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ai.create(this,e)}readonly(){return As.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},f5=/^c[^\s-]{8,}$/i,m5=/^[0-9a-z]+$/,h5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,v5=/^[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,g5=/^[a-z0-9_-]{21}$/i,y5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,b5=/^[-+]?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)?)??$/,x5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yd,E5=/^(?:(?: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])$/,w5=/^(?:(?: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])$/,S5=/^(([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]))$/,P5=/^(([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])$/,R5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,y1="((\\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])))",k5=new RegExp(`^${y1}$`);function b1(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);let r=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function O5(a){return new RegExp(`^${b1(a)}$`)}function x1(a){let e=`${y1}T${b1(a)}`,r=[];return r.push(a.local?"Z?":"Z"),a.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function C5(a,e){return!!((e==="v4"||!e)&&E5.test(a)||(e==="v6"||!e)&&S5.test(a))}function I5(a,e){if(!y5.test(a))return!1;try{let[r]=a.split(".");if(!r)return!1;let t=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(t));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function A5(a,e){return!!((e==="v4"||!e)&&w5.test(a)||(e==="v6"||!e)&&P5.test(a))}var ka=class a extends je{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_type,expected:le.string,received:i.parsedType}),we}let t=new Rt,s;for(let i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(s=this._getOrReturnCtx(e,s),se(s,{code:Y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind==="length"){let n=e.data.length>i.value,o=e.data.lengthe.test(s),{validation:r,code:Y.invalid_string,...me.errToObj(t)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...me.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,...me.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,...me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...me.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...me.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...me.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...me.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...me.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...me.errToObj(r)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...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.valuenew ka({checks:[],typeName:Pe.ZodString,coerce:a?.coerce??!1,...$e(a)});function j5(a,e){let r=(a.toString().split(".")[1]||"").length,t=(e.toString().split(".")[1]||"").length,s=r>t?r:t,i=Number.parseInt(a.toFixed(s).replace(".","")),n=Number.parseInt(e.toFixed(s).replace(".",""));return i%n/10**s}var ys=class a extends je{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)!==le.number){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_type,expected:le.number,received:i.parsedType}),we}let t,s=new Rt;for(let i of this._def.checks)i.kind==="int"?Ge.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),se(t,{code:Y.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?j5(e.data,i.value)!==0&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),se(t,{code:Y.not_finite,message:i.message}),s.dirty()):Ge.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,t,s){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:t,message:me.toString(s)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.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.valuee.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let t of this._def.checks){if(t.kind==="finite"||t.kind==="int"||t.kind==="multipleOf")return!0;t.kind==="min"?(r===null||t.value>r)&&(r=t.value):t.kind==="max"&&(e===null||t.valuenew ys({checks:[],typeName:Pe.ZodNumber,coerce:a?.coerce||!1,...$e(a)});var bs=class a extends je{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)!==le.bigint)return this._getInvalidInput(e);let t,s=new Rt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ge.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return se(r,{code:Y.invalid_type,expected:le.bigint,received:r.parsedType}),we}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,t,s){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:t,message:me.toString(s)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.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.valuenew bs({checks:[],typeName:Pe.ZodBigInt,coerce:a?.coerce??!1,...$e(a)});var xs=class extends je{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.boolean,received:t.parsedType}),we}return Ot(e.data)}};xs.create=a=>new xs({typeName:Pe.ZodBoolean,coerce:a?.coerce||!1,...$e(a)});var _s=class a extends je{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_type,expected:le.date,received:i.parsedType}),we}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_date}),we}let t=new Rt,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(s=this._getOrReturnCtx(e,s),se(s,{code:Y.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):Ge.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:me.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.valuenew _s({checks:[],coerce:a?.coerce||!1,typeName:Pe.ZodDate,...$e(a)});var Pn=class extends je{_parse(e){if(this._getType(e)!==le.symbol){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.symbol,received:t.parsedType}),we}return Ot(e.data)}};Pn.create=a=>new Pn({typeName:Pe.ZodSymbol,...$e(a)});var Es=class extends je{_parse(e){if(this._getType(e)!==le.undefined){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.undefined,received:t.parsedType}),we}return Ot(e.data)}};Es.create=a=>new Es({typeName:Pe.ZodUndefined,...$e(a)});var ws=class extends je{_parse(e){if(this._getType(e)!==le.null){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.null,received:t.parsedType}),we}return Ot(e.data)}};ws.create=a=>new ws({typeName:Pe.ZodNull,...$e(a)});var Oa=class extends je{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};Oa.create=a=>new Oa({typeName:Pe.ZodAny,...$e(a)});var sa=class extends je{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};sa.create=a=>new sa({typeName:Pe.ZodUnknown,...$e(a)});var Pr=class extends je{_parse(e){let r=this._getOrReturnCtx(e);return se(r,{code:Y.invalid_type,expected:le.never,received:r.parsedType}),we}};Pr.create=a=>new Pr({typeName:Pe.ZodNever,...$e(a)});var Rn=class extends je{_parse(e){if(this._getType(e)!==le.undefined){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.void,received:t.parsedType}),we}return Ot(e.data)}};Rn.create=a=>new Rn({typeName:Pe.ZodVoid,...$e(a)});var na=class a extends je{_parse(e){let{ctx:r,status:t}=this._processInputParams(e),s=this._def;if(r.parsedType!==le.array)return se(r,{code:Y.invalid_type,expected:le.array,received:r.parsedType}),we;if(s.exactLength!==null){let n=r.data.length>s.exactLength.value,o=r.data.lengths.maxLength.value&&(se(r,{code:Y.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),t.dirty()),r.common.async)return Promise.all([...r.data].map((n,o)=>s.type._parseAsync(new fr(r,n,r.path,o)))).then(n=>Rt.mergeArray(t,n));let i=[...r.data].map((n,o)=>s.type._parseSync(new fr(r,n,r.path,o)));return Rt.mergeArray(t,i)}get element(){return this._def.type}min(e,r){return new a({...this._def,minLength:{value:e,message:me.toString(r)}})}max(e,r){return new a({...this._def,maxLength:{value:e,message:me.toString(r)}})}length(e,r){return new a({...this._def,exactLength:{value:e,message:me.toString(r)}})}nonempty(e){return this.min(1,e)}};na.create=(a,e)=>new na({type:a,minLength:null,maxLength:null,exactLength:null,typeName:Pe.ZodArray,...$e(e)});function En(a){if(a instanceof Ut){let e={};for(let r in a.shape){let t=a.shape[r];e[r]=dr.create(En(t))}return new Ut({...a._def,shape:()=>e})}else return a instanceof na?new na({...a._def,type:En(a.element)}):a instanceof dr?dr.create(En(a.unwrap())):a instanceof zr?zr.create(En(a.unwrap())):a instanceof Ur?Ur.create(a.items.map(e=>En(e))):a}var Ut=class a extends je{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=Ge.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==le.object){let c=this._getOrReturnCtx(e);return se(c,{code:Y.invalid_type,expected:le.object,received:c.parsedType}),we}let{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),o=[];if(!(this._def.catchall instanceof Pr&&this._def.unknownKeys==="strip"))for(let c in s.data)n.includes(c)||o.push(c);let l=[];for(let c of n){let u=i[c],p=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new fr(s,p,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Pr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")o.length>0&&(se(s,{code:Y.unrecognized_keys,keys:o}),t.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of o){let p=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new fr(s,p,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let p=await u.key,m=await u.value;c.push({key:p,value:m,alwaysSet:u.alwaysSet})}return c}).then(c=>Rt.mergeObjectSync(t,c)):Rt.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,t)=>{let s=this._def.errorMap?.(r,t).message??t.defaultError;return r.code==="unrecognized_keys"?{message:me.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new a({...this._def,unknownKeys:"strip"})}passthrough(){return new a({...this._def,unknownKeys:"passthrough"})}extend(e){return new a({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new a({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Pe.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new a({...this._def,catchall:e})}pick(e){let r={};for(let t of Ge.objectKeys(e))e[t]&&this.shape[t]&&(r[t]=this.shape[t]);return new a({...this._def,shape:()=>r})}omit(e){let r={};for(let t of Ge.objectKeys(this.shape))e[t]||(r[t]=this.shape[t]);return new a({...this._def,shape:()=>r})}deepPartial(){return En(this)}partial(e){let r={};for(let t of Ge.objectKeys(this.shape)){let s=this.shape[t];e&&!e[t]?r[t]=s:r[t]=s.optional()}return new a({...this._def,shape:()=>r})}required(e){let r={};for(let t of Ge.objectKeys(this.shape))if(e&&!e[t])r[t]=this.shape[t];else{let i=this.shape[t];for(;i instanceof dr;)i=i._def.innerType;r[t]=i}return new a({...this._def,shape:()=>r})}keyof(){return _1(Ge.objectKeys(this.shape))}};Ut.create=(a,e)=>new Ut({shape:()=>a,unknownKeys:"strip",catchall:Pr.create(),typeName:Pe.ZodObject,...$e(e)});Ut.strictCreate=(a,e)=>new Ut({shape:()=>a,unknownKeys:"strict",catchall:Pr.create(),typeName:Pe.ZodObject,...$e(e)});Ut.lazycreate=(a,e)=>new Ut({shape:a,unknownKeys:"strip",catchall:Pr.create(),typeName:Pe.ZodObject,...$e(e)});var Ss=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=this._def.options;function s(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let n=i.map(o=>new Qt(o.ctx.common.issues));return se(r,{code:Y.invalid_union,unionErrors:n}),we}if(r.common.async)return Promise.all(t.map(async i=>{let n={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:n}),ctx:n}})).then(s);{let i,n=[];for(let l of t){let c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&n.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let o=n.map(l=>new Qt(l));return se(r,{code:Y.invalid_union,unionErrors:o}),we}}get options(){return this._def.options}};Ss.create=(a,e)=>new Ss({options:a,typeName:Pe.ZodUnion,...$e(e)});var ta=a=>a instanceof Rs?ta(a.schema):a instanceof Xt?ta(a.innerType()):a instanceof Ts?[a.value]:a instanceof ks?a.options:a instanceof Os?Ge.objectValues(a.enum):a instanceof Cs?ta(a._def.innerType):a instanceof Es?[void 0]:a instanceof ws?[null]:a instanceof dr?[void 0,...ta(a.unwrap())]:a instanceof zr?[null,...ta(a.unwrap())]:a instanceof Ii||a instanceof As?ta(a.unwrap()):a instanceof Is?ta(a._def.innerType):[],Vc=class a extends je{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==le.object)return se(r,{code:Y.invalid_type,expected:le.object,received:r.parsedType}),we;let t=this.discriminator,s=r.data[t],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(se(r,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,t){let s=new Map;for(let i of r){let n=ta(i.shape[e]);if(!n.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of n){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,i)}}return new a({typeName:Pe.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...$e(t)})}};function Od(a,e){let r=ra(a),t=ra(e);if(a===e)return{valid:!0,data:a};if(r===le.object&&t===le.object){let s=Ge.objectKeys(e),i=Ge.objectKeys(a).filter(o=>s.indexOf(o)!==-1),n={...a,...e};for(let o of i){let l=Od(a[o],e[o]);if(!l.valid)return{valid:!1};n[o]=l.data}return{valid:!0,data:n}}else if(r===le.array&&t===le.array){if(a.length!==e.length)return{valid:!1};let s=[];for(let i=0;i{if(Td(i)||Td(n))return we;let o=Od(i.value,n.value);return o.valid?((kd(i)||kd(n))&&r.dirty(),{status:r.value,value:o.data}):(se(t,{code:Y.invalid_intersection_types}),we)};return t.common.async?Promise.all([this._def.left._parseAsync({data:t.data,path:t.path,parent:t}),this._def.right._parseAsync({data:t.data,path:t.path,parent:t})]).then(([i,n])=>s(i,n)):s(this._def.left._parseSync({data:t.data,path:t.path,parent:t}),this._def.right._parseSync({data:t.data,path:t.path,parent:t}))}};Ps.create=(a,e,r)=>new Ps({left:a,right:e,typeName:Pe.ZodIntersection,...$e(r)});var Ur=class a extends je{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.array)return se(t,{code:Y.invalid_type,expected:le.array,received:t.parsedType}),we;if(t.data.lengththis._def.items.length&&(se(t,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...t.data].map((n,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new fr(t,n,t.path,o)):null}).filter(n=>!!n);return t.common.async?Promise.all(i).then(n=>Rt.mergeArray(r,n)):Rt.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};Ur.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:a,typeName:Pe.ZodTuple,rest:null,...$e(e)})};var Gc=class a extends je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.object)return se(t,{code:Y.invalid_type,expected:le.object,received:t.parsedType}),we;let s=[],i=this._def.keyType,n=this._def.valueType;for(let o in t.data)s.push({key:i._parse(new fr(t,o,t.path,o)),value:n._parse(new fr(t,t.data[o],t.path,o)),alwaysSet:o in t.data});return t.common.async?Rt.mergeObjectAsync(r,s):Rt.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,t){return r instanceof je?new a({keyType:e,valueType:r,typeName:Pe.ZodRecord,...$e(t)}):new a({keyType:ka.create(),valueType:e,typeName:Pe.ZodRecord,...$e(r)})}},Tn=class extends je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.map)return se(t,{code:Y.invalid_type,expected:le.map,received:t.parsedType}),we;let s=this._def.keyType,i=this._def.valueType,n=[...t.data.entries()].map(([o,l],c)=>({key:s._parse(new fr(t,o,t.path,[c,"key"])),value:i._parse(new fr(t,l,t.path,[c,"value"]))}));if(t.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of n){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return we;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of n){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return we;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}}}};Tn.create=(a,e,r)=>new Tn({valueType:e,keyType:a,typeName:Pe.ZodMap,...$e(r)});var kn=class a extends je{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.set)return se(t,{code:Y.invalid_type,expected:le.set,received:t.parsedType}),we;let s=this._def;s.minSize!==null&&t.data.sizes.maxSize.value&&(se(t,{code:Y.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function n(l){let c=new Set;for(let u of l){if(u.status==="aborted")return we;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}let o=[...t.data.values()].map((l,c)=>i._parse(new fr(t,l,t.path,c)));return t.common.async?Promise.all(o).then(l=>n(l)):n(o)}min(e,r){return new a({...this._def,minSize:{value:e,message:me.toString(r)}})}max(e,r){return new a({...this._def,maxSize:{value:e,message:me.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};kn.create=(a,e)=>new kn({valueType:a,minSize:null,maxSize:null,typeName:Pe.ZodSet,...$e(e)});var Zc=class a extends je{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==le.function)return se(r,{code:Y.invalid_type,expected:le.function,received:r.parsedType}),we;function t(o,l){return Bc({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Sn].filter(c=>!!c),issueData:{code:Y.invalid_arguments,argumentsError:l}})}function s(o,l){return Bc({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Sn].filter(c=>!!c),issueData:{code:Y.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},n=r.data;if(this._def.returns instanceof Ca){let o=this;return Ot(async function(...l){let c=new Qt([]),u=await o._def.args.parseAsync(l,i).catch(f=>{throw c.addIssue(t(l,f)),c}),p=await Reflect.apply(n,this,u);return await o._def.returns._def.type.parseAsync(p,i).catch(f=>{throw c.addIssue(s(p,f)),c})})}else{let o=this;return Ot(function(...l){let c=o._def.args.safeParse(l,i);if(!c.success)throw new Qt([t(l,c.error)]);let u=Reflect.apply(n,this,c.data),p=o._def.returns.safeParse(u,i);if(!p.success)throw new Qt([s(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:Ur.create(e).rest(sa.create())})}returns(e){return new a({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,t){return new a({args:e||Ur.create([]).rest(sa.create()),returns:r||sa.create(),typeName:Pe.ZodFunction,...$e(t)})}},Rs=class extends je{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})}};Rs.create=(a,e)=>new Rs({getter:a,typeName:Pe.ZodLazy,...$e(e)});var Ts=class extends je{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return se(r,{received:r.data,code:Y.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ts.create=(a,e)=>new Ts({value:a,typeName:Pe.ZodLiteral,...$e(e)});function _1(a,e){return new ks({values:a,typeName:Pe.ZodEnum,...$e(e)})}var ks=class a extends je{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),t=this._def.values;return se(r,{expected:Ge.joinValues(t),received:r.parsedType,code:Y.invalid_type}),we}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),t=this._def.values;return se(r,{received:r.data,code:Y.invalid_enum_value,options:t}),we}return Ot(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 a.create(e,{...this._def,...r})}exclude(e,r=this._def){return a.create(this.options.filter(t=>!e.includes(t)),{...this._def,...r})}};ks.create=_1;var Os=class extends je{_parse(e){let r=Ge.getValidEnumValues(this._def.values),t=this._getOrReturnCtx(e);if(t.parsedType!==le.string&&t.parsedType!==le.number){let s=Ge.objectValues(r);return se(t,{expected:Ge.joinValues(s),received:t.parsedType,code:Y.invalid_type}),we}if(this._cache||(this._cache=new Set(Ge.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=Ge.objectValues(r);return se(t,{received:t.data,code:Y.invalid_enum_value,options:s}),we}return Ot(e.data)}get enum(){return this._def.values}};Os.create=(a,e)=>new Os({values:a,typeName:Pe.ZodNativeEnum,...$e(e)});var Ca=class extends je{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==le.promise&&r.common.async===!1)return se(r,{code:Y.invalid_type,expected:le.promise,received:r.parsedType}),we;let t=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Ot(t.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ca.create=(a,e)=>new Ca({type:a,typeName:Pe.ZodPromise,...$e(e)});var Xt=class extends je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:t}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:n=>{se(t,n),n.fatal?r.abort():r.dirty()},get path(){return t.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let n=s.transform(t.data,i);if(t.common.async)return Promise.resolve(n).then(async o=>{if(r.value==="aborted")return we;let l=await this._def.schema._parseAsync({data:o,path:t.path,parent:t});return l.status==="aborted"?we:l.status==="dirty"||r.value==="dirty"?wn(l.value):l});{if(r.value==="aborted")return we;let o=this._def.schema._parseSync({data:n,path:t.path,parent:t});return o.status==="aborted"?we:o.status==="dirty"||r.value==="dirty"?wn(o.value):o}}if(s.type==="refinement"){let n=o=>{let l=s.refinement(o,i);if(t.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(t.common.async===!1){let o=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});return o.status==="aborted"?we:(o.status==="dirty"&&r.dirty(),n(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(o=>o.status==="aborted"?we:(o.status==="dirty"&&r.dirty(),n(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(t.common.async===!1){let n=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});if(!gs(n))return we;let o=s.transform(n.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(n=>gs(n)?Promise.resolve(s.transform(n.value,i)).then(o=>({status:r.value,value:o})):we);Ge.assertNever(s)}};Xt.create=(a,e,r)=>new Xt({schema:a,typeName:Pe.ZodEffects,effect:e,...$e(r)});Xt.createWithPreprocess=(a,e,r)=>new Xt({schema:e,effect:{type:"preprocess",transform:a},typeName:Pe.ZodEffects,...$e(r)});var dr=class extends je{_parse(e){return this._getType(e)===le.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};dr.create=(a,e)=>new dr({innerType:a,typeName:Pe.ZodOptional,...$e(e)});var zr=class extends je{_parse(e){return this._getType(e)===le.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zr.create=(a,e)=>new zr({innerType:a,typeName:Pe.ZodNullable,...$e(e)});var Cs=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return r.parsedType===le.undefined&&(t=this._def.defaultValue()),this._def.innerType._parse({data:t,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Cs.create=(a,e)=>new Cs({innerType:a,typeName:Pe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...$e(e)});var Is=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t}});return Ci(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(t.common.issues)},input:t.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qt(t.common.issues)},input:t.data})}}removeCatch(){return this._def.innerType}};Is.create=(a,e)=>new Is({innerType:a,typeName:Pe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...$e(e)});var On=class extends je{_parse(e){if(this._getType(e)!==le.nan){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.nan,received:t.parsedType}),we}return{status:"valid",value:e.data}}};On.create=a=>new On({typeName:Pe.ZodNaN,...$e(a)});var N5=Symbol("zod_brand"),Ii=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return this._def.type._parse({data:t,path:r.path,parent:r})}unwrap(){return this._def.type}},Ai=class a extends je{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return i.status==="aborted"?we:i.status==="dirty"?(r.dirty(),wn(i.value)):this._def.out._parseAsync({data:i.value,path:t.path,parent:t})})();{let s=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return s.status==="aborted"?we:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:t.path,parent:t})}}static create(e,r){return new a({in:e,out:r,typeName:Pe.ZodPipeline})}},As=class extends je{_parse(e){let r=this._def.innerType._parse(e),t=s=>(gs(s)&&(s.value=Object.freeze(s.value)),s);return Ci(r)?r.then(s=>t(s)):t(r)}unwrap(){return this._def.innerType}};As.create=(a,e)=>new As({innerType:a,typeName:Pe.ZodReadonly,...$e(e)});function KE(a,e){let r=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof r=="string"?{message:r}:r}function E1(a,e={},r){return a?Oa.create().superRefine((t,s)=>{let i=a(t);if(i instanceof Promise)return i.then(n=>{if(!n){let o=KE(e,t),l=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:l})}});if(!i){let n=KE(e,t),o=n.fatal??r??!0;s.addIssue({code:"custom",...n,fatal:o})}}):Oa.create()}var D5={object:Ut.lazycreate},Pe;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(Pe||(Pe={}));var $5=(a,e={message:`Input not instance of ${a.name}`})=>E1(r=>r instanceof a,e),w1=ka.create,S1=ys.create,q5=On.create,M5=bs.create,P1=xs.create,F5=_s.create,L5=Pn.create,U5=Es.create,z5=ws.create,H5=Oa.create,B5=sa.create,V5=Pr.create,G5=Rn.create,Z5=na.create,W5=Ut.create,K5=Ut.strictCreate,Q5=Ss.create,X5=Vc.create,J5=Ps.create,Y5=Ur.create,e6=Gc.create,t6=Tn.create,r6=kn.create,a6=Zc.create,s6=Rs.create,n6=Ts.create,i6=ks.create,o6=Os.create,c6=Ca.create,QE=Xt.create,l6=dr.create,u6=zr.create,p6=Xt.createWithPreprocess,d6=Ai.create,f6=()=>w1().optional(),m6=()=>S1().optional(),h6=()=>P1().optional(),v6={string:a=>ka.create({...a,coerce:!0}),number:a=>ys.create({...a,coerce:!0}),boolean:a=>xs.create({...a,coerce:!0}),bigint:a=>bs.create({...a,coerce:!0}),date:a=>_s.create({...a,coerce:!0})},g6=we;var Xc="2.0",R1=w.union([w.string(),w.number().int()]),T1=w.string(),y6=w.object({progressToken:w.optional(R1)}).passthrough(),mr=w.object({_meta:w.optional(y6)}).passthrough(),zt=w.object({method:w.string(),params:w.optional(mr)}),Ni=w.object({_meta:w.optional(w.object({}).passthrough())}).passthrough(),Hr=w.object({method:w.string(),params:w.optional(Ni)}),hr=w.object({_meta:w.optional(w.object({}).passthrough())}).passthrough(),Jc=w.union([w.string(),w.number().int()]),b6=w.object({jsonrpc:w.literal(Xc),id:Jc}).merge(zt).strict();var x6=w.object({jsonrpc:w.literal(Xc)}).merge(Hr).strict();var _6=w.object({jsonrpc:w.literal(Xc),id:Jc,result:hr}).strict();var XE;(function(a){a[a.ConnectionClosed=-32e3]="ConnectionClosed",a[a.RequestTimeout=-32001]="RequestTimeout",a[a.ParseError=-32700]="ParseError",a[a.InvalidRequest=-32600]="InvalidRequest",a[a.MethodNotFound=-32601]="MethodNotFound",a[a.InvalidParams=-32602]="InvalidParams",a[a.InternalError=-32603]="InternalError"})(XE||(XE={}));var E6=w.object({jsonrpc:w.literal(Xc),id:Jc,error:w.object({code:w.number().int(),message:w.string(),data:w.optional(w.unknown())})}).strict();var L3=w.union([b6,x6,_6,E6]),k1=hr.strict(),O1=Hr.extend({method:w.literal("notifications/cancelled"),params:Ni.extend({requestId:Jc,reason:w.string().optional()})}),Di=w.object({name:w.string(),title:w.optional(w.string())}).passthrough(),C1=Di.extend({version:w.string()}),w6=w.object({experimental:w.optional(w.object({}).passthrough()),sampling:w.optional(w.object({}).passthrough()),elicitation:w.optional(w.object({}).passthrough()),roots:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough())}).passthrough(),S6=zt.extend({method:w.literal("initialize"),params:mr.extend({protocolVersion:w.string(),capabilities:w6,clientInfo:C1})}),P6=w.object({experimental:w.optional(w.object({}).passthrough()),logging:w.optional(w.object({}).passthrough()),completions:w.optional(w.object({}).passthrough()),prompts:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough()),resources:w.optional(w.object({subscribe:w.optional(w.boolean()),listChanged:w.optional(w.boolean())}).passthrough()),tools:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough())}).passthrough(),R6=hr.extend({protocolVersion:w.string(),capabilities:P6,serverInfo:C1,instructions:w.optional(w.string())}),T6=Hr.extend({method:w.literal("notifications/initialized")}),I1=zt.extend({method:w.literal("ping")}),k6=w.object({progress:w.number(),total:w.optional(w.number()),message:w.optional(w.string())}).passthrough(),A1=Hr.extend({method:w.literal("notifications/progress"),params:Ni.merge(k6).extend({progressToken:R1})}),Yc=zt.extend({params:mr.extend({cursor:w.optional(T1)}).optional()}),el=hr.extend({nextCursor:w.optional(T1)}),j1=w.object({uri:w.string(),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}).passthrough(),N1=j1.extend({text:w.string()}),$d=w.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),D1=j1.extend({blob:$d}),$1=Di.extend({uri:w.string(),description:w.optional(w.string()),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}),O6=Di.extend({uriTemplate:w.string(),description:w.optional(w.string()),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}),C6=Yc.extend({method:w.literal("resources/list")}),I6=el.extend({resources:w.array($1)}),A6=Yc.extend({method:w.literal("resources/templates/list")}),j6=el.extend({resourceTemplates:w.array(O6)}),N6=zt.extend({method:w.literal("resources/read"),params:mr.extend({uri:w.string()})}),D6=hr.extend({contents:w.array(w.union([N1,D1]))}),$6=Hr.extend({method:w.literal("notifications/resources/list_changed")}),q6=zt.extend({method:w.literal("resources/subscribe"),params:mr.extend({uri:w.string()})}),M6=zt.extend({method:w.literal("resources/unsubscribe"),params:mr.extend({uri:w.string()})}),F6=Hr.extend({method:w.literal("notifications/resources/updated"),params:Ni.extend({uri:w.string()})}),L6=w.object({name:w.string(),description:w.optional(w.string()),required:w.optional(w.boolean())}).passthrough(),U6=Di.extend({description:w.optional(w.string()),arguments:w.optional(w.array(L6)),_meta:w.optional(w.object({}).passthrough())}),z6=Yc.extend({method:w.literal("prompts/list")}),H6=el.extend({prompts:w.array(U6)}),B6=zt.extend({method:w.literal("prompts/get"),params:mr.extend({name:w.string(),arguments:w.optional(w.record(w.string()))})}),qd=w.object({type:w.literal("text"),text:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),Md=w.object({type:w.literal("image"),data:$d,mimeType:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),Fd=w.object({type:w.literal("audio"),data:$d,mimeType:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),V6=w.object({type:w.literal("resource"),resource:w.union([N1,D1]),_meta:w.optional(w.object({}).passthrough())}).passthrough(),G6=$1.extend({type:w.literal("resource_link")}),q1=w.union([qd,Md,Fd,G6,V6]),Z6=w.object({role:w.enum(["user","assistant"]),content:q1}).passthrough(),W6=hr.extend({description:w.optional(w.string()),messages:w.array(Z6)}),K6=Hr.extend({method:w.literal("notifications/prompts/list_changed")}),Q6=w.object({title:w.optional(w.string()),readOnlyHint:w.optional(w.boolean()),destructiveHint:w.optional(w.boolean()),idempotentHint:w.optional(w.boolean()),openWorldHint:w.optional(w.boolean())}).passthrough(),X6=Di.extend({description:w.optional(w.string()),inputSchema:w.object({type:w.literal("object"),properties:w.optional(w.object({}).passthrough()),required:w.optional(w.array(w.string()))}).passthrough(),outputSchema:w.optional(w.object({type:w.literal("object"),properties:w.optional(w.object({}).passthrough()),required:w.optional(w.array(w.string()))}).passthrough()),annotations:w.optional(Q6),_meta:w.optional(w.object({}).passthrough())}),J6=Yc.extend({method:w.literal("tools/list")}),Y6=el.extend({tools:w.array(X6)}),M1=hr.extend({content:w.array(q1).default([]),structuredContent:w.object({}).passthrough().optional(),isError:w.optional(w.boolean())}),U3=M1.or(hr.extend({toolResult:w.unknown()})),e$=zt.extend({method:w.literal("tools/call"),params:mr.extend({name:w.string(),arguments:w.optional(w.record(w.unknown()))})}),t$=Hr.extend({method:w.literal("notifications/tools/list_changed")}),F1=w.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),r$=zt.extend({method:w.literal("logging/setLevel"),params:mr.extend({level:F1})}),a$=Hr.extend({method:w.literal("notifications/message"),params:Ni.extend({level:F1,logger:w.optional(w.string()),data:w.unknown()})}),s$=w.object({name:w.string().optional()}).passthrough(),n$=w.object({hints:w.optional(w.array(s$)),costPriority:w.optional(w.number().min(0).max(1)),speedPriority:w.optional(w.number().min(0).max(1)),intelligencePriority:w.optional(w.number().min(0).max(1))}).passthrough(),i$=w.object({role:w.enum(["user","assistant"]),content:w.union([qd,Md,Fd])}).passthrough(),o$=zt.extend({method:w.literal("sampling/createMessage"),params:mr.extend({messages:w.array(i$),systemPrompt:w.optional(w.string()),includeContext:w.optional(w.enum(["none","thisServer","allServers"])),temperature:w.optional(w.number()),maxTokens:w.number().int(),stopSequences:w.optional(w.array(w.string())),metadata:w.optional(w.object({}).passthrough()),modelPreferences:w.optional(n$)})}),c$=hr.extend({model:w.string(),stopReason:w.optional(w.enum(["endTurn","stopSequence","maxTokens"]).or(w.string())),role:w.enum(["user","assistant"]),content:w.discriminatedUnion("type",[qd,Md,Fd])}),l$=w.object({type:w.literal("boolean"),title:w.optional(w.string()),description:w.optional(w.string()),default:w.optional(w.boolean())}).passthrough(),u$=w.object({type:w.literal("string"),title:w.optional(w.string()),description:w.optional(w.string()),minLength:w.optional(w.number()),maxLength:w.optional(w.number()),format:w.optional(w.enum(["email","uri","date","date-time"]))}).passthrough(),p$=w.object({type:w.enum(["number","integer"]),title:w.optional(w.string()),description:w.optional(w.string()),minimum:w.optional(w.number()),maximum:w.optional(w.number())}).passthrough(),d$=w.object({type:w.literal("string"),title:w.optional(w.string()),description:w.optional(w.string()),enum:w.array(w.string()),enumNames:w.optional(w.array(w.string()))}).passthrough(),f$=w.union([l$,u$,p$,d$]),m$=zt.extend({method:w.literal("elicitation/create"),params:mr.extend({message:w.string(),requestedSchema:w.object({type:w.literal("object"),properties:w.record(w.string(),f$),required:w.optional(w.array(w.string()))}).passthrough()})}),h$=hr.extend({action:w.enum(["accept","decline","cancel"]),content:w.optional(w.record(w.string(),w.unknown()))}),v$=w.object({type:w.literal("ref/resource"),uri:w.string()}).passthrough(),g$=w.object({type:w.literal("ref/prompt"),name:w.string()}).passthrough(),y$=zt.extend({method:w.literal("completion/complete"),params:mr.extend({ref:w.union([g$,v$]),argument:w.object({name:w.string(),value:w.string()}).passthrough(),context:w.optional(w.object({arguments:w.optional(w.record(w.string(),w.string()))}))})}),b$=hr.extend({completion:w.object({values:w.array(w.string()).max(100),total:w.optional(w.number().int()),hasMore:w.optional(w.boolean())}).passthrough()}),x$=w.object({uri:w.string().startsWith("file://"),name:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}).passthrough(),_$=zt.extend({method:w.literal("roots/list")}),E$=hr.extend({roots:w.array(x$)}),w$=Hr.extend({method:w.literal("notifications/roots/list_changed")}),z3=w.union([I1,S6,y$,r$,B6,z6,C6,A6,N6,q6,M6,e$,J6]),H3=w.union([O1,A1,T6,w$]),B3=w.union([k1,c$,h$,E$]),V3=w.union([I1,o$,m$,_$]),G3=w.union([O1,A1,a$,F6,$6,t$,K6]),Z3=w.union([k1,R6,b$,W6,H6,I6,j6,D6,M1,Y6]);var W3=Pj(iN(),1);var K3=Symbol("Let zodToJsonSchema decide on which parser to use");var Q3=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Cd;(function(a){a.Completable="McpCompletable"})(Cd||(Cd={}));var Wc=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return this._def.type._parse({data:t,path:r.path,parent:r})}unwrap(){return this._def.type}};Wc.create=(a,e)=>new Wc({type:a,typeName:Cd.Completable,complete:e.complete,...S$(e)});function S$(a){if(!a)return{};let{errorMap:e,invalid_type_error:r,required_error:t,description:s}=a;if(e&&(r||t))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(n,o)=>{var l,c;let{message:u}=a;return n.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:(l=u??t)!==null&&l!==void 0?l:o.defaultError}:n.code!=="invalid_type"?{message:o.defaultError}:{message:(c=u??r)!==null&&c!==void 0?c:o.defaultError}},description:s}}function L1({prompt:a,options:e}){let{systemPrompt:r,settingSources:t,...s}=e??{},i,n;r===void 0?i="":typeof r=="string"?i=r:r.type==="preset"&&(n=r.append);let o=s.pathToClaudeCodeExecutable;if(!o){let xe=(0,r1.fileURLToPath)(P$.url),Oe=(0,xd.join)(xe,"..");o=(0,xd.join)(Oe,"cli.js")}process.env.CLAUDE_AGENT_SDK_VERSION="0.1.27";let{abortController:l=s1(),additionalDirectories:c=[],agents:u,allowedTools:p=[],canUseTool:m,continue:f,cwd:h,disallowedTools:d=[],env:v,executable:x=c1()?"bun":"node",executableArgs:b=[],extraArgs:E={},fallbackModel:k,forkSession:O,hooks:P,includePartialMessages:I,maxThinkingTokens:$,maxTurns:A,mcpServers:F,model:q,permissionMode:C="default",allowDangerouslySkipPermissions:R=!1,permissionPromptToolName:j,plugins:z,resume:B,resumeSessionAt:G,stderr:te,strictMcpConfig:X}=s,V=v;if(V||(V={...process.env}),V.CLAUDE_CODE_ENTRYPOINT||(V.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),!o)throw new Error("pathToClaudeCodeExecutable is required");let re={},ce=new Map;if(F)for(let[xe,Oe]of Object.entries(F))Oe.type==="sdk"&&"instance"in Oe?(ce.set(xe,Oe.instance),re[xe]={type:"sdk",name:xe}):re[xe]=Oe;let Be=typeof a=="string",be=new _d({abortController:l,additionalDirectories:c,agents:u,cwd:h,executable:x,executableArgs:b,extraArgs:E,pathToClaudeCodeExecutable:o,env:V,forkSession:O,stderr:te,customSystemPrompt:i,appendSystemPrompt:n,maxThinkingTokens:$,maxTurns:A,model:q,fallbackModel:k,permissionMode:C,allowDangerouslySkipPermissions:R,permissionPromptToolName:j,continueConversation:f,resume:B,resumeSessionAt:G,settingSources:t??[],allowedTools:p,disallowedTools:d,mcpServers:re,strictMcpConfig:X,canUseTool:!!m,hooks:!!P,includePartialMessages:I,plugins:z}),qe=new Pd(be,Be,m,P,l,ce);return typeof a=="string"?be.write(JSON.stringify({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:a}]},parent_tool_use_id:null})+` +`))}if(ea(`[Query.streamInput] Finished processing ${r} messages from input stream`),ea(`[Query.streamInput] About to check MCP servers. this.sdkMcpTransports.size = ${this.sdkMcpTransports.size}`),this.sdkMcpTransports.size>0&&this.firstResultReceivedPromise){ea("[Query.streamInput] Entering Promise.race to wait for result");let t=1e4,s;await Promise.race([this.firstResultReceivedPromise.then(()=>{ea("[Query.streamInput] Received first result, closing input stream"),s&&clearTimeout(s)}),new Promise(i=>{s=setTimeout(()=>{ea("[Query.streamInput] Timed out waiting for first result, closing input stream"),i()},t)})]),s&&clearTimeout(s)}ea("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof hs))throw r}}handleHookCallbacks(e,r,t,s){let i=this.hookCallbacks.get(e);if(!i)throw new Error(`No hook callback found for ID: ${e}`);return i(r,t,{signal:s})}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let t=`${e}:${r.id}`,s=this.pendingMcpResponses.get(t);if(s){s.resolve(r),this.pendingMcpResponses.delete(t);return}}throw new Error("No pending request found")}handleMcpControlRequest(e,r,t){let s="id"in r.message?r.message.id:null,i=`${e}:${s}`;return new Promise((n,o)=>{let l=null,c=()=>{l&&clearTimeout(l),this.pendingMcpResponses.delete(i)},u=m=>{c(),n(m)},p=m=>{c(),o(m)};if(this.pendingMcpResponses.set(i,{resolve:u,reject:p}),t.onmessage)t.onmessage(r.message);else{c(),o(new Error("No message handler registered"));return}l=setTimeout(()=>{this.pendingMcpResponses.has(i)&&(c(),o(new Error("Request timeout")))},3e4)})}},w={};R9(w,{void:()=>G5,util:()=>Ge,unknown:()=>B5,union:()=>Q5,undefined:()=>U5,tuple:()=>Y5,transformer:()=>QE,symbol:()=>L5,string:()=>w1,strictObject:()=>K5,setErrorMap:()=>p5,set:()=>r6,record:()=>e6,quotelessJson:()=>l5,promise:()=>c6,preprocess:()=>p6,pipeline:()=>d6,ostring:()=>f6,optional:()=>l6,onumber:()=>m6,oboolean:()=>h6,objectUtil:()=>Rd,object:()=>W5,number:()=>S1,nullable:()=>u6,null:()=>z5,never:()=>V5,nativeEnum:()=>o6,nan:()=>q5,map:()=>t6,makeIssue:()=>Bc,literal:()=>n6,lazy:()=>s6,late:()=>D5,isValid:()=>gs,isDirty:()=>kd,isAsync:()=>Ci,isAborted:()=>Td,intersection:()=>J5,instanceof:()=>$5,getParsedType:()=>ra,getErrorMap:()=>Hc,function:()=>a6,enum:()=>i6,effect:()=>QE,discriminatedUnion:()=>X5,defaultErrorMap:()=>Sn,datetimeRegex:()=>x1,date:()=>F5,custom:()=>E1,coerce:()=>v6,boolean:()=>P1,bigint:()=>M5,array:()=>Z5,any:()=>H5,addIssueToContext:()=>se,ZodVoid:()=>Rn,ZodUnknown:()=>sa,ZodUnion:()=>Ss,ZodUndefined:()=>Es,ZodType:()=>je,ZodTuple:()=>Ur,ZodTransformer:()=>Xt,ZodSymbol:()=>Pn,ZodString:()=>ka,ZodSet:()=>kn,ZodSchema:()=>je,ZodRecord:()=>Gc,ZodReadonly:()=>As,ZodPromise:()=>Ca,ZodPipeline:()=>Ai,ZodParsedType:()=>le,ZodOptional:()=>dr,ZodObject:()=>zt,ZodNumber:()=>ys,ZodNullable:()=>zr,ZodNull:()=>ws,ZodNever:()=>Pr,ZodNativeEnum:()=>Os,ZodNaN:()=>On,ZodMap:()=>Tn,ZodLiteral:()=>Ts,ZodLazy:()=>Rs,ZodIssueCode:()=>Y,ZodIntersection:()=>Ps,ZodFunction:()=>Zc,ZodFirstPartyTypeKind:()=>Pe,ZodError:()=>Qt,ZodEnum:()=>ks,ZodEffects:()=>Xt,ZodDiscriminatedUnion:()=>Vc,ZodDefault:()=>Cs,ZodDate:()=>_s,ZodCatch:()=>Is,ZodBranded:()=>Ii,ZodBoolean:()=>xs,ZodBigInt:()=>bs,ZodArray:()=>na,ZodAny:()=>Oa,Schema:()=>je,ParseStatus:()=>Rt,OK:()=>Ot,NEVER:()=>g6,INVALID:()=>we,EMPTY_PATH:()=>d5,DIRTY:()=>wn,BRAND:()=>N5});var Ge;(function(a){a.assertEqual=s=>{};function e(s){}a.assertIs=e;function r(s){throw new Error}a.assertNever=r,a.arrayToEnum=s=>{let i={};for(let n of s)i[n]=n;return i},a.getValidEnumValues=s=>{let i=a.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),n={};for(let o of i)n[o]=s[o];return a.objectValues(n)},a.objectValues=s=>a.objectKeys(s).map(function(i){return s[i]}),a.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let n in s)Object.prototype.hasOwnProperty.call(s,n)&&i.push(n);return i},a.find=(s,i)=>{for(let n of s)if(i(n))return n},a.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function t(s,i=" | "){return s.map(n=>typeof n=="string"?`'${n}'`:n).join(i)}a.joinValues=t,a.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ge||(Ge={}));var Rd;(function(a){a.mergeShapes=(e,r)=>({...e,...r})})(Rd||(Rd={}));var le=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ra=a=>{switch(typeof a){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(a)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(a)?le.array:a===null?le.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?le.promise:typeof Map<"u"&&a instanceof Map?le.map:typeof Set<"u"&&a instanceof Set?le.set:typeof Date<"u"&&a instanceof Date?le.date:le.object;default:return le.unknown}},Y=Ge.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"]),l5=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),Qt=class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};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(i){return i.message},t={_errors:[]},s=i=>{for(let n of i.issues)if(n.code==="invalid_union")n.unionErrors.map(s);else if(n.code==="invalid_return_type")s(n.returnTypeError);else if(n.code==="invalid_arguments")s(n.argumentsError);else if(n.path.length===0)t._errors.push(r(n));else{let o=t,l=0;for(;lr.message){let r={},t=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else t.push(e(s));return{formErrors:t,fieldErrors:r}}get formErrors(){return this.flatten()}};Qt.create=a=>new Qt(a);var u5=(a,e)=>{let r;switch(a.code){case Y.invalid_type:a.received===le.undefined?r="Required":r=`Expected ${a.expected}, received ${a.received}`;break;case Y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(a.expected,Ge.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ge.joinValues(a.keys,", ")}`;break;case Y.invalid_union:r="Invalid input";break;case Y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ge.joinValues(a.options)}`;break;case Y.invalid_enum_value:r=`Invalid enum value. Expected ${Ge.joinValues(a.options)}, received '${a.received}'`;break;case Y.invalid_arguments:r="Invalid function arguments";break;case Y.invalid_return_type:r="Invalid function return type";break;case Y.invalid_date:r="Invalid date";break;case Y.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(r=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?r=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?r=`Invalid input: must end with "${a.validation.endsWith}"`:Ge.assertNever(a.validation):a.validation!=="regex"?r=`Invalid ${a.validation}`:r="Invalid";break;case Y.too_small:a.type==="array"?r=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?r=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?r=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?r=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?r=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:r="Invalid input";break;case Y.too_big:a.type==="array"?r=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?r=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?r=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?r=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?r=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:r="Invalid input";break;case Y.custom:r="Invalid input";break;case Y.invalid_intersection_types:r="Intersection results could not be merged";break;case Y.not_multiple_of:r=`Number must be a multiple of ${a.multipleOf}`;break;case Y.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ge.assertNever(a)}return{message:r}},Sn=u5,g1=Sn;function p5(a){g1=a}function Hc(){return g1}var Bc=a=>{let{data:e,path:r,errorMaps:t,issueData:s}=a,i=[...r,...s.path||[]],n={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="",l=t.filter(c=>!!c).slice().reverse();for(let c of l)o=c(n,{data:e,defaultError:o}).message;return{...s,path:i,message:o}},d5=[];function se(a,e){let r=Hc(),t=Bc({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,r,r===Sn?void 0:Sn].filter(s=>!!s)});a.common.issues.push(t)}var Rt=class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let t=[];for(let s of r){if(s.status==="aborted")return we;s.status==="dirty"&&e.dirty(),t.push(s.value)}return{status:e.value,value:t}}static async mergeObjectAsync(e,r){let t=[];for(let s of r){let i=await s.key,n=await s.value;t.push({key:i,value:n})}return a.mergeObjectSync(e,t)}static mergeObjectSync(e,r){let t={};for(let s of r){let{key:i,value:n}=s;if(i.status==="aborted"||n.status==="aborted")return we;i.status==="dirty"&&e.dirty(),n.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof n.value<"u"||s.alwaysSet)&&(t[i.value]=n.value)}return{status:e.value,value:t}}},we=Object.freeze({status:"aborted"}),wn=a=>({status:"dirty",value:a}),Ot=a=>({status:"valid",value:a}),Td=a=>a.status==="aborted",kd=a=>a.status==="dirty",gs=a=>a.status==="valid",Ci=a=>typeof Promise<"u"&&a instanceof Promise,me;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(me||(me={}));var fr=class{constructor(e,r,t,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=t,this._key=s}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}},WE=(a,e)=>{if(gs(e))return{success:!0,data:e.value};if(!a.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 Qt(a.common.issues);return this._error=r,this._error}}};function $e(a){if(!a)return{};let{errorMap:e,invalid_type_error:r,required_error:t,description:s}=a;if(e&&(r||t))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(n,o)=>{let{message:l}=a;return n.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??t??o.defaultError}:n.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},description:s}}var je=class{get description(){return this._def.description}_getType(e){return ra(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ra(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Rt,ctx:{common:e.parent.common,data:e.data,parsedType:ra(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ci(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 t=this.safeParse(e,r);if(t.success)return t.data;throw t.error}safeParse(e,r){let t={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ra(e)},s=this._parseSync({data:e,path:t.path,parent:t});return WE(t,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ra(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:r});return gs(t)?{value:t.value}:{issues:r.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(t=>gs(t)?{value:t.value}:{issues:r.common.issues})}async parseAsync(e,r){let t=await this.safeParseAsync(e,r);if(t.success)return t.data;throw t.error}async safeParseAsync(e,r){let t={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ra(e)},s=this._parse({data:e,path:t.path,parent:t}),i=await(Ci(s)?s:Promise.resolve(s));return WE(t,i)}refine(e,r){let t=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let n=e(s),o=()=>i.addIssue({code:Y.custom,...t(s)});return typeof Promise<"u"&&n instanceof Promise?n.then(l=>l?!0:(o(),!1)):n?!0:(o(),!1)})}refinement(e,r){return this._refinement((t,s)=>e(t)?!0:(s.addIssue(typeof r=="function"?r(t,s):r),!1))}_refinement(e){return new Xt({schema:this,typeName:Pe.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 dr.create(this,this._def)}nullable(){return zr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Ca.create(this,this._def)}or(e){return Ss.create([this,e],this._def)}and(e){return Ps.create(this,e,this._def)}transform(e){return new Xt({...$e(this._def),schema:this,typeName:Pe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Cs({...$e(this._def),innerType:this,defaultValue:r,typeName:Pe.ZodDefault})}brand(){return new Ii({typeName:Pe.ZodBranded,type:this,...$e(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Is({...$e(this._def),innerType:this,catchValue:r,typeName:Pe.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ai.create(this,e)}readonly(){return As.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},f5=/^c[^\s-]{8,}$/i,m5=/^[0-9a-z]+$/,h5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,v5=/^[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,g5=/^[a-z0-9_-]{21}$/i,y5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,b5=/^[-+]?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)?)??$/,x5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yd,E5=/^(?:(?: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])$/,w5=/^(?:(?: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])$/,S5=/^(([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]))$/,P5=/^(([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])$/,R5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,y1="((\\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])))",k5=new RegExp(`^${y1}$`);function b1(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);let r=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function O5(a){return new RegExp(`^${b1(a)}$`)}function x1(a){let e=`${y1}T${b1(a)}`,r=[];return r.push(a.local?"Z?":"Z"),a.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function C5(a,e){return!!((e==="v4"||!e)&&E5.test(a)||(e==="v6"||!e)&&S5.test(a))}function I5(a,e){if(!y5.test(a))return!1;try{let[r]=a.split(".");if(!r)return!1;let t=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(t));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function A5(a,e){return!!((e==="v4"||!e)&&w5.test(a)||(e==="v6"||!e)&&P5.test(a))}var ka=class a extends je{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_type,expected:le.string,received:i.parsedType}),we}let t=new Rt,s;for(let i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(s=this._getOrReturnCtx(e,s),se(s,{code:Y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind==="length"){let n=e.data.length>i.value,o=e.data.lengthe.test(s),{validation:r,code:Y.invalid_string,...me.errToObj(t)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...me.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,...me.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,...me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...me.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...me.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...me.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...me.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...me.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...me.errToObj(r)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...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.valuenew ka({checks:[],typeName:Pe.ZodString,coerce:a?.coerce??!1,...$e(a)});function j5(a,e){let r=(a.toString().split(".")[1]||"").length,t=(e.toString().split(".")[1]||"").length,s=r>t?r:t,i=Number.parseInt(a.toFixed(s).replace(".","")),n=Number.parseInt(e.toFixed(s).replace(".",""));return i%n/10**s}var ys=class a extends je{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)!==le.number){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_type,expected:le.number,received:i.parsedType}),we}let t,s=new Rt;for(let i of this._def.checks)i.kind==="int"?Ge.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),se(t,{code:Y.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?j5(e.data,i.value)!==0&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),se(t,{code:Y.not_finite,message:i.message}),s.dirty()):Ge.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,t,s){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:t,message:me.toString(s)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.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.valuee.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let t of this._def.checks){if(t.kind==="finite"||t.kind==="int"||t.kind==="multipleOf")return!0;t.kind==="min"?(r===null||t.value>r)&&(r=t.value):t.kind==="max"&&(e===null||t.valuenew ys({checks:[],typeName:Pe.ZodNumber,coerce:a?.coerce||!1,...$e(a)});var bs=class a extends je{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)!==le.bigint)return this._getInvalidInput(e);let t,s=new Rt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),se(t,{code:Y.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ge.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return se(r,{code:Y.invalid_type,expected:le.bigint,received:r.parsedType}),we}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,t,s){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:t,message:me.toString(s)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.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.valuenew bs({checks:[],typeName:Pe.ZodBigInt,coerce:a?.coerce??!1,...$e(a)});var xs=class extends je{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.boolean,received:t.parsedType}),we}return Ot(e.data)}};xs.create=a=>new xs({typeName:Pe.ZodBoolean,coerce:a?.coerce||!1,...$e(a)});var _s=class a extends je{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_type,expected:le.date,received:i.parsedType}),we}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return se(i,{code:Y.invalid_date}),we}let t=new Rt,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(s=this._getOrReturnCtx(e,s),se(s,{code:Y.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):Ge.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:me.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.valuenew _s({checks:[],coerce:a?.coerce||!1,typeName:Pe.ZodDate,...$e(a)});var Pn=class extends je{_parse(e){if(this._getType(e)!==le.symbol){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.symbol,received:t.parsedType}),we}return Ot(e.data)}};Pn.create=a=>new Pn({typeName:Pe.ZodSymbol,...$e(a)});var Es=class extends je{_parse(e){if(this._getType(e)!==le.undefined){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.undefined,received:t.parsedType}),we}return Ot(e.data)}};Es.create=a=>new Es({typeName:Pe.ZodUndefined,...$e(a)});var ws=class extends je{_parse(e){if(this._getType(e)!==le.null){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.null,received:t.parsedType}),we}return Ot(e.data)}};ws.create=a=>new ws({typeName:Pe.ZodNull,...$e(a)});var Oa=class extends je{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};Oa.create=a=>new Oa({typeName:Pe.ZodAny,...$e(a)});var sa=class extends je{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};sa.create=a=>new sa({typeName:Pe.ZodUnknown,...$e(a)});var Pr=class extends je{_parse(e){let r=this._getOrReturnCtx(e);return se(r,{code:Y.invalid_type,expected:le.never,received:r.parsedType}),we}};Pr.create=a=>new Pr({typeName:Pe.ZodNever,...$e(a)});var Rn=class extends je{_parse(e){if(this._getType(e)!==le.undefined){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.void,received:t.parsedType}),we}return Ot(e.data)}};Rn.create=a=>new Rn({typeName:Pe.ZodVoid,...$e(a)});var na=class a extends je{_parse(e){let{ctx:r,status:t}=this._processInputParams(e),s=this._def;if(r.parsedType!==le.array)return se(r,{code:Y.invalid_type,expected:le.array,received:r.parsedType}),we;if(s.exactLength!==null){let n=r.data.length>s.exactLength.value,o=r.data.lengths.maxLength.value&&(se(r,{code:Y.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),t.dirty()),r.common.async)return Promise.all([...r.data].map((n,o)=>s.type._parseAsync(new fr(r,n,r.path,o)))).then(n=>Rt.mergeArray(t,n));let i=[...r.data].map((n,o)=>s.type._parseSync(new fr(r,n,r.path,o)));return Rt.mergeArray(t,i)}get element(){return this._def.type}min(e,r){return new a({...this._def,minLength:{value:e,message:me.toString(r)}})}max(e,r){return new a({...this._def,maxLength:{value:e,message:me.toString(r)}})}length(e,r){return new a({...this._def,exactLength:{value:e,message:me.toString(r)}})}nonempty(e){return this.min(1,e)}};na.create=(a,e)=>new na({type:a,minLength:null,maxLength:null,exactLength:null,typeName:Pe.ZodArray,...$e(e)});function En(a){if(a instanceof zt){let e={};for(let r in a.shape){let t=a.shape[r];e[r]=dr.create(En(t))}return new zt({...a._def,shape:()=>e})}else return a instanceof na?new na({...a._def,type:En(a.element)}):a instanceof dr?dr.create(En(a.unwrap())):a instanceof zr?zr.create(En(a.unwrap())):a instanceof Ur?Ur.create(a.items.map(e=>En(e))):a}var zt=class a extends je{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=Ge.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==le.object){let c=this._getOrReturnCtx(e);return se(c,{code:Y.invalid_type,expected:le.object,received:c.parsedType}),we}let{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),o=[];if(!(this._def.catchall instanceof Pr&&this._def.unknownKeys==="strip"))for(let c in s.data)n.includes(c)||o.push(c);let l=[];for(let c of n){let u=i[c],p=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new fr(s,p,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Pr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")o.length>0&&(se(s,{code:Y.unrecognized_keys,keys:o}),t.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of o){let p=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new fr(s,p,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let p=await u.key,m=await u.value;c.push({key:p,value:m,alwaysSet:u.alwaysSet})}return c}).then(c=>Rt.mergeObjectSync(t,c)):Rt.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,t)=>{let s=this._def.errorMap?.(r,t).message??t.defaultError;return r.code==="unrecognized_keys"?{message:me.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new a({...this._def,unknownKeys:"strip"})}passthrough(){return new a({...this._def,unknownKeys:"passthrough"})}extend(e){return new a({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new a({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Pe.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new a({...this._def,catchall:e})}pick(e){let r={};for(let t of Ge.objectKeys(e))e[t]&&this.shape[t]&&(r[t]=this.shape[t]);return new a({...this._def,shape:()=>r})}omit(e){let r={};for(let t of Ge.objectKeys(this.shape))e[t]||(r[t]=this.shape[t]);return new a({...this._def,shape:()=>r})}deepPartial(){return En(this)}partial(e){let r={};for(let t of Ge.objectKeys(this.shape)){let s=this.shape[t];e&&!e[t]?r[t]=s:r[t]=s.optional()}return new a({...this._def,shape:()=>r})}required(e){let r={};for(let t of Ge.objectKeys(this.shape))if(e&&!e[t])r[t]=this.shape[t];else{let i=this.shape[t];for(;i instanceof dr;)i=i._def.innerType;r[t]=i}return new a({...this._def,shape:()=>r})}keyof(){return _1(Ge.objectKeys(this.shape))}};zt.create=(a,e)=>new zt({shape:()=>a,unknownKeys:"strip",catchall:Pr.create(),typeName:Pe.ZodObject,...$e(e)});zt.strictCreate=(a,e)=>new zt({shape:()=>a,unknownKeys:"strict",catchall:Pr.create(),typeName:Pe.ZodObject,...$e(e)});zt.lazycreate=(a,e)=>new zt({shape:a,unknownKeys:"strip",catchall:Pr.create(),typeName:Pe.ZodObject,...$e(e)});var Ss=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=this._def.options;function s(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let n=i.map(o=>new Qt(o.ctx.common.issues));return se(r,{code:Y.invalid_union,unionErrors:n}),we}if(r.common.async)return Promise.all(t.map(async i=>{let n={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:n}),ctx:n}})).then(s);{let i,n=[];for(let l of t){let c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&n.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let o=n.map(l=>new Qt(l));return se(r,{code:Y.invalid_union,unionErrors:o}),we}}get options(){return this._def.options}};Ss.create=(a,e)=>new Ss({options:a,typeName:Pe.ZodUnion,...$e(e)});var ta=a=>a instanceof Rs?ta(a.schema):a instanceof Xt?ta(a.innerType()):a instanceof Ts?[a.value]:a instanceof ks?a.options:a instanceof Os?Ge.objectValues(a.enum):a instanceof Cs?ta(a._def.innerType):a instanceof Es?[void 0]:a instanceof ws?[null]:a instanceof dr?[void 0,...ta(a.unwrap())]:a instanceof zr?[null,...ta(a.unwrap())]:a instanceof Ii||a instanceof As?ta(a.unwrap()):a instanceof Is?ta(a._def.innerType):[],Vc=class a extends je{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==le.object)return se(r,{code:Y.invalid_type,expected:le.object,received:r.parsedType}),we;let t=this.discriminator,s=r.data[t],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(se(r,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,t){let s=new Map;for(let i of r){let n=ta(i.shape[e]);if(!n.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of n){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,i)}}return new a({typeName:Pe.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...$e(t)})}};function Od(a,e){let r=ra(a),t=ra(e);if(a===e)return{valid:!0,data:a};if(r===le.object&&t===le.object){let s=Ge.objectKeys(e),i=Ge.objectKeys(a).filter(o=>s.indexOf(o)!==-1),n={...a,...e};for(let o of i){let l=Od(a[o],e[o]);if(!l.valid)return{valid:!1};n[o]=l.data}return{valid:!0,data:n}}else if(r===le.array&&t===le.array){if(a.length!==e.length)return{valid:!1};let s=[];for(let i=0;i{if(Td(i)||Td(n))return we;let o=Od(i.value,n.value);return o.valid?((kd(i)||kd(n))&&r.dirty(),{status:r.value,value:o.data}):(se(t,{code:Y.invalid_intersection_types}),we)};return t.common.async?Promise.all([this._def.left._parseAsync({data:t.data,path:t.path,parent:t}),this._def.right._parseAsync({data:t.data,path:t.path,parent:t})]).then(([i,n])=>s(i,n)):s(this._def.left._parseSync({data:t.data,path:t.path,parent:t}),this._def.right._parseSync({data:t.data,path:t.path,parent:t}))}};Ps.create=(a,e,r)=>new Ps({left:a,right:e,typeName:Pe.ZodIntersection,...$e(r)});var Ur=class a extends je{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.array)return se(t,{code:Y.invalid_type,expected:le.array,received:t.parsedType}),we;if(t.data.lengththis._def.items.length&&(se(t,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...t.data].map((n,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new fr(t,n,t.path,o)):null}).filter(n=>!!n);return t.common.async?Promise.all(i).then(n=>Rt.mergeArray(r,n)):Rt.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};Ur.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:a,typeName:Pe.ZodTuple,rest:null,...$e(e)})};var Gc=class a extends je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.object)return se(t,{code:Y.invalid_type,expected:le.object,received:t.parsedType}),we;let s=[],i=this._def.keyType,n=this._def.valueType;for(let o in t.data)s.push({key:i._parse(new fr(t,o,t.path,o)),value:n._parse(new fr(t,t.data[o],t.path,o)),alwaysSet:o in t.data});return t.common.async?Rt.mergeObjectAsync(r,s):Rt.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,t){return r instanceof je?new a({keyType:e,valueType:r,typeName:Pe.ZodRecord,...$e(t)}):new a({keyType:ka.create(),valueType:e,typeName:Pe.ZodRecord,...$e(r)})}},Tn=class extends je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.map)return se(t,{code:Y.invalid_type,expected:le.map,received:t.parsedType}),we;let s=this._def.keyType,i=this._def.valueType,n=[...t.data.entries()].map(([o,l],c)=>({key:s._parse(new fr(t,o,t.path,[c,"key"])),value:i._parse(new fr(t,l,t.path,[c,"value"]))}));if(t.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of n){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return we;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of n){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return we;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}}}};Tn.create=(a,e,r)=>new Tn({valueType:e,keyType:a,typeName:Pe.ZodMap,...$e(r)});var kn=class a extends je{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.parsedType!==le.set)return se(t,{code:Y.invalid_type,expected:le.set,received:t.parsedType}),we;let s=this._def;s.minSize!==null&&t.data.sizes.maxSize.value&&(se(t,{code:Y.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function n(l){let c=new Set;for(let u of l){if(u.status==="aborted")return we;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}let o=[...t.data.values()].map((l,c)=>i._parse(new fr(t,l,t.path,c)));return t.common.async?Promise.all(o).then(l=>n(l)):n(o)}min(e,r){return new a({...this._def,minSize:{value:e,message:me.toString(r)}})}max(e,r){return new a({...this._def,maxSize:{value:e,message:me.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};kn.create=(a,e)=>new kn({valueType:a,minSize:null,maxSize:null,typeName:Pe.ZodSet,...$e(e)});var Zc=class a extends je{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==le.function)return se(r,{code:Y.invalid_type,expected:le.function,received:r.parsedType}),we;function t(o,l){return Bc({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Sn].filter(c=>!!c),issueData:{code:Y.invalid_arguments,argumentsError:l}})}function s(o,l){return Bc({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hc(),Sn].filter(c=>!!c),issueData:{code:Y.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},n=r.data;if(this._def.returns instanceof Ca){let o=this;return Ot(async function(...l){let c=new Qt([]),u=await o._def.args.parseAsync(l,i).catch(f=>{throw c.addIssue(t(l,f)),c}),p=await Reflect.apply(n,this,u);return await o._def.returns._def.type.parseAsync(p,i).catch(f=>{throw c.addIssue(s(p,f)),c})})}else{let o=this;return Ot(function(...l){let c=o._def.args.safeParse(l,i);if(!c.success)throw new Qt([t(l,c.error)]);let u=Reflect.apply(n,this,c.data),p=o._def.returns.safeParse(u,i);if(!p.success)throw new Qt([s(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:Ur.create(e).rest(sa.create())})}returns(e){return new a({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,t){return new a({args:e||Ur.create([]).rest(sa.create()),returns:r||sa.create(),typeName:Pe.ZodFunction,...$e(t)})}},Rs=class extends je{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})}};Rs.create=(a,e)=>new Rs({getter:a,typeName:Pe.ZodLazy,...$e(e)});var Ts=class extends je{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return se(r,{received:r.data,code:Y.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ts.create=(a,e)=>new Ts({value:a,typeName:Pe.ZodLiteral,...$e(e)});function _1(a,e){return new ks({values:a,typeName:Pe.ZodEnum,...$e(e)})}var ks=class a extends je{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),t=this._def.values;return se(r,{expected:Ge.joinValues(t),received:r.parsedType,code:Y.invalid_type}),we}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),t=this._def.values;return se(r,{received:r.data,code:Y.invalid_enum_value,options:t}),we}return Ot(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 a.create(e,{...this._def,...r})}exclude(e,r=this._def){return a.create(this.options.filter(t=>!e.includes(t)),{...this._def,...r})}};ks.create=_1;var Os=class extends je{_parse(e){let r=Ge.getValidEnumValues(this._def.values),t=this._getOrReturnCtx(e);if(t.parsedType!==le.string&&t.parsedType!==le.number){let s=Ge.objectValues(r);return se(t,{expected:Ge.joinValues(s),received:t.parsedType,code:Y.invalid_type}),we}if(this._cache||(this._cache=new Set(Ge.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=Ge.objectValues(r);return se(t,{received:t.data,code:Y.invalid_enum_value,options:s}),we}return Ot(e.data)}get enum(){return this._def.values}};Os.create=(a,e)=>new Os({values:a,typeName:Pe.ZodNativeEnum,...$e(e)});var Ca=class extends je{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==le.promise&&r.common.async===!1)return se(r,{code:Y.invalid_type,expected:le.promise,received:r.parsedType}),we;let t=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Ot(t.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ca.create=(a,e)=>new Ca({type:a,typeName:Pe.ZodPromise,...$e(e)});var Xt=class extends je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:t}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:n=>{se(t,n),n.fatal?r.abort():r.dirty()},get path(){return t.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let n=s.transform(t.data,i);if(t.common.async)return Promise.resolve(n).then(async o=>{if(r.value==="aborted")return we;let l=await this._def.schema._parseAsync({data:o,path:t.path,parent:t});return l.status==="aborted"?we:l.status==="dirty"||r.value==="dirty"?wn(l.value):l});{if(r.value==="aborted")return we;let o=this._def.schema._parseSync({data:n,path:t.path,parent:t});return o.status==="aborted"?we:o.status==="dirty"||r.value==="dirty"?wn(o.value):o}}if(s.type==="refinement"){let n=o=>{let l=s.refinement(o,i);if(t.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(t.common.async===!1){let o=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});return o.status==="aborted"?we:(o.status==="dirty"&&r.dirty(),n(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(o=>o.status==="aborted"?we:(o.status==="dirty"&&r.dirty(),n(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(t.common.async===!1){let n=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});if(!gs(n))return we;let o=s.transform(n.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(n=>gs(n)?Promise.resolve(s.transform(n.value,i)).then(o=>({status:r.value,value:o})):we);Ge.assertNever(s)}};Xt.create=(a,e,r)=>new Xt({schema:a,typeName:Pe.ZodEffects,effect:e,...$e(r)});Xt.createWithPreprocess=(a,e,r)=>new Xt({schema:e,effect:{type:"preprocess",transform:a},typeName:Pe.ZodEffects,...$e(r)});var dr=class extends je{_parse(e){return this._getType(e)===le.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};dr.create=(a,e)=>new dr({innerType:a,typeName:Pe.ZodOptional,...$e(e)});var zr=class extends je{_parse(e){return this._getType(e)===le.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zr.create=(a,e)=>new zr({innerType:a,typeName:Pe.ZodNullable,...$e(e)});var Cs=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return r.parsedType===le.undefined&&(t=this._def.defaultValue()),this._def.innerType._parse({data:t,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Cs.create=(a,e)=>new Cs({innerType:a,typeName:Pe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...$e(e)});var Is=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t}});return Ci(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(t.common.issues)},input:t.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qt(t.common.issues)},input:t.data})}}removeCatch(){return this._def.innerType}};Is.create=(a,e)=>new Is({innerType:a,typeName:Pe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...$e(e)});var On=class extends je{_parse(e){if(this._getType(e)!==le.nan){let t=this._getOrReturnCtx(e);return se(t,{code:Y.invalid_type,expected:le.nan,received:t.parsedType}),we}return{status:"valid",value:e.data}}};On.create=a=>new On({typeName:Pe.ZodNaN,...$e(a)});var N5=Symbol("zod_brand"),Ii=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return this._def.type._parse({data:t,path:r.path,parent:r})}unwrap(){return this._def.type}},Ai=class a extends je{_parse(e){let{status:r,ctx:t}=this._processInputParams(e);if(t.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return i.status==="aborted"?we:i.status==="dirty"?(r.dirty(),wn(i.value)):this._def.out._parseAsync({data:i.value,path:t.path,parent:t})})();{let s=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return s.status==="aborted"?we:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:t.path,parent:t})}}static create(e,r){return new a({in:e,out:r,typeName:Pe.ZodPipeline})}},As=class extends je{_parse(e){let r=this._def.innerType._parse(e),t=s=>(gs(s)&&(s.value=Object.freeze(s.value)),s);return Ci(r)?r.then(s=>t(s)):t(r)}unwrap(){return this._def.innerType}};As.create=(a,e)=>new As({innerType:a,typeName:Pe.ZodReadonly,...$e(e)});function KE(a,e){let r=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof r=="string"?{message:r}:r}function E1(a,e={},r){return a?Oa.create().superRefine((t,s)=>{let i=a(t);if(i instanceof Promise)return i.then(n=>{if(!n){let o=KE(e,t),l=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:l})}});if(!i){let n=KE(e,t),o=n.fatal??r??!0;s.addIssue({code:"custom",...n,fatal:o})}}):Oa.create()}var D5={object:zt.lazycreate},Pe;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(Pe||(Pe={}));var $5=(a,e={message:`Input not instance of ${a.name}`})=>E1(r=>r instanceof a,e),w1=ka.create,S1=ys.create,q5=On.create,M5=bs.create,P1=xs.create,F5=_s.create,L5=Pn.create,U5=Es.create,z5=ws.create,H5=Oa.create,B5=sa.create,V5=Pr.create,G5=Rn.create,Z5=na.create,W5=zt.create,K5=zt.strictCreate,Q5=Ss.create,X5=Vc.create,J5=Ps.create,Y5=Ur.create,e6=Gc.create,t6=Tn.create,r6=kn.create,a6=Zc.create,s6=Rs.create,n6=Ts.create,i6=ks.create,o6=Os.create,c6=Ca.create,QE=Xt.create,l6=dr.create,u6=zr.create,p6=Xt.createWithPreprocess,d6=Ai.create,f6=()=>w1().optional(),m6=()=>S1().optional(),h6=()=>P1().optional(),v6={string:a=>ka.create({...a,coerce:!0}),number:a=>ys.create({...a,coerce:!0}),boolean:a=>xs.create({...a,coerce:!0}),bigint:a=>bs.create({...a,coerce:!0}),date:a=>_s.create({...a,coerce:!0})},g6=we;var Xc="2.0",R1=w.union([w.string(),w.number().int()]),T1=w.string(),y6=w.object({progressToken:w.optional(R1)}).passthrough(),mr=w.object({_meta:w.optional(y6)}).passthrough(),Ht=w.object({method:w.string(),params:w.optional(mr)}),Ni=w.object({_meta:w.optional(w.object({}).passthrough())}).passthrough(),Hr=w.object({method:w.string(),params:w.optional(Ni)}),hr=w.object({_meta:w.optional(w.object({}).passthrough())}).passthrough(),Jc=w.union([w.string(),w.number().int()]),b6=w.object({jsonrpc:w.literal(Xc),id:Jc}).merge(Ht).strict();var x6=w.object({jsonrpc:w.literal(Xc)}).merge(Hr).strict();var _6=w.object({jsonrpc:w.literal(Xc),id:Jc,result:hr}).strict();var XE;(function(a){a[a.ConnectionClosed=-32e3]="ConnectionClosed",a[a.RequestTimeout=-32001]="RequestTimeout",a[a.ParseError=-32700]="ParseError",a[a.InvalidRequest=-32600]="InvalidRequest",a[a.MethodNotFound=-32601]="MethodNotFound",a[a.InvalidParams=-32602]="InvalidParams",a[a.InternalError=-32603]="InternalError"})(XE||(XE={}));var E6=w.object({jsonrpc:w.literal(Xc),id:Jc,error:w.object({code:w.number().int(),message:w.string(),data:w.optional(w.unknown())})}).strict();var L3=w.union([b6,x6,_6,E6]),k1=hr.strict(),O1=Hr.extend({method:w.literal("notifications/cancelled"),params:Ni.extend({requestId:Jc,reason:w.string().optional()})}),Di=w.object({name:w.string(),title:w.optional(w.string())}).passthrough(),C1=Di.extend({version:w.string()}),w6=w.object({experimental:w.optional(w.object({}).passthrough()),sampling:w.optional(w.object({}).passthrough()),elicitation:w.optional(w.object({}).passthrough()),roots:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough())}).passthrough(),S6=Ht.extend({method:w.literal("initialize"),params:mr.extend({protocolVersion:w.string(),capabilities:w6,clientInfo:C1})}),P6=w.object({experimental:w.optional(w.object({}).passthrough()),logging:w.optional(w.object({}).passthrough()),completions:w.optional(w.object({}).passthrough()),prompts:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough()),resources:w.optional(w.object({subscribe:w.optional(w.boolean()),listChanged:w.optional(w.boolean())}).passthrough()),tools:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough())}).passthrough(),R6=hr.extend({protocolVersion:w.string(),capabilities:P6,serverInfo:C1,instructions:w.optional(w.string())}),T6=Hr.extend({method:w.literal("notifications/initialized")}),I1=Ht.extend({method:w.literal("ping")}),k6=w.object({progress:w.number(),total:w.optional(w.number()),message:w.optional(w.string())}).passthrough(),A1=Hr.extend({method:w.literal("notifications/progress"),params:Ni.merge(k6).extend({progressToken:R1})}),Yc=Ht.extend({params:mr.extend({cursor:w.optional(T1)}).optional()}),el=hr.extend({nextCursor:w.optional(T1)}),j1=w.object({uri:w.string(),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}).passthrough(),N1=j1.extend({text:w.string()}),$d=w.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),D1=j1.extend({blob:$d}),$1=Di.extend({uri:w.string(),description:w.optional(w.string()),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}),O6=Di.extend({uriTemplate:w.string(),description:w.optional(w.string()),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}),C6=Yc.extend({method:w.literal("resources/list")}),I6=el.extend({resources:w.array($1)}),A6=Yc.extend({method:w.literal("resources/templates/list")}),j6=el.extend({resourceTemplates:w.array(O6)}),N6=Ht.extend({method:w.literal("resources/read"),params:mr.extend({uri:w.string()})}),D6=hr.extend({contents:w.array(w.union([N1,D1]))}),$6=Hr.extend({method:w.literal("notifications/resources/list_changed")}),q6=Ht.extend({method:w.literal("resources/subscribe"),params:mr.extend({uri:w.string()})}),M6=Ht.extend({method:w.literal("resources/unsubscribe"),params:mr.extend({uri:w.string()})}),F6=Hr.extend({method:w.literal("notifications/resources/updated"),params:Ni.extend({uri:w.string()})}),L6=w.object({name:w.string(),description:w.optional(w.string()),required:w.optional(w.boolean())}).passthrough(),U6=Di.extend({description:w.optional(w.string()),arguments:w.optional(w.array(L6)),_meta:w.optional(w.object({}).passthrough())}),z6=Yc.extend({method:w.literal("prompts/list")}),H6=el.extend({prompts:w.array(U6)}),B6=Ht.extend({method:w.literal("prompts/get"),params:mr.extend({name:w.string(),arguments:w.optional(w.record(w.string()))})}),qd=w.object({type:w.literal("text"),text:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),Md=w.object({type:w.literal("image"),data:$d,mimeType:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),Fd=w.object({type:w.literal("audio"),data:$d,mimeType:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),V6=w.object({type:w.literal("resource"),resource:w.union([N1,D1]),_meta:w.optional(w.object({}).passthrough())}).passthrough(),G6=$1.extend({type:w.literal("resource_link")}),q1=w.union([qd,Md,Fd,G6,V6]),Z6=w.object({role:w.enum(["user","assistant"]),content:q1}).passthrough(),W6=hr.extend({description:w.optional(w.string()),messages:w.array(Z6)}),K6=Hr.extend({method:w.literal("notifications/prompts/list_changed")}),Q6=w.object({title:w.optional(w.string()),readOnlyHint:w.optional(w.boolean()),destructiveHint:w.optional(w.boolean()),idempotentHint:w.optional(w.boolean()),openWorldHint:w.optional(w.boolean())}).passthrough(),X6=Di.extend({description:w.optional(w.string()),inputSchema:w.object({type:w.literal("object"),properties:w.optional(w.object({}).passthrough()),required:w.optional(w.array(w.string()))}).passthrough(),outputSchema:w.optional(w.object({type:w.literal("object"),properties:w.optional(w.object({}).passthrough()),required:w.optional(w.array(w.string()))}).passthrough()),annotations:w.optional(Q6),_meta:w.optional(w.object({}).passthrough())}),J6=Yc.extend({method:w.literal("tools/list")}),Y6=el.extend({tools:w.array(X6)}),M1=hr.extend({content:w.array(q1).default([]),structuredContent:w.object({}).passthrough().optional(),isError:w.optional(w.boolean())}),U3=M1.or(hr.extend({toolResult:w.unknown()})),e$=Ht.extend({method:w.literal("tools/call"),params:mr.extend({name:w.string(),arguments:w.optional(w.record(w.unknown()))})}),t$=Hr.extend({method:w.literal("notifications/tools/list_changed")}),F1=w.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),r$=Ht.extend({method:w.literal("logging/setLevel"),params:mr.extend({level:F1})}),a$=Hr.extend({method:w.literal("notifications/message"),params:Ni.extend({level:F1,logger:w.optional(w.string()),data:w.unknown()})}),s$=w.object({name:w.string().optional()}).passthrough(),n$=w.object({hints:w.optional(w.array(s$)),costPriority:w.optional(w.number().min(0).max(1)),speedPriority:w.optional(w.number().min(0).max(1)),intelligencePriority:w.optional(w.number().min(0).max(1))}).passthrough(),i$=w.object({role:w.enum(["user","assistant"]),content:w.union([qd,Md,Fd])}).passthrough(),o$=Ht.extend({method:w.literal("sampling/createMessage"),params:mr.extend({messages:w.array(i$),systemPrompt:w.optional(w.string()),includeContext:w.optional(w.enum(["none","thisServer","allServers"])),temperature:w.optional(w.number()),maxTokens:w.number().int(),stopSequences:w.optional(w.array(w.string())),metadata:w.optional(w.object({}).passthrough()),modelPreferences:w.optional(n$)})}),c$=hr.extend({model:w.string(),stopReason:w.optional(w.enum(["endTurn","stopSequence","maxTokens"]).or(w.string())),role:w.enum(["user","assistant"]),content:w.discriminatedUnion("type",[qd,Md,Fd])}),l$=w.object({type:w.literal("boolean"),title:w.optional(w.string()),description:w.optional(w.string()),default:w.optional(w.boolean())}).passthrough(),u$=w.object({type:w.literal("string"),title:w.optional(w.string()),description:w.optional(w.string()),minLength:w.optional(w.number()),maxLength:w.optional(w.number()),format:w.optional(w.enum(["email","uri","date","date-time"]))}).passthrough(),p$=w.object({type:w.enum(["number","integer"]),title:w.optional(w.string()),description:w.optional(w.string()),minimum:w.optional(w.number()),maximum:w.optional(w.number())}).passthrough(),d$=w.object({type:w.literal("string"),title:w.optional(w.string()),description:w.optional(w.string()),enum:w.array(w.string()),enumNames:w.optional(w.array(w.string()))}).passthrough(),f$=w.union([l$,u$,p$,d$]),m$=Ht.extend({method:w.literal("elicitation/create"),params:mr.extend({message:w.string(),requestedSchema:w.object({type:w.literal("object"),properties:w.record(w.string(),f$),required:w.optional(w.array(w.string()))}).passthrough()})}),h$=hr.extend({action:w.enum(["accept","decline","cancel"]),content:w.optional(w.record(w.string(),w.unknown()))}),v$=w.object({type:w.literal("ref/resource"),uri:w.string()}).passthrough(),g$=w.object({type:w.literal("ref/prompt"),name:w.string()}).passthrough(),y$=Ht.extend({method:w.literal("completion/complete"),params:mr.extend({ref:w.union([g$,v$]),argument:w.object({name:w.string(),value:w.string()}).passthrough(),context:w.optional(w.object({arguments:w.optional(w.record(w.string(),w.string()))}))})}),b$=hr.extend({completion:w.object({values:w.array(w.string()).max(100),total:w.optional(w.number().int()),hasMore:w.optional(w.boolean())}).passthrough()}),x$=w.object({uri:w.string().startsWith("file://"),name:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}).passthrough(),_$=Ht.extend({method:w.literal("roots/list")}),E$=hr.extend({roots:w.array(x$)}),w$=Hr.extend({method:w.literal("notifications/roots/list_changed")}),z3=w.union([I1,S6,y$,r$,B6,z6,C6,A6,N6,q6,M6,e$,J6]),H3=w.union([O1,A1,T6,w$]),B3=w.union([k1,c$,h$,E$]),V3=w.union([I1,o$,m$,_$]),G3=w.union([O1,A1,a$,F6,$6,t$,K6]),Z3=w.union([k1,R6,b$,W6,H6,I6,j6,D6,M1,Y6]);var W3=P9(iN(),1);var K3=Symbol("Let zodToJsonSchema decide on which parser to use");var Q3=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Cd;(function(a){a.Completable="McpCompletable"})(Cd||(Cd={}));var Wc=class extends je{_parse(e){let{ctx:r}=this._processInputParams(e),t=r.data;return this._def.type._parse({data:t,path:r.path,parent:r})}unwrap(){return this._def.type}};Wc.create=(a,e)=>new Wc({type:a,typeName:Cd.Completable,complete:e.complete,...S$(e)});function S$(a){if(!a)return{};let{errorMap:e,invalid_type_error:r,required_error:t,description:s}=a;if(e&&(r||t))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(n,o)=>{var l,c;let{message:u}=a;return n.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:(l=u??t)!==null&&l!==void 0?l:o.defaultError}:n.code!=="invalid_type"?{message:o.defaultError}:{message:(c=u??r)!==null&&c!==void 0?c:o.defaultError}},description:s}}function L1({prompt:a,options:e}){let{systemPrompt:r,settingSources:t,...s}=e??{},i,n;r===void 0?i="":typeof r=="string"?i=r:r.type==="preset"&&(n=r.append);let o=s.pathToClaudeCodeExecutable;if(!o){let xe=(0,r1.fileURLToPath)(P$.url),Oe=(0,xd.join)(xe,"..");o=(0,xd.join)(Oe,"cli.js")}process.env.CLAUDE_AGENT_SDK_VERSION="0.1.27";let{abortController:l=s1(),additionalDirectories:c=[],agents:u,allowedTools:p=[],canUseTool:m,continue:f,cwd:h,disallowedTools:d=[],env:v,executable:x=c1()?"bun":"node",executableArgs:b=[],extraArgs:E={},fallbackModel:k,forkSession:O,hooks:P,includePartialMessages:I,maxThinkingTokens:$,maxTurns:A,mcpServers:F,model:q,permissionMode:C="default",allowDangerouslySkipPermissions:R=!1,permissionPromptToolName:j,plugins:z,resume:B,resumeSessionAt:G,stderr:te,strictMcpConfig:X}=s,V=v;if(V||(V={...process.env}),V.CLAUDE_CODE_ENTRYPOINT||(V.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),!o)throw new Error("pathToClaudeCodeExecutable is required");let re={},ce=new Map;if(F)for(let[xe,Oe]of Object.entries(F))Oe.type==="sdk"&&"instance"in Oe?(ce.set(xe,Oe.instance),re[xe]={type:"sdk",name:xe}):re[xe]=Oe;let Be=typeof a=="string",be=new _d({abortController:l,additionalDirectories:c,agents:u,cwd:h,executable:x,executableArgs:b,extraArgs:E,pathToClaudeCodeExecutable:o,env:V,forkSession:O,stderr:te,customSystemPrompt:i,appendSystemPrompt:n,maxThinkingTokens:$,maxTurns:A,model:q,fallbackModel:k,permissionMode:C,allowDangerouslySkipPermissions:R,permissionPromptToolName:j,continueConversation:f,resume:B,resumeSessionAt:G,settingSources:t??[],allowedTools:p,disallowedTools:d,mcpServers:re,strictMcpConfig:X,canUseTool:!!m,hooks:!!P,includePartialMessages:I,plugins:z}),qe=new Pd(be,Be,m,P,l,ce);return typeof a=="string"?be.write(JSON.stringify({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:a}]},parent_tool_use_id:null})+` `):qe.streamInput(a),qe}var tl=class{dbManager;sessionManager;constructor(e,r){this.dbManager=e,this.sessionManager=r}async startSession(e,r){try{let t=this.findClaudeExecutable(),s=this.getModelId(),i=["Bash","Read","Write","Edit","Grep","Glob","WebFetch","WebSearch","Task","NotebookEdit","AskUserQuestion","TodoWrite"],n=this.createMessageGenerator(e),o=L1({prompt:n,options:{model:s,disallowedTools:i,abortController:e.abortController,pathToClaudeCodeExecutable:t}});for await(let c of o){if(c.type==="assistant"){let u=c.message.content,p=Array.isArray(u)?u.filter(v=>v.type==="text").map(v=>v.text).join(` -`):typeof u=="string"?u:"",m=p.length,f=e.cumulativeInputTokens+e.cumulativeOutputTokens,h=c.message.usage;h&&(e.cumulativeInputTokens+=h.input_tokens||0,e.cumulativeOutputTokens+=h.output_tokens||0,h.cache_creation_input_tokens&&(e.cumulativeInputTokens+=h.cache_creation_input_tokens),H.debug("SDK","Token usage captured",{sessionId:e.sessionDbId,inputTokens:h.input_tokens,outputTokens:h.output_tokens,cacheCreation:h.cache_creation_input_tokens||0,cacheRead:h.cache_read_input_tokens||0,cumulativeInput:e.cumulativeInputTokens,cumulativeOutput:e.cumulativeOutputTokens}));let d=e.cumulativeInputTokens+e.cumulativeOutputTokens-f;if(m>0){let v=m>100?p.substring(0,100)+"...":p;H.dataOut("SDK",`Response received (${m} chars)`,{sessionId:e.sessionDbId,promptNumber:e.lastPromptNumber},v),await this.processSDKResponse(e,p,r,d)}}c.type==="result"&&c.subtype}let l=Date.now()-e.startTime;H.success("SDK","Agent completed",{sessionId:e.sessionDbId,duration:`${(l/1e3).toFixed(1)}s`}),this.dbManager.getSessionStore().markSessionCompleted(e.sessionDbId)}catch(t){throw t.name==="AbortError"?H.warn("SDK","Agent aborted",{sessionId:e.sessionDbId}):H.failure("SDK","Agent error",{sessionDbId:e.sessionDbId},t),t}finally{this.sessionManager.deleteSession(e.sessionDbId).catch(()=>{})}}async*createMessageGenerator(e){yield{type:"user",message:{role:"user",content:e.lastPromptNumber===1?NE(e.project,e.claudeSessionId,e.userPrompt):qE(e.userPrompt,e.lastPromptNumber,e.claudeSessionId)},session_id:e.claudeSessionId,parent_tool_use_id:null,isSynthetic:!0};for await(let r of this.sessionManager.getMessageIterator(e.sessionDbId))r.type==="observation"?(r.prompt_number!==void 0&&(e.lastPromptNumber=r.prompt_number),yield{type:"user",message:{role:"user",content:DE({id:0,tool_name:r.tool_name,tool_input:JSON.stringify(r.tool_input),tool_output:JSON.stringify(r.tool_response),created_at_epoch:Date.now(),cwd:r.cwd})},session_id:e.claudeSessionId,parent_tool_use_id:null,isSynthetic:!0}):r.type==="summarize"&&(yield{type:"user",message:{role:"user",content:$E({id:e.sessionDbId,sdk_session_id:e.sdkSessionId,project:e.project,user_prompt:e.userPrompt,last_user_message:r.last_user_message||"",last_assistant_message:r.last_assistant_message||""})},session_id:e.claudeSessionId,parent_tool_use_id:null,isSynthetic:!0})}async processSDKResponse(e,r,t,s){let i=AE(r,e.claudeSessionId);for(let o of i){let{id:l,createdAtEpoch:c}=this.dbManager.getSessionStore().storeObservation(e.claudeSessionId,e.project,o,e.lastPromptNumber,s);H.info("SDK","Observation saved",{sessionId:e.sessionDbId,obsId:l,type:o.type,title:o.title||Kt("obs.title is null",{obsId:l,type:o.type},"(untitled)"),filesRead:o.files_read?.length??(Kt("obs.files_read is null/undefined",{obsId:l}),0),filesModified:o.files_modified?.length??(Kt("obs.files_modified is null/undefined",{obsId:l}),0),concepts:o.concepts?.length??(Kt("obs.concepts is null/undefined",{obsId:l}),0)});let u=Date.now(),p=o.type,m=o.title||Kt("obs.title is null for Chroma sync",{obsId:l,type:o.type},"(untitled)");this.dbManager.getChromaSync().syncObservation(l,e.claudeSessionId,e.project,o,e.lastPromptNumber,c,s).then(()=>{let f=Date.now()-u;H.debug("CHROMA","Observation synced",{obsId:l,duration:`${f}ms`,type:p,title:m})}).catch(f=>{H.error("CHROMA","Failed to sync observation",{obsId:l,sessionId:e.sessionDbId,type:p,title:m},f)}),t&&t.sseBroadcaster&&t.sseBroadcaster.broadcast({type:"new_observation",observation:{id:l,sdk_session_id:e.sdkSessionId,session_id:e.claudeSessionId,type:o.type,title:o.title,subtitle:o.subtitle,text:o.text||null,narrative:o.narrative||null,facts:JSON.stringify(o.facts||[]),concepts:JSON.stringify(o.concepts||[]),files_read:JSON.stringify(o.files||[]),files_modified:JSON.stringify([]),project:e.project,prompt_number:e.lastPromptNumber,created_at_epoch:c}})}let n=jE(r,e.sessionDbId);if(n){let{id:o,createdAtEpoch:l}=this.dbManager.getSessionStore().storeSummary(e.claudeSessionId,e.project,n,e.lastPromptNumber,s);H.info("SDK","Summary saved",{sessionId:e.sessionDbId,summaryId:o,request:n.request||Kt("summary.request is null",{summaryId:o},"(no request)"),hasCompleted:!!n.completed,hasNextSteps:!!n.next_steps});let c=Date.now(),u=n.request||Kt("summary.request is null for Chroma sync",{summaryId:o},"(no request)");this.dbManager.getChromaSync().syncSummary(o,e.claudeSessionId,e.project,n,e.lastPromptNumber,l,s).then(()=>{let p=Date.now()-c;H.debug("CHROMA","Summary synced",{summaryId:o,duration:`${p}ms`,request:u})}).catch(p=>{H.error("CHROMA","Failed to sync summary",{summaryId:o,sessionId:e.sessionDbId,request:u},p)}),t&&t.sseBroadcaster&&t.sseBroadcaster.broadcast({type:"new_summary",summary:{id:o,session_id:e.claudeSessionId,request:n.request,investigated:n.investigated,learned:n.learned,completed:n.completed,next_steps:n.next_steps,notes:n.notes,project:e.project,prompt_number:e.lastPromptNumber,created_at_epoch:l}})}t&&typeof t.broadcastProcessingStatus=="function"&&t.broadcastProcessingStatus()}findClaudeExecutable(){let e=process.env.CLAUDE_CODE_PATH||(0,U1.execSync)(process.platform==="win32"?"where claude":"which claude",{encoding:"utf8"}).trim().split(` +`):typeof u=="string"?u:"",m=p.length,f=e.cumulativeInputTokens+e.cumulativeOutputTokens,h=c.message.usage;h&&(e.cumulativeInputTokens+=h.input_tokens||0,e.cumulativeOutputTokens+=h.output_tokens||0,h.cache_creation_input_tokens&&(e.cumulativeInputTokens+=h.cache_creation_input_tokens),H.debug("SDK","Token usage captured",{sessionId:e.sessionDbId,inputTokens:h.input_tokens,outputTokens:h.output_tokens,cacheCreation:h.cache_creation_input_tokens||0,cacheRead:h.cache_read_input_tokens||0,cumulativeInput:e.cumulativeInputTokens,cumulativeOutput:e.cumulativeOutputTokens}));let d=e.cumulativeInputTokens+e.cumulativeOutputTokens-f;if(m>0){let v=m>100?p.substring(0,100)+"...":p;H.dataOut("SDK",`Response received (${m} chars)`,{sessionId:e.sessionDbId,promptNumber:e.lastPromptNumber},v),await this.processSDKResponse(e,p,r,d)}}c.type==="result"&&c.subtype}let l=Date.now()-e.startTime;H.success("SDK","Agent completed",{sessionId:e.sessionDbId,duration:`${(l/1e3).toFixed(1)}s`}),this.dbManager.getSessionStore().markSessionCompleted(e.sessionDbId)}catch(t){throw t.name==="AbortError"?H.warn("SDK","Agent aborted",{sessionId:e.sessionDbId}):H.failure("SDK","Agent error",{sessionDbId:e.sessionDbId},t),t}finally{this.sessionManager.deleteSession(e.sessionDbId).catch(()=>{})}}async*createMessageGenerator(e){yield{type:"user",message:{role:"user",content:e.lastPromptNumber===1?NE(e.project,e.claudeSessionId,e.userPrompt):qE(e.userPrompt,e.lastPromptNumber,e.claudeSessionId)},session_id:e.claudeSessionId,parent_tool_use_id:null,isSynthetic:!0};for await(let r of this.sessionManager.getMessageIterator(e.sessionDbId))r.type==="observation"?(r.prompt_number!==void 0&&(e.lastPromptNumber=r.prompt_number),yield{type:"user",message:{role:"user",content:DE({id:0,tool_name:r.tool_name,tool_input:JSON.stringify(r.tool_input),tool_output:JSON.stringify(r.tool_response),created_at_epoch:Date.now(),cwd:r.cwd})},session_id:e.claudeSessionId,parent_tool_use_id:null,isSynthetic:!0}):r.type==="summarize"&&(yield{type:"user",message:{role:"user",content:$E({id:e.sessionDbId,sdk_session_id:e.sdkSessionId,project:e.project,user_prompt:e.userPrompt,last_user_message:r.last_user_message||"",last_assistant_message:r.last_assistant_message||""})},session_id:e.claudeSessionId,parent_tool_use_id:null,isSynthetic:!0})}async processSDKResponse(e,r,t,s){let i=AE(r,e.claudeSessionId);for(let o of i){let{id:l,createdAtEpoch:c}=this.dbManager.getSessionStore().storeObservation(e.claudeSessionId,e.project,o,e.lastPromptNumber,s);H.info("SDK","Observation saved",{sessionId:e.sessionDbId,obsId:l,type:o.type,title:o.title||Ut("obs.title is null",{obsId:l,type:o.type},"(untitled)"),filesRead:o.files_read?.length??(Ut("obs.files_read is null/undefined",{obsId:l}),0),filesModified:o.files_modified?.length??(Ut("obs.files_modified is null/undefined",{obsId:l}),0),concepts:o.concepts?.length??(Ut("obs.concepts is null/undefined",{obsId:l}),0)});let u=Date.now(),p=o.type,m=o.title||Ut("obs.title is null for Chroma sync",{obsId:l,type:o.type},"(untitled)");this.dbManager.getChromaSync().syncObservation(l,e.claudeSessionId,e.project,o,e.lastPromptNumber,c,s).then(()=>{let f=Date.now()-u;H.debug("CHROMA","Observation synced",{obsId:l,duration:`${f}ms`,type:p,title:m})}).catch(f=>{H.error("CHROMA","Failed to sync observation",{obsId:l,sessionId:e.sessionDbId,type:p,title:m},f)}),t&&t.sseBroadcaster&&t.sseBroadcaster.broadcast({type:"new_observation",observation:{id:l,sdk_session_id:e.sdkSessionId,session_id:e.claudeSessionId,type:o.type,title:o.title,subtitle:o.subtitle,text:o.text||null,narrative:o.narrative||null,facts:JSON.stringify(o.facts||[]),concepts:JSON.stringify(o.concepts||[]),files_read:JSON.stringify(o.files||[]),files_modified:JSON.stringify([]),project:e.project,prompt_number:e.lastPromptNumber,created_at_epoch:c}})}let n=jE(r,e.sessionDbId);if(n){let{id:o,createdAtEpoch:l}=this.dbManager.getSessionStore().storeSummary(e.claudeSessionId,e.project,n,e.lastPromptNumber,s);H.info("SDK","Summary saved",{sessionId:e.sessionDbId,summaryId:o,request:n.request||Ut("summary.request is null",{summaryId:o},"(no request)"),hasCompleted:!!n.completed,hasNextSteps:!!n.next_steps});let c=Date.now(),u=n.request||Ut("summary.request is null for Chroma sync",{summaryId:o},"(no request)");this.dbManager.getChromaSync().syncSummary(o,e.claudeSessionId,e.project,n,e.lastPromptNumber,l,s).then(()=>{let p=Date.now()-c;H.debug("CHROMA","Summary synced",{summaryId:o,duration:`${p}ms`,request:u})}).catch(p=>{H.error("CHROMA","Failed to sync summary",{summaryId:o,sessionId:e.sessionDbId,request:u},p)}),t&&t.sseBroadcaster&&t.sseBroadcaster.broadcast({type:"new_summary",summary:{id:o,session_id:e.claudeSessionId,request:n.request,investigated:n.investigated,learned:n.learned,completed:n.completed,next_steps:n.next_steps,notes:n.notes,project:e.project,prompt_number:e.lastPromptNumber,created_at_epoch:l}})}t&&typeof t.broadcastProcessingStatus=="function"&&t.broadcastProcessingStatus()}findClaudeExecutable(){let e=process.env.CLAUDE_CODE_PATH||(0,U1.execSync)(process.platform==="win32"?"where claude":"which claude",{encoding:"utf8"}).trim().split(` `)[0].trim();if(!e)throw new Error("Claude executable not found in PATH");return e}getModelId(){try{let e=H1.default.join((0,z1.homedir)(),".claude-mem","settings.json");if((0,rl.existsSync)(e)){let t=JSON.parse((0,rl.readFileSync)(e,"utf-8")).env?.CLAUDE_MEM_MODEL;if(t)return t}}catch{}return process.env.CLAUDE_MEM_MODEL||"claude-haiku-4-5"}};var al=class{dbManager;constructor(e){this.dbManager=e}stripProjectPath(e,r){let t=`/${r}/`,s=e.indexOf(t);return s!==-1?e.substring(s+t.length):e}stripProjectPaths(e,r){if(!e)return e;try{let s=JSON.parse(e).map(i=>this.stripProjectPath(i,r));return JSON.stringify(s)}catch{return e}}sanitizeObservation(e){return{...e,files_read:this.stripProjectPaths(e.files_read,e.project),files_modified:this.stripProjectPaths(e.files_modified,e.project)}}getObservations(e,r,t){let s=this.paginate("observations","id, sdk_session_id, project, type, title, subtitle, narrative, text, facts, concepts, files_read, files_modified, prompt_number, created_at, created_at_epoch",e,r,t);return{...s,items:s.items.map(i=>this.sanitizeObservation(i))}}getSummaries(e,r,t){let s=this.dbManager.getSessionStore().db,i=` SELECT ss.id, diff --git a/src/services/worker/SessionManager.ts b/src/services/worker/SessionManager.ts index 81e766f8..416347cd 100644 --- a/src/services/worker/SessionManager.ts +++ b/src/services/worker/SessionManager.ts @@ -38,6 +38,19 @@ export class SessionManager { // Check if already active let session = this.sessions.get(sessionDbId); if (session) { + // Refresh project from database in case it was updated by new-hook + // This fixes the bug where sessions created with empty project get updated + // in the database but the in-memory session still has the stale empty value + const dbSession = this.dbManager.getSessionById(sessionDbId); + if (dbSession.project && dbSession.project !== session.project) { + silentDebug('[SessionManager] Updating project from database', { + sessionDbId, + oldProject: session.project, + newProject: dbSession.project + }); + session.project = dbSession.project; + } + // Update userPrompt for continuation prompts if (currentUserPrompt) { silentDebug('[SessionManager] Updating userPrompt for continuation', {