-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
56 lines (52 loc) · 318 KB
/
main.js
File metadata and controls
56 lines (52 loc) · 318 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var lg=Object.create;var un=Object.defineProperty;var fg=Object.getOwnPropertyDescriptor;var dg=Object.getOwnPropertyNames;var hg=Object.getPrototypeOf,pg=Object.prototype.hasOwnProperty;var p=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xu=(t,e)=>{for(var r in e)un(t,r,{get:e[r],enumerable:!0})},Nu=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of dg(e))!pg.call(t,n)&&n!==r&&un(t,n,{get:()=>e[n],enumerable:!(s=fg(e,n))||s.enumerable});return t};var k=(t,e,r)=>(r=t!=null?lg(hg(t)):{},Nu(e||!t||!t.__esModule?un(r,"default",{value:t,enumerable:!0}):r,t)),mg=t=>Nu(un({},"__esModule",{value:!0}),t);var Iu=p((Rk,Pu)=>{var or=require("fs"),Ru=require("url"),yg=require("child_process").spawn;Pu.exports=Mi;Mi.XMLHttpRequest=Mi;function Mi(t){"use strict";t=t||{};var e=this,r=require("http"),s=require("https"),n,i,o={},a=!1,c={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},u=Object.assign({},c),l=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],f=["TRACE","TRACK","CONNECT"],d=!1,h=!1,y=!1,m={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.response=Buffer.alloc(0),this.status=null,this.statusText=null;var g=function(_){return a||_&&l.indexOf(_.toLowerCase())===-1},v=function(_){return _&&f.indexOf(_)===-1};this.open=function(_,E,S,F,z){if(this.abort(),h=!1,y=!1,!v(_))throw new Error("SecurityError: Request method not allowed");o={method:_,url:E.toString(),async:typeof S!="boolean"?!0:S,user:F||null,password:z||null},$(this.OPENED)},this.setDisableHeaderCheck=function(_){a=_},this.setRequestHeader=function(_,E){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!g(_))return console.warn('Refused to set unsafe header "'+_+'"'),!1;if(d)throw new Error("INVALID_STATE_ERR: send flag is true");return u[_]=E,!0},this.getResponseHeader=function(_){return typeof _=="string"&&this.readyState>this.OPENED&&i.headers[_.toLowerCase()]&&!h?i.headers[_.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||h)return"";var _="";for(var E in i.headers)E!=="set-cookie"&&E!=="set-cookie2"&&(_+=E+": "+i.headers[E]+`\r
`);return _.substr(0,_.length-2)},this.getRequestHeader=function(_){return typeof _=="string"&&u[_]?u[_]:""},this.send=function(_){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(d)throw new Error("INVALID_STATE_ERR: send has already been called");var E=!1,S=!1,F=Ru.parse(o.url),z;switch(F.protocol){case"https:":E=!0;case"http:":z=F.hostname;break;case"file:":S=!0;break;case void 0:case"":z="localhost";break;default:throw new Error("Protocol not supported.")}if(S){if(o.method!=="GET")throw new Error("XMLHttpRequest: Only GET method is supported");if(o.async)or.readFile(unescape(F.pathname),function(he,qt){he?e.handleError(he,he.errno||-1):(e.status=200,e.responseText=qt.toString("utf8"),e.response=qt,$(e.DONE))});else try{this.response=or.readFileSync(unescape(F.pathname)),this.responseText=this.response.toString("utf8"),this.status=200,$(e.DONE)}catch(he){this.handleError(he,he.errno||-1)}return}var ae=F.port||(E?443:80),q=F.pathname+(F.search?F.search:"");if(u.Host=z,E&&ae===443||ae===80||(u.Host+=":"+F.port),o.user){typeof o.password>"u"&&(o.password="");var Fe=new Buffer(o.user+":"+o.password);u.Authorization="Basic "+Fe.toString("base64")}if(o.method==="GET"||o.method==="HEAD")_=null;else if(_){u["Content-Length"]=Buffer.isBuffer(_)?_.length:Buffer.byteLength(_);var vt=Object.keys(u);vt.some(function(he){return he.toLowerCase()==="content-type"})||(u["Content-Type"]="text/plain;charset=UTF-8")}else o.method==="POST"&&(u["Content-Length"]=0);var an=t.agent||!1,Ce={host:z,port:ae,path:q,method:o.method,headers:u,agent:an};if(E&&(Ce.pfx=t.pfx,Ce.key=t.key,Ce.passphrase=t.passphrase,Ce.cert=t.cert,Ce.ca=t.ca,Ce.ciphers=t.ciphers,Ce.rejectUnauthorized=t.rejectUnauthorized!==!1),h=!1,o.async){var Yr=E?s.request:r.request;d=!0,e.dispatchEvent("readystatechange");var Di=function(he){if(i=he,i.statusCode===302||i.statusCode===303||i.statusCode===307){o.url=i.headers.location;var qt=Ru.parse(o.url);z=qt.hostname;var Et={hostname:qt.hostname,port:qt.port,path:qt.path,method:i.statusCode===303?"GET":o.method,headers:u};E&&(Et.pfx=t.pfx,Et.key=t.key,Et.passphrase=t.passphrase,Et.cert=t.cert,Et.ca=t.ca,Et.ciphers=t.ciphers,Et.rejectUnauthorized=t.rejectUnauthorized!==!1),n=Yr(Et,Di).on("error",Li),n.end();return}$(e.HEADERS_RECEIVED),e.status=i.statusCode,i.on("data",function(cn){if(cn){var ug=Buffer.from(cn);e.response=Buffer.concat([e.response,ug])}d&&$(e.LOADING)}),i.on("end",function(){d&&(d=!1,$(e.DONE),e.responseText=e.response.toString("utf8"))}),i.on("error",function(cn){e.handleError(cn)})},Li=function(he){if(n.reusedSocket&&he.code==="ECONNRESET")return Yr(Ce,Di).on("error",Li);e.handleError(he)};n=Yr(Ce,Di).on("error",Li),t.autoUnref&&n.on("socket",he=>{he.unref()}),_&&n.write(_),n.end(),e.dispatchEvent("loadstart")}else{var Jr=".node-xmlhttprequest-content-"+process.pid,Qr=".node-xmlhttprequest-sync-"+process.pid;or.writeFileSync(Qr,"","utf8");for(var og="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(E?"s":"")+".request;var options = "+JSON.stringify(Ce)+";var responseText = '';var responseData = Buffer.alloc(0);var req = doRequest(options, function(response) {response.on('data', function(chunk) { var data = Buffer.from(chunk); responseText += data.toString('utf8'); responseData = Buffer.concat([responseData, data]);});response.on('end', function() {fs.writeFileSync('"+Jr+"', JSON.stringify({err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText, data: responseData.toString('base64')}}), 'utf8');fs.unlinkSync('"+Qr+"');});response.on('error', function(error) {fs.writeFileSync('"+Jr+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+Qr+"');});}).on('error', function(error) {fs.writeFileSync('"+Jr+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+Qr+"');});"+(_?"req.write('"+JSON.stringify(_).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",ag=yg(process.argv[0],["-e",og]),xk;or.existsSync(Qr););if(e.responseText=or.readFileSync(Jr,"utf8"),ag.stdin.end(),or.unlinkSync(Jr),e.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)){var cg=JSON.parse(e.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/,""));e.handleError(cg,503)}else{e.status=e.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/,"$1");var ji=JSON.parse(e.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/,"$1"));i={statusCode:e.status,headers:ji.data.headers},e.responseText=ji.data.text,e.response=Buffer.from(ji.data.data,"base64"),$(e.DONE,!0)}}},this.handleError=function(_,E){this.status=E||0,this.statusText=_,this.responseText=_.stack,h=!0,$(this.DONE)},this.abort=function(){n&&(n.abort(),n=null),u=Object.assign({},c),this.responseText="",this.responseXML="",this.response=Buffer.alloc(0),h=y=!0,this.readyState!==this.UNSENT&&(this.readyState!==this.OPENED||d)&&this.readyState!==this.DONE&&(d=!1,$(this.DONE)),this.readyState=this.UNSENT},this.addEventListener=function(_,E){_ in m||(m[_]=[]),m[_].push(E)},this.removeEventListener=function(_,E){_ in m&&(m[_]=m[_].filter(function(S){return S!==E}))},this.dispatchEvent=function(_){if(typeof e["on"+_]=="function"&&(this.readyState===this.DONE&&o.async?setTimeout(function(){e["on"+_]()},0):e["on"+_]()),_ in m)for(let E=0,S=m[_].length;E<S;E++)this.readyState===this.DONE?setTimeout(function(){m[_][E].call(e)},0):m[_][E].call(e)};var $=function(_){if(!(e.readyState===_||e.readyState===e.UNSENT&&y)&&(e.readyState=_,(o.async||e.readyState<e.OPENED||e.readyState===e.DONE)&&e.dispatchEvent("readystatechange"),e.readyState===e.DONE)){let E;y?E="abort":h?E="error":E="load",e.dispatchEvent(E),e.dispatchEvent("loadend")}}}});var Dt=p(Bu=>{Bu.Emitter=pe;function pe(t){if(t)return gg(t)}function gg(t){for(var e in pe.prototype)t[e]=pe.prototype[e];return t}pe.prototype.on=pe.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};pe.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this};pe.prototype.off=pe.prototype.removeListener=pe.prototype.removeAllListeners=pe.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var s,n=0;n<r.length;n++)if(s=r[n],s===e||s.fn===e){r.splice(n,1);break}return r.length===0&&delete this._callbacks["$"+t],this};pe.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(r){r=r.slice(0);for(var s=0,n=r.length;s<n;++s)r[s].apply(this,e)}return this};pe.prototype.emitReserved=pe.prototype.emit;pe.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};pe.prototype.hasListeners=function(t){return!!this.listeners(t).length}});var Xu=p((Hk,Ku)=>{var ar=1e3,cr=ar*60,ur=cr*60,Lt=ur*24,Sg=Lt*7,$g=Lt*365.25;Ku.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Tg(t);if(r==="number"&&isFinite(t))return e.long?Og(t):Cg(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Tg(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return r*$g;case"weeks":case"week":case"w":return r*Sg;case"days":case"day":case"d":return r*Lt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ur;case"minutes":case"minute":case"mins":case"min":case"m":return r*cr;case"seconds":case"second":case"secs":case"sec":case"s":return r*ar;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Cg(t){var e=Math.abs(t);return e>=Lt?Math.round(t/Lt)+"d":e>=ur?Math.round(t/ur)+"h":e>=cr?Math.round(t/cr)+"m":e>=ar?Math.round(t/ar)+"s":t+"ms"}function Og(t){var e=Math.abs(t);return e>=Lt?pn(t,e,Lt,"day"):e>=ur?pn(t,e,ur,"hour"):e>=cr?pn(t,e,cr,"minute"):e>=ar?pn(t,e,ar,"second"):t+" ms"}function pn(t,e,r,s){var n=e>=r*1.5;return Math.round(t/r)+" "+s+(n?"s":"")}});var zi=p((Wk,Yu)=>{function kg(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=n,r.enabled=a,r.humanize=Xu(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,d=null,h,y;function m(...g){if(!m.enabled)return;let v=m,$=Number(new Date),_=$-(f||$);v.diff=_,v.prev=f,v.curr=$,f=$,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let E=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(F,z)=>{if(F==="%%")return"%";E++;let ae=r.formatters[z];if(typeof ae=="function"){let q=g[E];F=ae.call(v,q),g.splice(E,1),E--}return F}),r.formatArgs.call(v,g),(v.log||r.log).apply(v,g)}return m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=s,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==r.namespaces&&(h=r.namespaces,y=r.enabled(l)),y),set:g=>{d=g}}),typeof r.init=="function"&&r.init(m),m}function s(l,f){let d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function n(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function i(l,f){let d=0,h=0,y=-1,m=0;for(;d<l.length;)if(h<f.length&&(f[h]===l[d]||f[h]==="*"))f[h]==="*"?(y=h,m=d,h++):(d++,h++);else if(y!==-1)h=y+1,m++,d=m;else return!1;for(;h<f.length&&f[h]==="*";)h++;return h===f.length}function o(){let l=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),l}function a(l){for(let f of r.skips)if(i(l,f))return!1;for(let f of r.names)if(i(l,f))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Yu.exports=kg});var Ju=p((Ee,mn)=>{Ee.formatArgs=Ng;Ee.save=Rg;Ee.load=Pg;Ee.useColors=xg;Ee.storage=Ig();Ee.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ee.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function xg(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ng(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+mn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(s=r))}),t.splice(s,0,e)}Ee.log=console.debug||console.log||(()=>{});function Rg(t){try{t?Ee.storage.setItem("debug",t):Ee.storage.removeItem("debug")}catch{}}function Pg(){let t;try{t=Ee.storage.getItem("debug")||Ee.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Ig(){try{return localStorage}catch{}}mn.exports=zi()(Ee);var{formatters:Ag}=mn.exports;Ag.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Zu=p((Z,gn)=>{var qg=require("tty"),yn=require("util");Z.init=Bg;Z.log=Mg;Z.formatArgs=Lg;Z.save=Fg;Z.load=Ug;Z.useColors=Dg;Z.destroy=yn.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Z.colors=[6,2,3,4,5,1];try{let t=require("supports-color");t&&(t.stderr||t).level>=2&&(Z.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Z.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,i)=>i.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function Dg(){return"colors"in Z.inspectOpts?!!Z.inspectOpts.colors:qg.isatty(process.stderr.fd)}function Lg(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,n="\x1B[3"+(s<8?s:"8;5;"+s),i=` ${n};1m${e} \x1B[0m`;t[0]=i+t[0].split(`
`).join(`
`+i),t.push(n+"m+"+gn.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=jg()+e+" "+t[0]}function jg(){return Z.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Mg(...t){return process.stderr.write(yn.formatWithOptions(Z.inspectOpts,...t)+`
`)}function Fg(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Ug(){return process.env.DEBUG}function Bg(t){t.inspectOpts={};let e=Object.keys(Z.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Z.inspectOpts[e[r]]}gn.exports=zi()(Z);var{formatters:Qu}=gn.exports;Qu.o=function(t){return this.inspectOpts.colors=this.useColors,yn.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};Qu.O=function(t){return this.inspectOpts.colors=this.useColors,yn.inspect(t,this.inspectOpts)}});var Ne=p((Kk,Gi)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Gi.exports=Ju():Gi.exports=Zu()});var ft=p((dx,ll)=>{"use strict";var cl=["nodebuffer","arraybuffer","fragments"],ul=typeof Blob<"u";ul&&cl.push("blob");ll.exports={BINARY_TYPES:cl,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:ul,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ns=p((hx,En)=>{"use strict";var{EMPTY_BUFFER:Wg}=ft(),Ki=Buffer[Symbol.species];function Kg(t,e){if(t.length===0)return Wg;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),s=0;for(let n=0;n<t.length;n++){let i=t[n];r.set(i,s),s+=i.length}return s<e?new Ki(r.buffer,r.byteOffset,s):r}function fl(t,e,r,s,n){for(let i=0;i<n;i++)r[s+i]=t[i]^e[i&3]}function dl(t,e){for(let r=0;r<t.length;r++)t[r]^=e[r&3]}function Xg(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function Xi(t){if(Xi.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Ki(t):ArrayBuffer.isView(t)?e=new Ki(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),Xi.readOnly=!1),e}En.exports={concat:Kg,mask:fl,toArrayBuffer:Xg,toBuffer:Xi,unmask:dl};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=require("bufferutil");En.exports.mask=function(e,r,s,n,i){i<48?fl(e,r,s,n,i):t.mask(e,r,s,n,i)},En.exports.unmask=function(e,r){e.length<32?dl(e,r):t.unmask(e,r)}}catch{}});var ml=p((px,pl)=>{"use strict";var hl=Symbol("kDone"),Yi=Symbol("kRun"),Ji=class{constructor(e){this[hl]=()=>{this.pending--,this[Yi]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Yi]()}[Yi](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[hl])}}};pl.exports=Ji});var os=p((mx,vl)=>{"use strict";var is=require("zlib"),yl=ns(),Yg=ml(),{kStatusCode:gl}=ft(),Jg=Buffer[Symbol.species],Qg=Buffer.from([0,0,255,255]),bn=Symbol("permessage-deflate"),dt=Symbol("total-length"),fr=Symbol("callback"),wt=Symbol("buffers"),dr=Symbol("error"),wn,Qi=class{constructor(e,r,s){if(this._maxPayload=s|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!wn){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;wn=new Yg(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[fr];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let r=this._options,s=e.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(s=>{let n=r[s];if(n.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(n=n[0],s==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${s}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${n}`)}else if(s==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${s}": ${n}`);n=i}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${n}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=n})}),e}decompress(e,r,s){wn.add(n=>{this._decompress(e,r,(i,o)=>{n(),s(i,o)})})}compress(e,r,s){wn.add(n=>{this._compress(e,r,(i,o)=>{n(),s(i,o)})})}_decompress(e,r,s){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,o=typeof this.params[i]!="number"?is.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=is.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[bn]=this,this._inflate[dt]=0,this._inflate[wt]=[],this._inflate.on("error",e0),this._inflate.on("data",_l)}this._inflate[fr]=s,this._inflate.write(e),r&&this._inflate.write(Qg),this._inflate.flush(()=>{let i=this._inflate[dr];if(i){this._inflate.close(),this._inflate=null,s(i);return}let o=yl.concat(this._inflate[wt],this._inflate[dt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[dt]=0,this._inflate[wt]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),s(null,o)})}_compress(e,r,s){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,o=typeof this.params[i]!="number"?is.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=is.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[dt]=0,this._deflate[wt]=[],this._deflate.on("data",Zg)}this._deflate[fr]=s,this._deflate.write(e),this._deflate.flush(is.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=yl.concat(this._deflate[wt],this._deflate[dt]);r&&(i=new Jg(i.buffer,i.byteOffset,i.length-4)),this._deflate[fr]=null,this._deflate[dt]=0,this._deflate[wt]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),s(null,i)})}};vl.exports=Qi;function Zg(t){this[wt].push(t),this[dt]+=t.length}function _l(t){if(this[dt]+=t.length,this[bn]._maxPayload<1||this[dt]<=this[bn]._maxPayload){this[wt].push(t);return}this[dr]=new RangeError("Max payload size exceeded"),this[dr].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[dr][gl]=1009,this.removeListener("data",_l),this.reset()}function e0(t){if(this[bn]._inflate=null,this[dr]){this[fr](this[dr]);return}t[gl]=1007,this[fr](t)}});var hr=p((yx,Sn)=>{"use strict";var{isUtf8:El}=require("buffer"),{hasBlob:t0}=ft(),r0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function s0(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Zi(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)===0)r++;else if((t[r]&224)===192){if(r+1===e||(t[r+1]&192)!==128||(t[r]&254)===192)return!1;r+=2}else if((t[r]&240)===224){if(r+2>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||t[r]===224&&(t[r+1]&224)===128||t[r]===237&&(t[r+1]&224)===160)return!1;r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||(t[r+3]&192)!==128||t[r]===240&&(t[r+1]&240)===128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}function n0(t){return t0&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}Sn.exports={isBlob:n0,isValidStatusCode:s0,isValidUTF8:Zi,tokenChars:r0};if(El)Sn.exports.isValidUTF8=function(t){return t.length<24?Zi(t):El(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=require("utf-8-validate");Sn.exports.isValidUTF8=function(e){return e.length<32?Zi(e):t(e)}}catch{}});var no=p((gx,Ol)=>{"use strict";var{Writable:i0}=require("stream"),wl=os(),{BINARY_TYPES:o0,EMPTY_BUFFER:bl,kStatusCode:a0,kWebSocket:c0}=ft(),{concat:eo,toArrayBuffer:u0,unmask:l0}=ns(),{isValidStatusCode:f0,isValidUTF8:Sl}=hr(),$n=Buffer[Symbol.species],Re=0,$l=1,Tl=2,Cl=3,to=4,ro=5,Tn=6,so=class extends i0{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||o0[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[c0]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Re}_write(e,r,s){if(this._opcode===8&&this._state==Re)return s();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(s)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new $n(s.buffer,s.byteOffset+e,s.length-e),new $n(s.buffer,s.byteOffset,e)}let r=Buffer.allocUnsafe(e);do{let s=this._buffers[0],n=r.length-e;e>=s.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(s.buffer,s.byteOffset,e),n),this._buffers[0]=new $n(s.buffer,s.byteOffset+e,s.length-e)),e-=s.length}while(e>0);return r}startLoop(e){this._loop=!0;do switch(this._state){case Re:this.getInfo(e);break;case $l:this.getPayloadLength16(e);break;case Tl:this.getPayloadLength64(e);break;case Cl:this.getMask();break;case to:this.getData(e);break;case ro:case Tn:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let s=(r[0]&64)===64;if(s&&!this._extensions[wl.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(s){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=$l:this._payloadLength===127?this._state=Tl:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=s*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(r);return}this._masked?this._state=Cl:this._state=to}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=to}getData(e){let r=bl;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&l0(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._compressed){this._state=ro,this.decompress(r,e);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[wl.extensionName].decompress(e,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(o);return}this._fragments.push(i)}this.dataMessage(r),this._state===Re&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=Re;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=eo(s,r):this._binaryType==="arraybuffer"?n=u0(eo(s,r)):this._binaryType==="blob"?n=new Blob(s):n=s,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Re):(this._state=Tn,setImmediate(()=>{this.emit("message",n,!0),this._state=Re,this.startLoop(e)}))}else{let n=eo(s,r);if(!this._skipUTF8Validation&&!Sl(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(i);return}this._state===ro||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Re):(this._state=Tn,setImmediate(()=>{this.emit("message",n,!1),this._state=Re,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,bl),this.end();else{let s=e.readUInt16BE(0);if(!f0(s)){let i=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new $n(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Sl(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",s,n),this.end()}this._state=Re;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Re):(this._state=Tn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Re,this.startLoop(r)}))}createError(e,r,s,n,i){this._loop=!1,this._errored=!0;let o=new e(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(o,this.createError),o.code=i,o[a0]=n,o}};Ol.exports=so});var ao=p((vx,Nl)=>{"use strict";var{Duplex:_x}=require("stream"),{randomFillSync:d0}=require("crypto"),kl=os(),{EMPTY_BUFFER:h0,kWebSocket:p0,NOOP:m0}=ft(),{isBlob:pr,isValidStatusCode:y0}=hr(),{mask:xl,toBuffer:jt}=ns(),Pe=Symbol("kByteLength"),g0=Buffer.alloc(4),Cn=8*1024,Mt,mr=Cn,Ve=0,_0=1,v0=2,io=class t{constructor(e,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Ve,this.onerror=m0,this[p0]=void 0}static frame(e,r){let s,n=!1,i=2,o=!1;r.mask&&(s=r.maskBuffer||g0,r.generateMask?r.generateMask(s):(mr===Cn&&(Mt===void 0&&(Mt=Buffer.alloc(Cn)),d0(Mt,0,Cn),mr=0),s[0]=Mt[mr++],s[1]=Mt[mr++],s[2]=Mt[mr++],s[3]=Mt[mr++]),o=(s[0]|s[1]|s[2]|s[3])===0,i=6);let a;typeof e=="string"?(!r.mask||o)&&r[Pe]!==void 0?a=r[Pe]:(e=Buffer.from(e),a=e.length):(a=e.length,n=r.mask&&r.readOnly&&!o);let c=a;a>=65536?(i+=8,c=127):a>125&&(i+=2,c=126);let u=Buffer.allocUnsafe(n?a+i:i);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[i-4]=s[0],u[i-3]=s[1],u[i-2]=s[2],u[i-1]=s[3],o?[u,e]:n?(xl(e,s,u,i,a),[u]):(xl(e,s,e,0,a),[u,e])):[u,e]}close(e,r,s,n){let i;if(e===void 0)i=h0;else{if(typeof e!="number"||!y0(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(e,0),typeof r=="string"?i.write(r,2):i.set(r,2)}}let o={[Pe]:i.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Ve?this.enqueue([this.dispatch,i,!1,o,n]):this.sendFrame(t.frame(i,o),n)}ping(e,r,s){let n,i;if(typeof e=="string"?(n=Buffer.byteLength(e),i=!1):pr(e)?(n=e.size,i=!1):(e=jt(e),n=e.length,i=jt.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[Pe]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};pr(e)?this._state!==Ve?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==Ve?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}pong(e,r,s){let n,i;if(typeof e=="string"?(n=Buffer.byteLength(e),i=!1):pr(e)?(n=e.size,i=!1):(e=jt(e),n=e.length,i=jt.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[Pe]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};pr(e)?this._state!==Ve?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==Ve?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}send(e,r,s){let n=this._extensions[kl.extensionName],i=r.binary?2:1,o=r.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):pr(e)?(a=e.size,c=!1):(e=jt(e),a=e.length,c=jt.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=n._threshold),this._compress=o):(o=!1,i=0),r.fin&&(this._firstFragment=!0);let u={[Pe]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};pr(e)?this._state!==Ve?this.enqueue([this.getBlobData,e,this._compress,u,s]):this.getBlobData(e,this._compress,u,s):this._state!==Ve?this.enqueue([this.dispatch,e,this._compress,u,s]):this.dispatch(e,this._compress,u,s)}getBlobData(e,r,s,n){this._bufferedBytes+=s[Pe],this._state=v0,e.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(oo,this,a,n);return}this._bufferedBytes-=s[Pe];let o=jt(i);r?this.dispatch(o,r,s,n):(this._state=Ve,this.sendFrame(t.frame(o,s),n),this.dequeue())}).catch(i=>{process.nextTick(E0,this,i,n)})}dispatch(e,r,s,n){if(!r){this.sendFrame(t.frame(e,s),n);return}let i=this._extensions[kl.extensionName];this._bufferedBytes+=s[Pe],this._state=_0,i.compress(e,s.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");oo(this,c,n);return}this._bufferedBytes-=s[Pe],this._state=Ve,s.readOnly=!1,this.sendFrame(t.frame(a,s),n),this.dequeue()})}dequeue(){for(;this._state===Ve&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][Pe],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Pe],this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};Nl.exports=io;function oo(t,e,r){typeof r=="function"&&r(e);for(let s=0;s<t._queue.length;s++){let n=t._queue[s],i=n[n.length-1];typeof i=="function"&&i(e)}}function E0(t,e,r){oo(t,e,r),t.onerror(e)}});var Ml=p((Ex,jl)=>{"use strict";var{kForOnEventAttribute:as,kListener:co}=ft(),Rl=Symbol("kCode"),Pl=Symbol("kData"),Il=Symbol("kError"),Al=Symbol("kMessage"),ql=Symbol("kReason"),yr=Symbol("kTarget"),Dl=Symbol("kType"),Ll=Symbol("kWasClean"),ht=class{constructor(e){this[yr]=null,this[Dl]=e}get target(){return this[yr]}get type(){return this[Dl]}};Object.defineProperty(ht.prototype,"target",{enumerable:!0});Object.defineProperty(ht.prototype,"type",{enumerable:!0});var Ft=class extends ht{constructor(e,r={}){super(e),this[Rl]=r.code===void 0?0:r.code,this[ql]=r.reason===void 0?"":r.reason,this[Ll]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Rl]}get reason(){return this[ql]}get wasClean(){return this[Ll]}};Object.defineProperty(Ft.prototype,"code",{enumerable:!0});Object.defineProperty(Ft.prototype,"reason",{enumerable:!0});Object.defineProperty(Ft.prototype,"wasClean",{enumerable:!0});var gr=class extends ht{constructor(e,r={}){super(e),this[Il]=r.error===void 0?null:r.error,this[Al]=r.message===void 0?"":r.message}get error(){return this[Il]}get message(){return this[Al]}};Object.defineProperty(gr.prototype,"error",{enumerable:!0});Object.defineProperty(gr.prototype,"message",{enumerable:!0});var cs=class extends ht{constructor(e,r={}){super(e),this[Pl]=r.data===void 0?null:r.data}get data(){return this[Pl]}};Object.defineProperty(cs.prototype,"data",{enumerable:!0});var w0={addEventListener(t,e,r={}){for(let n of this.listeners(t))if(!r[as]&&n[co]===e&&!n[as])return;let s;if(t==="message")s=function(i,o){let a=new cs("message",{data:o?i:i.toString()});a[yr]=this,On(e,this,a)};else if(t==="close")s=function(i,o){let a=new Ft("close",{code:i,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[yr]=this,On(e,this,a)};else if(t==="error")s=function(i){let o=new gr("error",{error:i,message:i.message});o[yr]=this,On(e,this,o)};else if(t==="open")s=function(){let i=new ht("open");i[yr]=this,On(e,this,i)};else return;s[as]=!!r[as],s[co]=e,r.once?this.once(t,s):this.on(t,s)},removeEventListener(t,e){for(let r of this.listeners(t))if(r[co]===e&&!r[as]){this.removeListener(t,r);break}}};jl.exports={CloseEvent:Ft,ErrorEvent:gr,Event:ht,EventTarget:w0,MessageEvent:cs};function On(t,e,r){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,r):t.call(e,r)}});var uo=p((wx,Fl)=>{"use strict";var{tokenChars:us}=hr();function Ye(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function b0(t){let e=Object.create(null),r=Object.create(null),s=!1,n=!1,i=!1,o,a,c=-1,u=-1,l=-1,f=0;for(;f<t.length;f++)if(u=t.charCodeAt(f),o===void 0)if(l===-1&&us[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let h=t.slice(c,l);u===44?(Ye(e,h,r),r=Object.create(null)):o=h,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(l===-1&&us[u]===1)c===-1&&(c=f);else if(u===32||u===9)l===-1&&c!==-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f),Ye(r,t.slice(c,l),!0),u===44&&(Ye(e,o,r),r=Object.create(null),o=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=t.slice(c,f),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(n){if(us[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:s||(s=!0),n=!1}else if(i)if(us[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)i=!1,l=f;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&t.charCodeAt(f-1)===61)i=!0;else if(l===-1&&us[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))l===-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let h=t.slice(c,l);s&&(h=h.replace(/\\/g,""),s=!1),Ye(r,a,h),u===44&&(Ye(e,o,r),r=Object.create(null),o=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||i||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=f);let d=t.slice(c,l);return o===void 0?Ye(e,d,r):(a===void 0?Ye(r,d,!0):s?Ye(r,a,d.replace(/\\/g,"")):Ye(r,a,d),Ye(e,o,r)),e}function S0(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(s=>[e].concat(Object.keys(s).map(n=>{let i=s[n];return Array.isArray(i)||(i=[i]),i.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Fl.exports={format:S0,parse:b0}});var Rn=p(($x,Ql)=>{"use strict";var $0=require("events"),T0=require("https"),C0=require("http"),Vl=require("net"),O0=require("tls"),{randomBytes:k0,createHash:x0}=require("crypto"),{Duplex:bx,Readable:Sx}=require("stream"),{URL:lo}=require("url"),bt=os(),N0=no(),R0=ao(),{isBlob:P0}=hr(),{BINARY_TYPES:Ul,EMPTY_BUFFER:kn,GUID:I0,kForOnEventAttribute:fo,kListener:A0,kStatusCode:q0,kWebSocket:ee,NOOP:zl}=ft(),{EventTarget:{addEventListener:D0,removeEventListener:L0}}=Ml(),{format:j0,parse:M0}=uo(),{toBuffer:F0}=ns(),U0=30*1e3,Gl=Symbol("kAborted"),ho=[8,13],pt=["CONNECTING","OPEN","CLOSING","CLOSED"],B0=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,X=class t extends $0{constructor(e,r,s){super(),this._binaryType=Ul[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=kn,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),Hl(this,e,r,s)):(this._autoPong=s.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ul.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,r,s){let n=new N0({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),i=new R0(e,this._extensions,s.generateMask);this._receiver=n,this._sender=i,this._socket=e,n[ee]=this,i[ee]=this,e[ee]=this,n.on("conclude",G0),n.on("drain",H0),n.on("error",W0),n.on("message",K0),n.on("ping",X0),n.on("pong",Y0),i.onerror=J0,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",Xl),e.on("data",Nn),e.on("end",Yl),e.on("error",Jl),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[bt.extensionName]&&this._extensions[bt.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,r){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){Oe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Kl(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){po(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||kn,r,s)}pong(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){po(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||kn,r,s)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){po(this,e,s);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[bt.extensionName]||(n.compress=!1),this._sender.send(e||kn,n,s)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){Oe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(X,"CONNECTING",{enumerable:!0,value:pt.indexOf("CONNECTING")});Object.defineProperty(X.prototype,"CONNECTING",{enumerable:!0,value:pt.indexOf("CONNECTING")});Object.defineProperty(X,"OPEN",{enumerable:!0,value:pt.indexOf("OPEN")});Object.defineProperty(X.prototype,"OPEN",{enumerable:!0,value:pt.indexOf("OPEN")});Object.defineProperty(X,"CLOSING",{enumerable:!0,value:pt.indexOf("CLOSING")});Object.defineProperty(X.prototype,"CLOSING",{enumerable:!0,value:pt.indexOf("CLOSING")});Object.defineProperty(X,"CLOSED",{enumerable:!0,value:pt.indexOf("CLOSED")});Object.defineProperty(X.prototype,"CLOSED",{enumerable:!0,value:pt.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(X.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(X.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[fo])return e[A0];return null},set(e){for(let r of this.listeners(t))if(r[fo]){this.removeListener(t,r);break}typeof e=="function"&&this.addEventListener(t,e,{[fo]:!0})}})});X.prototype.addEventListener=D0;X.prototype.removeEventListener=L0;Ql.exports=X;function Hl(t,e,r,s){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:ho[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=n.autoPong,!ho.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${ho.join(", ")})`);let i;if(e instanceof lo)i=e;else try{i=new lo(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),t._url=i.href;let o=i.protocol==="wss:",a=i.protocol==="ws+unix:",c;if(i.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?c="The URL's pathname is empty":i.hash&&(c="The URL contains a fragment identifier"),c){let m=new SyntaxError(c);if(t._redirects===0)throw m;xn(t,m);return}let u=o?443:80,l=k0(16).toString("base64"),f=o?T0.request:C0.request,d=new Set,h;if(n.createConnection=n.createConnection||(o?z0:V0),n.defaultPort=n.defaultPort||u,n.port=i.port||u,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(h=new bt(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=j0({[bt.extensionName]:h.offer()})),r.length){for(let m of r){if(typeof m!="string"||!B0.test(m)||d.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(m)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),a){let m=n.path.split(":");n.socketPath=m[0],n.path=m[1]}let y;if(n.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=o,t._originalHostOrSocketPath=a?n.socketPath:i.host;let m=s&&s.headers;if(s={...s,headers:{}},m)for(let[g,v]of Object.entries(m))s.headers[g.toLowerCase()]=v}else if(t.listenerCount("redirect")===0){let m=a?t._originalIpc?n.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:i.host===t._originalHostOrSocketPath;(!m||t._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,m||delete n.headers.host,n.auth=void 0)}n.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),y=t._req=f(n),t._redirects&&t.emit("redirect",t.url,y)}else y=t._req=f(n);n.timeout&&y.on("timeout",()=>{Oe(t,y,"Opening handshake has timed out")}),y.on("error",m=>{y===null||y[Gl]||(y=t._req=null,xn(t,m))}),y.on("response",m=>{let g=m.headers.location,v=m.statusCode;if(g&&n.followRedirects&&v>=300&&v<400){if(++t._redirects>n.maxRedirects){Oe(t,y,"Maximum redirects exceeded");return}y.abort();let $;try{$=new lo(g,e)}catch{let E=new SyntaxError(`Invalid URL: ${g}`);xn(t,E);return}Hl(t,$,r,s)}else t.emit("unexpected-response",y,m)||Oe(t,y,`Unexpected server response: ${m.statusCode}`)}),y.on("upgrade",(m,g,v)=>{if(t.emit("upgrade",m),t.readyState!==X.CONNECTING)return;y=t._req=null;let $=m.headers.upgrade;if($===void 0||$.toLowerCase()!=="websocket"){Oe(t,g,"Invalid Upgrade header");return}let _=x0("sha1").update(l+I0).digest("base64");if(m.headers["sec-websocket-accept"]!==_){Oe(t,g,"Invalid Sec-WebSocket-Accept header");return}let E=m.headers["sec-websocket-protocol"],S;if(E!==void 0?d.size?d.has(E)||(S="Server sent an invalid subprotocol"):S="Server sent a subprotocol but none was requested":d.size&&(S="Server sent no subprotocol"),S){Oe(t,g,S);return}E&&(t._protocol=E);let F=m.headers["sec-websocket-extensions"];if(F!==void 0){if(!h){Oe(t,g,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let z;try{z=M0(F)}catch{Oe(t,g,"Invalid Sec-WebSocket-Extensions header");return}let ae=Object.keys(z);if(ae.length!==1||ae[0]!==bt.extensionName){Oe(t,g,"Server indicated an extension that was not requested");return}try{h.accept(z[bt.extensionName])}catch{Oe(t,g,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[bt.extensionName]=h}t.setSocket(g,v,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(y,t):y.end()}function xn(t,e){t._readyState=X.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function V0(t){return t.path=t.socketPath,Vl.connect(t)}function z0(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Vl.isIP(t.host)?"":t.host),O0.connect(t)}function Oe(t,e,r){t._readyState=X.CLOSING;let s=new Error(r);Error.captureStackTrace(s,Oe),e.setHeader?(e[Gl]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(xn,t,s)):(e.destroy(s),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function po(t,e,r){if(e){let s=P0(e)?e.size:F0(e).length;t._socket?t._sender._bufferedBytes+=s:t._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${t.readyState} (${pt[t.readyState]})`);process.nextTick(r,s)}}function G0(t,e){let r=this[ee];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[ee]!==void 0&&(r._socket.removeListener("data",Nn),process.nextTick(Wl,r._socket),t===1005?r.close():r.close(t,e))}function H0(){let t=this[ee];t.isPaused||t._socket.resume()}function W0(t){let e=this[ee];e._socket[ee]!==void 0&&(e._socket.removeListener("data",Nn),process.nextTick(Wl,e._socket),e.close(t[q0])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Bl(){this[ee].emitClose()}function K0(t,e){this[ee].emit("message",t,e)}function X0(t){let e=this[ee];e._autoPong&&e.pong(t,!this._isServer,zl),e.emit("ping",t)}function Y0(t){this[ee].emit("pong",t)}function Wl(t){t.resume()}function J0(t){let e=this[ee];e.readyState!==X.CLOSED&&(e.readyState===X.OPEN&&(e._readyState=X.CLOSING,Kl(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function Kl(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),U0)}function Xl(){let t=this[ee];this.removeListener("close",Xl),this.removeListener("data",Nn),this.removeListener("end",Yl),t._readyState=X.CLOSING;let e;!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&(e=t._socket.read())!==null&&t._receiver.write(e),t._receiver.end(),this[ee]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Bl),t._receiver.on("finish",Bl))}function Nn(t){this[ee]._receiver.write(t)||this.pause()}function Yl(){let t=this[ee];t._readyState=X.CLOSING,t._receiver.end(),this.end()}function Jl(){let t=this[ee];this.removeListener("error",Jl),this.on("error",zl),t&&(t._readyState=X.CLOSING,this.destroy())}});var rf=p((Cx,tf)=>{"use strict";var Tx=Rn(),{Duplex:Q0}=require("stream");function Zl(t){t.emit("close")}function Z0(){!this.destroyed&&this._writableState.finished&&this.destroy()}function ef(t){this.removeListener("error",ef),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function e_(t,e){let r=!0,s=new Q0({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(i,o){let a=!o&&s._readableState.objectMode?i.toString():i;s.push(a)||t.pause()}),t.once("error",function(i){s.destroyed||(r=!1,s.destroy(i))}),t.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(n,i){if(t.readyState===t.CLOSED){i(n),process.nextTick(Zl,s);return}let o=!1;t.once("error",function(c){o=!0,i(c)}),t.once("close",function(){o||i(n),process.nextTick(Zl,s)}),r&&t.terminate()},s._final=function(n){if(t.readyState===t.CONNECTING){t.once("open",function(){s._final(n)});return}t._socket!==null&&(t._socket._writableState.finished?(n(),s._readableState.endEmitted&&s.destroy()):(t._socket.once("finish",function(){n()}),t.close()))},s._read=function(){t.isPaused&&t.resume()},s._write=function(n,i,o){if(t.readyState===t.CONNECTING){t.once("open",function(){s._write(n,i,o)});return}t.send(n,o)},s.on("end",Z0),s.on("error",ef),s}tf.exports=e_});var nf=p((Ox,sf)=>{"use strict";var{tokenChars:t_}=hr();function r_(t){let e=new Set,r=-1,s=-1,n=0;for(n;n<t.length;n++){let o=t.charCodeAt(n);if(s===-1&&t_[o]===1)r===-1&&(r=n);else if(n!==0&&(o===32||o===9))s===-1&&r!==-1&&(s=n);else if(o===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);s===-1&&(s=n);let a=t.slice(r,s);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),r=s=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let i=t.slice(r,n);if(e.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return e.add(i),e}sf.exports={parse:r_}});var df=p((xx,ff)=>{"use strict";var s_=require("events"),Pn=require("http"),{Duplex:kx}=require("stream"),{createHash:n_}=require("crypto"),of=uo(),Ut=os(),i_=nf(),o_=Rn(),{GUID:a_,kWebSocket:c_}=ft(),u_=/^[+/0-9A-Za-z]{22}==$/,af=0,cf=1,lf=2,mo=class extends s_{constructor(e,r){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:o_,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Pn.createServer((s,n)=>{let i=Pn.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(e.port,e.host,e.backlog,r)):e.server&&(this._server=e.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=l_(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,o)=>{this.handleUpgrade(n,i,o,s)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=af}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===lf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(ls,this);return}if(e&&this.once("close",e),this._state!==cf)if(this._state=cf,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(ls,this):process.nextTick(ls,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{ls(this)})}}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,s,n){r.on("error",uf);let i=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Bt(this,e,r,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Bt(this,e,r,400,"Invalid Upgrade header");return}if(i===void 0||!u_.test(i)){Bt(this,e,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Bt(this,e,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){fs(r,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=i_.parse(c)}catch{Bt(this,e,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&l!==void 0){let d=new Ut(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let h=of.parse(l);h[Ut.extensionName]&&(d.accept(h[Ut.extensionName]),f[Ut.extensionName]=d)}catch{Bt(this,e,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(h,y,m,g)=>{if(!h)return fs(r,y||401,m,g);this.completeUpgrade(f,i,u,e,r,s,n)});return}if(!this.options.verifyClient(d))return fs(r,401)}this.completeUpgrade(f,i,u,e,r,s,n)}completeUpgrade(e,r,s,n,i,o,a){if(!i.readable||!i.writable)return i.destroy();if(i[c_])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>af)return fs(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${n_("sha1").update(r+a_).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(s.size){let f=this.options.handleProtocols?this.options.handleProtocols(s,n):s.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),l._protocol=f)}if(e[Ut.extensionName]){let f=e[Ut.extensionName].params,d=of.format({[Ut.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${d}`),l._extensions=e}this.emit("headers",u,n),i.write(u.concat(`\r
`).join(`\r
`)),i.removeListener("error",uf),l.setSocket(i,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(ls,this)})),a(l,n)}};ff.exports=mo;function l_(t,e){for(let r of Object.keys(e))t.on(r,e[r]);return function(){for(let s of Object.keys(e))t.removeListener(s,e[s])}}function ls(t){t._state=lf,t.emit("close")}function uf(){this.destroy()}function fs(t,e,r,s){r=r||Pn.STATUS_CODES[e],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${Pn.STATUS_CODES[e]}\r
`+Object.keys(s).map(n=>`${n}: ${s[n]}`).join(`\r
`)+`\r
\r
`+r)}function Bt(t,e,r,s,n,i){if(t.listenerCount("wsClientError")){let o=new Error(n);Error.captureStackTrace(o,Bt),t.emit("wsClientError",o,r,e)}else fs(r,s,n,i)}});var Ss=p(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.regexpCode=M.getEsmExportName=M.getProperty=M.safeStringify=M.stringify=M.strConcat=M.addCodeArg=M.str=M._=M.nil=M._Code=M.Name=M.IDENTIFIER=M._CodeOrName=void 0;var ws=class{};M._CodeOrName=ws;M.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Wt=class extends ws{constructor(e){if(super(),!M.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};M.Name=Wt;var Ie=class extends ws{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof Wt&&(r[s.str]=(r[s.str]||0)+1),r),{})}};M._Code=Ie;M.nil=new Ie("");function Zf(t,...e){let r=[t[0]],s=0;for(;s<e.length;)Bo(r,e[s]),r.push(t[++s]);return new Ie(r)}M._=Zf;var Uo=new Ie("+");function ed(t,...e){let r=[bs(t[0])],s=0;for(;s<e.length;)r.push(Uo),Bo(r,e[s]),r.push(Uo,bs(t[++s]));return G_(r),new Ie(r)}M.str=ed;function Bo(t,e){e instanceof Ie?t.push(...e._items):e instanceof Wt?t.push(e):t.push(K_(e))}M.addCodeArg=Bo;function G_(t){let e=1;for(;e<t.length-1;){if(t[e]===Uo){let r=H_(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function H_(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Wt||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Wt))return`"${t}${e.slice(1)}`}function W_(t,e){return e.emptyStr()?t:t.emptyStr()?e:ed`${t}${e}`}M.strConcat=W_;function K_(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:bs(Array.isArray(t)?t.join(","):t)}function X_(t){return new Ie(bs(t))}M.stringify=X_;function bs(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}M.safeStringify=bs;function Y_(t){return typeof t=="string"&&M.IDENTIFIER.test(t)?new Ie(`.${t}`):Zf`[${t}]`}M.getProperty=Y_;function J_(t){if(typeof t=="string"&&M.IDENTIFIER.test(t))return new Ie(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}M.getEsmExportName=J_;function Q_(t){return new Ie(t.toString())}M.regexpCode=Q_});var Go=p(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.ValueScope=Se.ValueScopeName=Se.Scope=Se.varKinds=Se.UsedValueState=void 0;var be=Ss(),Vo=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Fn;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Fn||(Se.UsedValueState=Fn={}));Se.varKinds={const:new be.Name("const"),let:new be.Name("let"),var:new be.Name("var")};var Un=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof be.Name?e:this.name(e)}name(e){return new be.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Se.Scope=Un;var Bn=class extends be.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,be._)`.${new be.Name(r)}[${s}]`}};Se.ValueScopeName=Bn;var Z_=(0,be._)`\n`,zo=class extends Un{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Z_:be.nil}}get(){return this._scope}name(e){return new Bn(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,o=(s=r.key)!==null&&s!==void 0?s:r.ref,a=this._values[i];if(a){let l=a.get(o);if(l)return l}else a=this._values[i]=new Map;a.set(o,n);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:i,itemIndex:u}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,be._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let i=be.nil;for(let o in e){let a=e[o];if(!a)continue;let c=s[o]=s[o]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Fn.Started);let l=r(u);if(l){let f=this.opts.es5?Se.varKinds.var:Se.varKinds.const;i=(0,be._)`${i}${f} ${u} = ${l};${this.opts._n}`}else if(l=n==null?void 0:n(u))i=(0,be._)`${i}${l}${this.opts._n}`;else throw new Vo(u);c.set(u,Fn.Completed)})}return i}};Se.ValueScope=zo});var O=p(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var D=Ss(),Ge=Go(),Tt=Ss();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return Tt._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return Tt.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return Tt.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return Tt.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return Tt.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return Tt.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return Tt.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return Tt.Name}});var Hn=Go();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return Hn.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return Hn.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return Hn.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return Hn.varKinds}});P.operators={GT:new D._Code(">"),GTE:new D._Code(">="),LT:new D._Code("<"),LTE:new D._Code("<="),EQ:new D._Code("==="),NEQ:new D._Code("!=="),NOT:new D._Code("!"),OR:new D._Code("||"),AND:new D._Code("&&"),ADD:new D._Code("+")};var mt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Ho=class extends mt{constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?Ge.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Cr(this.rhs,e,r)),this}get names(){return this.rhs instanceof D._CodeOrName?this.rhs.names:{}}},Vn=class extends mt{constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof D.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Cr(this.rhs,e,r),this}get names(){let e=this.lhs instanceof D.Name?{}:{...this.lhs.names};return Gn(e,this.rhs)}},Wo=class extends Vn{constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ko=class extends mt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Xo=class extends mt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yo=class extends mt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Jo=class extends mt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Cr(this.code,e,r),this}get names(){return this.code instanceof D._CodeOrName?this.code.names:{}}},$s=class extends mt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let i=s[n];i.optimizeNames(e,r)||(ev(e,i.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Yt(e,r.names),{})}},yt=class extends $s{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qo=class extends $s{},Tr=class extends yt{};Tr.kind="else";var Kt=class t extends yt{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new Tr(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(td(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Cr(this.condition,e,r),this}get names(){let e=super.names;return Gn(e,this.condition),this.else&&Yt(e,this.else.names),e}};Kt.kind="if";var Xt=class extends yt{};Xt.kind="for";var Zo=class extends Xt{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Cr(this.iteration,e,r),this}get names(){return Yt(super.names,this.iteration.names)}},ea=class extends Xt{constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?Ge.varKinds.var:this.varKind,{name:s,from:n,to:i}=this;return`for(${r} ${s}=${n}; ${s}<${i}; ${s}++)`+super.render(e)}get names(){let e=Gn(super.names,this.from);return Gn(e,this.to)}},zn=class extends Xt{constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Cr(this.iterable,e,r),this}get names(){return Yt(super.names,this.iterable.names)}},Ts=class extends yt{constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ts.kind="func";var Cs=class extends $s{render(e){return"return "+super.render(e)}};Cs.kind="return";var ta=class extends yt{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Yt(e,this.catch.names),this.finally&&Yt(e,this.finally.names),e}},Os=class extends yt{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Os.kind="catch";var ks=class extends yt{render(e){return"finally"+super.render(e)}};ks.kind="finally";var ra=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
`:""},this._extScope=e,this._scope=new Ge.Scope({parent:e}),this._nodes=[new Qo]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let s=this._extScope.value(e,r);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,s,n){let i=this._scope.toName(r);return s!==void 0&&n&&(this._constants[i.str]=s),this._leafNode(new Ho(e,i,s)),i}const(e,r,s){return this._def(Ge.varKinds.const,e,r,s)}let(e,r,s){return this._def(Ge.varKinds.let,e,r,s)}var(e,r,s){return this._def(Ge.varKinds.var,e,r,s)}assign(e,r,s){return this._leafNode(new Vn(e,r,s))}add(e,r){return this._leafNode(new Wo(e,P.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==D.nil&&this._leafNode(new Jo(e)),this}object(...e){let r=["{"];for(let[s,n]of e)r.length>1&&r.push(","),r.push(s),(s!==n||this.opts.es5)&&(r.push(":"),(0,D.addCodeArg)(r,n));return r.push("}"),new D._Code(r)}if(e,r,s){if(this._blockNode(new Kt(e)),r&&s)this.code(r).else().code(s).endIf();else if(r)this.code(r).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Kt(e))}else(){return this._elseNode(new Tr)}endIf(){return this._endBlockNode(Kt,Tr)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Zo(e),r)}forRange(e,r,s,n,i=this.opts.es5?Ge.varKinds.var:Ge.varKinds.let){let o=this._scope.toName(e);return this._for(new ea(i,o,r,s),()=>n(o))}forOf(e,r,s,n=Ge.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof D.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,D._)`${o}.length`,a=>{this.var(i,(0,D._)`${o}[${a}]`),s(i)})}return this._for(new zn("of",n,i,r),()=>s(i))}forIn(e,r,s,n=this.opts.es5?Ge.varKinds.var:Ge.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,D._)`Object.keys(${r})`,s);let i=this._scope.toName(e);return this._for(new zn("in",n,i,r),()=>s(i))}endFor(){return this._endBlockNode(Xt)}label(e){return this._leafNode(new Ko(e))}break(e){return this._leafNode(new Xo(e))}return(e){let r=new Cs;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Cs)}try(e,r,s){if(!r&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new ta;if(this._blockNode(n),this.code(e),r){let i=this.name("e");this._currNode=n.catch=new Os(i),r(i)}return s&&(this._currNode=n.finally=new ks,this.code(s)),this._endBlockNode(Os,ks)}throw(e){return this._leafNode(new Yo(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-r;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=D.nil,s,n){return this._blockNode(new Ts(e,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Ts)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let s=this._currNode;if(s instanceof e||r&&s instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Kt))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};P.CodeGen=ra;function Yt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Gn(t,e){return e instanceof D._CodeOrName?Yt(t,e.names):t}function Cr(t,e,r){if(t instanceof D.Name)return s(t);if(!n(t))return t;return new D._Code(t._items.reduce((i,o)=>(o instanceof D.Name&&(o=s(o)),o instanceof D._Code?i.push(...o._items):i.push(o),i),[]));function s(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function n(i){return i instanceof D._Code&&i._items.some(o=>o instanceof D.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function ev(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function td(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,D._)`!${sa(t)}`}P.not=td;var tv=rd(P.operators.AND);function rv(...t){return t.reduce(tv)}P.and=rv;var sv=rd(P.operators.OR);function nv(...t){return t.reduce(sv)}P.or=nv;function rd(t){return(e,r)=>e===D.nil?r:r===D.nil?e:(0,D._)`${sa(e)} ${t} ${sa(r)}`}function sa(t){return t instanceof D.Name?t:(0,D._)`(${t})`}});var A=p(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.checkStrictMode=I.getErrorPath=I.Type=I.useFunc=I.setEvaluated=I.evaluatedPropsToName=I.mergeEvaluated=I.eachItem=I.unescapeJsonPointer=I.escapeJsonPointer=I.escapeFragment=I.unescapeFragment=I.schemaRefOrVal=I.schemaHasRulesButRef=I.schemaHasRules=I.checkUnknownRules=I.alwaysValidSchema=I.toHash=void 0;var V=O(),iv=Ss();function ov(t){let e={};for(let r of t)e[r]=!0;return e}I.toHash=ov;function av(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(id(t,e),!od(e,t.self.RULES.all))}I.alwaysValidSchema=av;function id(t,e=t.schema){let{opts:r,self:s}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=s.RULES.keywords;for(let i in e)n[i]||ud(t,`unknown keyword: "${i}"`)}I.checkUnknownRules=id;function od(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}I.schemaHasRules=od;function cv(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}I.schemaHasRulesButRef=cv;function uv({topSchemaRef:t,schemaPath:e},r,s,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,V._)`${r}`}return(0,V._)`${t}${e}${(0,V.getProperty)(s)}`}I.schemaRefOrVal=uv;function lv(t){return ad(decodeURIComponent(t))}I.unescapeFragment=lv;function fv(t){return encodeURIComponent(ia(t))}I.escapeFragment=fv;function ia(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}I.escapeJsonPointer=ia;function ad(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}I.unescapeJsonPointer=ad;function dv(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}I.eachItem=dv;function sd({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:s}){return(n,i,o,a)=>{let c=o===void 0?i:o instanceof V.Name?(i instanceof V.Name?t(n,i,o):e(n,i,o),o):i instanceof V.Name?(e(n,o,i),i):r(i,o);return a===V.Name&&!(c instanceof V.Name)?s(n,c):c}}I.mergeEvaluated={props:sd({mergeNames:(t,e,r)=>t.if((0,V._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,V._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,V._)`${r} || {}`).code((0,V._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,V._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,V._)`${r} || {}`),oa(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:cd}),items:sd({mergeNames:(t,e,r)=>t.if((0,V._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,V._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,V._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,V._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function cd(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,V._)`{}`);return e!==void 0&&oa(t,r,e),r}I.evaluatedPropsToName=cd;function oa(t,e,r){Object.keys(r).forEach(s=>t.assign((0,V._)`${e}${(0,V.getProperty)(s)}`,!0))}I.setEvaluated=oa;var nd={};function hv(t,e){return t.scopeValue("func",{ref:e,code:nd[e.code]||(nd[e.code]=new iv._Code(e.code))})}I.useFunc=hv;var na;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(na||(I.Type=na={}));function pv(t,e,r){if(t instanceof V.Name){let s=e===na.Num;return r?s?(0,V._)`"[" + ${t} + "]"`:(0,V._)`"['" + ${t} + "']"`:s?(0,V._)`"/" + ${t}`:(0,V._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,V.getProperty)(t).toString():"/"+ia(t)}I.getErrorPath=pv;function ud(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}I.checkStrictMode=ud});var Ae=p(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var ce=O(),mv={data:new ce.Name("data"),valCxt:new ce.Name("valCxt"),instancePath:new ce.Name("instancePath"),parentData:new ce.Name("parentData"),parentDataProperty:new ce.Name("parentDataProperty"),rootData:new ce.Name("rootData"),dynamicAnchors:new ce.Name("dynamicAnchors"),vErrors:new ce.Name("vErrors"),errors:new ce.Name("errors"),this:new ce.Name("this"),self:new ce.Name("self"),scope:new ce.Name("scope"),json:new ce.Name("json"),jsonPos:new ce.Name("jsonPos"),jsonLen:new ce.Name("jsonLen"),jsonPart:new ce.Name("jsonPart")};aa.default=mv});var xs=p(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.extendErrors=ue.resetErrorsCount=ue.reportExtraError=ue.reportError=ue.keyword$DataError=ue.keywordError=void 0;var j=O(),Wn=A(),ye=Ae();ue.keywordError={message:({keyword:t})=>(0,j.str)`must pass "${t}" keyword validation`};ue.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,j.str)`"${t}" keyword must be ${e} ($data)`:(0,j.str)`"${t}" keyword is invalid ($data)`};function yv(t,e=ue.keywordError,r,s){let{it:n}=t,{gen:i,compositeRule:o,allErrors:a}=n,c=dd(t,e,r);s??(o||a)?ld(i,c):fd(n,(0,j._)`[${c}]`)}ue.reportError=yv;function gv(t,e=ue.keywordError,r){let{it:s}=t,{gen:n,compositeRule:i,allErrors:o}=s,a=dd(t,e,r);ld(n,a),i||o||fd(s,ye.default.vErrors)}ue.reportExtraError=gv;function _v(t,e){t.assign(ye.default.errors,e),t.if((0,j._)`${ye.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,j._)`${ye.default.vErrors}.length`,e),()=>t.assign(ye.default.vErrors,null)))}ue.resetErrorsCount=_v;function vv({gen:t,keyword:e,schemaValue:r,data:s,errsCount:n,it:i}){if(n===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",n,ye.default.errors,a=>{t.const(o,(0,j._)`${ye.default.vErrors}[${a}]`),t.if((0,j._)`${o}.instancePath === undefined`,()=>t.assign((0,j._)`${o}.instancePath`,(0,j.strConcat)(ye.default.instancePath,i.errorPath))),t.assign((0,j._)`${o}.schemaPath`,(0,j.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,j._)`${o}.schema`,r),t.assign((0,j._)`${o}.data`,s))})}ue.extendErrors=vv;function ld(t,e){let r=t.const("err",e);t.if((0,j._)`${ye.default.vErrors} === null`,()=>t.assign(ye.default.vErrors,(0,j._)`[${r}]`),(0,j._)`${ye.default.vErrors}.push(${r})`),t.code((0,j._)`${ye.default.errors}++`)}function fd(t,e){let{gen:r,validateName:s,schemaEnv:n}=t;n.$async?r.throw((0,j._)`new ${t.ValidationError}(${e})`):(r.assign((0,j._)`${s}.errors`,e),r.return(!1))}var Jt={keyword:new j.Name("keyword"),schemaPath:new j.Name("schemaPath"),params:new j.Name("params"),propertyName:new j.Name("propertyName"),message:new j.Name("message"),schema:new j.Name("schema"),parentSchema:new j.Name("parentSchema")};function dd(t,e,r){let{createErrors:s}=t.it;return s===!1?(0,j._)`{}`:Ev(t,e,r)}function Ev(t,e,r={}){let{gen:s,it:n}=t,i=[wv(n,r),bv(t,r)];return Sv(t,e,i),s.object(...i)}function wv({errorPath:t},{instancePath:e}){let r=e?(0,j.str)`${t}${(0,Wn.getErrorPath)(e,Wn.Type.Str)}`:t;return[ye.default.instancePath,(0,j.strConcat)(ye.default.instancePath,r)]}function bv({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:s}){let n=s?e:(0,j.str)`${e}/${t}`;return r&&(n=(0,j.str)`${n}${(0,Wn.getErrorPath)(r,Wn.Type.Str)}`),[Jt.schemaPath,n]}function Sv(t,{params:e,message:r},s){let{keyword:n,data:i,schemaValue:o,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:f}=a;s.push([Jt.keyword,n],[Jt.params,typeof e=="function"?e(t):e||(0,j._)`{}`]),c.messages&&s.push([Jt.message,typeof r=="function"?r(t):r]),c.verbose&&s.push([Jt.schema,o],[Jt.parentSchema,(0,j._)`${l}${f}`],[ye.default.data,i]),u&&s.push([Jt.propertyName,u])}});var pd=p(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.boolOrEmptySchema=Or.topBoolOrEmptySchema=void 0;var $v=xs(),Tv=O(),Cv=Ae(),Ov={message:"boolean schema is false"};function kv(t){let{gen:e,schema:r,validateName:s}=t;r===!1?hd(t,!1):typeof r=="object"&&r.$async===!0?e.return(Cv.default.data):(e.assign((0,Tv._)`${s}.errors`,null),e.return(!0))}Or.topBoolOrEmptySchema=kv;function xv(t,e){let{gen:r,schema:s}=t;s===!1?(r.var(e,!1),hd(t)):r.var(e,!0)}Or.boolOrEmptySchema=xv;function hd(t,e){let{gen:r,data:s}=t,n={gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,$v.reportError)(n,Ov,void 0,e)}});var ca=p(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.getRules=kr.isJSONType=void 0;var Nv=["string","number","integer","boolean","null","object","array"],Rv=new Set(Nv);function Pv(t){return typeof t=="string"&&Rv.has(t)}kr.isJSONType=Pv;function Iv(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}kr.getRules=Iv});var ua=p(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.shouldUseRule=Ct.shouldUseGroup=Ct.schemaHasRulesForType=void 0;function Av({schema:t,self:e},r){let s=e.RULES.types[r];return s&&s!==!0&&md(t,s)}Ct.schemaHasRulesForType=Av;function md(t,e){return e.rules.some(r=>yd(t,r))}Ct.shouldUseGroup=md;function yd(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(s=>t[s]!==void 0))}Ct.shouldUseRule=yd});var Ns=p(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.reportTypeError=le.checkDataTypes=le.checkDataType=le.coerceAndCheckDataType=le.getJSONTypes=le.getSchemaTypes=le.DataType=void 0;var qv=ca(),Dv=ua(),Lv=xs(),R=O(),gd=A(),xr;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(xr||(le.DataType=xr={}));function jv(t){let e=_d(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}le.getSchemaTypes=jv;function _d(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(qv.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}le.getJSONTypes=_d;function Mv(t,e){let{gen:r,data:s,opts:n}=t,i=Fv(e,n.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,Dv.schemaHasRulesForType)(t,e[0]));if(o){let a=fa(e,s,n.strictNumbers,xr.Wrong);r.if(a,()=>{i.length?Uv(t,e,i):da(t)})}return o}le.coerceAndCheckDataType=Mv;var vd=new Set(["string","number","integer","boolean","null"]);function Fv(t,e){return e?t.filter(r=>vd.has(r)||e==="array"&&r==="array"):[]}function Uv(t,e,r){let{gen:s,data:n,opts:i}=t,o=s.let("dataType",(0,R._)`typeof ${n}`),a=s.let("coerced",(0,R._)`undefined`);i.coerceTypes==="array"&&s.if((0,R._)`${o} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>s.assign(n,(0,R._)`${n}[0]`).assign(o,(0,R._)`typeof ${n}`).if(fa(e,n,i.strictNumbers),()=>s.assign(a,n))),s.if((0,R._)`${a} !== undefined`);for(let u of r)(vd.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);s.else(),da(t),s.endIf(),s.if((0,R._)`${a} !== undefined`,()=>{s.assign(n,a),Bv(t,a)});function c(u){switch(u){case"string":s.elseIf((0,R._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,R._)`"" + ${n}`).elseIf((0,R._)`${n} === null`).assign(a,(0,R._)`""`);return;case"number":s.elseIf((0,R._)`${o} == "boolean" || ${n} === null
|| (${o} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,R._)`+${n}`);return;case"integer":s.elseIf((0,R._)`${o} === "boolean" || ${n} === null
|| (${o} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,R._)`+${n}`);return;case"boolean":s.elseIf((0,R._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,R._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":s.elseIf((0,R._)`${n} === "" || ${n} === 0 || ${n} === false`),s.assign(a,null);return;case"array":s.elseIf((0,R._)`${o} === "string" || ${o} === "number"
|| ${o} === "boolean" || ${n} === null`).assign(a,(0,R._)`[${n}]`)}}}function Bv({gen:t,parentData:e,parentDataProperty:r},s){t.if((0,R._)`${e} !== undefined`,()=>t.assign((0,R._)`${e}[${r}]`,s))}function la(t,e,r,s=xr.Correct){let n=s===xr.Correct?R.operators.EQ:R.operators.NEQ,i;switch(t){case"null":return(0,R._)`${e} ${n} null`;case"array":i=(0,R._)`Array.isArray(${e})`;break;case"object":i=(0,R._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,R._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,R._)`typeof ${e} ${n} ${t}`}return s===xr.Correct?i:(0,R.not)(i);function o(a=R.nil){return(0,R.and)((0,R._)`typeof ${e} == "number"`,a,r?(0,R._)`isFinite(${e})`:R.nil)}}le.checkDataType=la;function fa(t,e,r,s){if(t.length===1)return la(t[0],e,r,s);let n,i=(0,gd.toHash)(t);if(i.array&&i.object){let o=(0,R._)`typeof ${e} != "object"`;n=i.null?o:(0,R._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else n=R.nil;i.number&&delete i.integer;for(let o in i)n=(0,R.and)(n,la(o,e,r,s));return n}le.checkDataTypes=fa;var Vv={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,R._)`{type: ${t}}`:(0,R._)`{type: ${e}}`};function da(t){let e=zv(t);(0,Lv.reportError)(e,Vv)}le.reportTypeError=da;function zv(t){let{gen:e,data:r,schema:s}=t,n=(0,gd.schemaRefOrVal)(t,s,"type");return{gen:e,keyword:"type",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:t}}});var wd=p(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.assignDefaults=void 0;var Nr=O(),Gv=A();function Hv(t,e){let{properties:r,items:s}=t.schema;if(e==="object"&&r)for(let n in r)Ed(t,n,r[n].default);else e==="array"&&Array.isArray(s)&&s.forEach((n,i)=>Ed(t,i,n.default))}Kn.assignDefaults=Hv;function Ed(t,e,r){let{gen:s,compositeRule:n,data:i,opts:o}=t;if(r===void 0)return;let a=(0,Nr._)`${i}${(0,Nr.getProperty)(e)}`;if(n){(0,Gv.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Nr._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,Nr._)`${c} || ${a} === null || ${a} === ""`),s.if(c,(0,Nr._)`${a} = ${(0,Nr.stringify)(r)}`)}});var qe=p(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.validateUnion=U.validateArray=U.usePattern=U.callValidateCode=U.schemaProperties=U.allSchemaProperties=U.noPropertyInData=U.propertyInData=U.isOwnProperty=U.hasPropFunc=U.reportMissingProp=U.checkMissingProp=U.checkReportMissingProp=void 0;var G=O(),ha=A(),Ot=Ae(),Wv=A();function Kv(t,e){let{gen:r,data:s,it:n}=t;r.if(ma(r,s,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,G._)`${e}`},!0),t.error()})}U.checkReportMissingProp=Kv;function Xv({gen:t,data:e,it:{opts:r}},s,n){return(0,G.or)(...s.map(i=>(0,G.and)(ma(t,e,i,r.ownProperties),(0,G._)`${n} = ${i}`)))}U.checkMissingProp=Xv;function Yv(t,e){t.setParams({missingProperty:e},!0),t.error()}U.reportMissingProp=Yv;function bd(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,G._)`Object.prototype.hasOwnProperty`})}U.hasPropFunc=bd;function pa(t,e,r){return(0,G._)`${bd(t)}.call(${e}, ${r})`}U.isOwnProperty=pa;function Jv(t,e,r,s){let n=(0,G._)`${e}${(0,G.getProperty)(r)} !== undefined`;return s?(0,G._)`${n} && ${pa(t,e,r)}`:n}U.propertyInData=Jv;function ma(t,e,r,s){let n=(0,G._)`${e}${(0,G.getProperty)(r)} === undefined`;return s?(0,G.or)(n,(0,G.not)(pa(t,e,r))):n}U.noPropertyInData=ma;function Sd(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}U.allSchemaProperties=Sd;function Qv(t,e){return Sd(e).filter(r=>!(0,ha.alwaysValidSchema)(t,e[r]))}U.schemaProperties=Qv;function Zv({schemaCode:t,data:e,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:i},it:o},a,c,u){let l=u?(0,G._)`${t}, ${e}, ${s}${n}`:e,f=[[Ot.default.instancePath,(0,G.strConcat)(Ot.default.instancePath,i)],[Ot.default.parentData,o.parentData],[Ot.default.parentDataProperty,o.parentDataProperty],[Ot.default.rootData,Ot.default.rootData]];o.opts.dynamicRef&&f.push([Ot.default.dynamicAnchors,Ot.default.dynamicAnchors]);let d=(0,G._)`${l}, ${r.object(...f)}`;return c!==G.nil?(0,G._)`${a}.call(${c}, ${d})`:(0,G._)`${a}(${d})`}U.callValidateCode=Zv;var eE=(0,G._)`new RegExp`;function tE({gen:t,it:{opts:e}},r){let s=e.unicodeRegExp?"u":"",{regExp:n}=e.code,i=n(r,s);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,G._)`${n.code==="new RegExp"?eE:(0,Wv.useFunc)(t,n)}(${r}, ${s})`})}U.usePattern=tE;function rE(t){let{gen:e,data:r,keyword:s,it:n}=t,i=e.name("valid");if(n.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,G._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:ha.Type.Num},i),e.if((0,G.not)(i),a)})}}U.validateArray=rE;function sE(t){let{gen:e,schema:r,keyword:s,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,ha.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:s,schemaProp:u,compositeRule:!0},a);e.assign(o,(0,G._)`${o} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,G.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}U.validateUnion=sE});var Cd=p(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.validateKeywordUsage=et.validSchemaType=et.funcKeywordCode=et.macroKeywordCode=void 0;var ge=O(),Qt=Ae(),nE=qe(),iE=xs();function oE(t,e){let{gen:r,keyword:s,schema:n,parentSchema:i,it:o}=t,a=e.macro.call(o.self,n,i,o),c=Td(r,s,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ge.nil,errSchemaPath:`${o.errSchemaPath}/${s}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}et.macroKeywordCode=oE;function aE(t,e){var r;let{gen:s,keyword:n,schema:i,parentSchema:o,$data:a,it:c}=t;uE(c,e);let u=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,l=Td(s,n,u),f=s.let("valid");t.block$data(f,d),t.ok((r=e.valid)!==null&&r!==void 0?r:f);function d(){if(e.errors===!1)m(),e.modifying&&$d(t),g(()=>t.error());else{let v=e.async?h():y();e.modifying&&$d(t),g(()=>cE(t,v))}}function h(){let v=s.let("ruleErrs",null);return s.try(()=>m((0,ge._)`await `),$=>s.assign(f,!1).if((0,ge._)`${$} instanceof ${c.ValidationError}`,()=>s.assign(v,(0,ge._)`${$}.errors`),()=>s.throw($))),v}function y(){let v=(0,ge._)`${l}.errors`;return s.assign(v,null),m(ge.nil),v}function m(v=e.async?(0,ge._)`await `:ge.nil){let $=c.opts.passContext?Qt.default.this:Qt.default.self,_=!("compile"in e&&!a||e.schema===!1);s.assign(f,(0,ge._)`${v}${(0,nE.callValidateCode)(t,l,$,_)}`,e.modifying)}function g(v){var $;s.if((0,ge.not)(($=e.valid)!==null&&$!==void 0?$:f),v)}}et.funcKeywordCode=aE;function $d(t){let{gen:e,data:r,it:s}=t;e.if(s.parentData,()=>e.assign(r,(0,ge._)`${s.parentData}[${s.parentDataProperty}]`))}function cE(t,e){let{gen:r}=t;r.if((0,ge._)`Array.isArray(${e})`,()=>{r.assign(Qt.default.vErrors,(0,ge._)`${Qt.default.vErrors} === null ? ${e} : ${Qt.default.vErrors}.concat(${e})`).assign(Qt.default.errors,(0,ge._)`${Qt.default.vErrors}.length`),(0,iE.extendErrors)(t)},()=>t.error())}function uE({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Td(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ge.stringify)(r)})}function lE(t,e,r=!1){return!e.length||e.some(s=>s==="array"?Array.isArray(t):s==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==s||r&&typeof t>"u")}et.validSchemaType=lE;function fE({schema:t,opts:e,self:r,errSchemaPath:s},n,i){if(Array.isArray(n.keyword)?!n.keyword.includes(i):n.keyword!==i)throw new Error("ajv implementation error");let o=n.dependencies;if(o!=null&&o.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[i])){let c=`keyword "${i}" value is invalid at path "${s}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}et.validateKeywordUsage=fE});var kd=p(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.extendSubschemaMode=kt.extendSubschemaData=kt.getSubschema=void 0;var tt=O(),Od=A();function dE(t,{keyword:e,schemaProp:r,schema:s,schemaPath:n,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&s!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,tt._)`${t.schemaPath}${(0,tt.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,tt._)`${t.schemaPath}${(0,tt.getProperty)(e)}${(0,tt.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Od.escapeFragment)(r)}`}}if(s!==void 0){if(n===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:n,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}kt.getSubschema=dE;function hE(t,e,{dataProp:r,dataPropType:s,data:n,dataTypes:i,propertyName:o}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:f}=e,d=a.let("data",(0,tt._)`${e.data}${(0,tt.getProperty)(r)}`,!0);c(d),t.errorPath=(0,tt.str)`${u}${(0,Od.getErrorPath)(r,s,f.jsPropertySyntax)}`,t.parentDataProperty=(0,tt._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(n!==void 0){let u=n instanceof tt.Name?n:a.let("data",n,!0);c(u),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}kt.extendSubschemaData=hE;function pE(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:i}){s!==void 0&&(t.compositeRule=s),n!==void 0&&(t.createErrors=n),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}kt.extendSubschemaMode=pE});var ya=p((KR,xd)=>{"use strict";xd.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var s,n,i;if(Array.isArray(e)){if(s=e.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),s=i.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=s;n--!==0;){var o=i[n];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var Rd=p((XR,Nd)=>{"use strict";var xt=Nd.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var s=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Xn(e,s,n,t,"",t)};xt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};xt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};xt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};xt.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Xn(t,e,r,s,n,i,o,a,c,u){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,n,i,o,a,c,u);for(var l in s){var f=s[l];if(Array.isArray(f)){if(l in xt.arrayKeywords)for(var d=0;d<f.length;d++)Xn(t,e,r,f[d],n+"/"+l+"/"+d,i,n,l,s,d)}else if(l in xt.propsKeywords){if(f&&typeof f=="object")for(var h in f)Xn(t,e,r,f[h],n+"/"+l+"/"+mE(h),i,n,l,s,h)}else(l in xt.keywords||t.allKeys&&!(l in xt.skipKeywords))&&Xn(t,e,r,f,n+"/"+l,i,n,l,s)}r(s,n,i,o,a,c,u)}}function mE(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Rs=p($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.getSchemaRefs=$e.resolveUrl=$e.normalizeId=$e._getFullPath=$e.getFullPath=$e.inlineRef=void 0;var yE=A(),gE=ya(),_E=Rd(),vE=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function EE(t,e=!0){return typeof t=="boolean"?!0:e===!0?!ga(t):e?Pd(t)<=e:!1}$e.inlineRef=EE;var wE=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function ga(t){for(let e in t){if(wE.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(ga)||typeof r=="object"&&ga(r))return!0}return!1}function Pd(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!vE.has(r)&&(typeof t[r]=="object"&&(0,yE.eachItem)(t[r],s=>e+=Pd(s)),e===1/0))return 1/0}return e}function Id(t,e="",r){r!==!1&&(e=Rr(e));let s=t.parse(e);return Ad(t,s)}$e.getFullPath=Id;function Ad(t,e){return t.serialize(e).split("#")[0]+"#"}$e._getFullPath=Ad;var bE=/#\/?$/;function Rr(t){return t?t.replace(bE,""):""}$e.normalizeId=Rr;function SE(t,e,r){return r=Rr(r),t.resolve(e,r)}$e.resolveUrl=SE;var $E=/^[a-z_][-a-z0-9._]*$/i;function TE(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:s}=this.opts,n=Rr(t[r]||e),i={"":n},o=Id(s,n,!1),a={},c=new Set;return _E(t,{allKeys:!0},(f,d,h,y)=>{if(y===void 0)return;let m=o+d,g=i[y];typeof f[r]=="string"&&(g=v.call(this,f[r])),$.call(this,f.$anchor),$.call(this,f.$dynamicAnchor),i[d]=g;function v(_){let E=this.opts.uriResolver.resolve;if(_=Rr(g?E(g,_):_),c.has(_))throw l(_);c.add(_);let S=this.refs[_];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?u(f,S.schema,_):_!==Rr(m)&&(_[0]==="#"?(u(f,a[_],_),a[_]=f):this.refs[_]=m),_}function $(_){if(typeof _=="string"){if(!$E.test(_))throw new Error(`invalid anchor "${_}"`);v.call(this,`#${_}`)}}}),a;function u(f,d,h){if(d!==void 0&&!gE(f,d))throw l(h)}function l(f){return new Error(`reference "${f}" resolves to more than one schema`)}}$e.getSchemaRefs=TE});var Pr=p(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.getData=Nt.KeywordCxt=Nt.validateFunctionCode=void 0;var Md=pd(),qd=Ns(),va=ua(),Yn=Ns(),CE=wd(),Is=Cd(),_a=kd(),T=O(),C=Ae(),OE=Rs(),gt=A(),Ps=xs();function kE(t){if(Bd(t)&&(Vd(t),Ud(t))){RE(t);return}Fd(t,()=>(0,Md.topBoolOrEmptySchema)(t))}Nt.validateFunctionCode=kE;function Fd({gen:t,validateName:e,schema:r,schemaEnv:s,opts:n},i){n.code.es5?t.func(e,(0,T._)`${C.default.data}, ${C.default.valCxt}`,s.$async,()=>{t.code((0,T._)`"use strict"; ${Dd(r,n)}`),NE(t,n),t.code(i)}):t.func(e,(0,T._)`${C.default.data}, ${xE(n)}`,s.$async,()=>t.code(Dd(r,n)).code(i))}function xE(t){return(0,T._)`{${C.default.instancePath}="", ${C.default.parentData}, ${C.default.parentDataProperty}, ${C.default.rootData}=${C.default.data}${t.dynamicRef?(0,T._)`, ${C.default.dynamicAnchors}={}`:T.nil}}={}`}function NE(t,e){t.if(C.default.valCxt,()=>{t.var(C.default.instancePath,(0,T._)`${C.default.valCxt}.${C.default.instancePath}`),t.var(C.default.parentData,(0,T._)`${C.default.valCxt}.${C.default.parentData}`),t.var(C.default.parentDataProperty,(0,T._)`${C.default.valCxt}.${C.default.parentDataProperty}`),t.var(C.default.rootData,(0,T._)`${C.default.valCxt}.${C.default.rootData}`),e.dynamicRef&&t.var(C.default.dynamicAnchors,(0,T._)`${C.default.valCxt}.${C.default.dynamicAnchors}`)},()=>{t.var(C.default.instancePath,(0,T._)`""`),t.var(C.default.parentData,(0,T._)`undefined`),t.var(C.default.parentDataProperty,(0,T._)`undefined`),t.var(C.default.rootData,C.default.data),e.dynamicRef&&t.var(C.default.dynamicAnchors,(0,T._)`{}`)})}function RE(t){let{schema:e,opts:r,gen:s}=t;Fd(t,()=>{r.$comment&&e.$comment&&Gd(t),DE(t),s.let(C.default.vErrors,null),s.let(C.default.errors,0),r.unevaluated&&PE(t),zd(t),ME(t)})}function PE(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,T._)`${r}.evaluated`),e.if((0,T._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,T._)`${t.evaluated}.props`,(0,T._)`undefined`)),e.if((0,T._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,T._)`${t.evaluated}.items`,(0,T._)`undefined`))}function Dd(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,T._)`/*# sourceURL=${r} */`:T.nil}function IE(t,e){if(Bd(t)&&(Vd(t),Ud(t))){AE(t,e);return}(0,Md.boolOrEmptySchema)(t,e)}function Ud({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Bd(t){return typeof t.schema!="boolean"}function AE(t,e){let{schema:r,gen:s,opts:n}=t;n.$comment&&r.$comment&&Gd(t),LE(t),jE(t);let i=s.const("_errs",C.default.errors);zd(t,i),s.var(e,(0,T._)`${i} === ${C.default.errors}`)}function Vd(t){(0,gt.checkUnknownRules)(t),qE(t)}function zd(t,e){if(t.opts.jtd)return Ld(t,[],!1,e);let r=(0,qd.getSchemaTypes)(t.schema),s=(0,qd.coerceAndCheckDataType)(t,r);Ld(t,r,!s,e)}function qE(t){let{schema:e,errSchemaPath:r,opts:s,self:n}=t;e.$ref&&s.ignoreKeywordsWithRef&&(0,gt.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function DE(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,gt.checkStrictMode)(t,"default is ignored in the schema root")}function LE(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,OE.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function jE(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Gd({gen:t,schemaEnv:e,schema:r,errSchemaPath:s,opts:n}){let i=r.$comment;if(n.$comment===!0)t.code((0,T._)`${C.default.self}.logger.log(${i})`);else if(typeof n.$comment=="function"){let o=(0,T.str)`${s}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,T._)`${C.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function ME(t){let{gen:e,schemaEnv:r,validateName:s,ValidationError:n,opts:i}=t;r.$async?e.if((0,T._)`${C.default.errors} === 0`,()=>e.return(C.default.data),()=>e.throw((0,T._)`new ${n}(${C.default.vErrors})`)):(e.assign((0,T._)`${s}.errors`,C.default.vErrors),i.unevaluated&&FE(t),e.return((0,T._)`${C.default.errors} === 0`))}function FE({gen:t,evaluated:e,props:r,items:s}){r instanceof T.Name&&t.assign((0,T._)`${e}.props`,r),s instanceof T.Name&&t.assign((0,T._)`${e}.items`,s)}function Ld(t,e,r,s){let{gen:n,schema:i,data:o,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,gt.schemaHasRulesButRef)(i,l))){n.block(()=>Wd(t,"$ref",l.all.$ref.definition));return}c.jtd||UE(t,e),n.block(()=>{for(let d of l.rules)f(d);f(l.post)});function f(d){(0,va.shouldUseGroup)(i,d)&&(d.type?(n.if((0,Yn.checkDataType)(d.type,o,c.strictNumbers)),jd(t,d),e.length===1&&e[0]===d.type&&r&&(n.else(),(0,Yn.reportTypeError)(t)),n.endIf()):jd(t,d),a||n.if((0,T._)`${C.default.errors} === ${s||0}`))}}function jd(t,e){let{gen:r,schema:s,opts:{useDefaults:n}}=t;n&&(0,CE.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,va.shouldUseRule)(s,i)&&Wd(t,i.keyword,i.definition,e.type)})}function UE(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(BE(t,e),t.opts.allowUnionTypes||VE(t,e),zE(t,t.dataTypes))}function BE(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Hd(t.dataTypes,r)||Ea(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),HE(t,e)}}function VE(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ea(t,"use allowUnionTypes to allow union type keyword")}function zE(t,e){let r=t.self.RULES.all;for(let s in r){let n=r[s];if(typeof n=="object"&&(0,va.shouldUseRule)(t.schema,n)){let{type:i}=n.definition;i.length&&!i.some(o=>GE(e,o))&&Ea(t,`missing type "${i.join(",")}" for keyword "${s}"`)}}}function GE(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Hd(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function HE(t,e){let r=[];for(let s of t.dataTypes)Hd(e,s)?r.push(s):e.includes("integer")&&s==="number"&&r.push("integer");t.dataTypes=r}function Ea(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,gt.checkStrictMode)(t,e,t.opts.strictTypes)}var Jn=class{constructor(e,r,s){if((0,Is.validateKeywordUsage)(e,r,s),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=s,this.data=e.data,this.schema=e.schema[s],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gt.schemaRefOrVal)(e,this.schema,s,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Kd(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Is.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${s} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",C.default.errors))}result(e,r,s){this.failResult((0,T.not)(e),r,s)}failResult(e,r,s){this.gen.if(e),s?s():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,T.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,T._)`${r} !== undefined && (${(0,T.or)(this.invalid$data(),e)})`)}error(e,r,s){if(r){this.setParams(r),this._error(e,s),this.setParams({});return}this._error(e,s)}_error(e,r){(e?Ps.reportExtraError:Ps.reportError)(this,this.def.error,r)}$dataError(){(0,Ps.reportError)(this,this.def.$dataError||Ps.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ps.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,s=T.nil){this.gen.block(()=>{this.check$data(e,s),r()})}check$data(e=T.nil,r=T.nil){if(!this.$data)return;let{gen:s,schemaCode:n,schemaType:i,def:o}=this;s.if((0,T.or)((0,T._)`${n} === undefined`,r)),e!==T.nil&&s.assign(e,!0),(i.length||o.validateSchema)&&(s.elseIf(this.invalid$data()),this.$dataError(),e!==T.nil&&s.assign(e,!1)),s.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:s,def:n,it:i}=this;return(0,T.or)(o(),a());function o(){if(s.length){if(!(r instanceof T.Name))throw new Error("ajv implementation error");let c=Array.isArray(s)?s:[s];return(0,T._)`${(0,Yn.checkDataTypes)(c,r,i.opts.strictNumbers,Yn.DataType.Wrong)}`}return T.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,T._)`!${c}(${r})`}return T.nil}}subschema(e,r){let s=(0,_a.getSubschema)(this.it,e);(0,_a.extendSubschemaData)(s,this.it,e),(0,_a.extendSubschemaMode)(s,e);let n={...this.it,...s,items:void 0,props:void 0};return IE(n,r),n}mergeEvaluated(e,r){let{it:s,gen:n}=this;s.opts.unevaluated&&(s.props!==!0&&e.props!==void 0&&(s.props=gt.mergeEvaluated.props(n,e.props,s.props,r)),s.items!==!0&&e.items!==void 0&&(s.items=gt.mergeEvaluated.items(n,e.items,s.items,r)))}mergeValidEvaluated(e,r){let{it:s,gen:n}=this;if(s.opts.unevaluated&&(s.props!==!0||s.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,T.Name)),!0}};Nt.KeywordCxt=Jn;function Wd(t,e,r,s){let n=new Jn(t,r,e);"code"in r?r.code(n,s):n.$data&&r.validate?(0,Is.funcKeywordCode)(n,r):"macro"in r?(0,Is.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Is.funcKeywordCode)(n,r)}var WE=/^\/(?:[^~]|~0|~1)*$/,KE=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Kd(t,{dataLevel:e,dataNames:r,dataPathArr:s}){let n,i;if(t==="")return C.default.rootData;if(t[0]==="/"){if(!WE.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,i=C.default.rootData}else{let u=KE.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(n=u[2],n==="#"){if(l>=e)throw new Error(c("property/index",l));return s[e-l]}if(l>e)throw new Error(c("data",l));if(i=r[e-l],!n)return i}let o=i,a=n.split("/");for(let u of a)u&&(i=(0,T._)`${i}${(0,T.getProperty)((0,gt.unescapeJsonPointer)(u))}`,o=(0,T._)`${o} && ${i}`);return o;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}Nt.getData=Kd});var As=p(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var wa=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};ba.default=wa});var Ir=p(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var Sa=Rs(),$a=class extends Error{constructor(e,r,s,n){super(n||`can't resolve reference ${s} from id ${r}`),this.missingRef=(0,Sa.resolveUrl)(e,r,s),this.missingSchema=(0,Sa.normalizeId)((0,Sa.getFullPath)(e,this.missingRef))}};Ta.default=$a});var qs=p(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.resolveSchema=De.getCompilingSchema=De.resolveRef=De.compileSchema=De.SchemaEnv=void 0;var He=O(),XE=As(),Zt=Ae(),We=Rs(),Xd=A(),YE=Pr(),Ar=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let s;typeof e.schema=="object"&&(s=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,We.normalizeId)(s==null?void 0:s[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=s==null?void 0:s.$async,this.refs={}}};De.SchemaEnv=Ar;function Oa(t){let e=Yd.call(this,t);if(e)return e;let r=(0,We.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:s,lines:n}=this.opts.code,{ownProperties:i}=this.opts,o=new He.CodeGen(this.scope,{es5:s,lines:n,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:XE.default,code:(0,He._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let u={gen:o,allErrors:this.opts.allErrors,data:Zt.default.data,parentData:Zt.default.parentData,parentDataProperty:Zt.default.parentDataProperty,dataNames:[Zt.default.data],dataPathArr:[He.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,He.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:He.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,He._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,YE.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let f=o.toString();l=`${o.scopeRefs(Zt.default.scope)}return ${f}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let h=new Function(`${Zt.default.self}`,`${Zt.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:m}=u;h.evaluated={props:y instanceof He.Name?void 0:y,items:m instanceof He.Name?void 0:m,dynamicProps:y instanceof He.Name,dynamicItems:m instanceof He.Name},h.source&&(h.source.evaluated=(0,He.stringify)(h.evaluated))}return t.validate=h,t}catch(f){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),f}finally{this._compilations.delete(t)}}De.compileSchema=Oa;function JE(t,e,r){var s;r=(0,We.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let i=ew.call(this,t,r);if(i===void 0){let o=(s=t.localRefs)===null||s===void 0?void 0:s[r],{schemaId:a}=this.opts;o&&(i=new Ar({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=QE.call(this,i)}De.resolveRef=JE;function QE(t){return(0,We.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Oa.call(this,t)}function Yd(t){for(let e of this._compilations)if(ZE(e,t))return e}De.getCompilingSchema=Yd;function ZE(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function ew(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Qn.call(this,t,e)}function Qn(t,e){let r=this.opts.uriResolver.parse(e),s=(0,We._getFullPath)(this.opts.uriResolver,r),n=(0,We.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&s===n)return Ca.call(this,r,t);let i=(0,We.normalizeId)(s),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Qn.call(this,t,o);return typeof(a==null?void 0:a.schema)!="object"?void 0:Ca.call(this,r,a)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||Oa.call(this,o),i===(0,We.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,u=a[c];return u&&(n=(0,We.resolveUrl)(this.opts.uriResolver,n,u)),new Ar({schema:a,schemaId:c,root:t,baseId:n})}return Ca.call(this,r,o)}}De.resolveSchema=Qn;var tw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ca(t,{baseId:e,schema:r,root:s}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Xd.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!tw.has(a)&&u&&(e=(0,We.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Xd.schemaHasRulesButRef)(r,this.RULES)){let a=(0,We.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Qn.call(this,s,a)}let{schemaId:o}=this.opts;if(i=i||new Ar({schema:r,schemaId:o,root:s,baseId:e}),i.schema!==i.root.schema)return i}});var Jd=p((tP,rw)=>{rw.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var xa=p((rP,th)=>{"use strict";var sw=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Zd=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function ka(t){let e="",r=0,s=0;for(s=0;s<t.length;s++)if(r=t[s].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[s];break}for(s+=1;s<t.length;s++){if(r=t[s].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[s]}return e}var nw=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Qd(t){return t.length=0,!0}function iw(t,e,r){if(t.length){let s=ka(t);if(s!=="")e.push(s);else return r.error=!0,!1;t.length=0}return!0}function ow(t){let e=0,r={error:!1,address:"",zone:""},s=[],n=[],i=!1,o=!1,a=iw;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(o=!0),!a(n,s,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(i=!0),s.push(":");continue}else if(u==="%"){if(!a(n,s,r))break;a=Qd}else{n.push(u);continue}}return n.length&&(a===Qd?r.zone=n.join(""):o?s.push(n.join("")):s.push(ka(n))),r.address=s.join(""),r}function eh(t){if(aw(t,":")<2)return{host:t,isIPV6:!1};let e=ow(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,s=e.address;return e.zone&&(r+="%"+e.zone,s+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:s}}}function aw(t,e){let r=0;for(let s=0;s<t.length;s++)t[s]===e&&r++;return r}function cw(t){let e=t,r=[],s=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((s=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,s)),e=e.slice(s)}return r.join("")}function uw(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function lw(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!Zd(r)){let s=eh(r);s.isIPV6===!0?r=`[${s.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}th.exports={nonSimpleDomain:nw,recomposeAuthority:lw,normalizeComponentEncoding:uw,removeDotSegments:cw,isIPv4:Zd,isUUID:sw,normalizeIPv6:eh,stringArrayToHexStripped:ka}});var oh=p((sP,ih)=>{"use strict";var{isUUID:fw}=xa(),dw=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hw=["http","https","ws","wss","urn","urn:uuid"];function pw(t){return hw.indexOf(t)!==-1}function Na(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function rh(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function sh(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function mw(t){return t.secure=Na(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function yw(t){if((t.port===(Na(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function gw(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(dw);if(r){let s=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${s}:${e.nid||t.nid}`,i=Ra(n);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function _w(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",s=t.nid.toLowerCase(),n=`${r}:${e.nid||s}`,i=Ra(n);i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${s||e.nid}:${a}`,e.skipEscape=!0,o}function vw(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!fw(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Ew(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var nh={scheme:"http",domainHost:!0,parse:rh,serialize:sh},ww={scheme:"https",domainHost:nh.domainHost,parse:rh,serialize:sh},Zn={scheme:"ws",domainHost:!0,parse:mw,serialize:yw},bw={scheme:"wss",domainHost:Zn.domainHost,parse:Zn.parse,serialize:Zn.serialize},Sw={scheme:"urn",parse:gw,serialize:_w,skipNormalize:!0},$w={scheme:"urn:uuid",parse:vw,serialize:Ew,skipNormalize:!0},ei={http:nh,https:ww,ws:Zn,wss:bw,urn:Sw,"urn:uuid":$w};Object.setPrototypeOf(ei,null);function Ra(t){return t&&(ei[t]||ei[t.toLowerCase()])||void 0}ih.exports={wsIsSecure:Na,SCHEMES:ei,isValidSchemeName:pw,getSchemeHandler:Ra}});var uh=p((nP,ri)=>{"use strict";var{normalizeIPv6:Tw,removeDotSegments:Ds,recomposeAuthority:Cw,normalizeComponentEncoding:ti,isIPv4:Ow,nonSimpleDomain:kw}=xa(),{SCHEMES:xw,getSchemeHandler:ah}=oh();function Nw(t,e){return typeof t=="string"?t=rt(_t(t,e),e):typeof t=="object"&&(t=_t(rt(t,e),e)),t}function Rw(t,e,r){let s=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=ch(_t(t,s),_t(e,s),s,!0);return s.skipEscape=!0,rt(n,s)}function ch(t,e,r,s){let n={};return s||(t=_t(rt(t,r),r),e=_t(rt(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Ds(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Ds(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Ds(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Ds(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function Pw(t,e,r){return typeof t=="string"?(t=unescape(t),t=rt(ti(_t(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=rt(ti(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=rt(ti(_t(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=rt(ti(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function rt(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},s=Object.assign({},e),n=[],i=ah(s.scheme||r.scheme);i&&i.serialize&&i.serialize(r,s),r.path!==void 0&&(s.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),s.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let o=Cw(r);if(o!==void 0&&(s.reference!=="suffix"&&n.push("//"),n.push(o),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!s.absolutePath&&(!i||!i.absolutePath)&&(a=Ds(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var Iw=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _t(t,e){let r=Object.assign({},e),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(Iw);if(i){if(s.scheme=i[1],s.userinfo=i[3],s.host=i[4],s.port=parseInt(i[5],10),s.path=i[6]||"",s.query=i[7],s.fragment=i[8],isNaN(s.port)&&(s.port=i[5]),s.host)if(Ow(s.host)===!1){let c=Tw(s.host);s.host=c.host.toLowerCase(),n=c.isIPV6}else n=!0;s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference="same-document":s.scheme===void 0?s.reference="relative":s.fragment===void 0?s.reference="absolute":s.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");let o=ah(r.scheme||s.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&s.host&&(r.domainHost||o&&o.domainHost)&&n===!1&&kw(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(a){s.error=s.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),s.host!==void 0&&(s.host=unescape(s.host))),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),o&&o.parse&&o.parse(s,r)}else s.error=s.error||"URI can not be parsed.";return s}var Pa={SCHEMES:xw,normalize:Nw,resolve:Rw,resolveComponent:ch,equal:Pw,serialize:rt,parse:_t};ri.exports=Pa;ri.exports.default=Pa;ri.exports.fastUri=Pa});var fh=p(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var lh=uh();lh.code='require("ajv/dist/runtime/uri").default';Ia.default=lh});var Da=p(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.CodeGen=ie.Name=ie.nil=ie.stringify=ie.str=ie._=ie.KeywordCxt=void 0;var Aw=Pr();Object.defineProperty(ie,"KeywordCxt",{enumerable:!0,get:function(){return Aw.KeywordCxt}});var qr=O();Object.defineProperty(ie,"_",{enumerable:!0,get:function(){return qr._}});Object.defineProperty(ie,"str",{enumerable:!0,get:function(){return qr.str}});Object.defineProperty(ie,"stringify",{enumerable:!0,get:function(){return qr.stringify}});Object.defineProperty(ie,"nil",{enumerable:!0,get:function(){return qr.nil}});Object.defineProperty(ie,"Name",{enumerable:!0,get:function(){return qr.Name}});Object.defineProperty(ie,"CodeGen",{enumerable:!0,get:function(){return qr.CodeGen}});var qw=As(),yh=Ir(),Dw=ca(),Ls=qs(),Lw=O(),js=Rs(),si=Ns(),qa=A(),dh=Jd(),jw=fh(),gh=(t,e)=>new RegExp(t,e);gh.code="new RegExp";var Mw=["removeAdditional","useDefaults","coerceTypes"],Fw=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Uw={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Bw={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},hh=200;function Vw(t){var e,r,s,n,i,o,a,c,u,l,f,d,h,y,m,g,v,$,_,E,S,F,z,ae,q;let Fe=t.strict,vt=(e=t.code)===null||e===void 0?void 0:e.optimize,an=vt===!0||vt===void 0?1:vt||0,Ce=(s=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&s!==void 0?s:gh,Yr=(n=t.uriResolver)!==null&&n!==void 0?n:jw.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:Fe)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Fe)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:Fe)!==null&&l!==void 0?l:"log",strictTuples:(d=(f=t.strictTuples)!==null&&f!==void 0?f:Fe)!==null&&d!==void 0?d:"log",strictRequired:(y=(h=t.strictRequired)!==null&&h!==void 0?h:Fe)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:an,regExp:Ce}:{optimize:an,regExp:Ce},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:hh,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:hh,meta:(v=t.meta)!==null&&v!==void 0?v:!0,messages:($=t.messages)!==null&&$!==void 0?$:!0,inlineRefs:(_=t.inlineRefs)!==null&&_!==void 0?_:!0,schemaId:(E=t.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(S=t.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(F=t.validateSchema)!==null&&F!==void 0?F:!0,validateFormats:(z=t.validateFormats)!==null&&z!==void 0?z:!0,unicodeRegExp:(ae=t.unicodeRegExp)!==null&&ae!==void 0?ae:!0,int32range:(q=t.int32range)!==null&&q!==void 0?q:!0,uriResolver:Yr}}var Ms=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Vw(e)};let{es5:r,lines:s}=this.opts.code;this.scope=new Lw.ValueScope({scope:{},prefixes:Fw,es5:r,lines:s}),this.logger=Xw(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Dw.getRules)(),ph.call(this,Uw,e,"NOT SUPPORTED"),ph.call(this,Bw,e,"DEPRECATED","warn"),this._metaOpts=Ww.call(this),e.formats&&Gw.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Hw.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),zw.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:s}=this.opts,n=dh;s==="id"&&(n={...dh},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[s],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let s;if(typeof e=="string"){if(s=this.getSchema(e),!s)throw new Error(`no schema with key or ref "${e}"`)}else s=this.compile(e);let n=s(r);return"$async"in s||(this.errors=s.errors),n}compile(e,r){let s=this._addSchema(e,r);return s.validate||this._compileSchemaEnv(s)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:s}=this.opts;return n.call(this,e,r);async function n(l,f){await i.call(this,l.$schema);let d=this._addSchema(l,f);return d.validate||o.call(this,d)}async function i(l){l&&!this.getSchema(l)&&await n.call(this,{$ref:l},!0)}async function o(l){try{return this._compileSchemaEnv(l)}catch(f){if(!(f instanceof yh.default))throw f;return a.call(this,f),await c.call(this,f.missingSchema),o.call(this,l)}}function a({missingSchema:l,missingRef:f}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${f} cannot be resolved`)}async function c(l){let f=await u.call(this,l);this.refs[l]||await i.call(this,f.$schema),this.refs[l]||this.addSchema(f,l,r)}async function u(l){let f=this._loading[l];if(f)return f;try{return await(this._loading[l]=s(l))}finally{delete this._loading[l]}}}addSchema(e,r,s,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,s,n);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return r=(0,js.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,s,r,n,!0),this}addMetaSchema(e,r,s=this.opts.validateSchema){return this.addSchema(e,r,!0,s),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let s;if(s=e.$schema,s!==void 0&&typeof s!="string")throw new Error("$schema must be a string");if(s=s||this.opts.defaultMeta||this.defaultMeta(),!s)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(s,e);if(!n&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return n}getSchema(e){let r;for(;typeof(r=mh.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:s}=this.opts,n=new Ls.SchemaEnv({schema:{},schemaId:s});if(r=Ls.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=mh.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let s=e[this.opts.schemaId];return s&&(s=(0,js.normalizeId)(s),delete this.schemas[s],delete this.refs[s]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let s;if(typeof e=="string")s=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=s);else if(typeof e=="object"&&r===void 0){if(r=e,s=r.keyword,Array.isArray(s)&&!s.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Jw.call(this,s,r),!r)return(0,qa.eachItem)(s,i=>Aa.call(this,i)),this;Zw.call(this,r);let n={...r,type:(0,si.getJSONTypes)(r.type),schemaType:(0,si.getJSONTypes)(r.schemaType)};return(0,qa.eachItem)(s,n.type.length===0?i=>Aa.call(this,i,n):i=>n.type.forEach(o=>Aa.call(this,i,n,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let s of r.rules){let n=s.rules.findIndex(i=>i.keyword===e);n>=0&&s.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:s="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${s}${n.instancePath} ${n.message}`).reduce((n,i)=>n+r+i)}$dataMetaSchema(e,r){let s=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let i=n.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in s){let c=s[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=o[a];u&&l&&(o[a]=_h(l))}}return e}_removeAllSchemas(e,r){for(let s in e){let n=e[s];(!r||r.test(s))&&(typeof n=="string"?delete e[s]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[s]))}}_addSchema(e,r,s,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;s=(0,js.normalizeId)(o||s);let u=js.getSchemaRefs.call(this,e,s);return c=new Ls.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:s,localRefs:u}),this._cache.set(c.schema,c),i&&!s.startsWith("#")&&(s&&this._checkUnique(s),this.refs[s]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Ls.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Ls.compileSchema.call(this,e)}finally{this.opts=r}}};Ms.ValidationError=qw.default;Ms.MissingRefError=yh.default;ie.default=Ms;function ph(t,e,r,s="error"){for(let n in t){let i=n;i in e&&this.logger[s](`${r}: option ${n}. ${t[i]}`)}}function mh(t){return t=(0,js.normalizeId)(t),this.schemas[t]||this.refs[t]}function zw(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Gw(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Hw(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function Ww(){let t={...this.opts};for(let e of Mw)delete t[e];return t}var Kw={log(){},warn(){},error(){}};function Xw(t){if(t===!1)return Kw;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Yw=/^[a-z_$][a-z0-9_$:-]*$/i;function Jw(t,e){let{RULES:r}=this;if((0,qa.eachItem)(t,s=>{if(r.keywords[s])throw new Error(`Keyword ${s} is already defined`);if(!Yw.test(s))throw new Error(`Keyword ${s} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Aa(t,e,r){var s;let n=e==null?void 0:e.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=n?i.post:i.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},i.rules.push(o)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,si.getJSONTypes)(e.type),schemaType:(0,si.getJSONTypes)(e.schemaType)}};e.before?Qw.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(s=e.implements)===null||s===void 0||s.forEach(c=>this.addKeyword(c))}function Qw(t,e,r){let s=t.rules.findIndex(n=>n.keyword===r);s>=0?t.rules.splice(s,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Zw(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=_h(e)),t.validateSchema=this.compile(e,!0))}var eb={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _h(t){return{anyOf:[t,eb]}}});var vh=p(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var tb={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};La.default=tb});var oi=p(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.callRef=er.getValidate=void 0;var rb=Ir(),Eh=qe(),Te=O(),Dr=Ae(),wh=qs(),ni=A(),sb={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:s}=t,{baseId:n,schemaEnv:i,validateName:o,opts:a,self:c}=s,{root:u}=i;if((r==="#"||r==="#/")&&n===u.baseId)return f();let l=wh.resolveRef.call(c,u,n,r);if(l===void 0)throw new rb.default(s.opts.uriResolver,n,r);if(l instanceof wh.SchemaEnv)return d(l);return h(l);function f(){if(i===u)return ii(t,o,i,i.$async);let y=e.scopeValue("root",{ref:u});return ii(t,(0,Te._)`${y}.validate`,u,u.$async)}function d(y){let m=bh(t,y);ii(t,m,y,y.$async)}function h(y){let m=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Te.stringify)(y)}:{ref:y}),g=e.name("valid"),v=t.subschema({schema:y,dataTypes:[],schemaPath:Te.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(v),t.ok(g)}}};function bh(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Te._)`${r.scopeValue("wrapper",{ref:e})}.validate`}er.getValidate=bh;function ii(t,e,r,s){let{gen:n,it:i}=t,{allErrors:o,schemaEnv:a,opts:c}=i,u=c.passContext?Dr.default.this:Te.nil;s?l():f();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=n.let("valid");n.try(()=>{n.code((0,Te._)`await ${(0,Eh.callValidateCode)(t,e,u)}`),h(e),o||n.assign(y,!0)},m=>{n.if((0,Te._)`!(${m} instanceof ${i.ValidationError})`,()=>n.throw(m)),d(m),o||n.assign(y,!1)}),t.ok(y)}function f(){t.result((0,Eh.callValidateCode)(t,e,u),()=>h(e),()=>d(e))}function d(y){let m=(0,Te._)`${y}.errors`;n.assign(Dr.default.vErrors,(0,Te._)`${Dr.default.vErrors} === null ? ${m} : ${Dr.default.vErrors}.concat(${m})`),n.assign(Dr.default.errors,(0,Te._)`${Dr.default.vErrors}.length`)}function h(y){var m;if(!i.opts.unevaluated)return;let g=(m=r==null?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=ni.mergeEvaluated.props(n,g.props,i.props));else{let v=n.var("props",(0,Te._)`${y}.evaluated.props`);i.props=ni.mergeEvaluated.props(n,v,i.props,Te.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=ni.mergeEvaluated.items(n,g.items,i.items));else{let v=n.var("items",(0,Te._)`${y}.evaluated.items`);i.items=ni.mergeEvaluated.items(n,v,i.items,Te.Name)}}}er.callRef=ii;er.default=sb});var Ma=p(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var nb=vh(),ib=oi(),ob=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",nb.default,ib.default];ja.default=ob});var Sh=p(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var ai=O(),Rt=ai.operators,ci={maximum:{okStr:"<=",ok:Rt.LTE,fail:Rt.GT},minimum:{okStr:">=",ok:Rt.GTE,fail:Rt.LT},exclusiveMaximum:{okStr:"<",ok:Rt.LT,fail:Rt.GTE},exclusiveMinimum:{okStr:">",ok:Rt.GT,fail:Rt.LTE}},ab={message:({keyword:t,schemaCode:e})=>(0,ai.str)`must be ${ci[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ai._)`{comparison: ${ci[t].okStr}, limit: ${e}}`},cb={keyword:Object.keys(ci),type:"number",schemaType:"number",$data:!0,error:ab,code(t){let{keyword:e,data:r,schemaCode:s}=t;t.fail$data((0,ai._)`${r} ${ci[e].fail} ${s} || isNaN(${r})`)}};Fa.default=cb});var $h=p(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});var Fs=O(),ub={message:({schemaCode:t})=>(0,Fs.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Fs._)`{multipleOf: ${t}}`},lb={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ub,code(t){let{gen:e,data:r,schemaCode:s,it:n}=t,i=n.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,Fs._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Fs._)`${o} !== parseInt(${o})`;t.fail$data((0,Fs._)`(${s} === 0 || (${o} = ${r}/${s}, ${a}))`)}};Ua.default=lb});var Ch=p(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});function Th(t){let e=t.length,r=0,s=0,n;for(;s<e;)r++,n=t.charCodeAt(s++),n>=55296&&n<=56319&&s<e&&(n=t.charCodeAt(s),(n&64512)===56320&&s++);return r}Ba.default=Th;Th.code='require("ajv/dist/runtime/ucs2length").default'});var Oh=p(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});var tr=O(),fb=A(),db=Ch(),hb={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,tr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,tr._)`{limit: ${t}}`},pb={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:hb,code(t){let{keyword:e,data:r,schemaCode:s,it:n}=t,i=e==="maxLength"?tr.operators.GT:tr.operators.LT,o=n.opts.unicode===!1?(0,tr._)`${r}.length`:(0,tr._)`${(0,fb.useFunc)(t.gen,db.default)}(${r})`;t.fail$data((0,tr._)`${o} ${i} ${s}`)}};Va.default=pb});var kh=p(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var mb=qe(),yb=A(),Lr=O(),gb={message:({schemaCode:t})=>(0,Lr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Lr._)`{pattern: ${t}}`},_b={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:gb,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:i,it:o}=t,a=o.opts.unicodeRegExp?"u":"";if(s){let{regExp:c}=o.opts.code,u=c.code==="new RegExp"?(0,Lr._)`new RegExp`:(0,yb.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Lr._)`${u}(${i}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Lr._)`!${l}`)}else{let c=(0,mb.usePattern)(t,n);t.fail$data((0,Lr._)`!${c}.test(${r})`)}}};za.default=_b});var xh=p(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});var Us=O(),vb={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Us.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Us._)`{limit: ${t}}`},Eb={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:vb,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e==="maxProperties"?Us.operators.GT:Us.operators.LT;t.fail$data((0,Us._)`Object.keys(${r}).length ${n} ${s}`)}};Ga.default=Eb});var Nh=p(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var Bs=qe(),Vs=O(),wb=A(),bb={message:({params:{missingProperty:t}})=>(0,Vs.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Vs._)`{missingProperty: ${t}}`},Sb={keyword:"required",type:"object",schemaType:"array",$data:!0,error:bb,code(t){let{gen:e,schema:r,schemaCode:s,data:n,$data:i,it:o}=t,{opts:a}=o;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?u():l(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:y}=t.it;for(let m of r)if((h==null?void 0:h[m])===void 0&&!y.has(m)){let g=o.schemaEnv.baseId+o.errSchemaPath,v=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,wb.checkStrictMode)(o,v,o.opts.strictRequired)}}function u(){if(c||i)t.block$data(Vs.nil,f);else for(let h of r)(0,Bs.checkReportMissingProp)(t,h)}function l(){let h=e.let("missing");if(c||i){let y=e.let("valid",!0);t.block$data(y,()=>d(h,y)),t.ok(y)}else e.if((0,Bs.checkMissingProp)(t,r,h)),(0,Bs.reportMissingProp)(t,h),e.else()}function f(){e.forOf("prop",s,h=>{t.setParams({missingProperty:h}),e.if((0,Bs.noPropertyInData)(e,n,h,a.ownProperties),()=>t.error())})}function d(h,y){t.setParams({missingProperty:h}),e.forOf(h,s,()=>{e.assign(y,(0,Bs.propertyInData)(e,n,h,a.ownProperties)),e.if((0,Vs.not)(y),()=>{t.error(),e.break()})},Vs.nil)}}};Ha.default=Sb});var Rh=p(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});var zs=O(),$b={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,zs.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,zs._)`{limit: ${t}}`},Tb={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:$b,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e==="maxItems"?zs.operators.GT:zs.operators.LT;t.fail$data((0,zs._)`${r}.length ${n} ${s}`)}};Wa.default=Tb});var ui=p(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});var Ph=ya();Ph.code='require("ajv/dist/runtime/equal").default';Ka.default=Ph});var Ih=p(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});var Xa=Ns(),oe=O(),Cb=A(),Ob=ui(),kb={message:({params:{i:t,j:e}})=>(0,oe.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,oe._)`{i: ${t}, j: ${e}}`},xb={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:kb,code(t){let{gen:e,data:r,$data:s,schema:n,parentSchema:i,schemaCode:o,it:a}=t;if(!s&&!n)return;let c=e.let("valid"),u=i.items?(0,Xa.getSchemaTypes)(i.items):[];t.block$data(c,l,(0,oe._)`${o} === false`),t.ok(c);function l(){let y=e.let("i",(0,oe._)`${r}.length`),m=e.let("j");t.setParams({i:y,j:m}),e.assign(c,!0),e.if((0,oe._)`${y} > 1`,()=>(f()?d:h)(y,m))}function f(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function d(y,m){let g=e.name("item"),v=(0,Xa.checkDataTypes)(u,g,a.opts.strictNumbers,Xa.DataType.Wrong),$=e.const("indices",(0,oe._)`{}`);e.for((0,oe._)`;${y}--;`,()=>{e.let(g,(0,oe._)`${r}[${y}]`),e.if(v,(0,oe._)`continue`),u.length>1&&e.if((0,oe._)`typeof ${g} == "string"`,(0,oe._)`${g} += "_"`),e.if((0,oe._)`typeof ${$}[${g}] == "number"`,()=>{e.assign(m,(0,oe._)`${$}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,oe._)`${$}[${g}] = ${y}`)})}function h(y,m){let g=(0,Cb.useFunc)(e,Ob.default),v=e.name("outer");e.label(v).for((0,oe._)`;${y}--;`,()=>e.for((0,oe._)`${m} = ${y}; ${m}--;`,()=>e.if((0,oe._)`${g}(${r}[${y}], ${r}[${m}])`,()=>{t.error(),e.assign(c,!1).break(v)})))}}};Ya.default=xb});var Ah=p(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});var Ja=O(),Nb=A(),Rb=ui(),Pb={message:"must be equal to constant",params:({schemaCode:t})=>(0,Ja._)`{allowedValue: ${t}}`},Ib={keyword:"const",$data:!0,error:Pb,code(t){let{gen:e,data:r,$data:s,schemaCode:n,schema:i}=t;s||i&&typeof i=="object"?t.fail$data((0,Ja._)`!${(0,Nb.useFunc)(e,Rb.default)}(${r}, ${n})`):t.fail((0,Ja._)`${i} !== ${r}`)}};Qa.default=Ib});var qh=p(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});var Gs=O(),Ab=A(),qb=ui(),Db={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Gs._)`{allowedValues: ${t}}`},Lb={keyword:"enum",schemaType:"array",$data:!0,error:Db,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:i,it:o}=t;if(!s&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=o.opts.loopEnum,c,u=()=>c??(c=(0,Ab.useFunc)(e,qb.default)),l;if(a||s)l=e.let("valid"),t.block$data(l,f);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let h=e.const("vSchema",i);l=(0,Gs.or)(...n.map((y,m)=>d(h,m)))}t.pass(l);function f(){e.assign(l,!1),e.forOf("v",i,h=>e.if((0,Gs._)`${u()}(${r}, ${h})`,()=>e.assign(l,!0).break()))}function d(h,y){let m=n[y];return typeof m=="object"&&m!==null?(0,Gs._)`${u()}(${r}, ${h}[${y}])`:(0,Gs._)`${r} === ${m}`}}};Za.default=Lb});var tc=p(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var jb=Sh(),Mb=$h(),Fb=Oh(),Ub=kh(),Bb=xh(),Vb=Nh(),zb=Rh(),Gb=Ih(),Hb=Ah(),Wb=qh(),Kb=[jb.default,Mb.default,Fb.default,Ub.default,Bb.default,Vb.default,zb.default,Gb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Hb.default,Wb.default];ec.default=Kb});var sc=p(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.validateAdditionalItems=void 0;var rr=O(),rc=A(),Xb={message:({params:{len:t}})=>(0,rr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,rr._)`{limit: ${t}}`},Yb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Xb,code(t){let{parentSchema:e,it:r}=t,{items:s}=e;if(!Array.isArray(s)){(0,rc.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Dh(t,s)}};function Dh(t,e){let{gen:r,schema:s,data:n,keyword:i,it:o}=t;o.items=!0;let a=r.const("len",(0,rr._)`${n}.length`);if(s===!1)t.setParams({len:e.length}),t.pass((0,rr._)`${a} <= ${e.length}`);else if(typeof s=="object"&&!(0,rc.alwaysValidSchema)(o,s)){let u=r.var("valid",(0,rr._)`${a} <= ${e.length}`);r.if((0,rr.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:rc.Type.Num},u),o.allErrors||r.if((0,rr.not)(u),()=>r.break())})}}Hs.validateAdditionalItems=Dh;Hs.default=Yb});var nc=p(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.validateTuple=void 0;var Lh=O(),li=A(),Jb=qe(),Qb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return jh(t,"additionalItems",e);r.items=!0,!(0,li.alwaysValidSchema)(r,e)&&t.ok((0,Jb.validateArray)(t))}};function jh(t,e,r=t.schema){let{gen:s,parentSchema:n,data:i,keyword:o,it:a}=t;l(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=li.mergeEvaluated.items(s,r.length,a.items));let c=s.name("valid"),u=s.const("len",(0,Lh._)`${i}.length`);r.forEach((f,d)=>{(0,li.alwaysValidSchema)(a,f)||(s.if((0,Lh._)`${u} > ${d}`,()=>t.subschema({keyword:o,schemaProp:d,dataProp:d},c)),t.ok(c))});function l(f){let{opts:d,errSchemaPath:h}=a,y=r.length,m=y===f.minItems&&(y===f.maxItems||f[e]===!1);if(d.strictTuples&&!m){let g=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,li.checkStrictMode)(a,g,d.strictTuples)}}}Ws.validateTuple=jh;Ws.default=Qb});var Mh=p(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var Zb=nc(),eS={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Zb.validateTuple)(t,"items")};ic.default=eS});var Uh=p(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var Fh=O(),tS=A(),rS=qe(),sS=sc(),nS={message:({params:{len:t}})=>(0,Fh.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Fh._)`{limit: ${t}}`},iS={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:nS,code(t){let{schema:e,parentSchema:r,it:s}=t,{prefixItems:n}=r;s.items=!0,!(0,tS.alwaysValidSchema)(s,e)&&(n?(0,sS.validateAdditionalItems)(t,n):t.ok((0,rS.validateArray)(t)))}};oc.default=iS});var Bh=p(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});var Le=O(),fi=A(),oS={message:({params:{min:t,max:e}})=>e===void 0?(0,Le.str)`must contain at least ${t} valid item(s)`:(0,Le.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Le._)`{minContains: ${t}}`:(0,Le._)`{minContains: ${t}, maxContains: ${e}}`},aS={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:oS,code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:i}=t,o,a,{minContains:c,maxContains:u}=s;i.opts.next?(o=c===void 0?1:c,a=u):o=1;let l=e.const("len",(0,Le._)`${n}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,fi.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,fi.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,fi.alwaysValidSchema)(i,r)){let m=(0,Le._)`${l} >= ${o}`;a!==void 0&&(m=(0,Le._)`${m} && ${l} <= ${a}`),t.pass(m);return}i.items=!0;let f=e.name("valid");a===void 0&&o===1?h(f,()=>e.if(f,()=>e.break())):o===0?(e.let(f,!0),a!==void 0&&e.if((0,Le._)`${n}.length > 0`,d)):(e.let(f,!1),d()),t.result(f,()=>t.reset());function d(){let m=e.name("_valid"),g=e.let("count",0);h(m,()=>e.if(m,()=>y(g)))}function h(m,g){e.forRange("i",0,l,v=>{t.subschema({keyword:"contains",dataProp:v,dataPropType:fi.Type.Num,compositeRule:!0},m),g()})}function y(m){e.code((0,Le._)`${m}++`),a===void 0?e.if((0,Le._)`${m} >= ${o}`,()=>e.assign(f,!0).break()):(e.if((0,Le._)`${m} > ${a}`,()=>e.assign(f,!1).break()),o===1?e.assign(f,!0):e.if((0,Le._)`${m} >= ${o}`,()=>e.assign(f,!0)))}}};ac.default=aS});var di=p(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.validateSchemaDeps=st.validatePropertyDeps=st.error=void 0;var cc=O(),cS=A(),Ks=qe();st.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let s=e===1?"property":"properties";return(0,cc.str)`must have ${s} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:s}})=>(0,cc._)`{property: ${t},
missingProperty: ${s},
depsCount: ${e},
deps: ${r}}`};var uS={keyword:"dependencies",type:"object",schemaType:"object",error:st.error,code(t){let[e,r]=lS(t);Vh(t,e),zh(t,r)}};function lS({schema:t}){let e={},r={};for(let s in t){if(s==="__proto__")continue;let n=Array.isArray(t[s])?e:r;n[s]=t[s]}return[e,r]}function Vh(t,e=t.schema){let{gen:r,data:s,it:n}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Ks.propertyInData)(r,s,o,n.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let u of a)(0,Ks.checkReportMissingProp)(t,u)}):(r.if((0,cc._)`${c} && (${(0,Ks.checkMissingProp)(t,a,i)})`),(0,Ks.reportMissingProp)(t,i),r.else())}}st.validatePropertyDeps=Vh;function zh(t,e=t.schema){let{gen:r,data:s,keyword:n,it:i}=t,o=r.name("valid");for(let a in e)(0,cS.alwaysValidSchema)(i,e[a])||(r.if((0,Ks.propertyInData)(r,s,a,i.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}st.validateSchemaDeps=zh;st.default=uS});var Hh=p(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var Gh=O(),fS=A(),dS={message:"property name must be valid",params:({params:t})=>(0,Gh._)`{propertyName: ${t.propertyName}}`},hS={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:dS,code(t){let{gen:e,schema:r,data:s,it:n}=t;if((0,fS.alwaysValidSchema)(n,r))return;let i=e.name("valid");e.forIn("key",s,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,Gh.not)(i),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(i)}};uc.default=hS});var fc=p(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});var hi=qe(),Ke=O(),pS=Ae(),pi=A(),mS={message:"must NOT have additional properties",params:({params:t})=>(0,Ke._)`{additionalProperty: ${t.additionalProperty}}`},yS={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:mS,code(t){let{gen:e,schema:r,parentSchema:s,data:n,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,pi.alwaysValidSchema)(o,r))return;let u=(0,hi.allSchemaProperties)(s.properties),l=(0,hi.allSchemaProperties)(s.patternProperties);f(),t.ok((0,Ke._)`${i} === ${pS.default.errors}`);function f(){e.forIn("key",n,g=>{!u.length&&!l.length?y(g):e.if(d(g),()=>y(g))})}function d(g){let v;if(u.length>8){let $=(0,pi.schemaRefOrVal)(o,s.properties,"properties");v=(0,hi.isOwnProperty)(e,$,g)}else u.length?v=(0,Ke.or)(...u.map($=>(0,Ke._)`${g} === ${$}`)):v=Ke.nil;return l.length&&(v=(0,Ke.or)(v,...l.map($=>(0,Ke._)`${(0,hi.usePattern)(t,$)}.test(${g})`))),(0,Ke.not)(v)}function h(g){e.code((0,Ke._)`delete ${n}[${g}]`)}function y(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){h(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,pi.alwaysValidSchema)(o,r)){let v=e.name("valid");c.removeAdditional==="failing"?(m(g,v,!1),e.if((0,Ke.not)(v),()=>{t.reset(),h(g)})):(m(g,v),a||e.if((0,Ke.not)(v),()=>e.break()))}}function m(g,v,$){let _={keyword:"additionalProperties",dataProp:g,dataPropType:pi.Type.Str};$===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(_,v)}}};lc.default=yS});var Xh=p(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});var gS=Pr(),Wh=qe(),dc=A(),Kh=fc(),_S={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:i}=t;i.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&Kh.default.code(new gS.KeywordCxt(i,Kh.default,"additionalProperties"));let o=(0,Wh.allSchemaProperties)(r);for(let f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=dc.mergeEvaluated.props(e,(0,dc.toHash)(o),i.props));let a=o.filter(f=>!(0,dc.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let c=e.name("valid");for(let f of a)u(f)?l(f):(e.if((0,Wh.propertyInData)(e,n,f,i.opts.ownProperties)),l(f),i.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(f),t.ok(c);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function l(f){t.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};hc.default=_S});var Zh=p(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});var Yh=qe(),mi=O(),Jh=A(),Qh=A(),vS={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:s,parentSchema:n,it:i}=t,{opts:o}=i,a=(0,Yh.allSchemaProperties)(r),c=a.filter(m=>(0,Jh.alwaysValidSchema)(i,r[m]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&n.properties,l=e.name("valid");i.props!==!0&&!(i.props instanceof mi.Name)&&(i.props=(0,Qh.evaluatedPropsToName)(e,i.props));let{props:f}=i;d();function d(){for(let m of a)u&&h(m),i.allErrors?y(m):(e.var(l,!0),y(m),e.if(l))}function h(m){for(let g in u)new RegExp(m).test(g)&&(0,Jh.checkStrictMode)(i,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function y(m){e.forIn("key",s,g=>{e.if((0,mi._)`${(0,Yh.usePattern)(t,m)}.test(${g})`,()=>{let v=c.includes(m);v||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:Qh.Type.Str},l),i.opts.unevaluated&&f!==!0?e.assign((0,mi._)`${f}[${g}]`,!0):!v&&!i.allErrors&&e.if((0,mi.not)(l),()=>e.break())})})}}};pc.default=vS});var ep=p(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});var ES=A(),wS={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:s}=t;if((0,ES.alwaysValidSchema)(s,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};mc.default=wS});var tp=p(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var bS=qe(),SS={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:bS.validateUnion,error:{message:"must match a schema in anyOf"}};yc.default=SS});var rp=p(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var yi=O(),$S=A(),TS={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,yi._)`{passingSchemas: ${t.passing}}`},CS={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:TS,code(t){let{gen:e,schema:r,parentSchema:s,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;let i=r,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(o,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((l,f)=>{let d;(0,$S.alwaysValidSchema)(n,l)?e.var(c,!0):d=t.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c),f>0&&e.if((0,yi._)`${c} && ${o}`).assign(o,!1).assign(a,(0,yi._)`[${a}, ${f}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,f),d&&t.mergeEvaluated(d,yi.Name)})})}}};gc.default=CS});var sp=p(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});var OS=A(),kS={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((i,o)=>{if((0,OS.alwaysValidSchema)(s,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},n);t.ok(n),t.mergeEvaluated(a)})}};_c.default=kS});var op=p(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});var gi=O(),ip=A(),xS={message:({params:t})=>(0,gi.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,gi._)`{failingKeyword: ${t.ifClause}}`},NS={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:xS,code(t){let{gen:e,parentSchema:r,it:s}=t;r.then===void 0&&r.else===void 0&&(0,ip.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let n=np(s,"then"),i=np(s,"else");if(!n&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&i){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else n?e.if(a,u("then")):e.if((0,gi.not)(a),u("else"));t.pass(o,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,f){return()=>{let d=t.subschema({keyword:l},a);e.assign(o,a),t.mergeValidEvaluated(d,o),f?e.assign(f,(0,gi._)`${l}`):t.setParams({ifClause:l})}}}};function np(t,e){let r=t.schema[e];return r!==void 0&&!(0,ip.alwaysValidSchema)(t,r)}vc.default=NS});var ap=p(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});var RS=A(),PS={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,RS.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Ec.default=PS});var bc=p(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var IS=sc(),AS=Mh(),qS=nc(),DS=Uh(),LS=Bh(),jS=di(),MS=Hh(),FS=fc(),US=Xh(),BS=Zh(),VS=ep(),zS=tp(),GS=rp(),HS=sp(),WS=op(),KS=ap();function XS(t=!1){let e=[VS.default,zS.default,GS.default,HS.default,WS.default,KS.default,MS.default,FS.default,jS.default,US.default,BS.default];return t?e.push(AS.default,DS.default):e.push(IS.default,qS.default),e.push(LS.default),e}wc.default=XS});var $c=p(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.dynamicAnchor=void 0;var Sc=O(),YS=Ae(),cp=qs(),JS=oi(),QS={keyword:"$dynamicAnchor",schemaType:"string",code:t=>up(t,t.schema)};function up(t,e){let{gen:r,it:s}=t;s.schemaEnv.root.dynamicAnchors[e]=!0;let n=(0,Sc._)`${YS.default.dynamicAnchors}${(0,Sc.getProperty)(e)}`,i=s.errSchemaPath==="#"?s.validateName:ZS(t);r.if((0,Sc._)`!${n}`,()=>r.assign(n,i))}Xs.dynamicAnchor=up;function ZS(t){let{schemaEnv:e,schema:r,self:s}=t.it,{root:n,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=s.opts,u=new cp.SchemaEnv({schema:r,schemaId:c,root:n,baseId:i,localRefs:o,meta:a});return cp.compileSchema.call(s,u),(0,JS.getValidate)(t,u)}Xs.default=QS});var Tc=p(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.dynamicRef=void 0;var lp=O(),e$=Ae(),fp=oi(),t$={keyword:"$dynamicRef",schemaType:"string",code:t=>dp(t,t.schema)};function dp(t,e){let{gen:r,keyword:s,it:n}=t;if(e[0]!=="#")throw new Error(`"${s}" only supports hash fragment reference`);let i=e.slice(1);if(n.allErrors)o();else{let c=r.let("valid",!1);o(c),t.ok(c)}function o(c){if(n.schemaEnv.root.dynamicAnchors[i]){let u=r.let("_v",(0,lp._)`${e$.default.dynamicAnchors}${(0,lp.getProperty)(i)}`);r.if(u,a(u,c),a(n.validateName,c))}else a(n.validateName,c)()}function a(c,u){return u?()=>r.block(()=>{(0,fp.callRef)(t,c),r.let(u,!0)}):()=>(0,fp.callRef)(t,c)}}Ys.dynamicRef=dp;Ys.default=t$});var hp=p(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});var r$=$c(),s$=A(),n$={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,r$.dynamicAnchor)(t,""):(0,s$.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};Cc.default=n$});var pp=p(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});var i$=Tc(),o$={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,i$.dynamicRef)(t,t.schema)};Oc.default=o$});var mp=p(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var a$=$c(),c$=Tc(),u$=hp(),l$=pp(),f$=[a$.default,c$.default,u$.default,l$.default];kc.default=f$});var gp=p(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});var yp=di(),d$={keyword:"dependentRequired",type:"object",schemaType:"object",error:yp.error,code:t=>(0,yp.validatePropertyDeps)(t)};xc.default=d$});var _p=p(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});var h$=di(),p$={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,h$.validateSchemaDeps)(t)};Nc.default=p$});var vp=p(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});var m$=A(),y$={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,m$.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};Rc.default=y$});var Ep=p(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});var g$=gp(),_$=_p(),v$=vp(),E$=[g$.default,_$.default,v$.default];Pc.default=E$});var bp=p(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});var Pt=O(),wp=A(),w$=Ae(),b$={message:"must NOT have unevaluated properties",params:({params:t})=>(0,Pt._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},S$={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:b$,code(t){let{gen:e,schema:r,data:s,errsCount:n,it:i}=t;if(!n)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof Pt.Name?e.if((0,Pt._)`${a} !== true`,()=>e.forIn("key",s,f=>e.if(u(a,f),()=>c(f)))):a!==!0&&e.forIn("key",s,f=>a===void 0?c(f):e.if(l(a,f),()=>c(f))),i.props=!0,t.ok((0,Pt._)`${n} === ${w$.default.errors}`);function c(f){if(r===!1){t.setParams({unevaluatedProperty:f}),t.error(),o||e.break();return}if(!(0,wp.alwaysValidSchema)(i,r)){let d=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:wp.Type.Str},d),o||e.if((0,Pt.not)(d),()=>e.break())}}function u(f,d){return(0,Pt._)`!${f} || !${f}[${d}]`}function l(f,d){let h=[];for(let y in f)f[y]===!0&&h.push((0,Pt._)`${d} !== ${y}`);return(0,Pt.and)(...h)}}};Ic.default=S$});var $p=p(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});var sr=O(),Sp=A(),$$={message:({params:{len:t}})=>(0,sr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,sr._)`{limit: ${t}}`},T$={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:$$,code(t){let{gen:e,schema:r,data:s,it:n}=t,i=n.items||0;if(i===!0)return;let o=e.const("len",(0,sr._)`${s}.length`);if(r===!1)t.setParams({len:i}),t.fail((0,sr._)`${o} > ${i}`);else if(typeof r=="object"&&!(0,Sp.alwaysValidSchema)(n,r)){let c=e.var("valid",(0,sr._)`${o} <= ${i}`);e.if((0,sr.not)(c),()=>a(c,i)),t.ok(c)}n.items=!0;function a(c,u){e.forRange("i",u,o,l=>{t.subschema({keyword:"unevaluatedItems",dataProp:l,dataPropType:Sp.Type.Num},c),n.allErrors||e.if((0,sr.not)(c),()=>e.break())})}}};Ac.default=T$});var Tp=p(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var C$=bp(),O$=$p(),k$=[C$.default,O$.default];qc.default=k$});var Cp=p(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});var J=O(),x$={message:({schemaCode:t})=>(0,J.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,J._)`{format: ${t}}`},N$={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:x$,code(t,e){let{gen:r,data:s,$data:n,schema:i,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:f}=a;if(!c.validateFormats)return;n?d():h();function d(){let y=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),m=r.const("fDef",(0,J._)`${y}[${o}]`),g=r.let("fType"),v=r.let("format");r.if((0,J._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,J._)`${m}.type || "string"`).assign(v,(0,J._)`${m}.validate`),()=>r.assign(g,(0,J._)`"string"`).assign(v,m)),t.fail$data((0,J.or)($(),_()));function $(){return c.strictSchema===!1?J.nil:(0,J._)`${o} && !${v}`}function _(){let E=l.$async?(0,J._)`(${m}.async ? await ${v}(${s}) : ${v}(${s}))`:(0,J._)`${v}(${s})`,S=(0,J._)`(typeof ${v} == "function" ? ${E} : ${v}.test(${s}))`;return(0,J._)`${v} && ${v} !== true && ${g} === ${e} && !${S}`}}function h(){let y=f.formats[i];if(!y){$();return}if(y===!0)return;let[m,g,v]=_(y);m===e&&t.pass(E());function $(){if(c.strictSchema===!1){f.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function _(S){let F=S instanceof RegExp?(0,J.regexpCode)(S):c.code.formats?(0,J._)`${c.code.formats}${(0,J.getProperty)(i)}`:void 0,z=r.scopeValue("formats",{key:i,ref:S,code:F});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,J._)`${z}.validate`]:["string",S,z]}function E(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!l.$async)throw new Error("async format in sync schema");return(0,J._)`await ${v}(${s})`}return typeof g=="function"?(0,J._)`${v}(${s})`:(0,J._)`${v}.test(${s})`}}}};Dc.default=N$});var jc=p(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});var R$=Cp(),P$=[R$.default];Lc.default=P$});var Mc=p(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.contentVocabulary=jr.metadataVocabulary=void 0;jr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];jr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kp=p(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var I$=Ma(),A$=tc(),q$=bc(),D$=mp(),L$=Ep(),j$=Tp(),M$=jc(),Op=Mc(),F$=[D$.default,I$.default,A$.default,(0,q$.default)(!0),M$.default,Op.metadataVocabulary,Op.contentVocabulary,L$.default,j$.default];Fc.default=F$});var Np=p(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.DiscrError=void 0;var xp;(function(t){t.Tag="tag",t.Mapping="mapping"})(xp||(_i.DiscrError=xp={}))});var Vc=p(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});var Mr=O(),Uc=Np(),Rp=qs(),U$=Ir(),B$=A(),V$={message:({params:{discrError:t,tagName:e}})=>t===Uc.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Mr._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},z$={keyword:"discriminator",type:"object",schemaType:"object",error:V$,code(t){let{gen:e,data:r,schema:s,parentSchema:n,it:i}=t,{oneOf:o}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=s.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,Mr._)`${r}${(0,Mr.getProperty)(a)}`);e.if((0,Mr._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Uc.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let h=d();e.if(!1);for(let y in h)e.elseIf((0,Mr._)`${u} === ${y}`),e.assign(c,f(h[y]));e.else(),t.error(!1,{discrError:Uc.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function f(h){let y=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},y);return t.mergeEvaluated(m,Mr.Name),y}function d(){var h;let y={},m=v(n),g=!0;for(let E=0;E<o.length;E++){let S=o[E];if(S!=null&&S.$ref&&!(0,B$.schemaHasRulesButRef)(S,i.self.RULES)){let z=S.$ref;if(S=Rp.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,z),S instanceof Rp.SchemaEnv&&(S=S.schema),S===void 0)throw new U$.default(i.opts.uriResolver,i.baseId,z)}let F=(h=S==null?void 0:S.properties)===null||h===void 0?void 0:h[a];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||v(S)),$(F,E)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return y;function v({required:E}){return Array.isArray(E)&&E.includes(a)}function $(E,S){if(E.const)_(E.const,S);else if(E.enum)for(let F of E.enum)_(F,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function _(E,S){if(typeof E!="string"||E in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[E]=S}}}};Bc.default=z$});var Pp=p((nI,G$)=>{G$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Ip=p((iI,H$)=>{H$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Ap=p((oI,W$)=>{W$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var qp=p((aI,K$)=>{K$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Dp=p((cI,X$)=>{X$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Lp=p((uI,Y$)=>{Y$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var jp=p((lI,J$)=>{J$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Mp=p((fI,Q$)=>{Q$.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Fp=p(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});var Z$=Pp(),e1=Ip(),t1=Ap(),r1=qp(),s1=Dp(),n1=Lp(),i1=jp(),o1=Mp(),a1=["/properties"];function c1(t){return[Z$,e1,t1,r1,s1,e(this,n1),i1,e(this,o1)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,s){return t?r.$dataMetaSchema(s,a1):s}}zc.default=c1});var Up=p((H,Hc)=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.MissingRefError=H.ValidationError=H.CodeGen=H.Name=H.nil=H.stringify=H.str=H._=H.KeywordCxt=H.Ajv2020=void 0;var u1=Da(),l1=kp(),f1=Vc(),d1=Fp(),Gc="https://json-schema.org/draft/2020-12/schema",Fr=class extends u1.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),l1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(f1.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(d1.default.call(this,e),this.refs["http://json-schema.org/schema"]=Gc)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Gc)?Gc:void 0)}};H.Ajv2020=Fr;Hc.exports=H=Fr;Hc.exports.Ajv2020=Fr;Object.defineProperty(H,"__esModule",{value:!0});H.default=Fr;var h1=Pr();Object.defineProperty(H,"KeywordCxt",{enumerable:!0,get:function(){return h1.KeywordCxt}});var Ur=O();Object.defineProperty(H,"_",{enumerable:!0,get:function(){return Ur._}});Object.defineProperty(H,"str",{enumerable:!0,get:function(){return Ur.str}});Object.defineProperty(H,"stringify",{enumerable:!0,get:function(){return Ur.stringify}});Object.defineProperty(H,"nil",{enumerable:!0,get:function(){return Ur.nil}});Object.defineProperty(H,"Name",{enumerable:!0,get:function(){return Ur.Name}});Object.defineProperty(H,"CodeGen",{enumerable:!0,get:function(){return Ur.CodeGen}});var p1=As();Object.defineProperty(H,"ValidationError",{enumerable:!0,get:function(){return p1.default}});var m1=Ir();Object.defineProperty(H,"MissingRefError",{enumerable:!0,get:function(){return m1.default}})});var Xp=p(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.formatNames=it.fastFormats=it.fullFormats=void 0;function nt(t,e){return{validate:t,compare:e}}it.fullFormats={date:nt(Gp,Yc),time:nt(Kc(!0),Jc),"date-time":nt(Bp(!0),Wp),"iso-time":nt(Kc(),Hp),"iso-date-time":nt(Bp(),Kp),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w1,"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":/^(?:(?:[^\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,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,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:/^(?=.{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,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([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}))|:)))$/i,regex:k1,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b1,int32:{type:"number",validate:T1},int64:{type:"number",validate:C1},float:{type:"number",validate:zp},double:{type:"number",validate:zp},password:!0,binary:!0};it.fastFormats={...it.fullFormats,date:nt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Yc),time:nt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Jc),"date-time":nt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Wp),"iso-time":nt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Hp),"iso-date-time":nt(/^\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,Kp),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,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};it.formatNames=Object.keys(it.fullFormats);function y1(t){return t%4===0&&(t%100!==0||t%400===0)}var g1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,_1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Gp(t){let e=g1.exec(t);if(!e)return!1;let r=+e[1],s=+e[2],n=+e[3];return s>=1&&s<=12&&n>=1&&n<=(s===2&&y1(r)?29:_1[s])}function Yc(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Wc=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Kc(t){return function(r){let s=Wc.exec(r);if(!s)return!1;let n=+s[1],i=+s[2],o=+s[3],a=s[4],c=s[5]==="-"?-1:1,u=+(s[6]||0),l=+(s[7]||0);if(u>23||l>59||t&&!a)return!1;if(n<=23&&i<=59&&o<60)return!0;let f=i-l*c,d=n-u*c-(f<0?1:0);return(d===23||d===-1)&&(f===59||f===-1)&&o<61}}function Jc(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),s=new Date("2020-01-01T"+e).valueOf();if(r&&s)return r-s}function Hp(t,e){if(!(t&&e))return;let r=Wc.exec(t),s=Wc.exec(e);if(r&&s)return t=r[1]+r[2]+r[3],e=s[1]+s[2]+s[3],t>e?1:t<e?-1:0}var Xc=/t|\s/i;function Bp(t){let e=Kc(t);return function(s){let n=s.split(Xc);return n.length===2&&Gp(n[0])&&e(n[1])}}function Wp(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),s=new Date(e).valueOf();if(r&&s)return r-s}function Kp(t,e){if(!(t&&e))return;let[r,s]=t.split(Xc),[n,i]=e.split(Xc),o=Yc(r,n);if(o!==void 0)return o||Jc(s,i)}var v1=/\/|:/,E1=/^(?:[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;function w1(t){return v1.test(t)&&E1.test(t)}var Vp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function b1(t){return Vp.lastIndex=0,Vp.test(t)}var S1=-(2**31),$1=2**31-1;function T1(t){return Number.isInteger(t)&&t<=$1&&t>=S1}function C1(t){return Number.isInteger(t)}function zp(){return!0}var O1=/[^\\]\\Z/;function k1(t){if(O1.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Jp=p(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var x1=Ma(),N1=tc(),R1=bc(),P1=jc(),Yp=Mc(),I1=[x1.default,N1.default,(0,R1.default)(),P1.default,Yp.metadataVocabulary,Yp.contentVocabulary];Qc.default=I1});var Qp=p((mI,A1)=>{A1.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var em=p((W,Zc)=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.MissingRefError=W.ValidationError=W.CodeGen=W.Name=W.nil=W.stringify=W.str=W._=W.KeywordCxt=W.Ajv=void 0;var q1=Da(),D1=Jp(),L1=Vc(),Zp=Qp(),j1=["/properties"],vi="http://json-schema.org/draft-07/schema",Br=class extends q1.default{_addVocabularies(){super._addVocabularies(),D1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(L1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Zp,j1):Zp;this.addMetaSchema(e,vi,!1),this.refs["http://json-schema.org/schema"]=vi}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(vi)?vi:void 0)}};W.Ajv=Br;Zc.exports=W=Br;Zc.exports.Ajv=Br;Object.defineProperty(W,"__esModule",{value:!0});W.default=Br;var M1=Pr();Object.defineProperty(W,"KeywordCxt",{enumerable:!0,get:function(){return M1.KeywordCxt}});var Vr=O();Object.defineProperty(W,"_",{enumerable:!0,get:function(){return Vr._}});Object.defineProperty(W,"str",{enumerable:!0,get:function(){return Vr.str}});Object.defineProperty(W,"stringify",{enumerable:!0,get:function(){return Vr.stringify}});Object.defineProperty(W,"nil",{enumerable:!0,get:function(){return Vr.nil}});Object.defineProperty(W,"Name",{enumerable:!0,get:function(){return Vr.Name}});Object.defineProperty(W,"CodeGen",{enumerable:!0,get:function(){return Vr.CodeGen}});var F1=As();Object.defineProperty(W,"ValidationError",{enumerable:!0,get:function(){return F1.default}});var U1=Ir();Object.defineProperty(W,"MissingRefError",{enumerable:!0,get:function(){return U1.default}})});var tm=p(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.formatLimitDefinition=void 0;var B1=em(),Xe=O(),It=Xe.operators,Ei={formatMaximum:{okStr:"<=",ok:It.LTE,fail:It.GT},formatMinimum:{okStr:">=",ok:It.GTE,fail:It.LT},formatExclusiveMaximum:{okStr:"<",ok:It.LT,fail:It.GTE},formatExclusiveMinimum:{okStr:">",ok:It.GT,fail:It.LTE}},V1={message:({keyword:t,schemaCode:e})=>(0,Xe.str)`should be ${Ei[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Xe._)`{comparison: ${Ei[t].okStr}, limit: ${e}}`};zr.formatLimitDefinition={keyword:Object.keys(Ei),type:"string",schemaType:"string",$data:!0,error:V1,code(t){let{gen:e,data:r,schemaCode:s,keyword:n,it:i}=t,{opts:o,self:a}=i;if(!o.validateFormats)return;let c=new B1.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let d=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),h=e.const("fmt",(0,Xe._)`${d}[${c.schemaCode}]`);t.fail$data((0,Xe.or)((0,Xe._)`typeof ${h} != "object"`,(0,Xe._)`${h} instanceof RegExp`,(0,Xe._)`typeof ${h}.compare != "function"`,f(h)))}function l(){let d=c.schema,h=a.formats[d];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${n}": format "${d}" does not define "compare" function`);let y=e.scopeValue("formats",{key:d,ref:h,code:o.code.formats?(0,Xe._)`${o.code.formats}${(0,Xe.getProperty)(d)}`:void 0});t.fail$data(f(y))}function f(d){return(0,Xe._)`${d}.compare(${r}, ${s}) ${Ei[n].fail} 0`}},dependencies:["format"]};var z1=t=>(t.addKeyword(zr.formatLimitDefinition),t);zr.default=z1});var im=p((Js,nm)=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});var Gr=Xp(),G1=tm(),eu=O(),rm=new eu.Name("fullFormats"),H1=new eu.Name("fastFormats"),tu=(t,e={keywords:!0})=>{if(Array.isArray(e))return sm(t,e,Gr.fullFormats,rm),t;let[r,s]=e.mode==="fast"?[Gr.fastFormats,H1]:[Gr.fullFormats,rm],n=e.formats||Gr.formatNames;return sm(t,n,r,s),e.keywords&&(0,G1.default)(t),t};tu.get=(t,e="full")=>{let s=(e==="fast"?Gr.fastFormats:Gr.fullFormats)[t];if(!s)throw new Error(`Unknown format "${t}"`);return s};function sm(t,e,r,s){var n,i;(n=(i=t.opts.code).formats)!==null&&n!==void 0||(i.formats=(0,eu._)`require("ajv-formats/dist/formats").${s}`);for(let o of e)t.addFormat(o,r[o])}nm.exports=Js=tu;Object.defineProperty(Js,"__esModule",{value:!0});Js.default=tu});var Qs=p((EI,om)=>{"use strict";var tT="2.0.0",rT=Number.MAX_SAFE_INTEGER||9007199254740991,sT=16,nT=250,iT=["major","premajor","minor","preminor","patch","prepatch","prerelease"];om.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:sT,MAX_SAFE_BUILD_LENGTH:nT,MAX_SAFE_INTEGER:rT,RELEASE_TYPES:iT,SEMVER_SPEC_VERSION:tT,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Zs=p((wI,am)=>{"use strict";var oT=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};am.exports=oT});var Hr=p((ot,cm)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:nu,MAX_SAFE_BUILD_LENGTH:aT,MAX_LENGTH:cT}=Qs(),uT=Zs();ot=cm.exports={};var lT=ot.re=[],fT=ot.safeRe=[],w=ot.src=[],dT=ot.safeSrc=[],b=ot.t={},hT=0,iu="[a-zA-Z0-9-]",pT=[["\\s",1],["\\d",cT],[iu,aT]],mT=t=>{for(let[e,r]of pT)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},x=(t,e,r)=>{let s=mT(e),n=hT++;uT(t,n,e),b[t]=n,w[n]=e,dT[n]=s,lT[n]=new RegExp(e,r?"g":void 0),fT[n]=new RegExp(s,r?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*");x("NUMERICIDENTIFIERLOOSE","\\d+");x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${iu}*`);x("MAINVERSION",`(${w[b.NUMERICIDENTIFIER]})\\.(${w[b.NUMERICIDENTIFIER]})\\.(${w[b.NUMERICIDENTIFIER]})`);x("MAINVERSIONLOOSE",`(${w[b.NUMERICIDENTIFIERLOOSE]})\\.(${w[b.NUMERICIDENTIFIERLOOSE]})\\.(${w[b.NUMERICIDENTIFIERLOOSE]})`);x("PRERELEASEIDENTIFIER",`(?:${w[b.NONNUMERICIDENTIFIER]}|${w[b.NUMERICIDENTIFIER]})`);x("PRERELEASEIDENTIFIERLOOSE",`(?:${w[b.NONNUMERICIDENTIFIER]}|${w[b.NUMERICIDENTIFIERLOOSE]})`);x("PRERELEASE",`(?:-(${w[b.PRERELEASEIDENTIFIER]}(?:\\.${w[b.PRERELEASEIDENTIFIER]})*))`);x("PRERELEASELOOSE",`(?:-?(${w[b.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${w[b.PRERELEASEIDENTIFIERLOOSE]})*))`);x("BUILDIDENTIFIER",`${iu}+`);x("BUILD",`(?:\\+(${w[b.BUILDIDENTIFIER]}(?:\\.${w[b.BUILDIDENTIFIER]})*))`);x("FULLPLAIN",`v?${w[b.MAINVERSION]}${w[b.PRERELEASE]}?${w[b.BUILD]}?`);x("FULL",`^${w[b.FULLPLAIN]}$`);x("LOOSEPLAIN",`[v=\\s]*${w[b.MAINVERSIONLOOSE]}${w[b.PRERELEASELOOSE]}?${w[b.BUILD]}?`);x("LOOSE",`^${w[b.LOOSEPLAIN]}$`);x("GTLT","((?:<|>)?=?)");x("XRANGEIDENTIFIERLOOSE",`${w[b.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);x("XRANGEIDENTIFIER",`${w[b.NUMERICIDENTIFIER]}|x|X|\\*`);x("XRANGEPLAIN",`[v=\\s]*(${w[b.XRANGEIDENTIFIER]})(?:\\.(${w[b.XRANGEIDENTIFIER]})(?:\\.(${w[b.XRANGEIDENTIFIER]})(?:${w[b.PRERELEASE]})?${w[b.BUILD]}?)?)?`);x("XRANGEPLAINLOOSE",`[v=\\s]*(${w[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${w[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${w[b.XRANGEIDENTIFIERLOOSE]})(?:${w[b.PRERELEASELOOSE]})?${w[b.BUILD]}?)?)?`);x("XRANGE",`^${w[b.GTLT]}\\s*${w[b.XRANGEPLAIN]}$`);x("XRANGELOOSE",`^${w[b.GTLT]}\\s*${w[b.XRANGEPLAINLOOSE]}$`);x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${nu}})(?:\\.(\\d{1,${nu}}))?(?:\\.(\\d{1,${nu}}))?`);x("COERCE",`${w[b.COERCEPLAIN]}(?:$|[^\\d])`);x("COERCEFULL",w[b.COERCEPLAIN]+`(?:${w[b.PRERELEASE]})?(?:${w[b.BUILD]})?(?:$|[^\\d])`);x("COERCERTL",w[b.COERCE],!0);x("COERCERTLFULL",w[b.COERCEFULL],!0);x("LONETILDE","(?:~>?)");x("TILDETRIM",`(\\s*)${w[b.LONETILDE]}\\s+`,!0);ot.tildeTrimReplace="$1~";x("TILDE",`^${w[b.LONETILDE]}${w[b.XRANGEPLAIN]}$`);x("TILDELOOSE",`^${w[b.LONETILDE]}${w[b.XRANGEPLAINLOOSE]}$`);x("LONECARET","(?:\\^)");x("CARETTRIM",`(\\s*)${w[b.LONECARET]}\\s+`,!0);ot.caretTrimReplace="$1^";x("CARET",`^${w[b.LONECARET]}${w[b.XRANGEPLAIN]}$`);x("CARETLOOSE",`^${w[b.LONECARET]}${w[b.XRANGEPLAINLOOSE]}$`);x("COMPARATORLOOSE",`^${w[b.GTLT]}\\s*(${w[b.LOOSEPLAIN]})$|^$`);x("COMPARATOR",`^${w[b.GTLT]}\\s*(${w[b.FULLPLAIN]})$|^$`);x("COMPARATORTRIM",`(\\s*)${w[b.GTLT]}\\s*(${w[b.LOOSEPLAIN]}|${w[b.XRANGEPLAIN]})`,!0);ot.comparatorTrimReplace="$1$2$3";x("HYPHENRANGE",`^\\s*(${w[b.XRANGEPLAIN]})\\s+-\\s+(${w[b.XRANGEPLAIN]})\\s*$`);x("HYPHENRANGELOOSE",`^\\s*(${w[b.XRANGEPLAINLOOSE]})\\s+-\\s+(${w[b.XRANGEPLAINLOOSE]})\\s*$`);x("STAR","(<|>)?=?\\s*\\*");x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var wi=p((bI,um)=>{"use strict";var yT=Object.freeze({loose:!0}),gT=Object.freeze({}),_T=t=>t?typeof t!="object"?yT:t:gT;um.exports=_T});var ou=p((SI,dm)=>{"use strict";var lm=/^[0-9]+$/,fm=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=lm.test(t),s=lm.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:t<e?-1:1},vT=(t,e)=>fm(e,t);dm.exports={compareIdentifiers:fm,rcompareIdentifiers:vT}});var fe=p(($I,pm)=>{"use strict";var bi=Zs(),{MAX_LENGTH:hm,MAX_SAFE_INTEGER:Si}=Qs(),{safeRe:$i,t:Ti}=Hr(),ET=wi(),{compareIdentifiers:au}=ou(),cu=class t{constructor(e,r){if(r=ET(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>hm)throw new TypeError(`version is longer than ${hm} characters`);bi("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?$i[Ti.LOOSE]:$i[Ti.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Si||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Si||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Si||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Si)return i}return n}):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(bi("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let s=this.prerelease[r],n=e.prerelease[r];if(bi("prerelease compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return au(s,n)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let s=this.build[r],n=e.build[r];if(bi("build compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return au(s,n)}while(++r)}inc(e,r,s){if(e.startsWith("pre")){if(!r&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?$i[Ti.PRERELEASELOOSE]:$i[Ti.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,s),this.inc("pre",r,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,s),this.inc("pre",r,s);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let n=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let i=[r,n];s===!1&&(i=[r]),au(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};pm.exports=cu});var nr=p((TI,ym)=>{"use strict";var mm=fe(),wT=(t,e,r=!1)=>{if(t instanceof mm)return t;try{return new mm(t,e)}catch(s){if(!r)return null;throw s}};ym.exports=wT});var _m=p((CI,gm)=>{"use strict";var bT=nr(),ST=(t,e)=>{let r=bT(t,e);return r?r.version:null};gm.exports=ST});var Em=p((OI,vm)=>{"use strict";var $T=nr(),TT=(t,e)=>{let r=$T(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};vm.exports=TT});var Sm=p((kI,bm)=>{"use strict";var wm=fe(),CT=(t,e,r,s,n)=>{typeof r=="string"&&(n=s,s=r,r=void 0);try{return new wm(t instanceof wm?t.version:t,r).inc(e,s,n).version}catch{return null}};bm.exports=CT});var Cm=p((xI,Tm)=>{"use strict";var $m=nr(),OT=(t,e)=>{let r=$m(t,null,!0),s=$m(e,null,!0),n=r.compare(s);if(n===0)return null;let i=n>0,o=i?r:s,a=i?s:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==s.major?l+"major":r.minor!==s.minor?l+"minor":r.patch!==s.patch?l+"patch":"prerelease"};Tm.exports=OT});var km=p((NI,Om)=>{"use strict";var kT=fe(),xT=(t,e)=>new kT(t,e).major;Om.exports=xT});var Nm=p((RI,xm)=>{"use strict";var NT=fe(),RT=(t,e)=>new NT(t,e).minor;xm.exports=RT});var Pm=p((PI,Rm)=>{"use strict";var PT=fe(),IT=(t,e)=>new PT(t,e).patch;Rm.exports=IT});var Am=p((II,Im)=>{"use strict";var AT=nr(),qT=(t,e)=>{let r=AT(t,e);return r&&r.prerelease.length?r.prerelease:null};Im.exports=qT});var je=p((AI,Dm)=>{"use strict";var qm=fe(),DT=(t,e,r)=>new qm(t,r).compare(new qm(e,r));Dm.exports=DT});var jm=p((qI,Lm)=>{"use strict";var LT=je(),jT=(t,e,r)=>LT(e,t,r);Lm.exports=jT});var Fm=p((DI,Mm)=>{"use strict";var MT=je(),FT=(t,e)=>MT(t,e,!0);Mm.exports=FT});var Ci=p((LI,Bm)=>{"use strict";var Um=fe(),UT=(t,e,r)=>{let s=new Um(t,r),n=new Um(e,r);return s.compare(n)||s.compareBuild(n)};Bm.exports=UT});var zm=p((jI,Vm)=>{"use strict";var BT=Ci(),VT=(t,e)=>t.sort((r,s)=>BT(r,s,e));Vm.exports=VT});var Hm=p((MI,Gm)=>{"use strict";var zT=Ci(),GT=(t,e)=>t.sort((r,s)=>zT(s,r,e));Gm.exports=GT});var en=p((FI,Wm)=>{"use strict";var HT=je(),WT=(t,e,r)=>HT(t,e,r)>0;Wm.exports=WT});var Oi=p((UI,Km)=>{"use strict";var KT=je(),XT=(t,e,r)=>KT(t,e,r)<0;Km.exports=XT});var uu=p((BI,Xm)=>{"use strict";var YT=je(),JT=(t,e,r)=>YT(t,e,r)===0;Xm.exports=JT});var lu=p((VI,Ym)=>{"use strict";var QT=je(),ZT=(t,e,r)=>QT(t,e,r)!==0;Ym.exports=ZT});var ki=p((zI,Jm)=>{"use strict";var eC=je(),tC=(t,e,r)=>eC(t,e,r)>=0;Jm.exports=tC});var xi=p((GI,Qm)=>{"use strict";var rC=je(),sC=(t,e,r)=>rC(t,e,r)<=0;Qm.exports=sC});var fu=p((HI,Zm)=>{"use strict";var nC=uu(),iC=lu(),oC=en(),aC=ki(),cC=Oi(),uC=xi(),lC=(t,e,r,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return nC(t,r,s);case"!=":return iC(t,r,s);case">":return oC(t,r,s);case">=":return aC(t,r,s);case"<":return cC(t,r,s);case"<=":return uC(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};Zm.exports=lC});var ty=p((WI,ey)=>{"use strict";var fC=fe(),dC=nr(),{safeRe:Ni,t:Ri}=Hr(),hC=(t,e)=>{if(t instanceof fC)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Ni[Ri.COERCEFULL]:Ni[Ri.COERCE]);else{let c=e.includePrerelease?Ni[Ri.COERCERTLFULL]:Ni[Ri.COERCERTL],u;for(;(u=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let s=r[2],n=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return dC(`${s}.${n}.${i}${o}${a}`,e)};ey.exports=hC});var sy=p((KI,ry)=>{"use strict";var du=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,r)}return this}};ry.exports=du});var Me=p((XI,ay)=>{"use strict";var pC=/\s+/g,hu=class t{constructor(e,r){if(r=yC(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof pu)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(pC," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!iy(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&SC(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let s=0;s<r.length;s++)s>0&&(this.formatted+=" "),this.formatted+=r[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let s=((this.options.includePrerelease&&wC)|(this.options.loose&&bC))+":"+e,n=ny.get(s);if(n)return n;let i=this.options.loose,o=i?_e[de.HYPHENRANGELOOSE]:_e[de.HYPHENRANGE];e=e.replace(o,IC(this.options.includePrerelease)),K("hyphen replace",e),e=e.replace(_e[de.COMPARATORTRIM],_C),K("comparator trim",e),e=e.replace(_e[de.TILDETRIM],vC),K("tilde trim",e),e=e.replace(_e[de.CARETTRIM],EC),K("caret trim",e);let a=e.split(" ").map(f=>$C(f,this.options)).join(" ").split(/\s+/).map(f=>PC(f,this.options));i&&(a=a.filter(f=>(K("loose invalid filter",f,this.options),!!f.match(_e[de.COMPARATORLOOSE])))),K("range list",a);let c=new Map,u=a.map(f=>new pu(f,this.options));for(let f of u){if(iy(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return ny.set(s,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(s=>oy(s,r)&&e.set.some(n=>oy(n,r)&&s.every(i=>n.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new gC(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(AC(this.set[r],e,this.options))return!0;return!1}};ay.exports=hu;var mC=sy(),ny=new mC,yC=wi(),pu=tn(),K=Zs(),gC=fe(),{safeRe:_e,t:de,comparatorTrimReplace:_C,tildeTrimReplace:vC,caretTrimReplace:EC}=Hr(),{FLAG_INCLUDE_PRERELEASE:wC,FLAG_LOOSE:bC}=Qs(),iy=t=>t.value==="<0.0.0-0",SC=t=>t.value==="",oy=(t,e)=>{let r=!0,s=t.slice(),n=s.pop();for(;r&&s.length;)r=s.every(i=>n.intersects(i,e)),n=s.pop();return r},$C=(t,e)=>(t=t.replace(_e[de.BUILD],""),K("comp",t,e),t=OC(t,e),K("caret",t),t=TC(t,e),K("tildes",t),t=xC(t,e),K("xrange",t),t=RC(t,e),K("stars",t),t),ve=t=>!t||t.toLowerCase()==="x"||t==="*",TC=(t,e)=>t.trim().split(/\s+/).map(r=>CC(r,e)).join(" "),CC=(t,e)=>{let r=e.loose?_e[de.TILDELOOSE]:_e[de.TILDE];return t.replace(r,(s,n,i,o,a)=>{K("tilde",t,s,n,i,o,a);let c;return ve(n)?c="":ve(i)?c=`>=${n}.0.0 <${+n+1}.0.0-0`:ve(o)?c=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:a?(K("replaceTilde pr",a),c=`>=${n}.${i}.${o}-${a} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`,K("tilde return",c),c})},OC=(t,e)=>t.trim().split(/\s+/).map(r=>kC(r,e)).join(" "),kC=(t,e)=>{K("caret",t,e);let r=e.loose?_e[de.CARETLOOSE]:_e[de.CARET],s=e.includePrerelease?"-0":"";return t.replace(r,(n,i,o,a,c)=>{K("caret",t,n,i,o,a,c);let u;return ve(i)?u="":ve(o)?u=`>=${i}.0.0${s} <${+i+1}.0.0-0`:ve(a)?i==="0"?u=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${s} <${+i+1}.0.0-0`:c?(K("replaceCaret pr",c),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${c} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${c} <${+i+1}.0.0-0`):(K("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${s} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${s} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),K("caret return",u),u})},xC=(t,e)=>(K("replaceXRanges",t,e),t.split(/\s+/).map(r=>NC(r,e)).join(" ")),NC=(t,e)=>{t=t.trim();let r=e.loose?_e[de.XRANGELOOSE]:_e[de.XRANGE];return t.replace(r,(s,n,i,o,a,c)=>{K("xRange",t,s,n,i,o,a,c);let u=ve(i),l=u||ve(o),f=l||ve(a),d=f;return n==="="&&d&&(n=""),c=e.includePrerelease?"-0":"",u?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&d?(l&&(o=0),a=0,n===">"?(n=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",l?i=+i+1:o=+o+1),n==="<"&&(c="-0"),s=`${n+i}.${o}.${a}${c}`):l?s=`>=${i}.0.0${c} <${+i+1}.0.0-0`:f&&(s=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),K("xRange return",s),s})},RC=(t,e)=>(K("replaceStars",t,e),t.trim().replace(_e[de.STAR],"")),PC=(t,e)=>(K("replaceGTE0",t,e),t.trim().replace(_e[e.includePrerelease?de.GTE0PRE:de.GTE0],"")),IC=t=>(e,r,s,n,i,o,a,c,u,l,f,d)=>(ve(s)?r="":ve(n)?r=`>=${s}.0.0${t?"-0":""}`:ve(i)?r=`>=${s}.${n}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ve(u)?c="":ve(l)?c=`<${+u+1}.0.0-0`:ve(f)?c=`<${u}.${+l+1}.0-0`:d?c=`<=${u}.${l}.${f}-${d}`:t?c=`<${u}.${l}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),AC=(t,e,r)=>{for(let s=0;s<t.length;s++)if(!t[s].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let s=0;s<t.length;s++)if(K(t[s].semver),t[s].semver!==pu.ANY&&t[s].semver.prerelease.length>0){let n=t[s].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var tn=p((YI,hy)=>{"use strict";var rn=Symbol("SemVer ANY"),gu=class t{static get ANY(){return rn}constructor(e,r){if(r=cy(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),yu("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===rn?this.value="":this.value=this.operator+this.semver.version,yu("comp",this)}parse(e){let r=this.options.loose?uy[ly.COMPARATORLOOSE]:uy[ly.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new fy(s[2],this.options.loose):this.semver=rn}toString(){return this.value}test(e){if(yu("Comparator.test",e,this.options.loose),this.semver===rn||e===rn)return!0;if(typeof e=="string")try{e=new fy(e,this.options)}catch{return!1}return mu(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new dy(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new dy(this.value,r).test(e.semver):(r=cy(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||mu(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||mu(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};hy.exports=gu;var cy=wi(),{safeRe:uy,t:ly}=Hr(),mu=fu(),yu=Zs(),fy=fe(),dy=Me()});var sn=p((JI,py)=>{"use strict";var qC=Me(),DC=(t,e,r)=>{try{e=new qC(e,r)}catch{return!1}return e.test(t)};py.exports=DC});var yy=p((QI,my)=>{"use strict";var LC=Me(),jC=(t,e)=>new LC(t,e).set.map(r=>r.map(s=>s.value).join(" ").trim().split(" "));my.exports=jC});var _y=p((ZI,gy)=>{"use strict";var MC=fe(),FC=Me(),UC=(t,e,r)=>{let s=null,n=null,i=null;try{i=new FC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!s||n.compare(o)===-1)&&(s=o,n=new MC(s,r))}),s};gy.exports=UC});var Ey=p((eA,vy)=>{"use strict";var BC=fe(),VC=Me(),zC=(t,e,r)=>{let s=null,n=null,i=null;try{i=new VC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!s||n.compare(o)===1)&&(s=o,n=new BC(s,r))}),s};vy.exports=zC});var Sy=p((tA,by)=>{"use strict";var _u=fe(),GC=Me(),wy=en(),HC=(t,e)=>{t=new GC(t,e);let r=new _u("0.0.0");if(t.test(r)||(r=new _u("0.0.0-0"),t.test(r)))return r;r=null;for(let s=0;s<t.set.length;++s){let n=t.set[s],i=null;n.forEach(o=>{let a=new _u(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||wy(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||wy(r,i))&&(r=i)}return r&&t.test(r)?r:null};by.exports=HC});var Ty=p((rA,$y)=>{"use strict";var WC=Me(),KC=(t,e)=>{try{return new WC(t,e).range||"*"}catch{return null}};$y.exports=KC});var Pi=p((sA,xy)=>{"use strict";var XC=fe(),ky=tn(),{ANY:YC}=ky,JC=Me(),QC=sn(),Cy=en(),Oy=Oi(),ZC=xi(),eO=ki(),tO=(t,e,r,s)=>{t=new XC(t,s),e=new JC(e,s);let n,i,o,a,c;switch(r){case">":n=Cy,i=ZC,o=Oy,a=">",c=">=";break;case"<":n=Oy,i=eO,o=Cy,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(QC(t,e,s))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],f=null,d=null;if(l.forEach(h=>{h.semver===YC&&(h=new ky(">=0.0.0")),f=f||h,d=d||h,n(h.semver,f.semver,s)?f=h:o(h.semver,d.semver,s)&&(d=h)}),f.operator===a||f.operator===c||(!d.operator||d.operator===a)&&i(t,d.semver))return!1;if(d.operator===c&&o(t,d.semver))return!1}return!0};xy.exports=tO});var Ry=p((nA,Ny)=>{"use strict";var rO=Pi(),sO=(t,e,r)=>rO(t,e,">",r);Ny.exports=sO});var Iy=p((iA,Py)=>{"use strict";var nO=Pi(),iO=(t,e,r)=>nO(t,e,"<",r);Py.exports=iO});var Dy=p((oA,qy)=>{"use strict";var Ay=Me(),oO=(t,e,r)=>(t=new Ay(t,r),e=new Ay(e,r),t.intersects(e,r));qy.exports=oO});var jy=p((aA,Ly)=>{"use strict";var aO=sn(),cO=je();Ly.exports=(t,e,r)=>{let s=[],n=null,i=null,o=t.sort((l,f)=>cO(l,f,r));for(let l of o)aO(l,e,r)?(i=l,n||(n=l)):(i&&s.push([n,i]),i=null,n=null);n&&s.push([n,null]);let a=[];for(let[l,f]of s)l===f?a.push(l):!f&&l===o[0]?a.push("*"):f?l===o[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var zy=p((cA,Vy)=>{"use strict";var My=Me(),Eu=tn(),{ANY:vu}=Eu,nn=sn(),wu=je(),uO=(t,e,r={})=>{if(t===e)return!0;t=new My(t,r),e=new My(e,r);let s=!1;e:for(let n of t.set){for(let i of e.set){let o=fO(n,i,r);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},lO=[new Eu(">=0.0.0-0")],Fy=[new Eu(">=0.0.0")],fO=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===vu){if(e.length===1&&e[0].semver===vu)return!0;r.includePrerelease?t=lO:t=Fy}if(e.length===1&&e[0].semver===vu){if(r.includePrerelease)return!0;e=Fy}let s=new Set,n,i;for(let h of t)h.operator===">"||h.operator===">="?n=Uy(n,h,r):h.operator==="<"||h.operator==="<="?i=By(i,h,r):s.add(h.semver);if(s.size>1)return null;let o;if(n&&i){if(o=wu(n.semver,i.semver,r),o>0)return null;if(o===0&&(n.operator!==">="||i.operator!=="<="))return null}for(let h of s){if(n&&!nn(h,String(n),r)||i&&!nn(h,String(i),r))return null;for(let y of e)if(!nn(h,String(y),r))return!1;return!0}let a,c,u,l,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,d=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;f&&f.prerelease.length===1&&i.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(l=l||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",n){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator===">"||h.operator===">="){if(a=Uy(n,h,r),a===h&&a!==n)return!1}else if(n.operator===">="&&!nn(n.semver,String(h),r))return!1}if(i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator==="<"||h.operator==="<="){if(c=By(i,h,r),c===h&&c!==i)return!1}else if(i.operator==="<="&&!nn(i.semver,String(h),r))return!1}if(!h.operator&&(i||n)&&o!==0)return!1}return!(n&&u&&!i&&o!==0||i&&l&&!n&&o!==0||d||f)},Uy=(t,e,r)=>{if(!t)return e;let s=wu(t.semver,e.semver,r);return s>0?t:s<0||e.operator===">"&&t.operator===">="?e:t},By=(t,e,r)=>{if(!t)return e;let s=wu(t.semver,e.semver,r);return s<0?t:s>0||e.operator==="<"&&t.operator==="<="?e:t};Vy.exports=uO});var Ky=p((uA,Wy)=>{"use strict";var bu=Hr(),Gy=Qs(),dO=fe(),Hy=ou(),hO=nr(),pO=_m(),mO=Em(),yO=Sm(),gO=Cm(),_O=km(),vO=Nm(),EO=Pm(),wO=Am(),bO=je(),SO=jm(),$O=Fm(),TO=Ci(),CO=zm(),OO=Hm(),kO=en(),xO=Oi(),NO=uu(),RO=lu(),PO=ki(),IO=xi(),AO=fu(),qO=ty(),DO=tn(),LO=Me(),jO=sn(),MO=yy(),FO=_y(),UO=Ey(),BO=Sy(),VO=Ty(),zO=Pi(),GO=Ry(),HO=Iy(),WO=Dy(),KO=jy(),XO=zy();Wy.exports={parse:hO,valid:pO,clean:mO,inc:yO,diff:gO,major:_O,minor:vO,patch:EO,prerelease:wO,compare:bO,rcompare:SO,compareLoose:$O,compareBuild:TO,sort:CO,rsort:OO,gt:kO,lt:xO,eq:NO,neq:RO,gte:PO,lte:IO,cmp:AO,coerce:qO,Comparator:DO,Range:LO,satisfies:jO,toComparators:MO,maxSatisfying:FO,minSatisfying:UO,minVersion:BO,validRange:VO,outside:zO,gtr:GO,ltr:HO,intersects:WO,simplifyRange:KO,subset:XO,SemVer:dO,re:bu.re,src:bu.src,tokens:bu.t,SEMVER_SPEC_VERSION:Gy.SEMVER_SPEC_VERSION,RELEASE_TYPES:Gy.RELEASE_TYPES,compareIdentifiers:Hy.compareIdentifiers,rcompareIdentifiers:Hy.rcompareIdentifiers}});var kk={};xu(kk,{default:()=>on});module.exports=mg(kk);var Wi=k(Iu(),1);var Ue=Object.create(null);Ue.open="0";Ue.close="1";Ue.ping="2";Ue.pong="3";Ue.message="4";Ue.upgrade="5";Ue.noop="6";var Zr=Object.create(null);Object.keys(Ue).forEach(t=>{Zr[Ue[t]]=t});var es={type:"error",data:"parser error"};var ts=({type:t,data:e},r,s)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?s(r?e:"b"+Au(e,!0).toString("base64")):s(Ue[t]+(e||"")),Au=(t,e)=>Buffer.isBuffer(t)||t instanceof Uint8Array&&!e?t:t instanceof ArrayBuffer?Buffer.from(t):Buffer.from(t.buffer,t.byteOffset,t.byteLength),Fi;function qu(t,e){if(t.data instanceof ArrayBuffer||ArrayBuffer.isView(t.data))return e(Au(t.data,!1));ts(t,!0,r=>{Fi||(Fi=new TextEncoder),e(Fi.encode(r))})}var rs=(t,e)=>{if(typeof t!="string")return{type:"message",data:Du(t,e)};let r=t.charAt(0);if(r==="b"){let s=Buffer.from(t.substring(1),"base64");return{type:"message",data:Du(s,e)}}return Zr[r]?t.length>1?{type:Zr[r],data:t.substring(1)}:{type:Zr[r]}:es},Du=(t,e)=>{switch(e){case"arraybuffer":return t instanceof ArrayBuffer?t:Buffer.isBuffer(t)?t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):t.buffer;case"nodebuffer":default:return Buffer.isBuffer(t)?t:Buffer.from(t)}};var Lu="",ju=(t,e)=>{let r=t.length,s=new Array(r),n=0;t.forEach((i,o)=>{ts(i,!1,a=>{s[o]=a,++n===r&&e(s.join(Lu))})})},Mu=(t,e)=>{let r=t.split(Lu),s=[];for(let n=0;n<r.length;n++){let i=rs(r[n],e);if(s.push(i),i.type==="error")break}return s};function Fu(){return new TransformStream({transform(t,e){qu(t,r=>{let s=r.length,n;if(s<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,s);else if(s<65536){n=new Uint8Array(3);let i=new DataView(n.buffer);i.setUint8(0,126),i.setUint16(1,s)}else{n=new Uint8Array(9);let i=new DataView(n.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(s))}t.data&&typeof t.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(r)})}})}var Ui;function ln(t){return t.reduce((e,r)=>e+r.length,0)}function fn(t,e){if(t[0].length===e)return t.shift();let r=new Uint8Array(e),s=0;for(let n=0;n<e;n++)r[n]=t[0][s++],s===t[0].length&&(t.shift(),s=0);return t.length&&s<t[0].length&&(t[0]=t[0].slice(s)),r}function Uu(t,e){Ui||(Ui=new TextDecoder);let r=[],s=0,n=-1,i=!1;return new TransformStream({transform(o,a){for(r.push(o);;){if(s===0){if(ln(r)<1)break;let c=fn(r,1);i=(c[0]&128)===128,n=c[0]&127,n<126?s=3:n===126?s=1:s=2}else if(s===1){if(ln(r)<2)break;let c=fn(r,2);n=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(ln(r)<8)break;let c=fn(r,8),u=new DataView(c.buffer,c.byteOffset,c.length),l=u.getUint32(0);if(l>Math.pow(2,21)-1){a.enqueue(es);break}n=l*Math.pow(2,32)+u.getUint32(4),s=3}else{if(ln(r)<n)break;let c=fn(r,n);a.enqueue(rs(i?c:Ui.decode(c),e)),s=0}if(n===0||n>t){a.enqueue(es);break}}}})}var Bi=4;var el=k(Dt(),1);var at=process.nextTick,me=global,Vu="nodebuffer";function zu(){return new Vi}function _g(t){let e=t.split("; "),r=e[0].indexOf("=");if(r===-1)return;let s=e[0].substring(0,r).trim();if(!s.length)return;let n=e[0].substring(r+1).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));let i={name:s,value:n};for(let o=1;o<e.length;o++){let a=e[o].split("=");if(a.length!==2)continue;let c=a[0].trim(),u=a[1].trim();switch(c){case"Expires":i.expires=new Date(u);break;case"Max-Age":let l=new Date;l.setUTCSeconds(l.getUTCSeconds()+parseInt(u,10)),i.expires=l;break;default:}}return i}var Vi=class{constructor(){this._cookies=new Map}parseCookies(e){e&&e.forEach(r=>{let s=_g(r);s&&this._cookies.set(s.name,s)})}get cookies(){let e=Date.now();return this._cookies.forEach((r,s)=>{var n;((n=r.expires)===null||n===void 0?void 0:n.getTime())<e&&this._cookies.delete(s)}),this._cookies.entries()}addCookies(e){let r=[];for(let[s,n]of this.cookies)r.push(`${s}=${n.value}`);r.length&&(e.setDisableHeaderCheck(!0),e.setRequestHeader("cookie",r.join("; ")))}appendCookies(e){for(let[r,s]of this.cookies)e.append("cookie",`${r}=${s.value}`)}};function dn(t,...e){return e.reduce((r,s)=>(t.hasOwnProperty(s)&&(r[s]=t[s]),r),{})}var vg=me.setTimeout,Eg=me.clearTimeout;function ct(t,e){e.useNativeTimers?(t.setTimeoutFn=vg.bind(me),t.clearTimeoutFn=Eg.bind(me)):(t.setTimeoutFn=me.setTimeout.bind(me),t.clearTimeoutFn=me.clearTimeout.bind(me))}var wg=1.33;function Gu(t){return typeof t=="string"?bg(t):Math.ceil((t.byteLength||t.size)*wg)}function bg(t){let e=0,r=0;for(let s=0,n=t.length;s<n;s++)e=t.charCodeAt(s),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(s++,r+=4);return r}function hn(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Hu(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function Wu(t){let e={},r=t.split("&");for(let s=0,n=r.length;s<n;s++){let i=r[s].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}var tl=k(Ne(),1),Vg=(0,tl.default)("engine.io-client:transport"),_n=class extends Error{constructor(e,r,s){super(e),this.description=r,this.context=s,this.type="TransportError"}},ut=class extends el.Emitter{constructor(e){super(),this.writable=!1,ct(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,r,s){return super.emitReserved("error",new _n(e,r,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"?this.write(e):Vg("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let r=rs(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let r=Hu(e);return r.length?"?"+r:""}};var rl=k(Ne(),1),Be=(0,rl.default)("engine.io-client:polling"),ss=class extends ut{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let r=()=>{Be("paused"),this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(Be("we are currently polling - waiting to pause"),s++,this.once("pollComplete",function(){Be("pre-pause polling complete"),--s||r()})),this.writable||(Be("we are currently writing - waiting to pause"),s++,this.once("drain",function(){Be("pre-pause writing complete"),--s||r()}))}else r()}_poll(){Be("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){Be("polling got data %s",e);let r=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Mu(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this._poll():Be('ignoring poll - transport state "%s"',this.readyState))}doClose(){let e=()=>{Be("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(Be("transport open - closing"),e()):(Be("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,ju(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=hn()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}};var ol=k(Dt(),1);var sl=!1;try{sl=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var nl=sl;var al=k(Ne(),1),Hi=(0,al.default)("engine.io-client:polling");function zg(){}var vn=class extends ss{constructor(e){if(super(e),typeof location<"u"){let r=location.protocol==="https:",s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,r){let s=this.request({method:"POST",data:e});s.on("success",r),s.on("error",(n,i)=>{this.onError("xhr post error",n,i)})}doPoll(){Hi("xhr poll");let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,s)=>{this.onError("xhr poll error",r,s)}),this.pollXhr=e}},lt=class t extends ol.Emitter{constructor(e,r,s){super(),this.createRequest=e,ct(this,s),this._opts=s,this._method=s.method||"GET",this._uri=r,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;let r=dn(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;let s=this._xhr=this.createRequest(r);try{Hi("xhr open %s: %s",this._method,this._uri),s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&s.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var n;s.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},Hi("xhr data %s",this._data),s.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=t.requestsCount++,t.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=zg,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete t.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};lt.requestsCount=0;lt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",il);else if(typeof addEventListener=="function"){let t="onpagehide"in me?"pagehide":"unload";addEventListener(t,il,!1)}}function il(){for(let t in lt.requests)lt.requests.hasOwnProperty(t)&<.requests[t].abort()}var cx=function(){let t=Gg({xdomain:!1});return t&&t.responseType!==null}();function Gg(t){let e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||nl))return new XMLHttpRequest}catch{}if(!e)try{return new me[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Hg=Wi.default||Wi,lr=class extends vn{request(e={}){var r;return Object.assign(e,{xd:this.xd,cookieJar:(r=this.socket)===null||r===void 0?void 0:r._cookieJar},this.opts),new lt(s=>new Hg(s),this.uri(),e)}};var f_=k(rf(),1),d_=k(no(),1),h_=k(ao(),1),yo=k(Rn(),1),p_=k(df(),1);var hf=k(Ne(),1),y_=(0,hf.default)("engine.io-client:websocket"),g_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",In=class extends ut{get name(){return"websocket"}doOpen(){let e=this.uri(),r=this.opts.protocols,s=g_?{}:dn(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,r,s)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r<e.length;r++){let s=e[r],n=r===e.length-1;ts(s,this.supportsBinary,i=>{try{this.doWrite(s,i)}catch{y_("websocket closed before onclose event")}n&&at(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=hn()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}},Ax=me.WebSocket||me.MozWebSocket;var _r=class extends In{createSocket(e,r,s){var n;if(!((n=this.socket)===null||n===void 0)&&n._cookieJar){s.headers=s.headers||{},s.headers.cookie=typeof s.headers.cookie=="string"?[s.headers.cookie]:s.headers.cookie||[];for(let[i,o]of this.socket._cookieJar.cookies)s.headers.cookie.push(`${i}=${o.value}`)}return new yo.default(e,r,s)}doWrite(e,r){let s={};e.options&&(s.compress=e.options.compress),this.opts.perMessageDeflate&&(typeof r=="string"?Buffer.byteLength(r):r.length)<this.opts.perMessageDeflate.threshold&&(s.compress=!1),this.ws.send(r,s)}};var pf=k(Ne(),1),ds=(0,pf.default)("engine.io-client:webtransport"),vr=class extends ut{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{ds("transport closed gracefully"),this.onClose()}).catch(e=>{ds("transport closed due to %s",e),this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let r=Uu(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(r).getReader(),n=Fu();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();let i=()=>{s.read().then(({done:a,value:c})=>{if(a){ds("session is closed");return}ds("received chunk: %o",c),this.onPacket(c),i()}).catch(a=>{ds("an error occurred while reading: %s",a)})};i();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let r=0;r<e.length;r++){let s=e[r],n=r===e.length-1;this._writer.write(s).then(()=>{n&&at(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var go={websocket:_r,webtransport:vr,polling:lr};var __=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,v_=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Er(t){if(t.length>8e3)throw"URI too long";let e=t,r=t.indexOf("["),s=t.indexOf("]");r!=-1&&s!=-1&&(t=t.substring(0,r)+t.substring(r,s).replace(/:/g,";")+t.substring(s,t.length));let n=__.exec(t||""),i={},o=14;for(;o--;)i[v_[o]]=n[o]||"";return r!=-1&&s!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=E_(i,i.path),i.queryKey=w_(i,i.query),i}function E_(t,e){let r=/\/{2,9}/g,s=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function w_(t,e){let r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,n,i){n&&(r[n]=i)}),r}var mf=k(Dt(),1);var yf=k(Ne(),1),B=(0,yf.default)("engine.io-client:socket"),_o=typeof addEventListener=="function"&&typeof removeEventListener=="function",hs=[];_o&&addEventListener("offline",()=>{B("closing %d connection(s) because the network was lost",hs.length),hs.forEach(t=>t())},!1);var Vt=class t extends mf.Emitter{constructor(e,r){if(super(),this.binaryType=Vu,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(r=e,e=null),e){let s=Er(e);r.hostname=s.host,r.secure=s.protocol==="https"||s.protocol==="wss",r.port=s.port,s.query&&(r.query=s.query)}else r.host&&(r.hostname=Er(r.host).host);ct(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(s=>{let n=s.prototype.name;this.transports.push(n),this._transportsByName[n]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Wu(this.opts.query)),_o&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(B("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},hs.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=zu()),this._open()}createTransport(e){B('creating transport "%s"',e);let r=Object.assign({},this.opts.query);r.EIO=Bi,r.transport=e,this.id&&(r.sid=this.id);let s=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return B("options: %j",s),new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let e=this.opts.rememberUpgrade&&t.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let r=this.createTransport(e);r.open(),this.setTransport(r)}setTransport(e){B("setting transport %s",e.name),this.transport&&(B("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){B("socket open"),this.readyState="open",t.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(B('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let r=new Error("server error");r.code=e.data,this._onError(r);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}else B('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();B("flushing %d packets in socket",e.length),this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let s=0;s<this.writeBuffer.length;s++){let n=this.writeBuffer[s].data;if(n&&(r+=Gu(n)),s>0&&r>this._maxPayload)return B("only send %d out of %d packets",s,this.writeBuffer.length),this.writeBuffer.slice(0,s);r+=2}return B("payload size is %d (max: %d)",r,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(B("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,at(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,r,s){return this._sendPacket("message",e,r,s),this}send(e,r,s){return this._sendPacket("message",e,r,s),this}_sendPacket(e,r,s,n){if(typeof r=="function"&&(n=r,r=void 0),typeof s=="function"&&(n=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;let i={type:e,data:r,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),B("socket closing - telling transport to close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},s=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(B("socket error %j",e),t.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return B("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(B('socket close with reason: "%s"',e),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),_o&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let s=hs.indexOf(this._offlineEventListener);s!==-1&&(B("removing listener for the 'offline' event"),hs.splice(s,1))}this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this._prevBufferLen=0}}};Vt.protocol=Bi;var An=class extends Vt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade){B("starting upgrade probes");for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}}_probe(e){B('probing transport "%s"',e);let r=this.createTransport(e),s=!1;Vt.priorWebsocketSuccess=!1;let n=()=>{s||(B('probe transport "%s" opened',e),r.send([{type:"ping",data:"probe"}]),r.once("packet",f=>{if(!s)if(f.type==="pong"&&f.data==="probe"){if(B('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Vt.priorWebsocketSuccess=r.name==="websocket",B('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{s||this.readyState!=="closed"&&(B("changing transport and sending upgrade packet"),l(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{B('probe transport "%s" failed',e);let d=new Error("probe error");d.transport=r.name,this.emitReserved("upgradeError",d)}}))};function i(){s||(s=!0,l(),r.close(),r=null)}let o=f=>{let d=new Error("probe error: "+f);d.transport=r.name,i(),B('probe transport "%s" failed because of error: %s',e,f),this.emitReserved("upgradeError",d)};function a(){o("transport closed")}function c(){o("socket closed")}function u(f){r&&f.name!==r.name&&(B('"%s" works - aborting "%s"',f.name,r.name),i())}let l=()=>{r.removeListener("open",n),r.removeListener("error",o),r.removeListener("close",a),this.off("close",c),this.off("upgrading",u)};r.once("open",n),r.once("error",o),r.once("close",a),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||r.open()},200):r.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let r=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&r.push(e[s]);return r}},wr=class extends An{constructor(e,r={}){let s=typeof e=="object"?e:r;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(n=>go[n]).filter(n=>!!n)),super(e,s)}};var sN=wr.protocol;var _f=k(Ne(),1),gf=(0,_f.default)("socket.io-client:url");function vf(t,e="",r){let s=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(gf("protocol-less url %s",t),typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),gf("parse %s",t),s=Er(t)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let i=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+e,s.href=s.protocol+"://"+i+(r&&r.port===s.port?"":":"+s.port),s}var To={};xu(To,{Decoder:()=>So,Encoder:()=>bo,PacketType:()=>N,isPacketValid:()=>P_,protocol:()=>Cf});var Sf=k(Dt(),1);var T_=typeof ArrayBuffer=="function",C_=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Ef=Object.prototype.toString,O_=typeof Blob=="function"||typeof Blob<"u"&&Ef.call(Blob)==="[object BlobConstructor]",k_=typeof File=="function"||typeof File<"u"&&Ef.call(File)==="[object FileConstructor]";function ms(t){return T_&&(t instanceof ArrayBuffer||C_(t))||O_&&t instanceof Blob||k_&&t instanceof File}function ps(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,s=t.length;r<s;r++)if(ps(t[r]))return!0;return!1}if(ms(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return ps(t.toJSON(),!0);for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&ps(t[r]))return!0;return!1}function wf(t){let e=[],r=t.data,s=t;return s.data=vo(r,e),s.attachments=e.length,{packet:s,buffers:e}}function vo(t,e){if(!t)return t;if(ms(t)){let r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){let r=new Array(t.length);for(let s=0;s<t.length;s++)r[s]=vo(t[s],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){let r={};for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=vo(t[s],e));return r}return t}function bf(t,e){return t.data=Eo(t.data,e),delete t.attachments,t}function Eo(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Eo(t[r],e);else if(typeof t=="object")for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Eo(t[r],e));return t}var $f=k(Ne(),1),wo=(0,$f.default)("socket.io-parser"),Tf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Cf=5,N;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(N||(N={}));var bo=class{constructor(e){this.replacer=e}encode(e){return wo("encoding packet %j",e),(e.type===N.EVENT||e.type===N.ACK)&&ps(e)?this.encodeAsBinary({type:e.type===N.EVENT?N.BINARY_EVENT:N.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===N.BINARY_EVENT||e.type===N.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),wo("encoded %j as %s",e,r),r}encodeAsBinary(e){let r=wf(e),s=this.encodeAsString(r.packet),n=r.buffers;return n.unshift(s),n}},So=class t extends Sf.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);let s=r.type===N.BINARY_EVENT;s||r.type===N.BINARY_ACK?(r.type=s?N.EVENT:N.ACK,this.reconstructor=new $o(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(ms(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0,s={type:Number(e.charAt(0))};if(N[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===N.BINARY_EVENT||s.type===N.BINARY_ACK){let i=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);let o=e.substring(i,r);if(o!=Number(o)||e.charAt(r)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!Of(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");s.attachments=a}if(e.charAt(r+1)==="/"){let i=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););s.nsp=e.substring(i,r)}else s.nsp="/";let n=e.charAt(r+1);if(n!==""&&Number(n)==n){let i=r+1;for(;++r;){let o=e.charAt(r);if(o==null||Number(o)!=o){--r;break}if(r===e.length)break}s.id=Number(e.substring(i,r+1))}if(e.charAt(++r)){let i=this.tryParse(e.substr(r));if(t.isPayloadValid(s.type,i))s.data=i;else throw new Error("invalid payload")}return wo("decoded %s as %j",e,s),s}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case N.CONNECT:return qn(r);case N.DISCONNECT:return r===void 0;case N.CONNECT_ERROR:return typeof r=="string"||qn(r);case N.EVENT:case N.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Tf.indexOf(r[0])===-1);case N.ACK:case N.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},$o=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let r=bf(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function x_(t){return typeof t=="string"}var Of=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function N_(t){return t===void 0||Of(t)}function qn(t){return Object.prototype.toString.call(t)==="[object Object]"}function R_(t,e){switch(t){case N.CONNECT:return e===void 0||qn(e);case N.DISCONNECT:return e===void 0;case N.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Tf.indexOf(e[0])===-1);case N.ACK:return Array.isArray(e);case N.CONNECT_ERROR:return typeof e=="string"||qn(e);default:return!1}}function P_(t){return x_(t.nsp)&&N_(t.id)&&R_(t.type,t.data)}function ke(t,e,r){return t.on(e,r),function(){t.off(e,r)}}var kf=k(Dt(),1),xf=k(Ne(),1),Q=(0,xf.default)("socket.io-client:socket"),I_=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),br=class extends kf.Emitter{constructor(e,r,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[ke(e,"open",this.onopen.bind(this)),ke(e,"packet",this.onpacket.bind(this)),ke(e,"error",this.onerror.bind(this)),ke(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...r){var s,n,i;if(I_.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;let o={type:N.EVENT,data:r};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){let l=this.ids++;Q("emitting packet with ack id %d",l);let f=r.pop();this._registerAckCallback(l,f),o.id=l}let a=(n=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||n===void 0?void 0:n.writable,c=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a?Q("discard packet as the transport is not currently writable"):c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o),this.flags={},this}_registerAckCallback(e,r){var s;let n=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(n===void 0){this.acks[e]=r;return}let i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&(Q("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(a,1));Q("event with ack id %d has timed out after %d ms",e,n),r.call(this,new Error("operation has timed out"))},n),o=(...a)=>{this.io.clearTimeoutFn(i),r.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...r){return new Promise((s,n)=>{let i=(o,a)=>o?n(o):s(a);i.withError=!0,r.push(i),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...i)=>s!==this._queue[0]?Q("packet [%d] already acknowledged",s.id):(n!==null?s.tryCount>this._opts.retries&&(Q("packet [%d] is discarded after %d tries",s.id,s.tryCount),this._queue.shift(),r&&r(n)):(Q("packet [%d] was successfully sent",s.id),this._queue.shift(),r&&r(null,...i)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(Q("draining queue"),!this.connected||this._queue.length===0)return;let r=this._queue[0];if(r.pending&&!e){Q("packet [%d] has already been sent and is waiting for an ack",r.id);return}r.pending=!0,r.tryCount++,Q("sending packet [%d] (try n\xB0%d)",r.id,r.tryCount),this.flags=r.flags,this.emit.apply(this,r.args)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){Q("transport is open - connecting"),typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:N.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){Q("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case N.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case N.EVENT:case N.BINARY_EVENT:this.onevent(e);break;case N.ACK:case N.BINARY_ACK:this.onack(e);break;case N.DISCONNECT:this.ondisconnect();break;case N.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let r=e.data||[];Q("emitting event %j",r),e.id!=null&&(Q("attaching ack callback to event"),r.push(this.ack(e.id))),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let r=this._anyListeners.slice();for(let s of r)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let r=this,s=!1;return function(...n){s||(s=!0,Q("sending ack %j",n),r.packet({type:N.ACK,id:e,data:n}))}}onack(e){let r=this.acks[e.id];if(typeof r!="function"){Q("bad ack %s",e.id);return}delete this.acks[e.id],Q("calling ack %s with %j",e.id,e.data),r.withError&&e.data.unshift(null),r.apply(this,e.data)}onconnect(e,r){Q("socket connected with id %s",e),this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){Q("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(Q("performing disconnect (%s)",this.nsp),this.packet({type:N.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let r=this._anyListeners;for(let s=0;s<r.length;s++)if(e===r[s])return r.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let r=this._anyOutgoingListeners;for(let s=0;s<r.length;s++)if(e===r[s])return r.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let r=this._anyOutgoingListeners.slice();for(let s of r)s.apply(this,e.data)}}};function zt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}zt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0};zt.prototype.reset=function(){this.attempts=0};zt.prototype.setMin=function(t){this.ms=t};zt.prototype.setMax=function(t){this.max=t};zt.prototype.setJitter=function(t){this.jitter=t};var Nf=k(Dt(),1),Rf=k(Ne(),1),re=(0,Rf.default)("socket.io-client:manager"),Sr=class extends Nf.Emitter{constructor(e,r){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,ct(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((s=r.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new zt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;let n=r.parser||To;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(re("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;re("opening %s",this.uri),this.engine=new wr(this.uri,this.opts);let r=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let n=ke(r,"open",function(){s.onopen(),e&&e()}),i=a=>{re("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=ke(r,"error",i);if(this._timeout!==!1){let a=this._timeout;re("connect attempt will timeout after %d",a);let c=this.setTimeoutFn(()=>{re("connect attempt timed out after %d",a),n(),i(new Error("timeout")),r.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){re("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(ke(e,"ping",this.onping.bind(this)),ke(e,"data",this.ondata.bind(this)),ke(e,"error",this.onerror.bind(this)),ke(e,"close",this.onclose.bind(this)),ke(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){at(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){re("error",e),this.emitReserved("error",e)}socket(e,r){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new br(this,e,r),this.nsps[e]=s),s}_destroy(e){let r=Object.keys(this.nsps);for(let s of r)if(this.nsps[s].active){re("socket %s is still active, skipping close",s);return}this._close()}_packet(e){re("writing packet %j",e);let r=this.encoder.encode(e);for(let s=0;s<r.length;s++)this.engine.write(r[s],e.options)}cleanup(){re("cleanup"),this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){re("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,r){var s;re("closed due to %s",e),this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)re("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let r=this.backoff.duration();re("will wait %dms before reconnect attempt",r),this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(re("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(re("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):(re("reconnect success"),e.onreconnect())}))},r);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var If=k(Ne(),1),Pf=(0,If.default)("socket.io-client"),ys={};function gs(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};let r=vf(t,e.path||"/socket.io"),s=r.source,n=r.id,i=r.path,o=ys[n]&&i in ys[n].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o,c;return a?(Pf("ignoring socket cache for %s",s),c=new Sr(s,e)):(ys[n]||(Pf("new io instance for %s",s),ys[n]=new Sr(s,e)),c=ys[n]),r.query&&!e.query&&(e.query=r.queryKey),c.socket(r.path,e)}Object.assign(gs,{Manager:Sr,Socket:br,io:gs,connect:gs});var qi=k(require("fs"),1),sg=k(require("path"),1);var Zy=require("node:util"),Cu=k(require("node:process"),1),At=k(require("node:fs"),1),Ou=k(require("node:path"),1),Kr=k(require("node:crypto"),1),eg=k(require("node:assert"),1);var Gt=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var Co=new Set(["__proto__","prototype","constructor"]),A_=new Set("0123456789");function Dn(t){let e=[],r="",s="start",n=!1;for(let i of t)switch(i){case"\\":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");n&&(r+=i),s="property",n=!n;break}case".":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="property";break}if(n){n=!1,r+=i;break}if(Co.has(r))return[];e.push(r),r="",s="property";break}case"[":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="index";break}if(n){n=!1,r+=i;break}if(s==="property"){if(Co.has(r))return[];e.push(r),r=""}s="index";break}case"]":{if(s==="index"){e.push(Number.parseInt(r,10)),r="",s="indexEnd";break}if(s==="indexEnd")throw new Error("Invalid character after an index")}default:{if(s==="index"&&!A_.has(i))throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");s==="start"&&(s="property"),n&&(n=!1,r+="\\"),r+=i}}switch(n&&(r+="\\"),s){case"property":{if(Co.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Oo(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function Af(t,e){if(Oo(t,e))throw new Error("Cannot use string index")}function qf(t,e,r){if(!Gt(t)||typeof e!="string")return r===void 0?t:r;let s=Dn(e);if(s.length===0)return r;for(let n=0;n<s.length;n++){let i=s[n];if(Oo(t,i)?t=n===s.length-1?void 0:null:t=t[i],t==null){if(n!==s.length-1)return r;break}}return t===void 0?r:t}function ko(t,e,r){if(!Gt(t)||typeof e!="string")return t;let s=t,n=Dn(e);for(let i=0;i<n.length;i++){let o=n[i];Af(t,o),i===n.length-1?t[o]=r:Gt(t[o])||(t[o]=typeof n[i+1]=="number"?[]:{}),t=t[o]}return s}function Df(t,e){if(!Gt(t)||typeof e!="string")return!1;let r=Dn(e);for(let s=0;s<r.length;s++){let n=r[s];if(Af(t,n),s===r.length-1)return delete t[n],!0;if(t=t[n],!Gt(t))return!1}}function Lf(t,e){if(!Gt(t)||typeof e!="string")return!1;let r=Dn(e);if(r.length===0)return!1;for(let s of r){if(!Gt(t)||!(s in t)||Oo(t,s))return!1;t=t[s]}return!0}var Y=k(require("node:path"),1),xo=k(require("node:os"),1),Ln=k(require("node:process"),1),St=xo.default.homedir(),No=xo.default.tmpdir(),{env:$r}=Ln.default,q_=t=>{let e=Y.default.join(St,"Library");return{data:Y.default.join(e,"Application Support",t),config:Y.default.join(e,"Preferences",t),cache:Y.default.join(e,"Caches",t),log:Y.default.join(e,"Logs",t),temp:Y.default.join(No,t)}},D_=t=>{let e=$r.APPDATA||Y.default.join(St,"AppData","Roaming"),r=$r.LOCALAPPDATA||Y.default.join(St,"AppData","Local");return{data:Y.default.join(r,t,"Data"),config:Y.default.join(e,t,"Config"),cache:Y.default.join(r,t,"Cache"),log:Y.default.join(r,t,"Log"),temp:Y.default.join(No,t)}},L_=t=>{let e=Y.default.basename(St);return{data:Y.default.join($r.XDG_DATA_HOME||Y.default.join(St,".local","share"),t),config:Y.default.join($r.XDG_CONFIG_HOME||Y.default.join(St,".config"),t),cache:Y.default.join($r.XDG_CACHE_HOME||Y.default.join(St,".cache"),t),log:Y.default.join($r.XDG_STATE_HOME||Y.default.join(St,".local","state"),t),temp:Y.default.join(No,e,t)}};function Ro(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Ln.default.platform==="darwin"?q_(t):Ln.default.platform==="win32"?D_(t):L_(t)}var Qf=k(require("node:path"),1);var L=k(require("node:fs"),1),ne=require("node:util");var j_=(t,e)=>{let{onError:r}=e;return function(...n){return t.apply(void 0,n).catch(r)}},Je=j_;var M_=(t,e)=>{let{onError:r}=e;return function(...n){try{return t.apply(void 0,n)}catch(i){return r(i)}}},ze=M_;var U_=(t,e)=>{let{isRetriable:r}=e;return function(n){let{timeout:i}=n,o=n.interval??250,a=Date.now()+i;return function c(...u){return t.apply(void 0,u).catch(l=>{if(!r(l)||Date.now()>=a)throw l;let f=Math.round(o*Math.random());return f>0?new Promise(h=>setTimeout(h,f)).then(()=>c.apply(void 0,u)):c.apply(void 0,u)})}}},Qe=U_;var B_=(t,e)=>{let{isRetriable:r}=e;return function(n){let{timeout:i}=n,o=Date.now()+i;return function(...c){for(;;)try{return t.apply(void 0,c)}catch(u){if(!r(u)||Date.now()>=o)throw u;continue}}}},Ze=B_;var Io=k(require("node:process"),1);var _s={isChangeErrorOk:t=>{if(!_s.isNodeError(t))return!1;let{code:e}=t;return e==="ENOSYS"||!jf&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!_s.isNodeError(t))return!1;let{code:e}=t;return e==="EMFILE"||e==="ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!_s.isNodeError(t))throw t;if(!_s.isChangeErrorOk(t))throw t}},Po=_s;var vs={onError:Po.onChangeError},we={onError:()=>{}},jf=Io.default.getuid?!Io.default.getuid():!1,se={isRetriable:Po.isRetriableError};var V_={attempt:{chmod:Je((0,ne.promisify)(L.default.chmod),vs),chown:Je((0,ne.promisify)(L.default.chown),vs),close:Je((0,ne.promisify)(L.default.close),we),fsync:Je((0,ne.promisify)(L.default.fsync),we),mkdir:Je((0,ne.promisify)(L.default.mkdir),we),realpath:Je((0,ne.promisify)(L.default.realpath),we),stat:Je((0,ne.promisify)(L.default.stat),we),unlink:Je((0,ne.promisify)(L.default.unlink),we),chmodSync:ze(L.default.chmodSync,vs),chownSync:ze(L.default.chownSync,vs),closeSync:ze(L.default.closeSync,we),existsSync:ze(L.default.existsSync,we),fsyncSync:ze(L.default.fsync,we),mkdirSync:ze(L.default.mkdirSync,we),realpathSync:ze(L.default.realpathSync,we),statSync:ze(L.default.statSync,we),unlinkSync:ze(L.default.unlinkSync,we)},retry:{close:Qe((0,ne.promisify)(L.default.close),se),fsync:Qe((0,ne.promisify)(L.default.fsync),se),open:Qe((0,ne.promisify)(L.default.open),se),readFile:Qe((0,ne.promisify)(L.default.readFile),se),rename:Qe((0,ne.promisify)(L.default.rename),se),stat:Qe((0,ne.promisify)(L.default.stat),se),write:Qe((0,ne.promisify)(L.default.write),se),writeFile:Qe((0,ne.promisify)(L.default.writeFile),se),closeSync:Ze(L.default.closeSync,se),fsyncSync:Ze(L.default.fsyncSync,se),openSync:Ze(L.default.openSync,se),readFileSync:Ze(L.default.readFileSync,se),renameSync:Ze(L.default.renameSync,se),statSync:Ze(L.default.statSync,se),writeSync:Ze(L.default.writeSync,se),writeFileSync:Ze(L.default.writeFileSync,se)}},te=V_;var $t=k(require("node:process"),1),Mf="utf8",Ao=438,Ff=511;var Uf={},Bf=$t.default.geteuid?$t.default.geteuid():-1,Vf=$t.default.getegid?$t.default.getegid():-1;var zf=1e3,Gf=!!$t.default.getuid,aR=$t.default.getuid?!$t.default.getuid():!1,qo=128;var Hf=t=>t instanceof Error&&"code"in t;var Do=t=>typeof t=="string",jn=t=>t===void 0;var Jf=k(require("node:path"),1);var Ht=k(require("node:process"),1);var Lo=k(require("node:process"),1),Wf=Lo.default.platform==="linux",Mn=Lo.default.platform==="win32";var jo=["SIGHUP","SIGINT","SIGTERM"];Mn||jo.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");Wf&&jo.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Kf=jo;var Mo=class{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(let r of this.callbacks)r();e&&(Mn&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Ht.default.kill(Ht.default.pid,"SIGTERM"):Ht.default.kill(Ht.default.pid,e))}},this.hook=()=>{Ht.default.once("exit",()=>this.exit());for(let e of Kf)try{Ht.default.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},Xf=new Mo;var z_=Xf.register,Yf=z_;var xe={store:{},create:t=>{let e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${n}`},get:(t,e,r=!0)=>{let s=xe.truncate(e(t));return s in xe.store?xe.get(t,e,r):(xe.store[s]=r,[s,()=>delete xe.store[s]])},purge:t=>{xe.store[t]&&(delete xe.store[t],te.attempt.unlink(t))},purgeSync:t=>{xe.store[t]&&(delete xe.store[t],te.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(let t in xe.store)xe.purgeSync(t)},truncate:t=>{let e=Jf.default.basename(t);if(e.length<=qo)return t;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;let s=e.length-qo;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-s)}${r[3]}`}};Yf(xe.purgeSyncAll);var Es=xe;function Fo(t,e,r=Uf){if(Do(r))return Fo(t,e,{encoding:r});let n={timeout:r.timeout??zf},i=null,o=null,a=null;try{let c=te.attempt.realpathSync(t),u=!!c;t=c||t,[o,i]=Es.get(t,r.tmpCreate||Es.create,r.tmpPurge!==!1);let l=Gf&&jn(r.chown),f=jn(r.mode);if(u&&(l||f)){let d=te.attempt.statSync(t);d&&(r={...r},l&&(r.chown={uid:d.uid,gid:d.gid}),f&&(r.mode=d.mode))}if(!u){let d=Qf.default.dirname(t);te.attempt.mkdirSync(d,{mode:Ff,recursive:!0})}a=te.retry.openSync(n)(o,"w",r.mode||Ao),r.tmpCreated&&r.tmpCreated(o),Do(e)?te.retry.writeSync(n)(a,e,0,r.encoding||Mf):jn(e)||te.retry.writeSync(n)(a,e,0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?te.retry.fsyncSync(n)(a):te.attempt.fsync(a)),te.retry.closeSync(n)(a),a=null,r.chown&&(r.chown.uid!==Bf||r.chown.gid!==Vf)&&te.attempt.chownSync(o,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Ao&&te.attempt.chmodSync(o,r.mode);try{te.retry.renameSync(n)(o,t)}catch(d){if(!Hf(d)||d.code!=="ENAMETOOLONG")throw d;te.retry.renameSync(n)(o,Es.truncate(t))}i(),o=null}finally{a&&te.attempt.closeSync(a),o&&Es.purge(o)}}var tg=k(Up(),1),rg=k(im(),1);var W1=(t,e,r,s)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let n=Object.getOwnPropertyDescriptor(t,r),i=Object.getOwnPropertyDescriptor(e,r);!K1(n,i)&&s||Object.defineProperty(t,r,i)},K1=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},X1=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},Y1=(t,e)=>`/* Wrapped ${t}*/
${e}`,J1=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Q1=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Z1=(t,e,r)=>{let s=r===""?"":`with ${r.trim()}() `,n=Y1.bind(null,s,e.toString());Object.defineProperty(n,"name",Q1);let{writable:i,enumerable:o,configurable:a}=J1;Object.defineProperty(t,"toString",{value:n,writable:i,enumerable:o,configurable:a})};function ru(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:s}=t;for(let n of Reflect.ownKeys(e))W1(t,e,n,r);return X1(t,e),Z1(t,e,s),t}var eT=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);let{wait:r=0,maxWait:s=Number.POSITIVE_INFINITY,before:n=!1,after:i=!0}=e;if(r<0||s<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!n&&!i)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,c,u=function(...l){let f=this,d=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),i&&(c=t.apply(f,l))},h=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),i&&(c=t.apply(f,l))},y=n&&!o;return clearTimeout(o),o=setTimeout(d,r),s>0&&s!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(h,s)),y&&(c=t.apply(f,l)),c};return ru(u,t),u.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},u},su=eT;var ir=k(Ky(),1);var YO=Object.prototype.toString,JO="[object Uint8Array]",QO="[object ArrayBuffer]";function Yy(t,e,r){return t?t.constructor===e?!0:YO.call(t)===r:!1}function Jy(t){return Yy(t,Uint8Array,JO)}function ZO(t){return Yy(t,ArrayBuffer,QO)}function ek(t){return Jy(t)||ZO(t)}function tk(t){if(!Jy(t))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof t}\``)}function rk(t){if(!ek(t))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}function Su(t,e){if(t.length===0)return new Uint8Array(0);e??=t.reduce((n,i)=>n+i.length,0);let r=new Uint8Array(e),s=0;for(let n of t)tk(n),r.set(n,s),s+=n.length;return r}var Xy={utf8:new globalThis.TextDecoder("utf8")};function $u(t,e="utf8"){return rk(t),Xy[e]??=new globalThis.TextDecoder(e),Xy[e].decode(t)}function sk(t){if(typeof t!="string")throw new TypeError(`Expected \`string\`, got \`${typeof t}\``)}var nk=new globalThis.TextEncoder;function Ii(t){return sk(t),nk.encode(t)}var lA=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));var ik=rg.default.default,Qy="aes-256-cbc",Wr=()=>Object.create(null),ok=t=>t!=null,ak=(t,e)=>{let r=new Set(["undefined","symbol","function"]),s=typeof e;if(r.has(s))throw new TypeError(`Setting a value of type \`${s}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},Ai="__internal__",Tu=`${Ai}.migrations.version`,Xr=class{path;events;#s;#t;#e;#r={};constructor(e={}){let r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=Ro(r.projectName,{suffix:r.projectSuffix}).config}if(this.#e=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError("The `schema` option must be an object.");let o=new tg.Ajv2020({allErrors:!0,useDefaults:!0,...r.ajvOptions});ik(o);let a={...r.rootSchema,type:"object",properties:r.schema};this.#s=o.compile(a);for(let[c,u]of Object.entries(r.schema??{}))u!=null&&u.default&&(this.#r[c]=u.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#t=r.encryptionKey;let s=r.fileExtension?`.${r.fileExtension}`:"";this.path=Ou.default.resolve(r.cwd,`${r.configName??"config"}${s}`);let n=this.store,i=Object.assign(Wr(),r.defaults,n);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(i);try{eg.default.deepEqual(n,i)}catch{this.store=i}r.watch&&this._watch()}get(e,r){if(this.#e.accessPropertiesByDotNotation)return this._get(e,r);let{store:s}=this;return e in s?s[e]:r}set(e,r){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${Ai} key, as it's used to manage this module internal operations.`);let{store:s}=this,n=(i,o)=>{ak(i,o),this.#e.accessPropertiesByDotNotation?ko(s,i,o):s[i]=o};if(typeof e=="object"){let i=e;for(let[o,a]of Object.entries(i))n(o,a)}else n(e,r);this.store=s}has(e){return this.#e.accessPropertiesByDotNotation?Lf(this.store,e):e in this.store}reset(...e){for(let r of e)ok(this.#r[r])&&this.set(r,this.#r[r])}delete(e){let{store:r}=this;this.#e.accessPropertiesByDotNotation?Df(r,e):delete r[e],this.store=r}clear(){this.store=Wr();for(let e of Object.keys(this.#r))this.reset(e)}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=At.default.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(e),s=this._deserialize(r);return this._validate(s),Object.assign(Wr(),s)}catch(e){if((e==null?void 0:e.code)==="ENOENT")return this._ensureDirectory(),Wr();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Wr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!this.#t)return typeof e=="string"?e:$u(e);try{let r=e.slice(0,16),s=Kr.default.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),n=Kr.default.createDecipheriv(Qy,s,r),i=e.slice(17),o=typeof i=="string"?Ii(i):i;return $u(Su([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,r){let s=e(),n=()=>{let i=s,o=e();(0,Zy.isDeepStrictEqual)(o,i)||(s=o,r.call(this,o,i))};return this.events.addEventListener("change",n),()=>{this.events.removeEventListener("change",n)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0," ");_validate(e){if(!this.#s||this.#s(e)||!this.#s.errors)return;let s=this.#s.errors.map(({instancePath:n,message:i=""})=>`\`${n.slice(1)}\` ${i}`);throw new Error("Config schema violation: "+s.join("; "))}_ensureDirectory(){At.default.mkdirSync(Ou.default.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(this.#t){let s=Kr.default.randomBytes(16),n=Kr.default.pbkdf2Sync(this.#t,s.toString(),1e4,32,"sha512"),i=Kr.default.createCipheriv(Qy,n,s);r=Su([s,Ii(":"),i.update(Ii(r)),i.final()])}if(Cu.default.env.SNAP)At.default.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{Fo(this.path,r,{mode:this.#e.configFileMode})}catch(s){if((s==null?void 0:s.code)==="EXDEV"){At.default.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}throw s}}_watch(){this._ensureDirectory(),At.default.existsSync(this.path)||this._write(Wr()),Cu.default.platform==="win32"?At.default.watch(this.path,{persistent:!1},su(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):At.default.watchFile(this.path,{persistent:!1},su(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(e,r,s){let n=this._get(Tu,"0.0.0"),i=Object.keys(e).filter(a=>this._shouldPerformMigration(a,n,r)),o={...this.store};for(let a of i)try{s&&s(this,{fromVersion:n,toVersion:a,finalVersion:r,versions:i});let c=e[a];c==null||c(this),this._set(Tu,a),n=a,o={...this.store}}catch(c){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(n)||!ir.default.eq(n,r))&&this._set(Tu,r)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Ai?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${Ai}.`):!1}_isVersionInRangeFormat(e){return ir.default.clean(e)===null}_shouldPerformMigration(e,r,s){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&ir.default.satisfies(r,e)?!1:ir.default.satisfies(s,e):!(ir.default.lte(e,r)||ir.default.gt(e,s))}_get(e,r){return qf(this.store,e,r)}_set(e,r){let{store:s}=this;ko(s,e,r),this.store=s}};var ck=class{constructor(t,e){this.effects=["rainbow","static","off","lightningStorm","candle","perimeter","breathing"],this.currentEffect="off",this.currentSpeed=50,this.currentBrightness=100,this.currentColor="#FFFFFF",this.client=t,this.checkConnection=e}async setEffect(t,e,r,s){if(!await this.checkConnection())throw new Error("Cannot set RGB effect: No device is connected");if(!this.effects.includes(t))throw new Error(`Unknown RGB effect: ${t}. Available effects: ${this.effects.join(", ")}`);return this.currentEffect=t,this.currentSpeed=e,this.currentBrightness=r,this.currentColor=s,await this.client.call("rgb.setEffect",{effectName:t,speed:e,brightness:r,color:s})}async setBrightness(t){return this.currentBrightness=t,this.setEffect(this.currentEffect,this.currentSpeed,t,this.currentColor)}async setColor(t){return this.currentColor=t,this.setEffect(this.currentEffect,this.currentSpeed,this.currentBrightness,t)}async setSpeed(t){return this.currentSpeed=t,this.setEffect(this.currentEffect,t,this.currentBrightness,this.currentColor)}async turnOff(){return this.setEffect("off",0,0,"#000000")}getAvailableEffects(){return this.effects}getCurrentState(){return{effect:this.currentEffect,speed:this.currentSpeed,brightness:this.currentBrightness,color:this.currentColor}}};function uk(t,e){return new ck(t,e)}var lk=class{constructor(t,e){this.connectCallbacks=[],this.disconnectCallbacks=[],this.updateCallbacks=[],this.apiCallFn=t,this.rgb=uk(e,()=>this.isConnected())}async getConnected(){try{return(await this.apiCallFn("device.getConnected",{})).devices||[]}catch(t){return console.error("Failed to get connected devices:",t),[]}}async isConnected(){return(await this.getConnected()).length>0}onConnect(t){this.connectCallbacks.push(t)}onDisconnect(t){this.disconnectCallbacks.push(t)}onUpdate(t){this.updateCallbacks.push(t)}async triggerConnect(t){for(let e of this.connectCallbacks)try{await e(t)}catch(r){console.error("Error in device connect callback:",r)}}async triggerDisconnect(t){for(let e of this.disconnectCallbacks)try{await e(t)}catch(r){console.error("Error in device disconnect callback:",r)}}async triggerUpdate(t){for(let e of this.updateCallbacks)try{await e(t)}catch(r){console.error("Error in device update callback:",r)}}};function fk(t,e){return new lk(t,e)}var dk=3001;function hk(){try{if(typeof Deno<"u"&&Deno.env){let t=Deno.env.get("DOTX_PLUGIN_PORT");if(t){let e=parseInt(t,10);if(!isNaN(e)&&e>0)return e}}}catch{}try{if(typeof process<"u"&&process.env){let t=process.env.DOTX_PLUGIN_PORT;if(t){let e=parseInt(t,10);if(!isNaN(e)&&e>0)return e}}}catch{}return dk}function pk(){return`http://127.0.0.1:${hk()}`}var mk=class{constructor(t,e={}){this.isRegistered=!1,this.retryCount=0,this.actionCallbacks=new Map,this.isDestroyed=!1,this.pluginInfo=t;let r=pk();this.config={serverUrl:e.serverUrl||r,maxRetries:e.maxRetries||5,retryDelay:e.retryDelay||2e3,connectionTimeout:e.connectionTimeout||1e4,registrationTimeout:e.registrationTimeout||15e3,apiTimeout:e.apiTimeout||3e4},console.log(`Plugin connecting to server at ${this.config.serverUrl}`),this.deviceAPI=fk((s,n)=>this.call(s,n),this),this.connectionPromise=this.initializeConnection()}waitForConnection(){return this.connectionPromise}async onDeviceUpdate(t){if(!this.isDestroyed)return await this.deviceAPI.triggerUpdate(t),this.deviceUpdateCallback&&await this.deviceUpdateCallback(t)||t}setDeviceUpdateCallback(t){this.deviceUpdateCallback=t}initializeConnection(){return new Promise((t,e)=>{let r=()=>{if(this.isDestroyed)return;console.log(`Attempting to connect to plugin server at ${this.config.serverUrl}...`),this.socket=gs(this.config.serverUrl,{timeout:this.config.connectionTimeout,forceNew:!0,autoConnect:!0,reconnection:!0}),this.socket.on("plugin.action",i=>{console.log("Received action!",i);let o=this.actionCallbacks.get(i.action);if(console.log("Action callback:",o),o)try{o(i.params)}catch(a){console.error("Error executing action callback:",a)}}),this.socket.on("plugin.device_update",i=>{console.log("Received device update event"),this.onDeviceUpdate(i)}),this.socket.on("plugin.device_connected",i=>{console.log("Received device connected event",i),this.deviceAPI.triggerConnect(i)}),this.socket.on("plugin.device_disconnected",i=>{console.log("Received device disconnected event",i),this.deviceAPI.triggerDisconnect(i)}),this.socket.on("plugin.request",(i,o)=>{console.log("Received plugin request:",i);let{method:a,request_id:c}=i||{},u={success:!1,error:"Unknown method",request_id:c,method:a};if(a==="get_plugin_settings"){let l=this.settingsSchema;u=l?{success:!0,data:l,request_id:c,method:a}:{success:!1,error:"Settings not initialized",request_id:c,method:a}}else if(a==="get_actions"){let l=this.actionMappings;u=l?{success:!0,data:l,request_id:c,method:a}:{success:!0,data:{buttons:[]},request_id:c,method:a}}o(u)}),this.socket.onAny((i,...o)=>{console.log(`Received event: ${i} with arguments:`,o)});let s=setTimeout(()=>{if(!this.isRegistered){let i=this.retryCount>=this.config.maxRetries?`Plugin registration failed after ${this.config.maxRetries} attempts. Make sure Dot X is running and the plugin server is started.`:"Plugin registration timeout - server may not be running";e(new Error(i))}},this.config.registrationTimeout),n=i=>{if(!this.isDestroyed)if(this.socket.off("connect"),this.socket.off("disconnect"),this.socket.off("error"),this.socket.off("connect_error"),this.retryCount<this.config.maxRetries)this.retryCount++,console.log(`Connection failed (attempt ${this.retryCount}/${this.config.maxRetries}). Retrying in ${this.config.retryDelay}ms...`),console.log(`Error details: ${i.message||i}`),setTimeout(()=>{var o;this.isDestroyed||((o=this.socket)==null||o.disconnect(),r())},this.config.retryDelay);else{clearTimeout(s);let o=this.createDetailedErrorMessage(i);console.error("Max retry attempts reached. Plugin connection failed."),console.error("Error:",o),e(new Error(o))}};this.socket.on("connect",()=>{console.log("Connected to plugin server"),this.retryCount=0,this.socket.emit("register",this.pluginInfo,i=>{clearTimeout(s),console.log("Registration response:",i),i.status==="success"?(console.log("Plugin registered successfully!!"),this.isRegistered=!0,t()):(console.error("Plugin registration failed:",i),n(new Error(`Plugin registration failed: ${i.message||"Unknown error"}`)))})}),this.socket.on("disconnect",i=>{console.log("Disconnected from plugin server:",i),this.isRegistered=!1,!(this.isDestroyed||i==="io client disconnect")&&n(new Error(`Disconnected: ${i}`))}),this.socket.on("error",i=>{console.error("Socket error:",i),n(i)}),this.socket.on("connect_error",i=>{console.error("Failed to connect to plugin server:",i),n(i)})};r()})}createDetailedErrorMessage(t){var e,r;let s=`Failed to connect to plugin server after ${this.config.maxRetries} attempts.`;return t.code==="ECONNREFUSED"||(e=t.message)!=null&&e.includes("ECONNREFUSED")?`${s}
Possible causes:
1. Dot X is not running
2. The plugin server hasn't been started yet
3. The server is running on a different port than expected (${this.config.serverUrl})
Solutions:
1. Make sure Dot X is running
2. Wait for the application to fully load (the plugin server starts automatically)
3. Check if another application is using port 3001
4. Try restarting Dot X
Technical details: Connection refused (${t.code||"N/A"})`:t.code==="ETIMEDOUT"||(r=t.message)!=null&&r.includes("timeout")?`${s}
The connection attempt timed out. This usually means:
1. A firewall is blocking the connection
2. The server is not responding
3. Network connectivity issues
Technical details: Connection timeout (${t.code||"N/A"})`:`${s}
Technical details: ${t.message||t}`}async call(t,e){if(!this.isRegistered)throw new Error("Plugin registration failed");if(this.isDestroyed)throw new Error("Plugin client has been destroyed");let r={method:t,params:e,request_id:`req_${Date.now()}_${Math.random().toString(36).substr(2,9)}`};return new Promise((s,n)=>{let i=setTimeout(()=>{n(new Error(`API request timeout: ${t} took longer than ${this.config.apiTimeout}ms`))},this.config.apiTimeout);this.socket.emit("api_request",r,o=>{clearTimeout(i),o.success?s(o.data):n(new Error(`API request failed (${t}): ${o.error||"Unknown error"}`))})})}disconnect(){this.isDestroyed=!0,this.socket&&this.socket.disconnect(),this.actionCallbacks.clear()}isConnected(){return this.isRegistered&&!this.isDestroyed}getConnectionStatus(){var t;return this.isDestroyed?"destroyed":this.isRegistered?"connected":(t=this.socket)!=null&&t.connected?"connecting":"disconnected"}get ui(){return{showToast:t=>this.call("ui.showToast",t)}}get device(){return this.deviceAPI}async notifySettingsUpdated(){if(this.isConnected())try{await this.call("ui.updated",{})}catch(t){console.warn("Failed to notify settings updated:",t)}}async notifyActionsUpdated(){if(this.isConnected())try{await this.call("ui.actionsUpdated",{})}catch(t){console.warn("Failed to notify actions updated:",t)}}prepareSectionedSchemaWithActionIds(t){return{sections:t.sections.map((e,r)=>({key:e.key||e.title||`section_${r}`,name:e.name,title:e.title,disabled:e.disabled,hidden:e.hidden,expandable:e.expandable,expanded:e.expanded,components:(e.components||[]).map(s=>{let n={...s};if(n.type==="button"&&typeof n.onClick=="function"){let i=`action_${n.key}_${Date.now()}_${Math.random().toString(36).substr(2,5)}`;this.actionCallbacks.set(i,n.onClick),n.actionId=i,delete n.onClick}if(n.type!=="button"&&typeof n.onChange=="function"){let i=`change_${n.key}_${Date.now()}_${Math.random().toString(36).substr(2,5)}`;this.actionCallbacks.set(i,n.onChange),n.onChangeActionId=i,delete n.onChange}return n})}))}}setSectionedSchema(t){Array.from(this.actionCallbacks.keys()).filter(e=>e.startsWith("action_")||e.startsWith("change_")).forEach(e=>this.actionCallbacks.delete(e)),this.settingsSchema=this.prepareSectionedSchemaWithActionIds(t)}setActionMappings(t){let e={buttons:(t.buttons||[]).map(r=>{let s={...r};if(typeof s.onClick=="function"){let n=`channel_action_${s.id}_${Date.now()}_${Math.random().toString(36).substr(2,5)}`;this.actionCallbacks.set(n,s.onClick),s.actionId=n,delete s.onClick}if(r.selectedByChannel&&typeof r.selectedByChannel=="object"&&(s.selectedByChannel={...r.selectedByChannel}),r.settings&&r.settings.sections)try{s.settings=this.prepareSectionedSchemaWithActionIds(r.settings)}catch(n){console.warn("Failed to prepare button settings schema",n),s.settings=r.settings}return s})};this.actionMappings=e}},ku=class{constructor(t){this.sections=[],this.notificationsEnabled=!1,this.onMutate=t}addSection(t){this.currentSectionKey=t;let e=this.sections.find(r=>r.key===t);return e||(e={key:t,components:[]},this.sections.push(e)),new gk(e,this.createNotifier())}addInput(t,e={}){let r=["text","password","textarea","color","file","number","ip_address","mac_address"],n={type:e.type&&r.includes(e.type)?e.type:"text",label:e.label??"",...e},i=this.ensureCurrentSection(),o={key:t,...n};return i.components.push(o),new vk(o,this.createNotifier())}addButton(t){let e={type:"button",label:"",text:"",variant:"primary",buttonTitle:"Apply"},r=this.ensureCurrentSection(),s={key:t,...e};return r.components.push(s),new Ek(s,this.createNotifier())}addSwitch(t){let e={type:"switch",label:""},r=this.ensureCurrentSection(),s={key:t,...e};return r.components.push(s),new wk(s,this.createNotifier())}addSelect(t,e={}){let r={type:"select",label:e.label??"",options:Array.isArray(e.options)?e.options:[],...e},s=this.ensureCurrentSection(),n={key:t,...r};return s.components.push(n),new Tk(n,this.createNotifier())}addText(t){let e={type:"text_display",label:"",text:"",variant:"default"},r=this.ensureCurrentSection(),s={key:t,...e};return r.components.push(s),new bk(s,this.createNotifier())}addBadge(t){let e={type:"badge",label:"",text:"",variant:"default"},r=this.ensureCurrentSection(),s={key:t,...e};return r.components.push(s),new Sk(s,this.createNotifier())}addInfo(t){let e={type:"info",label:"",text:"",variant:"default"},r=this.ensureCurrentSection(),s={key:t,...e};return r.components.push(s),new $k(s,this.createNotifier())}build(){return{sections:this.sections.map(t=>({key:t.key,name:t.name,title:t.title,disabled:t.disabled,hidden:t.hidden,expandable:t.expandable,expanded:t.expanded,components:t.components}))}}ensureCurrentSection(){this.currentSectionKey||this.addSection("general");let t=this.sections.find(e=>e.key===this.currentSectionKey);if(!t){let e={key:this.currentSectionKey,components:[]};return this.sections.push(e),e}return t}enableNotifications(){this.notificationsEnabled=!0}createNotifier(){return()=>{var t;this.notificationsEnabled&&((t=this.onMutate)==null||t.call(this))}}},yk=class{constructor(t,e,r){this.button=t,this.notifyChange=e,this.configStore=r,this.autoPersist=!0;let s=()=>`action.${this.button.id}.selectedByChannel`,n=()=>this.configStore?this.configStore.get(s(),{})||{}:this.button.selectedByChannel&&{...this.button.selectedByChannel}||{},i=o=>{this.configStore&&this.autoPersist&&this.configStore.set(s(),o)};this.button.onClick=o=>{var a;let c=o&&Object.prototype.hasOwnProperty.call(o,"channel")?o.channel:void 0,u=o&&Object.prototype.hasOwnProperty.call(o,"selected")?o.selected:void 0;if(c==null){typeof this.pluginClickHandler=="function"&&this.pluginClickHandler(o);return}let l=String(c),f=n(),d=typeof u=="boolean"?!!u:!f[l],h={...f,[l]:d};i(h),this.button.selectedByChannel||(this.button.selectedByChannel={}),this.button.selectedByChannel[l]=d,(a=this.notifyChange)==null||a.call(this),typeof this.pluginClickHandler=="function"&&this.pluginClickHandler({selected:d,channel:c})}}setTitle(t){var e;return this.button.title=t,(e=this.notifyChange)==null||e.call(this),this}setIcon(t){var e;return this.button.icon=t,(e=this.notifyChange)==null||e.call(this),this}setHidden(t){var e;return this.button.hidden=t,(e=this.notifyChange)==null||e.call(this),this}setDisabled(t){var e;return this.button.disabled=t,(e=this.notifyChange)==null||e.call(this),this}onClick(t){var e;return this.pluginClickHandler=t,(e=this.notifyChange)==null||e.call(this),this}addSettings(t){var e;let r=new ku(()=>{var s;this.button.settings=r.build(),(s=this.notifyChange)==null||s.call(this)});return t(r),this.button.settings=r.build(),(e=this.notifyChange)==null||e.call(this),this}setSelected(t,e){var r,s,n;let i=`action.${this.button.id}.selectedByChannel`,o=()=>this.configStore?this.configStore.get(i,{})||{}:this.button.selectedByChannel&&{...this.button.selectedByChannel}||{},a=f=>{this.configStore&&this.autoPersist&&this.configStore.set(i,f)};if(Array.isArray(t)){let f={};for(let d=0;d<t.length;d++)!!t[d]&&(f[String(d)]=!0);return this.button.selectedByChannel=f,a(f),(r=this.notifyChange)==null||r.call(this),this}if(typeof t=="object"){let f={};for(let d in t)Object.prototype.hasOwnProperty.call(t,d)&&(f[String(d)]=!!t[d]);return this.button.selectedByChannel=f,a(f),(s=this.notifyChange)==null||s.call(this),this}let c=String(e);this.button.selectedByChannel||(this.button.selectedByChannel={}),this.button.selectedByChannel[c]=!!t;let l={...o(),[c]:!!t};return a(l),(n=this.notifyChange)==null||n.call(this),this}getSelectedMap(){if(this.configStore){let t=`action.${this.button.id}.selectedByChannel`;return this.configStore.get(t,{})||{}}return this.button.selectedByChannel&&{...this.button.selectedByChannel}||{}}isSelected(t){return!!this.getSelectedMap()[String(t)]}setAutoPersist(t){return this.autoPersist=!!t,this}},gk=class{constructor(t,e){this.section=t,this.notifyChange=e}setName(t){var e;return this.section.name=t,(e=this.notifyChange)==null||e.call(this),this}setDisabled(t){var e;return this.section.disabled=t,(e=this.notifyChange)==null||e.call(this),this}setHidden(t){var e;return this.section.hidden=t,(e=this.notifyChange)==null||e.call(this),this}setExpandable(t){var e;return this.section.expandable=t,(e=this.notifyChange)==null||e.call(this),this}setExpanded(t){var e;return this.section.expanded=t,(e=this.notifyChange)==null||e.call(this),this}},_k=class{constructor(t,e){this.buttons=[],this.notificationsEnabled=!1,this.onMutate=t,this.configStore=e}addSystemUtilButton(t){let e={id:t,title:""};return this.buttons.push(e),new yk(e,this.createNotifier(),this.configStore)}build(){return{buttons:this.buttons.map(t=>{let e={...t};if(!e.selectedByChannel&&this.configStore){let r=`action.${e.id}.selectedByChannel`;e.selectedByChannel=this.configStore.get(r,{})||{}}return e})}}enableNotifications(){this.notificationsEnabled=!0}createNotifier(){return()=>{var t;this.notificationsEnabled&&((t=this.onMutate)==null||t.call(this))}}},vk=class{constructor(t,e){this.component=t,this.notifyChange=e}setPlaceholder(t){var e;return this.component.placeholder=t,(e=this.notifyChange)==null||e.call(this),this}setValue(t){var e;return this.component.default=t,(e=this.notifyChange)==null||e.call(this),this}onChange(t){var e;return this.component.onChange=t,(e=this.notifyChange)==null||e.call(this),this}setDesc(t){var e;return this.component.description=t,(e=this.notifyChange)==null||e.call(this),this}setName(t){var e;return this.component.label=t,(e=this.notifyChange)==null||e.call(this),this}setLabel(t){var e;return this.component.label=t,(e=this.notifyChange)==null||e.call(this),this}setRequired(t){var e;return this.component.required=t,(e=this.notifyChange)==null||e.call(this),this}setDisabled(t){var e;return this.component.disabled=t,(e=this.notifyChange)==null||e.call(this),this}setType(t){var e;return this.component.type=t,(e=this.notifyChange)==null||e.call(this),this}assign(t){var e;return Object.assign(this.component,t),(e=this.notifyChange)==null||e.call(this),this}setMax(t){var e;return this.component.max=t,(e=this.notifyChange)==null||e.call(this),this}setMin(t){var e;return this.component.min=t,(e=this.notifyChange)==null||e.call(this),this}},Ek=class{constructor(t,e){this.component=t,this.notifyChange=e}setTitle(t){var e;return this.component.buttonTitle=t,(e=this.notifyChange)==null||e.call(this),this}setLabel(t){var e;return this.component.label=t,(e=this.notifyChange)==null||e.call(this),this}setStyle(t){var e;return this.component.variant=t,(e=this.notifyChange)==null||e.call(this),this}onClick(t){var e;return this.component.onClick=t,(e=this.notifyChange)==null||e.call(this),this}setDesc(t){var e;return this.component.description=t,(e=this.notifyChange)==null||e.call(this),this}assign(t){var e;return Object.assign(this.component,t),(e=this.notifyChange)==null||e.call(this),this}},wk=class{constructor(t,e){this.component=t,this.notifyChange=e}setValue(t){var e;return this.component.default=t,(e=this.notifyChange)==null||e.call(this),this}onChange(t){var e;return this.component.onChange=t,(e=this.notifyChange)==null||e.call(this),this}setLabel(t){var e;return this.component.label=t,(e=this.notifyChange)==null||e.call(this),this}setDesc(t){var e;return this.component.description=t,(e=this.notifyChange)==null||e.call(this),this}setRequired(t){var e;return this.component.required=t,(e=this.notifyChange)==null||e.call(this),this}setDisabled(t){var e;return this.component.disabled=t,(e=this.notifyChange)==null||e.call(this),this}assign(t){var e;return Object.assign(this.component,t),(e=this.notifyChange)==null||e.call(this),this}},bk=class{constructor(t,e){this.component=t,this.notifyChange=e}setText(t){var e;return this.component.text=t,(e=this.notifyChange)==null||e.call(this),this}setStyle(t){var e;return this.component.variant=t,(e=this.notifyChange)==null||e.call(this),this}setLabel(t){var e;return this.component.label=t,(e=this.notifyChange)==null||e.call(this),this}setDesc(t){var e;return this.component.description=t,(e=this.notifyChange)==null||e.call(this),this}assign(t){var e;return Object.assign(this.component,t),(e=this.notifyChange)==null||e.call(this),this}},Sk=class{constructor(t,e){this.component=t,this.notifyChange=e}setText(t){var e;return this.component.text=t,(e=this.notifyChange)==null||e.call(this),this}setStyle(t){var e;return this.component.variant=t,(e=this.notifyChange)==null||e.call(this),this}setLabel(t){var e;return this.component.label=t,(e=this.notifyChange)==null||e.call(this),this}setDesc(t){var e;return this.component.description=t,(e=this.notifyChange)==null||e.call(this),this}assign(t){var e;return Object.assign(this.component,t),(e=this.notifyChange)==null||e.call(this),this}},$k=class{constructor(t,e){this.component=t,this.notifyChange=e}setText(t){var e;return this.component.text=t,(e=this.notifyChange)==null||e.call(this),this}setStyle(t){var e;return this.component.variant=t,(e=this.notifyChange)==null||e.call(this),this}useIcon(t){var e;return this.component.showIcon=t,(e=this.notifyChange)==null||e.call(this),this}assign(t){var e;return Object.assign(this.component,t),(e=this.notifyChange)==null||e.call(this),this}},Tk=class{constructor(t,e){this.component=t,this.notifyChange=e}setLabel(t){var e;return this.component.label=t,(e=this.notifyChange)==null||e.call(this),this}setDesc(t){var e;return this.component.description=t,(e=this.notifyChange)==null||e.call(this),this}setRequired(t){var e;return this.component.required=t,(e=this.notifyChange)==null||e.call(this),this}setDisabled(t){var e;return this.component.disabled=t,(e=this.notifyChange)==null||e.call(this),this}setPlaceholder(t){var e;return this.component.placeholder=t,(e=this.notifyChange)==null||e.call(this),this}setValue(t){var e;return this.component.default=t,(e=this.notifyChange)==null||e.call(this),this}setOptions(t){var e;let r=Array.isArray(t)?t.map(s=>typeof s=="object"&&s!==null&&"value"in s&&"label"in s?s:{value:s,label:String(s)}):[];return this.component.options=r,(e=this.notifyChange)==null||e.call(this),this}onChange(t){var e;return this.component.onChange=t,(e=this.notifyChange)==null||e.call(this),this}assign(t){var e;return Object.assign(this.component,t),(e=this.notifyChange)==null||e.call(this),this}};var Ck=class{constructor(t,e){this.client=new mk(t,e),this.ui=this.client.ui,this.device=this.client.device;let r=process.cwd(),s=`${t.id||"plugin"}-config`;this.configStore=new Xr({cwd:r,configName:s,fileExtension:"json"}),this.config={set:(i,o)=>{if(typeof i=="object"&&i!==null){this.configStore.set(i);return}this.configStore.set(i,o)},get:(i,o)=>this.configStore.get(i,o),delete:i=>{this.configStore.delete(i)},clear:()=>{this.configStore.clear()},has:i=>this.configStore.has(i),all:()=>({...this.configStore.store}),path:()=>this.configStore.path,init:i=>{let o=process.cwd(),a=`${t.id||"plugin"}-config`;this.configStore=new Xr({cwd:o,configName:a,fileExtension:"json",schema:i==null?void 0:i.schema,defaults:i==null?void 0:i.defaults})}};let n=new _k(()=>{let i=n.build();this.client.setActionMappings(i),this.client.notifyActionsUpdated()},this.config);n.enableNotifications(),this.actionmapper=n,this.settingsPage={addSettings:async i=>{let o=new ku(()=>{let c=o.build();this.client.setSectionedSchema(c),this.client.notifySettingsUpdated()});i(o);let a=o.build();this.client.setSectionedSchema(a),o.enableNotifications()}}}getClient(){return this.client}waitForConnection(){return this.client.waitForConnection()}buildSettingsSchema(t){let e=new ku;return t(e),e.build()}getConnectionStatus(){return this.client.getConnectionStatus()}isConnected(){return this.client.isConnected()}async onLoad(){console.log("Plugin loaded")}async onUnload(){console.log("Plugin unloaded"),this.client.disconnect()}};function Ok(){try{let t=sg.join(process.cwd(),"manifest.json");if(qi.existsSync(t)){let e=qi.readFileSync(t,"utf-8");return JSON.parse(e)}}catch(t){console.warn("Failed to read manifest.json:",t)}return null}async function ng(t,e){let r=Ok(),s=(r==null?void 0:r.name)||t.name||"Unknown Plugin",n=(r==null?void 0:r.version)||"1.0.0",i=(r==null?void 0:r.id)||s.toLowerCase().replace(/\s+/g,"-");console.log(`Starting ${s} v${n}...`),r!=null&&r.description&&console.log(`Description: ${r.description}`),r!=null&&r.author&&console.log(`Author: ${r.author}`);let o={id:i,name:s,version:n,connected_at:new Date().toISOString()},a,c=!1;try{a=new t(o,e),console.log("Waiting for connection to be established..."),await a.waitForConnection(),console.log("Connection established, calling onLoad..."),await a.onLoad(),console.log(`${s} loaded successfully!`)}catch(l){console.error(`Failed to start ${s}:`,l.message),process.exit(1)}let u=async()=>{if(!c){c=!0,console.log(`
Shutting down ${s}...`);try{await a.onUnload(),console.log("Plugin unloaded successfully.")}catch(l){console.error("Error during plugin unload:",l)}process.exit(0)}};process.on("SIGINT",u),process.on("SIGTERM",u)}var ig=Ck;var on=class extends ig{settings;async onLoad(){this.initConfig(),this.getConfig();let e=await this.device.getConnected();this.device.onConnect(r=>{this.ui.showToast({message:`${r.name} connected on ${r.port}`,type:"success",duration:3e3})}),this.device.onDisconnect(r=>{this.ui.showToast({message:`${r.name} disconnected`,type:"warning",duration:3e3})}),this.device.onUpdate(r=>{r.changes.forEach(s=>{})});try{await this.settingsPage.addSettings(s=>{var $,_,E,S,F,z,ae;let n=s.addSection("Device Monitoring").setName("\u{1F50C} Device Monitoring");s.addInfo("deviceInfo").setText("Device monitoring shows real-time connection status and updates.").setStyle("info");let i=s.addInfo("deviceError").setText("").setStyle("error");e.length===0&&i.setText("No device connected. Please connect a device to continue."),this.device.onConnect(()=>{i.setText("")}),this.device.onDisconnect(()=>{i.setText("Device disconnected. Please reconnect to continue.").setStyle("error")});let o=s.addBadge("connectionStatus").setLabel("Device Connection Status").setText(e.length>0?`Connected: ${e[0].name}`:"No device connected").setDesc("Real-time device connection state using this.device API.").setStyle(e.length>0?"success":"error");this.device.onConnect(q=>{o.setText(`Connected: ${q.name}`),o.setStyle("success")}),this.device.onDisconnect(()=>{o.setText("No device connected"),o.setStyle("error")}),e.length>0&&s.addText("devicePort").setLabel("Device Port").setText(e[0].port).setDesc("COM port where the device is connected."),s.addButton("checkDevicesButton").setTitle("Check Connected Devices").onClick(async()=>{let q=await this.device.getConnected();if(q.length>0){let Fe=q.map(vt=>`${vt.name} (${vt.port})`).join(", ");this.ui.showToast({message:`Connected: ${Fe}`,type:"success",duration:4e3})}else this.ui.showToast({message:"No devices connected",type:"info",duration:3e3})});let a=s.addSection("General");s.addInfo("autoSaveInfo").setText("Your changes are saved automatically when you update any field.").setStyle("success");let c=s.addText("currentTime").setLabel("Current Time").setText(new Date().toLocaleTimeString()).setDesc("This is the current time.").setStyle("info"),u=s.addInput("customGreeting").setType("ip_address").setLabel("Broker IP").setPlaceholder("Enter broker IP").setValue((($=this.settings)==null?void 0:$.brokerIP)||"192.168.1.1").setRequired(!0).setDesc("This broker IP is used by the plugin when needed.").onChange(q=>{u.setValue(q.value),this.config.set("settings.brokerIP",q.value)}),l=s.addInput("brokerPort").setType("number").setLabel("Broker Port").setPlaceholder("Enter broker port").setValue(((_=this.settings)==null?void 0:_.brokerPort)||1883).setRequired(!0).setDesc("This broker port is used by the plugin when needed.").onChange(q=>{l.setValue(q.value),this.config.set("settings.brokerPort",q.value)}),f=s.addSelect("quality").setLabel("Quality").setPlaceholder("Pick one").setOptions([{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]).setValue(((E=this.settings)==null?void 0:E.quality)||"medium").setDesc("Select processing quality").onChange(({value:q})=>{f.setValue(q),this.config.set("settings.quality",q)}),d=s.addSwitch("demoSwitch").setLabel("Expandable Section Switch").setValue(((S=this.settings)==null?void 0:S.demoSwitch)||!1).onChange(q=>{m.setExpanded(q.value)}),h=s.addSwitch("hiddenSectionSwitch").setLabel("Hidden Section Switch").setValue(((F=this.settings)==null?void 0:F.hiddenSectionSwitch)||!1).onChange(q=>{m.setHidden(q.value)}),y=s.addSwitch("disabledSwitch").setLabel("Disabled Section Switch").setValue(((z=this.settings)==null?void 0:z.disabledSwitch)||!1).onChange(q=>{m.setDisabled(q.value)});s.addButton("demoButton").setTitle("Toggle Section").onClick(()=>{d.setValue(!0)});let m=s.addSection("advanced").setExpandable(!0).setName("Advanced");s.addInfo("advancedWarning").setText("Modifying advanced settings may affect plugin behavior. Use with caution.").setStyle("warning");let g=s.addSwitch("debug").setLabel("Debug Flag").setValue(((ae=this.settings)==null?void 0:ae.debug)||!1).onChange(q=>{g.setValue(q.value),u.setDisabled(q.value),this.config.set("settings.debug",q.value),this.ui.showToast({message:"Debug flag changed to: "+q.value,type:"info"}),q.value?v.setText("Debug mode is enabled. Additional logging is active.").setStyle("info"):v.setText("Debug mode is disabled.").setStyle("default")}),v=s.addInfo("debugInfo").setText("Debug mode is currently disabled.").setStyle("default");s.addInfo("simpleNote").setText("Note: This plugin demonstrates all available field components.").setStyle("default").useIcon(!1)}),this.actionmapper.addSystemUtilButton("bolt").setTitle("Boltt").setIcon("fas fa-lg fa-bolt").onClick(({selected:s,channel:n})=>{this.ui.showToast({message:`Hello on ch ${n} (${s?"ON":"OFF"})`,type:"success"})}).addSettings(s=>{s.addSection("General").setName("General"),s.addSwitch("enabled").setLabel("Enable EQ").setValue(!0).setDesc("Toggle the equalizer")})}catch(r){console.error("Error during plugin initialization:",r)}}getConfig(){this.settings=this.config.get("settings")}saveSettings(){this.config.set("settings",this.settings)}initConfig(){this.config.init({schema:{settings:{type:"object",properties:{brokerIP:{default:"192.168.1.1",description:"The broker IP to use when interacting with the plugin.",type:"string"}}}}})}async onUnload(){}};require.main===module&&ng(on);
/*! Bundled license information:
xmlhttprequest-ssl/lib/XMLHttpRequest.js:
(**
* Wrapper for built-in http.js to emulate the browser XMLHttpRequest object.
*
* This can be used with JS designed for browsers to improve reuse of code and
* allow the use of existing libraries.
*
* Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs.
*
* @author Dan DeFelippi <dan@driverdan.com>
* @contributor David Ellis <d.f.ellis@ieee.org>
* @license MIT
*)
*/