mirror of
https://github.com/thedotmack/claude-mem
synced 2026-04-25 17:15:04 +02:00
- Replaced instances of silentDebug with happy_path_error__with_fallback across multiple files to improve error logging and handling. - Updated the utility function to provide clearer semantics for error handling when expected values are missing. - Introduced a script to find potential silent failures in the codebase that may need to be addressed with the new error handling approach.
18 lines
247 KiB
JavaScript
Executable File
18 lines
247 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
"use strict";var Il=Object.create;var Oa=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var Cl=Object.getOwnPropertyNames;var kl=Object.getPrototypeOf,Nl=Object.prototype.hasOwnProperty;var Q=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),jl=(a,e)=>{for(var t in e)Oa(a,t,{get:e[t],enumerable:!0})},Fl=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Cl(e))!Nl.call(a,r)&&r!==t&&Oa(a,r,{get:()=>e[r],enumerable:!(s=$l(e,r))||s.enumerable});return a};var Ra=(a,e,t)=>(t=a!=null?Il(kl(a)):{},Fl(e||!a||!a.__esModule?Oa(t,"default",{value:a,enumerable:!0}):t,a));var gn=Q((Qt,vn)=>{(function(a,e){typeof Qt=="object"&&typeof vn<"u"?e(Qt):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{})})(Qt,(function(a){"use strict";function e(){for(var h=arguments.length,u=Array(h),g=0;g<h;g++)u[g]=arguments[g];if(u.length>1){u[0]=u[0].slice(0,-1);for(var E=u.length-1,x=1;x<E;++x)u[x]=u[x].slice(1,-1);return u[E]=u[E].slice(1),u.join("")}else return u[0]}function t(h){return"(?:"+h+")"}function s(h){return h===void 0?"undefined":h===null?"null":Object.prototype.toString.call(h).split(" ").pop().split("]").shift().toLowerCase()}function r(h){return h.toUpperCase()}function n(h){return h!=null?h instanceof Array?h:typeof h.length!="number"||h.split||h.setInterval||h.call?[h]:Array.prototype.slice.call(h):[]}function l(h,u){var g=h;if(u)for(var E in u)g[E]=u[E];return g}function o(h){var u="[A-Za-z]",g="[\\x0D]",E="[0-9]",x="[\\x22]",j=e(E,"[A-Fa-f]"),K="[\\x0A]",ae="[\\x20]",oe=t(t("%[EFef]"+j+"%"+j+j+"%"+j+j)+"|"+t("%[89A-Fa-f]"+j+"%"+j+j)+"|"+t("%"+j+j)),be="[\\:\\/\\?\\#\\[\\]\\@]",te="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",pe=e(be,te),Ee=h?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",de=h?"[\\uE000-\\uF8FF]":"[]",ne=e(u,E,"[\\-\\.\\_\\~]",Ee),he=t(u+e(u,E,"[\\+\\-\\.]")+"*"),ce=t(t(oe+"|"+e(ne,te,"[\\:]"))+"*"),Dr=t(t("25[0-5]")+"|"+t("2[0-4]"+E)+"|"+t("1"+E+E)+"|"+t("[1-9]"+E)+"|"+E),Me=t(t("25[0-5]")+"|"+t("2[0-4]"+E)+"|"+t("1"+E+E)+"|"+t("0?[1-9]"+E)+"|0?0?"+E),ze=t(Me+"\\."+Me+"\\."+Me+"\\."+Me),ue=t(j+"{1,4}"),qe=t(t(ue+"\\:"+ue)+"|"+ze),He=t(t(ue+"\\:")+"{6}"+qe),sr=t("\\:\\:"+t(ue+"\\:")+"{5}"+qe),Ir=t(t(ue)+"?\\:\\:"+t(ue+"\\:")+"{4}"+qe),dr=t(t(t(ue+"\\:")+"{0,1}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{3}"+qe),ht=t(t(t(ue+"\\:")+"{0,2}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{2}"+qe),Dt=t(t(t(ue+"\\:")+"{0,3}"+ue)+"?\\:\\:"+ue+"\\:"+qe),It=t(t(t(ue+"\\:")+"{0,4}"+ue)+"?\\:\\:"+qe),Yr=t(t(t(ue+"\\:")+"{0,5}"+ue)+"?\\:\\:"+ue),Xr=t(t(t(ue+"\\:")+"{0,6}"+ue)+"?\\:\\:"),fr=t([He,sr,Ir,dr,ht,Dt,It,Yr,Xr].join("|")),et=t(t(ne+"|"+oe)+"+"),Pa=t(fr+"\\%25"+et),$r=t(fr+t("\\%25|\\%(?!"+j+"{2})")+et),Pl=t("[vV]"+j+"+\\."+e(ne,te,"[\\:]")+"+"),wl=t("\\["+t($r+"|"+fr+"|"+Pl)+"\\]"),Ns=t(t(oe+"|"+e(ne,te))+"*"),mt=t(wl+"|"+ze+"(?!"+Ns+")|"+Ns),vt=t(E+"*"),js=t(t(ce+"@")+"?"+mt+t("\\:"+vt)+"?"),gt=t(oe+"|"+e(ne,te,"[\\:\\@]")),Ol=t(gt+"*"),Fs=t(gt+"+"),Rl=t(t(oe+"|"+e(ne,te,"[\\@]"))+"+"),pr=t(t("\\/"+Ol)+"*"),rt=t("\\/"+t(Fs+pr)+"?"),wa=t(Rl+pr),$t=t(Fs+pr),tt="(?!"+gt+")",Mf=t(pr+"|"+rt+"|"+wa+"|"+$t+"|"+tt),at=t(t(gt+"|"+e("[\\/\\?]",de))+"*"),yt=t(t(gt+"|[\\/\\?]")+"*"),Ls=t(t("\\/\\/"+js+pr)+"|"+rt+"|"+$t+"|"+tt),Tl=t(he+"\\:"+Ls+t("\\?"+at)+"?"+t("\\#"+yt)+"?"),Al=t(t("\\/\\/"+js+pr)+"|"+rt+"|"+wa+"|"+tt),Dl=t(Al+t("\\?"+at)+"?"+t("\\#"+yt)+"?"),qf=t(Tl+"|"+Dl),Uf=t(he+"\\:"+Ls+t("\\?"+at)+"?"),Vf="^("+he+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+mt+")"+t("\\:("+vt+")")+"?)")+"?("+pr+"|"+rt+"|"+$t+"|"+tt+")")+t("\\?("+at+")")+"?"+t("\\#("+yt+")")+"?$",zf="^(){0}"+t(t("\\/\\/("+t("("+ce+")@")+"?("+mt+")"+t("\\:("+vt+")")+"?)")+"?("+pr+"|"+rt+"|"+wa+"|"+tt+")")+t("\\?("+at+")")+"?"+t("\\#("+yt+")")+"?$",Hf="^("+he+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+mt+")"+t("\\:("+vt+")")+"?)")+"?("+pr+"|"+rt+"|"+$t+"|"+tt+")")+t("\\?("+at+")")+"?$",Zf="^"+t("\\#("+yt+")")+"?$",Bf="^"+t("("+ce+")@")+"?("+mt+")"+t("\\:("+vt+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",u,E,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",ne,te),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",ne,te),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",ne,te),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",ne,te),"g"),NOT_QUERY:new RegExp(e("[^\\%]",ne,te,"[\\:\\@\\/\\?]",de),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",ne,te,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",ne,te),"g"),UNRESERVED:new RegExp(ne,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",ne,pe),"g"),PCT_ENCODED:new RegExp(oe,"g"),IPV4ADDRESS:new RegExp("^("+ze+")$"),IPV6ADDRESS:new RegExp("^\\[?("+fr+")"+t(t("\\%25|\\%(?!"+j+"{2})")+"("+et+")")+"?\\]?$")}}var d=o(!1),f=o(!0),p=(function(){function h(u,g){var E=[],x=!0,j=!1,K=void 0;try{for(var ae=u[Symbol.iterator](),oe;!(x=(oe=ae.next()).done)&&(E.push(oe.value),!(g&&E.length===g));x=!0);}catch(be){j=!0,K=be}finally{try{!x&&ae.return&&ae.return()}finally{if(j)throw K}}return E}return function(u,g){if(Array.isArray(u))return u;if(Symbol.iterator in Object(u))return h(u,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),m=function(h){if(Array.isArray(h)){for(var u=0,g=Array(h.length);u<h.length;u++)g[u]=h[u];return g}else return Array.from(h)},b=2147483647,c=36,y=1,_=26,v=38,S=700,T=72,P=128,O="-",D=/^xn--/,I=/[^\0-\x7E]/,z=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$=c-y,U=Math.floor,M=String.fromCharCode;function F(h){throw new RangeError(q[h])}function A(h,u){for(var g=[],E=h.length;E--;)g[E]=u(h[E]);return g}function C(h,u){var g=h.split("@"),E="";g.length>1&&(E=g[0]+"@",h=g[1]),h=h.replace(z,".");var x=h.split("."),j=A(x,u).join(".");return E+j}function L(h){for(var u=[],g=0,E=h.length;g<E;){var x=h.charCodeAt(g++);if(x>=55296&&x<=56319&&g<E){var j=h.charCodeAt(g++);(j&64512)==56320?u.push(((x&1023)<<10)+(j&1023)+65536):(u.push(x),g--)}else u.push(x)}return u}var le=function(u){return String.fromCodePoint.apply(String,m(u))},Y=function(u){return u-48<10?u-22:u-65<26?u-65:u-97<26?u-97:c},re=function(u,g){return u+22+75*(u<26)-((g!=0)<<5)},G=function(u,g,E){var x=0;for(u=E?U(u/S):u>>1,u+=U(u/g);u>$*_>>1;x+=c)u=U(u/$);return U(x+($+1)*u/(u+v))},H=function(u){var g=[],E=u.length,x=0,j=P,K=T,ae=u.lastIndexOf(O);ae<0&&(ae=0);for(var oe=0;oe<ae;++oe)u.charCodeAt(oe)>=128&&F("not-basic"),g.push(u.charCodeAt(oe));for(var be=ae>0?ae+1:0;be<E;){for(var te=x,pe=1,Ee=c;;Ee+=c){be>=E&&F("invalid-input");var de=Y(u.charCodeAt(be++));(de>=c||de>U((b-x)/pe))&&F("overflow"),x+=de*pe;var ne=Ee<=K?y:Ee>=K+_?_:Ee-K;if(de<ne)break;var he=c-ne;pe>U(b/he)&&F("overflow"),pe*=he}var ce=g.length+1;K=G(x-te,ce,te==0),U(x/ce)>b-j&&F("overflow"),j+=U(x/ce),x%=ce,g.splice(x++,0,j)}return String.fromCodePoint.apply(String,g)},me=function(u){var g=[];u=L(u);var E=u.length,x=P,j=0,K=T,ae=!0,oe=!1,be=void 0;try{for(var te=u[Symbol.iterator](),pe;!(ae=(pe=te.next()).done);ae=!0){var Ee=pe.value;Ee<128&&g.push(M(Ee))}}catch($r){oe=!0,be=$r}finally{try{!ae&&te.return&&te.return()}finally{if(oe)throw be}}var de=g.length,ne=de;for(de&&g.push(O);ne<E;){var he=b,ce=!0,Dr=!1,Me=void 0;try{for(var ze=u[Symbol.iterator](),ue;!(ce=(ue=ze.next()).done);ce=!0){var qe=ue.value;qe>=x&&qe<he&&(he=qe)}}catch($r){Dr=!0,Me=$r}finally{try{!ce&&ze.return&&ze.return()}finally{if(Dr)throw Me}}var He=ne+1;he-x>U((b-j)/He)&&F("overflow"),j+=(he-x)*He,x=he;var sr=!0,Ir=!1,dr=void 0;try{for(var ht=u[Symbol.iterator](),Dt;!(sr=(Dt=ht.next()).done);sr=!0){var It=Dt.value;if(It<x&&++j>b&&F("overflow"),It==x){for(var Yr=j,Xr=c;;Xr+=c){var fr=Xr<=K?y:Xr>=K+_?_:Xr-K;if(Yr<fr)break;var et=Yr-fr,Pa=c-fr;g.push(M(re(fr+et%Pa,0))),Yr=U(et/Pa)}g.push(M(re(Yr,0))),K=G(j,He,ne==de),j=0,++ne}}}catch($r){Ir=!0,dr=$r}finally{try{!sr&&ht.return&&ht.return()}finally{if(Ir)throw dr}}++j,++x}return g.join("")},we=function(u){return C(u,function(g){return D.test(g)?H(g.slice(4).toLowerCase()):g})},Te=function(u){return C(u,function(g){return I.test(g)?"xn--"+me(g):g})},se={version:"2.1.0",ucs2:{decode:L,encode:le},decode:H,encode:me,toASCII:Te,toUnicode:we},ye={};function xe(h){var u=h.charCodeAt(0),g=void 0;return u<16?g="%0"+u.toString(16).toUpperCase():u<128?g="%"+u.toString(16).toUpperCase():u<2048?g="%"+(u>>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase():g="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase(),g}function Ae(h){for(var u="",g=0,E=h.length;g<E;){var x=parseInt(h.substr(g+1,2),16);if(x<128)u+=String.fromCharCode(x),g+=3;else if(x>=194&&x<224){if(E-g>=6){var j=parseInt(h.substr(g+4,2),16);u+=String.fromCharCode((x&31)<<6|j&63)}else u+=h.substr(g,6);g+=6}else if(x>=224){if(E-g>=9){var K=parseInt(h.substr(g+4,2),16),ae=parseInt(h.substr(g+7,2),16);u+=String.fromCharCode((x&15)<<12|(K&63)<<6|ae&63)}else u+=h.substr(g,9);g+=9}else u+=h.substr(g,3),g+=3}return u}function yr(h,u){function g(E){var x=Ae(E);return x.match(u.UNRESERVED)?x:E}return h.scheme&&(h.scheme=String(h.scheme).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_SCHEME,"")),h.userinfo!==void 0&&(h.userinfo=String(h.userinfo).replace(u.PCT_ENCODED,g).replace(u.NOT_USERINFO,xe).replace(u.PCT_ENCODED,r)),h.host!==void 0&&(h.host=String(h.host).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_HOST,xe).replace(u.PCT_ENCODED,r)),h.path!==void 0&&(h.path=String(h.path).replace(u.PCT_ENCODED,g).replace(h.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,xe).replace(u.PCT_ENCODED,r)),h.query!==void 0&&(h.query=String(h.query).replace(u.PCT_ENCODED,g).replace(u.NOT_QUERY,xe).replace(u.PCT_ENCODED,r)),h.fragment!==void 0&&(h.fragment=String(h.fragment).replace(u.PCT_ENCODED,g).replace(u.NOT_FRAGMENT,xe).replace(u.PCT_ENCODED,r)),h}function cr(h){return h.replace(/^0*(.*)/,"$1")||"0"}function _e(h,u){var g=h.match(u.IPV4ADDRESS)||[],E=p(g,2),x=E[1];return x?x.split(".").map(cr).join("."):h}function ve(h,u){var g=h.match(u.IPV6ADDRESS)||[],E=p(g,3),x=E[1],j=E[2];if(x){for(var K=x.toLowerCase().split("::").reverse(),ae=p(K,2),oe=ae[0],be=ae[1],te=be?be.split(":").map(cr):[],pe=oe.split(":").map(cr),Ee=u.IPV4ADDRESS.test(pe[pe.length-1]),de=Ee?7:8,ne=pe.length-de,he=Array(de),ce=0;ce<de;++ce)he[ce]=te[ce]||pe[ne+ce]||"";Ee&&(he[de-1]=_e(he[de-1],u));var Dr=he.reduce(function(He,sr,Ir){if(!sr||sr==="0"){var dr=He[He.length-1];dr&&dr.index+dr.length===Ir?dr.length++:He.push({index:Ir,length:1})}return He},[]),Me=Dr.sort(function(He,sr){return sr.length-He.length})[0],ze=void 0;if(Me&&Me.length>1){var ue=he.slice(0,Me.index),qe=he.slice(Me.index+Me.length);ze=ue.join(":")+"::"+qe.join(":")}else ze=he.join(":");return j&&(ze+="%"+j),ze}else return h}var Rr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Oe="".match(/(){0}/)[1]===void 0;function ie(h){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={},E=u.iri!==!1?f:d;u.reference==="suffix"&&(h=(u.scheme?u.scheme+":":"")+"//"+h);var x=h.match(Rr);if(x){Oe?(g.scheme=x[1],g.userinfo=x[3],g.host=x[4],g.port=parseInt(x[5],10),g.path=x[6]||"",g.query=x[7],g.fragment=x[8],isNaN(g.port)&&(g.port=x[5])):(g.scheme=x[1]||void 0,g.userinfo=h.indexOf("@")!==-1?x[3]:void 0,g.host=h.indexOf("//")!==-1?x[4]:void 0,g.port=parseInt(x[5],10),g.path=x[6]||"",g.query=h.indexOf("?")!==-1?x[7]:void 0,g.fragment=h.indexOf("#")!==-1?x[8]:void 0,isNaN(g.port)&&(g.port=h.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?x[4]:void 0)),g.host&&(g.host=ve(_e(g.host,E),E)),g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&!g.path&&g.query===void 0?g.reference="same-document":g.scheme===void 0?g.reference="relative":g.fragment===void 0?g.reference="absolute":g.reference="uri",u.reference&&u.reference!=="suffix"&&u.reference!==g.reference&&(g.error=g.error||"URI is not a "+u.reference+" reference.");var j=ye[(u.scheme||g.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!j||!j.unicodeSupport)){if(g.host&&(u.domainHost||j&&j.domainHost))try{g.host=se.toASCII(g.host.replace(E.PCT_ENCODED,Ae).toLowerCase())}catch(K){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+K}yr(g,d)}else yr(g,E);j&&j.parse&&j.parse(g,u)}else g.error=g.error||"URI can not be parsed.";return g}function _r(h,u){var g=u.iri!==!1?f:d,E=[];return h.userinfo!==void 0&&(E.push(h.userinfo),E.push("@")),h.host!==void 0&&E.push(ve(_e(String(h.host),g),g).replace(g.IPV6ADDRESS,function(x,j,K){return"["+j+(K?"%25"+K:"")+"]"})),(typeof h.port=="number"||typeof h.port=="string")&&(E.push(":"),E.push(String(h.port))),E.length?E.join(""):void 0}var ur=/^\.\.?\//,Tr=/^\/\.(\/|$)/,Ar=/^\/\.\.(\/|$)/,Se=/^\/?(?:.|\n)*?(?=\/|$)/;function Ve(h){for(var u=[];h.length;)if(h.match(ur))h=h.replace(ur,"");else if(h.match(Tr))h=h.replace(Tr,"/");else if(h.match(Ar))h=h.replace(Ar,"/"),u.pop();else if(h==="."||h==="..")h="";else{var g=h.match(Se);if(g){var E=g[0];h=h.slice(E.length),u.push(E)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function $e(h){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=u.iri?f:d,E=[],x=ye[(u.scheme||h.scheme||"").toLowerCase()];if(x&&x.serialize&&x.serialize(h,u),h.host&&!g.IPV6ADDRESS.test(h.host)){if(u.domainHost||x&&x.domainHost)try{h.host=u.iri?se.toUnicode(h.host):se.toASCII(h.host.replace(g.PCT_ENCODED,Ae).toLowerCase())}catch(ae){h.error=h.error||"Host's domain name can not be converted to "+(u.iri?"Unicode":"ASCII")+" via punycode: "+ae}}yr(h,g),u.reference!=="suffix"&&h.scheme&&(E.push(h.scheme),E.push(":"));var j=_r(h,u);if(j!==void 0&&(u.reference!=="suffix"&&E.push("//"),E.push(j),h.path&&h.path.charAt(0)!=="/"&&E.push("/")),h.path!==void 0){var K=h.path;!u.absolutePath&&(!x||!x.absolutePath)&&(K=Ve(K)),j===void 0&&(K=K.replace(/^\/\//,"/%2F")),E.push(K)}return h.query!==void 0&&(E.push("?"),E.push(h.query)),h.fragment!==void 0&&(E.push("#"),E.push(h.fragment)),E.join("")}function De(h,u){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments[3],x={};return E||(h=ie($e(h,g),g),u=ie($e(u,g),g)),g=g||{},!g.tolerant&&u.scheme?(x.scheme=u.scheme,x.userinfo=u.userinfo,x.host=u.host,x.port=u.port,x.path=Ve(u.path||""),x.query=u.query):(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0?(x.userinfo=u.userinfo,x.host=u.host,x.port=u.port,x.path=Ve(u.path||""),x.query=u.query):(u.path?(u.path.charAt(0)==="/"?x.path=Ve(u.path):((h.userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?x.path="/"+u.path:h.path?x.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+u.path:x.path=u.path,x.path=Ve(x.path)),x.query=u.query):(x.path=h.path,u.query!==void 0?x.query=u.query:x.query=h.query),x.userinfo=h.userinfo,x.host=h.host,x.port=h.port),x.scheme=h.scheme),x.fragment=u.fragment,x}function tr(h,u,g){var E=l({scheme:"null"},g);return $e(De(ie(h,E),ie(u,E),E,!0),E)}function Le(h,u){return typeof h=="string"?h=$e(ie(h,u),u):s(h)==="object"&&(h=ie($e(h,u),u)),h}function At(h,u,g){return typeof h=="string"?h=$e(ie(h,g),g):s(h)==="object"&&(h=$e(h,g)),typeof u=="string"?u=$e(ie(u,g),g):s(u)==="object"&&(u=$e(u,g)),h===u}function xa(h,u){return h&&h.toString().replace(!u||!u.iri?d.ESCAPE:f.ESCAPE,xe)}function Je(h,u){return h&&h.toString().replace(!u||!u.iri?d.PCT_ENCODED:f.PCT_ENCODED,Ae)}var ft={scheme:"http",domainHost:!0,parse:function(u,g){return u.host||(u.error=u.error||"HTTP URIs must have a host."),u},serialize:function(u,g){var E=String(u.scheme).toLowerCase()==="https";return(u.port===(E?443:80)||u.port==="")&&(u.port=void 0),u.path||(u.path="/"),u}},Rs={scheme:"https",domainHost:ft.domainHost,parse:ft.parse,serialize:ft.serialize};function Ts(h){return typeof h.secure=="boolean"?h.secure:String(h.scheme).toLowerCase()==="wss"}var pt={scheme:"ws",domainHost:!0,parse:function(u,g){var E=u;return E.secure=Ts(E),E.resourceName=(E.path||"/")+(E.query?"?"+E.query:""),E.path=void 0,E.query=void 0,E},serialize:function(u,g){if((u.port===(Ts(u)?443:80)||u.port==="")&&(u.port=void 0),typeof u.secure=="boolean"&&(u.scheme=u.secure?"wss":"ws",u.secure=void 0),u.resourceName){var E=u.resourceName.split("?"),x=p(E,2),j=x[0],K=x[1];u.path=j&&j!=="/"?j:void 0,u.query=K,u.resourceName=void 0}return u.fragment=void 0,u}},As={scheme:"wss",domainHost:pt.domainHost,parse:pt.parse,serialize:pt.serialize},fl={},pl=!0,Ds="[A-Za-z0-9\\-\\.\\_\\~"+(pl?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",ar="[0-9A-Fa-f]",hl=t(t("%[EFef]"+ar+"%"+ar+ar+"%"+ar+ar)+"|"+t("%[89A-Fa-f]"+ar+"%"+ar+ar)+"|"+t("%"+ar+ar)),ml="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",vl="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",gl=e(vl,'[\\"\\\\]'),yl="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",_l=new RegExp(Ds,"g"),Gr=new RegExp(hl,"g"),bl=new RegExp(e("[^]",ml,"[\\.]",'[\\"]',gl),"g"),Is=new RegExp(e("[^]",Ds,yl),"g"),El=Is;function Sa(h){var u=Ae(h);return u.match(_l)?u:h}var $s={scheme:"mailto",parse:function(u,g){var E=u,x=E.to=E.path?E.path.split(","):[];if(E.path=void 0,E.query){for(var j=!1,K={},ae=E.query.split("&"),oe=0,be=ae.length;oe<be;++oe){var te=ae[oe].split("=");switch(te[0]){case"to":for(var pe=te[1].split(","),Ee=0,de=pe.length;Ee<de;++Ee)x.push(pe[Ee]);break;case"subject":E.subject=Je(te[1],g);break;case"body":E.body=Je(te[1],g);break;default:j=!0,K[Je(te[0],g)]=Je(te[1],g);break}}j&&(E.headers=K)}E.query=void 0;for(var ne=0,he=x.length;ne<he;++ne){var ce=x[ne].split("@");if(ce[0]=Je(ce[0]),g.unicodeSupport)ce[1]=Je(ce[1],g).toLowerCase();else try{ce[1]=se.toASCII(Je(ce[1],g).toLowerCase())}catch(Dr){E.error=E.error||"Email address's domain name can not be converted to ASCII via punycode: "+Dr}x[ne]=ce.join("@")}return E},serialize:function(u,g){var E=u,x=n(u.to);if(x){for(var j=0,K=x.length;j<K;++j){var ae=String(x[j]),oe=ae.lastIndexOf("@"),be=ae.slice(0,oe).replace(Gr,Sa).replace(Gr,r).replace(bl,xe),te=ae.slice(oe+1);try{te=g.iri?se.toUnicode(te):se.toASCII(Je(te,g).toLowerCase())}catch(ne){E.error=E.error||"Email address's domain name can not be converted to "+(g.iri?"Unicode":"ASCII")+" via punycode: "+ne}x[j]=be+"@"+te}E.path=x.join(",")}var pe=u.headers=u.headers||{};u.subject&&(pe.subject=u.subject),u.body&&(pe.body=u.body);var Ee=[];for(var de in pe)pe[de]!==fl[de]&&Ee.push(de.replace(Gr,Sa).replace(Gr,r).replace(Is,xe)+"="+pe[de].replace(Gr,Sa).replace(Gr,r).replace(El,xe));return Ee.length&&(E.query=Ee.join("&")),E}},xl=/^([^\:]+)\:(.*)/,Cs={scheme:"urn",parse:function(u,g){var E=u.path&&u.path.match(xl),x=u;if(E){var j=g.scheme||x.scheme||"urn",K=E[1].toLowerCase(),ae=E[2],oe=j+":"+(g.nid||K),be=ye[oe];x.nid=K,x.nss=ae,x.path=void 0,be&&(x=be.parse(x,g))}else x.error=x.error||"URN can not be parsed.";return x},serialize:function(u,g){var E=g.scheme||u.scheme||"urn",x=u.nid,j=E+":"+(g.nid||x),K=ye[j];K&&(u=K.serialize(u,g));var ae=u,oe=u.nss;return ae.path=(x||g.nid)+":"+oe,ae}},Sl=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ks={scheme:"urn:uuid",parse:function(u,g){var E=u;return E.uuid=E.nss,E.nss=void 0,!g.tolerant&&(!E.uuid||!E.uuid.match(Sl))&&(E.error=E.error||"UUID is not valid."),E},serialize:function(u,g){var E=u;return E.nss=(u.uuid||"").toLowerCase(),E}};ye[ft.scheme]=ft,ye[Rs.scheme]=Rs,ye[pt.scheme]=pt,ye[As.scheme]=As,ye[$s.scheme]=$s,ye[Cs.scheme]=Cs,ye[ks.scheme]=ks,a.SCHEMES=ye,a.pctEncChar=xe,a.pctDecChars=Ae,a.parse=ie,a.removeDotSegments=Ve,a.serialize=$e,a.resolveComponents=De,a.resolve=tr,a.normalize=Le,a.equal=At,a.escapeComponent=xa,a.unescapeComponent=Je,Object.defineProperty(a,"__esModule",{value:!0})}))});var Wt=Q((Ip,yn)=>{"use strict";yn.exports=function a(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var s,r,n;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!a(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(n=Object.keys(e),s=n.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return!1;for(r=s;r--!==0;){var l=n[r];if(!a(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}});var bn=Q(($p,_n)=>{"use strict";_n.exports=function(e){for(var t=0,s=e.length,r=0,n;r<s;)t++,n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<s&&(n=e.charCodeAt(r),(n&64512)==56320&&r++);return t}});var Kr=Q((Cp,Sn)=>{"use strict";Sn.exports={copy:Hu,checkDataType:Za,checkDataTypes:Zu,coerceToTypes:Bu,toHash:Qa,getProperty:Wa,escapeQuotes:Ka,equal:Wt(),ucs2length:bn(),varOccurences:Ku,varReplace:Ju,schemaHasRules:Gu,schemaHasRulesExcept:Yu,schemaUnknownRules:Xu,toQuotedString:Ba,getPathExpr:ed,getPath:rd,getData:sd,unescapeFragment:nd,unescapeJsonPointer:Ga,escapeFragment:id,escapeJsonPointer:Ja};function Hu(a,e){e=e||{};for(var t in a)e[t]=a[t];return e}function Za(a,e,t,s){var r=s?" !== ":" === ",n=s?" || ":" && ",l=s?"!":"",o=s?"":"!";switch(a){case"null":return e+r+"null";case"array":return l+"Array.isArray("+e+")";case"object":return"("+l+e+n+"typeof "+e+r+'"object"'+n+o+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+r+'"number"'+n+o+"("+e+" % 1)"+n+e+r+e+(t?n+l+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+r+'"'+a+'"'+(t?n+l+"isFinite("+e+")":"")+")";default:return"typeof "+e+r+'"'+a+'"'}}function Zu(a,e,t){switch(a.length){case 1:return Za(a[0],e,t,!0);default:var s="",r=Qa(a);r.array&&r.object&&(s=r.null?"(":"(!"+e+" || ",s+="typeof "+e+' !== "object")',delete r.null,delete r.array,delete r.object),r.number&&delete r.integer;for(var n in r)s+=(s?" && ":"")+Za(n,e,t,!0);return s}}var En=Qa(["string","number","integer","boolean","null"]);function Bu(a,e){if(Array.isArray(e)){for(var t=[],s=0;s<e.length;s++){var r=e[s];(En[r]||a==="array"&&r==="array")&&(t[t.length]=r)}if(t.length)return t}else{if(En[e])return[e];if(a==="array"&&e==="array")return["array"]}}function Qa(a){for(var e={},t=0;t<a.length;t++)e[a[t]]=!0;return e}var Qu=/^[a-z$_][a-z$_0-9]*$/i,Wu=/'|\\/g;function Wa(a){return typeof a=="number"?"["+a+"]":Qu.test(a)?"."+a:"['"+Ka(a)+"']"}function Ka(a){return a.replace(Wu,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function Ku(a,e){e+="[^0-9]";var t=a.match(new RegExp(e,"g"));return t?t.length:0}function Ju(a,e,t){return e+="([^0-9])",t=t.replace(/\$/g,"$$$$"),a.replace(new RegExp(e,"g"),t+"$1")}function Gu(a,e){if(typeof a=="boolean")return!a;for(var t in a)if(e[t])return!0}function Yu(a,e,t){if(typeof a=="boolean")return!a&&t!="not";for(var s in a)if(s!=t&&e[s])return!0}function Xu(a,e){if(typeof a!="boolean"){for(var t in a)if(!e[t])return t}}function Ba(a){return"'"+Ka(a)+"'"}function ed(a,e,t,s){var r=t?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return xn(a,r)}function rd(a,e,t){var s=Ba(t?"/"+Ja(e):Wa(e));return xn(a,s)}var td=/^\/(?:[^~]|~0|~1)*$/,ad=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function sd(a,e,t){var s,r,n,l;if(a==="")return"rootData";if(a[0]=="/"){if(!td.test(a))throw new Error("Invalid JSON-pointer: "+a);r=a,n="rootData"}else{if(l=a.match(ad),!l)throw new Error("Invalid JSON-pointer: "+a);if(s=+l[1],r=l[2],r=="#"){if(s>=e)throw new Error("Cannot access property/index "+s+" levels up, current level is "+e);return t[e-s]}if(s>e)throw new Error("Cannot access data "+s+" levels up, current level is "+e);if(n="data"+(e-s||""),!r)return n}for(var o=n,d=r.split("/"),f=0;f<d.length;f++){var p=d[f];p&&(n+=Wa(Ga(p)),o+=" && "+n)}return o}function xn(a,e){return a=='""'?e:(a+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function nd(a){return Ga(decodeURIComponent(a))}function id(a){return encodeURIComponent(Ja(a))}function Ja(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}function Ga(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}});var Ya=Q((kp,Pn)=>{"use strict";var od=Kr();Pn.exports=ld;function ld(a){od.copy(a,this)}});var On=Q((Np,wn)=>{"use strict";var Pr=wn.exports=function(a,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var s=typeof t=="function"?t:t.pre||function(){},r=t.post||function(){};Kt(e,s,r,a,"",a)};Pr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};Pr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Pr.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Pr.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 Kt(a,e,t,s,r,n,l,o,d,f){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,r,n,l,o,d,f);for(var p in s){var m=s[p];if(Array.isArray(m)){if(p in Pr.arrayKeywords)for(var b=0;b<m.length;b++)Kt(a,e,t,m[b],r+"/"+p+"/"+b,n,r,p,s,b)}else if(p in Pr.propsKeywords){if(m&&typeof m=="object")for(var c in m)Kt(a,e,t,m[c],r+"/"+p+"/"+cd(c),n,r,p,s,c)}else(p in Pr.keywords||a.allKeys&&!(p in Pr.skipKeywords))&&Kt(a,e,t,m,r+"/"+p,n,r,p,s)}t(s,r,n,l,o,d,f)}}function cd(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}});var ra=Q((jp,Dn)=>{"use strict";var Ot=gn(),Rn=Wt(),Xt=Kr(),Jt=Ya(),ud=On();Dn.exports=Or;Or.normalizeId=wr;Or.fullPath=Gt;Or.url=Yt;Or.ids=md;Or.inlineRef=Xa;Or.schema=ea;function Or(a,e,t){var s=this._refs[t];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return Or.call(this,a,e,s);if(s=s||this._schemas[t],s instanceof Jt)return Xa(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var r=ea.call(this,e,t),n,l,o;return r&&(n=r.schema,e=r.root,o=r.baseId),n instanceof Jt?l=n.validate||a.call(this,n.schema,e,void 0,o):n!==void 0&&(l=Xa(n,this._opts.inlineRefs)?n:a.call(this,n,e,void 0,o)),l}function ea(a,e){var t=Ot.parse(e),s=An(t),r=Gt(this._getId(a.schema));if(Object.keys(a.schema).length===0||s!==r){var n=wr(s),l=this._refs[n];if(typeof l=="string")return dd.call(this,a,l,t);if(l instanceof Jt)l.validate||this._compile(l),a=l;else if(l=this._schemas[n],l instanceof Jt){if(l.validate||this._compile(l),n==wr(e))return{schema:l,root:a,baseId:r};a=l}else return;if(!a.schema)return;r=Gt(this._getId(a.schema))}return Tn.call(this,t,r,a.schema,a)}function dd(a,e,t){var s=ea.call(this,a,e);if(s){var r=s.schema,n=s.baseId;a=s.root;var l=this._getId(r);return l&&(n=Yt(n,l)),Tn.call(this,t,n,r,a)}}var fd=Xt.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Tn(a,e,t,s){if(a.fragment=a.fragment||"",a.fragment.slice(0,1)=="/"){for(var r=a.fragment.split("/"),n=1;n<r.length;n++){var l=r[n];if(l){if(l=Xt.unescapeFragment(l),t=t[l],t===void 0)break;var o;if(!fd[l]&&(o=this._getId(t),o&&(e=Yt(e,o)),t.$ref)){var d=Yt(e,t.$ref),f=ea.call(this,s,d);f&&(t=f.schema,s=f.root,e=f.baseId)}}}if(t!==void 0&&t!==s.schema)return{schema:t,root:s,baseId:e}}}var pd=Xt.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function Xa(a,e){if(e===!1)return!1;if(e===void 0||e===!0)return es(a);if(e)return rs(a)<=e}function es(a){var e;if(Array.isArray(a)){for(var t=0;t<a.length;t++)if(e=a[t],typeof e=="object"&&!es(e))return!1}else for(var s in a)if(s=="$ref"||(e=a[s],typeof e=="object"&&!es(e)))return!1;return!0}function rs(a){var e=0,t;if(Array.isArray(a)){for(var s=0;s<a.length;s++)if(t=a[s],typeof t=="object"&&(e+=rs(t)),e==1/0)return 1/0}else for(var r in a){if(r=="$ref")return 1/0;if(pd[r])e++;else if(t=a[r],typeof t=="object"&&(e+=rs(t)+1),e==1/0)return 1/0}return e}function Gt(a,e){e!==!1&&(a=wr(a));var t=Ot.parse(a);return An(t)}function An(a){return Ot.serialize(a).split("#")[0]+"#"}var hd=/#\/?$/;function wr(a){return a?a.replace(hd,""):""}function Yt(a,e){return e=wr(e),Ot.resolve(a,e)}function md(a){var e=wr(this._getId(a)),t={"":e},s={"":Gt(e,!1)},r={},n=this;return ud(a,{allKeys:!0},function(l,o,d,f,p,m,b){if(o!==""){var c=n._getId(l),y=t[f],_=s[f]+"/"+p;if(b!==void 0&&(_+="/"+(typeof b=="number"?b:Xt.escapeFragment(b))),typeof c=="string"){c=y=wr(y?Ot.resolve(y,c):c);var v=n._refs[c];if(typeof v=="string"&&(v=n._refs[v]),v&&v.schema){if(!Rn(l,v.schema))throw new Error('id "'+c+'" resolves to more than one schema')}else if(c!=wr(_))if(c[0]=="#"){if(r[c]&&!Rn(l,r[c]))throw new Error('id "'+c+'" resolves to more than one schema');r[c]=l}else n._refs[c]=_}t[o]=y,s[o]=_}}),r}});var ta=Q((Fp,$n)=>{"use strict";var ts=ra();$n.exports={Validation:In(vd),MissingRef:In(as)};function vd(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}as.message=function(a,e){return"can't resolve reference "+e+" from id "+a};function as(a,e,t){this.message=t||as.message(a,e),this.missingRef=ts.url(a,e),this.missingSchema=ts.normalizeId(ts.fullPath(this.missingRef))}function In(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var ss=Q((Lp,Cn)=>{"use strict";Cn.exports=function(a,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,s=e.cmp&&(function(n){return function(l){return function(o,d){var f={key:o,value:l[o]},p={key:d,value:l[d]};return n(f,p)}}})(e.cmp),r=[];return(function n(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 o,d;if(Array.isArray(l)){for(d="[",o=0;o<l.length;o++)o&&(d+=","),d+=n(l[o])||"null";return d+"]"}if(l===null)return"null";if(r.indexOf(l)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var f=r.push(l)-1,p=Object.keys(l).sort(s&&s(l));for(d="",o=0;o<p.length;o++){var m=p[o],b=n(l[m]);b&&(d&&(d+=","),d+=JSON.stringify(m)+":"+b)}return r.splice(f,1),"{"+d+"}"}})(a)}});var ns=Q((Mp,kn)=>{"use strict";kn.exports=function(e,t,s){var r="",n=e.schema.$async===!0,l=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var d=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(d){var f="unknown keyword: "+d;if(e.opts.strictKeywords==="log")e.logger.warn(f);else throw new Error(f)}}if(e.isTop&&(r+=" var validate = ",n&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" "+("/*# sourceURL="+o+" */")+" ")),typeof e.schema=="boolean"||!(l||e.schema.$ref)){var t="false schema",p=e.level,m=e.dataLevel,b=e.schema[t],c=e.schemaPath+e.util.getProperty(t),y=e.errSchemaPath+"/"+t,D=!e.opts.allErrors,q,_="data"+(m||""),O="valid"+p;if(e.schema===!1){e.isTop?D=!0:r+=" var "+O+" = false; ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var S=r;r=v.pop(),!e.compositeRule&&D?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?n?r+=" return data; ":r+=" validate.errors = null; return true; ":r+=" var "+O+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var T=e.isTop,p=e.level=0,m=e.dataLevel=0,_="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 P="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var p=e.level,m=e.dataLevel,_="data"+(m||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),n&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+p+" = errors;"}var O="valid"+p,D=!e.opts.allErrors,I="",z="",q,$=e.schema.type,U=Array.isArray($);if($&&e.opts.nullable&&e.schema.nullable===!0&&(U?$.indexOf("null")==-1&&($=$.concat("null")):$!="null"&&($=[$,"null"],U=!0)),U&&$.length==1&&($=$[0],U=!1),e.schema.$ref&&l){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&&(l=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),$){if(e.opts.coerceTypes)var M=e.util.coerceToTypes(e.opts.coerceTypes,$);var F=e.RULES.types[$];if(M||U||F===!0||F&&!Se(F)){var c=e.schemaPath+".type",y=e.errSchemaPath+"/type",c=e.schemaPath+".type",y=e.errSchemaPath+"/type",A=U?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[A]($,_,e.opts.strictNumbers,!0)+") { ",M){var C="dataType"+p,L="coerced"+p;r+=" var "+C+" = typeof "+_+"; var "+L+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+C+" == 'object' && Array.isArray("+_+") && "+_+".length == 1) { "+_+" = "+_+"[0]; "+C+" = typeof "+_+"; if ("+e.util.checkDataType(e.schema.type,_,e.opts.strictNumbers)+") "+L+" = "+_+"; } "),r+=" if ("+L+" !== undefined) ; ";var le=M;if(le)for(var Y,re=-1,G=le.length-1;re<G;)Y=le[re+=1],Y=="string"?r+=" else if ("+C+" == 'number' || "+C+" == 'boolean') "+L+" = '' + "+_+"; else if ("+_+" === null) "+L+" = ''; ":Y=="number"||Y=="integer"?(r+=" else if ("+C+" == 'boolean' || "+_+" === null || ("+C+" == 'string' && "+_+" && "+_+" == +"+_+" ",Y=="integer"&&(r+=" && !("+_+" % 1)"),r+=")) "+L+" = +"+_+"; "):Y=="boolean"?r+=" else if ("+_+" === 'false' || "+_+" === 0 || "+_+" === null) "+L+" = false; else if ("+_+" === 'true' || "+_+" === 1) "+L+" = true; ":Y=="null"?r+=" else if ("+_+" === '' || "+_+" === 0 || "+_+" === false) "+L+" = null; ":e.opts.coerceTypes=="array"&&Y=="array"&&(r+=" else if ("+C+" == 'string' || "+C+" == 'number' || "+C+" == 'boolean' || "+_+" == null) "+L+" = ["+_+"]; ");r+=" else { ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+$.join(","):r+=""+$,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+$.join(","):r+=""+$,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var S=r;r=v.pop(),!e.compositeRule&&D?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+L+" !== undefined) { ";var H=m?"data"+(m-1||""):"parentData",me=m?e.dataPathArr[m]:"parentDataProperty";r+=" "+_+" = "+L+"; ",m||(r+="if ("+H+" !== undefined)"),r+=" "+H+"["+me+"] = "+L+"; } "}else{var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+$.join(","):r+=""+$,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+$.join(","):r+=""+$,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var S=r;r=v.pop(),!e.compositeRule&&D?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!l)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",D&&(r+=" } if (errors === ",T?r+="0":r+="errs_"+p,r+=") { ",z+="}");else{var we=e.RULES;if(we){for(var F,Te=-1,se=we.length-1;Te<se;)if(F=we[Te+=1],Se(F)){if(F.type&&(r+=" if ("+e.util.checkDataType(F.type,_,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(F.type=="object"&&e.schema.properties){var b=e.schema.properties,ye=Object.keys(b),xe=ye;if(xe)for(var Ae,yr=-1,cr=xe.length-1;yr<cr;){Ae=xe[yr+=1];var _e=b[Ae];if(_e.default!==void 0){var ve=_+e.util.getProperty(Ae);if(e.compositeRule){if(e.opts.strictDefaults){var P="default is ignored for: "+ve;if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}}else r+=" if ("+ve+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ve+" === null || "+ve+" === '' "),r+=" ) "+ve+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(_e.default)+" ":r+=" "+JSON.stringify(_e.default)+" ",r+="; "}}}else if(F.type=="array"&&Array.isArray(e.schema.items)){var Rr=e.schema.items;if(Rr){for(var _e,re=-1,Oe=Rr.length-1;re<Oe;)if(_e=Rr[re+=1],_e.default!==void 0){var ve=_+"["+re+"]";if(e.compositeRule){if(e.opts.strictDefaults){var P="default is ignored for: "+ve;if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}}else r+=" if ("+ve+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ve+" === null || "+ve+" === '' "),r+=" ) "+ve+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(_e.default)+" ":r+=" "+JSON.stringify(_e.default)+" ",r+="; "}}}}var ie=F.rules;if(ie){for(var _r,ur=-1,Tr=ie.length-1;ur<Tr;)if(_r=ie[ur+=1],Ve(_r)){var Ar=_r.code(e,_r.keyword,F.type);Ar&&(r+=" "+Ar+" ",D&&(I+="}"))}}if(D&&(r+=" "+I+" ",I=""),F.type&&(r+=" } ",$&&$===F.type&&!M)){r+=" else { ";var c=e.schemaPath+".type",y=e.errSchemaPath+"/type",v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+$.join(","):r+=""+$,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+$.join(","):r+=""+$,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var S=r;r=v.pop(),!e.compositeRule&&D?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}D&&(r+=" if (errors === ",T?r+="0":r+="errs_"+p,r+=") { ",z+="}")}}}D&&(r+=" "+z+" "),T?(n?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+O+" = errors === errs_"+p+";";function Se(De){for(var tr=De.rules,Le=0;Le<tr.length;Le++)if(Ve(tr[Le]))return!0}function Ve(De){return e.schema[De.keyword]!==void 0||De.implements&&$e(De)}function $e(De){for(var tr=De.implements,Le=0;Le<tr.length;Le++)if(e.schema[tr[Le]]!==void 0)return!0}return r}});var Mn=Q((qp,Ln)=>{"use strict";var aa=ra(),na=Kr(),jn=ta(),gd=ss(),Nn=ns(),yd=na.ucs2length,_d=Wt(),bd=jn.Validation;Ln.exports=is;function is(a,e,t,s){var r=this,n=this._opts,l=[void 0],o={},d=[],f={},p=[],m={},b=[];e=e||{schema:a,refVal:l,refs:o};var c=Ed.call(this,a,e,s),y=this._compilations[c.index];if(c.compiling)return y.callValidate=P;var _=this._formats,v=this.RULES;try{var S=O(a,e,t,s);y.validate=S;var T=y.callValidate;return T&&(T.schema=S.schema,T.errors=null,T.refs=S.refs,T.refVal=S.refVal,T.root=S.root,T.$async=S.$async,n.sourceCode&&(T.source=S.source)),S}finally{xd.call(this,a,e,s)}function P(){var A=y.validate,C=A.apply(this,arguments);return P.errors=A.errors,C}function O(A,C,L,le){var Y=!C||C&&C.schema==A;if(C.schema!=e.schema)return is.call(r,A,C,L,le);var re=A.$async===!0,G=Nn({isTop:!0,schema:A,isRoot:Y,baseId:le,root:C,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:jn.MissingRef,RULES:v,validate:Nn,util:na,resolve:aa,resolveRef:D,usePattern:U,useDefault:M,useCustomRule:F,opts:n,formats:_,logger:r.logger,self:r});G=sa(l,wd)+sa(d,Sd)+sa(p,Pd)+sa(b,Od)+G,n.processCode&&(G=n.processCode(G,A));var H;try{var me=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",G);H=me(r,v,_,e,l,p,b,_d,yd,bd),l[0]=H}catch(we){throw r.logger.error("Error compiling schema, function code:",G),we}return H.schema=A,H.errors=null,H.refs=o,H.refVal=l,H.root=Y?H:C,re&&(H.$async=!0),n.sourceCode===!0&&(H.source={code:G,patterns:d,defaults:p}),H}function D(A,C,L){C=aa.url(A,C);var le=o[C],Y,re;if(le!==void 0)return Y=l[le],re="refVal["+le+"]",$(Y,re);if(!L&&e.refs){var G=e.refs[C];if(G!==void 0)return Y=e.refVal[G],re=I(C,Y),$(Y,re)}re=I(C);var H=aa.call(r,O,e,C);if(H===void 0){var me=t&&t[C];me&&(H=aa.inlineRef(me,n.inlineRefs)?me:is.call(r,me,e,t,A))}if(H===void 0)z(C);else return q(C,H),$(H,re)}function I(A,C){var L=l.length;return l[L]=C,o[A]=L,"refVal"+L}function z(A){delete o[A]}function q(A,C){var L=o[A];l[L]=C}function $(A,C){return typeof A=="object"||typeof A=="boolean"?{code:C,schema:A,inline:!0}:{code:C,$async:A&&!!A.$async}}function U(A){var C=f[A];return C===void 0&&(C=f[A]=d.length,d[C]=A),"pattern"+C}function M(A){switch(typeof A){case"boolean":case"number":return""+A;case"string":return na.toQuotedString(A);case"object":if(A===null)return"null";var C=gd(A),L=m[C];return L===void 0&&(L=m[C]=p.length,p[L]=A),"default"+L}}function F(A,C,L,le){if(r._opts.validateSchema!==!1){var Y=A.definition.dependencies;if(Y&&!Y.every(function(xe){return Object.prototype.hasOwnProperty.call(L,xe)}))throw new Error("parent schema must have all required keywords: "+Y.join(","));var re=A.definition.validateSchema;if(re){var G=re(C);if(!G){var H="keyword schema is invalid: "+r.errorsText(re.errors);if(r._opts.validateSchema=="log")r.logger.error(H);else throw new Error(H)}}}var me=A.definition.compile,we=A.definition.inline,Te=A.definition.macro,se;if(me)se=me.call(r,C,L,le);else if(Te)se=Te.call(r,C,L,le),n.validateSchema!==!1&&r.validateSchema(se,!0);else if(we)se=we.call(r,le,A.keyword,C,L);else if(se=A.definition.validate,!se)return;if(se===void 0)throw new Error('custom keyword "'+A.keyword+'"failed to compile');var ye=b.length;return b[ye]=se,{code:"customRule"+ye,validate:se}}}function Ed(a,e,t){var s=Fn.call(this,a,e,t);return s>=0?{index:s,compiling:!0}:(s=this._compilations.length,this._compilations[s]={schema:a,root:e,baseId:t},{index:s,compiling:!1})}function xd(a,e,t){var s=Fn.call(this,a,e,t);s>=0&&this._compilations.splice(s,1)}function Fn(a,e,t){for(var s=0;s<this._compilations.length;s++){var r=this._compilations[s];if(r.schema==a&&r.root==e&&r.baseId==t)return s}return-1}function Sd(a,e){return"var pattern"+a+" = new RegExp("+na.toQuotedString(e[a])+");"}function Pd(a){return"var default"+a+" = defaults["+a+"];"}function wd(a,e){return e[a]===void 0?"":"var refVal"+a+" = refVal["+a+"];"}function Od(a){return"var customRule"+a+" = customRules["+a+"];"}function sa(a,e){if(!a.length)return"";for(var t="",s=0;s<a.length;s++)t+=e(s,a);return t}});var Un=Q((Up,qn)=>{"use strict";var ia=qn.exports=function(){this._cache={}};ia.prototype.put=function(e,t){this._cache[e]=t};ia.prototype.get=function(e){return this._cache[e]};ia.prototype.del=function(e){delete this._cache[e]};ia.prototype.clear=function(){this._cache={}}});var Xn=Q((Vp,Yn)=>{"use strict";var Rd=Kr(),Td=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Ad=[0,31,28,31,30,31,30,31,31,30,31,30,31],Dd=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Vn=/^(?=.{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,Id=/^(?:[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,$d=/^(?:[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,zn=/^(?:(?:[^\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,Hn=/^(?:(?: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,Zn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Bn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Qn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Wn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Yn.exports=oa;function oa(a){return a=a=="full"?"full":"fast",Rd.copy(oa[a])}oa.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":zn,url:Hn,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:Vn,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:Gn,uuid:Zn,"json-pointer":Bn,"json-pointer-uri-fragment":Qn,"relative-json-pointer":Wn};oa.full={date:Kn,time:Jn,"date-time":Nd,uri:Fd,"uri-reference":$d,"uri-template":zn,url:Hn,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:Vn,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:Gn,uuid:Zn,"json-pointer":Bn,"json-pointer-uri-fragment":Qn,"relative-json-pointer":Wn};function Cd(a){return a%4===0&&(a%100!==0||a%400===0)}function Kn(a){var e=a.match(Td);if(!e)return!1;var t=+e[1],s=+e[2],r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&Cd(t)?29:Ad[s])}function Jn(a,e){var t=a.match(Dd);if(!t)return!1;var s=t[1],r=t[2],n=t[3],l=t[5];return(s<=23&&r<=59&&n<=59||s==23&&r==59&&n==60)&&(!e||l)}var kd=/t|\s/i;function Nd(a){var e=a.split(kd);return e.length==2&&Kn(e[0])&&Jn(e[1],!0)}var jd=/\/|:/;function Fd(a){return jd.test(a)&&Id.test(a)}var Ld=/[^\\]\\Z/;function Gn(a){if(Ld.test(a))return!1;try{return new RegExp(a),!0}catch{return!1}}});var ri=Q((zp,ei)=>{"use strict";ei.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(l||""),m="valid"+n,b,c;if(o=="#"||o=="#/")e.isRoot?(b=e.async,c="validate"):(b=e.root.schema.$async===!0,c="root.refVal[0]");else{var y=e.resolveRef(e.baseId,o,e.isRoot);if(y===void 0){var _=e.MissingRefError.message(e.baseId,o);if(e.opts.missingRefs=="fail"){e.logger.error(_);var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { ref: '"+e.util.escapeQuotes(o)+"' } ",e.opts.messages!==!1&&(r+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(o)+"' "),e.opts.verbose&&(r+=" , schema: "+e.util.toQuotedString(o)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=v.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(_),f&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,o,_)}else if(y.inline){var T=e.util.copy(e);T.level++;var P="valid"+T.level;T.schema=y.schema,T.schemaPath="",T.errSchemaPath=o;var O=e.validate(T).replace(/validate\.schema/g,y.code);r+=" "+O+" ",f&&(r+=" if ("+P+") { ")}else b=y.$async===!0||e.async&&y.$async!==!1,c=y.code}if(c){var v=v||[];v.push(r),r="",e.opts.passContext?r+=" "+c+".call(this, ":r+=" "+c+"( ",r+=" "+p+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var D=l?"data"+(l-1||""):"parentData",I=l?e.dataPathArr[l]:"parentDataProperty";r+=" , "+D+" , "+I+", rootData) ";var z=r;if(r=v.pop(),b){if(!e.async)throw new Error("async schema referenced by sync schema");f&&(r+=" var "+m+"; "),r+=" try { await "+z+"; ",f&&(r+=" "+m+" = true; "),r+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",f&&(r+=" "+m+" = false; "),r+=" } ",f&&(r+=" if ("+m+") { ")}else r+=" if (!"+z+") { if (vErrors === null) vErrors = "+c+".errors; else vErrors = vErrors.concat("+c+".errors); errors = vErrors.length; } ",f&&(r+=" else { ")}return r}});var ai=Q((Hp,ti)=>{"use strict";ti.exports=function(e,t,s){var r=" ",n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,b=f.baseId,c=!0,y=n;if(y)for(var _,v=-1,S=y.length-1;v<S;)_=y[v+=1],(e.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:e.util.schemaHasRules(_,e.RULES.all))&&(c=!1,f.schema=_,f.schemaPath=l+"["+v+"]",f.errSchemaPath=o+"/"+v,r+=" "+e.validate(f)+" ",f.baseId=b,d&&(r+=" if ("+m+") { ",p+="}"));return d&&(c?r+=" if (true) { ":r+=" "+p.slice(0,-1)+" "),r}});var ni=Q((Zp,si)=>{"use strict";si.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,S=o.every(function(q){return e.opts.strictKeywords?typeof q=="object"&&Object.keys(q).length>0||q===!1:e.util.schemaHasRules(q,e.RULES.all)});if(S){var T=y.baseId;r+=" var "+c+" = errors; var "+b+" = false; ";var P=e.compositeRule;e.compositeRule=y.compositeRule=!0;var O=o;if(O)for(var D,I=-1,z=O.length-1;I<z;)D=O[I+=1],y.schema=D,y.schemaPath=d+"["+I+"]",y.errSchemaPath=f+"/"+I,r+=" "+e.validate(y)+" ",y.baseId=T,r+=" "+b+" = "+b+" || "+v+"; if (!"+b+") { ",_+="}";e.compositeRule=y.compositeRule=P,r+=" "+_+" if (!"+b+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else p&&(r+=" if (true) { ");return r}});var oi=Q((Bp,ii)=>{"use strict";ii.exports=function(e,t,s){var r=" ",n=e.schema[t],l=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,d=e.util.toQuotedString(n);return e.opts.$comment===!0?r+=" console.log("+d+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+d+", "+e.util.toQuotedString(l)+", validate.root.schema);"),r}});var ci=Q((Qp,li)=>{"use strict";li.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c=e.opts.$data&&o&&o.$data,y;c?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=o,c||(r+=" var schema"+n+" = validate.schema"+d+";"),r+="var "+b+" = equal("+m+", schema"+n+"); if (!"+b+") { ";var _=_||[];_.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValue: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var v=r;return r=_.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",p&&(r+=" else { "),r}});var di=Q((Wp,ui)=>{"use strict";ui.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,S="i"+n,T=y.dataLevel=e.dataLevel+1,P="data"+T,O=e.baseId,D=e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all);if(r+="var "+c+" = errors;var "+b+";",D){var I=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.schema=o,y.schemaPath=d,y.errSchemaPath=f,r+=" var "+v+" = false; for (var "+S+" = 0; "+S+" < "+m+".length; "+S+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var z=m+"["+S+"]";y.dataPathArr[T]=S;var q=e.validate(y);y.baseId=O,e.util.varOccurences(q,P)<2?r+=" "+e.util.varReplace(q,P,z)+" ":r+=" var "+P+" = "+z+"; "+q+" ",r+=" if ("+v+") break; } ",e.compositeRule=y.compositeRule=I,r+=" "+_+" if (!"+v+") {"}else r+=" if ("+m+".length == 0) {";var $=$||[];$.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var U=r;return r=$.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+U+"]); ":r+=" validate.errors = ["+U+"]; return false; ":r+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",D&&(r+=" errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}});var pi=Q((Kp,fi)=>{"use strict";fi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,c=e.util.copy(e),y="";c.level++;var _="valid"+c.level,v={},S={},T=e.opts.ownProperties;for(I in o)if(I!="__proto__"){var P=o[I],O=Array.isArray(P)?S:v;O[I]=P}r+="var "+b+" = errors;";var D=e.errorPath;r+="var missing"+n+";";for(var I in S)if(O=S[I],O.length){if(r+=" if ( "+m+e.util.getProperty(I)+" !== undefined ",T&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(I)+"') "),p){r+=" && ( ";var z=O;if(z)for(var q,$=-1,U=z.length-1;$<U;){q=z[$+=1],$&&(r+=" || ");var M=e.util.getProperty(q),F=m+M;r+=" ( ( "+F+" === undefined ",T&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(q)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?q:M)+") ) "}r+=")) { ";var A="missing"+n,C="' + "+A+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(D,A,!0):D+" + "+A);var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+C+"', depsCount: "+O.length+", deps: '"+e.util.escapeQuotes(O.length==1?O[0]:O.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",O.length==1?r+="property "+e.util.escapeQuotes(O[0]):r+="properties "+e.util.escapeQuotes(O.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var le=r;r=L.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+le+"]); ":r+=" validate.errors = ["+le+"]; return false; ":r+=" var err = "+le+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var Y=O;if(Y)for(var q,re=-1,G=Y.length-1;re<G;){q=Y[re+=1];var M=e.util.getProperty(q),C=e.util.escapeQuotes(q),F=m+M;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(D,q,e.opts.jsonPointers)),r+=" if ( "+F+" === undefined ",T&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(q)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+C+"', depsCount: "+O.length+", deps: '"+e.util.escapeQuotes(O.length==1?O[0]:O.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",O.length==1?r+="property "+e.util.escapeQuotes(O[0]):r+="properties "+e.util.escapeQuotes(O.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",p&&(y+="}",r+=" else { ")}e.errorPath=D;var H=c.baseId;for(var I in v){var P=v[I];(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))&&(r+=" "+_+" = true; if ( "+m+e.util.getProperty(I)+" !== undefined ",T&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(I)+"') "),r+=") { ",c.schema=P,c.schemaPath=d+e.util.getProperty(I),c.errSchemaPath=f+"/"+e.util.escapeFragment(I),r+=" "+e.validate(c)+" ",c.baseId=H,r+=" } ",p&&(r+=" if ("+_+") { ",y+="}"))}return p&&(r+=" "+y+" if ("+b+" == errors) {"),r}});var mi=Q((Jp,hi)=>{"use strict";hi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c=e.opts.$data&&o&&o.$data,y;c?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=o;var _="i"+n,v="schema"+n;c||(r+=" var "+v+" = validate.schema"+d+";"),r+="var "+b+";",c&&(r+=" if (schema"+n+" === undefined) "+b+" = true; else if (!Array.isArray(schema"+n+")) "+b+" = false; else {"),r+=""+b+" = false;for (var "+_+"=0; "+_+"<"+v+".length; "+_+"++) if (equal("+m+", "+v+"["+_+"])) { "+b+" = true; break; }",c&&(r+=" } "),r+=" if (!"+b+") { ";var S=S||[];S.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValues: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var T=r;return r=S.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+T+"]); ":r+=" validate.errors = ["+T+"]; return false; ":r+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",p&&(r+=" else { "),r}});var gi=Q((Gp,vi)=>{"use strict";vi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||"");if(e.opts.format===!1)return p&&(r+=" if (true) { "),r;var b=e.opts.$data&&o&&o.$data,c;b?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=o;var y=e.opts.unknownFormats,_=Array.isArray(y);if(b){var v="format"+n,S="isObject"+n,T="formatType"+n;r+=" var "+v+" = formats["+c+"]; var "+S+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+T+" = "+S+" && "+v+".type || 'string'; if ("+S+") { ",e.async&&(r+=" var async"+n+" = "+v+".async; "),r+=" "+v+" = "+v+".validate; } if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'string') || "),r+=" (",y!="ignore"&&(r+=" ("+c+" && !"+v+" ",_&&(r+=" && self._opts.unknownFormats.indexOf("+c+") == -1 "),r+=") || "),r+=" ("+v+" && "+T+" == '"+s+"' && !(typeof "+v+" == 'function' ? ",e.async?r+=" (async"+n+" ? await "+v+"("+m+") : "+v+"("+m+")) ":r+=" "+v+"("+m+") ",r+=" : "+v+".test("+m+"))))) {"}else{var v=e.formats[o];if(!v){if(y=="ignore")return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),p&&(r+=" if (true) { "),r;if(_&&y.indexOf(o)>=0)return p&&(r+=" if (true) { "),r;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var S=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,T=S&&v.type||"string";if(S){var P=v.async===!0;v=v.validate}if(T!=s)return p&&(r+=" if (true) { "),r;if(P){if(!e.async)throw new Error("async format in sync schema");var O="formats"+e.util.getProperty(o)+".validate";r+=" if (!(await "+O+"("+m+"))) { "}else{r+=" if (! ";var O="formats"+e.util.getProperty(o);S&&(O+=".validate"),typeof v=="function"?r+=" "+O+"("+m+") ":r+=" "+O+".test("+m+") ",r+=") { "}}var D=D||[];D.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { format: ",b?r+=""+c:r+=""+e.util.toQuotedString(o),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,b?r+="' + "+c+" + '":r+=""+e.util.escapeQuotes(o),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+d:r+=""+e.util.toQuotedString(o),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var I=r;return r=D.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+I+"]); ":r+=" validate.errors = ["+I+"]; return false; ":r+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",p&&(r+=" else { "),r}});var _i=Q((Yp,yi)=>{"use strict";yi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c="errs__"+n,y=e.util.copy(e);y.level++;var _="valid"+y.level,v=e.schema.then,S=e.schema.else,T=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),P=S!==void 0&&(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all)),O=y.baseId;if(T||P){var D;y.createErrors=!1,y.schema=o,y.schemaPath=d,y.errSchemaPath=f,r+=" var "+c+" = errors; var "+b+" = true; ";var I=e.compositeRule;e.compositeRule=y.compositeRule=!0,r+=" "+e.validate(y)+" ",y.baseId=O,y.createErrors=!0,r+=" errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.compositeRule=y.compositeRule=I,T?(r+=" if ("+_+") { ",y.schema=e.schema.then,y.schemaPath=e.schemaPath+".then",y.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(y)+" ",y.baseId=O,r+=" "+b+" = "+_+"; ",T&&P?(D="ifClause"+n,r+=" var "+D+" = 'then'; "):D="'then'",r+=" } ",P&&(r+=" else { ")):r+=" if (!"+_+") { ",P&&(y.schema=e.schema.else,y.schemaPath=e.schemaPath+".else",y.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(y)+" ",y.baseId=O,r+=" "+b+" = "+_+"; ",T&&P?(D="ifClause"+n,r+=" var "+D+" = 'else'; "):D="'else'",r+=" } "),r+=" if (!"+b+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { failingKeyword: "+D+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+D+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",p&&(r+=" else { ")}else p&&(r+=" if (true) { ");return r}});var Ei=Q((Xp,bi)=>{"use strict";bi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,S="i"+n,T=y.dataLevel=e.dataLevel+1,P="data"+T,O=e.baseId;if(r+="var "+c+" = errors;var "+b+";",Array.isArray(o)){var D=e.schema.additionalItems;if(D===!1){r+=" "+b+" = "+m+".length <= "+o.length+"; ";var I=f;f=e.errSchemaPath+"/additionalItems",r+=" if (!"+b+") { ";var z=z||[];z.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+o.length+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var q=r;r=z.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+q+"]); ":r+=" validate.errors = ["+q+"]; return false; ":r+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",f=I,p&&(_+="}",r+=" else { ")}var $=o;if($){for(var U,M=-1,F=$.length-1;M<F;)if(U=$[M+=1],e.opts.strictKeywords?typeof U=="object"&&Object.keys(U).length>0||U===!1:e.util.schemaHasRules(U,e.RULES.all)){r+=" "+v+" = true; if ("+m+".length > "+M+") { ";var A=m+"["+M+"]";y.schema=U,y.schemaPath=d+"["+M+"]",y.errSchemaPath=f+"/"+M,y.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),y.dataPathArr[T]=M;var C=e.validate(y);y.baseId=O,e.util.varOccurences(C,P)<2?r+=" "+e.util.varReplace(C,P,A)+" ":r+=" var "+P+" = "+A+"; "+C+" ",r+=" } ",p&&(r+=" if ("+v+") { ",_+="}")}}if(typeof D=="object"&&(e.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:e.util.schemaHasRules(D,e.RULES.all))){y.schema=D,y.schemaPath=e.schemaPath+".additionalItems",y.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+v+" = true; if ("+m+".length > "+o.length+") { for (var "+S+" = "+o.length+"; "+S+" < "+m+".length; "+S+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var A=m+"["+S+"]";y.dataPathArr[T]=S;var C=e.validate(y);y.baseId=O,e.util.varOccurences(C,P)<2?r+=" "+e.util.varReplace(C,P,A)+" ":r+=" var "+P+" = "+A+"; "+C+" ",p&&(r+=" if (!"+v+") break; "),r+=" } } ",p&&(r+=" if ("+v+") { ",_+="}")}}else if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){y.schema=o,y.schemaPath=d,y.errSchemaPath=f,r+=" for (var "+S+" = 0; "+S+" < "+m+".length; "+S+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var A=m+"["+S+"]";y.dataPathArr[T]=S;var C=e.validate(y);y.baseId=O,e.util.varOccurences(C,P)<2?r+=" "+e.util.varReplace(C,P,A)+" ":r+=" var "+P+" = "+A+"; "+C+" ",p&&(r+=" if (!"+v+") break; "),r+=" }"}return p&&(r+=" "+_+" if ("+c+" == errors) {"),r}});var os=Q((eh,xi)=>{"use strict";xi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,O,m="data"+(l||""),b=e.opts.$data&&o&&o.$data,c;b?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=o;var y=t=="maximum",_=y?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[_],S=e.opts.$data&&v&&v.$data,T=y?"<":">",P=y?">":"<",O=void 0;if(!(b||typeof o=="number"||o===void 0))throw new Error(t+" must be number");if(!(S||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(_+" must be number or boolean");if(S){var D=e.util.getData(v.$data,l,e.dataPathArr),I="exclusive"+n,z="exclType"+n,q="exclIsNumber"+n,$="op"+n,U="' + "+$+" + '";r+=" var schemaExcl"+n+" = "+D+"; ",D="schemaExcl"+n,r+=" var "+I+"; var "+z+" = typeof "+D+"; if ("+z+" != 'boolean' && "+z+" != 'undefined' && "+z+" != 'number') { ";var O=_,M=M||[];M.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(O||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+_+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var F=r;r=M.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+F+"]); ":r+=" validate.errors = ["+F+"]; return false; ":r+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" "+z+" == 'number' ? ( ("+I+" = "+c+" === undefined || "+D+" "+T+"= "+c+") ? "+m+" "+P+"= "+D+" : "+m+" "+P+" "+c+" ) : ( ("+I+" = "+D+" === true) ? "+m+" "+P+"= "+c+" : "+m+" "+P+" "+c+" ) || "+m+" !== "+m+") { var op"+n+" = "+I+" ? '"+T+"' : '"+T+"='; ",o===void 0&&(O=_,f=e.errSchemaPath+"/"+_,c=D,b=S)}else{var q=typeof v=="number",U=T;if(q&&b){var $="'"+U+"'";r+=" if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" ( "+c+" === undefined || "+v+" "+T+"= "+c+" ? "+m+" "+P+"= "+v+" : "+m+" "+P+" "+c+" ) || "+m+" !== "+m+") { "}else{q&&o===void 0?(I=!0,O=_,f=e.errSchemaPath+"/"+_,c=v,P+="="):(q&&(c=Math[y?"min":"max"](v,o)),v===(q?c:!0)?(I=!0,O=_,f=e.errSchemaPath+"/"+_,P+="="):(I=!1,U+="="));var $="'"+U+"'";r+=" if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" "+m+" "+P+" "+c+" || "+m+" !== "+m+") { "}}O=O||t;var M=M||[];M.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(O||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+$+", limit: "+c+", exclusive: "+I+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+U+" ",b?r+="' + "+c:r+=""+c+"'"),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+d:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var F=r;return r=M.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+F+"]); ":r+=" validate.errors = ["+F+"]; return false; ":r+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",p&&(r+=" else { "),r}});var ls=Q((rh,Si)=>{"use strict";Si.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,_,m="data"+(l||""),b=e.opts.$data&&o&&o.$data,c;if(b?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=o,!(b||typeof o=="number"))throw new Error(t+" must be number");var y=t=="maxItems"?">":"<";r+="if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" "+m+".length "+y+" "+c+") { ";var _=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",b?r+="' + "+c+" + '":r+=""+o,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+d:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var S=r;return r=v.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var cs=Q((th,Pi)=>{"use strict";Pi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,_,m="data"+(l||""),b=e.opts.$data&&o&&o.$data,c;if(b?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=o,!(b||typeof o=="number"))throw new Error(t+" must be number");var y=t=="maxLength"?">":"<";r+="if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),e.opts.unicode===!1?r+=" "+m+".length ":r+=" ucs2length("+m+") ",r+=" "+y+" "+c+") { ";var _=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",b?r+="' + "+c+" + '":r+=""+o,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+d:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var S=r;return r=v.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var us=Q((ah,wi)=>{"use strict";wi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,_,m="data"+(l||""),b=e.opts.$data&&o&&o.$data,c;if(b?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=o,!(b||typeof o=="number"))throw new Error(t+" must be number");var y=t=="maxProperties"?">":"<";r+="if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" Object.keys("+m+").length "+y+" "+c+") { ";var _=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",b?r+="' + "+c+" + '":r+=""+o,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+d:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var S=r;return r=v.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var Ri=Q((sh,Oi)=>{"use strict";Oi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b=e.opts.$data&&o&&o.$data,c;if(b?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=o,!(b||typeof o=="number"))throw new Error(t+" must be number");r+="var division"+n+";if (",b&&(r+=" "+c+" !== undefined && ( typeof "+c+" != 'number' || "),r+=" (division"+n+" = "+m+" / "+c+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+n+" !== parseInt(division"+n+") ",r+=" ) ",b&&(r+=" ) "),r+=" ) { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { multipleOf: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",b?r+="' + "+c:r+=""+c+"'"),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+d:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var _=r;return r=y.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var Ai=Q((nh,Ti)=>{"use strict";Ti.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,c=e.util.copy(e);c.level++;var y="valid"+c.level;if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){c.schema=o,c.schemaPath=d,c.errSchemaPath=f,r+=" var "+b+" = errors; ";var _=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.createErrors=!1;var v;c.opts.allErrors&&(v=c.opts.allErrors,c.opts.allErrors=!1),r+=" "+e.validate(c)+" ",c.createErrors=!0,v&&(c.opts.allErrors=v),e.compositeRule=c.compositeRule=_,r+=" if ("+y+") { ";var S=S||[];S.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var T=r;r=S.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+T+"]); ":r+=" validate.errors = ["+T+"]; return false; ":r+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+b+"; if (vErrors !== null) { if ("+b+") vErrors.length = "+b+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(r+=" if (false) { ");return r}});var Ii=Q((ih,Di)=>{"use strict";Di.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,S=y.baseId,T="prevValid"+n,P="passingSchemas"+n;r+="var "+c+" = errors , "+T+" = false , "+b+" = false , "+P+" = null; ";var O=e.compositeRule;e.compositeRule=y.compositeRule=!0;var D=o;if(D)for(var I,z=-1,q=D.length-1;z<q;)I=D[z+=1],(e.opts.strictKeywords?typeof I=="object"&&Object.keys(I).length>0||I===!1:e.util.schemaHasRules(I,e.RULES.all))?(y.schema=I,y.schemaPath=d+"["+z+"]",y.errSchemaPath=f+"/"+z,r+=" "+e.validate(y)+" ",y.baseId=S):r+=" var "+v+" = true; ",z&&(r+=" if ("+v+" && "+T+") { "+b+" = false; "+P+" = ["+P+", "+z+"]; } else { ",_+="}"),r+=" if ("+v+") { "+b+" = "+T+" = true; "+P+" = "+z+"; }";return e.compositeRule=y.compositeRule=O,r+=""+_+"if (!"+b+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { passingSchemas: "+P+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}});var Ci=Q((oh,$i)=>{"use strict";$i.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b=e.opts.$data&&o&&o.$data,c;b?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=o;var y=b?"(new RegExp("+c+"))":e.usePattern(o);r+="if ( ",b&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'string') || "),r+=" !"+y+".test("+m+") ) { ";var _=_||[];_.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { pattern: ",b?r+=""+c:r+=""+e.util.toQuotedString(o),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,b?r+="' + "+c+" + '":r+=""+e.util.escapeQuotes(o),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+d:r+=""+e.util.toQuotedString(o),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var v=r;return r=_.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var Ni=Q((lh,ki)=>{"use strict";ki.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,c=e.util.copy(e),y="";c.level++;var _="valid"+c.level,v="key"+n,S="idx"+n,T=c.dataLevel=e.dataLevel+1,P="data"+T,O="dataProperties"+n,D=Object.keys(o||{}).filter(re),I=e.schema.patternProperties||{},z=Object.keys(I).filter(re),q=e.schema.additionalProperties,$=D.length||z.length,U=q===!1,M=typeof q=="object"&&Object.keys(q).length,F=e.opts.removeAdditional,A=U||M||F,C=e.opts.ownProperties,L=e.baseId,le=e.schema.required;if(le&&!(e.opts.$data&&le.$data)&&le.length<e.opts.loopRequired)var Y=e.util.toHash(le);function re(Je){return Je!=="__proto__"}if(r+="var "+b+" = errors;var "+_+" = true;",C&&(r+=" var "+O+" = undefined;"),A){if(C?r+=" "+O+" = "+O+" || Object.keys("+m+"); for (var "+S+"=0; "+S+"<"+O+".length; "+S+"++) { var "+v+" = "+O+"["+S+"]; ":r+=" for (var "+v+" in "+m+") { ",$){if(r+=" var isAdditional"+n+" = !(false ",D.length)if(D.length>8)r+=" || validate.schema"+d+".hasOwnProperty("+v+") ";else{var G=D;if(G)for(var H,me=-1,we=G.length-1;me<we;)H=G[me+=1],r+=" || "+v+" == "+e.util.toQuotedString(H)+" "}if(z.length){var Te=z;if(Te)for(var se,ye=-1,xe=Te.length-1;ye<xe;)se=Te[ye+=1],r+=" || "+e.usePattern(se)+".test("+v+") "}r+=" ); if (isAdditional"+n+") { "}if(F=="all")r+=" delete "+m+"["+v+"]; ";else{var Ae=e.errorPath,yr="' + "+v+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers)),U)if(F)r+=" delete "+m+"["+v+"]; ";else{r+=" "+_+" = false; ";var cr=f;f=e.errSchemaPath+"/additionalProperties";var _e=_e||[];_e.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { additionalProperty: '"+yr+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var ve=r;r=_e.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+ve+"]); ":r+=" validate.errors = ["+ve+"]; return false; ":r+=" var err = "+ve+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=cr,p&&(r+=" break; ")}else if(M)if(F=="failing"){r+=" var "+b+" = errors; ";var Rr=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.schema=q,c.schemaPath=e.schemaPath+".additionalProperties",c.errSchemaPath=e.errSchemaPath+"/additionalProperties",c.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Oe=m+"["+v+"]";c.dataPathArr[T]=v;var ie=e.validate(c);c.baseId=L,e.util.varOccurences(ie,P)<2?r+=" "+e.util.varReplace(ie,P,Oe)+" ":r+=" var "+P+" = "+Oe+"; "+ie+" ",r+=" if (!"+_+") { errors = "+b+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+m+"["+v+"]; } ",e.compositeRule=c.compositeRule=Rr}else{c.schema=q,c.schemaPath=e.schemaPath+".additionalProperties",c.errSchemaPath=e.errSchemaPath+"/additionalProperties",c.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Oe=m+"["+v+"]";c.dataPathArr[T]=v;var ie=e.validate(c);c.baseId=L,e.util.varOccurences(ie,P)<2?r+=" "+e.util.varReplace(ie,P,Oe)+" ":r+=" var "+P+" = "+Oe+"; "+ie+" ",p&&(r+=" if (!"+_+") break; ")}e.errorPath=Ae}$&&(r+=" } "),r+=" } ",p&&(r+=" if ("+_+") { ",y+="}")}var _r=e.opts.useDefaults&&!e.compositeRule;if(D.length){var ur=D;if(ur)for(var H,Tr=-1,Ar=ur.length-1;Tr<Ar;){H=ur[Tr+=1];var Se=o[H];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){var Ve=e.util.getProperty(H),Oe=m+Ve,$e=_r&&Se.default!==void 0;c.schema=Se,c.schemaPath=d+Ve,c.errSchemaPath=f+"/"+e.util.escapeFragment(H),c.errorPath=e.util.getPath(e.errorPath,H,e.opts.jsonPointers),c.dataPathArr[T]=e.util.toQuotedString(H);var ie=e.validate(c);if(c.baseId=L,e.util.varOccurences(ie,P)<2){ie=e.util.varReplace(ie,P,Oe);var De=Oe}else{var De=P;r+=" var "+P+" = "+Oe+"; "}if($e)r+=" "+ie+" ";else{if(Y&&Y[H]){r+=" if ( "+De+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(H)+"') "),r+=") { "+_+" = false; ";var Ae=e.errorPath,cr=f,tr=e.util.escapeQuotes(H);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Ae,H,e.opts.jsonPointers)),f=e.errSchemaPath+"/required";var _e=_e||[];_e.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+tr+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+tr+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var ve=r;r=_e.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+ve+"]); ":r+=" validate.errors = ["+ve+"]; return false; ":r+=" var err = "+ve+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=cr,e.errorPath=Ae,r+=" } else { "}else p?(r+=" if ( "+De+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(H)+"') "),r+=") { "+_+" = true; } else { "):(r+=" if ("+De+" !== undefined ",C&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(H)+"') "),r+=" ) { ");r+=" "+ie+" } "}}p&&(r+=" if ("+_+") { ",y+="}")}}if(z.length){var Le=z;if(Le)for(var se,At=-1,xa=Le.length-1;At<xa;){se=Le[At+=1];var Se=I[se];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){c.schema=Se,c.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(se),c.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(se),C?r+=" "+O+" = "+O+" || Object.keys("+m+"); for (var "+S+"=0; "+S+"<"+O+".length; "+S+"++) { var "+v+" = "+O+"["+S+"]; ":r+=" for (var "+v+" in "+m+") { ",r+=" if ("+e.usePattern(se)+".test("+v+")) { ",c.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Oe=m+"["+v+"]";c.dataPathArr[T]=v;var ie=e.validate(c);c.baseId=L,e.util.varOccurences(ie,P)<2?r+=" "+e.util.varReplace(ie,P,Oe)+" ":r+=" var "+P+" = "+Oe+"; "+ie+" ",p&&(r+=" if (!"+_+") break; "),r+=" } ",p&&(r+=" else "+_+" = true; "),r+=" } ",p&&(r+=" if ("+_+") { ",y+="}")}}}return p&&(r+=" "+y+" if ("+b+" == errors) {"),r}});var Fi=Q((ch,ji)=>{"use strict";ji.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,c=e.util.copy(e),y="";c.level++;var _="valid"+c.level;if(r+="var "+b+" = errors;",e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===!1:e.util.schemaHasRules(o,e.RULES.all)){c.schema=o,c.schemaPath=d,c.errSchemaPath=f;var v="key"+n,S="idx"+n,T="i"+n,P="' + "+v+" + '",O=c.dataLevel=e.dataLevel+1,D="data"+O,I="dataProperties"+n,z=e.opts.ownProperties,q=e.baseId;z&&(r+=" var "+I+" = undefined; "),z?r+=" "+I+" = "+I+" || Object.keys("+m+"); for (var "+S+"=0; "+S+"<"+I+".length; "+S+"++) { var "+v+" = "+I+"["+S+"]; ":r+=" for (var "+v+" in "+m+") { ",r+=" var startErrs"+n+" = errors; ";var $=v,U=e.compositeRule;e.compositeRule=c.compositeRule=!0;var M=e.validate(c);c.baseId=q,e.util.varOccurences(M,D)<2?r+=" "+e.util.varReplace(M,D,$)+" ":r+=" var "+D+" = "+$+"; "+M+" ",e.compositeRule=c.compositeRule=U,r+=" if (!"+_+") { for (var "+T+"=startErrs"+n+"; "+T+"<errors; "+T+"++) { vErrors["+T+"].propertyName = "+v+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { propertyName: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+P+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),p&&(r+=" break; "),r+=" } }"}return p&&(r+=" "+y+" if ("+b+" == errors) {"),r}});var Mi=Q((uh,Li)=>{"use strict";Li.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c=e.opts.$data&&o&&o.$data,y;c?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=o;var _="schema"+n;if(!c)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var v=[],S=o;if(S)for(var T,P=-1,O=S.length-1;P<O;){T=S[P+=1];var D=e.schema.properties[T];D&&(e.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:e.util.schemaHasRules(D,e.RULES.all))||(v[v.length]=T)}}else var v=o;if(c||v.length){var I=e.errorPath,z=c||v.length>=e.opts.loopRequired,q=e.opts.ownProperties;if(p)if(r+=" var missing"+n+"; ",z){c||(r+=" var "+_+" = validate.schema"+d+"; ");var $="i"+n,U="schema"+n+"["+$+"]",M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,U,e.opts.jsonPointers)),r+=" var "+b+" = true; ",c&&(r+=" if (schema"+n+" === undefined) "+b+" = true; else if (!Array.isArray(schema"+n+")) "+b+" = false; else {"),r+=" for (var "+$+" = 0; "+$+" < "+_+".length; "+$+"++) { "+b+" = "+m+"["+_+"["+$+"]] !== undefined ",q&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", "+_+"["+$+"]) "),r+="; if (!"+b+") break; } ",c&&(r+=" } "),r+=" if (!"+b+") { ";var F=F||[];F.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var A=r;r=F.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var C=v;if(C)for(var L,$=-1,le=C.length-1;$<le;){L=C[$+=1],$&&(r+=" || ");var Y=e.util.getProperty(L),re=m+Y;r+=" ( ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(L)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?L:Y)+") ) "}r+=") { ";var U="missing"+n,M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,U,!0):I+" + "+U);var F=F||[];F.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var A=r;r=F.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(z){c||(r+=" var "+_+" = validate.schema"+d+"; ");var $="i"+n,U="schema"+n+"["+$+"]",M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,U,e.opts.jsonPointers)),c&&(r+=" if ("+_+" && !Array.isArray("+_+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+_+" !== undefined) { "),r+=" for (var "+$+" = 0; "+$+" < "+_+".length; "+$+"++) { if ("+m+"["+_+"["+$+"]] === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", "+_+"["+$+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",c&&(r+=" } ")}else{var G=v;if(G)for(var L,H=-1,me=G.length-1;H<me;){L=G[H+=1];var Y=e.util.getProperty(L),M=e.util.escapeQuotes(L),re=m+Y;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,L,e.opts.jsonPointers)),r+=" if ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(L)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=I}else p&&(r+=" if (true) {");return r}});var Ui=Q((dh,qi)=>{"use strict";qi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,c=e.opts.$data&&o&&o.$data,y;if(c?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=o,(o||c)&&e.opts.uniqueItems!==!1){c&&(r+=" var "+b+"; if ("+y+" === false || "+y+" === undefined) "+b+" = true; else if (typeof "+y+" != 'boolean') "+b+" = false; else { "),r+=" var i = "+m+".length , "+b+" = true , j; if (i > 1) { ";var _=e.schema.items&&e.schema.items.type,v=Array.isArray(_);if(!_||_=="object"||_=="array"||v&&(_.indexOf("object")>=0||_.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+m+"[i], "+m+"[j])) { "+b+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+m+"[i]; ";var S="checkDataType"+(v?"s":"");r+=" if ("+e.util[S](_,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+b+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",c&&(r+=" } "),r+=" if (!"+b+") { ";var T=T||[];T.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r+=" , schema: ",c?r+="validate.schema"+d:r+=""+o,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var P=r;r=T.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",p&&(r+=" else { ")}else p&&(r+=" if (true) { ");return r}});var zi=Q((fh,Vi)=>{"use strict";Vi.exports={$ref:ri(),allOf:ai(),anyOf:ni(),$comment:oi(),const:ci(),contains:di(),dependencies:pi(),enum:mi(),format:gi(),if:_i(),items:Ei(),maximum:os(),minimum:os(),maxItems:ls(),minItems:ls(),maxLength:cs(),minLength:cs(),maxProperties:us(),minProperties:us(),multipleOf:Ri(),not:Ai(),oneOf:Ii(),pattern:Ci(),properties:Ni(),propertyNames:Fi(),required:Mi(),uniqueItems:Ui(),validate:ns()}});var Bi=Q((ph,Zi)=>{"use strict";var Hi=zi(),ds=Kr().toHash;Zi.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"]}],t=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],r=["number","integer","string","array","object","boolean","null"];return e.all=ds(t),e.types=ds(r),e.forEach(function(n){n.rules=n.rules.map(function(l){var o;if(typeof l=="object"){var d=Object.keys(l)[0];o=l[d],l=d,o.forEach(function(p){t.push(p),e.all[p]=!0})}t.push(l);var f=e.all[l]={keyword:l,code:Hi[l],implements:o};return f}),e.all.$comment={keyword:"$comment",code:Hi.$comment},n.type&&(e.types[n.type]=n)}),e.keywords=ds(t.concat(s)),e.custom={},e}});var Ki=Q((hh,Wi)=>{"use strict";var Qi=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];Wi.exports=function(a,e){for(var t=0;t<e.length;t++){a=JSON.parse(JSON.stringify(a));var s=e[t].split("/"),r=a,n;for(n=1;n<s.length;n++)r=r[s[n]];for(n=0;n<Qi.length;n++){var l=Qi[n],o=r[l];o&&(r[l]={anyOf:[o,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return a}});var Yi=Q((mh,Gi)=>{"use strict";var Md=ta().MissingRef;Gi.exports=Ji;function Ji(a,e,t){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(t=e,e=void 0);var r=n(a).then(function(){var o=s._addSchema(a,void 0,e);return o.validate||l(o)});return t&&r.then(function(o){t(null,o)},t),r;function n(o){var d=o.$schema;return d&&!s.getSchema(d)?Ji.call(s,{$ref:d},!0):Promise.resolve()}function l(o){try{return s._compile(o)}catch(f){if(f instanceof Md)return d(f);throw f}function d(f){var p=f.missingSchema;if(c(p))throw new Error("Schema "+p+" is loaded but "+f.missingRef+" cannot be resolved");var m=s._loadingSchemas[p];return m||(m=s._loadingSchemas[p]=s._opts.loadSchema(p),m.then(b,b)),m.then(function(y){if(!c(p))return n(y).then(function(){c(p)||s.addSchema(y,p,void 0,e)})}).then(function(){return l(o)});function b(){delete s._loadingSchemas[p]}function c(y){return s._refs[y]||s._schemas[y]}}}}});var eo=Q((vh,Xi)=>{"use strict";Xi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m,b="data"+(l||""),c="valid"+n,y="errs__"+n,_=e.opts.$data&&o&&o.$data,v;_?(r+=" var schema"+n+" = "+e.util.getData(o.$data,l,e.dataPathArr)+"; ",v="schema"+n):v=o;var S=this,T="definition"+n,P=S.definition,O="",D,I,z,q,$;if(_&&P.$data){$="keywordValidate"+n;var U=P.validateSchema;r+=" var "+T+" = RULES.custom['"+t+"'].definition; var "+$+" = "+T+".validate;"}else{if(q=e.useCustomRule(S,o,e.schema,e),!q)return;v="validate.schema"+d,$=q.code,D=P.compile,I=P.inline,z=P.macro}var M=$+".errors",F="i"+n,A="ruleErr"+n,C=P.async;if(C&&!e.async)throw new Error("async keyword in sync schema");if(I||z||(r+=""+M+" = null;"),r+="var "+y+" = errors;var "+c+";",_&&P.$data&&(O+="}",r+=" if ("+v+" === undefined) { "+c+" = true; } else { ",U&&(O+="}",r+=" "+c+" = "+T+".validateSchema("+v+"); if ("+c+") { ")),I)P.statements?r+=" "+q.validate+" ":r+=" "+c+" = "+q.validate+"; ";else if(z){var L=e.util.copy(e),O="";L.level++;var le="valid"+L.level;L.schema=q.validate,L.schemaPath="";var Y=e.compositeRule;e.compositeRule=L.compositeRule=!0;var re=e.validate(L).replace(/validate\.schema/g,$);e.compositeRule=L.compositeRule=Y,r+=" "+re}else{var G=G||[];G.push(r),r="",r+=" "+$+".call( ",e.opts.passContext?r+="this":r+="self",D||P.schema===!1?r+=" , "+b+" ":r+=" , "+v+" , "+b+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var H=l?"data"+(l-1||""):"parentData",me=l?e.dataPathArr[l]:"parentDataProperty";r+=" , "+H+" , "+me+" , rootData ) ";var we=r;r=G.pop(),P.errors===!1?(r+=" "+c+" = ",C&&(r+="await "),r+=""+we+"; "):C?(M="customErrors"+n,r+=" var "+M+" = null; try { "+c+" = await "+we+"; } catch (e) { "+c+" = false; if (e instanceof ValidationError) "+M+" = e.errors; else throw e; } "):r+=" "+M+" = null; "+c+" = "+we+"; "}if(P.modifying&&(r+=" if ("+H+") "+b+" = "+H+"["+me+"];"),r+=""+O,P.valid)p&&(r+=" if (true) { ");else{r+=" if ( ",P.valid===void 0?(r+=" !",z?r+=""+le:r+=""+c):r+=" "+!P.valid+" ",r+=") { ",m=S.keyword;var G=G||[];G.push(r),r="";var G=G||[];G.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+S.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+S.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var Te=r;r=G.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+Te+"]); ":r+=" validate.errors = ["+Te+"]; return false; ":r+=" var err = "+Te+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var se=r;r=G.pop(),I?P.errors?P.errors!="full"&&(r+=" for (var "+F+"="+y+"; "+F+"<errors; "+F+"++) { var "+A+" = vErrors["+F+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(r+=" "+A+".schema = "+v+"; "+A+".data = "+b+"; "),r+=" } "):P.errors===!1?r+=" "+se+" ":(r+=" if ("+y+" == errors) { "+se+" } else { for (var "+F+"="+y+"; "+F+"<errors; "+F+"++) { var "+A+" = vErrors["+F+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(r+=" "+A+".schema = "+v+"; "+A+".data = "+b+"; "),r+=" } } "):z?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+S.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+S.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):P.errors===!1?r+=" "+se+" ":(r+=" if (Array.isArray("+M+")) { if (vErrors === null) vErrors = "+M+"; else vErrors = vErrors.concat("+M+"); errors = vErrors.length; for (var "+F+"="+y+"; "+F+"<errors; "+F+"++) { var "+A+" = vErrors["+F+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; "+A+'.schemaPath = "'+f+'"; ',e.opts.verbose&&(r+=" "+A+".schema = "+v+"; "+A+".data = "+b+"; "),r+=" } } else { "+se+" } "),r+=" } ",p&&(r+=" else { ")}return r}});var fs=Q((gh,qd)=>{qd.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 ao=Q((yh,to)=>{"use strict";var ro=fs();to.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:ro.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:ro.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 no=Q((_h,so)=>{"use strict";var Ud=/^[a-z_$][a-z0-9_$-]*$/i,Vd=eo(),zd=ao();so.exports={add:Hd,get:Zd,remove:Bd,validate:ps};function Hd(a,e){var t=this.RULES;if(t.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!Ud.test(a))throw new Error("Keyword "+a+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var s=e.type;if(Array.isArray(s))for(var r=0;r<s.length;r++)l(a,s[r],e);else l(a,s,e);var n=e.metaSchema;n&&(e.$data&&this._opts.$data&&(n={anyOf:[n,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(n,!0))}t.keywords[a]=t.all[a]=!0;function l(o,d,f){for(var p,m=0;m<t.length;m++){var b=t[m];if(b.type==d){p=b;break}}p||(p={type:d,rules:[]},t.push(p));var c={keyword:o,definition:f,custom:!0,code:Vd,implements:f.implements};p.rules.push(c),t.custom[o]=c}return this}function Zd(a){var e=this.RULES.custom[a];return e?e.definition:this.RULES.keywords[a]||!1}function Bd(a){var e=this.RULES;delete e.keywords[a],delete e.all[a],delete e.custom[a];for(var t=0;t<e.length;t++)for(var s=e[t].rules,r=0;r<s.length;r++)if(s[r].keyword==a){s.splice(r,1);break}return this}function ps(a,e){ps.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(zd,!0);if(t(a))return!0;if(ps.errors=t.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}});var io=Q((bh,Qd)=>{Qd.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 go=Q((Eh,vo)=>{"use strict";var lo=Mn(),Jr=ra(),Wd=Un(),co=Ya(),Kd=ss(),Jd=Xn(),Gd=Bi(),uo=Ki(),fo=Kr();vo.exports=ge;ge.prototype.validate=Xd;ge.prototype.compile=ef;ge.prototype.addSchema=rf;ge.prototype.addMetaSchema=tf;ge.prototype.validateSchema=af;ge.prototype.getSchema=nf;ge.prototype.removeSchema=lf;ge.prototype.addFormat=vf;ge.prototype.errorsText=mf;ge.prototype._addSchema=cf;ge.prototype._compile=uf;ge.prototype.compileAsync=Yi();var ua=no();ge.prototype.addKeyword=ua.add;ge.prototype.getKeyword=ua.get;ge.prototype.removeKeyword=ua.remove;ge.prototype.validateKeyword=ua.validate;var po=ta();ge.ValidationError=po.Validation;ge.MissingRefError=po.MissingRef;ge.$dataMetaSchema=uo;var ca="http://json-schema.org/draft-07/schema",oo=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],Yd=["/properties"];function ge(a){if(!(this instanceof ge))return new ge(a);a=this._opts=fo.copy(a)||{},xf(this),this._schemas={},this._refs={},this._fragments={},this._formats=Jd(a.format),this._cache=a.cache||new Wd,this._loadingSchemas={},this._compilations=[],this.RULES=Gd(),this._getId=df(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=!0),a.serialize===void 0&&(a.serialize=Kd),this._metaOpts=Ef(this),a.formats&&_f(this),a.keywords&&bf(this),gf(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),yf(this)}function Xd(a,e){var t;if(typeof a=="string"){if(t=this.getSchema(a),!t)throw new Error('no schema with key or ref "'+a+'"')}else{var s=this._addSchema(a);t=s.validate||this._compile(s)}var r=t(e);return t.$async!==!0&&(this.errors=t.errors),r}function ef(a,e){var t=this._addSchema(a,void 0,e);return t.validate||this._compile(t)}function rf(a,e,t,s){if(Array.isArray(a)){for(var r=0;r<a.length;r++)this.addSchema(a[r],void 0,t,s);return this}var n=this._getId(a);if(n!==void 0&&typeof n!="string")throw new Error("schema id must be string");return e=Jr.normalizeId(e||n),mo(this,e),this._schemas[e]=this._addSchema(a,t,s,!0),this}function tf(a,e,t){return this.addSchema(a,e,t,!0),this}function af(a,e){var t=a.$schema;if(t!==void 0&&typeof t!="string")throw new Error("$schema must be a string");if(t=t||this._opts.defaultMeta||sf(this),!t)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var s=this.validate(t,a);if(!s&&e){var r="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(r);else throw new Error(r)}return s}function sf(a){var e=a._opts.meta;return a._opts.defaultMeta=typeof e=="object"?a._getId(e)||e:a.getSchema(ca)?ca:void 0,a._opts.defaultMeta}function nf(a){var e=ho(this,a);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return of(this,a)}}function of(a,e){var t=Jr.schema.call(a,{schema:{}},e);if(t){var s=t.schema,r=t.root,n=t.baseId,l=lo.call(a,s,r,void 0,n);return a._fragments[e]=new co({ref:e,fragment:!0,schema:s,root:r,baseId:n,validate:l}),l}}function ho(a,e){return e=Jr.normalizeId(e),a._schemas[e]||a._refs[e]||a._fragments[e]}function lf(a){if(a instanceof RegExp)return la(this,this._schemas,a),la(this,this._refs,a),this;switch(typeof a){case"undefined":return la(this,this._schemas),la(this,this._refs),this._cache.clear(),this;case"string":var e=ho(this,a);return e&&this._cache.del(e.cacheKey),delete this._schemas[a],delete this._refs[a],this;case"object":var t=this._opts.serialize,s=t?t(a):a;this._cache.del(s);var r=this._getId(a);r&&(r=Jr.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this}function la(a,e,t){for(var s in e){var r=e[s];!r.meta&&(!t||t.test(s))&&(a._cache.del(r.cacheKey),delete e[s])}}function cf(a,e,t,s){if(typeof a!="object"&&typeof a!="boolean")throw new Error("schema should be object or boolean");var r=this._opts.serialize,n=r?r(a):a,l=this._cache.get(n);if(l)return l;s=s||this._opts.addUsedSchema!==!1;var o=Jr.normalizeId(this._getId(a));o&&s&&mo(this,o);var d=this._opts.validateSchema!==!1&&!e,f;d&&!(f=o&&o==Jr.normalizeId(a.$schema))&&this.validateSchema(a,!0);var p=Jr.ids.call(this,a),m=new co({id:o,schema:a,localRefs:p,cacheKey:n,meta:t});return o[0]!="#"&&s&&(this._refs[o]=m),this._cache.put(n,m),d&&f&&this.validateSchema(a,!0),m}function uf(a,e){if(a.compiling)return a.validate=r,r.schema=a.schema,r.errors=null,r.root=e||r,a.schema.$async===!0&&(r.$async=!0),r;a.compiling=!0;var t;a.meta&&(t=this._opts,this._opts=this._metaOpts);var s;try{s=lo.call(this,a.schema,e,a.localRefs)}catch(n){throw delete a.validate,n}finally{a.compiling=!1,a.meta&&(this._opts=t)}return a.validate=s,a.refs=s.refs,a.refVal=s.refVal,a.root=s.root,s;function r(){var n=a.validate,l=n.apply(this,arguments);return r.errors=n.errors,l}}function df(a){switch(a.schemaId){case"auto":return hf;case"id":return ff;default:return pf}}function ff(a){return a.$id&&this.logger.warn("schema $id ignored",a.$id),a.id}function pf(a){return a.id&&this.logger.warn("schema id ignored",a.id),a.$id}function hf(a){if(a.$id&&a.id&&a.$id!=a.id)throw new Error("schema $id is different from id");return a.$id||a.id}function mf(a,e){if(a=a||this.errors,!a)return"No errors";e=e||{};for(var t=e.separator===void 0?", ":e.separator,s=e.dataVar===void 0?"data":e.dataVar,r="",n=0;n<a.length;n++){var l=a[n];l&&(r+=s+l.dataPath+" "+l.message+t)}return r.slice(0,-t.length)}function vf(a,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[a]=e,this}function gf(a){var e;if(a._opts.$data&&(e=io(),a.addMetaSchema(e,e.$id,!0)),a._opts.meta!==!1){var t=fs();a._opts.$data&&(t=uo(t,Yd)),a.addMetaSchema(t,ca,!0),a._refs["http://json-schema.org/schema"]=ca}}function yf(a){var e=a._opts.schemas;if(e)if(Array.isArray(e))a.addSchema(e);else for(var t in e)a.addSchema(e[t],t)}function _f(a){for(var e in a._opts.formats){var t=a._opts.formats[e];a.addFormat(e,t)}}function bf(a){for(var e in a._opts.keywords){var t=a._opts.keywords[e];a.addKeyword(e,t)}}function mo(a,e){if(a._schemas[e]||a._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function Ef(a){for(var e=fo.copy(a._opts),t=0;t<oo.length;t++)delete e[oo[t]];return e}function xf(a){var e=a._opts.logger;if(e===!1)a.logger={log:hs,warn:hs,error:hs};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");a.logger=e}}function hs(){}});var i={};jl(i,{BRAND:()=>cc,DIRTY:()=>Cr,EMPTY_PATH:()=>Ul,INVALID:()=>Z,NEVER:()=>Qc,OK:()=>Re,ParseStatus:()=>Pe,Schema:()=>J,ZodAny:()=>xr,ZodArray:()=>gr,ZodBigInt:()=>Nr,ZodBoolean:()=>jr,ZodBranded:()=>bt,ZodCatch:()=>Qr,ZodDate:()=>Fr,ZodDefault:()=>Br,ZodDiscriminatedUnion:()=>Nt,ZodEffects:()=>Qe,ZodEnum:()=>Hr,ZodError:()=>Ce,ZodFirstPartyTypeKind:()=>R,ZodFunction:()=>Ft,ZodIntersection:()=>Ur,ZodIssueCode:()=>w,ZodLazy:()=>Vr,ZodLiteral:()=>zr,ZodMap:()=>ct,ZodNaN:()=>dt,ZodNativeEnum:()=>Zr,ZodNever:()=>Ge,ZodNull:()=>Mr,ZodNullable:()=>or,ZodNumber:()=>kr,ZodObject:()=>ke,ZodOptional:()=>Ze,ZodParsedType:()=>N,ZodPipeline:()=>Et,ZodPromise:()=>Sr,ZodReadonly:()=>Wr,ZodRecord:()=>jt,ZodSchema:()=>J,ZodSet:()=>ut,ZodString:()=>Er,ZodSymbol:()=>ot,ZodTransformer:()=>Qe,ZodTuple:()=>ir,ZodType:()=>J,ZodUndefined:()=>Lr,ZodUnion:()=>qr,ZodUnknown:()=>vr,ZodVoid:()=>lt,addIssueToContext:()=>k,any:()=>yc,array:()=>xc,bigint:()=>pc,boolean:()=>Ks,coerce:()=>Bc,custom:()=>Bs,date:()=>hc,datetimeRegex:()=>Hs,defaultErrorMap:()=>hr,discriminatedUnion:()=>Oc,effect:()=>Lc,enum:()=>Nc,function:()=>$c,getErrorMap:()=>st,getParsedType:()=>nr,instanceof:()=>dc,intersection:()=>Rc,isAborted:()=>Ct,isAsync:()=>nt,isDirty:()=>kt,isValid:()=>br,late:()=>uc,lazy:()=>Cc,literal:()=>kc,makeIssue:()=>_t,map:()=>Dc,nan:()=>fc,nativeEnum:()=>jc,never:()=>bc,null:()=>gc,nullable:()=>qc,number:()=>Ws,object:()=>Sc,objectUtil:()=>Ta,oboolean:()=>Zc,onumber:()=>Hc,optional:()=>Mc,ostring:()=>zc,pipeline:()=>Vc,preprocess:()=>Uc,promise:()=>Fc,quotelessJson:()=>Ll,record:()=>Ac,set:()=>Ic,setErrorMap:()=>ql,strictObject:()=>Pc,string:()=>Qs,symbol:()=>mc,transformer:()=>Lc,tuple:()=>Tc,undefined:()=>vc,union:()=>wc,unknown:()=>_c,util:()=>X,void:()=>Ec});var X;(function(a){a.assertEqual=r=>{};function e(r){}a.assertIs=e;function t(r){throw new Error}a.assertNever=t,a.arrayToEnum=r=>{let n={};for(let l of r)n[l]=l;return n},a.getValidEnumValues=r=>{let n=a.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),l={};for(let o of n)l[o]=r[o];return a.objectValues(l)},a.objectValues=r=>a.objectKeys(r).map(function(n){return r[n]}),a.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let n=[];for(let l in r)Object.prototype.hasOwnProperty.call(r,l)&&n.push(l);return n},a.find=(r,n)=>{for(let l of r)if(n(l))return l},a.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(n)}a.joinValues=s,a.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(X||(X={}));var Ta;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(Ta||(Ta={}));var N=X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=a=>{switch(typeof a){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(a)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(a)?N.array:a===null?N.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?N.promise:typeof Map<"u"&&a instanceof Map?N.map:typeof Set<"u"&&a instanceof Set?N.set:typeof Date<"u"&&a instanceof Date?N.date:N.object;default:return N.unknown}};var w=X.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"]),Ll=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),Ce=class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},s={_errors:[]},r=n=>{for(let l of n.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)s._errors.push(t(l));else{let o=s,d=0;for(;d<l.path.length;){let f=l.path[d];d===l.path.length-1?(o[f]=o[f]||{_errors:[]},o[f]._errors.push(t(l))):o[f]=o[f]||{_errors:[]},o=o[f],d++}}};return r(this),s}static assert(e){if(!(e instanceof a))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,X.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};Ce.create=a=>new Ce(a);var Ml=(a,e)=>{let t;switch(a.code){case w.invalid_type:a.received===N.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case w.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,X.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:t=`Unrecognized key(s) in object: ${X.joinValues(a.keys,", ")}`;break;case w.invalid_union:t="Invalid input";break;case w.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${X.joinValues(a.options)}`;break;case w.invalid_enum_value:t=`Invalid enum value. Expected ${X.joinValues(a.options)}, received '${a.received}'`;break;case w.invalid_arguments:t="Invalid function arguments";break;case w.invalid_return_type:t="Invalid function return type";break;case w.invalid_date:t="Invalid date";break;case w.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:X.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case w.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case w.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case w.custom:t="Invalid input";break;case w.invalid_intersection_types:t="Intersection results could not be merged";break;case w.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case w.not_finite:t="Number must be finite";break;default:t=e.defaultError,X.assertNever(a)}return{message:t}},hr=Ml;var Ms=hr;function ql(a){Ms=a}function st(){return Ms}var _t=a=>{let{data:e,path:t,errorMaps:s,issueData:r}=a,n=[...t,...r.path||[]],l={...r,path:n};if(r.message!==void 0)return{...r,path:n,message:r.message};let o="",d=s.filter(f=>!!f).slice().reverse();for(let f of d)o=f(l,{data:e,defaultError:o}).message;return{...r,path:n,message:o}},Ul=[];function k(a,e){let t=st(),s=_t({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===hr?void 0:hr].filter(r=>!!r)});a.common.issues.push(s)}var Pe=class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let r of t){if(r.status==="aborted")return Z;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let r of t){let n=await r.key,l=await r.value;s.push({key:n,value:l})}return a.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let r of t){let{key:n,value:l}=r;if(n.status==="aborted"||l.status==="aborted")return Z;n.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(s[n.value]=l.value)}return{status:e.value,value:s}}},Z=Object.freeze({status:"aborted"}),Cr=a=>({status:"dirty",value:a}),Re=a=>({status:"valid",value:a}),Ct=a=>a.status==="aborted",kt=a=>a.status==="dirty",br=a=>a.status==="valid",nt=a=>typeof Promise<"u"&&a instanceof Promise;var V;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var Be=class{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}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}},qs=(a,e)=>{if(br(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 t=new Ce(a.common.issues);return this._error=t,this._error}}};function W(a){if(!a)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:r}=a;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,o)=>{let{message:d}=a;return l.code==="invalid_enum_value"?{message:d??o.defaultError}:typeof o.data>"u"?{message:d??s??o.defaultError}:l.code!=="invalid_type"?{message:o.defaultError}:{message:d??t??o.defaultError}},description:r}}var J=class{get description(){return this._def.description}_getType(e){return nr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Pe,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(nt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parseSync({data:e,path:s.path,parent:s});return qs(s,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return br(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>br(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parse({data:e,path:s.path,parent:s}),n=await(nt(r)?r:Promise.resolve(r));return qs(s,n)}refine(e,t){let s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,n)=>{let l=e(r),o=()=>n.addIssue({code:w.custom,...s(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(o(),!1)):l?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new Qe({schema:this,typeName:R.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:t=>this["~validate"](t)}}optional(){return Ze.create(this,this._def)}nullable(){return or.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gr.create(this)}promise(){return Sr.create(this,this._def)}or(e){return qr.create([this,e],this._def)}and(e){return Ur.create(this,e,this._def)}transform(e){return new Qe({...W(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Br({...W(this._def),innerType:this,defaultValue:t,typeName:R.ZodDefault})}brand(){return new bt({typeName:R.ZodBranded,type:this,...W(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Qr({...W(this._def),innerType:this,catchValue:t,typeName:R.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Et.create(this,e)}readonly(){return Wr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vl=/^c[^\s-]{8,}$/i,zl=/^[0-9a-z]+$/,Hl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Zl=/^[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,Bl=/^[a-z0-9_-]{21}$/i,Ql=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Wl=/^[-+]?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)?)??$/,Kl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Aa,Gl=/^(?:(?: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])$/,Yl=/^(?:(?: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])$/,Xl=/^(([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]))$/,ec=/^(([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])$/,rc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vs="((\\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])))",ac=new RegExp(`^${Vs}$`);function zs(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);let t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function sc(a){return new RegExp(`^${zs(a)}$`)}function Hs(a){let e=`${Vs}T${zs(a)}`,t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function nc(a,e){return!!((e==="v4"||!e)&&Gl.test(a)||(e==="v6"||!e)&&Xl.test(a))}function ic(a,e){if(!Ql.test(a))return!1;try{let[t]=a.split(".");if(!t)return!1;let s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(s));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function oc(a,e){return!!((e==="v4"||!e)&&Yl.test(a)||(e==="v6"||!e)&&ec.test(a))}var Er=class a extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==N.string){let n=this._getOrReturnCtx(e);return k(n,{code:w.invalid_type,expected:N.string,received:n.parsedType}),Z}let s=new Pe,r;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:w.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:w.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let l=e.data.length>n.value,o=e.data.length<n.value;(l||o)&&(r=this._getOrReturnCtx(e,r),l?k(r,{code:w.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&k(r,{code:w.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")Kl.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"email",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")Aa||(Aa=new RegExp(Jl,"u")),Aa.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"emoji",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")Zl.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"uuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")Bl.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"nanoid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")Vl.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")zl.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid2",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Hl.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ulid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),k(r,{validation:"url",code:w.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"regex",code:w.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),k(r,{code:w.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:w.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:w.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?Hs(n).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:w.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?ac.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:w.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?sc(n).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:w.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?Wl.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"duration",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?nc(e.data,n.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ip",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?ic(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"jwt",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?oc(e.data,n.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cidr",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?rc.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?tc.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64url",code:w.invalid_string,message:n.message}),s.dirty()):X.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:w.invalid_string,...V.errToObj(s)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.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,...V.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,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...V.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...V.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...V.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...V.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...V.errToObj(t)})}nonempty(e){return this.min(1,V.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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Er.create=a=>new Er({checks:[],typeName:R.ZodString,coerce:a?.coerce??!1,...W(a)});function lc(a,e){let t=(a.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,n=Number.parseInt(a.toFixed(r).replace(".","")),l=Number.parseInt(e.toFixed(r).replace(".",""));return n%l/10**r}var kr=class a extends J{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)!==N.number){let n=this._getOrReturnCtx(e);return k(n,{code:w.invalid_type,expected:N.number,received:n.parsedType}),Z}let s,r=new Pe;for(let n of this._def.checks)n.kind==="int"?X.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),k(s,{code:w.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:w.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:w.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="multipleOf"?lc(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),k(s,{code:w.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),k(s,{code:w.not_finite,message:n.message}),r.dirty()):X.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&X.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};kr.create=a=>new kr({checks:[],typeName:R.ZodNumber,coerce:a?.coerce||!1,...W(a)});var Nr=class a extends J{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)!==N.bigint)return this._getInvalidInput(e);let s,r=new Pe;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:w.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:w.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),k(s,{code:w.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):X.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return k(t,{code:w.invalid_type,expected:N.bigint,received:t.parsedType}),Z}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.toString(r)}]})}_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:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Nr.create=a=>new Nr({checks:[],typeName:R.ZodBigInt,coerce:a?.coerce??!1,...W(a)});var jr=class extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==N.boolean){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.boolean,received:s.parsedType}),Z}return Re(e.data)}};jr.create=a=>new jr({typeName:R.ZodBoolean,coerce:a?.coerce||!1,...W(a)});var Fr=class a extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==N.date){let n=this._getOrReturnCtx(e);return k(n,{code:w.invalid_type,expected:N.date,received:n.parsedType}),Z}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return k(n,{code:w.invalid_date}),Z}let s=new Pe,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:w.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:w.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):X.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Fr.create=a=>new Fr({checks:[],coerce:a?.coerce||!1,typeName:R.ZodDate,...W(a)});var ot=class extends J{_parse(e){if(this._getType(e)!==N.symbol){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.symbol,received:s.parsedType}),Z}return Re(e.data)}};ot.create=a=>new ot({typeName:R.ZodSymbol,...W(a)});var Lr=class extends J{_parse(e){if(this._getType(e)!==N.undefined){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.undefined,received:s.parsedType}),Z}return Re(e.data)}};Lr.create=a=>new Lr({typeName:R.ZodUndefined,...W(a)});var Mr=class extends J{_parse(e){if(this._getType(e)!==N.null){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.null,received:s.parsedType}),Z}return Re(e.data)}};Mr.create=a=>new Mr({typeName:R.ZodNull,...W(a)});var xr=class extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return Re(e.data)}};xr.create=a=>new xr({typeName:R.ZodAny,...W(a)});var vr=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Re(e.data)}};vr.create=a=>new vr({typeName:R.ZodUnknown,...W(a)});var Ge=class extends J{_parse(e){let t=this._getOrReturnCtx(e);return k(t,{code:w.invalid_type,expected:N.never,received:t.parsedType}),Z}};Ge.create=a=>new Ge({typeName:R.ZodNever,...W(a)});var lt=class extends J{_parse(e){if(this._getType(e)!==N.undefined){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.void,received:s.parsedType}),Z}return Re(e.data)}};lt.create=a=>new lt({typeName:R.ZodVoid,...W(a)});var gr=class a extends J{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==N.array)return k(t,{code:w.invalid_type,expected:N.array,received:t.parsedType}),Z;if(r.exactLength!==null){let l=t.data.length>r.exactLength.value,o=t.data.length<r.exactLength.value;(l||o)&&(k(t,{code:l?w.too_big:w.too_small,minimum:o?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(k(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(k(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((l,o)=>r.type._parseAsync(new Be(t,l,t.path,o)))).then(l=>Pe.mergeArray(s,l));let n=[...t.data].map((l,o)=>r.type._parseSync(new Be(t,l,t.path,o)));return Pe.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new a({...this._def,minLength:{value:e,message:V.toString(t)}})}max(e,t){return new a({...this._def,maxLength:{value:e,message:V.toString(t)}})}length(e,t){return new a({...this._def,exactLength:{value:e,message:V.toString(t)}})}nonempty(e){return this.min(1,e)}};gr.create=(a,e)=>new gr({type:a,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...W(e)});function it(a){if(a instanceof ke){let e={};for(let t in a.shape){let s=a.shape[t];e[t]=Ze.create(it(s))}return new ke({...a._def,shape:()=>e})}else return a instanceof gr?new gr({...a._def,type:it(a.element)}):a instanceof Ze?Ze.create(it(a.unwrap())):a instanceof or?or.create(it(a.unwrap())):a instanceof ir?ir.create(a.items.map(e=>it(e))):a}var ke=class a extends J{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(),t=X.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==N.object){let f=this._getOrReturnCtx(e);return k(f,{code:w.invalid_type,expected:N.object,received:f.parsedType}),Z}let{status:s,ctx:r}=this._processInputParams(e),{shape:n,keys:l}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ge&&this._def.unknownKeys==="strip"))for(let f in r.data)l.includes(f)||o.push(f);let d=[];for(let f of l){let p=n[f],m=r.data[f];d.push({key:{status:"valid",value:f},value:p._parse(new Be(r,m,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof Ge){let f=this._def.unknownKeys;if(f==="passthrough")for(let p of o)d.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(f==="strict")o.length>0&&(k(r,{code:w.unrecognized_keys,keys:o}),s.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let p of o){let m=r.data[p];d.push({key:{status:"valid",value:p},value:f._parse(new Be(r,m,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let f=[];for(let p of d){let m=await p.key,b=await p.value;f.push({key:m,value:b,alwaysSet:p.alwaysSet})}return f}).then(f=>Pe.mergeObjectSync(s,f)):Pe.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let r=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:V.errToObj(e).message??r}:{message:r}}}:{}})}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:R.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new a({...this._def,catchall:e})}pick(e){let t={};for(let s of X.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new a({...this._def,shape:()=>t})}omit(e){let t={};for(let s of X.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new a({...this._def,shape:()=>t})}deepPartial(){return it(this)}partial(e){let t={};for(let s of X.objectKeys(this.shape)){let r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}return new a({...this._def,shape:()=>t})}required(e){let t={};for(let s of X.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Ze;)n=n._def.innerType;t[s]=n}return new a({...this._def,shape:()=>t})}keyof(){return Zs(X.objectKeys(this.shape))}};ke.create=(a,e)=>new ke({shape:()=>a,unknownKeys:"strip",catchall:Ge.create(),typeName:R.ZodObject,...W(e)});ke.strictCreate=(a,e)=>new ke({shape:()=>a,unknownKeys:"strict",catchall:Ge.create(),typeName:R.ZodObject,...W(e)});ke.lazycreate=(a,e)=>new ke({shape:a,unknownKeys:"strip",catchall:Ge.create(),typeName:R.ZodObject,...W(e)});var qr=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function r(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let l=n.map(o=>new Ce(o.ctx.common.issues));return k(t,{code:w.invalid_union,unionErrors:l}),Z}if(t.common.async)return Promise.all(s.map(async n=>{let l={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let n,l=[];for(let d of s){let f={...t,common:{...t.common,issues:[]},parent:null},p=d._parseSync({data:t.data,path:t.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!n&&(n={result:p,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let o=l.map(d=>new Ce(d));return k(t,{code:w.invalid_union,unionErrors:o}),Z}}get options(){return this._def.options}};qr.create=(a,e)=>new qr({options:a,typeName:R.ZodUnion,...W(e)});var mr=a=>a instanceof Vr?mr(a.schema):a instanceof Qe?mr(a.innerType()):a instanceof zr?[a.value]:a instanceof Hr?a.options:a instanceof Zr?X.objectValues(a.enum):a instanceof Br?mr(a._def.innerType):a instanceof Lr?[void 0]:a instanceof Mr?[null]:a instanceof Ze?[void 0,...mr(a.unwrap())]:a instanceof or?[null,...mr(a.unwrap())]:a instanceof bt||a instanceof Wr?mr(a.unwrap()):a instanceof Qr?mr(a._def.innerType):[],Nt=class a extends J{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.object)return k(t,{code:w.invalid_type,expected:N.object,received:t.parsedType}),Z;let s=this.discriminator,r=t.data[s],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(k(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let r=new Map;for(let n of t){let l=mr(n.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of l){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,n)}}return new a({typeName:R.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...W(s)})}};function Da(a,e){let t=nr(a),s=nr(e);if(a===e)return{valid:!0,data:a};if(t===N.object&&s===N.object){let r=X.objectKeys(e),n=X.objectKeys(a).filter(o=>r.indexOf(o)!==-1),l={...a,...e};for(let o of n){let d=Da(a[o],e[o]);if(!d.valid)return{valid:!1};l[o]=d.data}return{valid:!0,data:l}}else if(t===N.array&&s===N.array){if(a.length!==e.length)return{valid:!1};let r=[];for(let n=0;n<a.length;n++){let l=a[n],o=e[n],d=Da(l,o);if(!d.valid)return{valid:!1};r.push(d.data)}return{valid:!0,data:r}}else return t===N.date&&s===N.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}var Ur=class extends J{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=(n,l)=>{if(Ct(n)||Ct(l))return Z;let o=Da(n.value,l.value);return o.valid?((kt(n)||kt(l))&&t.dirty(),{status:t.value,value:o.data}):(k(s,{code:w.invalid_intersection_types}),Z)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,l])=>r(n,l)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};Ur.create=(a,e,t)=>new Ur({left:a,right:e,typeName:R.ZodIntersection,...W(t)});var ir=class a extends J{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==N.array)return k(s,{code:w.invalid_type,expected:N.array,received:s.parsedType}),Z;if(s.data.length<this._def.items.length)return k(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Z;!this._def.rest&&s.data.length>this._def.items.length&&(k(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((l,o)=>{let d=this._def.items[o]||this._def.rest;return d?d._parse(new Be(s,l,s.path,o)):null}).filter(l=>!!l);return s.common.async?Promise.all(n).then(l=>Pe.mergeArray(t,l)):Pe.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};ir.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ir({items:a,typeName:R.ZodTuple,rest:null,...W(e)})};var jt=class a extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==N.object)return k(s,{code:w.invalid_type,expected:N.object,received:s.parsedType}),Z;let r=[],n=this._def.keyType,l=this._def.valueType;for(let o in s.data)r.push({key:n._parse(new Be(s,o,s.path,o)),value:l._parse(new Be(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?Pe.mergeObjectAsync(t,r):Pe.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof J?new a({keyType:e,valueType:t,typeName:R.ZodRecord,...W(s)}):new a({keyType:Er.create(),valueType:e,typeName:R.ZodRecord,...W(t)})}},ct=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==N.map)return k(s,{code:w.invalid_type,expected:N.map,received:s.parsedType}),Z;let r=this._def.keyType,n=this._def.valueType,l=[...s.data.entries()].map(([o,d],f)=>({key:r._parse(new Be(s,o,s.path,[f,"key"])),value:n._parse(new Be(s,d,s.path,[f,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let d of l){let f=await d.key,p=await d.value;if(f.status==="aborted"||p.status==="aborted")return Z;(f.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(f.value,p.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let d of l){let f=d.key,p=d.value;if(f.status==="aborted"||p.status==="aborted")return Z;(f.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(f.value,p.value)}return{status:t.value,value:o}}}};ct.create=(a,e,t)=>new ct({valueType:e,keyType:a,typeName:R.ZodMap,...W(t)});var ut=class a extends J{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==N.set)return k(s,{code:w.invalid_type,expected:N.set,received:s.parsedType}),Z;let r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(k(s,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(k(s,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let n=this._def.valueType;function l(d){let f=new Set;for(let p of d){if(p.status==="aborted")return Z;p.status==="dirty"&&t.dirty(),f.add(p.value)}return{status:t.value,value:f}}let o=[...s.data.values()].map((d,f)=>n._parse(new Be(s,d,s.path,f)));return s.common.async?Promise.all(o).then(d=>l(d)):l(o)}min(e,t){return new a({...this._def,minSize:{value:e,message:V.toString(t)}})}max(e,t){return new a({...this._def,maxSize:{value:e,message:V.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ut.create=(a,e)=>new ut({valueType:a,minSize:null,maxSize:null,typeName:R.ZodSet,...W(e)});var Ft=class a extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.function)return k(t,{code:w.invalid_type,expected:N.function,received:t.parsedType}),Z;function s(o,d){return _t({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,st(),hr].filter(f=>!!f),issueData:{code:w.invalid_arguments,argumentsError:d}})}function r(o,d){return _t({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,st(),hr].filter(f=>!!f),issueData:{code:w.invalid_return_type,returnTypeError:d}})}let n={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Sr){let o=this;return Re(async function(...d){let f=new Ce([]),p=await o._def.args.parseAsync(d,n).catch(c=>{throw f.addIssue(s(d,c)),f}),m=await Reflect.apply(l,this,p);return await o._def.returns._def.type.parseAsync(m,n).catch(c=>{throw f.addIssue(r(m,c)),f})})}else{let o=this;return Re(function(...d){let f=o._def.args.safeParse(d,n);if(!f.success)throw new Ce([s(d,f.error)]);let p=Reflect.apply(l,this,f.data),m=o._def.returns.safeParse(p,n);if(!m.success)throw new Ce([r(p,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:ir.create(e).rest(vr.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,t,s){return new a({args:e||ir.create([]).rest(vr.create()),returns:t||vr.create(),typeName:R.ZodFunction,...W(s)})}},Vr=class extends J{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Vr.create=(a,e)=>new Vr({getter:a,typeName:R.ZodLazy,...W(e)});var zr=class extends J{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),Z}return{status:"valid",value:e.data}}get value(){return this._def.value}};zr.create=(a,e)=>new zr({value:a,typeName:R.ZodLiteral,...W(e)});function Zs(a,e){return new Hr({values:a,typeName:R.ZodEnum,...W(e)})}var Hr=class a extends J{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return k(t,{expected:X.joinValues(s),received:t.parsedType,code:w.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return k(t,{received:t.data,code:w.invalid_enum_value,options:s}),Z}return Re(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return a.create(e,{...this._def,...t})}exclude(e,t=this._def){return a.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};Hr.create=Zs;var Zr=class extends J{_parse(e){let t=X.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==N.string&&s.parsedType!==N.number){let r=X.objectValues(t);return k(s,{expected:X.joinValues(r),received:s.parsedType,code:w.invalid_type}),Z}if(this._cache||(this._cache=new Set(X.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=X.objectValues(t);return k(s,{received:s.data,code:w.invalid_enum_value,options:r}),Z}return Re(e.data)}get enum(){return this._def.values}};Zr.create=(a,e)=>new Zr({values:a,typeName:R.ZodNativeEnum,...W(e)});var Sr=class extends J{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.promise&&t.common.async===!1)return k(t,{code:w.invalid_type,expected:N.promise,received:t.parsedType}),Z;let s=t.parsedType===N.promise?t.data:Promise.resolve(t.data);return Re(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Sr.create=(a,e)=>new Sr({type:a,typeName:R.ZodPromise,...W(e)});var Qe=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:l=>{k(s,l),l.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),r.type==="preprocess"){let l=r.transform(s.data,n);if(s.common.async)return Promise.resolve(l).then(async o=>{if(t.value==="aborted")return Z;let d=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return d.status==="aborted"?Z:d.status==="dirty"?Cr(d.value):t.value==="dirty"?Cr(d.value):d});{if(t.value==="aborted")return Z;let o=this._def.schema._parseSync({data:l,path:s.path,parent:s});return o.status==="aborted"?Z:o.status==="dirty"?Cr(o.value):t.value==="dirty"?Cr(o.value):o}}if(r.type==="refinement"){let l=o=>{let d=r.refinement(o,n);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?Z:(o.status==="dirty"&&t.dirty(),l(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?Z:(o.status==="dirty"&&t.dirty(),l(o.value).then(()=>({status:t.value,value:o.value}))))}if(r.type==="transform")if(s.common.async===!1){let l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!br(l))return Z;let o=r.transform(l.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>br(l)?Promise.resolve(r.transform(l.value,n)).then(o=>({status:t.value,value:o})):Z);X.assertNever(r)}};Qe.create=(a,e,t)=>new Qe({schema:a,typeName:R.ZodEffects,effect:e,...W(t)});Qe.createWithPreprocess=(a,e,t)=>new Qe({schema:e,effect:{type:"preprocess",transform:a},typeName:R.ZodEffects,...W(t)});var Ze=class extends J{_parse(e){return this._getType(e)===N.undefined?Re(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ze.create=(a,e)=>new Ze({innerType:a,typeName:R.ZodOptional,...W(e)});var or=class extends J{_parse(e){return this._getType(e)===N.null?Re(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};or.create=(a,e)=>new or({innerType:a,typeName:R.ZodNullable,...W(e)});var Br=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===N.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Br.create=(a,e)=>new Br({innerType:a,typeName:R.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...W(e)});var Qr=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return nt(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ce(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ce(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Qr.create=(a,e)=>new Qr({innerType:a,typeName:R.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...W(e)});var dt=class extends J{_parse(e){if(this._getType(e)!==N.nan){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.nan,received:s.parsedType}),Z}return{status:"valid",value:e.data}}};dt.create=a=>new dt({typeName:R.ZodNaN,...W(a)});var cc=Symbol("zod_brand"),bt=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},Et=class a extends J{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Z:n.status==="dirty"?(t.dirty(),Cr(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?Z:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new a({in:e,out:t,typeName:R.ZodPipeline})}},Wr=class extends J{_parse(e){let t=this._def.innerType._parse(e),s=r=>(br(r)&&(r.value=Object.freeze(r.value)),r);return nt(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}};Wr.create=(a,e)=>new Wr({innerType:a,typeName:R.ZodReadonly,...W(e)});function Us(a,e){let t=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof t=="string"?{message:t}:t}function Bs(a,e={},t){return a?xr.create().superRefine((s,r)=>{let n=a(s);if(n instanceof Promise)return n.then(l=>{if(!l){let o=Us(e,s),d=o.fatal??t??!0;r.addIssue({code:"custom",...o,fatal:d})}});if(!n){let l=Us(e,s),o=l.fatal??t??!0;r.addIssue({code:"custom",...l,fatal:o})}}):xr.create()}var uc={object:ke.lazycreate},R;(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"})(R||(R={}));var dc=(a,e={message:`Input not instance of ${a.name}`})=>Bs(t=>t instanceof a,e),Qs=Er.create,Ws=kr.create,fc=dt.create,pc=Nr.create,Ks=jr.create,hc=Fr.create,mc=ot.create,vc=Lr.create,gc=Mr.create,yc=xr.create,_c=vr.create,bc=Ge.create,Ec=lt.create,xc=gr.create,Sc=ke.create,Pc=ke.strictCreate,wc=qr.create,Oc=Nt.create,Rc=Ur.create,Tc=ir.create,Ac=jt.create,Dc=ct.create,Ic=ut.create,$c=Ft.create,Cc=Vr.create,kc=zr.create,Nc=Hr.create,jc=Zr.create,Fc=Sr.create,Lc=Qe.create,Mc=Ze.create,qc=or.create,Uc=Qe.createWithPreprocess,Vc=Et.create,zc=()=>Qs().optional(),Hc=()=>Ws().optional(),Zc=()=>Ks().optional(),Bc={string:(a=>Er.create({...a,coerce:!0})),number:(a=>kr.create({...a,coerce:!0})),boolean:(a=>jr.create({...a,coerce:!0})),bigint:(a=>Nr.create({...a,coerce:!0})),date:(a=>Fr.create({...a,coerce:!0}))};var Qc=Z;var Ia="2025-06-18";var Js=[Ia,"2025-03-26","2024-11-05","2024-10-07"],Lt="2.0",Gs=i.union([i.string(),i.number().int()]),Ys=i.string(),Wc=i.object({progressToken:i.optional(Gs)}).passthrough(),We=i.object({_meta:i.optional(Wc)}).passthrough(),Ne=i.object({method:i.string(),params:i.optional(We)}),xt=i.object({_meta:i.optional(i.object({}).passthrough())}).passthrough(),lr=i.object({method:i.string(),params:i.optional(xt)}),Ke=i.object({_meta:i.optional(i.object({}).passthrough())}).passthrough(),Mt=i.union([i.string(),i.number().int()]),Xs=i.object({jsonrpc:i.literal(Lt),id:Mt}).merge(Ne).strict(),en=a=>Xs.safeParse(a).success,rn=i.object({jsonrpc:i.literal(Lt)}).merge(lr).strict(),tn=a=>rn.safeParse(a).success,an=i.object({jsonrpc:i.literal(Lt),id:Mt,result:Ke}).strict(),$a=a=>an.safeParse(a).success,Ye;(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"})(Ye||(Ye={}));var sn=i.object({jsonrpc:i.literal(Lt),id:Mt,error:i.object({code:i.number().int(),message:i.string(),data:i.optional(i.unknown())})}).strict(),nn=a=>sn.safeParse(a).success,on=i.union([Xs,rn,an,sn]),qt=Ke.strict(),Ut=lr.extend({method:i.literal("notifications/cancelled"),params:xt.extend({requestId:Mt,reason:i.string().optional()})}),Kc=i.object({src:i.string(),mimeType:i.optional(i.string()),sizes:i.optional(i.array(i.string()))}).passthrough(),St=i.object({icons:i.array(Kc).optional()}).passthrough(),Pt=i.object({name:i.string(),title:i.optional(i.string())}).passthrough(),ln=Pt.extend({version:i.string(),websiteUrl:i.optional(i.string())}).merge(St),Jc=i.object({experimental:i.optional(i.object({}).passthrough()),sampling:i.optional(i.object({}).passthrough()),elicitation:i.optional(i.object({}).passthrough()),roots:i.optional(i.object({listChanged:i.optional(i.boolean())}).passthrough())}).passthrough(),Ca=Ne.extend({method:i.literal("initialize"),params:We.extend({protocolVersion:i.string(),capabilities:Jc,clientInfo:ln})});var Gc=i.object({experimental:i.optional(i.object({}).passthrough()),logging:i.optional(i.object({}).passthrough()),completions:i.optional(i.object({}).passthrough()),prompts:i.optional(i.object({listChanged:i.optional(i.boolean())}).passthrough()),resources:i.optional(i.object({subscribe:i.optional(i.boolean()),listChanged:i.optional(i.boolean())}).passthrough()),tools:i.optional(i.object({listChanged:i.optional(i.boolean())}).passthrough())}).passthrough(),Yc=Ke.extend({protocolVersion:i.string(),capabilities:Gc,serverInfo:ln,instructions:i.optional(i.string())}),ka=lr.extend({method:i.literal("notifications/initialized")});var Vt=Ne.extend({method:i.literal("ping")}),Xc=i.object({progress:i.number(),total:i.optional(i.number()),message:i.optional(i.string())}).passthrough(),zt=lr.extend({method:i.literal("notifications/progress"),params:xt.merge(Xc).extend({progressToken:Gs})}),Ht=Ne.extend({params:We.extend({cursor:i.optional(Ys)}).optional()}),Zt=Ke.extend({nextCursor:i.optional(Ys)}),cn=i.object({uri:i.string(),mimeType:i.optional(i.string()),_meta:i.optional(i.object({}).passthrough())}).passthrough(),un=cn.extend({text:i.string()}),Na=i.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),dn=cn.extend({blob:Na}),fn=Pt.extend({uri:i.string(),description:i.optional(i.string()),mimeType:i.optional(i.string()),_meta:i.optional(i.object({}).passthrough())}).merge(St),eu=Pt.extend({uriTemplate:i.string(),description:i.optional(i.string()),mimeType:i.optional(i.string()),_meta:i.optional(i.object({}).passthrough())}).merge(St),ru=Ht.extend({method:i.literal("resources/list")}),tu=Zt.extend({resources:i.array(fn)}),au=Ht.extend({method:i.literal("resources/templates/list")}),su=Zt.extend({resourceTemplates:i.array(eu)}),nu=Ne.extend({method:i.literal("resources/read"),params:We.extend({uri:i.string()})}),iu=Ke.extend({contents:i.array(i.union([un,dn]))}),ou=lr.extend({method:i.literal("notifications/resources/list_changed")}),lu=Ne.extend({method:i.literal("resources/subscribe"),params:We.extend({uri:i.string()})}),cu=Ne.extend({method:i.literal("resources/unsubscribe"),params:We.extend({uri:i.string()})}),uu=lr.extend({method:i.literal("notifications/resources/updated"),params:xt.extend({uri:i.string()})}),du=i.object({name:i.string(),description:i.optional(i.string()),required:i.optional(i.boolean())}).passthrough(),fu=Pt.extend({description:i.optional(i.string()),arguments:i.optional(i.array(du)),_meta:i.optional(i.object({}).passthrough())}).merge(St),pu=Ht.extend({method:i.literal("prompts/list")}),hu=Zt.extend({prompts:i.array(fu)}),mu=Ne.extend({method:i.literal("prompts/get"),params:We.extend({name:i.string(),arguments:i.optional(i.record(i.string()))})}),ja=i.object({type:i.literal("text"),text:i.string(),_meta:i.optional(i.object({}).passthrough())}).passthrough(),Fa=i.object({type:i.literal("image"),data:Na,mimeType:i.string(),_meta:i.optional(i.object({}).passthrough())}).passthrough(),La=i.object({type:i.literal("audio"),data:Na,mimeType:i.string(),_meta:i.optional(i.object({}).passthrough())}).passthrough(),vu=i.object({type:i.literal("resource"),resource:i.union([un,dn]),_meta:i.optional(i.object({}).passthrough())}).passthrough(),gu=fn.extend({type:i.literal("resource_link")}),pn=i.union([ja,Fa,La,gu,vu]),yu=i.object({role:i.enum(["user","assistant"]),content:pn}).passthrough(),_u=Ke.extend({description:i.optional(i.string()),messages:i.array(yu)}),bu=lr.extend({method:i.literal("notifications/prompts/list_changed")}),Eu=i.object({title:i.optional(i.string()),readOnlyHint:i.optional(i.boolean()),destructiveHint:i.optional(i.boolean()),idempotentHint:i.optional(i.boolean()),openWorldHint:i.optional(i.boolean())}).passthrough(),xu=Pt.extend({description:i.optional(i.string()),inputSchema:i.object({type:i.literal("object"),properties:i.optional(i.object({}).passthrough()),required:i.optional(i.array(i.string()))}).passthrough(),outputSchema:i.optional(i.object({type:i.literal("object"),properties:i.optional(i.object({}).passthrough()),required:i.optional(i.array(i.string()))}).passthrough()),annotations:i.optional(Eu),_meta:i.optional(i.object({}).passthrough())}).merge(St),Ma=Ht.extend({method:i.literal("tools/list")}),Su=Zt.extend({tools:i.array(xu)}),hn=Ke.extend({content:i.array(pn).default([]),structuredContent:i.object({}).passthrough().optional(),isError:i.optional(i.boolean())}),Ep=hn.or(Ke.extend({toolResult:i.unknown()})),qa=Ne.extend({method:i.literal("tools/call"),params:We.extend({name:i.string(),arguments:i.optional(i.record(i.unknown()))})}),Pu=lr.extend({method:i.literal("notifications/tools/list_changed")}),wt=i.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Ua=Ne.extend({method:i.literal("logging/setLevel"),params:We.extend({level:wt})}),wu=lr.extend({method:i.literal("notifications/message"),params:xt.extend({level:wt,logger:i.optional(i.string()),data:i.unknown()})}),Ou=i.object({name:i.string().optional()}).passthrough(),Ru=i.object({hints:i.optional(i.array(Ou)),costPriority:i.optional(i.number().min(0).max(1)),speedPriority:i.optional(i.number().min(0).max(1)),intelligencePriority:i.optional(i.number().min(0).max(1))}).passthrough(),Tu=i.object({role:i.enum(["user","assistant"]),content:i.union([ja,Fa,La])}).passthrough(),Au=Ne.extend({method:i.literal("sampling/createMessage"),params:We.extend({messages:i.array(Tu),systemPrompt:i.optional(i.string()),includeContext:i.optional(i.enum(["none","thisServer","allServers"])),temperature:i.optional(i.number()),maxTokens:i.number().int(),stopSequences:i.optional(i.array(i.string())),metadata:i.optional(i.object({}).passthrough()),modelPreferences:i.optional(Ru)})}),Va=Ke.extend({model:i.string(),stopReason:i.optional(i.enum(["endTurn","stopSequence","maxTokens"]).or(i.string())),role:i.enum(["user","assistant"]),content:i.discriminatedUnion("type",[ja,Fa,La])}),Du=i.object({type:i.literal("boolean"),title:i.optional(i.string()),description:i.optional(i.string()),default:i.optional(i.boolean())}).passthrough(),Iu=i.object({type:i.literal("string"),title:i.optional(i.string()),description:i.optional(i.string()),minLength:i.optional(i.number()),maxLength:i.optional(i.number()),format:i.optional(i.enum(["email","uri","date","date-time"]))}).passthrough(),$u=i.object({type:i.enum(["number","integer"]),title:i.optional(i.string()),description:i.optional(i.string()),minimum:i.optional(i.number()),maximum:i.optional(i.number())}).passthrough(),Cu=i.object({type:i.literal("string"),title:i.optional(i.string()),description:i.optional(i.string()),enum:i.array(i.string()),enumNames:i.optional(i.array(i.string()))}).passthrough(),ku=i.union([Du,Iu,$u,Cu]),Nu=Ne.extend({method:i.literal("elicitation/create"),params:We.extend({message:i.string(),requestedSchema:i.object({type:i.literal("object"),properties:i.record(i.string(),ku),required:i.optional(i.array(i.string()))}).passthrough()})}),za=Ke.extend({action:i.enum(["accept","decline","cancel"]),content:i.optional(i.record(i.string(),i.unknown()))}),ju=i.object({type:i.literal("ref/resource"),uri:i.string()}).passthrough();var Fu=i.object({type:i.literal("ref/prompt"),name:i.string()}).passthrough(),Lu=Ne.extend({method:i.literal("completion/complete"),params:We.extend({ref:i.union([Fu,ju]),argument:i.object({name:i.string(),value:i.string()}).passthrough(),context:i.optional(i.object({arguments:i.optional(i.record(i.string(),i.string()))}))})}),Mu=Ke.extend({completion:i.object({values:i.array(i.string()).max(100),total:i.optional(i.number().int()),hasMore:i.optional(i.boolean())}).passthrough()}),qu=i.object({uri:i.string().startsWith("file://"),name:i.optional(i.string()),_meta:i.optional(i.object({}).passthrough())}).passthrough(),Uu=Ne.extend({method:i.literal("roots/list")}),Ha=Ke.extend({roots:i.array(qu)}),Vu=lr.extend({method:i.literal("notifications/roots/list_changed")}),xp=i.union([Vt,Ca,Lu,Ua,mu,pu,ru,au,nu,lu,cu,qa,Ma]),Sp=i.union([Ut,zt,ka,Vu]),Pp=i.union([qt,Va,za,Ha]),wp=i.union([Vt,Au,Nu,Uu]),Op=i.union([Ut,zt,wu,uu,ou,Pu,bu]),Rp=i.union([qt,Yc,Mu,_u,hu,tu,su,iu,hn,Su]),Xe=class extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError"}};var zu=6e4,Bt=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(Ut,t=>{let s=this._requestHandlerAbortControllers.get(t.params.requestId);s?.abort(t.params.reason)}),this.setNotificationHandler(zt,t=>{this._onprogress(t)}),this.setRequestHandler(Vt,t=>({}))}_setupTimeout(e,t,s,r,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:n,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Xe(Ye.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,s,r;this._transport=e;let n=(t=this.transport)===null||t===void 0?void 0:t.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let l=(s=this.transport)===null||s===void 0?void 0:s.onerror;this._transport.onerror=d=>{l?.(d),this._onerror(d)};let o=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(d,f)=>{o?.(d,f),$a(d)||nn(d)?this._onresponse(d):en(d)?this._onrequest(d,f):tn(d)?this._onnotification(d):this._onerror(new Error(`Unknown message type: ${JSON.stringify(d)}`))},await this._transport.start()}_onclose(){var e;let t=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 s=new Xe(Ye.ConnectionClosed,"Connection closed");for(let r of t.values())r(s)}_onerror(e){var t;(t=this.onerror)===null||t===void 0||t.call(this,e)}_onnotification(e){var t;let s=(t=this._notificationHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackNotificationHandler;s!==void 0&&Promise.resolve().then(()=>s(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){var s,r;let n=(s=this._requestHandlers.get(e.method))!==null&&s!==void 0?s:this.fallbackRequestHandler,l=this._transport;if(n===void 0){l?.send({jsonrpc:"2.0",id:e.id,error:{code:Ye.MethodNotFound,message:"Method not found"}}).catch(f=>this._onerror(new Error(`Failed to send an error response: ${f}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let d={signal:o.signal,sessionId:l?.sessionId,_meta:(r=e.params)===null||r===void 0?void 0:r._meta,sendNotification:f=>this.notification(f,{relatedRequestId:e.id}),sendRequest:(f,p,m)=>this.request(f,p,{...m,relatedRequestId:e.id}),authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo};Promise.resolve().then(()=>n(e,d)).then(f=>{if(!o.signal.aborted)return l?.send({result:f,jsonrpc:"2.0",id:e.id})},f=>{var p;if(!o.signal.aborted)return l?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Ye.InternalError,message:(p=f.message)!==null&&p!==void 0?p:"Internal error"}})}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...s}=e.params,r=Number(t),n=this._progressHandlers.get(r);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let l=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&l&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(d){l(d);return}n(s)}_onresponse(e){let t=Number(e.id),s=this._responseHandlers.get(t);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),$a(e))s(e);else{let r=new Xe(e.error.code,e.error.message,e.error.data);s(r)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,t,s){let{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}=s??{};return new Promise((o,d)=>{var f,p,m,b,c,y;if(!this._transport){d(new Error("Not connected"));return}((f=this._options)===null||f===void 0?void 0:f.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(p=s?.signal)===null||p===void 0||p.throwIfAborted();let _=this._requestMessageId++,v={...e,jsonrpc:"2.0",id:_};s?.onprogress&&(this._progressHandlers.set(_,s.onprogress),v.params={...e.params,_meta:{...((m=e.params)===null||m===void 0?void 0:m._meta)||{},progressToken:_}});let S=O=>{var D;this._responseHandlers.delete(_),this._progressHandlers.delete(_),this._cleanupTimeout(_),(D=this._transport)===null||D===void 0||D.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:_,reason:String(O)}},{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}).catch(I=>this._onerror(new Error(`Failed to send cancellation: ${I}`))),d(O)};this._responseHandlers.set(_,O=>{var D;if(!(!((D=s?.signal)===null||D===void 0)&&D.aborted)){if(O instanceof Error)return d(O);try{let I=t.parse(O.result);o(I)}catch(I){d(I)}}}),(b=s?.signal)===null||b===void 0||b.addEventListener("abort",()=>{var O;S((O=s?.signal)===null||O===void 0?void 0:O.reason)});let T=(c=s?.timeout)!==null&&c!==void 0?c:zu,P=()=>S(new Xe(Ye.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(_,T,s?.maxTotalTimeout,P,(y=s?.resetTimeoutOnProgress)!==null&&y!==void 0?y:!1),this._transport.send(v,{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}).catch(O=>{this._cleanupTimeout(_),d(O)})})}async notification(e,t){var s,r;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((r=(s=this._options)===null||s===void 0?void 0:s.debouncedNotificationMethods)!==null&&r!==void 0?r:[]).includes(e.method)&&!e.params&&!t?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var d;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let f={...e,jsonrpc:"2.0"};(d=this._transport)===null||d===void 0||d.send(f,t).catch(p=>this._onerror(p))});return}let o={...e,jsonrpc:"2.0"};await this._transport.send(o,t)}setRequestHandler(e,t){let s=e.shape.method.value;this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,n)=>Promise.resolve(t(e.parse(r),n)))}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,t){this._notificationHandlers.set(e.shape.method.value,s=>Promise.resolve(t(e.parse(s))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function mn(a,e){return Object.entries(e).reduce((t,[s,r])=>(r&&typeof r=="object"?t[s]=t[s]?{...t[s],...r}:r:t[s]=r,t),{...a})}var yo=Ra(go(),1),da=class extends Bt{constructor(e,t){var s;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(wt.options.map((r,n)=>[r,n])),this.isMessageIgnored=(r,n)=>{let l=this._loggingLevels.get(n);return l?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(l):!1},this._capabilities=(s=t?.capabilities)!==null&&s!==void 0?s:{},this._instructions=t?.instructions,this.setRequestHandler(Ca,r=>this._oninitialize(r)),this.setNotificationHandler(ka,()=>{var r;return(r=this.oninitialized)===null||r===void 0?void 0:r.call(this)}),this._capabilities.logging&&this.setRequestHandler(Ua,async(r,n)=>{var l;let o=n.sessionId||((l=n.requestInfo)===null||l===void 0?void 0:l.headers["mcp-session-id"])||void 0,{level:d}=r.params,f=wt.safeParse(d);return f.success&&this._loggingLevels.set(o,f.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=mn(this._capabilities,e)}assertCapabilityForMethod(e){var t,s,r;switch(e){case"sampling/createMessage":if(!(!((t=this._clientCapabilities)===null||t===void 0)&&t.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(!((s=this._clientCapabilities)===null||s===void 0)&&s.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(!((r=this._clientCapabilities)===null||r===void 0)&&r.roots))throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Js.includes(t)?t:Ia,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},qt)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Va,t)}async elicitInput(e,t){let s=await this.request({method:"elicitation/create",params:e},za,t);if(s.action==="accept"&&s.content)try{let r=new yo.default,n=r.compile(e.requestedSchema);if(!n(s.content))throw new Xe(Ye.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorsText(n.errors)}`)}catch(r){throw r instanceof Xe?r:new Xe(Ye.InternalError,`Error validating elicitation response: ${r}`)}return s}async listRoots(e,t){return this.request({method:"roots/list",params:e},Ha,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var ms=Ra(require("node:process"),1);var fa=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 t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Sf(t)}clear(){this._buffer=void 0}};function Sf(a){return on.parse(JSON.parse(a))}function _o(a){return JSON.stringify(a)+`
|
|
`}var pa=class{constructor(e=ms.default.stdin,t=ms.default.stdout){this._stdin=e,this._stdout=t,this._readBuffer=new fa,this._started=!1,this._ondata=s=>{this._readBuffer.append(s),this.processReadBuffer()},this._onerror=s=>{var r;(r=this.onerror)===null||r===void 0||r.call(this,s)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,t;;)try{let s=this._readBuffer.readMessage();if(s===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,s)}catch(s){(t=this.onerror)===null||t===void 0||t.call(this,s)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(e=this.onclose)===null||e===void 0||e.call(this)}send(e){return new Promise(t=>{let s=_o(e);this._stdout.write(s)?t():this._stdout.once("drain",t)})}};var Eo=Symbol("Let zodToJsonSchema decide on which parser to use");var bo={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},xo=a=>typeof a=="string"?{...bo,name:a}:{...bo,...a};var So=a=>{let e=xo(a),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}};function vs(a,e,t,s){s?.errorMessages&&t&&(a.errorMessage={...a.errorMessage,[e]:t})}function ee(a,e,t,s,r){a[e]=t,vs(a,e,s,r)}var ha=(a,e)=>{let t=0;for(;t<a.length&&t<e.length&&a[t]===e[t];t++);return[(a.length-t).toString(),...e.slice(t)].join("/")};function fe(a){if(a.target!=="openAi")return{};let e=[...a.basePath,a.definitionPath,a.openAiAnyTypeName];return a.flags.hasReferencedOpenAiAnyType=!0,{$ref:a.$refStrategy==="relative"?ha(e,a.currentPath):e.join("/")}}function Po(a,e){let t={type:"array"};return a.type?._def&&a.type?._def?.typeName!==R.ZodAny&&(t.items=B(a.type._def,{...e,currentPath:[...e.currentPath,"items"]})),a.minLength&&ee(t,"minItems",a.minLength.value,a.minLength.message,e),a.maxLength&&ee(t,"maxItems",a.maxLength.value,a.maxLength.message,e),a.exactLength&&(ee(t,"minItems",a.exactLength.value,a.exactLength.message,e),ee(t,"maxItems",a.exactLength.value,a.exactLength.message,e)),t}function wo(a,e){let t={type:"integer",format:"int64"};if(!a.checks)return t;for(let s of a.checks)switch(s.kind){case"min":e.target==="jsonSchema7"?s.inclusive?ee(t,"minimum",s.value,s.message,e):ee(t,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(t.exclusiveMinimum=!0),ee(t,"minimum",s.value,s.message,e));break;case"max":e.target==="jsonSchema7"?s.inclusive?ee(t,"maximum",s.value,s.message,e):ee(t,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(t.exclusiveMaximum=!0),ee(t,"maximum",s.value,s.message,e));break;case"multipleOf":ee(t,"multipleOf",s.value,s.message,e);break}return t}function Oo(){return{type:"boolean"}}function ma(a,e){return B(a.type._def,e)}var Ro=(a,e)=>B(a.innerType._def,e);function gs(a,e,t){let s=t??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,n)=>gs(a,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Pf(a,e)}}var Pf=(a,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let s of a.checks)switch(s.kind){case"min":ee(t,"minimum",s.value,s.message,e);break;case"max":ee(t,"maximum",s.value,s.message,e);break}return t};function To(a,e){return{...B(a.innerType._def,e),default:a.defaultValue()}}function Ao(a,e){return e.effectStrategy==="input"?B(a.schema._def,e):fe(e)}function Do(a){return{type:"string",enum:Array.from(a.values)}}var wf=a=>"type"in a&&a.type==="string"?!1:"allOf"in a;function Io(a,e){let t=[B(a.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),B(a.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(n=>!!n),s=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return t.forEach(n=>{if(wf(n))r.push(...n.allOf),n.unevaluatedProperties===void 0&&(s=void 0);else{let l=n;if("additionalProperties"in n&&n.additionalProperties===!1){let{additionalProperties:o,...d}=n;l=d}else s=void 0;r.push(l)}}),r.length?{allOf:r,...s}:void 0}function $o(a,e){let t=typeof a.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(a.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[a.value]}:{type:t==="bigint"?"integer":t,const:a.value}}var ys,er={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ys===void 0&&(ys=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ys),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function va(a,e){let t={type:"string"};if(a.checks)for(let s of a.checks)switch(s.kind){case"min":ee(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,s.value):s.value,s.message,e);break;case"max":ee(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,s.value):s.value,s.message,e);break;case"email":switch(e.emailStrategy){case"format:email":rr(t,"email",s.message,e);break;case"format:idn-email":rr(t,"idn-email",s.message,e);break;case"pattern:zod":Ie(t,er.email,s.message,e);break}break;case"url":rr(t,"uri",s.message,e);break;case"uuid":rr(t,"uuid",s.message,e);break;case"regex":Ie(t,s.regex,s.message,e);break;case"cuid":Ie(t,er.cuid,s.message,e);break;case"cuid2":Ie(t,er.cuid2,s.message,e);break;case"startsWith":Ie(t,RegExp(`^${_s(s.value,e)}`),s.message,e);break;case"endsWith":Ie(t,RegExp(`${_s(s.value,e)}$`),s.message,e);break;case"datetime":rr(t,"date-time",s.message,e);break;case"date":rr(t,"date",s.message,e);break;case"time":rr(t,"time",s.message,e);break;case"duration":rr(t,"duration",s.message,e);break;case"length":ee(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,s.value):s.value,s.message,e),ee(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,s.value):s.value,s.message,e);break;case"includes":{Ie(t,RegExp(_s(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&rr(t,"ipv4",s.message,e),s.version!=="v4"&&rr(t,"ipv6",s.message,e);break}case"base64url":Ie(t,er.base64url,s.message,e);break;case"jwt":Ie(t,er.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&Ie(t,er.ipv4Cidr,s.message,e),s.version!=="v4"&&Ie(t,er.ipv6Cidr,s.message,e);break}case"emoji":Ie(t,er.emoji(),s.message,e);break;case"ulid":{Ie(t,er.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{rr(t,"binary",s.message,e);break}case"contentEncoding:base64":{ee(t,"contentEncoding","base64",s.message,e);break}case"pattern:zod":{Ie(t,er.base64,s.message,e);break}}break}case"nanoid":Ie(t,er.nanoid,s.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return t}function _s(a,e){return e.patternStrategy==="escape"?Rf(a):a}var Of=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Rf(a){let e="";for(let t=0;t<a.length;t++)Of.has(a[t])||(e+="\\"),e+=a[t];return e}function rr(a,e,t,s){a.format||a.anyOf?.some(r=>r.format)?(a.anyOf||(a.anyOf=[]),a.format&&(a.anyOf.push({format:a.format,...a.errorMessage&&s.errorMessages&&{errorMessage:{format:a.errorMessage.format}}}),delete a.format,a.errorMessage&&(delete a.errorMessage.format,Object.keys(a.errorMessage).length===0&&delete a.errorMessage)),a.anyOf.push({format:e,...t&&s.errorMessages&&{errorMessage:{format:t}}})):ee(a,"format",e,t,s)}function Ie(a,e,t,s){a.pattern||a.allOf?.some(r=>r.pattern)?(a.allOf||(a.allOf=[]),a.pattern&&(a.allOf.push({pattern:a.pattern,...a.errorMessage&&s.errorMessages&&{errorMessage:{pattern:a.errorMessage.pattern}}}),delete a.pattern,a.errorMessage&&(delete a.errorMessage.pattern,Object.keys(a.errorMessage).length===0&&delete a.errorMessage)),a.allOf.push({pattern:Co(e,s),...t&&s.errorMessages&&{errorMessage:{pattern:t}}})):ee(a,"pattern",Co(e,s),t,s)}function Co(a,e){if(!e.applyRegexFlags||!a.flags)return a.source;let t={i:a.flags.includes("i"),m:a.flags.includes("m"),s:a.flags.includes("s")},s=t.i?a.source.toLowerCase():a.source,r="",n=!1,l=!1,o=!1;for(let d=0;d<s.length;d++){if(n){r+=s[d],n=!1;continue}if(t.i){if(l){if(s[d].match(/[a-z]/)){o?(r+=s[d],r+=`${s[d-2]}-${s[d]}`.toUpperCase(),o=!1):s[d+1]==="-"&&s[d+2]?.match(/[a-z]/)?(r+=s[d],o=!0):r+=`${s[d]}${s[d].toUpperCase()}`;continue}}else if(s[d].match(/[a-z]/)){r+=`[${s[d]}${s[d].toUpperCase()}]`;continue}}if(t.m){if(s[d]==="^"){r+=`(^|(?<=[\r
|
|
]))`;continue}else if(s[d]==="$"){r+=`($|(?=[\r
|
|
]))`;continue}}if(t.s&&s[d]==="."){r+=l?`${s[d]}\r
|
|
`:`[${s[d]}\r
|
|
]`;continue}r+=s[d],s[d]==="\\"?n=!0:l&&s[d]==="]"?l=!1:!l&&s[d]==="["&&(l=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),a.source}return r}function ga(a,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&a.keyType?._def.typeName===R.ZodEnum)return{type:"object",required:a.keyType._def.values,properties:a.keyType._def.values.reduce((s,r)=>({...s,[r]:B(a.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??fe(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let t={type:"object",additionalProperties:B(a.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(a.keyType?._def.typeName===R.ZodString&&a.keyType._def.checks?.length){let{type:s,...r}=va(a.keyType._def,e);return{...t,propertyNames:r}}else{if(a.keyType?._def.typeName===R.ZodEnum)return{...t,propertyNames:{enum:a.keyType._def.values}};if(a.keyType?._def.typeName===R.ZodBranded&&a.keyType._def.type._def.typeName===R.ZodString&&a.keyType._def.type._def.checks?.length){let{type:s,...r}=ma(a.keyType._def,e);return{...t,propertyNames:r}}}return t}function ko(a,e){if(e.mapStrategy==="record")return ga(a,e);let t=B(a.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||fe(e),s=B(a.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||fe(e);return{type:"array",maxItems:125,items:{type:"array",items:[t,s],minItems:2,maxItems:2}}}function No(a){let e=a.values,s=Object.keys(a.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(s.map(n=>typeof n)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function jo(a){return a.target==="openAi"?void 0:{not:fe({...a,currentPath:[...a.currentPath,"not"]})}}function Fo(a){return a.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Rt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Mo(a,e){if(e.target==="openApi3")return Lo(a,e);let t=a.options instanceof Map?Array.from(a.options.values()):a.options;if(t.every(s=>s._def.typeName in Rt&&(!s._def.checks||!s._def.checks.length))){let s=t.reduce((r,n)=>{let l=Rt[n._def.typeName];return l&&!r.includes(l)?[...r,l]:r},[]);return{type:s.length>1?s:s[0]}}else if(t.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){let s=t.reduce((r,n)=>{let l=typeof n._def.value;switch(l){case"string":case"number":case"boolean":return[...r,l];case"bigint":return[...r,"integer"];case"object":if(n._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(s.length===t.length){let r=s.filter((n,l,o)=>o.indexOf(n)===l);return{type:r.length>1?r:r[0],enum:t.reduce((n,l)=>n.includes(l._def.value)?n:[...n,l._def.value],[])}}}else if(t.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:t.reduce((s,r)=>[...s,...r._def.values.filter(n=>!s.includes(n))],[])};return Lo(a,e)}var Lo=(a,e)=>{let t=(a.options instanceof Map?Array.from(a.options.values()):a.options).map((s,r)=>B(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return t.length?{anyOf:t}:void 0};function qo(a,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(a.innerType._def.typeName)&&(!a.innerType._def.checks||!a.innerType._def.checks.length))return e.target==="openApi3"?{type:Rt[a.innerType._def.typeName],nullable:!0}:{type:[Rt[a.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let s=B(a.innerType._def,{...e,currentPath:[...e.currentPath]});return s&&"$ref"in s?{allOf:[s],nullable:!0}:s&&{...s,nullable:!0}}let t=B(a.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}function Uo(a,e){let t={type:"number"};if(!a.checks)return t;for(let s of a.checks)switch(s.kind){case"int":t.type="integer",vs(t,"type",s.message,e);break;case"min":e.target==="jsonSchema7"?s.inclusive?ee(t,"minimum",s.value,s.message,e):ee(t,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(t.exclusiveMinimum=!0),ee(t,"minimum",s.value,s.message,e));break;case"max":e.target==="jsonSchema7"?s.inclusive?ee(t,"maximum",s.value,s.message,e):ee(t,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(t.exclusiveMaximum=!0),ee(t,"maximum",s.value,s.message,e));break;case"multipleOf":ee(t,"multipleOf",s.value,s.message,e);break}return t}function Vo(a,e){let t=e.target==="openAi",s={type:"object",properties:{}},r=[],n=a.shape();for(let o in n){let d=n[o];if(d===void 0||d._def===void 0)continue;let f=Af(d);f&&t&&(d._def.typeName==="ZodOptional"&&(d=d._def.innerType),d.isNullable()||(d=d.nullable()),f=!1);let p=B(d._def,{...e,currentPath:[...e.currentPath,"properties",o],propertyPath:[...e.currentPath,"properties",o]});p!==void 0&&(s.properties[o]=p,f||r.push(o))}r.length&&(s.required=r);let l=Tf(a,e);return l!==void 0&&(s.additionalProperties=l),s}function Tf(a,e){if(a.catchall._def.typeName!=="ZodNever")return B(a.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(a.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function Af(a){try{return a.isOptional()}catch{return!0}}var zo=(a,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return B(a.innerType._def,e);let t=B(a.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:fe(e)},t]}:fe(e)};var Ho=(a,e)=>{if(e.pipeStrategy==="input")return B(a.in._def,e);if(e.pipeStrategy==="output")return B(a.out._def,e);let t=B(a.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=B(a.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return{allOf:[t,s].filter(r=>r!==void 0)}};function Zo(a,e){return B(a.type._def,e)}function Bo(a,e){let s={type:"array",uniqueItems:!0,items:B(a.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return a.minSize&&ee(s,"minItems",a.minSize.value,a.minSize.message,e),a.maxSize&&ee(s,"maxItems",a.maxSize.value,a.maxSize.message,e),s}function Qo(a,e){return a.rest?{type:"array",minItems:a.items.length,items:a.items.map((t,s)=>B(t._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((t,s)=>s===void 0?t:[...t,s],[]),additionalItems:B(a.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:a.items.length,maxItems:a.items.length,items:a.items.map((t,s)=>B(t._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((t,s)=>s===void 0?t:[...t,s],[])}}function Wo(a){return{not:fe(a)}}function Ko(a){return fe(a)}var Jo=(a,e)=>B(a.innerType._def,e);var Go=(a,e,t)=>{switch(e){case R.ZodString:return va(a,t);case R.ZodNumber:return Uo(a,t);case R.ZodObject:return Vo(a,t);case R.ZodBigInt:return wo(a,t);case R.ZodBoolean:return Oo();case R.ZodDate:return gs(a,t);case R.ZodUndefined:return Wo(t);case R.ZodNull:return Fo(t);case R.ZodArray:return Po(a,t);case R.ZodUnion:case R.ZodDiscriminatedUnion:return Mo(a,t);case R.ZodIntersection:return Io(a,t);case R.ZodTuple:return Qo(a,t);case R.ZodRecord:return ga(a,t);case R.ZodLiteral:return $o(a,t);case R.ZodEnum:return Do(a);case R.ZodNativeEnum:return No(a);case R.ZodNullable:return qo(a,t);case R.ZodOptional:return zo(a,t);case R.ZodMap:return ko(a,t);case R.ZodSet:return Bo(a,t);case R.ZodLazy:return()=>a.getter()._def;case R.ZodPromise:return Zo(a,t);case R.ZodNaN:case R.ZodNever:return jo(t);case R.ZodEffects:return Ao(a,t);case R.ZodAny:return fe(t);case R.ZodUnknown:return Ko(t);case R.ZodDefault:return To(a,t);case R.ZodBranded:return ma(a,t);case R.ZodReadonly:return Jo(a,t);case R.ZodCatch:return Ro(a,t);case R.ZodPipeline:return Ho(a,t);case R.ZodFunction:case R.ZodVoid:case R.ZodSymbol:return;default:return(s=>{})(e)}};function B(a,e,t=!1){let s=e.seen.get(a);if(e.override){let o=e.override?.(a,e,s,t);if(o!==Eo)return o}if(s&&!t){let o=Df(s,e);if(o!==void 0)return o}let r={def:a,path:e.currentPath,jsonSchema:void 0};e.seen.set(a,r);let n=Go(a,a.typeName,e),l=typeof n=="function"?B(n(),e):n;if(l&&If(a,e,l),e.postProcess){let o=e.postProcess(l,a,e);return r.jsonSchema=l,o}return r.jsonSchema=l,l}var Df=(a,e)=>{switch(e.$refStrategy){case"root":return{$ref:a.path.join("/")};case"relative":return{$ref:ha(e.currentPath,a.path)};case"none":case"seen":return a.path.length<e.currentPath.length&&a.path.every((t,s)=>e.currentPath[s]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),fe(e)):e.$refStrategy==="seen"?fe(e):void 0}},If=(a,e,t)=>(a.description&&(t.description=a.description,e.markdownDescription&&(t.markdownDescription=a.description)),t);var bs=(a,e)=>{let t=So(e),s=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((d,[f,p])=>({...d,[f]:B(p._def,{...t,currentPath:[...t.basePath,t.definitionPath,f]},!0)??fe(t)}),{}):void 0,r=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,n=B(a._def,r===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,r]},!1)??fe(t),l=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;l!==void 0&&(n.title=l),t.flags.hasReferencedOpenAiAnyType&&(s||(s={}),s[t.openAiAnyTypeName]||(s[t.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:t.$refStrategy==="relative"?"1":[...t.basePath,t.definitionPath,t.openAiAnyTypeName].join("/")}}));let o=r===void 0?s?{...n,[t.definitionPath]:s}:n:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,r].join("/"),[t.definitionPath]:{...s,[r]:n}};return t.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(t.target==="jsonSchema2019-09"||t.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),t.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o};var Yo=require("fs"),Xo=require("os"),el=require("path"),$f=(0,el.join)((0,Xo.homedir)(),".claude-mem","silent.log");function Ue(a,e,t=""){let s=new Date().toISOString(),o=((new Error().stack||"").split(`
|
|
`)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),d=o?`${o[1].split("/").pop()}:${o[2]}`:"unknown",f=`[${s}] [HAPPY-PATH-ERROR] [${d}] ${a}`;if(e!==void 0)try{f+=` ${JSON.stringify(e)}`}catch(p){f+=` [stringify error: ${p}]`}f+=`
|
|
`;try{(0,Yo.appendFileSync)($f,f)}catch(p){console.error("[silent-debug] Failed to write to log:",p)}return t}var Ps=Ra(require("path"),1);var ws=require("os");var _a=require("fs"),al=require("path"),sl=require("os");var Cf=["bugfix","feature","refactor","discovery","decision","change"],kf=["how-it-works","why-it-exists","what-changed","problem-solution","gotcha","pattern","trade-off"];var rl=Cf.join(","),tl=kf.join(",");var ya=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-haiku-4-5",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:"37777",CLAUDE_MEM_DATA_DIR:(0,al.join)((0,sl.homedir)(),".claude-mem"),CLAUDE_MEM_LOG_LEVEL:"INFO",CLAUDE_MEM_PYTHON_VERSION:"3.13",CLAUDE_CODE_PATH:"",CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS:"true",CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS:"true",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT:"true",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT:"true",CLAUDE_MEM_CONTEXT_OBSERVATION_TYPES:rl,CLAUDE_MEM_CONTEXT_OBSERVATION_CONCEPTS:tl,CLAUDE_MEM_CONTEXT_FULL_COUNT:"5",CLAUDE_MEM_CONTEXT_FULL_FIELD:"narrative",CLAUDE_MEM_CONTEXT_SESSION_COUNT:"10",CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY:"true",CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE:"false"};static getAllDefaults(){return{...this.DEFAULTS}}static get(e){return process.env[e]||this.DEFAULTS[e]}static getInt(e){let t=this.get(e);return parseInt(t,10)}static getBool(e){return this.get(e)==="true"}static loadFromFile(e){if(!(0,_a.existsSync)(e))return this.getAllDefaults();let t=(0,_a.readFileSync)(e,"utf-8"),r=JSON.parse(t).env||{},n={...this.DEFAULTS};for(let l of Object.keys(this.DEFAULTS))r[l]!==void 0&&(n[l]=r[l]);return n}};var nl=require("path"),il=require("os"),ba=require("fs");var Es=(0,nl.join)((0,il.homedir)(),".claude-mem","settings.json");function ol(a,e){try{if((0,ba.existsSync)(Es)){let s=JSON.parse((0,ba.readFileSync)(Es,"utf-8")).env?.[a];if(s!==void 0)return s}}catch(t){Ue("Failed to load settings file",{error:t,settingsPath:Es,key:a})}return process.env[a]||e}var xs=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.SILENT=4]="SILENT",n))(xs||{}),Ss=class{level;useColor;constructor(){let e=ol("CLAUDE_MEM_LOG_LEVEL","INFO").toUpperCase();this.level=xs[e]??1,this.useColor=process.stdout.isTTY??!1}correlationId(e,t){return`obs-${e}-${t}`}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 t=Object.keys(e);return t.length===0?"{}":t.length<=3?JSON.stringify(e):`{${t.length} keys: ${t.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,t){if(!t)return e;try{let s=typeof t=="string"?JSON.parse(t):t;if(e==="Bash"&&s.command){let r=s.command.length>50?s.command.substring(0,50)+"...":s.command;return`${e}(${r})`}if(e==="Read"&&s.file_path){let r=s.file_path.split("/").pop()||s.file_path;return`${e}(${r})`}if(e==="Edit"&&s.file_path){let r=s.file_path.split("/").pop()||s.file_path;return`${e}(${r})`}if(e==="Write"&&s.file_path){let r=s.file_path.split("/").pop()||s.file_path;return`${e}(${r})`}return e}catch{return e}}log(e,t,s,r,n){if(e<this.level)return;let l=new Date().toISOString().replace("T"," ").substring(0,23),o=xs[e].padEnd(5),d=t.padEnd(6),f="";r?.correlationId?f=`[${r.correlationId}] `:r?.sessionId&&(f=`[session-${r.sessionId}] `);let p="";n!=null&&(this.level===0&&typeof n=="object"?p=`
|
|
`+JSON.stringify(n,null,2):p=" "+this.formatData(n));let m="";if(r){let{sessionId:c,sdkSessionId:y,correlationId:_,...v}=r;Object.keys(v).length>0&&(m=` {${Object.entries(v).map(([T,P])=>`${T}=${P}`).join(", ")}}`)}let b=`[${l}] [${o}] [${d}] ${f}${s}${m}${p}`;e===3?console.error(b):console.log(b)}debug(e,t,s,r){this.log(0,e,t,s,r)}info(e,t,s,r){this.log(1,e,t,s,r)}warn(e,t,s,r){this.log(2,e,t,s,r)}error(e,t,s,r){this.log(3,e,t,s,r)}dataIn(e,t,s,r){this.info(e,`\u2192 ${t}`,s,r)}dataOut(e,t,s,r){this.info(e,`\u2190 ${t}`,s,r)}success(e,t,s,r){this.info(e,`\u2713 ${t}`,s,r)}failure(e,t,s,r){this.error(e,`\u2717 ${t}`,s,r)}timing(e,t,s,r){this.info(e,`\u23F1 ${t}`,r,{duration:`${s}ms`})}},Nf=new Ss;var Tt={DEFAULT:5e3,HEALTH_CHECK:1e3,WORKER_STARTUP_WAIT:1e3,WORKER_STARTUP_RETRIES:15,WINDOWS_MULTIPLIER:1.5};function ll(a){return process.platform==="win32"?Math.round(a*Tt.WINDOWS_MULTIPLIER):a}var $g=Ps.default.join((0,ws.homedir)(),".claude","plugins","marketplaces","thedotmack"),Cg=ll(Tt.HEALTH_CHECK),kg=Tt.WORKER_STARTUP_WAIT,Ng=Tt.WORKER_STARTUP_RETRIES;function cl(){let a=Ps.default.join((0,ws.homedir)(),".claude-mem","settings.json"),e=ya.loadFromFile(a);return parseInt(e.CLAUDE_MEM_WORKER_PORT,10)}var jf=cl(),Ea=`http://localhost:${jf}`,je={search:"/api/search",timeline:"/api/timeline",decisions:"/api/decisions",changes:"/api/changes",how_it_works:"/api/how-it-works",search_observations:"/api/search/observations",search_sessions:"/api/search/sessions",search_user_prompts:"/api/search/prompts",find_by_concept:"/api/search/by-concept",find_by_file:"/api/search/by-file",find_by_type:"/api/search/by-type",get_recent_context:"/api/context/recent",get_context_timeline:"/api/context/timeline",get_timeline_by_query:"/api/timeline/by-query"};async function Fe(a,e){Ue("[mcp-server] \u2192 Worker API",{endpoint:a,params:e});try{let t=new URLSearchParams;for(let[l,o]of Object.entries(e))o!=null&&t.append(l,String(o));let s=`${Ea}${a}?${t}`,r=await fetch(s);if(!r.ok){let l=await r.text();throw new Error(`Worker API error (${r.status}): ${l}`)}let n=await r.json();return Ue("[mcp-server] \u2190 Worker API success",{endpoint:a}),n}catch(t){return Ue("[mcp-server] \u2190 Worker API error",{endpoint:a,error:t.message}),{content:[{type:"text",text:`Error calling Worker API: ${t.message}`}],isError:!0}}}async function Ff(){try{return(await fetch(`${Ea}/api/health`)).ok}catch{return!1}}var ul=[{name:"search",description:'Unified search across all memory types (observations, sessions, and user prompts) using vector-first semantic search (ChromaDB). Returns combined results from all document types. IMPORTANT: Always use index format first (default) to get an overview with minimal token usage, then use format: "full" only for specific items of interest.',inputSchema:i.object({query:i.string().optional().describe("Natural language search query for semantic ranking via ChromaDB vector search. Optional - omit for date-filtered queries only (Chroma cannot filter by date, requires direct SQLite)."),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED for initial search), "full" for complete details (use only after reviewing index results)'),type:i.enum(["observations","sessions","prompts"]).optional().describe("Filter by document type (observations, sessions, or prompts). Omit to search all types."),obs_type:i.string().optional().describe('Filter observations by type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change). Only applies when type="observations"'),concepts:i.string().optional().describe('Filter by concept tags (single value or comma-separated list). Only applies when type="observations"'),files:i.string().optional().describe('Filter by file paths (single value or comma-separated list for partial match). Only applies when type="observations"'),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)"),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),offset:i.number().min(0).default(0).describe("Number of results to skip"),orderBy:i.enum(["relevance","date_desc","date_asc"]).default("date_desc").describe("Sort order")}),handler:async a=>{let e=je.search;return await Fe(e,a)}},{name:"timeline",description:"Fetch timeline of observations around a specific point in time. Supports two modes: anchor-based (fetch observations before/after a specific observation ID) and query-based (semantic search for anchor point). IMPORTANT: Use anchor_id when you know the specific observation, or query to find an anchor point first.",inputSchema:i.object({query:i.string().optional().describe("Natural language query to find anchor observation (query-based mode). Mutually exclusive with anchor_id."),anchor_id:i.number().optional().describe("Observation ID to use as anchor (anchor-based mode). Mutually exclusive with query."),before:i.number().min(0).max(100).default(10).describe("Number of observations to fetch before anchor"),after:i.number().min(0).max(100).default(10).describe("Number of observations to fetch after anchor"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),obs_type:i.string().optional().describe("Filter observations by type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),concepts:i.string().optional().describe("Filter by concept tags (single value or comma-separated list)"),files:i.string().optional().describe("Filter by file paths (single value or comma-separated list for partial match)"),project:i.string().optional().describe("Filter by project name")}),handler:async a=>{let e=je.timeline;return await Fe(e,a)}},{name:"decisions",description:"Semantic shortcut for finding architectural, design, and implementation decisions. Optimized for decision-type observations with relevant keyword boosting.",inputSchema:i.object({query:i.string().describe("Natural language query for finding decisions"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)")}),handler:async a=>{let e=je.decisions;return await Fe(e,a)}},{name:"changes",description:"Semantic shortcut for finding code changes, refactorings, and modifications. Optimized for change-type observations with relevant keyword boosting.",inputSchema:i.object({query:i.string().describe("Natural language query for finding changes"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)")}),handler:async a=>{let e=je.changes;return await Fe(e,a)}},{name:"how_it_works",description:"Semantic shortcut for understanding system architecture, design patterns, and implementation details. Optimized for discovery-type observations with architecture/design keyword boosting.",inputSchema:i.object({query:i.string().describe("Natural language query for understanding how something works"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)")}),handler:async a=>{let e=je.how_it_works;return await Fe(e,a)}},{name:"search_observations",description:'[DEPRECATED - Use "search" with type="observations" instead] Search observations (facts/narratives) using FTS5 full-text search. Supports filtering by type, concepts, files, and date range.',inputSchema:i.object({query:i.string().optional().describe("Full-text search query (FTS5)"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),type:i.string().optional().describe("Filter by observation type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),concepts:i.string().optional().describe("Filter by concept tags (single value or comma-separated list)"),files:i.string().optional().describe("Filter by file paths (single value or comma-separated list for partial match)"),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)"),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),offset:i.number().min(0).default(0).describe("Number of results to skip"),orderBy:i.enum(["relevance","date_desc","date_asc"]).default("relevance").describe("Sort order (relevance only when query provided)")}),handler:async a=>{let e=je.search_observations;return await Fe(e,a)}},{name:"search_sessions",description:'[DEPRECATED - Use "search" with type="sessions" instead] Search session summaries using FTS5 full-text search. Returns both request_summary and learned_summary fields.',inputSchema:i.object({query:i.string().optional().describe("Full-text search query (FTS5)"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)"),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),offset:i.number().min(0).default(0).describe("Number of results to skip"),orderBy:i.enum(["relevance","date_desc","date_asc"]).default("relevance").describe("Sort order (relevance only when query provided)")}),handler:async a=>{let e=je.search_sessions;return await Fe(e,a)}},{name:"search_user_prompts",description:'[DEPRECATED - Use "search" with type="prompts" instead] Search user prompts using FTS5 full-text search. Searches prompt text only.',inputSchema:i.object({query:i.string().optional().describe("Full-text search query (FTS5)"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)"),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),offset:i.number().min(0).default(0).describe("Number of results to skip"),orderBy:i.enum(["relevance","date_desc","date_asc"]).default("relevance").describe("Sort order (relevance only when query provided)")}),handler:async a=>{let e=je.search_user_prompts;return await Fe(e,a)}},{name:"find_by_concept",description:"Find observations tagged with specific concepts. Returns observations that match any of the provided concept tags.",inputSchema:i.object({concepts:i.string().describe("Concept tag(s) to filter by (single value or comma-separated list)"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),type:i.string().optional().describe("Filter by observation type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),files:i.string().optional().describe("Filter by file paths (single value or comma-separated list for partial match)"),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)"),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),offset:i.number().min(0).default(0).describe("Number of results to skip"),orderBy:i.enum(["date_desc","date_asc"]).default("date_desc").describe("Sort order")}),handler:async a=>{let e=je.find_by_concept;return await Fe(e,a)}},{name:"find_by_file",description:"Find observations related to specific file paths. Uses partial matching - searches for file paths containing the provided string.",inputSchema:i.object({files:i.string().describe("File path(s) to filter by (single value or comma-separated list for partial match)"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),type:i.string().optional().describe("Filter by observation type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),concepts:i.string().optional().describe("Filter by concept tags (single value or comma-separated list)"),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)"),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),offset:i.number().min(0).default(0).describe("Number of results to skip"),orderBy:i.enum(["date_desc","date_asc"]).default("date_desc").describe("Sort order")}),handler:async a=>{let e=je.find_by_file;return await Fe(e,a)}},{name:"find_by_type",description:"Find observations of specific types. Returns observations matching any of the provided observation types.",inputSchema:i.object({type:i.string().describe("Observation type(s) to filter by (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),concepts:i.string().optional().describe("Filter by concept tags (single value or comma-separated list)"),files:i.string().optional().describe("Filter by file paths (single value or comma-separated list for partial match)"),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)"),limit:i.number().min(1).max(100).default(20).describe("Maximum number of results"),offset:i.number().min(0).default(0).describe("Number of results to skip"),orderBy:i.enum(["date_desc","date_asc"]).default("date_desc").describe("Sort order")}),handler:async a=>{let e=je.find_by_type;return await Fe(e,a)}},{name:"get_recent_context",description:"Get recent session context for timeline display. Returns recent observations, sessions, and user prompts with metadata for building timeline UI.",inputSchema:i.object({limit:i.number().min(1).max(100).default(30).describe("Maximum number of timeline items to return"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),type:i.string().optional().describe("Filter by observation type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),concepts:i.string().optional().describe("Filter by concept tags (single value or comma-separated list)"),files:i.string().optional().describe("Filter by file paths (single value or comma-separated list for partial match)"),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)")}),handler:async a=>{let e=je.get_recent_context;return await Fe(e,a)}},{name:"get_context_timeline",description:"Get timeline of observations around a specific observation ID. Returns observations before and after the anchor point with metadata for timeline display.",inputSchema:i.object({anchor_id:i.number().describe("Observation ID to use as anchor point"),before:i.number().min(0).max(100).default(10).describe("Number of observations to fetch before anchor"),after:i.number().min(0).max(100).default(10).describe("Number of observations to fetch after anchor"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),type:i.string().optional().describe("Filter by observation type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),concepts:i.string().optional().describe("Filter by concept tags (single value or comma-separated list)"),files:i.string().optional().describe("Filter by file paths (single value or comma-separated list for partial match)"),project:i.string().optional().describe("Filter by project name")}),handler:async a=>{let e=je.get_context_timeline;return await Fe(e,a)}},{name:"get_timeline_by_query",description:"Combined search + timeline tool. First searches for observations matching the query, then returns timeline around the best match. Useful for finding specific observations and viewing their context.",inputSchema:i.object({query:i.string().describe("Natural language query to find anchor observation"),before:i.number().min(0).max(100).default(10).describe("Number of observations to fetch before anchor"),after:i.number().min(0).max(100).default(10).describe("Number of observations to fetch after anchor"),format:i.enum(["index","full"]).default("index").describe('Output format: "index" for titles/dates only (default, RECOMMENDED), "full" for complete details'),type:i.string().optional().describe("Filter by observation type (single value or comma-separated list: decision,bugfix,feature,refactor,discovery,change)"),concepts:i.string().optional().describe("Filter by concept tags (single value or comma-separated list)"),files:i.string().optional().describe("Filter by file paths (single value or comma-separated list for partial match)"),project:i.string().optional().describe("Filter by project name"),dateStart:i.union([i.string(),i.number()]).optional().describe("Start date for filtering (ISO string or epoch timestamp)"),dateEnd:i.union([i.string(),i.number()]).optional().describe("End date for filtering (ISO string or epoch timestamp)")}),handler:async a=>{let e=je.get_timeline_by_query;return await Fe(e,a)}}],Os=new da({name:"claude-mem-search-server",version:"1.0.0"},{capabilities:{tools:{}}});Os.setRequestHandler(Ma,async()=>({tools:ul.map(a=>({name:a.name,description:a.description,inputSchema:bs(a.inputSchema)}))}));Os.setRequestHandler(qa,async a=>{let e=ul.find(t=>t.name===a.params.name);if(!e)throw new Error(`Unknown tool: ${a.params.name}`);try{return await e.handler(a.params.arguments||{})}catch(t){return{content:[{type:"text",text:`Tool execution failed: ${t.message}`}],isError:!0}}});async function dl(){Ue("[mcp-server] Shutting down..."),process.exit(0)}process.on("SIGTERM",dl);process.on("SIGINT",dl);async function Lf(){let a=new pa;await Os.connect(a),Ue("[mcp-server] Claude-mem search server started"),setTimeout(async()=>{await Ff()?Ue("[mcp-server] Worker available at",Ea):(Ue("[mcp-server] WARNING: Worker not available at",Ea),Ue("[mcp-server] Tools will fail until Worker is started"),Ue("[mcp-server] Start Worker with: npm run worker:restart"))},0)}Lf().catch(a=>{Ue("[mcp-server] Fatal error:",a),process.exit(1)});
|
|
/*! Bundled license information:
|
|
|
|
uri-js/dist/es5/uri.all.js:
|
|
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
|
|
*/
|