whoami7 - Manager
:
/
home
/
ezdajrnh
/
www
/
wp-content
/
plugins
/
elementor
/
assets
/
js
/
packages
/
editor-mcp
/
Upload File:
files >> //home/ezdajrnh/www/wp-content/plugins/elementor/assets/js/packages/editor-mcp/editor-mcp.min.js
/*! For license information please see editor-mcp.min.js.LICENSE.txt */ !function(){var e={484:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.schema[t],i=e.errSchemaPath+"/"+t,n=(e.opts.allErrors,e.util.toQuotedString(s));return!0===e.opts.$comment?a+=" console.log("+n+");":"function"==typeof e.opts.$comment&&(a+=" self._opts.$comment("+n+", "+e.util.toQuotedString(i)+", validate.root.schema);"),a}},553:function(e){"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,n=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",a="schema"+i):a=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+l+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==t?"more":"fewer",s+=" than ",s+=h?"' + "+a+" + '":""+o,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+d:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ";var f=s;return s=m.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},705:function(e,t,r){"use strict";e.exports={$ref:r(2776),allOf:r(8203),anyOf:r(8806),$comment:r(484),const:r(3458),contains:r(9372),dependencies:r(7676),enum:r(5736),format:r(2442),if:r(3022),items:r(8665),maximum:r(1525),minimum:r(1525),maxItems:r(553),minItems:r(553),maxLength:r(8601),minLength:r(8601),maxProperties:r(9468),minProperties:r(9468),multipleOf:r(7148),not:r(1948),oneOf:r(2416),pattern:r(4431),properties:r(7276),propertyNames:r(6862),required:r(4720),uniqueItems:r(8484),validate:r(9787)}},955:function(e,t,r){"use strict";var a=r(705),s=r(7710).toHash;e.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"];return e.all=s(t),e.types=s(["number","integer","string","array","object","boolean","null"]),e.forEach(function(r){r.rules=r.rules.map(function(r){var s;if("object"==typeof r){var i=Object.keys(r)[0];s=r[i],r=i,s.forEach(function(r){t.push(r),e.all[r]=!0})}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:s}}),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)}),e.keywords=s(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},1130:function(e){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,a="boolean"==typeof t.cycles&&t.cycles,s=t.cmp&&(r=t.cmp,function(e){return function(t,a){var s={key:t,value:e[t]},i={key:a,value:e[a]};return r(s,i)}}),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,n;if(Array.isArray(t)){for(n="[",r=0;r<t.length;r++)r&&(n+=","),n+=e(t[r])||"null";return n+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(a)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var o=i.push(t)-1,d=Object.keys(t).sort(s&&s(t));for(n="",r=0;r<d.length;r++){var c=d[r],u=e(t[c]);u&&(n&&(n+=","),n+=JSON.stringify(c)+":"+u)}return i.splice(o,1),"{"+n+"}"}}(e)}},1353:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,s=1;s<a;++s)t[s]=t[s].slice(1,-1);return t[a]=t[a].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function s(e){return e.toUpperCase()}function i(e){var a="[A-Za-z]",s="[0-9]",i=t(s,"[A-Fa-f]"),n=r(r("%[EFef]"+i+"%"+i+i+"%"+i+i)+"|"+r("%[89A-Fa-f]"+i+"%"+i+i)+"|"+r("%"+i+i)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",d=t("[\\:\\/\\?\\#\\[\\]\\@]",o),c=e?"[\\uE000-\\uF8FF]":"[]",u=t(a,s,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),l=r(a+t(a,s,"[\\+\\-\\.]")+"*"),h=r(r(n+"|"+t(u,o,"[\\:]"))+"*"),p=(r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("[1-9]"+s)+"|"+s),r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("0?[1-9]"+s)+"|0?0?"+s)),m=r(p+"\\."+p+"\\."+p+"\\."+p),f=r(i+"{1,4}"),v=r(r(f+"\\:"+f)+"|"+m),g=r(r(f+"\\:")+"{6}"+v),y=r("\\:\\:"+r(f+"\\:")+"{5}"+v),_=r(r(f)+"?\\:\\:"+r(f+"\\:")+"{4}"+v),b=r(r(r(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+r(f+"\\:")+"{3}"+v),w=r(r(r(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+r(f+"\\:")+"{2}"+v),x=r(r(r(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+v),P=r(r(r(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+v),k=r(r(r(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),E=r(r(r(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),S=r([g,y,_,b,w,x,P,k,E].join("|")),R=r(r(u+"|"+n)+"+"),T=(r(S+"\\%25"+R),r(S+r("\\%25|\\%(?!"+i+"{2})")+R)),O=r("[vV]"+i+"+\\."+t(u,o,"[\\:]")+"+"),C=r("\\["+r(T+"|"+S+"|"+O)+"\\]"),A=r(r(n+"|"+t(u,o))+"*"),$=r(C+"|"+m+"(?!"+A+")|"+A),j=r(s+"*"),I=r(r(h+"@")+"?"+$+r("\\:"+j)+"?"),N=r(n+"|"+t(u,o,"[\\:\\@]")),F=r(N+"*"),Z=r(N+"+"),D=r(r(n+"|"+t(u,o,"[\\@]"))+"+"),M=r(r("\\/"+F)+"*"),L=r("\\/"+r(Z+M)+"?"),q=r(D+M),z=r(Z+M),V="(?!"+N+")",H=(r(M+"|"+L+"|"+q+"|"+z+"|"+V),r(r(N+"|"+t("[\\/\\?]",c))+"*")),U=r(r(N+"|[\\/\\?]")+"*"),Q=r(r("\\/\\/"+I+M)+"|"+L+"|"+z+"|"+V),K=r(l+"\\:"+Q+r("\\?"+H)+"?"+r("\\#"+U)+"?"),B=r(r("\\/\\/"+I+M)+"|"+L+"|"+q+"|"+V),W=r(B+r("\\?"+H)+"?"+r("\\#"+U)+"?");return r(K+"|"+W),r(l+"\\:"+Q+r("\\?"+H)+"?"),r(r("\\/\\/("+r("("+h+")@")+"?("+$+")"+r("\\:("+j+")")+"?)")+"?("+M+"|"+L+"|"+z+"|"+V+")"),r("\\?("+H+")"),r("\\#("+U+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+$+")"+r("\\:("+j+")")+"?)")+"?("+M+"|"+L+"|"+q+"|"+V+")"),r("\\?("+H+")"),r("\\#("+U+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+$+")"+r("\\:("+j+")")+"?)")+"?("+M+"|"+L+"|"+z+"|"+V+")"),r("\\?("+H+")"),r("\\#("+U+")"),r("("+h+")@"),r("\\:("+j+")"),{NOT_SCHEME:new RegExp(t("[^]",a,s,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,o),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,o),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,o),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,o),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,o,"[\\:\\@\\/\\?]",c),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,o),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,d),"g"),PCT_ENCODED:new RegExp(n,"g"),IPV4ADDRESS:new RegExp("^("+m+")$"),IPV6ADDRESS:new RegExp("^\\[?("+S+")"+r(r("\\%25|\\%(?!"+i+"{2})")+"("+R+")")+"?\\]?$")}}var n=i(!1),o=i(!0),d=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],a=!0,s=!1,i=void 0;try{for(var n,o=e[Symbol.iterator]();!(a=(n=o.next()).done)&&(r.push(n.value),!t||r.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{!a&&o.return&&o.return()}finally{if(s)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=2147483647,u=36,l=/^xn--/,h=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,v=String.fromCharCode;function g(e){throw new RangeError(m[e])}function y(e,t){var r=e.split("@"),a="";return r.length>1&&(a=r[0]+"@",e=r[1]),a+function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(p,".")).split("."),t).join(".")}function _(e){for(var t=[],r=0,a=e.length;r<a;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){var i=e.charCodeAt(r++);56320==(64512&i)?t.push(((1023&s)<<10)+(1023&i)+65536):(t.push(s),r--)}else t.push(s)}return t}var b=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:u},w=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},x=function(e,t,r){var a=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;a+=u)e=f(e/35);return f(a+36*e/(e+38))},P=function(e){var t=[],r=e.length,a=0,s=128,i=72,n=e.lastIndexOf("-");n<0&&(n=0);for(var o=0;o<n;++o)e.charCodeAt(o)>=128&&g("not-basic"),t.push(e.charCodeAt(o));for(var d=n>0?n+1:0;d<r;){for(var l=a,h=1,p=u;;p+=u){d>=r&&g("invalid-input");var m=b(e.charCodeAt(d++));(m>=u||m>f((c-a)/h))&&g("overflow"),a+=m*h;var v=p<=i?1:p>=i+26?26:p-i;if(m<v)break;var y=u-v;h>f(c/y)&&g("overflow"),h*=y}var _=t.length+1;i=x(a-l,_,0==l),f(a/_)>c-s&&g("overflow"),s+=f(a/_),a%=_,t.splice(a++,0,s)}return String.fromCodePoint.apply(String,t)},k=function(e){var t=[],r=(e=_(e)).length,a=128,s=0,i=72,n=!0,o=!1,d=void 0;try{for(var l,h=e[Symbol.iterator]();!(n=(l=h.next()).done);n=!0){var p=l.value;p<128&&t.push(v(p))}}catch(e){o=!0,d=e}finally{try{!n&&h.return&&h.return()}finally{if(o)throw d}}var m=t.length,y=m;for(m&&t.push("-");y<r;){var b=c,P=!0,k=!1,E=void 0;try{for(var S,R=e[Symbol.iterator]();!(P=(S=R.next()).done);P=!0){var T=S.value;T>=a&&T<b&&(b=T)}}catch(e){k=!0,E=e}finally{try{!P&&R.return&&R.return()}finally{if(k)throw E}}var O=y+1;b-a>f((c-s)/O)&&g("overflow"),s+=(b-a)*O,a=b;var C=!0,A=!1,$=void 0;try{for(var j,I=e[Symbol.iterator]();!(C=(j=I.next()).done);C=!0){var N=j.value;if(N<a&&++s>c&&g("overflow"),N==a){for(var F=s,Z=u;;Z+=u){var D=Z<=i?1:Z>=i+26?26:Z-i;if(F<D)break;var M=F-D,L=u-D;t.push(v(w(D+M%L,0))),F=f(M/L)}t.push(v(w(F,0))),i=x(s,O,y==m),s=0,++y}}}catch(e){A=!0,$=e}finally{try{!C&&I.return&&I.return()}finally{if(A)throw $}}++s,++a}return t.join("")},E=function(e){return y(e,function(e){return h.test(e)?"xn--"+k(e):e})},S=function(e){return y(e,function(e){return l.test(e)?P(e.slice(4).toLowerCase()):e})},R={};function T(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function O(e){for(var t="",r=0,a=e.length;r<a;){var s=parseInt(e.substr(r+1,2),16);if(s<128)t+=String.fromCharCode(s),r+=3;else if(s>=194&&s<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(a-r>=9){var n=parseInt(e.substr(r+4,2),16),o=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&n)<<6|63&o)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function C(e,t){function r(e){var r=O(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,T).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,T).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,T).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,T).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,T).replace(t.PCT_ENCODED,s)),e}function A(e){return e.replace(/^0*(.*)/,"$1")||"0"}function $(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=d(r,2)[1];return a?a.split(".").map(A).join("."):e}function j(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=d(r,3),s=a[1],i=a[2];if(s){for(var n=s.toLowerCase().split("::").reverse(),o=d(n,2),c=o[0],u=o[1],l=u?u.split(":").map(A):[],h=c.split(":").map(A),p=t.IPV4ADDRESS.test(h[h.length-1]),m=p?7:8,f=h.length-m,v=Array(m),g=0;g<m;++g)v[g]=l[g]||h[f+g]||"";p&&(v[m-1]=$(v[m-1],t));var y=v.reduce(function(e,t,r){if(!t||"0"===t){var a=e[e.length-1];a&&a.index+a.length===r?a.length++:e.push({index:r,length:1})}return e},[]).sort(function(e,t){return t.length-e.length})[0],_=void 0;if(y&&y.length>1){var b=v.slice(0,y.index),w=v.slice(y.index+y.length);_=b.join(":")+"::"+w.join(":")}else _=v.join(":");return i&&(_+="%"+i),_}return e}var I=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,N=void 0==="".match(/(){0}/)[1];function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?o:n;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(I);if(s){N?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=j($(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=R[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)C(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=E(r.host.replace(a.PCT_ENCODED,O).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}C(r,n)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var Z=/^\.\.?\//,D=/^\/\.(\/|$)/,M=/^\/\.\.(\/|$)/,L=/^\/?(?:.|\n)*?(?=\/|$)/;function q(e){for(var t=[];e.length;)if(e.match(Z))e=e.replace(Z,"");else if(e.match(D))e=e.replace(D,"/");else if(e.match(M))e=e.replace(M,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(L);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?o:n,a=[],s=R[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?S(e.host):E(e.host.replace(r.PCT_ENCODED,O).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}C(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?o:n,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(j($(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(a.push(":"),a.push(String(e.port))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var d=e.path;t.absolutePath||s&&s.absolutePath||(d=q(d)),void 0===i&&(d=d.replace(/^\/\//,"/%2F")),a.push(d)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function V(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=F(z(e,r),r),t=F(z(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=q(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=q(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=q(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=q(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function H(e,t){return e&&e.toString().replace(t&&t.iri?o.PCT_ENCODED:n.PCT_ENCODED,O)}var U={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:U.domainHost,parse:U.parse,serialize:U.serialize};function K(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var B={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=K(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(K(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),a=d(r,2),s=a[0],i=a[1];e.path=s&&"/"!==s?s:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},W={scheme:"wss",domainHost:B.domainHost,parse:B.parse,serialize:B.serialize},J={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",X=r(r("%[EFef]"+Y+"%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f]"+Y+"%"+Y+Y)+"|"+r("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(G,"g"),re=new RegExp(X,"g"),ae=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),se=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=se;function ne(e){var t=O(e);return t.match(te)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,i={},n=r.query.split("&"),o=0,d=n.length;o<d;++o){var c=n[o].split("=");switch(c[0]){case"to":for(var u=c[1].split(","),l=0,h=u.length;l<h;++l)a.push(u[l]);break;case"subject":r.subject=H(c[1],t);break;case"body":r.body=H(c[1],t);break;default:s=!0,i[H(c[0],t)]=H(c[1],t)}}s&&(r.headers=i)}r.query=void 0;for(var p=0,m=a.length;p<m;++p){var f=a[p].split("@");if(f[0]=H(f[0]),t.unicodeSupport)f[1]=H(f[1],t).toLowerCase();else try{f[1]=E(H(f[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}a[p]=f.join("@")}return r},serialize:function(e,t){var r,a=e,i=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(i){for(var n=0,o=i.length;n<o;++n){var d=String(i[n]),c=d.lastIndexOf("@"),u=d.slice(0,c).replace(re,ne).replace(re,s).replace(ae,T),l=d.slice(c+1);try{l=t.iri?S(l):E(H(l,t).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}i[n]=u+"@"+l}a.path=i.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var p=[];for(var m in h)h[m]!==J[m]&&p.push(m.replace(re,ne).replace(re,s).replace(se,T)+"="+h[m].replace(re,ne).replace(re,s).replace(ie,T));return p.length&&(a.query=p.join("&")),a}},de=/^([^\:]+)\:(.*)/,ce={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(de),a=e;if(r){var s=t.scheme||a.scheme||"urn",i=r[1].toLowerCase(),n=r[2],o=s+":"+(t.nid||i),d=R[o];a.nid=i,a.nss=n,a.path=void 0,d&&(a=d.parse(a,t))}else a.error=a.error||"URN can not be parsed.";return a},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",a=e.nid,s=r+":"+(t.nid||a),i=R[s];i&&(e=i.serialize(e,t));var n=e,o=e.nss;return n.path=(a||t.nid)+":"+o,n}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,le={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};R[U.scheme]=U,R[Q.scheme]=Q,R[B.scheme]=B,R[W.scheme]=W,R[oe.scheme]=oe,R[ce.scheme]=ce,R[le.scheme]=le,e.SCHEMES=R,e.pctEncChar=T,e.pctDecChars=O,e.parse=F,e.removeDotSegments=q,e.serialize=z,e.resolveComponents=V,e.resolve=function(e,t,r){var a=function(e,t){var r=e;if(t)for(var a in t)r[a]=t[a];return r}({scheme:"null"},r);return z(V(F(e,a),F(t,a),a,!0),a)},e.normalize=function(e,t){return"string"==typeof e?e=z(F(e,t),t):"object"===a(e)&&(e=F(z(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=z(F(e,r),r):"object"===a(e)&&(e=z(e,r)),"string"==typeof t?t=z(F(t,r),r):"object"===a(t)&&(t=z(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?o.ESCAPE:n.ESCAPE,T)},e.unescapeComponent=H,Object.defineProperty(e,"__esModule",{value:!0})}(t)},1373:function(e,t,r){"use strict";var a=/^[a-z_$][a-z0-9_$-]*$/i,s=r(9602),i=r(6351);e.exports={add:function(e,t){var r=this.RULES;if(r.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!a.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var i=t.type;if(Array.isArray(i))for(var n=0;n<i.length;n++)d(e,i[n],t);else d(e,i,t);var o=t.metaSchema;o&&(t.$data&&this._opts.$data&&(o={anyOf:[o,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(o,!0))}function d(e,t,a){for(var i,n=0;n<r.length;n++){var o=r[n];if(o.type==t){i=o;break}}i||(i={type:t,rules:[]},r.push(i));var d={keyword:e,definition:a,custom:!0,code:s,implements:a.implements};i.rules.push(d),r.custom[e]=d}return r.keywords[e]=r.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var a=t[r].rules,s=0;s<a.length;s++)if(a[s].keyword==e){a.splice(s,1);break}return this},validate:function e(t,r){e.errors=null;var a=this._validateKeyword=this._validateKeyword||this.compile(i,!0);if(a(t))return!0;if(e.errors=a.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(a.errors));return!1}}},1525:function(e){"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,n=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",a="schema"+i):a=o;var p="maximum"==t,m=p?"exclusiveMaximum":"exclusiveMinimum",f=e.schema[m],v=e.opts.$data&&f&&f.$data,g=p?"<":">",y=p?">":"<",_=void 0;if(!h&&"number"!=typeof o&&void 0!==o)throw new Error(t+" must be number");if(!v&&void 0!==f&&"number"!=typeof f&&"boolean"!=typeof f)throw new Error(m+" must be number or boolean");if(v){var b,w=e.util.getData(f.$data,n,e.dataPathArr),x="exclusive"+i,P="exclType"+i,k="exclIsNumber"+i,E="' + "+(R="op"+i)+" + '";s+=" var schemaExcl"+i+" = "+w+"; ",s+=" var "+x+"; var "+P+" = typeof "+(w="schemaExcl"+i)+"; if ("+P+" != 'boolean' && "+P+" != 'undefined' && "+P+" != 'number') { ",_=m,(b=b||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ";var S=s;s=b.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+P+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+l+" "+y+"= "+w+" : "+l+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+l+" "+y+"= "+a+" : "+l+" "+y+" "+a+" ) || "+l+" !== "+l+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===o&&(_=m,c=e.errSchemaPath+"/"+m,a=w,h=v)}else if(E=g,(k="number"==typeof f)&&h){var R="'"+E+"'";s+=" if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+f+" "+g+"= "+a+" ? "+l+" "+y+"= "+f+" : "+l+" "+y+" "+a+" ) || "+l+" !== "+l+") { "}else k&&void 0===o?(x=!0,_=m,c=e.errSchemaPath+"/"+m,a=f,y+="="):(k&&(a=Math[p?"min":"max"](f,o)),f===(!k||a)?(x=!0,_=m,c=e.errSchemaPath+"/"+m,y+="="):(x=!1,E+="=")),R="'"+E+"'",s+=" if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+l+" "+y+" "+a+" || "+l+" !== "+l+") { ";return _=_||t,(b=b||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+R+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+E+" ",s+=h?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+d:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ",S=s,s=b.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}},1688:function(e){"use strict";var t=e.exports=function(){this._cache={}};t.prototype.put=function(e,t){this._cache[e]=t},t.prototype.get=function(e){return this._cache[e]},t.prototype.del=function(e){delete this._cache[e]},t.prototype.clear=function(){this._cache={}}},1780:function(e){"use strict";e.exports=JSON.parse('{"$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":true,"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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":true}')},1948:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=d,a+=" var "+l+" = errors; ";var m,f=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(m=h.opts.allErrors,h.opts.allErrors=!1),a+=" "+e.validate(h)+" ",h.createErrors=!0,m&&(h.opts.allErrors=m),e.compositeRule=h.compositeRule=f,a+=" if ("+p+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(a+=" if (false) { ");return a}},2416:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var f="valid"+p.level,v=p.baseId,g="prevValid"+s,y="passingSchemas"+s;a+="var "+h+" = errors , "+g+" = false , "+l+" = false , "+y+" = null; ";var _=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=n;if(b)for(var w,x=-1,P=b.length-1;x<P;)w=b[x+=1],(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w:e.util.schemaHasRules(w,e.RULES.all))?(p.schema=w,p.schemaPath=o+"["+x+"]",p.errSchemaPath=d+"/"+x,a+=" "+e.validate(p)+" ",p.baseId=v):a+=" var "+f+" = true; ",x&&(a+=" if ("+f+" && "+g+") { "+l+" = false; "+y+" = ["+y+", "+x+"]; } else { ",m+="}"),a+=" if ("+f+") { "+l+" = "+g+" = true; "+y+" = "+x+"; }";return e.compositeRule=p.compositeRule=_,a+=m+"if (!"+l+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},2442:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||"");if(!1===e.opts.format)return c&&(a+=" if (true) { "),a;var l,h=e.opts.$data&&n&&n.$data;h?(a+=" var schema"+s+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",l="schema"+s):l=n;var p=e.opts.unknownFormats,m=Array.isArray(p);if(h)a+=" var "+(f="format"+s)+" = formats["+l+"]; var "+(v="isObject"+s)+" = typeof "+f+" == 'object' && !("+f+" instanceof RegExp) && "+f+".validate; var "+(g="formatType"+s)+" = "+v+" && "+f+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+s+" = "+f+".async; "),a+=" "+f+" = "+f+".validate; } if ( ",h&&(a+=" ("+l+" !== undefined && typeof "+l+" != 'string') || "),a+=" (","ignore"!=p&&(a+=" ("+l+" && !"+f+" ",m&&(a+=" && self._opts.unknownFormats.indexOf("+l+") == -1 "),a+=") || "),a+=" ("+f+" && "+g+" == '"+r+"' && !(typeof "+f+" == 'function' ? ",e.async?a+=" (async"+s+" ? await "+f+"("+u+") : "+f+"("+u+")) ":a+=" "+f+"("+u+") ",a+=" : "+f+".test("+u+"))))) {";else{var f;if(!(f=e.formats[n])){if("ignore"==p)return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(a+=" if (true) { "),a;if(m&&p.indexOf(n)>=0)return c&&(a+=" if (true) { "),a;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof f&&!(f instanceof RegExp)&&f.validate)&&f.type||"string";if(v){var y=!0===f.async;f=f.validate}if(g!=r)return c&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(_="formats"+e.util.getProperty(n)+".validate")+"("+u+"))) { "}else{a+=" if (! ";var _="formats"+e.util.getProperty(n);v&&(_+=".validate"),a+="function"==typeof f?" "+_+"("+u+") ":" "+_+".test("+u+") ",a+=") { "}}var b=b||[];b.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { format: ",a+=h?""+l:""+e.util.toQuotedString(n),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=h?"' + "+l+" + '":""+e.util.escapeQuotes(n),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+o:""+e.util.toQuotedString(n),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var w=a;return a=b.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+w+"]); ":a+=" validate.errors = ["+w+"]; return false; ":a+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { "),a}},2776:function(e){"use strict";e.exports=function(e,t,r){var a,s,i=" ",n=e.level,o=e.dataLevel,d=e.schema[t],c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),h="valid"+n;if("#"==d||"#/"==d)e.isRoot?(a=e.async,s="validate"):(a=!0===e.root.schema.$async,s="root.refVal[0]");else{var p=e.resolveRef(e.baseId,d,e.isRoot);if(void 0===p){var m=e.MissingRefError.message(e.baseId,d);if("fail"==e.opts.missingRefs){e.logger.error(m),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(d)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(d)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(d)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var f=i;i=y.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,d,m);e.logger.warn(m),u&&(i+=" if (true) { ")}}else if(p.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=p.schema,v.schemaPath="",v.errSchemaPath=d,i+=" "+e.validate(v).replace(/validate\.schema/g,p.code)+" ",u&&(i+=" if ("+g+") { ")}else a=!0===p.$async||e.async&&!1!==p.$async,s=p.code}if(s){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+s+".call(this, ":i+=" "+s+"( ",i+=" "+l+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var _=i+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(i+=" var "+h+"; "),i+=" try { await "+_+"; ",u&&(i+=" "+h+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(i+=" "+h+" = false; "),i+=" } ",u&&(i+=" if ("+h+") { ")}else i+=" if (!"+_+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",u&&(i+=" else { ")}return i}},3020:function(e){"use strict";var t=e.exports=function(e,t,a){"function"==typeof t&&(a=t,t={}),r(t,"function"==typeof(a=t.cb||a)?a:a.pre||function(){},a.post||function(){},e,"",e)};function r(e,s,i,n,o,d,c,u,l,h){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var p in s(n,o,d,c,u,l,h),n){var m=n[p];if(Array.isArray(m)){if(p in t.arrayKeywords)for(var f=0;f<m.length;f++)r(e,s,i,m[f],o+"/"+p+"/"+f,d,o,p,n,f)}else if(p in t.propsKeywords){if(m&&"object"==typeof m)for(var v in m)r(e,s,i,m[v],o+"/"+p+"/"+a(v),d,o,p,n,v)}else(p in t.keywords||e.allKeys&&!(p in t.skipKeywords))&&r(e,s,i,m,o+"/"+p,d,o,p,n)}i(n,o,d,c,u,l,h)}}function a(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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}},3022:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,f=e.schema.then,v=e.schema.else,g=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0||!1===f:e.util.schemaHasRules(f,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all)),_=p.baseId;if(g||y){var b;p.createErrors=!1,p.schema=n,p.schemaPath=o,p.errSchemaPath=d,a+=" var "+h+" = errors; var "+l+" = true; ";var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,a+=" "+e.validate(p)+" ",p.baseId=_,p.createErrors=!0,a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=w,g?(a+=" if ("+m+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(p)+" ",p.baseId=_,a+=" "+l+" = "+m+"; ",g&&y?a+=" var "+(b="ifClause"+s)+" = 'then'; ":b="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+m+") { ",y&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(p)+" ",p.baseId=_,a+=" "+l+" = "+m+"; ",g&&y?a+=" var "+(b="ifClause"+s)+" = 'else'; ":b="'else'",a+=" } "),a+=" if (!"+l+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",c&&(a+=" else { ")}else c&&(a+=" if (true) { ");return a}},3204:function(e,t,r){"use strict";var a=r(1353),s=r(8991),i=r(7710),n=r(3867),o=r(3020);function d(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return d.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof n)return m(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var s,i,o,u=c.call(this,t,r);return u&&(s=u.schema,t=u.root,o=u.baseId),s instanceof n?i=s.validate||e.call(this,s.schema,t,void 0,o):void 0!==s&&(i=m(s,this._opts.inlineRefs)?s:e.call(this,s,t,void 0,o)),i}function c(e,t){var r=a.parse(t),s=y(r),i=g(this._getId(e.schema));if(0===Object.keys(e.schema).length||s!==i){var o=b(s),d=this._refs[o];if("string"==typeof d)return u.call(this,e,d,r);if(d instanceof n)d.validate||this._compile(d),e=d;else{if(!((d=this._schemas[o])instanceof n))return;if(d.validate||this._compile(d),o==b(t))return{schema:d,root:e,baseId:i};e=d}if(!e.schema)return;i=g(this._getId(e.schema))}return h.call(this,r,i,e.schema,e)}function u(e,t,r){var a=c.call(this,e,t);if(a){var s=a.schema,i=a.baseId;e=a.root;var n=this._getId(s);return n&&(i=w(i,n)),h.call(this,r,i,s,e)}}e.exports=d,d.normalizeId=b,d.fullPath=g,d.url=w,d.ids=function(e){var t=b(this._getId(e)),r={"":t},n={"":g(t,!1)},d={},c=this;return o(e,{allKeys:!0},function(e,t,o,u,l,h,p){if(""!==t){var m=c._getId(e),f=r[u],v=n[u]+"/"+l;if(void 0!==p&&(v+="/"+("number"==typeof p?p:i.escapeFragment(p))),"string"==typeof m){m=f=b(f?a.resolve(f,m):m);var g=c._refs[m];if("string"==typeof g&&(g=c._refs[g]),g&&g.schema){if(!s(e,g.schema))throw new Error('id "'+m+'" resolves to more than one schema')}else if(m!=b(v))if("#"==m[0]){if(d[m]&&!s(e,d[m]))throw new Error('id "'+m+'" resolves to more than one schema');d[m]=e}else c._refs[m]=v}r[t]=f,n[t]=v}}),d},d.inlineRef=m,d.schema=c;var l=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),n=1;n<s.length;n++){var o=s[n];if(o){if(void 0===(r=r[o=i.unescapeFragment(o)]))break;var d;if(!l[o]&&((d=this._getId(r))&&(t=w(t,d)),r.$ref)){var u=w(t,r.$ref),h=c.call(this,a,u);h&&(r=h.schema,a=h.root,t=h.baseId)}}}return void 0!==r&&r!==a.schema?{schema:r,root:a,baseId:t}:void 0}}var p=i.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function m(e,t){return!1!==t&&(void 0===t||!0===t?f(e):t?v(e)<=t:void 0)}function f(e){var t;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(t=e[r])&&!f(t))return!1}else for(var a in e){if("$ref"==a)return!1;if("object"==typeof(t=e[a])&&!f(t))return!1}return!0}function v(e){var t,r=0;if(Array.isArray(e)){for(var a=0;a<e.length;a++)if("object"==typeof(t=e[a])&&(r+=v(t)),r==1/0)return 1/0}else for(var s in e){if("$ref"==s)return 1/0;if(p[s])r++;else if("object"==typeof(t=e[s])&&(r+=v(t)+1),r==1/0)return 1/0}return r}function g(e,t){return!1!==t&&(e=b(e)),y(a.parse(e))}function y(e){return a.serialize(e).split("#")[0]+"#"}var _=/#\/?$/;function b(e){return e?e.replace(_,""):""}function w(e,t){return t=b(t),a.resolve(e,t)}},3458:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h=e.opts.$data&&n&&n.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; "),h||(a+=" var schema"+s+" = validate.schema"+o+";"),a+="var "+l+" = equal("+u+", schema"+s+"); if (!"+l+") { ";var p=p||[];p.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValue: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to constant' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var m=a;return a=p.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",c&&(a+=" else { "),a}},3497:function(e,t,r){"use strict";var a=r(3204);function s(e,t,r){this.message=r||s.message(e,t),this.missingRef=a.url(e,t),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function i(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}e.exports={Validation:i(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:i(s)},s.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},3867:function(e,t,r){"use strict";var a=r(7710);e.exports=function(e){a.copy(e,this)}},4324:function(e){"use strict";var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,r){for(var a=0;a<r.length;a++){e=JSON.parse(JSON.stringify(e));var s,i=r[a].split("/"),n=e;for(s=1;s<i.length;s++)n=n[i[s]];for(s=0;s<t.length;s++){var o=t[s],d=n[o];d&&(n[o]={anyOf:[d,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},4431:function(e){"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,n=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",a="schema"+i):a=o,s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),s+=" !"+(h?"(new RegExp("+a+"))":e.usePattern(o))+".test("+l+") ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",s+=h?""+a:""+e.util.toQuotedString(o),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=h?"' + "+a+" + '":""+e.util.escapeQuotes(o),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+d:""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},4720:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h=e.opts.$data&&n&&n.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ");var p="schema"+s;if(!h)if(n.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var m=[],f=n;if(f)for(var v,g=-1,y=f.length-1;g<y;){v=f[g+=1];var _=e.schema.properties[v];_&&(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:e.util.schemaHasRules(_,e.RULES.all))||(m[m.length]=v)}}else m=n;if(h||m.length){var b=e.errorPath,w=h||m.length>=e.opts.loopRequired,x=e.opts.ownProperties;if(c)if(a+=" var missing"+s+"; ",w){h||(a+=" var "+p+" = validate.schema"+o+"; ");var P="' + "+(O="schema"+s+"["+(R="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,O,e.opts.jsonPointers)),a+=" var "+l+" = true; ",h&&(a+=" if (schema"+s+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+s+")) "+l+" = false; else {"),a+=" for (var "+R+" = 0; "+R+" < "+p+".length; "+R+"++) { "+l+" = "+u+"["+p+"["+R+"]] !== undefined ",x&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", "+p+"["+R+"]) "),a+="; if (!"+l+") break; } ",h&&(a+=" } "),a+=" if (!"+l+") { ",(E=E||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var k=a;a=E.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+k+"]); ":a+=" validate.errors = ["+k+"]; return false; ":a+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var E,S=m;if(S)for(var R=-1,T=S.length-1;R<T;)A=S[R+=1],R&&(a+=" || "),a+=" ( ( "+(N=u+(I=e.util.getProperty(A)))+" === undefined ",x&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(A)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?A:I)+") ) ";a+=") { ",P="' + "+(O="missing"+s)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,O,!0):b+" + "+O),(E=E||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",k=a,a=E.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+k+"]); ":a+=" validate.errors = ["+k+"]; return false; ":a+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else if(w){var O;h||(a+=" var "+p+" = validate.schema"+o+"; "),P="' + "+(O="schema"+s+"["+(R="i"+s)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,O,e.opts.jsonPointers)),h&&(a+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),a+=" for (var "+R+" = 0; "+R+" < "+p+".length; "+R+"++) { if ("+u+"["+p+"["+R+"]] === undefined ",x&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", "+p+"["+R+"]) "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(a+=" } ")}else{var C=m;if(C)for(var A,$=-1,j=C.length-1;$<j;){A=C[$+=1];var I=e.util.getProperty(A),N=(P=e.util.escapeQuotes(A),u+I);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,A,e.opts.jsonPointers)),a+=" if ( "+N+" === undefined ",x&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(A)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=b}else c&&(a+=" if (true) {");return a}},5736:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h=e.opts.$data&&n&&n.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ");var p="i"+s,m="schema"+s;h||(a+=" var "+m+" = validate.schema"+o+";"),a+="var "+l+";",h&&(a+=" if (schema"+s+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+s+")) "+l+" = false; else {"),a+=l+" = false;for (var "+p+"=0; "+p+"<"+m+".length; "+p+"++) if (equal("+u+", "+m+"["+p+"])) { "+l+" = true; break; }",h&&(a+=" } "),a+=" if (!"+l+") { ";var f=f||[];f.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;return a=f.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",c&&(a+=" else { "),a}},6351:function(e,t,r){"use strict";var a=r(1780);e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:a.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:a.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"}]}}}},6540:function(e,t,r){"use strict";var a=r(3204),s=r(7710),i=r(3497),n=r(1130),o=r(9787),d=s.ucs2length,c=r(8991),u=i.Validation;function l(e,t,r){var a=p.call(this,e,t,r);return a>=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function h(e,t,r){var a=p.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function p(e,t,r){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==t&&s.baseId==r)return a}return-1}function m(e,t){return"var pattern"+e+" = new RegExp("+s.toQuotedString(t[e])+");"}function f(e){return"var default"+e+" = defaults["+e+"];"}function v(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function g(e){return"var customRule"+e+" = customRules["+e+"];"}function y(e,t){if(!e.length)return"";for(var r="",a=0;a<e.length;a++)r+=t(a,e);return r}e.exports=function e(t,r,p,_){var b=this,w=this._opts,x=[void 0],P={},k=[],E={},S=[],R={},T=[];r=r||{schema:t,refVal:x,refs:P};var O=l.call(this,t,r,_),C=this._compilations[O.index];if(O.compiling)return C.callValidate=function e(){var t=C.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var A=this._formats,$=this.RULES;try{var j=N(t,r,p,_);C.validate=j;var I=C.callValidate;return I&&(I.schema=j.schema,I.errors=null,I.refs=j.refs,I.refVal=j.refVal,I.root=j.root,I.$async=j.$async,w.sourceCode&&(I.source=j.source)),j}finally{h.call(this,t,r,_)}function N(t,n,l,h){var p=!n||n&&n.schema==t;if(n.schema!=r.schema)return e.call(b,t,n,l,h);var _,E=!0===t.$async,R=o({isTop:!0,schema:t,isRoot:p,baseId:h,root:n,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:i.MissingRef,RULES:$,validate:o,util:s,resolve:a,resolveRef:F,usePattern:M,useDefault:L,useCustomRule:q,opts:w,formats:A,logger:b.logger,self:b});R=y(x,v)+y(k,m)+y(S,f)+y(T,g)+R,w.processCode&&(R=w.processCode(R,t));try{_=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",R)(b,$,A,r,x,S,T,c,d,u),x[0]=_}catch(e){throw b.logger.error("Error compiling schema, function code:",R),e}return _.schema=t,_.errors=null,_.refs=P,_.refVal=x,_.root=p?_:n,E&&(_.$async=!0),!0===w.sourceCode&&(_.source={code:R,patterns:k,defaults:S}),_}function F(t,s,i){s=a.url(t,s);var n,o,d=P[s];if(void 0!==d)return D(n=x[d],o="refVal["+d+"]");if(!i&&r.refs){var c=r.refs[s];if(void 0!==c)return D(n=r.refVal[c],o=Z(s,n))}o=Z(s);var u=a.call(b,N,r,s);if(void 0===u){var l=p&&p[s];l&&(u=a.inlineRef(l,w.inlineRefs)?l:e.call(b,l,r,p,t))}if(void 0!==u)return function(e,t){var r=P[e];x[r]=t}(s,u),D(u,o);!function(e){delete P[e]}(s)}function Z(e,t){var r=x.length;return x[r]=t,P[e]=r,"refVal"+r}function D(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function M(e){var t=E[e];return void 0===t&&(t=E[e]=k.length,k[t]=e),"pattern"+t}function L(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return s.toQuotedString(e);case"object":if(null===e)return"null";var t=n(e),r=R[t];return void 0===r&&(r=R[t]=S.length,S[r]=e),"default"+r}}function q(e,t,r,a){if(!1!==b._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var i=e.definition.validateSchema;if(i&&!i(t)){var n="keyword schema is invalid: "+b.errorsText(i.errors);if("log"!=b._opts.validateSchema)throw new Error(n);b.logger.error(n)}}var o,d=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(d)o=d.call(b,t,r,a);else if(u)o=u.call(b,t,r,a),!1!==w.validateSchema&&b.validateSchema(o,!0);else if(c)o=c.call(b,a,e.keyword,t,r);else if(!(o=e.definition.validate))return;if(void 0===o)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var l=T.length;return T[l]=o,{code:"customRule"+l,validate:o}}}},6862:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(a+="var "+l+" = errors;",e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=d;var m="key"+s,f="idx"+s,v="i"+s,g="' + "+m+" + '",y="data"+(h.dataLevel=e.dataLevel+1),_="dataProperties"+s,b=e.opts.ownProperties,w=e.baseId;b&&(a+=" var "+_+" = undefined; "),a+=b?" "+_+" = "+_+" || Object.keys("+u+"); for (var "+f+"=0; "+f+"<"+_+".length; "+f+"++) { var "+m+" = "+_+"["+f+"]; ":" for (var "+m+" in "+u+") { ",a+=" var startErrs"+s+" = errors; ";var x=m,P=e.compositeRule;e.compositeRule=h.compositeRule=!0;var k=e.validate(h);h.baseId=w,e.util.varOccurences(k,y)<2?a+=" "+e.util.varReplace(k,y,x)+" ":a+=" var "+y+" = "+x+"; "+k+" ",e.compositeRule=h.compositeRule=P,a+=" if (!"+p+") { for (var "+v+"=startErrs"+s+"; "+v+"<errors; "+v+"++) { vErrors["+v+"].propertyName = "+m+"; } var err = ",!1!==e.createErrors?(a+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { propertyName: '"+g+"' } ",!1!==e.opts.messages&&(a+=" , message: 'property name \\'"+g+"\\' is invalid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),c&&(a+=" break; "),a+=" } }"}return c&&(a+=" if ("+l+" == errors) {"),a}},7048:function(e,t,r){"use strict";var a=r(3497).MissingRef;e.exports=function e(t,r,s){var i=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof r&&(s=r,r=void 0);var n=o(t).then(function(){var e=i._addSchema(t,void 0,r);return e.validate||d(e)});return s&&n.then(function(e){s(null,e)},s),n;function o(t){var r=t.$schema;return r&&!i.getSchema(r)?e.call(i,{$ref:r},!0):Promise.resolve()}function d(e){try{return i._compile(e)}catch(t){if(t instanceof a)return function(t){var a=t.missingSchema;if(c(a))throw new Error("Schema "+a+" is loaded but "+t.missingRef+" cannot be resolved");var s=i._loadingSchemas[a];return s||(s=i._loadingSchemas[a]=i._opts.loadSchema(a)).then(n,n),s.then(function(e){if(!c(a))return o(e).then(function(){c(a)||i.addSchema(e,a,void 0,r)})}).then(function(){return d(e)});function n(){delete i._loadingSchemas[a]}function c(e){return i._refs[e]||i._schemas[e]}}(t);throw t}}}},7148:function(e){"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,n=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",a="schema"+i):a=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="var division"+i+";if (",h&&(s+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),s+=" (division"+i+" = "+l+" / "+a+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",h&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=h?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+d:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},7276:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,f="key"+s,v="idx"+s,g=h.dataLevel=e.dataLevel+1,y="data"+g,_="dataProperties"+s,b=Object.keys(n||{}).filter(j),w=e.schema.patternProperties||{},x=Object.keys(w).filter(j),P=e.schema.additionalProperties,k=b.length||x.length,E=!1===P,S="object"==typeof P&&Object.keys(P).length,R=e.opts.removeAdditional,T=E||S||R,O=e.opts.ownProperties,C=e.baseId,A=e.schema.required;if(A&&(!e.opts.$data||!A.$data)&&A.length<e.opts.loopRequired)var $=e.util.toHash(A);function j(e){return"__proto__"!==e}if(a+="var "+l+" = errors;var "+m+" = true;",O&&(a+=" var "+_+" = undefined;"),T){if(a+=O?" "+_+" = "+_+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+f+" = "+_+"["+v+"]; ":" for (var "+f+" in "+u+") { ",k){if(a+=" var isAdditional"+s+" = !(false ",b.length)if(b.length>8)a+=" || validate.schema"+o+".hasOwnProperty("+f+") ";else{var I=b;if(I)for(var N=-1,F=I.length-1;N<F;)W=I[N+=1],a+=" || "+f+" == "+e.util.toQuotedString(W)+" "}if(x.length){var Z=x;if(Z)for(var D=-1,M=Z.length-1;D<M;)ie=Z[D+=1],a+=" || "+e.usePattern(ie)+".test("+f+") "}a+=" ); if (isAdditional"+s+") { "}if("all"==R)a+=" delete "+u+"["+f+"]; ";else{var L=e.errorPath,q="' + "+f+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers)),E)if(R)a+=" delete "+u+"["+f+"]; ";else{a+=" "+m+" = false; ";var z=d;d=e.errSchemaPath+"/additionalProperties",(re=re||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { additionalProperty: '"+q+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is an invalid additional property":a+="should NOT have additional properties",a+="' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var V=a;a=re.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+V+"]); ":a+=" validate.errors = ["+V+"]; return false; ":a+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=z,c&&(a+=" break; ")}else if(S)if("failing"==R){a+=" var "+l+" = errors; ";var H=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=P,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers);var U=u+"["+f+"]";h.dataPathArr[g]=f;var Q=e.validate(h);h.baseId=C,e.util.varOccurences(Q,y)<2?a+=" "+e.util.varReplace(Q,y,U)+" ":a+=" var "+y+" = "+U+"; "+Q+" ",a+=" if (!"+m+") { errors = "+l+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+u+"["+f+"]; } ",e.compositeRule=h.compositeRule=H}else h.schema=P,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers),U=u+"["+f+"]",h.dataPathArr[g]=f,Q=e.validate(h),h.baseId=C,e.util.varOccurences(Q,y)<2?a+=" "+e.util.varReplace(Q,y,U)+" ":a+=" var "+y+" = "+U+"; "+Q+" ",c&&(a+=" if (!"+m+") break; ");e.errorPath=L}k&&(a+=" } "),a+=" } ",c&&(a+=" if ("+m+") { ",p+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(b.length){var B=b;if(B)for(var W,J=-1,G=B.length-1;J<G;){var Y=n[W=B[J+=1]];if(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all)){var X=e.util.getProperty(W),ee=(U=u+X,K&&void 0!==Y.default);if(h.schema=Y,h.schemaPath=o+X,h.errSchemaPath=d+"/"+e.util.escapeFragment(W),h.errorPath=e.util.getPath(e.errorPath,W,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(W),Q=e.validate(h),h.baseId=C,e.util.varOccurences(Q,y)<2){Q=e.util.varReplace(Q,y,U);var te=U}else te=y,a+=" var "+y+" = "+U+"; ";if(ee)a+=" "+Q+" ";else{if($&&$[W]){a+=" if ( "+te+" === undefined ",O&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(W)+"') "),a+=") { "+m+" = false; ",L=e.errorPath,z=d;var re,ae=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(L,W,e.opts.jsonPointers)),d=e.errSchemaPath+"/required",(re=re||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+ae+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+ae+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",V=a,a=re.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+V+"]); ":a+=" validate.errors = ["+V+"]; return false; ":a+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=z,e.errorPath=L,a+=" } else { "}else c?(a+=" if ( "+te+" === undefined ",O&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(W)+"') "),a+=") { "+m+" = true; } else { "):(a+=" if ("+te+" !== undefined ",O&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(W)+"') "),a+=" ) { ");a+=" "+Q+" } "}}c&&(a+=" if ("+m+") { ",p+="}")}}if(x.length){var se=x;if(se)for(var ie,ne=-1,oe=se.length-1;ne<oe;)Y=w[ie=se[ne+=1]],(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all))&&(h.schema=Y,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ie),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ie),a+=O?" "+_+" = "+_+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+f+" = "+_+"["+v+"]; ":" for (var "+f+" in "+u+") { ",a+=" if ("+e.usePattern(ie)+".test("+f+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers),U=u+"["+f+"]",h.dataPathArr[g]=f,Q=e.validate(h),h.baseId=C,e.util.varOccurences(Q,y)<2?a+=" "+e.util.varReplace(Q,y,U)+" ":a+=" var "+y+" = "+U+"; "+Q+" ",c&&(a+=" if (!"+m+") break; "),a+=" } ",c&&(a+=" else "+m+" = true; "),a+=" } ",c&&(a+=" if ("+m+") { ",p+="}"))}return c&&(a+=" "+p+" if ("+l+" == errors) {"),a}},7294:function(e){"use strict";e.exports=JSON.parse('{"$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":false}')},7539:function(e){"use strict";e.exports=function(e){for(var t,r=0,a=e.length,s=0;s<a;)r++,(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<a&&56320==(64512&(t=e.charCodeAt(s)))&&s++;return r}},7676:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,f={},v={},g=e.opts.ownProperties;for(w in n)if("__proto__"!=w){var y=n[w],_=Array.isArray(y)?v:f;_[w]=y}a+="var "+l+" = errors;";var b=e.errorPath;for(var w in a+="var missing"+s+";",v)if((_=v[w]).length){if(a+=" if ( "+u+e.util.getProperty(w)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(w)+"') "),c){a+=" && ( ";var x=_;if(x)for(var P=-1,k=x.length-1;P<k;)C=x[P+=1],P&&(a+=" || "),a+=" ( ( "+(I=u+(j=e.util.getProperty(C)))+" === undefined ",g&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(C)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?C:j)+") ) ";a+=")) { ";var E="missing"+s,S="' + "+E+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,E,!0):b+" + "+E);var R=R||[];R.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes(w)+"', missingProperty: '"+S+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==_.length?a+="property "+e.util.escapeQuotes(_[0]):a+="properties "+e.util.escapeQuotes(_.join(", ")),a+=" when property "+e.util.escapeQuotes(w)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var T=a;a=R.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+T+"]); ":a+=" validate.errors = ["+T+"]; return false; ":a+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{a+=" ) { ";var O=_;if(O)for(var C,A=-1,$=O.length-1;A<$;){C=O[A+=1];var j=e.util.getProperty(C),I=(S=e.util.escapeQuotes(C),u+j);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,C,e.opts.jsonPointers)),a+=" if ( "+I+" === undefined ",g&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(C)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes(w)+"', missingProperty: '"+S+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==_.length?a+="property "+e.util.escapeQuotes(_[0]):a+="properties "+e.util.escapeQuotes(_.join(", ")),a+=" when property "+e.util.escapeQuotes(w)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}a+=" } ",c&&(p+="}",a+=" else { ")}e.errorPath=b;var N=h.baseId;for(var w in f)y=f[w],(e.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0||!1===y:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+m+" = true; if ( "+u+e.util.getProperty(w)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(w)+"') "),a+=") { ",h.schema=y,h.schemaPath=o+e.util.getProperty(w),h.errSchemaPath=d+"/"+e.util.escapeFragment(w),a+=" "+e.validate(h)+" ",h.baseId=N,a+=" } ",c&&(a+=" if ("+m+") { ",p+="}"));return c&&(a+=" "+p+" if ("+l+" == errors) {"),a}},7710:function(e,t,r){"use strict";function a(e,t,r,a){var s=a?" !== ":" === ",i=a?" || ":" && ",n=a?"!":"",o=a?"":"!";switch(e){case"null":return t+s+"null";case"array":return n+"Array.isArray("+t+")";case"object":return"("+n+t+i+"typeof "+t+s+'"object"'+i+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+s+'"number"'+i+o+"("+t+" % 1)"+i+t+s+t+(r?i+n+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+s+'"'+e+'"'+(r?i+n+"isFinite("+t+")":"")+")";default:return"typeof "+t+s+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t,r){if(1===e.length)return a(e[0],t,r,!0);var s="",n=i(e);for(var o in n.array&&n.object&&(s=n.null?"(":"(!"+t+" || ",s+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)s+=(s?" && ":"")+a(o,t,r,!0);return s},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a<t.length;a++){var i=t[a];(s[i]||"array"===e&&"array"===i)&&(r[r.length]=i)}if(r.length)return r}else{if(s[t])return[t];if("array"===e&&"array"===t)return["array"]}},toHash:i,getProperty:d,escapeQuotes:c,equal:r(8991),ucs2length:r(7539),varOccurences:function(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0},varReplace:function(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0},schemaHasRulesExcept:function(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var a in e)if(a!=r&&t[a])return!0},schemaUnknownRules:function(e,t){if("boolean"!=typeof e)for(var r in e)if(!t[r])return r},toQuotedString:u,getPathExpr:function(e,t,r,a){return p(e,r?"'/' + "+t+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,r){return p(e,u(r?"/"+m(t):d(t)))},getData:function(e,t,r){var a,s,i,n;if(""===e)return"rootData";if("/"==e[0]){if(!l.test(e))throw new Error("Invalid JSON-pointer: "+e);s=e,i="rootData"}else{if(!(n=e.match(h)))throw new Error("Invalid JSON-pointer: "+e);if(a=+n[1],"#"==(s=n[2])){if(a>=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!s)return i}for(var o=i,c=s.split("/"),u=0;u<c.length;u++){var p=c[u];p&&(o+=" && "+(i+=d(f(p))))}return o},unescapeFragment:function(e){return f(decodeURIComponent(e))},unescapeJsonPointer:f,escapeFragment:function(e){return encodeURIComponent(m(e))},escapeJsonPointer:m};var s=i(["string","number","integer","boolean","null"]);function i(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}var n=/^[a-z$_][a-z$_0-9]*$/i,o=/'|\\/g;function d(e){return"number"==typeof e?"["+e+"]":n.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(o,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function u(e){return"'"+c(e)+"'"}var l=/^\/(?:[^~]|~0|~1)*$/,h=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function p(e,t){return'""'==e?t:(e+" + "+t).replace(/([^\\])' \+ '/g,"$1")}function m(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},8203:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.schema[t],i=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,d=e.util.copy(e),c="";d.level++;var u="valid"+d.level,l=d.baseId,h=!0,p=s;if(p)for(var m,f=-1,v=p.length-1;f<v;)m=p[f+=1],(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all))&&(h=!1,d.schema=m,d.schemaPath=i+"["+f+"]",d.errSchemaPath=n+"/"+f,a+=" "+e.validate(d)+" ",d.baseId=l,o&&(a+=" if ("+u+") { ",c+="}"));return o&&(a+=h?" if (true) { ":" "+c.slice(0,-1)+" "),a}},8484:function(e){"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,n=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(n||""),h="valid"+i,p=e.opts.$data&&o&&o.$data;if(p?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",a="schema"+i):a=o,(o||p)&&!1!==e.opts.uniqueItems){p&&(s+=" var "+h+"; if ("+a+" === false || "+a+" === undefined) "+h+" = true; else if (typeof "+a+" != 'boolean') "+h+" = false; else { "),s+=" var i = "+l+".length , "+h+" = true , j; if (i > 1) { ";var m=e.schema.items&&e.schema.items.type,f=Array.isArray(m);if(!m||"object"==m||"array"==m||f&&(m.indexOf("object")>=0||m.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+l+"[i], "+l+"[j])) { "+h+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+l+"[i]; ";var v="checkDataType"+(f?"s":"");s+=" if ("+e.util[v](m,"item",e.opts.strictNumbers,!0)+") continue; ",f&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",p&&(s+=" } "),s+=" if (!"+h+") { ";var g=g||[];g.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+d:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ";var y=s;s=g.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+y+"]); ":s+=" validate.errors = ["+y+"]; return false; ":s+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}},8601:function(e){"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,n=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",a="schema"+i):a=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?s+=" "+l+".length ":s+=" ucs2length("+l+") ",s+=" "+p+" "+a+") { ";var m=t,f=f||[];f.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==t?"longer":"shorter",s+=" than ",s+=h?"' + "+a+" + '":""+o,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+d:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ";var v=s;return s=f.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},8665:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var f="valid"+p.level,v="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,_=e.baseId;if(a+="var "+h+" = errors;var "+l+";",Array.isArray(n)){var b=e.schema.additionalItems;if(!1===b){a+=" "+l+" = "+u+".length <= "+n.length+"; ";var w=d;d=e.errSchemaPath+"/additionalItems",a+=" if (!"+l+") { ";var x=x||[];x.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+n.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var P=a;a=x.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+P+"]); ":a+=" validate.errors = ["+P+"]; return false; ":a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",d=w,c&&(m+="}",a+=" else { ")}var k=n;if(k)for(var E,S=-1,R=k.length-1;S<R;)if(E=k[S+=1],e.opts.strictKeywords?"object"==typeof E&&Object.keys(E).length>0||!1===E:e.util.schemaHasRules(E,e.RULES.all)){a+=" "+f+" = true; if ("+u+".length > "+S+") { ";var T=u+"["+S+"]";p.schema=E,p.schemaPath=o+"["+S+"]",p.errSchemaPath=d+"/"+S,p.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0),p.dataPathArr[g]=S;var O=e.validate(p);p.baseId=_,e.util.varOccurences(O,y)<2?a+=" "+e.util.varReplace(O,y,T)+" ":a+=" var "+y+" = "+T+"; "+O+" ",a+=" } ",c&&(a+=" if ("+f+") { ",m+="}")}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0||!1===b:e.util.schemaHasRules(b,e.RULES.all))&&(p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+f+" = true; if ("+u+".length > "+n.length+") { for (var "+v+" = "+n.length+"; "+v+" < "+u+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),T=u+"["+v+"]",p.dataPathArr[g]=v,O=e.validate(p),p.baseId=_,e.util.varOccurences(O,y)<2?a+=" "+e.util.varReplace(O,y,T)+" ":a+=" var "+y+" = "+T+"; "+O+" ",c&&(a+=" if (!"+f+") break; "),a+=" } } ",c&&(a+=" if ("+f+") { ",m+="}"))}else(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all))&&(p.schema=n,p.schemaPath=o,p.errSchemaPath=d,a+=" for (var "+v+" = 0; "+v+" < "+u+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),T=u+"["+v+"]",p.dataPathArr[g]=v,O=e.validate(p),p.baseId=_,e.util.varOccurences(O,y)<2?a+=" "+e.util.varReplace(O,y,T)+" ":a+=" var "+y+" = "+T+"; "+O+" ",c&&(a+=" if (!"+f+") break; "),a+=" }");return c&&(a+=" "+m+" if ("+h+" == errors) {"),a}},8725:function(e,t,r){"use strict";var a=r(6540),s=r(3204),i=r(1688),n=r(3867),o=r(1130),d=r(9428),c=r(955),u=r(4324),l=r(7710);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var s=r(t);return!0!==r.$async&&(this.errors=r.errors),s},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i<e.length;i++)this.addSchema(e[i],void 0,r,a);return this}var n=this._getId(e);if(void 0!==n&&"string"!=typeof n)throw new Error("schema id must be string");return P(this,t=s.normalizeId(t||n)),this._schemas[t]=this._addSchema(e,r,a,!0),this},g.prototype.addMetaSchema=function(e,t,r){return this.addSchema(e,t,r,!0),this},g.prototype.validateSchema=function(e,t){var r,a,s=e.$schema;if(void 0!==s&&"string"!=typeof s)throw new Error("$schema must be a string");if(!(s=s||this._opts.defaultMeta||(r=this,a=r._opts.meta,r._opts.defaultMeta="object"==typeof a?r._getId(a)||a:r.getSchema(m)?m:void 0,r._opts.defaultMeta)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var i=this.validate(s,e);if(!i&&t){var n="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(n);this.logger.error(n)}return i},g.prototype.getSchema=function(e){var t=y(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var r=s.schema.call(e,{schema:{}},t);if(r){var i=r.schema,o=r.root,d=r.baseId,c=a.call(e,i,o,void 0,d);return e._fragments[t]=new n({ref:t,fragment:!0,schema:i,root:o,baseId:d,validate:c}),c}}(this,e)}},g.prototype.removeSchema=function(e){if(e instanceof RegExp)return _(this,this._schemas,e),_(this,this._refs,e),this;switch(typeof e){case"undefined":return _(this,this._schemas),_(this,this._refs),this._cache.clear(),this;case"string":var t=y(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,a=r?r(e):e;this._cache.del(a);var i=this._getId(e);i&&(i=s.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this},g.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this},g.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,a=void 0===t.dataVar?"data":t.dataVar,s="",i=0;i<e.length;i++){var n=e[i];n&&(s+=a+n.dataPath+" "+n.message+r)}return s.slice(0,-r.length)},g.prototype._addSchema=function(e,t,r,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var i=this._opts.serialize,o=i?i(e):e,d=this._cache.get(o);if(d)return d;a=a||!1!==this._opts.addUsedSchema;var c=s.normalizeId(this._getId(e));c&&a&&P(this,c);var u,l=!1!==this._opts.validateSchema&&!t;l&&!(u=c&&c==s.normalizeId(e.$schema))&&this.validateSchema(e,!0);var h=s.ids.call(this,e),p=new n({id:c,schema:e,localRefs:h,cacheKey:o,meta:r});return"#"!=c[0]&&a&&(this._refs[c]=p),this._cache.put(o,p),l&&u&&this.validateSchema(e,!0),p},g.prototype._compile=function(e,t){if(e.compiling)return e.validate=i,i.schema=e.schema,i.errors=null,i.root=t||i,!0===e.schema.$async&&(i.$async=!0),i;var r,s;e.compiling=!0,e.meta&&(r=this._opts,this._opts=this._metaOpts);try{s=a.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=r)}return e.validate=s,e.refs=s.refs,e.refVal=s.refVal,e.root=s.root,s;function i(){var t=e.validate,r=t.apply(this,arguments);return i.errors=t.errors,r}},g.prototype.compileAsync=r(7048);var h=r(1373);g.prototype.addKeyword=h.add,g.prototype.getKeyword=h.get,g.prototype.removeKeyword=h.remove,g.prototype.validateKeyword=h.validate;var p=r(3497);g.ValidationError=p.Validation,g.MissingRefError=p.MissingRef,g.$dataMetaSchema=u;var m="http://json-schema.org/draft-07/schema",f=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],v=["/properties"];function g(e){if(!(this instanceof g))return new g(e);e=this._opts=l.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:k,warn:k,error:k};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=d(e.format),this._cache=e.cache||new i,this._loadingSchemas={},this._compilations=[],this.RULES=c(),this._getId=function(e){switch(e.schemaId){case"auto":return x;case"id":return b;default:return w}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=o),this._metaOpts=function(e){for(var t=l.copy(e._opts),r=0;r<f.length;r++)delete t[f[r]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}(this),e.keywords&&function(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}(this),function(e){var t;if(e._opts.$data&&(t=r(7294),e.addMetaSchema(t,t.$id,!0)),!1!==e._opts.meta){var a=r(1780);e._opts.$data&&(a=u(a,v)),e.addMetaSchema(a,m,!0),e._refs["http://json-schema.org/schema"]=m}}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}(this)}function y(e,t){return t=s.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function _(e,t,r){for(var a in t){var s=t[a];s.meta||r&&!r.test(a)||(e._cache.del(s.cacheKey),delete t[a])}}function b(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function w(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function x(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function P(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function k(){}},8806:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var f="valid"+p.level,v=n.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)});if(v){var g=p.baseId;a+=" var "+h+" = errors; var "+l+" = false; ";var y=e.compositeRule;e.compositeRule=p.compositeRule=!0;var _=n;if(_)for(var b,w=-1,x=_.length-1;w<x;)b=_[w+=1],p.schema=b,p.schemaPath=o+"["+w+"]",p.errSchemaPath=d+"/"+w,a+=" "+e.validate(p)+" ",p.baseId=g,a+=" "+l+" = "+l+" || "+f+"; if (!"+l+") { ",m+="}";e.compositeRule=p.compositeRule=y,a+=" "+m+" if (!"+l+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else c&&(a+=" if (true) { ");return a}},8991:function(e){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var a,s,i;if(Array.isArray(t)){if((a=t.length)!=r.length)return!1;for(s=a;0!==s--;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((a=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=a;0!==s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=a;0!==s--;){var n=i[s];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}},9372:function(e){"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),l="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,f="i"+s,v=p.dataLevel=e.dataLevel+1,g="data"+v,y=e.baseId,_=e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all);if(a+="var "+h+" = errors;var "+l+";",_){var b=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=n,p.schemaPath=o,p.errSchemaPath=d,a+=" var "+m+" = false; for (var "+f+" = 0; "+f+" < "+u+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);var w=u+"["+f+"]";p.dataPathArr[v]=f;var x=e.validate(p);p.baseId=y,e.util.varOccurences(x,g)<2?a+=" "+e.util.varReplace(x,g,w)+" ":a+=" var "+g+" = "+w+"; "+x+" ",a+=" if ("+m+") break; } ",e.compositeRule=p.compositeRule=b,a+=" if (!"+m+") {"}else a+=" if ("+u+".length == 0) {";var P=P||[];P.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var k=a;return a=P.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+k+"]); ":a+=" validate.errors = ["+k+"]; return false; ":a+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",_&&(a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a}},9428:function(e,t,r){"use strict";var a=r(7710),s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31],n=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,o=/^(?=.{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,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,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,l=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,m=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function f(e){return e="full"==e?"full":"fast",a.copy(f[e])}function v(e){var t=e.match(s);if(!t)return!1;var r=+t[1],a=+t[2],n=+t[3];return a>=1&&a<=12&&n>=1&&n<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(n);if(!r)return!1;var a=r[1],s=r[2],i=r[3],o=r[5];return(a<=23&&s<=59&&i<=59||23==a&&59==s&&60==i)&&(!t||o)}e.exports=f,f.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:o,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:w,uuid:l,"json-pointer":h,"json-pointer-uri-fragment":p,"relative-json-pointer":m},f.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return _.test(e)&&d.test(e)},"uri-reference":/^(?:[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,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:o,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:w,uuid:l,"json-pointer":h,"json-pointer-uri-fragment":p,"relative-json-pointer":m};var y=/t|\s/i,_=/\/|:/,b=/[^\\]\\Z/;function w(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},9468:function(e){"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,n=e.dataLevel,o=e.schema[t],d=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",a="schema"+i):a=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" Object.keys("+l+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==t?"more":"fewer",s+=" than ",s+=h?"' + "+a+" + '":""+o,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+d:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),s+=" } "):s+=" {} ";var f=s;return s=m.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},9602:function(e){"use strict";e.exports=function(e,t,r){var a,s,i=" ",n=e.level,o=e.dataLevel,d=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(o||""),p="valid"+n,m="errs__"+n,f=e.opts.$data&&d&&d.$data;f?(i+=" var schema"+n+" = "+e.util.getData(d.$data,o,e.dataPathArr)+"; ",s="schema"+n):s=d;var v,g,y,_,b,w=this,x="definition"+n,P=w.definition,k="";if(f&&P.$data){b="keywordValidate"+n;var E=P.validateSchema;i+=" var "+x+" = RULES.custom['"+t+"'].definition; var "+b+" = "+x+".validate;"}else{if(!(_=e.useCustomRule(w,d,e.schema,e)))return;s="validate.schema"+c,b=_.code,v=P.compile,g=P.inline,y=P.macro}var S=b+".errors",R="i"+n,T="ruleErr"+n,O=P.async;if(O&&!e.async)throw new Error("async keyword in sync schema");if(g||y||(i+=S+" = null;"),i+="var "+m+" = errors;var "+p+";",f&&P.$data&&(k+="}",i+=" if ("+s+" === undefined) { "+p+" = true; } else { ",E&&(k+="}",i+=" "+p+" = "+x+".validateSchema("+s+"); if ("+p+") { ")),g)P.statements?i+=" "+_.validate+" ":i+=" "+p+" = "+_.validate+"; ";else if(y){var C=e.util.copy(e);k="",C.level++;var A="valid"+C.level;C.schema=_.validate,C.schemaPath="";var $=e.compositeRule;e.compositeRule=C.compositeRule=!0;var j=e.validate(C).replace(/validate\.schema/g,b);e.compositeRule=C.compositeRule=$,i+=" "+j}else{(Z=Z||[]).push(i),i="",i+=" "+b+".call( ",e.opts.passContext?i+="this":i+="self",v||!1===P.schema?i+=" , "+h+" ":i+=" , "+s+" , "+h+" , validate.schema"+e.schemaPath+" ",i+=" , (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var I=o?"data"+(o-1||""):"parentData",N=o?e.dataPathArr[o]:"parentDataProperty",F=i+=" , "+I+" , "+N+" , rootData ) ";i=Z.pop(),!1===P.errors?(i+=" "+p+" = ",O&&(i+="await "),i+=F+"; "):i+=O?" var "+(S="customErrors"+n)+" = null; try { "+p+" = await "+F+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ":" "+S+" = null; "+p+" = "+F+"; "}if(P.modifying&&(i+=" if ("+I+") "+h+" = "+I+"["+N+"];"),i+=""+k,P.valid)l&&(i+=" if (true) { ");else{var Z;i+=" if ( ",void 0===P.valid?(i+=" !",i+=y?""+A:""+p):i+=" "+!P.valid+" ",i+=") { ",a=w.keyword,(Z=Z||[]).push(i),i="",(Z=Z||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(a||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+w.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+w.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var D=i;i=Z.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+D+"]); ":i+=" validate.errors = ["+D+"]; return false; ":i+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var M=i;i=Z.pop(),g?P.errors?"full"!=P.errors&&(i+=" for (var "+R+"="+m+"; "+R+"<errors; "+R+"++) { var "+T+" = vErrors["+R+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+T+".schema = "+s+"; "+T+".data = "+h+"; "),i+=" } "):!1===P.errors?i+=" "+M+" ":(i+=" if ("+m+" == errors) { "+M+" } else { for (var "+R+"="+m+"; "+R+"<errors; "+R+"++) { var "+T+" = vErrors["+R+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+T+".schema = "+s+"; "+T+".data = "+h+"; "),i+=" } } "):y?(i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: '"+(a||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+w.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+w.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; ")):!1===P.errors?i+=" "+M+" ":(i+=" if (Array.isArray("+S+")) { if (vErrors === null) vErrors = "+S+"; else vErrors = vErrors.concat("+S+"); errors = vErrors.length; for (var "+R+"="+m+"; "+R+"<errors; "+R+"++) { var "+T+" = vErrors["+R+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; "+T+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(i+=" "+T+".schema = "+s+"; "+T+".data = "+h+"; "),i+=" } } else { "+M+" } "),i+=" } ",l&&(i+=" else { ")}return i}},9787:function(e){"use strict";e.exports=function(e,t,r){var a="",s=!0===e.schema.$async,i=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),n=e.self._getId(e.schema);if(e.opts.strictKeywords){var o=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(o){var d="unknown keyword: "+o;if("log"!==e.opts.strictKeywords)throw new Error(d);e.logger.warn(d)}}if(e.isTop&&(a+=" var validate = ",s&&(e.async=!0,a+="async "),a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",n&&(e.opts.sourceCode||e.opts.processCode)&&(a+=" /*# sourceURL="+n+" */ ")),"boolean"==typeof e.schema||!i&&!e.schema.$ref){t="false schema";var c=e.level,u=e.dataLevel,l=e.schema[t],h=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,m=!e.opts.allErrors,f="data"+(u||""),v="valid"+c;if(!1===e.schema){e.isTop?m=!0:a+=" var "+v+" = false; ",(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'boolean schema is false' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ";var g=a;a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?a+=s?" return data; ":" validate.errors = null; return true; ":a+=" var "+v+" = true; ";return e.isTop&&(a+=" }; return validate; "),a}if(e.isTop){var y=e.isTop;if(c=e.level=0,u=e.dataLevel=0,f="data",e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var _="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}a+=" var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data; "}else{if(c=e.level,f="data"+((u=e.dataLevel)||""),n&&(e.baseId=e.resolve.url(e.baseId,n)),s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+c+" = errors;"}v="valid"+c,m=!e.opts.allErrors;var b="",w="",x=e.schema.type,P=Array.isArray(x);if(x&&e.opts.nullable&&!0===e.schema.nullable&&(P?-1==x.indexOf("null")&&(x=x.concat("null")):"null"!=x&&(x=[x,"null"],P=!0)),P&&1==x.length&&(x=x[0],P=!1),e.schema.$ref&&i){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(i=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(a+=" "+e.RULES.all.$comment.code(e,"$comment")),x){if(e.opts.coerceTypes)var k=e.util.coerceToTypes(e.opts.coerceTypes,x);var E=e.RULES.types[x];if(k||P||!0===E||E&&!G(E)){h=e.schemaPath+".type",p=e.errSchemaPath+"/type",h=e.schemaPath+".type",p=e.errSchemaPath+"/type";var S=P?"checkDataTypes":"checkDataType";if(a+=" if ("+e.util[S](x,f,e.opts.strictNumbers,!0)+") { ",k){var R="dataType"+c,T="coerced"+c;a+=" var "+R+" = typeof "+f+"; var "+T+" = undefined; ","array"==e.opts.coerceTypes&&(a+=" if ("+R+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+R+" = typeof "+f+"; if ("+e.util.checkDataType(e.schema.type,f,e.opts.strictNumbers)+") "+T+" = "+f+"; } "),a+=" if ("+T+" !== undefined) ; ";var O=k;if(O)for(var C,A=-1,$=O.length-1;A<$;)"string"==(C=O[A+=1])?a+=" else if ("+R+" == 'number' || "+R+" == 'boolean') "+T+" = '' + "+f+"; else if ("+f+" === null) "+T+" = ''; ":"number"==C||"integer"==C?(a+=" else if ("+R+" == 'boolean' || "+f+" === null || ("+R+" == 'string' && "+f+" && "+f+" == +"+f+" ","integer"==C&&(a+=" && !("+f+" % 1)"),a+=")) "+T+" = +"+f+"; "):"boolean"==C?a+=" else if ("+f+" === 'false' || "+f+" === 0 || "+f+" === null) "+T+" = false; else if ("+f+" === 'true' || "+f+" === 1) "+T+" = true; ":"null"==C?a+=" else if ("+f+" === '' || "+f+" === 0 || "+f+" === false) "+T+" = null; ":"array"==e.opts.coerceTypes&&"array"==C&&(a+=" else if ("+R+" == 'string' || "+R+" == 'number' || "+R+" == 'boolean' || "+f+" == null) "+T+" = ["+f+"]; ");a+=" else { ",(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=P?""+x.join(","):""+x,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=P?""+x.join(","):""+x,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ",g=a,a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } if ("+T+" !== undefined) { ";var j=u?"data"+(u-1||""):"parentData";a+=" "+f+" = "+T+"; ",u||(a+="if ("+j+" !== undefined)"),a+=" "+j+"["+(u?e.dataPathArr[u]:"parentDataProperty")+"] = "+T+"; } "}else(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=P?""+x.join(","):""+x,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=P?""+x.join(","):""+x,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ",g=a,a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";a+=" } "}}if(e.schema.$ref&&!i)a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",m&&(a+=" } if (errors === ",a+=y?"0":"errs_"+c,a+=") { ",w+="}");else{var I=e.RULES;if(I)for(var N=-1,F=I.length-1;N<F;)if(G(E=I[N+=1])){if(E.type&&(a+=" if ("+e.util.checkDataType(E.type,f,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==E.type&&e.schema.properties){l=e.schema.properties;var Z=Object.keys(l);if(Z)for(var D,M=-1,L=Z.length-1;M<L;)if(void 0!==(V=l[D=Z[M+=1]]).default){var q=f+e.util.getProperty(D);if(e.compositeRule){if(e.opts.strictDefaults){if(_="default is ignored for: "+q,"log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else a+=" if ("+q+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+q+" === null || "+q+" === '' "),a+=" ) "+q+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(V.default)+" ":a+=" "+JSON.stringify(V.default)+" ",a+="; "}}else if("array"==E.type&&Array.isArray(e.schema.items)){var z=e.schema.items;if(z){A=-1;for(var V,H=z.length-1;A<H;)if(void 0!==(V=z[A+=1]).default)if(q=f+"["+A+"]",e.compositeRule){if(e.opts.strictDefaults){if(_="default is ignored for: "+q,"log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else a+=" if ("+q+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+q+" === null || "+q+" === '' "),a+=" ) "+q+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(V.default)+" ":a+=" "+JSON.stringify(V.default)+" ",a+="; "}}var U,Q=E.rules;if(Q)for(var K,B=-1,W=Q.length-1;B<W;)if(Y(K=Q[B+=1])){var J=K.code(e,K.keyword,E.type);J&&(a+=" "+J+" ",m&&(b+="}"))}if(m&&(a+=" "+b+" ",b=""),E.type&&(a+=" } ",x&&x===E.type&&!k))a+=" else { ",h=e.schemaPath+".type",p=e.errSchemaPath+"/type",(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=P?""+x.join(","):""+x,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=P?""+x.join(","):""+x,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ",g=a,a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ";m&&(a+=" if (errors === ",a+=y?"0":"errs_"+c,a+=") { ",w+="}")}}function G(e){for(var t=e.rules,r=0;r<t.length;r++)if(Y(t[r]))return!0}function Y(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var r=t.implements,a=0;a<r.length;a++)if(void 0!==e.schema[r[a]])return!0}(t)}return m&&(a+=" "+w+" "),y?(s?(a+=" if (errors === 0) return data; ",a+=" else throw new ValidationError(vErrors); "):(a+=" validate.errors = vErrors; ",a+=" return errors === 0; "),a+=" }; return validate;"):a+=" var "+v+" = errors === errs_"+c+";",a}}},t={};function r(a){var s=t[a];if(void 0!==s)return s.exports;var i=t[a]={exports:{}};return e[a].call(i.exports,i,i.exports,r),i.exports}r.d=function(e,t){for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};!function(){"use strict";r.r(a),r.d(a,{McpServer:function(){return Ln},activateMcpRegistration:function(){return Jn},getAngieSdk:function(){return ro},getMCPByDomain:function(){return Yn},init:function(){return to},registerMcp:function(){return Wn}});var e,t,s,i,n=window.elementorV2.editorV1Adapters;!function(e){e.POST_MESSAGE="postMessage"}(e||(e={})),function(e){e.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",e.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",e.SDK_REQUEST_INIT_SERVER="sdk-request-init-server"}(t||(t={}));class o{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(e=>{this.readyResolve=e}),"undefined"==typeof window)return;let e=0;const r=()=>{if(this.isAngieReady||e>=500)return void(!this.isAngieReady&&e>=500&&this.handleDetectionTimeout());const a=new MessageChannel;a.port1.onmessage=e=>{this.handleAngieReady(e.data),a.port1.close(),a.port2.close()};const s={type:t.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(s,window.location.origin,[a.port2]),e++,setTimeout(r,500)};r()}handleAngieReady(e){this.isAngieReady=!0;const t={isReady:!0,version:e.version,capabilities:e.capabilities};this.readyResolve&&this.readyResolve(t)}handleDetectionTimeout(){this.readyResolve&&this.readyResolve({isReady:!1}),console.warn("AngieMcpSdk: AngieDetector: Detection timeout - Angie may not be available")}isReady(){return this.isAngieReady}async waitForReady(){return this.readyPromise}}class d{queue=[];isProcessing=!1;add(e){const t={id:this.generateId(e),config:e,timestamp:Date.now(),status:"pending"};return this.queue.push(t),console.log(`RegistrationQueue: Added server "${e.name}" to queue`),t}getAll(){return[...this.queue]}getPending(){return this.queue.filter(e=>"pending"===e.status)}updateStatus(e,t,r){const a=this.queue.find(t=>t.id===e);a&&(a.status=t,r&&(a.error=r),console.log(`RegistrationQueue: Updated server ${e} status to ${t}`))}async processQueue(e){if(this.isProcessing)return void console.log("RegistrationQueue: Already processing queue");this.isProcessing=!0;const t=this.getPending();console.log(`RegistrationQueue: Processing ${t.length} pending registrations`);try{for(const r of t)try{await e(r),this.updateStatus(r.id,"registered")}catch(e){const t=e instanceof Error?e.message:String(e);this.updateStatus(r.id,"failed",t),console.error(`RegistrationQueue: Failed to process registration ${r.id}:`,t)}}finally{this.isProcessing=!1}}clear(){this.queue=[],console.log("RegistrationQueue: Cleared all registrations")}remove(e){const t=this.queue.findIndex(t=>t.id===e);return-1!==t&&(this.queue.splice(t,1),console.log(`RegistrationQueue: Removed registration ${e}`),!0)}generateId(e){return`reg_${e.name}_${e.version}_${Date.now()}`}}class c{async requestClientCreation(r){const{config:a}=r,s={serverId:r.id,serverName:a.name,serverVersion:a.version,description:a.description,transport:e.POST_MESSAGE,capabilities:a.capabilities};return new Promise((e,r)=>{const a=new MessageChannel,i=setTimeout(()=>{r(new Error("Client creation request timed out after 10000ms"))},1e4);a.port1.onmessage=t=>{clearTimeout(i),e(t.data)};const n={type:t.SDK_REQUEST_CLIENT_CREATION,payload:s,timestamp:Date.now()};window.postMessage(n,window.location.origin,[a.port2])})}}!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(s||(s={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(i||(i={}));const u=s.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?u.promise:"undefined"!=typeof Map&&e instanceof Map?u.map:"undefined"!=typeof Set&&e instanceof Set?u.set:"undefined"!=typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}},h=s.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"]);class p extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){const r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof p))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}p.create=e=>new p(e);const m=(e,t)=>{let r;switch(e.code){case h.invalid_type:r=e.received===u.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case h.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,s.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:r=`Unrecognized key(s) in object: ${s.joinValues(e.keys,", ")}`;break;case h.invalid_union:r="Invalid input";break;case h.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${s.joinValues(e.options)}`;break;case h.invalid_enum_value:r=`Invalid enum value. Expected ${s.joinValues(e.options)}, received '${e.received}'`;break;case h.invalid_arguments:r="Invalid function arguments";break;case h.invalid_return_type:r="Invalid function return type";break;case h.invalid_date:r="Invalid date";break;case h.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:s.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case h.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case h.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case h.custom:r="Invalid input";break;case h.invalid_intersection_types:r="Intersection results could not be merged";break;case h.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case h.not_finite:r="Number must be finite";break;default:r=t.defaultError,s.assertNever(e)}return{message:r}};let f=m;function v(e,t){const r=f,a=(e=>{const{data:t,path:r,errorMaps:a,issueData:s}=e,i=[...r,...s.path||[]],n={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let o="";const d=a.filter(e=>!!e).slice().reverse();for(const e of d)o=e(n,{data:t,defaultError:o}).message;return{...s,path:i,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===m?void 0:m].filter(e=>!!e)});e.common.issues.push(a)}class g{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if("aborted"===a.status)return y;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return g.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:t,value:s}=a;if("aborted"===t.status)return y;if("aborted"===s.status)return y;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!a.alwaysSet||(r[t.value]=s.value)}return{status:e.value,value:r}}}const y=Object.freeze({status:"aborted"}),_=e=>({status:"dirty",value:e}),b=e=>({status:"valid",value:e}),w=e=>"aborted"===e.status,x=e=>"dirty"===e.status,P=e=>"valid"===e.status,k=e=>"undefined"!=typeof Promise&&e instanceof Promise;var E;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(E||(E={}));class S{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}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}}const R=(e,t)=>{if(P(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new p(e.common.issues);return this._error=t,this._error}}};function T(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??s.defaultError}:void 0===s.data?{message:i??a??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:i??r??s.defaultError}},description:s}}class O{get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new g,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(k(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},a=this._parseSync({data:e,path:r.path,parent:r});return R(r,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return P(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>P(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(k(a)?a:Promise.resolve(a));return R(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,a)=>{const s=e(t),i=()=>a.addIssue({code:h.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new Te({schema:this,typeName:Ze.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:e=>this["~validate"](e)}}optional(){return Oe.create(this,this._def)}nullable(){return Ce.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ue.create(this)}promise(){return Re.create(this,this._def)}or(e){return pe.create([this,e],this._def)}and(e){return ge.create(this,e,this._def)}transform(e){return new Te({...T(this._def),schema:this,typeName:Ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ae({...T(this._def),innerType:this,defaultValue:t,typeName:Ze.ZodDefault})}brand(){return new Ie({typeName:Ze.ZodBranded,type:this,...T(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new $e({...T(this._def),innerType:this,catchValue:t,typeName:Ze.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ne.create(this,e)}readonly(){return Fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const C=/^c[^\s-]{8,}$/i,A=/^[0-9a-z]+$/,$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j=/^[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,I=/^[a-z0-9_-]{21}$/i,N=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,F=/^[-+]?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)?)??$/,Z=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let D;const M=/^(?:(?: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])$/,L=/^(?:(?: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])$/,q=/^(([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]))$/,z=/^(([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])$/,V=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,H=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U="((\\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])))",Q=new RegExp(`^${U}$`);function K(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function B(e){let t=`${U}T${K(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function W(e,t){if(!N.test(e))return!1;try{const[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function J(e,t){return!("v4"!==t&&t||!L.test(e))||!("v6"!==t&&t||!z.test(e))}class G extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.string,received:t.parsedType}),y}const t=new g;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),v(r,{code:h.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),v(r,{code:h.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const a=e.data.length>n.value,s=e.data.length<n.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?v(r,{code:h.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&v(r,{code:h.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)Z.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"email",code:h.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)D||(D=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),D.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"emoji",code:h.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)j.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"uuid",code:h.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)I.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"nanoid",code:h.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)C.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"cuid",code:h.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)A.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"cuid2",code:h.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)$.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"ulid",code:h.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),v(r,{validation:"url",code:h.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"regex",code:h.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),v(r,{code:h.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),v(r,{code:h.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),v(r,{code:h.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?B(n).test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{code:h.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?Q.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{code:h.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?new RegExp(`^${K(n)}$`).test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{code:h.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?F.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"duration",code:h.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?(a=e.data,("v4"!==(i=n.version)&&i||!M.test(a))&&("v6"!==i&&i||!q.test(a))&&(r=this._getOrReturnCtx(e,r),v(r,{validation:"ip",code:h.invalid_string,message:n.message}),t.dirty())):"jwt"===n.kind?W(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"jwt",code:h.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?J(e.data,n.version)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"cidr",code:h.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?V.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"base64",code:h.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?H.test(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{validation:"base64url",code:h.invalid_string,message:n.message}),t.dirty()):s.assertNever(n);var a,i;return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:h.invalid_string,...E.errToObj(r)})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...E.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...E.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...E.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...E.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...E.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...E.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...E.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...E.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...E.errToObj(t)})}nonempty(e){return this.min(1,E.errToObj(e))}trim(){return new G({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Y(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}G.create=e=>new G({checks:[],typeName:Ze.ZodString,coerce:e?.coerce??!1,...T(e)});class X extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.number,received:t.parsedType}),y}let t;const r=new g;for(const a of this._def.checks)"int"===a.kind?s.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:h.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==Y(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:h.not_finite,message:a.message}),r.dirty()):s.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,r,a){return new X({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:E.toString(a)}]})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&s.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}X.create=e=>new X({checks:[],typeName:Ze.ZodNumber,coerce:e?.coerce||!1,...T(e)});class ee extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let t;const r=new g;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):s.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,r,a){return new ee({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:E.toString(a)}]})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ee.create=e=>new ee({checks:[],typeName:Ze.ZodBigInt,coerce:e?.coerce??!1,...T(e)});class te extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==u.boolean){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.boolean,received:t.parsedType}),y}return b(e.data)}}te.create=e=>new te({typeName:Ze.ZodBoolean,coerce:e?.coerce||!1,...T(e)});class re extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.date,received:t.parsedType}),y}if(Number.isNaN(e.data.getTime()))return v(this._getOrReturnCtx(e),{code:h.invalid_date}),y;const t=new g;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),v(r,{code:h.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),v(r,{code:h.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):s.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new re({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:E.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:E.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}re.create=e=>new re({checks:[],coerce:e?.coerce||!1,typeName:Ze.ZodDate,...T(e)});class ae extends O{_parse(e){if(this._getType(e)!==u.symbol){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.symbol,received:t.parsedType}),y}return b(e.data)}}ae.create=e=>new ae({typeName:Ze.ZodSymbol,...T(e)});class se extends O{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.undefined,received:t.parsedType}),y}return b(e.data)}}se.create=e=>new se({typeName:Ze.ZodUndefined,...T(e)});class ie extends O{_parse(e){if(this._getType(e)!==u.null){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.null,received:t.parsedType}),y}return b(e.data)}}ie.create=e=>new ie({typeName:Ze.ZodNull,...T(e)});class ne extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}ne.create=e=>new ne({typeName:Ze.ZodAny,...T(e)});class oe extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}oe.create=e=>new oe({typeName:Ze.ZodUnknown,...T(e)});class de extends O{_parse(e){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.never,received:t.parsedType}),y}}de.create=e=>new de({typeName:Ze.ZodNever,...T(e)});class ce extends O{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.void,received:t.parsedType}),y}return b(e.data)}}ce.create=e=>new ce({typeName:Ze.ZodVoid,...T(e)});class ue extends O{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==u.array)return v(t,{code:h.invalid_type,expected:u.array,received:t.parsedType}),y;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(v(t,{code:e?h.too_big:h.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(v(t,{code:h.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(v(t,{code:h.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new S(t,e,t.path,r)))).then(e=>g.mergeArray(r,e));const s=[...t.data].map((e,r)=>a.type._parseSync(new S(t,e,t.path,r)));return g.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new ue({...this._def,minLength:{value:e,message:E.toString(t)}})}max(e,t){return new ue({...this._def,maxLength:{value:e,message:E.toString(t)}})}length(e,t){return new ue({...this._def,exactLength:{value:e,message:E.toString(t)}})}nonempty(e){return this.min(1,e)}}function le(e){if(e instanceof he){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=Oe.create(le(a))}return new he({...e._def,shape:()=>t})}return e instanceof ue?new ue({...e._def,type:le(e.element)}):e instanceof Oe?Oe.create(le(e.unwrap())):e instanceof Ce?Ce.create(le(e.unwrap())):e instanceof ye?ye.create(e.items.map(e=>le(e))):e}ue.create=(e,t)=>new ue({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ze.ZodArray,...T(t)});class he extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=s.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),y}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof de&&"strip"===this._def.unknownKeys))for(const e in r.data)s.includes(e)||i.push(e);const n=[];for(const e of s){const t=a[e],s=r.data[e];n.push({key:{status:"valid",value:e},value:t._parse(new S(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof de){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)n.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(v(r,{code:h.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=r.data[t];n.push({key:{status:"valid",value:t},value:e._parse(new S(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of n){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>g.mergeObjectSync(t,e)):g.mergeObjectSync(t,n)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new he({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{const a=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:E.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new he({...this._def,unknownKeys:"strip"})}passthrough(){return new he({...this._def,unknownKeys:"passthrough"})}extend(e){return new he({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new he({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ze.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new he({...this._def,catchall:e})}pick(e){const t={};for(const r of s.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new he({...this._def,shape:()=>t})}omit(e){const t={};for(const r of s.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new he({...this._def,shape:()=>t})}deepPartial(){return le(this)}partial(e){const t={};for(const r of s.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new he({...this._def,shape:()=>t})}required(e){const t={};for(const r of s.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Oe;)e=e._def.innerType;t[r]=e}return new he({...this._def,shape:()=>t})}keyof(){return ke(s.objectKeys(this.shape))}}he.create=(e,t)=>new he({shape:()=>e,unknownKeys:"strip",catchall:de.create(),typeName:Ze.ZodObject,...T(t)}),he.strictCreate=(e,t)=>new he({shape:()=>e,unknownKeys:"strict",catchall:de.create(),typeName:Ze.ZodObject,...T(t)}),he.lazycreate=(e,t)=>new he({shape:e,unknownKeys:"strip",catchall:de.create(),typeName:Ze.ZodObject,...T(t)});class pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new p(e.ctx.common.issues));return v(t,{code:h.invalid_union,unionErrors:r}),y});{let e;const a=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=a.map(e=>new p(e));return v(t,{code:h.invalid_union,unionErrors:s}),y}}get options(){return this._def.options}}pe.create=(e,t)=>new pe({options:e,typeName:Ze.ZodUnion,...T(t)});const me=e=>e instanceof xe?me(e.schema):e instanceof Te?me(e.innerType()):e instanceof Pe?[e.value]:e instanceof Ee?e.options:e instanceof Se?s.objectValues(e.enum):e instanceof Ae?me(e._def.innerType):e instanceof se?[void 0]:e instanceof ie?[null]:e instanceof Oe?[void 0,...me(e.unwrap())]:e instanceof Ce?[null,...me(e.unwrap())]:e instanceof Ie||e instanceof Fe?me(e.unwrap()):e instanceof $e?me(e._def.innerType):[];class fe extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return v(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),y;const r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=me(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new fe({typeName:Ze.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...T(r)})}}function ve(e,t){const r=l(e),a=l(t);if(e===t)return{valid:!0,data:e};if(r===u.object&&a===u.object){const r=s.objectKeys(t),a=s.objectKeys(e).filter(e=>-1!==r.indexOf(e)),i={...e,...t};for(const r of a){const a=ve(e[r],t[r]);if(!a.valid)return{valid:!1};i[r]=a.data}return{valid:!0,data:i}}if(r===u.array&&a===u.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let a=0;a<e.length;a++){const s=ve(e[a],t[a]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return r===u.date&&a===u.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class ge extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if(w(e)||w(a))return y;const s=ve(e.value,a.value);return s.valid?((x(e)||x(a))&&t.dirty(),{status:t.value,value:s.data}):(v(r,{code:h.invalid_intersection_types}),y)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ge.create=(e,t,r)=>new ge({left:e,right:t,typeName:Ze.ZodIntersection,...T(r)});class ye extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return v(r,{code:h.invalid_type,expected:u.array,received:r.parsedType}),y;if(r.data.length<this._def.items.length)return v(r,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&r.data.length>this._def.items.length&&(v(r,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new S(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>g.mergeArray(t,e)):g.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:e,typeName:Ze.ZodTuple,rest:null,...T(t)})};class _e extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return v(r,{code:h.invalid_type,expected:u.object,received:r.parsedType}),y;const a=[],s=this._def.keyType,i=this._def.valueType;for(const e in r.data)a.push({key:s._parse(new S(r,e,r.path,e)),value:i._parse(new S(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?g.mergeObjectAsync(t,a):g.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new _e(t instanceof O?{keyType:e,valueType:t,typeName:Ze.ZodRecord,...T(r)}:{keyType:G.create(),valueType:e,typeName:Ze.ZodRecord,...T(t)})}}class be extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return v(r,{code:h.invalid_type,expected:u.map,received:r.parsedType}),y;const a=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([e,t],i)=>({key:a._parse(new S(r,e,r.path,[i,"key"])),value:s._parse(new S(r,t,r.path,[i,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of i){const a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return y;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of i){const a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return y;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}be.create=(e,t,r)=>new be({valueType:t,keyType:e,typeName:Ze.ZodMap,...T(r)});class we extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return v(r,{code:h.invalid_type,expected:u.set,received:r.parsedType}),y;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(v(r,{code:h.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(v(r,{code:h.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const r=new Set;for(const a of e){if("aborted"===a.status)return y;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const n=[...r.data.values()].map((e,t)=>s._parse(new S(r,e,r.path,t)));return r.common.async?Promise.all(n).then(e=>i(e)):i(n)}min(e,t){return new we({...this._def,minSize:{value:e,message:E.toString(t)}})}max(e,t){return new we({...this._def,maxSize:{value:e,message:E.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}we.create=(e,t)=>new we({valueType:e,minSize:null,maxSize:null,typeName:Ze.ZodSet,...T(t)});class xe extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}xe.create=(e,t)=>new xe({getter:e,typeName:Ze.ZodLazy,...T(t)});class Pe extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ke(e,t){return new Ee({values:e,typeName:Ze.ZodEnum,...T(t)})}Pe.create=(e,t)=>new Pe({value:e,typeName:Ze.ZodLiteral,...T(t)});class Ee extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return v(t,{expected:s.joinValues(r),received:t.parsedType,code:h.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return v(t,{received:t.data,code:h.invalid_enum_value,options:r}),y}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ee.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ee.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Ee.create=ke;class Se extends O{_parse(e){const t=s.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const e=s.objectValues(t);return v(r,{expected:s.joinValues(e),received:r.parsedType,code:h.invalid_type}),y}if(this._cache||(this._cache=new Set(s.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=s.objectValues(t);return v(r,{received:r.data,code:h.invalid_enum_value,options:e}),y}return b(e.data)}get enum(){return this._def.values}}Se.create=(e,t)=>new Se({values:e,typeName:Ze.ZodNativeEnum,...T(t)});class Re extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&!1===t.common.async)return v(t,{code:h.invalid_type,expected:u.promise,received:t.parsedType}),y;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return b(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Re.create=(e,t)=>new Re({type:e,typeName:Ze.ZodPromise,...T(t)});class Te extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:e=>{v(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===a.type){const e=a.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return y;const a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?y:"dirty"===a.status||"dirty"===t.value?_(a.value):a});{if("aborted"===t.value)return y;const a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?y:"dirty"===a.status||"dirty"===t.value?_(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?y:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?y:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!P(e))return y;const s=a.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>P(e)?Promise.resolve(a.transform(e.value,i)).then(e=>({status:t.value,value:e})):y)}s.assertNever(a)}}Te.create=(e,t,r)=>new Te({schema:e,typeName:Ze.ZodEffects,effect:t,...T(r)}),Te.createWithPreprocess=(e,t,r)=>new Te({schema:t,effect:{type:"preprocess",transform:e},typeName:Ze.ZodEffects,...T(r)});class Oe extends O{_parse(e){return this._getType(e)===u.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:Ze.ZodOptional,...T(t)});class Ce extends O{_parse(e){return this._getType(e)===u.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:Ze.ZodNullable,...T(t)});class Ae extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:Ze.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});class $e extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return k(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new p(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new p(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}$e.create=(e,t)=>new $e({innerType:e,typeName:Ze.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});class je extends O{_parse(e){if(this._getType(e)!==u.nan){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.nan,received:t.parsedType}),y}return{status:"valid",value:e.data}}}je.create=e=>new je({typeName:Ze.ZodNaN,...T(e)}),Symbol("zod_brand");class Ie extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ne extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),_(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Ne({in:e,out:t,typeName:Ze.ZodPipeline})}}class Fe extends O{_parse(e){const t=this._def.innerType._parse(e),r=e=>(P(e)&&(e.value=Object.freeze(e.value)),e);return k(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var Ze;Fe.create=(e,t)=>new Fe({innerType:e,typeName:Ze.ZodReadonly,...T(t)}),he.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ze||(Ze={}));const De=G.create,Me=X.create,Le=(je.create,ee.create,te.create),qe=(re.create,ae.create,se.create,ie.create,ne.create,oe.create),ze=(de.create,ce.create,ue.create),Ve=he.create,He=(he.strictCreate,pe.create),Ue=fe.create,Qe=(ge.create,ye.create,_e.create),Ke=(be.create,we.create,xe.create,Pe.create),Be=Ee.create,We=(Se.create,Re.create,Te.create,Oe.create),Je=(Ce.create,Te.createWithPreprocess,Ne.create,"2.0"),Ge=He([De(),Me().int()]),Ye=De(),Xe=Ve({progressToken:We(Ge)}).passthrough(),et=Ve({_meta:We(Xe)}).passthrough(),tt=Ve({method:De(),params:We(et)}),rt=Ve({_meta:We(Ve({}).passthrough())}).passthrough(),at=Ve({method:De(),params:We(rt)}),st=Ve({_meta:We(Ve({}).passthrough())}).passthrough(),it=He([De(),Me().int()]),nt=Ve({jsonrpc:Ke(Je),id:it}).merge(tt).strict(),ot=Ve({jsonrpc:Ke(Je)}).merge(at).strict(),dt=Ve({jsonrpc:Ke(Je),id:it,result:st}).strict();var ct;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(ct||(ct={}));const ut=He([nt,ot,dt,Ve({jsonrpc:Ke(Je),id:it,error:Ve({code:Me().int(),message:De(),data:We(qe())})}).strict()]),lt=st.strict(),ht=at.extend({method:Ke("notifications/cancelled"),params:rt.extend({requestId:it,reason:De().optional()})}),pt=Ve({name:De(),title:We(De())}).passthrough(),mt=pt.extend({version:De()}),ft=Ve({experimental:We(Ve({}).passthrough()),sampling:We(Ve({}).passthrough()),elicitation:We(Ve({}).passthrough()),roots:We(Ve({listChanged:We(Le())}).passthrough())}).passthrough(),vt=tt.extend({method:Ke("initialize"),params:et.extend({protocolVersion:De(),capabilities:ft,clientInfo:mt})}),gt=Ve({experimental:We(Ve({}).passthrough()),logging:We(Ve({}).passthrough()),completions:We(Ve({}).passthrough()),prompts:We(Ve({listChanged:We(Le())}).passthrough()),resources:We(Ve({subscribe:We(Le()),listChanged:We(Le())}).passthrough()),tools:We(Ve({listChanged:We(Le())}).passthrough())}).passthrough(),yt=st.extend({protocolVersion:De(),capabilities:gt,serverInfo:mt,instructions:We(De())}),_t=at.extend({method:Ke("notifications/initialized")}),bt=tt.extend({method:Ke("ping")}),wt=Ve({progress:Me(),total:We(Me()),message:We(De())}).passthrough(),xt=at.extend({method:Ke("notifications/progress"),params:rt.merge(wt).extend({progressToken:Ge})}),Pt=tt.extend({params:et.extend({cursor:We(Ye)}).optional()}),kt=st.extend({nextCursor:We(Ye)}),Et=Ve({uri:De(),mimeType:We(De()),_meta:We(Ve({}).passthrough())}).passthrough(),St=Et.extend({text:De()}),Rt=Et.extend({blob:De().base64()}),Tt=pt.extend({uri:De(),description:We(De()),mimeType:We(De()),_meta:We(Ve({}).passthrough())}),Ot=pt.extend({uriTemplate:De(),description:We(De()),mimeType:We(De()),_meta:We(Ve({}).passthrough())}),Ct=Pt.extend({method:Ke("resources/list")}),At=kt.extend({resources:ze(Tt)}),$t=Pt.extend({method:Ke("resources/templates/list")}),jt=kt.extend({resourceTemplates:ze(Ot)}),It=tt.extend({method:Ke("resources/read"),params:et.extend({uri:De()})}),Nt=st.extend({contents:ze(He([St,Rt]))}),Ft=at.extend({method:Ke("notifications/resources/list_changed")}),Zt=tt.extend({method:Ke("resources/subscribe"),params:et.extend({uri:De()})}),Dt=tt.extend({method:Ke("resources/unsubscribe"),params:et.extend({uri:De()})}),Mt=at.extend({method:Ke("notifications/resources/updated"),params:rt.extend({uri:De()})}),Lt=Ve({name:De(),description:We(De()),required:We(Le())}).passthrough(),qt=pt.extend({description:We(De()),arguments:We(ze(Lt)),_meta:We(Ve({}).passthrough())}),zt=Pt.extend({method:Ke("prompts/list")}),Vt=kt.extend({prompts:ze(qt)}),Ht=tt.extend({method:Ke("prompts/get"),params:et.extend({name:De(),arguments:We(Qe(De()))})}),Ut=Ve({type:Ke("text"),text:De(),_meta:We(Ve({}).passthrough())}).passthrough(),Qt=Ve({type:Ke("image"),data:De().base64(),mimeType:De(),_meta:We(Ve({}).passthrough())}).passthrough(),Kt=Ve({type:Ke("audio"),data:De().base64(),mimeType:De(),_meta:We(Ve({}).passthrough())}).passthrough(),Bt=Ve({type:Ke("resource"),resource:He([St,Rt]),_meta:We(Ve({}).passthrough())}).passthrough(),Wt=He([Ut,Qt,Kt,Tt.extend({type:Ke("resource_link")}),Bt]),Jt=Ve({role:Be(["user","assistant"]),content:Wt}).passthrough(),Gt=st.extend({description:We(De()),messages:ze(Jt)}),Yt=at.extend({method:Ke("notifications/prompts/list_changed")}),Xt=Ve({title:We(De()),readOnlyHint:We(Le()),destructiveHint:We(Le()),idempotentHint:We(Le()),openWorldHint:We(Le())}).passthrough(),er=pt.extend({description:We(De()),inputSchema:Ve({type:Ke("object"),properties:We(Ve({}).passthrough()),required:We(ze(De()))}).passthrough(),outputSchema:We(Ve({type:Ke("object"),properties:We(Ve({}).passthrough()),required:We(ze(De()))}).passthrough()),annotations:We(Xt),_meta:We(Ve({}).passthrough())}),tr=Pt.extend({method:Ke("tools/list")}),rr=kt.extend({tools:ze(er)}),ar=st.extend({content:ze(Wt).default([]),structuredContent:Ve({}).passthrough().optional(),isError:We(Le())}),sr=(ar.or(st.extend({toolResult:qe()})),tt.extend({method:Ke("tools/call"),params:et.extend({name:De(),arguments:We(Qe(qe()))})})),ir=at.extend({method:Ke("notifications/tools/list_changed")}),nr=Be(["debug","info","notice","warning","error","critical","alert","emergency"]),or=tt.extend({method:Ke("logging/setLevel"),params:et.extend({level:nr})}),dr=at.extend({method:Ke("notifications/message"),params:rt.extend({level:nr,logger:We(De()),data:qe()})}),cr=Ve({name:De().optional()}).passthrough(),ur=Ve({hints:We(ze(cr)),costPriority:We(Me().min(0).max(1)),speedPriority:We(Me().min(0).max(1)),intelligencePriority:We(Me().min(0).max(1))}).passthrough(),lr=Ve({role:Be(["user","assistant"]),content:He([Ut,Qt,Kt])}).passthrough(),hr=tt.extend({method:Ke("sampling/createMessage"),params:et.extend({messages:ze(lr),systemPrompt:We(De()),includeContext:We(Be(["none","thisServer","allServers"])),temperature:We(Me()),maxTokens:Me().int(),stopSequences:We(ze(De())),metadata:We(Ve({}).passthrough()),modelPreferences:We(ur)})}),pr=st.extend({model:De(),stopReason:We(Be(["endTurn","stopSequence","maxTokens"]).or(De())),role:Be(["user","assistant"]),content:Ue("type",[Ut,Qt,Kt])}),mr=He([Ve({type:Ke("boolean"),title:We(De()),description:We(De()),default:We(Le())}).passthrough(),Ve({type:Ke("string"),title:We(De()),description:We(De()),minLength:We(Me()),maxLength:We(Me()),format:We(Be(["email","uri","date","date-time"]))}).passthrough(),Ve({type:Be(["number","integer"]),title:We(De()),description:We(De()),minimum:We(Me()),maximum:We(Me())}).passthrough(),Ve({type:Ke("string"),title:We(De()),description:We(De()),enum:ze(De()),enumNames:We(ze(De()))}).passthrough()]),fr=tt.extend({method:Ke("elicitation/create"),params:et.extend({message:De(),requestedSchema:Ve({type:Ke("object"),properties:Qe(De(),mr),required:We(ze(De()))}).passthrough()})}),vr=st.extend({action:Be(["accept","reject","cancel"]),content:We(Qe(De(),qe()))}),gr=Ve({type:Ke("ref/resource"),uri:De()}).passthrough(),yr=Ve({type:Ke("ref/prompt"),name:De()}).passthrough(),_r=tt.extend({method:Ke("completion/complete"),params:et.extend({ref:He([yr,gr]),argument:Ve({name:De(),value:De()}).passthrough(),context:We(Ve({arguments:We(Qe(De(),De()))}))})}),br=st.extend({completion:Ve({values:ze(De()).max(100),total:We(Me().int()),hasMore:We(Le())}).passthrough()}),wr=Ve({uri:De().startsWith("file://"),name:We(De()),_meta:We(Ve({}).passthrough())}).passthrough(),xr=tt.extend({method:Ke("roots/list")}),Pr=st.extend({roots:ze(wr)}),kr=at.extend({method:Ke("notifications/roots/list_changed")});He([bt,vt,_r,or,Ht,zt,Ct,$t,It,Zt,Dt,sr,tr]),He([ht,xt,_t,kr]),He([lt,pr,vr,Pr]),He([bt,hr,fr,xr]),He([ht,xt,dr,Mt,Ft,ir,Yt]),He([lt,yt,br,Gt,Vt,At,jt,Nt,ar,rr]),Error;class Er{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(e,t){if(!e)throw new Error("MessagePort is required");this._port=e,this.sessionId=t||this.generateId(),this._port.onmessage=e=>{try{const t=ut.parse(e.data);this.onmessage?.(t)}catch(e){const t=new Error(`Failed to parse message: ${e}`);this.onerror?.(t)}},this._port.onmessageerror=e=>{const t=new Error(`MessagePort error: ${JSON.stringify(e)}`);this.onerror?.(t)}}static generateSessionId(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,10)}`}async start(){if(this._started)throw new Error("BrowserContextTransport already started! If using Client or Server class, note that connect() calls start() automatically.");if(this._closed)throw new Error("Cannot start a closed BrowserContextTransport");this._started=!0,this._port.start()}async send(e){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((t,r)=>{try{this._port.postMessage(e),t()}catch(e){const t=e instanceof Error?e:new Error(String(e));this.onerror?.(t),r(t)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}generateId(){return Er.generateSessionId()}}class Sr{angieDetector;registrationQueue;clientManager;isInitialized=!1;constructor(){this.angieDetector=new o,this.registrationQueue=new d,this.clientManager=new c,this.setupAngieReadyHandler(),this.setupServerInitHandler()}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(e=>{e.isReady?this.handleAngieReady():console.warn("AngieMcpSdk: Angie not detected - servers will remain queued")}).catch(e=>{console.error("AngieMcpSdk: Error waiting for Angie:",e)})}async handleAngieReady(){console.log("AngieMcpSdk: Angie is ready, processing queued registrations");try{await this.registrationQueue.processQueue(async e=>{await this.processRegistration(e)}),this.isInitialized=!0,console.log("AngieMcpSdk: Initialization complete")}catch(e){console.error("AngieMcpSdk: Error processing registration queue:",e)}}async processRegistration(e){console.log(`AngieMcpSdk: Processing registration for server "${e.config.name}"`);try{await this.clientManager.requestClientCreation(e),console.log(`AngieMcpSdk: Successfully registered server "${e.config.name}"`)}catch(t){throw console.error(`AngieMcpSdk: Failed to register server "${e.config.name}":`,t),t}}async registerServer(e){if(!e.server)throw new Error("Server instance is required");if(!e.name)throw new Error("Server name is required");if(!e.description)throw new Error("Server description is required");console.log(`AngieMcpSdk: Registering server "${e.name}"`);const t=this.registrationQueue.add(e);if(this.angieDetector.isReady())try{await this.processRegistration(t),this.registrationQueue.updateStatus(t.id,"registered"),console.log(`AngieMcpSdk: Server "${e.name}" registered successfully`)}catch(e){const r=e instanceof Error?e.message:String(e);throw this.registrationQueue.updateStatus(t.id,"failed",r),e}else console.log(`AngieMcpSdk: Server "${e.name}" queued until Angie is ready`)}getRegistrations(){return this.registrationQueue.getAll()}getPendingRegistrations(){return this.registrationQueue.getPending()}isAngieReady(){return this.angieDetector.isReady()}isReady(){return this.isInitialized}async waitForReady(){if(!(await this.angieDetector.waitForReady()).isReady)throw new Error("Angie is not available");for(;!this.isInitialized;)await new Promise(e=>setTimeout(e,100))}destroy(){this.registrationQueue.clear(),console.log("AngieMcpSdk: SDK destroyed")}setupServerInitHandler(){window.addEventListener("message",e=>{e.data?.type===t.SDK_REQUEST_INIT_SERVER&&this.handleServerInitRequest(e)})}handleServerInitRequest(e){const{clientId:t,serverId:r}=e.data.payload||{};if(t&&r){console.log(`AngieMcpSdk: Handling server init request for clientId: ${t}, serverId: ${r}`);try{const t=this.registrationQueue.getAll().find(e=>e.id===r);if(!t)return void console.error(`AngieMcpSdk: No registration found for serverId: ${r}`);const a=e.ports[0];if(!a)return void console.error("AngieMcpSdk: No port provided in server init request");const s=t.config.server,i=new Er(a);s.connect(i),console.log(`AngieMcpSdk: Server "${t.config.name}" initialized successfully`)}catch(e){console.error(`AngieMcpSdk: Error initializing server for clientId ${t}:`,e)}}else console.error("AngieMcpSdk: Invalid server init request - missing clientId or serverId")}}var Rr,Tr;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Rr||(Rr={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Tr||(Tr={}));const Or=Rr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cr=e=>{switch(typeof e){case"undefined":return Or.undefined;case"string":return Or.string;case"number":return Number.isNaN(e)?Or.nan:Or.number;case"boolean":return Or.boolean;case"function":return Or.function;case"bigint":return Or.bigint;case"symbol":return Or.symbol;case"object":return Array.isArray(e)?Or.array:null===e?Or.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Or.promise:"undefined"!=typeof Map&&e instanceof Map?Or.map:"undefined"!=typeof Set&&e instanceof Set?Or.set:"undefined"!=typeof Date&&e instanceof Date?Or.date:Or.object;default:return Or.unknown}},Ar=Rr.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"]);class $r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){const r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof $r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rr.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const r=a.path[0];t[r]=t[r]||[],t[r].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}$r.create=e=>new $r(e);var jr=(e,t)=>{let r;switch(e.code){case Ar.invalid_type:r=e.received===Or.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Ar.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Rr.jsonStringifyReplacer)}`;break;case Ar.unrecognized_keys:r=`Unrecognized key(s) in object: ${Rr.joinValues(e.keys,", ")}`;break;case Ar.invalid_union:r="Invalid input";break;case Ar.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Rr.joinValues(e.options)}`;break;case Ar.invalid_enum_value:r=`Invalid enum value. Expected ${Rr.joinValues(e.options)}, received '${e.received}'`;break;case Ar.invalid_arguments:r="Invalid function arguments";break;case Ar.invalid_return_type:r="Invalid function return type";break;case Ar.invalid_date:r="Invalid date";break;case Ar.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Rr.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Ar.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Ar.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Ar.custom:r="Invalid input";break;case Ar.invalid_intersection_types:r="Intersection results could not be merged";break;case Ar.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ar.not_finite:r="Number must be finite";break;default:r=t.defaultError,Rr.assertNever(e)}return{message:r}};let Ir=jr;var Nr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(Nr||(Nr={}));function Fr(e,t){const r=Ir,a=(e=>{const{data:t,path:r,errorMaps:a,issueData:s}=e,i=[...r,...s.path||[]],n={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let o="";const d=a.filter(e=>!!e).slice().reverse();for(const e of d)o=e(n,{data:t,defaultError:o}).message;return{...s,path:i,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===jr?void 0:jr].filter(e=>!!e)});e.common.issues.push(a)}class Zr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if("aborted"===a.status)return Dr;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return Zr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:t,value:s}=a;if("aborted"===t.status)return Dr;if("aborted"===s.status)return Dr;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!a.alwaysSet||(r[t.value]=s.value)}return{status:e.value,value:r}}}const Dr=Object.freeze({status:"aborted"}),Mr=e=>({status:"dirty",value:e}),Lr=e=>({status:"valid",value:e}),qr=e=>"aborted"===e.status,zr=e=>"dirty"===e.status,Vr=e=>"valid"===e.status,Hr=e=>"undefined"!=typeof Promise&&e instanceof Promise;class Ur{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}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}}const Qr=(e,t)=>{if(Vr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new $r(e.common.issues);return this._error=t,this._error}}};function Kr(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??s.defaultError}:void 0===s.data?{message:i??a??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:i??r??s.defaultError}},description:s}}class Br{get description(){return this._def.description}_getType(e){return Cr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zr,ctx:{common:e.parent.common,data:e.data,parsedType:Cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Hr(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cr(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Qr(r,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cr(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return Vr(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Vr(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cr(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(Hr(a)?a:Promise.resolve(a));return Qr(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,a)=>{const s=e(t),i=()=>a.addIssue({code:Ar.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new Wa({schema:this,typeName:ss.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:e=>this["~validate"](e)}}optional(){return Ja.create(this,this._def)}nullable(){return Ga.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Aa.create(this)}promise(){return Ba.create(this,this._def)}or(e){return Ia.create([this,e],this._def)}and(e){return Da.create(this,e,this._def)}transform(e){return new Wa({...Kr(this._def),schema:this,typeName:ss.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ya({...Kr(this._def),innerType:this,defaultValue:t,typeName:ss.ZodDefault})}brand(){return new ts({typeName:ss.ZodBranded,type:this,...Kr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Xa({...Kr(this._def),innerType:this,catchValue:t,typeName:ss.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return rs.create(this,e)}readonly(){return as.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Wr=/^c[^\s-]{8,}$/i,Jr=/^[0-9a-z]+$/,Gr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yr=/^[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,Xr=/^[a-z0-9_-]{21}$/i,ea=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ta=/^[-+]?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)?)??$/,ra=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let aa;const sa=/^(?:(?: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])$/,ia=/^(?:(?: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])$/,na=/^(([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]))$/,oa=/^(([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])$/,da=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ca=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ua="((\\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])))",la=new RegExp(`^${ua}$`);function ha(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function pa(e){return new RegExp(`^${ha(e)}$`)}function ma(e){let t=`${ua}T${ha(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function fa(e,t){return!("v4"!==t&&t||!sa.test(e))||!("v6"!==t&&t||!na.test(e))}function va(e,t){if(!ea.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function ga(e,t){return!("v4"!==t&&t||!ia.test(e))||!("v6"!==t&&t||!oa.test(e))}class ya extends Br{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Or.string){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.string,received:t.parsedType}),Dr}const t=new Zr;let r;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const s=e.data.length>a.value,i=e.data.length<a.value;(s||i)&&(r=this._getOrReturnCtx(e,r),s?Fr(r,{code:Ar.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&Fr(r,{code:Ar.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)ra.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"email",code:Ar.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)aa||(aa=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),aa.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"emoji",code:Ar.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)Yr.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"uuid",code:Ar.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)Xr.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"nanoid",code:Ar.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)Wr.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"cuid",code:Ar.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)Jr.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"cuid2",code:Ar.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)Gr.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"ulid",code:Ar.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Fr(r,{validation:"url",code:Ar.invalid_string,message:a.message}),t.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"regex",code:Ar.invalid_string,message:a.message}),t.dirty())):"trim"===a.kind?e.data=e.data.trim():"includes"===a.kind?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty()):"toLowerCase"===a.kind?e.data=e.data.toLowerCase():"toUpperCase"===a.kind?e.data=e.data.toUpperCase():"startsWith"===a.kind?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty()):"endsWith"===a.kind?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty()):"datetime"===a.kind?ma(a).test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.invalid_string,validation:"datetime",message:a.message}),t.dirty()):"date"===a.kind?la.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.invalid_string,validation:"date",message:a.message}),t.dirty()):"time"===a.kind?pa(a).test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.invalid_string,validation:"time",message:a.message}),t.dirty()):"duration"===a.kind?ta.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"duration",code:Ar.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?fa(e.data,a.version)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"ip",code:Ar.invalid_string,message:a.message}),t.dirty()):"jwt"===a.kind?va(e.data,a.alg)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"jwt",code:Ar.invalid_string,message:a.message}),t.dirty()):"cidr"===a.kind?ga(e.data,a.version)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"cidr",code:Ar.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?da.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"base64",code:Ar.invalid_string,message:a.message}),t.dirty()):"base64url"===a.kind?ca.test(e.data)||(r=this._getOrReturnCtx(e,r),Fr(r,{validation:"base64url",code:Ar.invalid_string,message:a.message}),t.dirty()):Rr.assertNever(a);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:Ar.invalid_string,...Nr.errToObj(r)})}_addCheck(e){return new ya({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Nr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Nr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Nr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Nr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Nr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Nr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Nr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Nr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Nr.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Nr.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Nr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Nr.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Nr.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Nr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...Nr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Nr.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Nr.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Nr.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Nr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Nr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Nr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Nr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Nr.errToObj(t)})}nonempty(e){return this.min(1,Nr.errToObj(e))}trim(){return new ya({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ya({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ya({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function _a(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}ya.create=e=>new ya({checks:[],typeName:ss.ZodString,coerce:e?.coerce??!1,...Kr(e)});class ba extends Br{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)!==Or.number){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.number,received:t.parsedType}),Dr}let t;const r=new Zr;for(const a of this._def.checks)"int"===a.kind?Rr.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==_a(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.not_finite,message:a.message}),r.dirty()):Rr.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Nr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Nr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Nr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Nr.toString(t))}setLimit(e,t,r,a){return new ba({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Nr.toString(a)}]})}_addCheck(e){return new ba({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Nr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Nr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Nr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&Rr.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ba.create=e=>new ba({checks:[],typeName:ss.ZodNumber,coerce:e?.coerce||!1,...Kr(e)});class wa extends Br{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)!==Or.bigint)return this._getInvalidInput(e);let t;const r=new Zr;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Fr(t,{code:Ar.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):Rr.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.bigint,received:t.parsedType}),Dr}gte(e,t){return this.setLimit("min",e,!0,Nr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Nr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Nr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Nr.toString(t))}setLimit(e,t,r,a){return new wa({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Nr.toString(a)}]})}_addCheck(e){return new wa({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Nr.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}wa.create=e=>new wa({checks:[],typeName:ss.ZodBigInt,coerce:e?.coerce??!1,...Kr(e)});class xa extends Br{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==Or.boolean){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.boolean,received:t.parsedType}),Dr}return Lr(e.data)}}xa.create=e=>new xa({typeName:ss.ZodBoolean,coerce:e?.coerce||!1,...Kr(e)});class Pa extends Br{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Or.date){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.date,received:t.parsedType}),Dr}if(Number.isNaN(e.data.getTime()))return Fr(this._getOrReturnCtx(e),{code:Ar.invalid_date}),Dr;const t=new Zr;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),Fr(r,{code:Ar.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):Rr.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Pa({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Nr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Nr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Pa.create=e=>new Pa({checks:[],coerce:e?.coerce||!1,typeName:ss.ZodDate,...Kr(e)});class ka extends Br{_parse(e){if(this._getType(e)!==Or.symbol){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.symbol,received:t.parsedType}),Dr}return Lr(e.data)}}ka.create=e=>new ka({typeName:ss.ZodSymbol,...Kr(e)});class Ea extends Br{_parse(e){if(this._getType(e)!==Or.undefined){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.undefined,received:t.parsedType}),Dr}return Lr(e.data)}}Ea.create=e=>new Ea({typeName:ss.ZodUndefined,...Kr(e)});class Sa extends Br{_parse(e){if(this._getType(e)!==Or.null){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.null,received:t.parsedType}),Dr}return Lr(e.data)}}Sa.create=e=>new Sa({typeName:ss.ZodNull,...Kr(e)});class Ra extends Br{constructor(){super(...arguments),this._any=!0}_parse(e){return Lr(e.data)}}Ra.create=e=>new Ra({typeName:ss.ZodAny,...Kr(e)});class Ta extends Br{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Lr(e.data)}}Ta.create=e=>new Ta({typeName:ss.ZodUnknown,...Kr(e)});class Oa extends Br{_parse(e){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.never,received:t.parsedType}),Dr}}Oa.create=e=>new Oa({typeName:ss.ZodNever,...Kr(e)});class Ca extends Br{_parse(e){if(this._getType(e)!==Or.undefined){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.void,received:t.parsedType}),Dr}return Lr(e.data)}}Ca.create=e=>new Ca({typeName:ss.ZodVoid,...Kr(e)});class Aa extends Br{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==Or.array)return Fr(t,{code:Ar.invalid_type,expected:Or.array,received:t.parsedType}),Dr;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(Fr(t,{code:e?Ar.too_big:Ar.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(Fr(t,{code:Ar.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(Fr(t,{code:Ar.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new Ur(t,e,t.path,r)))).then(e=>Zr.mergeArray(r,e));const s=[...t.data].map((e,r)=>a.type._parseSync(new Ur(t,e,t.path,r)));return Zr.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new Aa({...this._def,minLength:{value:e,message:Nr.toString(t)}})}max(e,t){return new Aa({...this._def,maxLength:{value:e,message:Nr.toString(t)}})}length(e,t){return new Aa({...this._def,exactLength:{value:e,message:Nr.toString(t)}})}nonempty(e){return this.min(1,e)}}function $a(e){if(e instanceof ja){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=Ja.create($a(a))}return new ja({...e._def,shape:()=>t})}return e instanceof Aa?new Aa({...e._def,type:$a(e.element)}):e instanceof Ja?Ja.create($a(e.unwrap())):e instanceof Ga?Ga.create($a(e.unwrap())):e instanceof Ma?Ma.create(e.items.map(e=>$a(e))):e}Aa.create=(e,t)=>new Aa({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ss.ZodArray,...Kr(t)});class ja extends Br{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Rr.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Or.object){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.object,received:t.parsedType}),Dr}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Oa&&"strip"===this._def.unknownKeys))for(const e in r.data)s.includes(e)||i.push(e);const n=[];for(const e of s){const t=a[e],s=r.data[e];n.push({key:{status:"valid",value:e},value:t._parse(new Ur(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof Oa){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)n.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(Fr(r,{code:Ar.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=r.data[t];n.push({key:{status:"valid",value:t},value:e._parse(new Ur(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of n){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>Zr.mergeObjectSync(t,e)):Zr.mergeObjectSync(t,n)}get shape(){return this._def.shape()}strict(e){return Nr.errToObj,new ja({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{const a=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:Nr.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new ja({...this._def,unknownKeys:"strip"})}passthrough(){return new ja({...this._def,unknownKeys:"passthrough"})}extend(e){return new ja({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ja({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ss.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ja({...this._def,catchall:e})}pick(e){const t={};for(const r of Rr.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new ja({...this._def,shape:()=>t})}omit(e){const t={};for(const r of Rr.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new ja({...this._def,shape:()=>t})}deepPartial(){return $a(this)}partial(e){const t={};for(const r of Rr.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new ja({...this._def,shape:()=>t})}required(e){const t={};for(const r of Rr.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Ja;)e=e._def.innerType;t[r]=e}return new ja({...this._def,shape:()=>t})}keyof(){return Ua(Rr.objectKeys(this.shape))}}ja.create=(e,t)=>new ja({shape:()=>e,unknownKeys:"strip",catchall:Oa.create(),typeName:ss.ZodObject,...Kr(t)}),ja.strictCreate=(e,t)=>new ja({shape:()=>e,unknownKeys:"strict",catchall:Oa.create(),typeName:ss.ZodObject,...Kr(t)}),ja.lazycreate=(e,t)=>new ja({shape:e,unknownKeys:"strip",catchall:Oa.create(),typeName:ss.ZodObject,...Kr(t)});class Ia extends Br{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new $r(e.ctx.common.issues));return Fr(t,{code:Ar.invalid_union,unionErrors:r}),Dr});{let e;const a=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=a.map(e=>new $r(e));return Fr(t,{code:Ar.invalid_union,unionErrors:s}),Dr}}get options(){return this._def.options}}Ia.create=(e,t)=>new Ia({options:e,typeName:ss.ZodUnion,...Kr(t)});const Na=e=>e instanceof Va?Na(e.schema):e instanceof Wa?Na(e.innerType()):e instanceof Ha?[e.value]:e instanceof Qa?e.options:e instanceof Ka?Rr.objectValues(e.enum):e instanceof Ya?Na(e._def.innerType):e instanceof Ea?[void 0]:e instanceof Sa?[null]:e instanceof Ja?[void 0,...Na(e.unwrap())]:e instanceof Ga?[null,...Na(e.unwrap())]:e instanceof ts||e instanceof as?Na(e.unwrap()):e instanceof Xa?Na(e._def.innerType):[];class Fa extends Br{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Or.object)return Fr(t,{code:Ar.invalid_type,expected:Or.object,received:t.parsedType}),Dr;const r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(Fr(t,{code:Ar.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Dr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=Na(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new Fa({typeName:ss.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...Kr(r)})}}function Za(e,t){const r=Cr(e),a=Cr(t);if(e===t)return{valid:!0,data:e};if(r===Or.object&&a===Or.object){const r=Rr.objectKeys(t),a=Rr.objectKeys(e).filter(e=>-1!==r.indexOf(e)),s={...e,...t};for(const r of a){const a=Za(e[r],t[r]);if(!a.valid)return{valid:!1};s[r]=a.data}return{valid:!0,data:s}}if(r===Or.array&&a===Or.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let a=0;a<e.length;a++){const s=Za(e[a],t[a]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return r===Or.date&&a===Or.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Da extends Br{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if(qr(e)||qr(a))return Dr;const s=Za(e.value,a.value);return s.valid?((zr(e)||zr(a))&&t.dirty(),{status:t.value,value:s.data}):(Fr(r,{code:Ar.invalid_intersection_types}),Dr)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Da.create=(e,t,r)=>new Da({left:e,right:t,typeName:ss.ZodIntersection,...Kr(r)});class Ma extends Br{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Or.array)return Fr(r,{code:Ar.invalid_type,expected:Or.array,received:r.parsedType}),Dr;if(r.data.length<this._def.items.length)return Fr(r,{code:Ar.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Dr;!this._def.rest&&r.data.length>this._def.items.length&&(Fr(r,{code:Ar.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new Ur(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>Zr.mergeArray(t,e)):Zr.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Ma({...this._def,rest:e})}}Ma.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ma({items:e,typeName:ss.ZodTuple,rest:null,...Kr(t)})};class La extends Br{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Or.object)return Fr(r,{code:Ar.invalid_type,expected:Or.object,received:r.parsedType}),Dr;const a=[],s=this._def.keyType,i=this._def.valueType;for(const e in r.data)a.push({key:s._parse(new Ur(r,e,r.path,e)),value:i._parse(new Ur(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?Zr.mergeObjectAsync(t,a):Zr.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new La(t instanceof Br?{keyType:e,valueType:t,typeName:ss.ZodRecord,...Kr(r)}:{keyType:ya.create(),valueType:e,typeName:ss.ZodRecord,...Kr(t)})}}class qa extends Br{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Or.map)return Fr(r,{code:Ar.invalid_type,expected:Or.map,received:r.parsedType}),Dr;const a=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([e,t],i)=>({key:a._parse(new Ur(r,e,r.path,[i,"key"])),value:s._parse(new Ur(r,t,r.path,[i,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of i){const a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return Dr;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of i){const a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return Dr;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}qa.create=(e,t,r)=>new qa({valueType:t,keyType:e,typeName:ss.ZodMap,...Kr(r)});class za extends Br{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Or.set)return Fr(r,{code:Ar.invalid_type,expected:Or.set,received:r.parsedType}),Dr;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(Fr(r,{code:Ar.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(Fr(r,{code:Ar.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const r=new Set;for(const a of e){if("aborted"===a.status)return Dr;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const n=[...r.data.values()].map((e,t)=>s._parse(new Ur(r,e,r.path,t)));return r.common.async?Promise.all(n).then(e=>i(e)):i(n)}min(e,t){return new za({...this._def,minSize:{value:e,message:Nr.toString(t)}})}max(e,t){return new za({...this._def,maxSize:{value:e,message:Nr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}za.create=(e,t)=>new za({valueType:e,minSize:null,maxSize:null,typeName:ss.ZodSet,...Kr(t)});class Va extends Br{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Va.create=(e,t)=>new Va({getter:e,typeName:ss.ZodLazy,...Kr(t)});class Ha extends Br{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Fr(t,{received:t.data,code:Ar.invalid_literal,expected:this._def.value}),Dr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ua(e,t){return new Qa({values:e,typeName:ss.ZodEnum,...Kr(t)})}Ha.create=(e,t)=>new Ha({value:e,typeName:ss.ZodLiteral,...Kr(t)});class Qa extends Br{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return Fr(t,{expected:Rr.joinValues(r),received:t.parsedType,code:Ar.invalid_type}),Dr}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return Fr(t,{received:t.data,code:Ar.invalid_enum_value,options:r}),Dr}return Lr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Qa.create(e,{...this._def,...t})}exclude(e,t=this._def){return Qa.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Qa.create=Ua;class Ka extends Br{_parse(e){const t=Rr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Or.string&&r.parsedType!==Or.number){const e=Rr.objectValues(t);return Fr(r,{expected:Rr.joinValues(e),received:r.parsedType,code:Ar.invalid_type}),Dr}if(this._cache||(this._cache=new Set(Rr.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=Rr.objectValues(t);return Fr(r,{received:r.data,code:Ar.invalid_enum_value,options:e}),Dr}return Lr(e.data)}get enum(){return this._def.values}}Ka.create=(e,t)=>new Ka({values:e,typeName:ss.ZodNativeEnum,...Kr(t)});class Ba extends Br{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Or.promise&&!1===t.common.async)return Fr(t,{code:Ar.invalid_type,expected:Or.promise,received:t.parsedType}),Dr;const r=t.parsedType===Or.promise?t.data:Promise.resolve(t.data);return Lr(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ba.create=(e,t)=>new Ba({type:e,typeName:ss.ZodPromise,...Kr(t)});class Wa extends Br{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ss.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:e=>{Fr(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return Dr;const a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?Dr:"dirty"===a.status||"dirty"===t.value?Mr(a.value):a});{if("aborted"===t.value)return Dr;const a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?Dr:"dirty"===a.status||"dirty"===t.value?Mr(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?Dr:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?Dr:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Vr(e))return Dr;const i=a.transform(e.value,s);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>Vr(e)?Promise.resolve(a.transform(e.value,s)).then(e=>({status:t.value,value:e})):Dr)}Rr.assertNever(a)}}Wa.create=(e,t,r)=>new Wa({schema:e,typeName:ss.ZodEffects,effect:t,...Kr(r)}),Wa.createWithPreprocess=(e,t,r)=>new Wa({schema:t,effect:{type:"preprocess",transform:e},typeName:ss.ZodEffects,...Kr(r)});class Ja extends Br{_parse(e){return this._getType(e)===Or.undefined?Lr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ja.create=(e,t)=>new Ja({innerType:e,typeName:ss.ZodOptional,...Kr(t)});class Ga extends Br{_parse(e){return this._getType(e)===Or.null?Lr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ga.create=(e,t)=>new Ga({innerType:e,typeName:ss.ZodNullable,...Kr(t)});class Ya extends Br{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===Or.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ya.create=(e,t)=>new Ya({innerType:e,typeName:ss.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Kr(t)});class Xa extends Br{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Hr(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new $r(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new $r(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Xa.create=(e,t)=>new Xa({innerType:e,typeName:ss.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Kr(t)});class es extends Br{_parse(e){if(this._getType(e)!==Or.nan){const t=this._getOrReturnCtx(e);return Fr(t,{code:Ar.invalid_type,expected:Or.nan,received:t.parsedType}),Dr}return{status:"valid",value:e.data}}}es.create=e=>new es({typeName:ss.ZodNaN,...Kr(e)}),Symbol("zod_brand");class ts extends Br{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class rs extends Br{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Dr:"dirty"===e.status?(t.dirty(),Mr(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Dr:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new rs({in:e,out:t,typeName:ss.ZodPipeline})}}class as extends Br{_parse(e){const t=this._def.innerType._parse(e),r=e=>(Vr(e)&&(e.value=Object.freeze(e.value)),e);return Hr(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var ss;as.create=(e,t)=>new as({innerType:e,typeName:ss.ZodReadonly,...Kr(t)}),ja.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ss||(ss={}));const is=ya.create,ns=ba.create,os=(es.create,wa.create,xa.create),ds=(Pa.create,ka.create,Ea.create,Sa.create,Ra.create,Ta.create),cs=(Oa.create,Ca.create,Aa.create),us=ja.create,ls=(ja.strictCreate,Ia.create),hs=Fa.create,ps=(Da.create,Ma.create,La.create),ms=(qa.create,za.create,Va.create,Ha.create),fs=Qa.create,vs=(Ka.create,Ba.create,Wa.create,Ja.create),gs=(Ga.create,Wa.createWithPreprocess,rs.create,"2025-06-18"),ys=[gs,"2025-03-26","2024-11-05","2024-10-07"],_s="2.0",bs=ls([is(),ns().int()]),ws=is(),xs=us({progressToken:vs(bs)}).passthrough(),Ps=us({_meta:vs(xs)}).passthrough(),ks=us({method:is(),params:vs(Ps)}),Es=us({_meta:vs(us({}).passthrough())}).passthrough(),Ss=us({method:is(),params:vs(Es)}),Rs=us({_meta:vs(us({}).passthrough())}).passthrough(),Ts=ls([is(),ns().int()]),Os=us({jsonrpc:ms(_s),id:Ts}).merge(ks).strict(),Cs=us({jsonrpc:ms(_s)}).merge(Ss).strict(),As=us({jsonrpc:ms(_s),id:Ts,result:Rs}).strict(),$s=e=>As.safeParse(e).success;var js;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(js||(js={}));const Is=us({jsonrpc:ms(_s),id:Ts,error:us({code:ns().int(),message:is(),data:vs(ds())})}).strict(),Ns=(ls([Os,Cs,As,Is]),Rs.strict()),Fs=Ss.extend({method:ms("notifications/cancelled"),params:Es.extend({requestId:Ts,reason:is().optional()})}),Zs=us({name:is(),title:vs(is())}).passthrough(),Ds=Zs.extend({version:is()}),Ms=us({experimental:vs(us({}).passthrough()),sampling:vs(us({}).passthrough()),elicitation:vs(us({}).passthrough()),roots:vs(us({listChanged:vs(os())}).passthrough())}).passthrough(),Ls=ks.extend({method:ms("initialize"),params:Ps.extend({protocolVersion:is(),capabilities:Ms,clientInfo:Ds})}),qs=us({experimental:vs(us({}).passthrough()),logging:vs(us({}).passthrough()),completions:vs(us({}).passthrough()),prompts:vs(us({listChanged:vs(os())}).passthrough()),resources:vs(us({subscribe:vs(os()),listChanged:vs(os())}).passthrough()),tools:vs(us({listChanged:vs(os())}).passthrough())}).passthrough(),zs=Rs.extend({protocolVersion:is(),capabilities:qs,serverInfo:Ds,instructions:vs(is())}),Vs=Ss.extend({method:ms("notifications/initialized")}),Hs=ks.extend({method:ms("ping")}),Us=us({progress:ns(),total:vs(ns()),message:vs(is())}).passthrough(),Qs=Ss.extend({method:ms("notifications/progress"),params:Es.merge(Us).extend({progressToken:bs})}),Ks=ks.extend({params:Ps.extend({cursor:vs(ws)}).optional()}),Bs=Rs.extend({nextCursor:vs(ws)}),Ws=us({uri:is(),mimeType:vs(is()),_meta:vs(us({}).passthrough())}).passthrough(),Js=Ws.extend({text:is()}),Gs=is().refine(e=>{try{return atob(e),!0}catch(e){return!1}},{message:"Invalid Base64 string"}),Ys=Ws.extend({blob:Gs}),Xs=Zs.extend({uri:is(),description:vs(is()),mimeType:vs(is()),_meta:vs(us({}).passthrough())}),ei=Zs.extend({uriTemplate:is(),description:vs(is()),mimeType:vs(is()),_meta:vs(us({}).passthrough())}),ti=Ks.extend({method:ms("resources/list")}),ri=Bs.extend({resources:cs(Xs)}),ai=Ks.extend({method:ms("resources/templates/list")}),si=Bs.extend({resourceTemplates:cs(ei)}),ii=ks.extend({method:ms("resources/read"),params:Ps.extend({uri:is()})}),ni=Rs.extend({contents:cs(ls([Js,Ys]))}),oi=Ss.extend({method:ms("notifications/resources/list_changed")}),di=ks.extend({method:ms("resources/subscribe"),params:Ps.extend({uri:is()})}),ci=ks.extend({method:ms("resources/unsubscribe"),params:Ps.extend({uri:is()})}),ui=Ss.extend({method:ms("notifications/resources/updated"),params:Es.extend({uri:is()})}),li=us({name:is(),description:vs(is()),required:vs(os())}).passthrough(),hi=Zs.extend({description:vs(is()),arguments:vs(cs(li)),_meta:vs(us({}).passthrough())}),pi=Ks.extend({method:ms("prompts/list")}),mi=Bs.extend({prompts:cs(hi)}),fi=ks.extend({method:ms("prompts/get"),params:Ps.extend({name:is(),arguments:vs(ps(is()))})}),vi=us({type:ms("text"),text:is(),_meta:vs(us({}).passthrough())}).passthrough(),gi=us({type:ms("image"),data:Gs,mimeType:is(),_meta:vs(us({}).passthrough())}).passthrough(),yi=us({type:ms("audio"),data:Gs,mimeType:is(),_meta:vs(us({}).passthrough())}).passthrough(),_i=us({type:ms("resource"),resource:ls([Js,Ys]),_meta:vs(us({}).passthrough())}).passthrough(),bi=ls([vi,gi,yi,Xs.extend({type:ms("resource_link")}),_i]),wi=us({role:fs(["user","assistant"]),content:bi}).passthrough(),xi=Rs.extend({description:vs(is()),messages:cs(wi)}),Pi=Ss.extend({method:ms("notifications/prompts/list_changed")}),ki=us({title:vs(is()),readOnlyHint:vs(os()),destructiveHint:vs(os()),idempotentHint:vs(os()),openWorldHint:vs(os())}).passthrough(),Ei=Zs.extend({description:vs(is()),inputSchema:us({type:ms("object"),properties:vs(us({}).passthrough()),required:vs(cs(is()))}).passthrough(),outputSchema:vs(us({type:ms("object"),properties:vs(us({}).passthrough()),required:vs(cs(is()))}).passthrough()),annotations:vs(ki),_meta:vs(us({}).passthrough())}),Si=Ks.extend({method:ms("tools/list")}),Ri=Bs.extend({tools:cs(Ei)}),Ti=Rs.extend({content:cs(bi).default([]),structuredContent:us({}).passthrough().optional(),isError:vs(os())}),Oi=(Ti.or(Rs.extend({toolResult:ds()})),ks.extend({method:ms("tools/call"),params:Ps.extend({name:is(),arguments:vs(ps(ds()))})})),Ci=Ss.extend({method:ms("notifications/tools/list_changed")}),Ai=fs(["debug","info","notice","warning","error","critical","alert","emergency"]),$i=ks.extend({method:ms("logging/setLevel"),params:Ps.extend({level:Ai})}),ji=Ss.extend({method:ms("notifications/message"),params:Es.extend({level:Ai,logger:vs(is()),data:ds()})}),Ii=us({name:is().optional()}).passthrough(),Ni=us({hints:vs(cs(Ii)),costPriority:vs(ns().min(0).max(1)),speedPriority:vs(ns().min(0).max(1)),intelligencePriority:vs(ns().min(0).max(1))}).passthrough(),Fi=us({role:fs(["user","assistant"]),content:ls([vi,gi,yi])}).passthrough(),Zi=ks.extend({method:ms("sampling/createMessage"),params:Ps.extend({messages:cs(Fi),systemPrompt:vs(is()),includeContext:vs(fs(["none","thisServer","allServers"])),temperature:vs(ns()),maxTokens:ns().int(),stopSequences:vs(cs(is())),metadata:vs(us({}).passthrough()),modelPreferences:vs(Ni)})}),Di=Rs.extend({model:is(),stopReason:vs(fs(["endTurn","stopSequence","maxTokens"]).or(is())),role:fs(["user","assistant"]),content:hs("type",[vi,gi,yi])}),Mi=ls([us({type:ms("boolean"),title:vs(is()),description:vs(is()),default:vs(os())}).passthrough(),us({type:ms("string"),title:vs(is()),description:vs(is()),minLength:vs(ns()),maxLength:vs(ns()),format:vs(fs(["email","uri","date","date-time"]))}).passthrough(),us({type:fs(["number","integer"]),title:vs(is()),description:vs(is()),minimum:vs(ns()),maximum:vs(ns())}).passthrough(),us({type:ms("string"),title:vs(is()),description:vs(is()),enum:cs(is()),enumNames:vs(cs(is()))}).passthrough()]),Li=ks.extend({method:ms("elicitation/create"),params:Ps.extend({message:is(),requestedSchema:us({type:ms("object"),properties:ps(is(),Mi),required:vs(cs(is()))}).passthrough()})}),qi=Rs.extend({action:fs(["accept","decline","cancel"]),content:vs(ps(is(),ds()))}),zi=us({type:ms("ref/resource"),uri:is()}).passthrough(),Vi=us({type:ms("ref/prompt"),name:is()}).passthrough(),Hi=ks.extend({method:ms("completion/complete"),params:Ps.extend({ref:ls([Vi,zi]),argument:us({name:is(),value:is()}).passthrough(),context:vs(us({arguments:vs(ps(is(),is()))}))})}),Ui=Rs.extend({completion:us({values:cs(is()).max(100),total:vs(ns().int()),hasMore:vs(os())}).passthrough()}),Qi=us({uri:is().startsWith("file://"),name:vs(is()),_meta:vs(us({}).passthrough())}).passthrough(),Ki=ks.extend({method:ms("roots/list")}),Bi=Rs.extend({roots:cs(Qi)}),Wi=Ss.extend({method:ms("notifications/roots/list_changed")});ls([Hs,Ls,Hi,$i,fi,pi,ti,ai,ii,di,ci,Oi,Si]),ls([Fs,Qs,Vs,Wi]),ls([Ns,Di,qi,Bi]),ls([Hs,Zi,Li,Ki]),ls([Fs,Qs,ji,ui,oi,Ci,Pi]),ls([Ns,zs,Ui,xi,mi,ri,si,ni,Ti,Ri]);class Ji extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}}class Gi{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(Fs,e=>{const t=this._requestHandlerAbortControllers.get(e.params.requestId);null==t||t.abort(e.params.reason)}),this.setNotificationHandler(Qs,e=>{this._onprogress(e)}),this.setRequestHandler(Hs,e=>({}))}_setupTimeout(e,t,r,a,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Ji(js.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,r,a;this._transport=e;const s=null===(t=this.transport)||void 0===t?void 0:t.onclose;this._transport.onclose=()=>{null==s||s(),this._onclose()};const i=null===(r=this.transport)||void 0===r?void 0:r.onerror;this._transport.onerror=e=>{null==i||i(e),this._onerror(e)};const n=null===(a=this._transport)||void 0===a?void 0:a.onmessage;this._transport.onmessage=(e,t)=>{var r;null==n||n(e,t),$s(e)||(r=e,Is.safeParse(r).success)?this._onresponse(e):(e=>Os.safeParse(e).success)(e)?this._onrequest(e,t):(e=>Cs.safeParse(e).success)(e)?this._onnotification(e):this._onerror(new Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null===(e=this.onclose)||void 0===e||e.call(this);const r=new Ji(js.ConnectionClosed,"Connection closed");for(const e of t.values())e(r)}_onerror(e){var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}_onnotification(e){var t;const r=null!==(t=this._notificationHandlers.get(e.method))&&void 0!==t?t:this.fallbackNotificationHandler;void 0!==r&&Promise.resolve().then(()=>r(e)).catch(e=>this._onerror(new Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r,a;const s=null!==(r=this._requestHandlers.get(e.method))&&void 0!==r?r:this.fallbackRequestHandler,i=this._transport;if(void 0===s)return void(null==i||i.send({jsonrpc:"2.0",id:e.id,error:{code:js.MethodNotFound,message:"Method not found"}}).catch(e=>this._onerror(new Error(`Failed to send an error response: ${e}`))));const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const o={signal:n.signal,sessionId:null==i?void 0:i.sessionId,_meta:null===(a=e.params)||void 0===a?void 0:a._meta,sendNotification:t=>this.notification(t,{relatedRequestId:e.id}),sendRequest:(t,r,a)=>this.request(t,r,{...a,relatedRequestId:e.id}),authInfo:null==t?void 0:t.authInfo,requestId:e.id,requestInfo:null==t?void 0:t.requestInfo};Promise.resolve().then(()=>s(e,o)).then(t=>{if(!n.signal.aborted)return null==i?void 0:i.send({result:t,jsonrpc:"2.0",id:e.id})},t=>{var r;if(!n.signal.aborted)return null==i?void 0:i.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:js.InternalError,message:null!==(r=t.message)&&void 0!==r?r:"Internal error"}})}).catch(e=>this._onerror(new Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...r}=e.params,a=Number(t),s=this._progressHandlers.get(a);if(!s)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));const i=this._responseHandlers.get(a),n=this._timeoutInfo.get(a);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(e){return void i(e)}s(r)}_onresponse(e){const t=Number(e.id),r=this._responseHandlers.get(t);void 0!==r?(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),$s(e)?r(e):r(new Ji(e.error.code,e.error.message,e.error.data))):this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`))}get transport(){return this._transport}async close(){var e;await(null===(e=this._transport)||void 0===e?void 0:e.close())}request(e,t,r){const{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}=null!=r?r:{};return new Promise((n,o)=>{var d,c,u,l,h,p;if(!this._transport)return void o(new Error("Not connected"));!0===(null===(d=this._options)||void 0===d?void 0:d.enforceStrictCapabilities)&&this.assertCapabilityForMethod(e.method),null===(c=null==r?void 0:r.signal)||void 0===c||c.throwIfAborted();const m=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:m};(null==r?void 0:r.onprogress)&&(this._progressHandlers.set(m,r.onprogress),f.params={...e.params,_meta:{...(null===(u=e.params)||void 0===u?void 0:u._meta)||{},progressToken:m}});const v=e=>{var t;this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),null===(t=this._transport)||void 0===t||t.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(e)}},{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>this._onerror(new Error(`Failed to send cancellation: ${e}`))),o(e)};this._responseHandlers.set(m,e=>{var a;if(!(null===(a=null==r?void 0:r.signal)||void 0===a?void 0:a.aborted)){if(e instanceof Error)return o(e);try{const r=t.parse(e.result);n(r)}catch(e){o(e)}}}),null===(l=null==r?void 0:r.signal)||void 0===l||l.addEventListener("abort",()=>{var e;v(null===(e=null==r?void 0:r.signal)||void 0===e?void 0:e.reason)});const g=null!==(h=null==r?void 0:r.timeout)&&void 0!==h?h:6e4;this._setupTimeout(m,g,null==r?void 0:r.maxTotalTimeout,()=>v(new Ji(js.RequestTimeout,"Request timed out",{timeout:g})),null!==(p=null==r?void 0:r.resetTimeoutOnProgress)&&void 0!==p&&p),this._transport.send(f,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>{this._cleanupTimeout(m),o(e)})})}async notification(e,t){var r,a;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),(null!==(a=null===(r=this._options)||void 0===r?void 0:r.debouncedNotificationMethods)&&void 0!==a?a:[]).includes(e.method)&&!e.params&&!(null==t?void 0:t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;return this._pendingDebouncedNotifications.add(e.method),void Promise.resolve().then(()=>{var r;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const a={...e,jsonrpc:"2.0"};null===(r=this._transport)||void 0===r||r.send(a,t).catch(e=>this._onerror(e))})}const s={...e,jsonrpc:"2.0"};await this._transport.send(s,t)}setRequestHandler(e,t){const r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(r,a)=>Promise.resolve(t(e.parse(r),a)))}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,r=>Promise.resolve(t(e.parse(r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}var Yi=r(8725);class Xi extends Gi{constructor(e,t){var r;super(t),this._serverInfo=e,this._capabilities=null!==(r=null==t?void 0:t.capabilities)&&void 0!==r?r:{},this._instructions=null==t?void 0:t.instructions,this.setRequestHandler(Ls,e=>this._oninitialize(e)),this.setNotificationHandler(Vs,()=>{var e;return null===(e=this.oninitialized)||void 0===e?void 0:e.call(this)})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");var t,r;this._capabilities=(t=this._capabilities,r=e,Object.entries(r).reduce((e,[t,r])=>(e[t]=r&&"object"==typeof r&&e[t]?{...e[t],...r}:r,e),{...t}))}assertCapabilityForMethod(e){var t,r,a;switch(e){case"sampling/createMessage":if(!(null===(t=this._clientCapabilities)||void 0===t?void 0:t.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(null===(r=this._clientCapabilities)||void 0===r?void 0:r.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(null===(a=this._clientCapabilities)||void 0===a?void 0:a.roots))throw new Error(`Client does not support listing roots (required for ${e})`)}}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})`)}}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})`)}}async _oninitialize(e){const t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:ys.includes(t)?t:gs,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"},Ns)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Di,t)}async elicitInput(e,t){const r=await this.request({method:"elicitation/create",params:e},qi,t);if("accept"===r.action&&r.content)try{const t=new Yi,a=t.compile(e.requestedSchema);if(!a(r.content))throw new Ji(js.InvalidParams,`Elicitation response content does not match requested schema: ${t.errorsText(a.errors)}`)}catch(e){if(e instanceof Ji)throw e;throw new Ji(js.InternalError,`Error validating elicitation response: ${e}`)}return r}async listRoots(e,t){return this.request({method:"roots/list",params:e},Bi,t)}async sendLoggingMessage(e){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"})}}const en=Symbol("Let zodToJsonSchema decide on which parser to use"),tn={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"},rn=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function an(e){if("openAi"!==e.target)return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?rn(t,e.currentPath):t.join("/")}}function sn(e,t,r,a){a?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function nn(e,t,r,a,s){e[t]=r,sn(e,t,a,s)}function on(e,t){return jn(e.type._def,t)}function dn(e,t,r){const a=r??t.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((r,a)=>dn(e,t,r))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return cn(e,t)}}const cn=(e,t)=>{const r={type:"integer",format:"unix-time"};if("openApi3"===t.target)return r;for(const a of e.checks)switch(a.kind){case"min":nn(r,"minimum",a.value,a.message,t);break;case"max":nn(r,"maximum",a.value,a.message,t)}return r};let un;const ln=/^[cC][^\s-]{8,}$/,hn=/^[0-9a-z]+$/,pn=/^[0-9A-HJKMNP-TV-Z]{26}$/,mn=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,fn=()=>(void 0===un&&(un=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),un),vn=/^(?:(?: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])$/,gn=/^(([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])$/,yn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_n=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bn=/^[a-zA-Z0-9_-]{21}$/,wn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function xn(e,t){const r={type:"string"};if(e.checks)for(const a of e.checks)switch(a.kind){case"min":nn(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t);break;case"max":nn(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"email":switch(t.emailStrategy){case"format:email":En(r,"email",a.message,t);break;case"format:idn-email":En(r,"idn-email",a.message,t);break;case"pattern:zod":Sn(r,mn,a.message,t)}break;case"url":En(r,"uri",a.message,t);break;case"uuid":En(r,"uuid",a.message,t);break;case"regex":Sn(r,a.regex,a.message,t);break;case"cuid":Sn(r,ln,a.message,t);break;case"cuid2":Sn(r,hn,a.message,t);break;case"startsWith":Sn(r,RegExp(`^${Pn(a.value,t)}`),a.message,t);break;case"endsWith":Sn(r,RegExp(`${Pn(a.value,t)}$`),a.message,t);break;case"datetime":En(r,"date-time",a.message,t);break;case"date":En(r,"date",a.message,t);break;case"time":En(r,"time",a.message,t);break;case"duration":En(r,"duration",a.message,t);break;case"length":nn(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t),nn(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"includes":Sn(r,RegExp(Pn(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&En(r,"ipv4",a.message,t),"v4"!==a.version&&En(r,"ipv6",a.message,t);break;case"base64url":Sn(r,_n,a.message,t);break;case"jwt":Sn(r,wn,a.message,t);break;case"cidr":"v6"!==a.version&&Sn(r,vn,a.message,t),"v4"!==a.version&&Sn(r,gn,a.message,t);break;case"emoji":Sn(r,fn(),a.message,t);break;case"ulid":Sn(r,pn,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":En(r,"binary",a.message,t);break;case"contentEncoding:base64":nn(r,"contentEncoding","base64",a.message,t);break;case"pattern:zod":Sn(r,yn,a.message,t)}break;case"nanoid":Sn(r,bn,a.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return r}function Pn(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)kn.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}const kn=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function En(e,t,r,a){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&a.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&a.errorMessages&&{errorMessage:{format:r}}})):nn(e,"format",t,r,a)}function Sn(e,t,r,a){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&a.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:Rn(t,a),...r&&a.errorMessages&&{errorMessage:{pattern:r}}})):nn(e,"pattern",Rn(t,a),r,a)}function Rn(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;const r=e.flags.includes("i"),a=e.flags.includes("m"),s=e.flags.includes("s"),i=r?e.source.toLowerCase():e.source;let n="",o=!1,d=!1,c=!1;for(let e=0;e<i.length;e++)if(o)n+=i[e],o=!1;else{if(r)if(d){if(i[e].match(/[a-z]/)){c?(n+=i[e],n+=`${i[e-2]}-${i[e]}`.toUpperCase(),c=!1):"-"===i[e+1]&&i[e+2]?.match(/[a-z]/)?(n+=i[e],c=!0):n+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){n+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(a){if("^"===i[e]){n+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){n+="($|(?=[\r\n]))";continue}}s&&"."===i[e]?n+=d?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(n+=i[e],"\\"===i[e]?o=!0:d&&"]"===i[e]?d=!1:d||"["!==i[e]||(d=!0))}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function Tn(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===ss.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,a)=>({...r,[a]:jn(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??an(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};const r={type:"object",additionalProperties:jn(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===ss.ZodString&&e.keyType._def.checks?.length){const{type:a,...s}=xn(e.keyType._def,t);return{...r,propertyNames:s}}if(e.keyType?._def.typeName===ss.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===ss.ZodBranded&&e.keyType._def.type._def.typeName===ss.ZodString&&e.keyType._def.type._def.checks?.length){const{type:a,...s}=on(e.keyType._def,t);return{...r,propertyNames:s}}return r}const On={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},Cn=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>jn(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function An(e){try{return e.isOptional()}catch{return!0}}const $n=(e,t,r)=>{switch(t){case ss.ZodString:return xn(e,r);case ss.ZodNumber:return function(e,t){const r={type:"number"};if(!e.checks)return r;for(const a of e.checks)switch(a.kind){case"int":r.type="integer",sn(r,"type",a.message,t);break;case"min":"jsonSchema7"===t.target?a.inclusive?nn(r,"minimum",a.value,a.message,t):nn(r,"exclusiveMinimum",a.value,a.message,t):(a.inclusive||(r.exclusiveMinimum=!0),nn(r,"minimum",a.value,a.message,t));break;case"max":"jsonSchema7"===t.target?a.inclusive?nn(r,"maximum",a.value,a.message,t):nn(r,"exclusiveMaximum",a.value,a.message,t):(a.inclusive||(r.exclusiveMaximum=!0),nn(r,"maximum",a.value,a.message,t));break;case"multipleOf":nn(r,"multipleOf",a.value,a.message,t)}return r}(e,r);case ss.ZodObject:return function(e,t){const r="openAi"===t.target,a={type:"object",properties:{}},s=[],i=e.shape();for(const e in i){let n=i[e];if(void 0===n||void 0===n._def)continue;let o=An(n);o&&r&&("ZodOptional"===n._def.typeName&&(n=n._def.innerType),n.isNullable()||(n=n.nullable()),o=!1);const d=jn(n._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==d&&(a.properties[e]=d,o||s.push(e))}s.length&&(a.required=s);const n=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return jn(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==n&&(a.additionalProperties=n),a}(e,r);case ss.ZodBigInt:return function(e,t){const r={type:"integer",format:"int64"};if(!e.checks)return r;for(const a of e.checks)switch(a.kind){case"min":"jsonSchema7"===t.target?a.inclusive?nn(r,"minimum",a.value,a.message,t):nn(r,"exclusiveMinimum",a.value,a.message,t):(a.inclusive||(r.exclusiveMinimum=!0),nn(r,"minimum",a.value,a.message,t));break;case"max":"jsonSchema7"===t.target?a.inclusive?nn(r,"maximum",a.value,a.message,t):nn(r,"exclusiveMaximum",a.value,a.message,t):(a.inclusive||(r.exclusiveMaximum=!0),nn(r,"maximum",a.value,a.message,t));break;case"multipleOf":nn(r,"multipleOf",a.value,a.message,t)}return r}(e,r);case ss.ZodBoolean:return{type:"boolean"};case ss.ZodDate:return dn(e,r);case ss.ZodUndefined:return function(e){return{not:an(e)}}(r);case ss.ZodNull:return function(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}(r);case ss.ZodArray:return function(e,t){const r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==ss.ZodAny&&(r.items=jn(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&nn(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&nn(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(nn(r,"minItems",e.exactLength.value,e.exactLength.message,t),nn(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}(e,r);case ss.ZodUnion:case ss.ZodDiscriminatedUnion:return function(e,t){if("openApi3"===t.target)return Cn(e,t);const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(e=>e._def.typeName in On&&(!e._def.checks||!e._def.checks.length))){const e=r.reduce((e,t)=>{const r=On[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(r.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){const e=r.reduce((e,t)=>{const r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===r.length){const t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:r.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(r.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:r.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return Cn(e,t)}(e,r);case ss.ZodIntersection:return function(e,t){const r=[jn(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),jn(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e);let a="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0;const s=[];return r.forEach(e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:r,...a}=e;t=a}else a=void 0;s.push(t)}else s.push(...e.allOf),void 0===e.unevaluatedProperties&&(a=void 0);var t}),s.length?{allOf:s,...a}:void 0}(e,r);case ss.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,r)=>jn(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:jn(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,r)=>jn(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,r);case ss.ZodRecord:return Tn(e,r);case ss.ZodLiteral:return function(e,t){const r=typeof e.value;return"bigint"!==r&&"number"!==r&&"boolean"!==r&&"string"!==r?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===r?"integer":r,enum:[e.value]}:{type:"bigint"===r?"integer":r,const:e.value}}(e,r);case ss.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case ss.ZodNativeEnum:return function(e){const t=e.values,r=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),a=Array.from(new Set(r.map(e=>typeof e)));return{type:1===a.length?"string"===a[0]?"string":"number":["string","number"],enum:r}}(e);case ss.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:On[e.innerType._def.typeName],nullable:!0}:{type:[On[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){const r=jn(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const r=jn(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}(e,r);case ss.ZodOptional:return((e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return jn(e.innerType._def,t);const r=jn(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:an(t)},r]}:an(t)})(e,r);case ss.ZodMap:return function(e,t){return"record"===t.mapStrategy?Tn(e,t):{type:"array",maxItems:125,items:{type:"array",items:[jn(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||an(t),jn(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||an(t)],minItems:2,maxItems:2}}}(e,r);case ss.ZodSet:return function(e,t){const r={type:"array",uniqueItems:!0,items:jn(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&nn(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&nn(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}(e,r);case ss.ZodLazy:return()=>e.getter()._def;case ss.ZodPromise:return function(e,t){return jn(e.type._def,t)}(e,r);case ss.ZodNaN:case ss.ZodNever:return function(e){return"openAi"===e.target?void 0:{not:an({...e,currentPath:[...e.currentPath,"not"]})}}(r);case ss.ZodEffects:return function(e,t){return"input"===t.effectStrategy?jn(e.schema._def,t):an(t)}(e,r);case ss.ZodAny:return an(r);case ss.ZodUnknown:return function(e){return an(e)}(r);case ss.ZodDefault:return function(e,t){return{...jn(e.innerType._def,t),default:e.defaultValue()}}(e,r);case ss.ZodBranded:return on(e,r);case ss.ZodReadonly:case ss.ZodCatch:return((e,t)=>jn(e.innerType._def,t))(e,r);case ss.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return jn(e.in._def,t);if("output"===t.pipeStrategy)return jn(e.out._def,t);const r=jn(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[r,jn(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]})].filter(e=>void 0!==e)}})(e,r);case ss.ZodFunction:case ss.ZodVoid:case ss.ZodSymbol:default:return}};function jn(e,t,r=!1){const a=t.seen.get(e);if(t.override){const s=t.override?.(e,t,a,r);if(s!==en)return s}if(a&&!r){const e=In(a,t);if(void 0!==e)return e}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=$n(e,e.typeName,t),n="function"==typeof i?jn(i(),t):i;if(n&&Nn(e,t,n),t.postProcess){const r=t.postProcess(n,e,t);return s.jsonSchema=n,r}return s.jsonSchema=n,n}const In=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:rn(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),an(t)):"seen"===t.$refStrategy?an(t):void 0}},Nn=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),Fn=(e,t)=>{const r=(e=>{const t=(e=>"string"==typeof e?{...tn,name:e}:{...tn,...e})(e),r=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}})(t);let a="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,a])=>({...e,[t]:jn(a._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0)??an(r)}),{}):void 0;const s="string"==typeof t?t:"title"===t?.nameStrategy?void 0:t?.name,i=jn(e._def,void 0===s?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1)??an(r),n="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==n&&(i.title=n),r.flags.hasReferencedOpenAiAnyType&&(a||(a={}),a[r.openAiAnyTypeName]||(a[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===r.$refStrategy?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));const o=void 0===s?a?{...i,[r.definitionPath]:a}:i:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...a,[s]:i}};return"jsonSchema7"===r.target?o.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==r.target&&"openAi"!==r.target||(o.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===r.target&&("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 Zn;!function(e){e.Completable="McpCompletable"}(Zn||(Zn={}));class Dn extends Br{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}function Mn(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{var i,n;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:s.defaultError}:void 0===s.data?{message:null!==(i=null!=o?o:a)&&void 0!==i?i:s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:null!==(n=null!=o?o:r)&&void 0!==n?n:s.defaultError}},description:s}}Dn.create=(e,t)=>new Dn({type:e,typeName:Zn.Completable,complete:t.complete,...Mn(t)});class Ln{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Xi(e,t)}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Si.shape.method.value),this.server.assertCanSetRequestHandler(Oi.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Si,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{const r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?Fn(t.inputSchema,{strictUnions:!0}):qn,annotations:t.annotations};return t.outputSchema&&(r.outputSchema=Fn(t.outputSchema,{strictUnions:!0})),r})})),this.server.setRequestHandler(Oi,async(e,t)=>{const r=this._registeredTools[e.params.name];if(!r)throw new Ji(js.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new Ji(js.InvalidParams,`Tool ${e.params.name} disabled`);let a;if(r.inputSchema){const s=await r.inputSchema.safeParseAsync(e.params.arguments);if(!s.success)throw new Ji(js.InvalidParams,`Invalid arguments for tool ${e.params.name}: ${s.error.message}`);const i=s.data,n=r.callback;try{a=await Promise.resolve(n(i,t))}catch(e){a={content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:!0}}}else{const e=r.callback;try{a=await Promise.resolve(e(t))}catch(e){a={content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:!0}}}if(r.outputSchema&&!a.isError){if(!a.structuredContent)throw new Ji(js.InvalidParams,`Tool ${e.params.name} has an output schema but no structured content was provided`);const t=await r.outputSchema.safeParseAsync(a.structuredContent);if(!t.success)throw new Ji(js.InvalidParams,`Invalid structured content for tool ${e.params.name}: ${t.error.message}`)}return a}),this._toolHandlersInitialized=!0)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Hi.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Hi,async e=>{switch(e.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return this.handleResourceCompletion(e,e.params.ref);default:throw new Ji(js.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){const r=this._registeredPrompts[t.name];if(!r)throw new Ji(js.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new Ji(js.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Un;const a=r.argsSchema.shape[e.params.argument.name];if(!(a instanceof Dn))return Un;const s=a._def;return Hn(await s.complete(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){const r=Object.values(this._registeredResourceTemplates).find(e=>e.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Un;throw new Ji(js.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}const a=r.resourceTemplate.completeCallback(e.params.argument.name);return a?Hn(await a(e.params.argument.value,e.params.context)):Un}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(ti.shape.method.value),this.server.assertCanSetRequestHandler(ai.shape.method.value),this.server.assertCanSetRequestHandler(ii.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(ti,async(e,t)=>{const r=Object.entries(this._registeredResources).filter(([e,t])=>t.enabled).map(([e,t])=>({uri:e,name:t.name,...t.metadata})),a=[];for(const e of Object.values(this._registeredResourceTemplates)){if(!e.resourceTemplate.listCallback)continue;const r=await e.resourceTemplate.listCallback(t);for(const t of r.resources)a.push({...e.metadata,...t})}return{resources:[...r,...a]}}),this.server.setRequestHandler(ai,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler(ii,async(e,t)=>{const r=new URL(e.params.uri),a=this._registeredResources[r.toString()];if(a){if(!a.enabled)throw new Ji(js.InvalidParams,`Resource ${r} disabled`);return a.readCallback(r,t)}for(const e of Object.values(this._registeredResourceTemplates)){const a=e.resourceTemplate.uriTemplate.match(r.toString());if(a)return e.readCallback(r,a,t)}throw new Ji(js.InvalidParams,`Resource ${r} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(pi.shape.method.value),this.server.assertCanSetRequestHandler(fi.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(pi,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>{return{name:e,title:t.title,description:t.description,arguments:t.argsSchema?(r=t.argsSchema,Object.entries(r.shape).map(([e,t])=>({name:e,description:t.description,required:!t.isOptional()}))):void 0};var r})})),this.server.setRequestHandler(fi,async(e,t)=>{const r=this._registeredPrompts[e.params.name];if(!r)throw new Ji(js.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new Ji(js.InvalidParams,`Prompt ${e.params.name} disabled`);if(r.argsSchema){const a=await r.argsSchema.safeParseAsync(e.params.arguments);if(!a.success)throw new Ji(js.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${a.error.message}`);const s=a.data,i=r.callback;return await Promise.resolve(i(s,t))}{const e=r.callback;return await Promise.resolve(e(t))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0)}resource(e,t,...r){let a;"object"==typeof r[0]&&(a=r.shift());const s=r[0];if("string"==typeof t){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);const r=this._createRegisteredResource(e,void 0,t,a,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);const r=this._createRegisteredResourceTemplate(e,void 0,t,a,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}}registerResource(e,t,r,a){if("string"==typeof t){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);const s=this._createRegisteredResource(e,r.title,t,r,a);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);const s=this._createRegisteredResourceTemplate(e,r.title,t,r,a);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,t,r,a,s){const i={name:e,title:t,metadata:a,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:e=>{void 0!==e.uri&&e.uri!==r&&(delete this._registeredResources[r],e.uri&&(this._registeredResources[e.uri]=i)),void 0!==e.name&&(i.name=e.name),void 0!==e.title&&(i.title=e.title),void 0!==e.metadata&&(i.metadata=e.metadata),void 0!==e.callback&&(i.readCallback=e.callback),void 0!==e.enabled&&(i.enabled=e.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,a,s){const i={resourceTemplate:r,title:t,metadata:a,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredResourceTemplates[e],t.name&&(this._registeredResourceTemplates[t.name]=i)),void 0!==t.title&&(i.title=t.title),void 0!==t.template&&(i.resourceTemplate=t.template),void 0!==t.metadata&&(i.metadata=t.metadata),void 0!==t.callback&&(i.readCallback=t.callback),void 0!==t.enabled&&(i.enabled=t.enabled),this.sendResourceListChanged()}};return this._registeredResourceTemplates[e]=i,i}_createRegisteredPrompt(e,t,r,a,s){const i={title:t,description:r,argsSchema:void 0===a?void 0:us(a),callback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredPrompts[e],t.name&&(this._registeredPrompts[t.name]=i)),void 0!==t.title&&(i.title=t.title),void 0!==t.description&&(i.description=t.description),void 0!==t.argsSchema&&(i.argsSchema=us(t.argsSchema)),void 0!==t.callback&&(i.callback=t.callback),void 0!==t.enabled&&(i.enabled=t.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=i,i}_createRegisteredTool(e,t,r,a,s,i,n){const o={title:t,description:r,inputSchema:void 0===a?void 0:us(a),outputSchema:void 0===s?void 0:us(s),annotations:i,callback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredTools[e],t.name&&(this._registeredTools[t.name]=o)),void 0!==t.title&&(o.title=t.title),void 0!==t.description&&(o.description=t.description),void 0!==t.paramsSchema&&(o.inputSchema=us(t.paramsSchema)),void 0!==t.callback&&(o.callback=t.callback),void 0!==t.annotations&&(o.annotations=t.annotations),void 0!==t.enabled&&(o.enabled=t.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=o,this.setToolRequestHandlers(),this.sendToolListChanged(),o}tool(e,...t){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let r,a,s;if("string"==typeof t[0]&&(r=t.shift()),t.length>1){const e=t[0];zn(e)?(a=t.shift(),t.length>1&&"object"==typeof t[0]&&null!==t[0]&&!zn(t[0])&&(s=t.shift())):"object"==typeof e&&null!==e&&(s=t.shift())}const i=t[0];return this._createRegisteredTool(e,void 0,r,a,void 0,s,i)}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);const{title:a,description:s,inputSchema:i,outputSchema:n,annotations:o}=t;return this._createRegisteredTool(e,a,s,i,n,o,r)}prompt(e,...t){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let r,a;"string"==typeof t[0]&&(r=t.shift()),t.length>1&&(a=t.shift());const s=t[0],i=this._createRegisteredPrompt(e,void 0,r,a,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);const{title:a,description:s,argsSchema:i}=t,n=this._createRegisteredPrompt(e,a,s,i,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),n}isConnected(){return void 0!==this.server.transport}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}const qn={type:"object",properties:{}};function zn(e){return"object"==typeof e&&null!==e&&(0===Object.keys(e).length||Object.values(e).some(Vn))}function Vn(e){return null!==e&&"object"==typeof e&&"parse"in e&&"function"==typeof e.parse&&"safeParse"in e&&"function"==typeof e.safeParse}function Hn(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}const Un={completion:{values:[],hasMore:!1}},Qn={},Kn={};let Bn=void 0!==globalThis.jest;const Wn=(e,t)=>{if(Bn)throw new Error("MCP Registration is already activated. Cannot register new MCP servers.");const r=Gn(t);Qn[r]=e};async function Jn(e){if(Bn)return;Bn=!0;const t=Object.entries(Qn);for await(const r of t){const[t,a]=r;await e.registerServer({name:`editor-${t}`,server:a,version:"1.0.0",description:Kn[t]||t})}}const Gn=e=>{if(!e||!/^[a-z_]+$/.test(e))throw new Error("Not alphabet");return e},Yn=e=>{const t=`editor-${Gn(e)}`;if(void 0!==globalThis.jest)return{addTool:()=>{},setMCPDescription:()=>{}};Qn[e]||(Qn[e]=new Ln({name:t,version:"1.0.0"}));const r=Qn[e],{addTool:a}=(s=r,{addTool:function(e){const t=e.schema?e.schema:{};if(Bn)throw new Error("MCP Registration is already activated. Cannot add new tools.");s.registerTool(e.name,{description:e.description,inputSchema:t,outputSchema:e.outputSchema,title:e.name,annotations:{destructiveHint:e.isDestrcutive,readOnlyHint:!e.isDestrcutive&&void 0,title:e.name}},async function(t,r){try{const a=await e.handler(e.schema?t:{},r);return{structuredContent:"string"==typeof a?void 0:a,content:[{type:"text",text:"string"==typeof a?a:JSON.stringify(a)}]}}catch(e){return{isError:!0,content:[{type:"text",text:e.message||"Unknown error"}]}}})}});var s;return{addTool:a,setMCPDescription:t=>{Kn[e]=t}}};let Xn;const eo=()=>void 0!==globalThis.jest?{}:(Xn||(Xn=new Sr),Xn);function to(){return(0,n.isExperimentActive)("editor_mcp")?eo().waitForReady():Promise.resolve()}document.addEventListener("DOMContentLoaded",()=>{(0,n.isExperimentActive)("editor_mcp")?eo().waitForReady().then(()=>Jn(Xn)):Promise.resolve()},{once:!0});const ro=()=>eo()}(),(window.elementorV2=window.elementorV2||{}).editorMcp=a}(),window.elementorV2.editorMcp?.init?.();
Copyright ©2021 || Defacer Indonesia