@lioneltay/claude-pilot 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +63 -63
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3,36 +3,36 @@
|
|
|
3
3
|
import { createRequire as __createRequire } from 'module';
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var FA=Object.create;var ig=Object.defineProperty;var MA=Object.getOwnPropertyDescriptor;var HA=Object.getOwnPropertyNames;var VA=Object.getPrototypeOf,zA=Object.prototype.hasOwnProperty;var V=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var UA=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of HA(e))!zA.call(t,s)&&s!==r&&ig(t,s,{get:()=>e[s],enumerable:!(n=MA(e,s))||n.enumerable});return t};var og=(t,e,r)=>(r=t!=null?FA(VA(t)):{},UA(e||!t||!t.__esModule?ig(r,"default",{value:t,enumerable:!0}):r,t));var Ws=E(Du=>{var ko=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},ju=class extends ko{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Du.CommanderError=ko;Du.InvalidArgumentError=ju});var xo=E(Mu=>{var{InvalidArgumentError:BA}=Ws(),Fu=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new BA(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function GA(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Mu.Argument=Fu;Mu.humanReadableArgName=GA});var Vu=E(ag=>{var{humanReadableArgName:WA}=xo(),Hu=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(s=>!s._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((s,i)=>s.name().localeCompare(i.name())),r}compareOptions(e,r){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(s=>!s.hidden),n=e._getHelpOption();if(n&&!n.hidden){let s=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!s&&!i?r.push(n):n.long&&!i?r.push(e.createOption(n.long,n.description)):n.short&&!s&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let s=n.options.filter(i=>!i.hidden);r.push(...s)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>WA(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,s)=>Math.max(n,r.subcommandTerm(s).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,s)=>Math.max(n,r.optionTerm(s).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,s)=>Math.max(n,r.optionTerm(s).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,s)=>Math.max(n,r.argumentTerm(s).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let s=e.parent;s;s=s.parent)n=s.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),s=r.helpWidth||80,i=2,o=2;function a(d,m){if(m){let g=`${d.padEnd(n+o)}${m}`;return r.wrap(g,s-i,n+o)}return d}function l(d){return d.join(`
|
|
7
7
|
`).replace(/^/gm," ".repeat(i))}let u=[`Usage: ${r.commandUsage(e)}`,""],c=r.commandDescription(e);c.length>0&&(u=u.concat([r.wrap(c,s,0),""]));let f=r.visibleArguments(e).map(d=>a(r.argumentTerm(d),r.argumentDescription(d)));f.length>0&&(u=u.concat(["Arguments:",l(f),""]));let p=r.visibleOptions(e).map(d=>a(r.optionTerm(d),r.optionDescription(d)));if(p.length>0&&(u=u.concat(["Options:",l(p),""])),this.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(m=>a(r.optionTerm(m),r.optionDescription(m)));d.length>0&&(u=u.concat(["Global Options:",l(d),""]))}let h=r.visibleCommands(e).map(d=>a(r.subcommandTerm(d),r.subcommandDescription(d)));return h.length>0&&(u=u.concat(["Commands:",l(h),""])),u.join(`
|
|
8
8
|
`)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,n,s=40){let i=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",o=new RegExp(`[\\n][${i}]+`);if(e.match(o))return e;let a=r-n;if(a<s)return e;let l=e.slice(0,n),u=e.slice(n).replace(`\r
|
|
9
9
|
`,`
|
|
10
10
|
`),c=" ".repeat(n),p="\\s\u200B",h=new RegExp(`
|
|
11
11
|
|.{1,${a-1}}([${p}]|$)|[^${p}]+?([${p}]|$)`,"g"),d=u.match(h)||[];return l+d.map((m,g)=>m===`
|
|
12
12
|
`?"":(g>0?c:"")+m.trimEnd()).join(`
|
|
13
|
-
`)}};
|
|
13
|
+
`)}};ag.Help=Hu});var Gu=E(Bu=>{var{InvalidArgumentError:JA}=Ws(),zu=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=YA(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new JA(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return KA(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Uu=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let s=this.negativeOptions.get(n).presetArg,i=s!==void 0?s:!1;return r.negate===(i===e)}};function KA(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function YA(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Bu.Option=zu;Bu.DualOptions=Uu});var ug=E(lg=>{function XA(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let s=1;s<=t.length;s++){let i=1;t[s-1]===e[n-1]?i=0:i=1,r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+i),s>1&&n>1&&t[s-1]===e[n-2]&&t[s-2]===e[n-1]&&(r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1))}return r[t.length][e.length]}function QA(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let n=[],s=3,i=.4;return e.forEach(o=>{if(o.length<=1)return;let a=XA(t,o),l=Math.max(t.length,o.length);(l-a)/l>i&&(a<s?(s=a,n=[o]):a===s&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
|
|
14
14
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
15
|
-
(Did you mean ${n[0]}?)`:""}
|
|
16
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new
|
|
17
|
-
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new
|
|
18
|
-
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=s=>[s.name()].concat(s.aliases()),n=r(e).find(s=>this._findCommand(s));if(n){let s=r(this._findCommand(n)).join("|"),i=r(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${s}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let s=(i,o,a)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let l=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,l,o):i!==null&&e.variadic&&(i=e._concatValue(i,l)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let o=`error: option '${e.flags}' argument '${i}' is invalid.`;s(i,o,"cli")}),e.envVar&&this.on("optionEnv:"+r,i=>{let o=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;s(i,o,"env")}),this}_optionEx(e,r,n,s,i){if(typeof r=="object"&&r instanceof
|
|
15
|
+
(Did you mean ${n[0]}?)`:""}lg.suggestSimilar=QA});var pg=E(hg=>{var ZA=V("node:events").EventEmitter,Wu=V("node:child_process"),yr=V("node:path"),Ju=V("node:fs"),Ne=V("node:process"),{Argument:eC,humanReadableArgName:tC}=xo(),{CommanderError:Ku}=Ws(),{Help:rC}=Vu(),{Option:cg,DualOptions:nC}=Gu(),{suggestSimilar:fg}=ug(),Yu=class t extends ZA{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>Ne.stdout.write(r),writeErr:r=>Ne.stderr.write(r),getOutHelpWidth:()=>Ne.stdout.isTTY?Ne.stdout.columns:void 0,getErrHelpWidth:()=>Ne.stderr.isTTY?Ne.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let s=r,i=n;typeof s=="object"&&s!==null&&(i=s,s=null),i=i||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return s&&(l.description(s),l._executableHandler=!0),i.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(i.noHelp||i.hidden),l._executableFile=i.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),s?this:l}createCommand(e){return new t(e)}createHelp(){return Object.assign(new rC,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
16
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new eC(e,r)}argument(e,r,n,s){let i=this.createArgument(e,r);return typeof n=="function"?i.default(s).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,s]=e.match(/([^ ]+) *(.*)/),i=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),s&&o.arguments(s),i&&o.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
17
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Ku(e,r,n)),Ne.exit(e)}action(e){let r=n=>{let s=this.registeredArguments.length,i=n.slice(0,s);return this._storeOptionsAsProperties?i[s]=this:i[s]=this.opts(),i.push(this),e.apply(this,i)};return this._actionHandler=r,this}createOption(e,r){return new cg(e,r)}_callParseArg(e,r,n,s){try{return e.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let o=`${s} ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
18
|
+
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=s=>[s.name()].concat(s.aliases()),n=r(e).find(s=>this._findCommand(s));if(n){let s=r(this._findCommand(n)).join("|"),i=r(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${s}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let s=(i,o,a)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let l=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,l,o):i!==null&&e.variadic&&(i=e._concatValue(i,l)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let o=`error: option '${e.flags}' argument '${i}' is invalid.`;s(i,o,"cli")}),e.envVar&&this.on("optionEnv:"+r,i=>{let o=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;s(i,o,"env")}),this}_optionEx(e,r,n,s,i){if(typeof r=="object"&&r instanceof cg)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!e.mandatory),typeof s=="function")o.default(i).argParser(s);else if(s instanceof RegExp){let a=s;s=(l,u)=>{let c=a.exec(l);return c?c[0]:u},o.default(i).argParser(s)}else o.default(s);return this.addOption(o)}option(e,r,n,s){return this._optionEx({},e,r,n,s)}requiredOption(e,r,n,s){return this._optionEx({mandatory:!0},e,r,n,s)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ne.versions?.electron&&(r.from="electron");let s=Ne.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ne.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Ne.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function i(c,f){let p=yr.resolve(c,f);if(Ju.existsSync(p))return p;if(s.includes(yr.extname(f)))return;let h=s.find(d=>Ju.existsSync(`${p}${d}`));if(h)return`${p}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=Ju.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=yr.resolve(yr.dirname(c),a)}if(a){let c=i(a,o);if(!c&&!e._executableFile&&this._scriptPath){let f=yr.basename(this._scriptPath,yr.extname(this._scriptPath));f!==this._name&&(c=i(a,`${f}-${e._name}`))}o=c||o}n=s.includes(yr.extname(o));let l;Ne.platform!=="win32"?n?(r.unshift(o),r=dg(Ne.execArgv).concat(r),l=Wu.spawn(Ne.argv[0],r,{stdio:"inherit"})):l=Wu.spawn(o,r,{stdio:"inherit"}):(r.unshift(o),r=dg(Ne.execArgv).concat(r),l=Wu.spawn(Ne.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{Ne.on(f,()=>{l.killed===!1&&l.exitCode===null&&l.kill(f)})});let u=this._exitCallback;l.on("close",c=>{c=c??1,u?u(new Ku(c,"commander.executeSubCommandAsync","(close)")):Ne.exit(c)}),l.on("error",c=>{if(c.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",p=`'${o}' does not exist
|
|
19
19
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${f}`;throw new Error(p)}else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)Ne.exit(1);else{let f=new
|
|
21
|
+
- ${f}`;throw new Error(p)}else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)Ne.exit(1);else{let f=new Ku(1,"commander.executeSubCommandAsync","(error)");f.nestedError=c,u(f)}}),this.runningCommand=l}_dispatchSubcommand(e,r,n){let s=this._findCommand(e);s||this.help({error:!0});let i;return i=this._chainOrCallSubCommandHook(i,s,"preSubcommand"),i=this._chainOrCall(i,()=>{if(s._executableHandler)this._executeSubCommand(s,r.concat(n));else return s._parseCommand(r,n)}),i}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,s,i)=>{let o=s;if(s!==null&&n.parseArg){let a=`error: command-argument value '${s}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,s,i,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,s)=>{let i=n.defaultValue;n.variadic?s<this.args.length?(i=this.args.slice(s),n.parseArg&&(i=i.reduce((o,a)=>e(n,a,o),n.defaultValue))):i===void 0&&(i=[]):s<this.args.length&&(i=this.args[s],n.parseArg&&(i=e(n,i,n.defaultValue))),r[s]=i}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,s=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(o=>{s.push({hookedCommand:i,callback:o})})}),r==="postAction"&&s.reverse(),s.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let s=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{s=this._chainOrCall(s,()=>i(this,r))}),s}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(i,e,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(i))s(),this._processArguments(),this.parent.emit(i,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let s=n.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let s=e.find(i=>n.conflictsWith.includes(i.attributeName()));s&&this._conflictingOption(n,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],s=r,i=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=null;for(;i.length;){let l=i.shift();if(l==="--"){s===n&&s.push(l),s.push(...i);break}if(a&&!o(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let u=this._findOption(l);if(u){if(u.required){let c=i.shift();c===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,c)}else if(u.optional){let c=null;i.length>0&&!o(i[0])&&(c=i.shift()),this.emit(`option:${u.name()}`,c)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),i.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),c=this._findOption(l.slice(0,u));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,l.slice(u+1));continue}}if(o(l)&&(s=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),i.length>0&&r.push(...i);break}else if(this._defaultCommandName){n.push(l),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){s.push(l),i.length>0&&s.push(...i);break}s.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let s=this.options[n].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
22
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
23
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
24
|
-
`),this.outputHelp({error:!0}));let n=r||{},s=n.exitCode||1,i=n.code||"commander.error";this._exit(s,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ne.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ne.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new
|
|
25
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>
|
|
24
|
+
`),this.outputHelp({error:!0}));let n=r||{},s=n.exitCode||1,i=n.code||"commander.error";this._exit(s,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ne.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ne.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new nC(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(s=>!r(s)).forEach(s=>{this.setOptionValueWithSource(s,n.implied[s],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=o=>{let a=o.attributeName(),l=this.getOptionValue(a),u=this.options.find(f=>f.negate&&a===f.attributeName()),c=this.options.find(f=>!f.negate&&a===f.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:c||o},s=o=>{let a=n(o),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${s(e)} cannot be used with ${s(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let s=[],i=this;do{let o=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);s=s.concat(o),i=i.parent}while(i&&!i._enablePositionalOptions);r=fg(e,s)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(i=>{s.push(i.name()),i.alias()&&s.push(i.alias())}),r=fg(e,s)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let s=this.createOption(r,n);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
25
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>tC(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=yr.basename(e,yr.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=s=>this._outputConfiguration.writeErr(s):n=s=>this._outputConfiguration.writeOut(s),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation(n);if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Ne.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${n.join("', '")}'`);let s=`${e}Help`;return this.on(s,i=>{let o;typeof r=="function"?o=r({error:i.error,command:i.command}):o=r,o&&i.write(`${o}
|
|
27
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(s=>r.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
28
|
-
`;for(let i=0;i<n;++i){let o=t.nodes[i],a=e+(i===s?" ":"\u2502 ");r+=e,r+=i===s?"\u2514\u2500":"\u251C\u2500",r+=o.nodes.length===0?"\u2500 ":"\u252C ",r+=
|
|
29
|
-
`).slice(0,2).map(r=>r.trim()).join(" -- ")}Lg.exports={getPluginName:vC}});var Do=E((a8,jg)=>{"use strict";function wC(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}jg.exports={isPromiseLike:wC}});var Fg=E((l8,Dg)=>{"use strict";var{EventEmitter:RC}=V("node:events"),{inherits:OC}=V("node:util"),{debug:Ge}=jo(),{createPromise:TC}=xg(),{AVV_ERR_PLUGIN_EXEC_TIMEOUT:$C}=qo(),{getPluginName:PC}=qg(),{isPromiseLike:AC}=Do();function Gn(t,e,r,n,s){this.queue=t,this.func=e,this.options=r,this.isAfter=n,this.timeout=s,this.started=!1,this.name=PC(e,r),this.queue.pause(),this._error=null,this.loaded=!1,this._promise=null,this.startTime=null}OC(Gn,RC);Gn.prototype.exec=function(t,e){Ge("exec",this.name),this.server=t;let r=this.func,n=this.name,s=!1;this.options=typeof this.options=="function"?this.options(this.server):this.options;let i=null,o=l=>{if(s){Ge("loading complete",n);return}this._error=l,Ge(l?"exec errored":"exec completed",n),s=!0,i&&clearTimeout(i),e(l)};this.timeout>0&&(Ge("setting up timeout",n,this.timeout),i=setTimeout(function(){Ge("timed out",n),i=null;let l=new $C(n);l.fn=r,o(l)},this.timeout)),this.started=!0,this.startTime=Date.now(),this.emit("start",this.server?this.server.name:null,this.name,Date.now());let a=r(this.server,this.options,o);AC(a)?(Ge("exec: resolving promise",n),a.then(()=>process.nextTick(o),l=>process.nextTick(o,l))):r.length<3&&o()};Gn.prototype.loadedSoFar=function(){if(Ge("loadedSoFar",this.name),this.loaded)return Promise.resolve();let t=()=>{this.server.after((r,n)=>{this._error=r,this.queue.pause(),this._promise&&(r?(Ge("rejecting promise",this.name,r),this._promise.reject(r)):(Ge("resolving promise",this.name),this._promise.resolve()),this._promise=null),process.nextTick(n,r)}),this.queue.resume()},e;return this._promise?e=Promise.resolve():(this._promise=TC(),e=this._promise.promise,this.server?t():this.on("start",t)),e};Gn.prototype.enqueue=function(t,e){Ge("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.queue.push(t,e)};Gn.prototype.finish=function(t,e){Ge("finish",this.name,t);let r=()=>{this.loaded||(Ge("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,e(t))};if(t){this._promise&&(this._promise.reject(t),this._promise=null),r();return}let n=()=>{if(Ge("check",this.name,this.queue.length(),this.queue.running(),this._promise),this.queue.length()===0&&this.queue.running()===0)if(this._promise){let s=()=>{Ge("wrap"),queueMicrotask(n)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else r();else Ge("delayed",this.name),this.queue.drain=()=>{Ge("drain",this.name),this.queue.drain=CC,queueMicrotask(n)}};queueMicrotask(n),this.queue.resume()};function CC(){}Dg.exports={Plugin:Gn}});var Hg=E((u8,Mg)=>{"use strict";var{AVV_ERR_PLUGIN_NOT_VALID:rc}=qo();function IC(t){if(!(t&&(typeof t=="function"||typeof t.then=="function")))throw Array.isArray(t)?new rc("array"):t===null?new rc("null"):new rc(typeof t)}Mg.exports={validatePlugin:IC}});var zg=E((c8,Vg)=>{"use strict";function NC(t){return t!==null&&typeof t=="object"&&typeof t.default=="function"}Vg.exports={isBundledOrTypescriptPlugin:NC}});var Gg=E((f8,Bg)=>{"use strict";var{debug:Ug}=jo(),{kThenifyDoNotWrap:nc}=Bn();function kC(){if(this.booted){Ug("thenify returning undefined because we are already booted");return}if(this[nc]){this[nc]=!1;return}return Ug("thenify"),(t,e)=>this._loadRegistered().then(()=>(this[nc]=!0,t(this._server)),e)}Bg.exports={thenify:kC}});var Jg=E((d8,Wg)=>{"use strict";var{isPromiseLike:xC}=Do(),{kAvvio:LC}=Bn();function qC(t,e,r){let n=t.apply(t,e);xC(n)&&!n[LC]?n.then(()=>process.nextTick(r),s=>process.nextTick(r,s)):r&&process.nextTick(r)}Wg.exports={executeWithThenable:qC}});var ny=E((h8,ry)=>{"use strict";var Fo=vg(),jC=V("node:events").EventEmitter,DC=V("node:util").inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ks,AVV_ERR_CALLBACK_NOT_FN:Wn,AVV_ERR_ROOT_PLG_BOOTED:FC,AVV_ERR_READY_TIMEOUT:MC,AVV_ERR_ATTRIBUTE_ALREADY_DEFINED:HC}=qo(),{kAvvio:Xg,kIsOnCloseHandler:Qg}=Bn(),{TimeTree:VC}=Ig(),{Plugin:Zg}=Fg(),{debug:Jn}=jo(),{validatePlugin:zC}=Hg(),{isBundledOrTypescriptPlugin:UC}=zg(),{isPromiseLike:BC}=Do(),{thenify:ey}=Gg(),{executeWithThenable:Kg}=Jg();function je(t,e,r){if(typeof t=="function"&&arguments.length===1&&(r=t,e={},t=null),typeof e=="function"&&(r=e,e={}),e=e||{},e.autostart=e.autostart!==!1,e.timeout=Number(e.timeout)||0,e.expose=e.expose||{},!new.target)return new je(t,e,r);this._server=t||this,this._opts=e,t&&this._expose(),this._current=[],this._error=null,this._lastUsed=null,this.setMaxListeners(0),r&&this.once("start",r),this.started=!1,this.booted=!1,this.pluginTree=new VC,this._readyQ=Fo(this,ty,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Yg},this._closeQ=Fo(this,WC,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Yg},this._doStart=null;let n=this;this._root=new Zg(Fo(this,this._loadPluginNextTick,1),function(i,o,a){n._doStart=a,o.autostart&&n.start()},e,!1,0),this._trackPluginLoading(this._root),this._loadPlugin(this._root,s=>{Jn("root plugin ready");try{this.emit("preReady"),this._root=null}catch(i){s=s||this._error||i}if(s){if(this._error=s,this._readyQ.length()===0)throw s}else this.booted=!0;this._readyQ.resume()})}DC(je,jC);je.prototype.start=function(){return this.started=!0,process.nextTick(this._doStart),this};je.prototype.override=function(t,e,r){return t};je.prototype[Xg]=!0;je.prototype.use=function(t,e){return this._lastUsed=this._addPlugin(t,e,!1),this};je.prototype._loadRegistered=function(){let t=this._current[0];return!this.started&&!this.booted&&process.nextTick(()=>this._root.queue.resume()),t?t.loadedSoFar():Promise.resolve()};Object.defineProperty(je.prototype,"then",{get:ey});je.prototype._addPlugin=function(t,e,r){if(UC(t)&&(t=t.default),zC(t),e=e||{},this.booted)throw new FC;let n=this._current[0],s=this._opts.timeout;if(!n.loaded&&n.timeout>0){let o=Date.now()-n.startTime;s=n.timeout-(o+3)}let i=new Zg(Fo(this,this._loadPluginNextTick,1),t,e,r,s);if(this._trackPluginLoading(i),n.loaded)throw new Error(i.name,n.name);return n.enqueue(i,o=>{o&&(this._error=o)}),i};je.prototype._expose=function(){let e=this,r=e._server,{use:n="use",after:s="after",ready:i="ready",onClose:o="onClose",close:a="close"}=this._opts.expose;if(r[n])throw new Ks(n,"use");if(r[n]=function(l,u){return e.use(l,u),this},r[s])throw new Ks(s,"after");if(r[s]=function(l){return typeof l!="function"?e._loadRegistered():(e.after(sc(l,this)),this)},r[i])throw new Ks(i,"ready");if(r[i]=function(l){if(l&&typeof l!="function")throw new Wn(i,typeof l);return e.ready(l?sc(l,this):void 0)},r[o])throw new Ks(o,"onClose");if(r[o]=function(l){if(typeof l!="function")throw new Wn(o,typeof l);return e.onClose(JC(l,this)),this},r[a])throw new Ks(a,"close");if(r[a]=function(l){if(l&&typeof l!="function")throw new Wn(a,typeof l);return l?(e.close(sc(l,this)),this):e.close()},r.then)throw new HC("then");Object.defineProperty(r,"then",{get:ey.bind(e)}),r[Xg]=!0};je.prototype.after=function(t){if(!t)return this._loadRegistered();this._addPlugin(e.bind(this),{},!0);function e(r,n,s){ty.call(this,t,s)}return this};je.prototype.onClose=function(t){if(typeof t!="function")throw new Wn("onClose",typeof t);return t[Qg]=!0,this._closeQ.unshift(t,e=>{e&&(this._error=e)}),this};je.prototype.close=function(t){let e;if(t){if(typeof t!="function")throw new Wn("close",typeof t)}else e=new Promise(function(r,n){t=function(s){if(s)return n(s);r()}});return this.ready(()=>{this._error=null,this._closeQ.push(t),process.nextTick(this._closeQ.resume.bind(this._closeQ))}),e};je.prototype.ready=function(t){if(t){if(typeof t!="function")throw new Wn("ready",typeof t);this._readyQ.push(t),queueMicrotask(this.start.bind(this));return}return new Promise((e,r)=>{this._readyQ.push(s),this.start();let n=this._current[0].server;function s(i,o,a){i?r(i):e(n),process.nextTick(a)}})};je.prototype._trackPluginLoading=function(t){let e=this._current[0]?.name||null;t.once("start",(r,n,s)=>{let i=this.pluginTree.start(e||null,n,s);t.once("loaded",(o,a,l)=>{this.pluginTree.stop(i,l)})})};je.prototype.prettyPrint=function(){return this.pluginTree.prettyPrint()};je.prototype.toJSON=function(){return this.pluginTree.toJSON()};je.prototype._loadPlugin=function(t,e){let r=this;if(BC(t.func)){t.func.then(o=>{typeof o.default=="function"&&(o=o.default),t.func=o,this._loadPlugin(t,e)},e);return}let n=r._current[0];if(r._current.unshift(t),r._error&&!t.isAfter){Jn("skipping loading of plugin as instance errored and it is not an after",t.name),process.nextTick(i);return}let s=n&&n.server||r._server;if(!t.isAfter)try{s=r.override(s,t.func,t.options)}catch(o){return Jn("override errored",t.name),i(o)}t.exec(s,i);function i(o){t.finish(o,a=>{r._current.shift(),e(a)})}};je.prototype._loadPluginNextTick=function(t,e){process.nextTick(this._loadPlugin.bind(this),t,e)};function Yg(){}function ty(t,e){let r=this._server,n=this._error;if(this._error=null,t.length===0)this._error=n,Kg(t,[],e);else if(t.length===1)Kg(t,[n],e);else if(this._opts.timeout===0){let s=i=>{this._error=i,e(this._error)};t.length===2?t(n,s):t(n,r,s)}else GC.call(this,t,n,r,e)}function GC(t,e,r,n){let s=t.unwrappedName??t.name;Jn("setting up ready timeout",s,this._opts.timeout);let i=setTimeout(()=>{Jn("timed out",s),i=null;let a=new MC(s);a.fn=t,this._error=a,n(a)},this._opts.timeout);t.length===2?t(e,o.bind(this)):t(e,r,o.bind(this));function o(a){i&&(clearTimeout(i),this._error=a,n(this._error))}}function WC(t,e){let r=this._server,n=t[Qg];if(t.length===0||t.length===1){let s;n?s=t(r):s=t(this._error),s&&typeof s.then=="function"?(Jn("resolving close/onClose promise"),s.then(()=>process.nextTick(e),i=>process.nextTick(e,i))):process.nextTick(e)}else t.length===2?t(n?r:this._error,e):n?t(r,e):t(this._error,r,e)}function JC(t,e){return r.bind(e);function r(n,s){let i;t.length===0?(i=t(),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t.length===1?(i=t(this),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t(this,s)}}function sc(t,e){let r=n.bind(e);return r.unwrappedName=t.name,r;function n(s,i){let o;t?t.length===0?(o=t(),o&&o.then?o.then(function(){process.nextTick(i,s)},i):process.nextTick(i,s)):t.length===1?(o=t(s),o&&o.then?o.then(function(){process.nextTick(i)},i):process.nextTick(i)):t.length===2?t(s,i):t(s,this,i):process.nextTick(i)}}ry.exports=je});var De=E((p8,sy)=>{"use strict";var KC={kAvvioBoot:Symbol("fastify.avvioBoot"),kChildren:Symbol("fastify.children"),kServerBindings:Symbol("fastify.serverBindings"),kBodyLimit:Symbol("fastify.bodyLimit"),kSupportedHTTPMethods:Symbol("fastify.acceptedHTTPMethods"),kRoutePrefix:Symbol("fastify.routePrefix"),kLogLevel:Symbol("fastify.logLevel"),kLogSerializers:Symbol("fastify.logSerializers"),kHooks:Symbol("fastify.hooks"),kContentTypeParser:Symbol("fastify.contentTypeParser"),kState:Symbol("fastify.state"),kOptions:Symbol("fastify.options"),kDisableRequestLogging:Symbol("fastify.disableRequestLogging"),kPluginNameChain:Symbol("fastify.pluginNameChain"),kRouteContext:Symbol("fastify.context"),kGenReqId:Symbol("fastify.genReqId"),kHttp2ServerSessions:Symbol("fastify.http2ServerSessions"),kSchemaController:Symbol("fastify.schemaController"),kSchemaHeaders:Symbol("headers-schema"),kSchemaParams:Symbol("params-schema"),kSchemaQuerystring:Symbol("querystring-schema"),kSchemaBody:Symbol("body-schema"),kSchemaResponse:Symbol("response-schema"),kSchemaErrorFormatter:Symbol("fastify.schemaErrorFormatter"),kSchemaVisited:Symbol("fastify.schemas.visited"),kRequest:Symbol("fastify.Request"),kRequestPayloadStream:Symbol("fastify.RequestPayloadStream"),kRequestAcceptVersion:Symbol("fastify.RequestAcceptVersion"),kRequestCacheValidateFns:Symbol("fastify.request.cache.validateFns"),kRequestOriginalUrl:Symbol("fastify.request.originalUrl"),kFourOhFour:Symbol("fastify.404"),kCanSetNotFoundHandler:Symbol("fastify.canSetNotFoundHandler"),kFourOhFourLevelInstance:Symbol("fastify.404LogLevelInstance"),kFourOhFourContext:Symbol("fastify.404ContextKey"),kDefaultJsonParse:Symbol("fastify.defaultJSONParse"),kReply:Symbol("fastify.Reply"),kReplySerializer:Symbol("fastify.reply.serializer"),kReplyIsError:Symbol("fastify.reply.isError"),kReplyHeaders:Symbol("fastify.reply.headers"),kReplyTrailers:Symbol("fastify.reply.trailers"),kReplyHasStatusCode:Symbol("fastify.reply.hasStatusCode"),kReplyHijacked:Symbol("fastify.reply.hijacked"),kReplyStartTime:Symbol("fastify.reply.startTime"),kReplyNextErrorHandler:Symbol("fastify.reply.nextErrorHandler"),kReplyEndTime:Symbol("fastify.reply.endTime"),kReplyErrorHandlerCalled:Symbol("fastify.reply.errorHandlerCalled"),kReplyIsRunningOnErrorHook:Symbol("fastify.reply.isRunningOnErrorHook"),kReplySerializerDefault:Symbol("fastify.replySerializerDefault"),kReplyCacheSerializeFns:Symbol("fastify.reply.cache.serializeFns"),kTestInternals:Symbol("fastify.testInternals"),kErrorHandler:Symbol("fastify.errorHandler"),kErrorHandlerAlreadySet:Symbol("fastify.errorHandlerAlreadySet"),kChildLoggerFactory:Symbol("fastify.childLoggerFactory"),kHasBeenDecorated:Symbol("fastify.hasBeenDecorated"),kKeepAliveConnections:Symbol("fastify.keepAliveConnections"),kRouteByFastify:Symbol("fastify.routeByFastify")};sy.exports=KC});var oy=E((m8,Mo)=>{"use strict";var{format:ic}=V("node:util");function YC(t){return iy({...t,name:"DeprecationWarning"})}function iy({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=ic(r,o,a,l):o&&a?u=ic(r,o,a):o?u=ic(r,o):u=r,u},i}var oc={createWarning:iy,createDeprecation:YC};Mo.exports=oc;Mo.exports.default=oc;Mo.exports.processWarning=oc});var Kn=E((g8,ay)=>{"use strict";var{createWarning:Ys}=oy(),XC=Ys({name:"FastifyWarning",code:"FSTWRN001",message:"The %s schema for %s: %s is missing. This may indicate the schema is not well specified.",unlimited:!0}),QC=Ys({name:"FastifyWarning",code:"FSTWRN003",message:"The %s mixes async and callback styles that may lead to unhandled rejections. Please use only one of them.",unlimited:!0}),ZC=Ys({name:"FastifyWarning",code:"FSTWRN004",message:"It seems that you are overriding an errorHandler in the same scope, which can lead to subtle bugs.",unlimited:!0}),eI=Ys({name:"FastifySecurity",code:"FSTSEC001",message:'You are using /%s/ Content-Type which may be vulnerable to CORS attack. Please make sure your RegExp start with "^" or include ";?" to proper detection of the essence MIME type.',unlimited:!0}),tI=Ys({name:"FastifyWarning",code:"FSTDEP022",message:'The router options for %s property access is deprecated. Please use "options.routerOptions" instead for accessing router options. The router options will be removed in `fastify@6`.',unlimited:!0});ay.exports={FSTWRN001:XC,FSTWRN003:QC,FSTWRN004:ZC,FSTSEC001:eI,FSTDEP022:tI}});var He=E((y8,Ho)=>{"use strict";var L=Qu(),fn={FST_ERR_NOT_FOUND:L("FST_ERR_NOT_FOUND","Not Found",404),FST_ERR_OPTIONS_NOT_OBJ:L("FST_ERR_OPTIONS_NOT_OBJ","Options must be an object",500,TypeError),FST_ERR_QSP_NOT_FN:L("FST_ERR_QSP_NOT_FN","querystringParser option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:L("FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN","schemaController.bucket option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:L("FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN","schemaErrorFormatter option should be a non async function. Instead got '%s'.",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ","ajv.customOptions option should be an object, instead got '%s'",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR","ajv.plugins option should be an array, instead got '%s'",500,TypeError),FST_ERR_VALIDATION:L("FST_ERR_VALIDATION","%s",400),FST_ERR_LISTEN_OPTIONS_INVALID:L("FST_ERR_LISTEN_OPTIONS_INVALID","Invalid listen options: '%s'",500,TypeError),FST_ERR_ERROR_HANDLER_NOT_FN:L("FST_ERR_ERROR_HANDLER_NOT_FN","Error Handler must be a function",500,TypeError),FST_ERR_ERROR_HANDLER_ALREADY_SET:L("FST_ERR_ERROR_HANDLER_ALREADY_SET","Error Handler already set in this scope. Set 'allowErrorHandlerOverride: true' to allow overriding.",500,TypeError),FST_ERR_CTP_ALREADY_PRESENT:L("FST_ERR_CTP_ALREADY_PRESENT","Content type parser '%s' already present."),FST_ERR_CTP_INVALID_TYPE:L("FST_ERR_CTP_INVALID_TYPE","The content type should be a string or a RegExp",500,TypeError),FST_ERR_CTP_EMPTY_TYPE:L("FST_ERR_CTP_EMPTY_TYPE","The content type cannot be an empty string",500,TypeError),FST_ERR_CTP_INVALID_HANDLER:L("FST_ERR_CTP_INVALID_HANDLER","The content type handler should be a function",500,TypeError),FST_ERR_CTP_INVALID_PARSE_TYPE:L("FST_ERR_CTP_INVALID_PARSE_TYPE","The body parser can only parse your data as 'string' or 'buffer', you asked '%s' which is not supported.",500,TypeError),FST_ERR_CTP_BODY_TOO_LARGE:L("FST_ERR_CTP_BODY_TOO_LARGE","Request body is too large",413,RangeError),FST_ERR_CTP_INVALID_MEDIA_TYPE:L("FST_ERR_CTP_INVALID_MEDIA_TYPE","Unsupported Media Type: %s",415),FST_ERR_CTP_INVALID_CONTENT_LENGTH:L("FST_ERR_CTP_INVALID_CONTENT_LENGTH","Request body size did not match Content-Length",400,RangeError),FST_ERR_CTP_EMPTY_JSON_BODY:L("FST_ERR_CTP_EMPTY_JSON_BODY","Body cannot be empty when content-type is set to 'application/json'",400),FST_ERR_CTP_INVALID_JSON_BODY:L("FST_ERR_CTP_INVALID_JSON_BODY","Body is not valid JSON but content-type is set to 'application/json'",400),FST_ERR_CTP_INSTANCE_ALREADY_STARTED:L("FST_ERR_CTP_INSTANCE_ALREADY_STARTED",'Cannot call "%s" when fastify instance is already started!',400),FST_ERR_DEC_ALREADY_PRESENT:L("FST_ERR_DEC_ALREADY_PRESENT","The decorator '%s' has already been added!"),FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:L("FST_ERR_DEC_DEPENDENCY_INVALID_TYPE","The dependencies of decorator '%s' must be of type Array.",500,TypeError),FST_ERR_DEC_MISSING_DEPENDENCY:L("FST_ERR_DEC_MISSING_DEPENDENCY","The decorator is missing dependency '%s'."),FST_ERR_DEC_AFTER_START:L("FST_ERR_DEC_AFTER_START","The decorator '%s' has been added after start!"),FST_ERR_DEC_REFERENCE_TYPE:L("FST_ERR_DEC_REFERENCE_TYPE","The decorator '%s' of type '%s' is a reference type. Use the { getter, setter } interface instead."),FST_ERR_DEC_UNDECLARED:L("FST_ERR_DEC_UNDECLARED","No decorator '%s' has been declared on %s."),FST_ERR_HOOK_INVALID_TYPE:L("FST_ERR_HOOK_INVALID_TYPE","The hook name must be a string",500,TypeError),FST_ERR_HOOK_INVALID_HANDLER:L("FST_ERR_HOOK_INVALID_HANDLER","%s hook should be a function, instead got %s",500,TypeError),FST_ERR_HOOK_INVALID_ASYNC_HANDLER:L("FST_ERR_HOOK_INVALID_ASYNC_HANDLER","Async function has too many arguments. Async hooks should not use the 'done' argument.",500,TypeError),FST_ERR_HOOK_NOT_SUPPORTED:L("FST_ERR_HOOK_NOT_SUPPORTED","%s hook not supported!",500,TypeError),FST_ERR_MISSING_MIDDLEWARE:L("FST_ERR_MISSING_MIDDLEWARE","You must register a plugin for handling middlewares, visit fastify.dev/docs/latest/Reference/Middleware/ for more info.",500),FST_ERR_HOOK_TIMEOUT:L("FST_ERR_HOOK_TIMEOUT","A callback for '%s' hook%s timed out. You may have forgotten to call 'done' function or to resolve a Promise"),FST_ERR_LOG_INVALID_DESTINATION:L("FST_ERR_LOG_INVALID_DESTINATION","Cannot specify both logger.stream and logger.file options"),FST_ERR_LOG_INVALID_LOGGER:L("FST_ERR_LOG_INVALID_LOGGER","Invalid logger object provided. The logger instance should have these functions(s): '%s'.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_INSTANCE:L("FST_ERR_LOG_INVALID_LOGGER_INSTANCE","loggerInstance only accepts a logger instance.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_CONFIG:L("FST_ERR_LOG_INVALID_LOGGER_CONFIG","logger options only accepts a configuration object.",500,TypeError),FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:L("FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED","You cannot provide both logger and loggerInstance. Please provide only one.",500,TypeError),FST_ERR_REP_INVALID_PAYLOAD_TYPE:L("FST_ERR_REP_INVALID_PAYLOAD_TYPE","Attempted to send payload of invalid type '%s'. Expected a string or Buffer.",500,TypeError),FST_ERR_REP_RESPONSE_BODY_CONSUMED:L("FST_ERR_REP_RESPONSE_BODY_CONSUMED","Response.body is already consumed."),FST_ERR_REP_READABLE_STREAM_LOCKED:L("FST_ERR_REP_READABLE_STREAM_LOCKED","ReadableStream was locked. You should call releaseLock() method on reader before sending."),FST_ERR_REP_ALREADY_SENT:L("FST_ERR_REP_ALREADY_SENT",'Reply was already sent, did you forget to "return reply" in "%s" (%s)?'),FST_ERR_REP_SENT_VALUE:L("FST_ERR_REP_SENT_VALUE","The only possible value for reply.sent is true.",500,TypeError),FST_ERR_SEND_INSIDE_ONERR:L("FST_ERR_SEND_INSIDE_ONERR","You cannot use `send` inside the `onError` hook"),FST_ERR_SEND_UNDEFINED_ERR:L("FST_ERR_SEND_UNDEFINED_ERR","Undefined error has occurred"),FST_ERR_BAD_STATUS_CODE:L("FST_ERR_BAD_STATUS_CODE","Called reply with an invalid status code: %s"),FST_ERR_BAD_TRAILER_NAME:L("FST_ERR_BAD_TRAILER_NAME","Called reply.trailer with an invalid header name: %s"),FST_ERR_BAD_TRAILER_VALUE:L("FST_ERR_BAD_TRAILER_VALUE","Called reply.trailer('%s', fn) with an invalid type: %s. Expected a function."),FST_ERR_FAILED_ERROR_SERIALIZATION:L("FST_ERR_FAILED_ERROR_SERIALIZATION","Failed to serialize an error. Error: %s. Original error: %s"),FST_ERR_MISSING_SERIALIZATION_FN:L("FST_ERR_MISSING_SERIALIZATION_FN",'Missing serialization function. Key "%s"'),FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:L("FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN",'Missing serialization function. Key "%s:%s"'),FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:L("FST_ERR_REQ_INVALID_VALIDATION_INVOCATION",'Invalid validation invocation. Missing validation function for HTTP part "%s" nor schema provided.'),FST_ERR_SCH_MISSING_ID:L("FST_ERR_SCH_MISSING_ID","Missing schema $id property"),FST_ERR_SCH_ALREADY_PRESENT:L("FST_ERR_SCH_ALREADY_PRESENT","Schema with id '%s' already declared!"),FST_ERR_SCH_CONTENT_MISSING_SCHEMA:L("FST_ERR_SCH_CONTENT_MISSING_SCHEMA","Schema is missing for the content type '%s'"),FST_ERR_SCH_DUPLICATE:L("FST_ERR_SCH_DUPLICATE","Schema with '%s' already present!"),FST_ERR_SCH_VALIDATION_BUILD:L("FST_ERR_SCH_VALIDATION_BUILD","Failed building the validation schema for %s: %s, due to error %s"),FST_ERR_SCH_SERIALIZATION_BUILD:L("FST_ERR_SCH_SERIALIZATION_BUILD","Failed building the serialization schema for %s: %s, due to error %s"),FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:L("FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX",'response schemas should be nested under a valid status code, e.g { 2xx: { type: "object" } }'),FST_ERR_INIT_OPTS_INVALID:L("FST_ERR_INIT_OPTS_INVALID","Invalid initialization options: '%s'"),FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:L("FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE","Cannot set forceCloseConnections to 'idle' as your HTTP server does not support closeIdleConnections method"),FST_ERR_DUPLICATED_ROUTE:L("FST_ERR_DUPLICATED_ROUTE","Method '%s' already declared for route '%s'"),FST_ERR_BAD_URL:L("FST_ERR_BAD_URL","'%s' is not a valid url component",400,URIError),FST_ERR_ASYNC_CONSTRAINT:L("FST_ERR_ASYNC_CONSTRAINT","Unexpected error from async constraint",500),FST_ERR_INVALID_URL:L("FST_ERR_INVALID_URL","URL must be a string. Received '%s'",400,TypeError),FST_ERR_ROUTE_OPTIONS_NOT_OBJ:L("FST_ERR_ROUTE_OPTIONS_NOT_OBJ",'Options for "%s:%s" route must be an object',500,TypeError),FST_ERR_ROUTE_DUPLICATED_HANDLER:L("FST_ERR_ROUTE_DUPLICATED_HANDLER",'Duplicate handler for "%s:%s" route is not allowed!',500),FST_ERR_ROUTE_HANDLER_NOT_FN:L("FST_ERR_ROUTE_HANDLER_NOT_FN","Error Handler for %s:%s route, if defined, must be a function",500,TypeError),FST_ERR_ROUTE_MISSING_HANDLER:L("FST_ERR_ROUTE_MISSING_HANDLER",'Missing handler function for "%s:%s" route.',500),FST_ERR_ROUTE_METHOD_INVALID:L("FST_ERR_ROUTE_METHOD_INVALID","Provided method is invalid!",500,TypeError),FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:L("FST_ERR_ROUTE_METHOD_NOT_SUPPORTED","%s method is not supported.",500),FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:L("FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED","Body validation schema for %s:%s route is not supported!",500),FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:L("FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT","'bodyLimit' option must be an integer > 0. Got '%s'",500,TypeError),FST_ERR_ROUTE_REWRITE_NOT_STR:L("FST_ERR_ROUTE_REWRITE_NOT_STR",'Rewrite url for "%s" needs to be of type "string" but received "%s"',500,TypeError),FST_ERR_REOPENED_CLOSE_SERVER:L("FST_ERR_REOPENED_CLOSE_SERVER","Fastify has already been closed and cannot be reopened"),FST_ERR_REOPENED_SERVER:L("FST_ERR_REOPENED_SERVER","Fastify is already listening"),FST_ERR_INSTANCE_ALREADY_LISTENING:L("FST_ERR_INSTANCE_ALREADY_LISTENING","Fastify instance is already listening. %s"),FST_ERR_PLUGIN_VERSION_MISMATCH:L("FST_ERR_PLUGIN_VERSION_MISMATCH","fastify-plugin: %s - expected '%s' fastify version, '%s' is installed"),FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:L("FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE","The decorator '%s'%s is not present in %s"),FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:L("FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER","The %s plugin being registered mixes async and callback styles. Async plugin should not mix async and callback style.",500,TypeError),FST_ERR_PLUGIN_CALLBACK_NOT_FN:L("FST_ERR_PLUGIN_CALLBACK_NOT_FN","fastify-plugin: %s",500,TypeError),FST_ERR_PLUGIN_NOT_VALID:L("FST_ERR_PLUGIN_NOT_VALID","fastify-plugin: %s"),FST_ERR_ROOT_PLG_BOOTED:L("FST_ERR_ROOT_PLG_BOOTED","fastify-plugin: %s"),FST_ERR_PARENT_PLUGIN_BOOTED:L("FST_ERR_PARENT_PLUGIN_BOOTED","fastify-plugin: %s"),FST_ERR_PLUGIN_TIMEOUT:L("FST_ERR_PLUGIN_TIMEOUT","fastify-plugin: %s")};function rI(t,e){return e.cause=t,e}Ho.exports=fn;Ho.exports.appendStackTrace=rI;Ho.exports.AVVIO_ERRORS_MAP={AVV_ERR_CALLBACK_NOT_FN:fn.FST_ERR_PLUGIN_CALLBACK_NOT_FN,AVV_ERR_PLUGIN_NOT_VALID:fn.FST_ERR_PLUGIN_NOT_VALID,AVV_ERR_ROOT_PLG_BOOTED:fn.FST_ERR_ROOT_PLG_BOOTED,AVV_ERR_PARENT_PLG_LOADED:fn.FST_ERR_PARENT_PLUGIN_BOOTED,AVV_ERR_READY_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT,AVV_ERR_PLUGIN_EXEC_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT}});var Dr=E((_8,gy)=>{"use strict";var nI=["onRoute","onRegister","onReady","onListen","preClose","onClose"],fy=["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError","onRequestAbort"],sI=fy.concat(nI),{FST_ERR_HOOK_INVALID_TYPE:iI,FST_ERR_HOOK_INVALID_HANDLER:oI,FST_ERR_SEND_UNDEFINED_ERR:Vo,FST_ERR_HOOK_TIMEOUT:aI,FST_ERR_HOOK_NOT_SUPPORTED:lI,AVVIO_ERRORS_MAP:ly,appendStackTrace:uy}=He(),{kChildren:Xs,kHooks:dy,kRequestPayloadStream:cy}=De();function Qs(){this.onRequest=[],this.preParsing=[],this.preValidation=[],this.preSerialization=[],this.preHandler=[],this.onResponse=[],this.onSend=[],this.onError=[],this.onRoute=[],this.onRegister=[],this.onReady=[],this.onListen=[],this.onTimeout=[],this.onRequestAbort=[],this.preClose=[]}Qs.prototype=Object.create(null);Qs.prototype.validate=function(t,e){if(typeof t!="string")throw new iI;if(Array.isArray(this[t])===!1)throw new lI(t);if(typeof e!="function")throw new oI(t,Object.prototype.toString.call(e))};Qs.prototype.add=function(t,e){this.validate(t,e),this[t].push(e)};function uI(t){let e=new Qs;return e.onRequest=t.onRequest.slice(),e.preParsing=t.preParsing.slice(),e.preValidation=t.preValidation.slice(),e.preSerialization=t.preSerialization.slice(),e.preHandler=t.preHandler.slice(),e.onSend=t.onSend.slice(),e.onResponse=t.onResponse.slice(),e.onError=t.onError.slice(),e.onRoute=t.onRoute.slice(),e.onRegister=t.onRegister.slice(),e.onTimeout=t.onTimeout.slice(),e.onRequestAbort=t.onRequestAbort.slice(),e.onReady=[],e.onListen=[],e.preClose=[],e}function hy(t,e,r,n){let s=r[dy][t],i=0,o=0;l();function a(c){let f=s[i-1]?.name,p=f?` "${f}"`:"";if(c){c.code==="AVV_ERR_READY_TIMEOUT"?c=uy(c,new aI(t,p)):c=ly[c.code]!=null?uy(c,new ly[c.code](c.message)):c,n(c);return}n()}function l(c){if(c){a(c);return}if(i===s.length&&o===r[Xs].length){i===0&&o===0?a():e(function(p,h){a(p),h(p)});return}if(i===s.length&&o<r[Xs].length){let f=r[Xs][o++];hy(t,e,f,l);return}e(u(s[i++],r)),l()}function u(c,f){return function(p,h){if(p){h(p);return}if(c.length===1){try{c.call(f,h)}catch(d){h(d)}return}try{let d=c.call(f);if(d&&typeof d.then=="function"){d.then(h,h);return}}catch(d){p=d}h(p)}}}function py(t){let e=t[dy].onListen,r=e.length,n=0,s=0;i();function i(a){if(a&&t.log.error(a),n===r){for(;s<t[Xs].length;){let l=t[Xs][s++];py(l)}return}o(e[n++],t,i)}async function o(a,l,u){if(a.length===1){try{a.call(l,u)}catch(c){u(c)}return}try{let c=a.call(l);if(c&&typeof c.then=="function"){c.then(u,u);return}u()}catch(c){u(c)}}}function Yn(t){return function(r,n,s,i){let o=0;function a(c){if(c||o===r.length){i(c,n,s);return}let f;try{f=t(r[o++],n,s,a)}catch(p){i(p,n,s);return}f&&typeof f.then=="function"&&f.then(l,u)}function l(){a()}function u(c){c||(c=new Vo),i(c,n,s)}a()}}function cI(t,e,r,n){return t(e,r,n)}var fI=Yn(cI),dI=Yn(Zs),hI=Yn(Zs),pI=Yn(Zs),mI=Yn(Zs);function my(t,e,r,n,s){let i=0;function o(u,c){if(u){s(u,e,r,n);return}if(c!==void 0&&(n=c),i===t.length){s(null,e,r,n);return}let f;try{f=t[i++](e,r,n,o)}catch(p){s(p,e,r);return}f&&typeof f.then=="function"&&f.then(a,l)}function a(u){o(null,u)}function l(u){u||(u=new Vo),s(u,e,r,n)}o()}var gI=my;function yI(t,e,r,n){let s=0;function i(l,u){if(r.sent)return;if(u!==void 0&&(e[cy]=u),l||s===t.length){n(l,e,r);return}let c;try{c=t[s++](e,r,e[cy],i)}catch(f){n(f,e,r);return}c&&typeof c.then=="function"&&c.then(o,a)}function o(l){i(null,l)}function a(l){l||(l=new Vo),n(l,e,r)}i()}function _I(t,e,r){let n=0;function s(a){if(a||n===t.length){r(a,e);return}let l;try{l=t[n++](e,s)}catch(u){r(u,e);return}l&&typeof l.then=="function"&&l.then(i,o)}function i(){s()}function o(a){a||(a=new Vo),r(a,e)}s()}function Zs(t,e,r,n){if(r.sent!==!0)return t(e,r,n)}gy.exports={Hooks:Qs,buildHooks:uI,hookRunnerGenerator:Yn,preParsingHookRunner:yI,onResponseHookRunner:fI,onSendHookRunner:my,preSerializationHookRunner:gI,onRequestAbortHookRunner:_I,hookIterator:Zs,hookRunnerApplication:hy,onListenHookRunner:py,preHandlerHookRunner:hI,preValidationHookRunner:dI,onRequestHookRunner:mI,onTimeoutHookRunner:pI,lifecycleHooks:fy,supportedHooks:sI}});var _y=E((S8,yy)=>{"use strict";yy.exports=function(){return{[Symbol.iterator]:function*(){},add(){},delete(){},has(){return!0}}}});var ac=E((E8,Ey)=>{"use strict";var{kTestInternals:SI}=De();function Sy(){let t,e;return{promise:new Promise((n,s)=>{t=n,e=s}),resolve:t,reject:e}}Ey.exports={withResolvers:typeof Promise.withResolvers=="function"?Promise.withResolvers.bind(Promise):Sy,[SI]:{withResolvers:Sy}}});var Iy=E((b8,Cy)=>{"use strict";var EI=V("node:http"),bI=V("node:https"),by=V("node:http2"),vI=V("node:dns"),wI=V("node:os"),{kState:ke,kOptions:RI,kServerBindings:OI,kHttp2ServerSessions:dn}=De(),{FSTWRN003:TI}=Kn(),{onListenHookRunner:zo}=Dr(),{FST_ERR_REOPENED_CLOSE_SERVER:wy,FST_ERR_REOPENED_SERVER:Ry,FST_ERR_LISTEN_OPTIONS_INVALID:$I,FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:PI}=He(),AI=_y(),Oy=ac();Cy.exports.createServer=CI;function Ty(t){return`Server listening at ${t}`}function CI(t,e){let r=Py(t,e);function n(u={port:0,host:"localhost"},c=void 0){if(typeof c=="function"&&(c.constructor.name==="AsyncFunction"&&TI("listen method"),u.cb=c),u.signal){if(typeof u.signal.on!="function"&&typeof u.signal.addEventListener!="function")throw new $I("Invalid options.signal");if(this[ke].aborted=u.signal.aborted,this[ke].aborted)return this.close();{let p=()=>{this[ke].aborted=!0,this.close()};u.signal.addEventListener("abort",p,{once:!0})}}let f;if(u.path==null?f=u.host??"localhost":f=u.host,(!Object.hasOwn(u,"host")||u.host==null)&&(u.host=f),f==="localhost"?u.cb=(p,h)=>{if(p){c(p,h);return}vy.call(this,r,e,t,u,()=>{this[ke].listening=!0,c(null,h),zo(this)})}:u.cb=(p,h)=>{if(p){c(p,h);return}this[ke].listening=!0,c(null,h),zo(this)},c===void 0)return II.call(this,r,u).then(h=>{let{promise:d,resolve:m}=Oy.withResolvers();return f==="localhost"?vy.call(this,r,e,t,u,()=>{this[ke].listening=!0,m(h),zo(this)}):(m(h),zo(this)),d});this.ready($y.call(this,r,u))}let s=typeof r.closeAllConnections=="function",i=typeof r.closeIdleConnections=="function",o=typeof r.closeHttp2Sessions=="function",a=t.forceCloseConnections;if(a==="idle"&&!i)throw new PI;typeof a!="boolean"&&(a=i?"idle":!1);let l=!s&&a===!0?new Set:AI();return{server:r,listen:n,forceCloseConnections:a,serverHasCloseAllConnections:s,serverHasCloseHttp2Sessions:o,keepAliveConnections:l}}function vy(t,e,r,n,s){this[ke].listening=!1,vI.lookup(n.host,{all:!0},(i,o)=>{if(i||this[ke].aborted){s();return}let a=t.listening&&r.serverFactory,l=0,u=0;if(!a){let f=t.address();for(let p of o)if(p.address!==f.address){l++;let h=Object.assign({},n,{host:p.address,port:f.port,cb:g=>{u++,g||this[OI].push(d),u===l&&s()}}),d=Py(r,e),m=()=>{d.close(()=>{}),typeof d.closeAllConnections=="function"&&r.forceCloseConnections===!0&&d.closeAllConnections(),typeof d.closeHttp2Sessions=="function"&&d.closeHttp2Sessions()};d.on("upgrade",t.emit.bind(t,"upgrade")),t.on("unref",m),t.on("close",m),t.on("error",m),this[ke].listening=!1,$y.call(this,d,h)()}}if(l===0){s();return}let c=t.unref;t.unref=function(){c.call(t),t.emit("unref")}})}function $y(t,e){let r=n=>{if(t.removeListener("error",r),t.removeListener("listening",r),n)this[ke].listening=!1,e.cb(n,null);else{let s=Ay.call(this,t,e.listenTextResolver||Ty);e.cb(null,s)}};return n=>{if(n!=null)return e.cb(n);if(this[ke].listening&&this[ke].closing)return e.cb(new wy,null);if(this[ke].listening)return e.cb(new Ry,null);t.once("error",r),this[ke].closing||(t.once("listening",r),t.listen(e),this[ke].listening=!0)}}function II(t,e){return this[ke].listening&&this[ke].closing?Promise.reject(new wy):this[ke].listening?Promise.reject(new Ry):this.ready().then(()=>{if(this[ke].aborted)return;let{promise:r,resolve:n,reject:s}=Oy.withResolvers(),i=l=>{a(),this[ke].listening=!1,s(l)},o=()=>{a(),this[ke].listening=!0,n(Ay.call(this,t,e.listenTextResolver||Ty))};function a(){t.removeListener("error",i),t.removeListener("listening",o)}return t.once("error",i),t.once("listening",o),t.listen(e),r})}function Py(t,e){if(t.serverFactory)return t.serverFactory(e,t);let r=t.https===!0?{}:t.https;if(t.http2){let s=typeof r=="object"?by.createSecureServer(r,e):by.createServer(t.http,e);return s.on("session",i=>i.setTimeout(t.http2SessionTimeout,()=>{i.close()})),t.forceCloseConnections===!0&&(s.closeHttp2Sessions=kI(s)),s.setTimeout(t.connectionTimeout),s}let n=r?bI.createServer(r,e):EI.createServer(t.http,e);return n.keepAliveTimeout=t.keepAliveTimeout,n.requestTimeout=t.requestTimeout,n.setTimeout(t.connectionTimeout),t.maxRequestsPerSocket>0&&(n.maxRequestsPerSocket=t.maxRequestsPerSocket),n}function NI(t){return t.address==="0.0.0.0"?Object.values(wI.networkInterfaces()).flatMap(e=>e.filter(r=>r.family==="IPv4")).sort(e=>e.internal?-1:1).map(e=>e.address):[t.address]}function Ay(t,e){let r;typeof t.address()=="string"?r=[t.address()]:(t.address().address.indexOf(":")===-1?r=NI(t.address()).map(s=>s+":"+t.address().port):r=["["+t.address().address+"]:"+t.address().port],r=r.map(s=>"http"+(this[RI].https?"s":"")+"://"+s));for(let s of r)this.log.info(e(s));return r[0]}function kI(t){return t[dn]=new Set,t.on("session",function(e){e.once("connect",function(){t[dn].add(e)}),e.once("close",function(){t[dn].delete(e)}),e.once("frameError",function(r,n,s){s===0&&t[dn].delete(e)}),e.once("goaway",function(){t[dn].delete(e)})}),function(){if(t[dn].size!==0)for(let r of t[dn])r.close()}}});var cc=E((v8,xy)=>{"use strict";var lc=/([\w!#$%&'*+.^`|~-]+)=([^;]*)/gm,Ny=/^[\w!#$%&'*+.^`|~-]+$/,ky=/^[\w!#$%&'*+.^`|~-]+\s*/,uc=class{#e=!1;#t=!0;#r="";#n="";#s=new Map;#i;constructor(e){if(e==null||e===""||e==="undefined")return;let r=e.indexOf(";");if(r===-1){if(r=e.indexOf("/"),r===-1)return;let l=e.slice(0,r).trimStart().toLowerCase(),u=e.slice(r+1).trimEnd().toLowerCase();Ny.test(l)===!0&&ky.test(u)===!0&&(this.#e=!0,this.#t=!1,this.#r=l,this.#n=u);return}let n=e.slice(0,r).toLowerCase(),s=e.slice(r+1).trim();if(r=n.indexOf("/"),r===-1)return;let i=n.slice(0,r).trimStart(),o=n.slice(r+1).trimEnd();if(Ny.test(i)===!1||ky.test(o)===!1)return;this.#r=i,this.#n=o,this.#e=!0,this.#t=!1;let a=lc.exec(s);for(;a;){let l=a[1],u=a[2];if(u[0]==='"'){if(u.at(-1)!=='"'){this.#s.set(l,"invalid quoted string"),a=lc.exec(s);continue}this.#s.set(l,u.slice(1,u.length-1))}else this.#s.set(l,u);a=lc.exec(s)}}get[Symbol.toStringTag](){return"ContentType"}get isEmpty(){return this.#t}get isValid(){return this.#e}get mediaType(){return`${this.#r}/${this.#n}`}get type(){return this.#r}get subtype(){return this.#n}get parameters(){return this.#s}toString(){if(this.#i)return this.#i;let e=[];for(let[n,s]of this.#s.entries())e.push(`${n}="${s}"`);let r=[this.#r,"/",this.#n];return e.length>0&&(r.push("; "),r.push(e.join("; "))),this.#i=r.join(""),this.#i}};xy.exports=uc});var Uo=E((w8,Ly)=>{"use strict";var{kReplyHasStatusCode:xI}=De();function LI(t,e){if(!t[xI]||t.statusCode===200){let r=e&&(e.statusCode||e.status);t.code(r>=400?r:500)}}Ly.exports={setErrorStatusCode:LI}});var fc=E((R8,jy)=>{"use strict";var{kReplyIsError:qy,kReplyHijacked:qI}=De(),{setErrorStatusCode:jI}=Uo(),DI=V("node:diagnostics_channel"),ei=DI.tracingChannel("fastify.request.handler");function FI(t,e,r){r&&(r.async=!0),t.then(function(n){if(e[qI]!==!0){r&&ei.asyncStart.publish(r);try{if(n!==void 0||e.sent===!1&&e.raw.headersSent===!1&&e.request.raw.aborted===!1&&e.request.socket&&!e.request.socket.destroyed)try{e.send(n)}catch(s){e[qy]=!0,e.send(s)}}finally{r&&ei.asyncEnd.publish(r)}}},function(n){r&&(r.error=n,jI(e,n),ei.error.publish(r),ei.asyncStart.publish(r));try{if(e.sent===!0){e.log.error({err:n},"Promise errored, but reply.sent = true was set");return}e[qy]=!0,e.send(n)}catch(s){e.send(s)}finally{r&&ei.asyncEnd.publish(r)}})}jy.exports=FI});var pc=E((O8,Fy)=>{"use strict";var{kSchemaHeaders:Wo,kSchemaParams:dc,kSchemaQuerystring:hc,kSchemaBody:hn,kSchemaResponse:Dy}=De(),MI=/^[1-5](?:\d{2}|xx)$|^default$/,{FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:HI}=He(),{FSTWRN001:Bo}=Kn();function VI(t,e){if(!t.schema||!t.schema.response)return;let{method:r,url:n}=t.config||{};t[Dy]=Object.keys(t.schema.response).reduce(function(s,i){let o=t.schema.response[i];if(i=i.toLowerCase(),!MI.test(i))throw new HI;if(o.content){let a={};for(let l of Object.keys(o.content)){let u=o.content[l].schema;a[l]=e({schema:u,url:n,method:r,httpStatus:i,contentType:l})}s[i]=a}else s[i]=e({schema:o,url:n,method:r,httpStatus:i});return s},{})}function zI(t,e,r){let{schema:n}=t;if(!n)return;let{method:s,url:i}=t.config||{},o=n.headers;if(o&&(r||Object.getPrototypeOf(o)!==Object.prototype))t[Wo]=e({schema:o,method:s,url:i,httpPart:"headers"});else if(o){let a={};Object.keys(o).forEach(l=>{a[l]=o[l]}),a.required instanceof Array&&(a.required=a.required.map(l=>l.toLowerCase())),o.properties&&(a.properties={},Object.keys(o.properties).forEach(l=>{a.properties[l.toLowerCase()]=o.properties[l]})),t[Wo]=e({schema:a,method:s,url:i,httpPart:"headers"})}else Object.hasOwn(n,"headers")&&Bo("headers",s,i);if(n.body){let a=n.body.content;if(a){let l={};for(let u of Object.keys(a)){let c=a[u].schema;l[u]=e({schema:c,method:s,url:i,httpPart:"body",contentType:u})}t[hn]=l}else t[hn]=e({schema:n.body,method:s,url:i,httpPart:"body"})}else Object.hasOwn(n,"body")&&Bo("body",s,i);n.querystring?t[hc]=e({schema:n.querystring,method:s,url:i,httpPart:"querystring"}):Object.hasOwn(n,"querystring")&&Bo("querystring",s,i),n.params?t[dc]=e({schema:n.params,method:s,url:i,httpPart:"params"}):Object.hasOwn(n,"params")&&Bo("params",s,i)}function Go(t,e,r){let n=e[r]===void 0,s;try{s=t?.(n?null:e[r])}catch(o){return o.statusCode=500,o}if(s&&typeof s.then=="function")return s.then(o=>i(o)).catch(o=>o);return i(s);function i(o){return o===!1?t.errors:o&&o.error?o.error:(o&&o.value&&(e[r]=o.value),!1)}}function Jo(t,e,r){let n=r===void 0;if(n||!r.skipParams){let i=Go(t[dc],e,"params");if(i)return typeof i.then!="function"?Fr(i,"params",t.schemaErrorFormatter):UI(i,t,e)}if(n||!r.skipBody){let i=null;if(typeof t[hn]=="function")i=t[hn];else if(t[hn]){let a=JI(e.headers["content-type"]),l=t[hn][a];l&&(i=l)}let o=Go(i,e,"body");if(o)return typeof o.then!="function"?Fr(o,"body",t.schemaErrorFormatter):BI(o,t,e)}if(n||!r.skipQuery){let i=Go(t[hc],e,"query");if(i)return typeof i.then!="function"?Fr(i,"querystring",t.schemaErrorFormatter):GI(i,t,e)}let s=Go(t[Wo],e,"headers");return s?typeof s.then!="function"?Fr(s,"headers",t.schemaErrorFormatter):WI(s,t,e):!1}function UI(t,e,r){return t.then(n=>n?Fr(n,"params",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0}))}function BI(t,e,r){return t.then(n=>n?Fr(n,"body",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0,skipBody:!0}))}function GI(t,e,r){return t.then(n=>n?Fr(n,"querystring",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0,skipBody:!0,skipQuery:!0}))}function WI(t,e,r){return t.then(n=>n?Fr(n,"headers",e.schemaErrorFormatter):!1)}function Fr(t,e,r){if(t instanceof Error)return t.statusCode=t.statusCode||400,t.code=t.code||"FST_ERR_VALIDATION",t.validationContext=t.validationContext||e,t;let n=r(t,e);return n.statusCode=n.statusCode||400,n.code=n.code||"FST_ERR_VALIDATION",n.validation=t,n.validationContext=e,n}function JI(t){return t?t.split(/[ ;]/,1)[0].trim().toLowerCase():""}Fy.exports={symbols:{bodySchema:hn,querystringSchema:hc,responseSchema:Dy,paramsSchema:dc,headersSchema:Wo},compileSchemasForValidation:zI,compileSchemasForSerialization:VI,validate:Jo}});var _c=E((T8,yc)=>{"use strict";var KI=V("node:diagnostics_channel"),YI=cc(),XI=fc(),{validate:QI}=pc(),{preValidationHookRunner:ZI,preHandlerHookRunner:e1}=Dr(),{FST_ERR_CTP_INVALID_MEDIA_TYPE:t1}=He(),{setErrorStatusCode:My}=Uo(),{kReplyIsError:ri,kRouteContext:tr,kFourOhFourContext:r1,kSupportedHTTPMethods:Hy}=De(),ti=KI.tracingChannel("fastify.request.handler");function n1(t,e,r){if(r.sent===!0)return;if(t!=null){r[ri]=!0,r.send(t);return}let n=e.method;if(this[Hy].bodyless.has(n)){Xn(e,r);return}if(this[Hy].bodywith.has(n)){let s=e.headers,i=s["content-type"];if(i===void 0){let a=s["content-length"];if(s["transfer-encoding"]===void 0&&(a===void 0||a==="0")){Xn(e,r);return}e[tr].contentTypeParser.run("",Xn,e,r);return}let o=new YI(i);if(o.isValid===!1){r[ri]=!0,r.status(415).send(new t1);return}e[tr].contentTypeParser.run(o.toString(),Xn,e,r);return}Xn(e,r)}function Xn(t,e){try{t[tr].preValidation!==null?ZI(t[tr].preValidation,t,e,mc):mc(null,t,e)}catch(r){mc(r,t,e)}}function mc(t,e,r){if(r.sent===!0)return;if(t!=null){r[ri]=!0,r.send(t);return}let n=QI(r[tr],e);if(n&&typeof n.then=="function"||!1){let i=Vy.bind(null,e,r);n.then(i,i)}else Vy(e,r,n)}function Vy(t,e,r){if(r){if(e[tr].attachValidation===!1){e.send(r);return}e.request.validationError=r}t[tr].preHandler!==null?e1(t[tr].preHandler,t,e,gc):gc(null,t,e)}function gc(t,e,r){if(r.sent)return;let n=e[tr];if(!ti.hasSubscribers||n[r1]===null)zy(t,e,r);else{let s={request:e,reply:r,async:!1,route:{url:n.config.url,method:n.config.method}};ti.start.runStores(s,zy,void 0,t,e,r,s)}}function zy(t,e,r,n){let s=e[tr];try{if(t!=null){r[ri]=!0,n&&(n.error=t,My(r,t),ti.error.publish(n)),r.send(t);return}let i;try{i=s.handler(e,r)}catch(o){n&&(n.error=o,My(r,o),ti.error.publish(n)),r[ri]=!0,r.send(o);return}i!==void 0&&(i!==null&&typeof i.then=="function"?XI(i,r,n):r.send(i))}finally{n&&ti.end.publish(n)}}yc.exports=n1;yc.exports[Symbol.for("internals")]={handler:Xn,preHandlerCallback:gc}});var By=E(($8,Uy)=>{"use strict";function Qn(){}var s1={fatal:Qn,error:Qn,warn:Qn,info:Qn,debug:Qn,trace:Qn};Object.defineProperty(Uy,"exports",{get(){return Object.create(s1)}})});var Ec=E((P8,Jy)=>{"use strict";var ni=t=>t&&typeof t.message=="string",Sc=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return ni(r)?r:void 0}else return ni(e)?e:void 0},Gy=(t,e)=>{if(!ni(t))return"";let r=t.stack||"";if(e.has(t))return r+`
|
|
30
|
-
causes have become circular...`;let n=
|
|
31
|
-
caused by: `+Gy(n,e)):r},i1=t=>Gy(t,new Set),Wy=(t,e,r)=>{if(!ni(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Sc(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Wy(s,e,i)}else return n},o1=t=>Wy(t,new Set);Jy.exports={isErrorLike:ni,getErrorCause:Sc,stackWithCauses:i1,messageWithCauses:o1}});var bc=E((A8,Yy)=>{"use strict";var a1=Symbol("circular-ref-tag"),Ko=Symbol("pino-raw-err-ref"),Ky=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Ko]},set:function(t){this[Ko]=t}}});Object.defineProperty(Ky,Ko,{writable:!0,value:{}});Yy.exports={pinoErrProto:Ky,pinoErrorSymbols:{seen:a1,rawSymbol:Ko}}});var Zy=E((C8,Qy)=>{"use strict";Qy.exports=wc;var{messageWithCauses:l1,stackWithCauses:u1,isErrorLike:Xy}=Ec(),{pinoErrProto:c1,pinoErrorSymbols:f1}=bc(),{seen:vc}=f1,{toString:d1}=Object.prototype;function wc(t){if(!Xy(t))return t;t[vc]=void 0;let e=Object.create(c1);e.type=d1.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=l1(t),e.stack=u1(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>wc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Xy(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,vc)&&(e[r]=wc(n)):e[r]=n}return delete t[vc],e.raw=t,e}});var t_=E((I8,e_)=>{"use strict";e_.exports=Xo;var{isErrorLike:Rc}=Ec(),{pinoErrProto:h1,pinoErrorSymbols:p1}=bc(),{seen:Yo}=p1,{toString:m1}=Object.prototype;function Xo(t){if(!Rc(t))return t;t[Yo]=void 0;let e=Object.create(h1);e.type=m1.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Xo(r))),Rc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Yo)&&(e.cause=Xo(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Rc(n)?Object.prototype.hasOwnProperty.call(n,Yo)||(e[r]=Xo(n)):e[r]=n}return delete t[Yo],e.raw=t,e}});var i_=E((N8,s_)=>{"use strict";s_.exports={mapHttpRequest:g1,reqSerializer:n_};var Oc=Symbol("pino-raw-req-ref"),r_=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Oc]},set:function(t){this[Oc]=t}}});Object.defineProperty(r_,Oc,{writable:!0,value:{}});function n_(t){let e=t.info||t.socket,r=Object.create(r_);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function g1(t){return{req:n_(t)}}});var u_=E((k8,l_)=>{"use strict";l_.exports={mapHttpResponse:y1,resSerializer:a_};var Tc=Symbol("pino-raw-res-ref"),o_=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Tc]},set:function(t){this[Tc]=t}}});Object.defineProperty(o_,Tc,{writable:!0,value:{}});function a_(t){let e=Object.create(o_);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function y1(t){return{res:a_(t)}}});var Pc=E((x8,c_)=>{"use strict";var $c=Zy(),_1=t_(),Qo=i_(),Zo=u_();c_.exports={err:$c,errWithCause:_1,mapHttpRequest:Qo.mapHttpRequest,mapHttpResponse:Zo.mapHttpResponse,req:Qo.reqSerializer,res:Zo.resSerializer,wrapErrorSerializer:function(e){return e===$c?e:function(n){return e($c(n))}},wrapRequestSerializer:function(e){return e===Qo.reqSerializer?e:function(n){return e(Qo.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Zo.resSerializer?e:function(n){return e(Zo.resSerializer(n))}}}});var Ac=E((L8,f_)=>{"use strict";function S1(t,e){return e}f_.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=S1;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s}});var y_=E((q8,g_)=>{"use strict";function Cc(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=Cc(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=Cc(t[r]));return e}return t}function d_(t){let e=[],r="",n=!1,s=!1,i="";for(let o=0;o<t.length;o++){let a=t[o];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,s=!1):(a==='"'||a==="'")&&n?s?a===i?(s=!1,i=""):r+=a:(s=!0,i=a):r+=a}return r&&e.push(r),e}function h_(t,e,r){let n=t;for(let i=0;i<e.length-1;i++){let o=e[i];if(typeof n!="object"||n===null||!(o in n)||typeof n[o]!="object"||n[o]===null)return!1;n=n[o]}let s=e[e.length-1];if(s==="*"){if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=r;else if(typeof n=="object"&&n!==null)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r)}else typeof n=="object"&&n!==null&&s in n&&Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r);return!0}function p_(t,e){let r=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof r!="object"||r===null||!(i in r)||typeof r[i]!="object"||r[i]===null)return!1;r=r[i]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let s=0;s<r.length;s++)r[s]=void 0;else if(typeof r=="object"&&r!==null)for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var ea=Symbol("PATH_NOT_FOUND");function E1(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return ea;r=r[n]}return r}function b1(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function v1(t,e,r,n=!1){for(let s of e){let i=d_(s);if(i.includes("*"))m_(t,i,r,s,n);else if(n)p_(t,i);else{let o=E1(t,i);if(o===ea)continue;let a=typeof r=="function"?r(o,i):r;h_(t,i,a)}}}function m_(t,e,r,n,s=!1){let i=e.indexOf("*");if(i===e.length-1){let o=e.slice(0,-1),a=t;for(let l of o){if(a==null||typeof a!="object"||a===null)return;a=a[l]}if(Array.isArray(a))if(s)for(let l=0;l<a.length;l++)a[l]=void 0;else for(let l=0;l<a.length;l++){let u=[...o,l.toString()],c=typeof r=="function"?r(a[l],u):r;a[l]=c}else if(typeof a=="object"&&a!==null)if(s){let l=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&l.push(u);for(let u of l)delete a[u]}else for(let l in a){let u=[...o,l],c=typeof r=="function"?r(a[l],u):r;a[l]=c}}else w1(t,e,r,i,n,s)}function w1(t,e,r,n,s,i=!1){let o=e.slice(0,n),a=e.slice(n+1),l=[];function u(c,f){if(f===o.length){if(Array.isArray(c))for(let p=0;p<c.length;p++)l[f]=p.toString(),u(c[p],f+1);else if(typeof c=="object"&&c!==null)for(let p in c)l[f]=p,u(c[p],f+1)}else if(f<o.length){let p=o[f];c&&typeof c=="object"&&c!==null&&p in c&&(l[f]=p,u(c[p],f+1))}else if(a.includes("*"))m_(c,a,typeof r=="function"?(h,d)=>{let m=[...l.slice(0,f),...d];return r(h,m)}:r,s,i);else if(i)p_(c,a);else{let p=typeof r=="function"?r(b1(c,a),[...l.slice(0,f),...a]):r;h_(c,a,p)}}if(o.length===0)u(t,0);else{let c=t;for(let f=0;f<o.length;f++){let p=o[f];if(c==null||typeof c!="object"||c===null)return;c=c[p],l[f]=p}c!=null&&u(c,o.length)}}function R1(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=d_(r),s=e;for(let i=0;i<n.length;i++){let o=n[i];s.has(o)||s.set(o,new Map),s=s.get(o)}}return e}function O1(t,e){if(!e)return t;function r(n,s,i=0){if(!s||s.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let l=0;l<n.length;l++){let u=l.toString();s.has(u)||s.has("*")?a[l]=r(n[l],s.get(u)||s.get("*")):a[l]=n[l]}return a}let o=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(s.has(a)||s.has("*")?o[a]=r(n[a],s.get(a)||s.get("*")):o[a]=n[a]);return o}return r(t,e)}function T1(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let s=0;s<t.length;s++){let i=t[s];if((i==='"'||i==="'")&&e>0)r?i===n&&(r=!1,n=""):(r=!0,n=i);else if(i==="["&&!r)e++;else if(i==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function $1(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)T1(e)}function P1(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:s=!0,remove:i=!1}=t;$1(e);let o=R1(e);return function(l){if(s&&(l===null||typeof l!="object")&&(l==null||typeof l!="object"))return n?n(l):l;let u=O1(l,o),c=l,f=r;return typeof r=="function"&&(f=r),v1(u,e,f,i),n===!1?(u.restore=function(){return Cc(c)},u):typeof n=="function"?n(u):JSON.stringify(u)}}g_.exports=P1});var Zn=E((j8,__)=>{"use strict";var A1=Symbol("pino.setLevel"),C1=Symbol("pino.getLevel"),I1=Symbol("pino.levelVal"),N1=Symbol("pino.levelComp"),k1=Symbol("pino.useLevelLabels"),x1=Symbol("pino.useOnlyCustomLevels"),L1=Symbol("pino.mixin"),q1=Symbol("pino.lsCache"),j1=Symbol("pino.chindings"),D1=Symbol("pino.asJson"),F1=Symbol("pino.write"),M1=Symbol("pino.redactFmt"),H1=Symbol("pino.time"),V1=Symbol("pino.timeSliceIndex"),z1=Symbol("pino.stream"),U1=Symbol("pino.stringify"),B1=Symbol("pino.stringifySafe"),G1=Symbol("pino.stringifiers"),W1=Symbol("pino.end"),J1=Symbol("pino.formatOpts"),K1=Symbol("pino.messageKey"),Y1=Symbol("pino.errorKey"),X1=Symbol("pino.nestedKey"),Q1=Symbol("pino.nestedKeyStr"),Z1=Symbol("pino.mixinMergeStrategy"),eN=Symbol("pino.msgPrefix"),tN=Symbol("pino.wildcardFirst"),rN=Symbol.for("pino.serializers"),nN=Symbol.for("pino.formatters"),sN=Symbol.for("pino.hooks"),iN=Symbol.for("pino.metadata");__.exports={setLevelSym:A1,getLevelSym:C1,levelValSym:I1,levelCompSym:N1,useLevelLabelsSym:k1,mixinSym:L1,lsCacheSym:q1,chindingsSym:j1,asJsonSym:D1,writeSym:F1,serializersSym:rN,redactFmtSym:M1,timeSym:H1,timeSliceIndexSym:V1,streamSym:z1,stringifySym:U1,stringifySafeSym:B1,stringifiersSym:G1,endSym:W1,formatOptsSym:J1,messageKeySym:K1,errorKeySym:Y1,nestedKeySym:X1,wildcardFirstSym:tN,needsMetadataGsym:iN,useOnlyCustomLevelsSym:x1,formattersSym:nN,hooksSym:sN,nestedKeyStrSym:Q1,mixinMergeStrategySym:Z1,msgPrefixSym:eN}});var Nc=E((D8,v_)=>{"use strict";var S_=y_(),{redactFmtSym:oN,wildcardFirstSym:ta}=Zn(),Ic=/[^.[\]]+|\[([^[\]]*?)\]/g,E_="[Redacted]",b_=!1;function aN(t,e){let{paths:r,censor:n,remove:s}=lN(t),i=r.reduce((l,u)=>{Ic.lastIndex=0;let c=Ic.exec(u),f=Ic.exec(u),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=ta),f===null)return l[p]=null,l;if(l[p]===null)return l;let{index:h}=f,d=`${u.substr(h,u.length-1)}`;return l[p]=l[p]||[],p!==ta&&l[p].length===0&&l[p].push(...l[ta]||[]),p===ta&&Object.keys(l).forEach(function(m){l[m]&&l[m].push(d)}),l[p].push(d),l},{}),o={[oN]:S_({paths:r,censor:n,serialize:e,strict:b_,remove:s})},a=(...l)=>e(typeof n=="function"?n(...l):n);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((l,u)=>{if(i[u]===null)l[u]=c=>a(c,[u]);else{let c=typeof n=="function"?(f,p)=>n(f,[u,...p]):n;l[u]=S_({paths:i[u],censor:c,serialize:e,strict:b_,remove:s})}return l},o)}function lN(t){if(Array.isArray(t))return t={paths:t,censor:E_},t;let{paths:e,censor:r=E_,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}v_.exports=aN});var O_=E((F8,R_)=>{"use strict";var uN=()=>"",cN=()=>`,"time":${Date.now()}`,fN=()=>`,"time":${Math.round(Date.now()/1e3)}`,dN=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,hN=1000000n,w_=1000000000n,pN=BigInt(Date.now())*hN,mN=process.hrtime.bigint(),gN=()=>{let t=process.hrtime.bigint()-mN,e=pN+t,r=e/w_,n=e%w_,s=Number(r*1000n+n/1000000n),i=new Date(s),o=i.getUTCFullYear(),a=(i.getUTCMonth()+1).toString().padStart(2,"0"),l=i.getUTCDate().toString().padStart(2,"0"),u=i.getUTCHours().toString().padStart(2,"0"),c=i.getUTCMinutes().toString().padStart(2,"0"),f=i.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${o}-${a}-${l}T${u}:${c}:${f}.${n.toString().padStart(9,"0")}Z"`};R_.exports={nullTime:uN,epochTime:cN,unixTime:fN,isoTime:dN,isoTimeNano:gN}});var $_=E((M8,T_)=>{"use strict";function yN(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}T_.exports=_N;function _N(t,e,r){var n=r&&r.stringify||yN,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var a=1;a<i;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var l=e.length;if(l===0)return t;for(var u="",c=1-s,f=-1,p=t&&t.length||0,h=0;h<p;){if(t.charCodeAt(h)===37&&h+1<p){switch(f=f>-1?f:0,t.charCodeAt(h+1)){case 100:case 102:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Number(e[c]),f=h+2,h++;break;case 105:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Math.floor(Number(e[c])),f=h+2,h++;break;case 79:case 111:case 106:if(c>=l||e[c]===void 0)break;f<h&&(u+=t.slice(f,h));var d=typeof e[c];if(d==="string"){u+="'"+e[c]+"'",f=h+2,h++;break}if(d==="function"){u+=e[c].name||"<anonymous>",f=h+2,h++;break}u+=n(e[c]),f=h+2,h++;break;case 115:if(c>=l)break;f<h&&(u+=t.slice(f,h)),u+=String(e[c]),f=h+2,h++;break;case 37:f<h&&(u+=t.slice(f,h)),u+="%",f=h+2,h++,c--;break}++c}++h}return f===-1?t:(f<p&&(u+=t.slice(f)),u)}});var xc=E((H8,kc)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));kc.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};kc.exports=t}});var L_=E((V8,x_)=>{"use strict";var xe=V("fs"),SN=V("events"),EN=V("util").inherits,P_=V("path"),qc=xc(),bN=V("assert"),ra=100,na=Buffer.allocUnsafe(0),vN=16*1024,A_="buffer",C_="utf8",[wN,RN]=(process.versions.node||"0.0").split(".").map(Number),ON=wN>=22&&RN>=7;function I_(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i)}):e.emit("error",i);return}let a=e._reopening;e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&xe.mkdirSync(P_.dirname(t),{recursive:!0});let i=xe.openSync(t,n,s);r(null,i)}catch(i){throw r(i),i}else e.mkdir?xe.mkdir(P_.dirname(t),{recursive:!0},i=>{if(i)return r(i);xe.open(t,n,s,r)}):xe.open(t,n,s,r)}function Vt(t){if(!(this instanceof Vt))return new Vt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,periodicFlush:o,sync:a,append:l=!0,mkdir:u,retryEAGAIN:c,fsync:f,contentMode:p,mode:h}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||vN,this._periodicFlush=o||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=f||!1,this.append=l||!1,this.mode=h,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1;let d,m;if(p===A_)this._writingBuf=na,this.write=PN,this.flush=CN,this.flushSync=NN,this._actualWrite=xN,d=()=>xe.writeSync(this.fd,this._writingBuf),m=()=>xe.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===C_)this._writingBuf="",this.write=$N,this.flush=AN,this.flushSync=IN,this._actualWrite=kN,d=()=>xe.writeSync(this.fd,this._writingBuf,"utf8"),m=()=>xe.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${C_}" and "${A_}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")I_(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,S)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{qc(ra),this.release(void 0,0)}catch(y){this.release(y)}else setTimeout(m,ra);else this._writing=!1,this.emit("error",g);return}this.emit("write",S);let b=Lc(this._writingBuf,this._len,S);if(this._len=b.len,this._writingBuf=b.writingBuf,this._writingBuf.length){if(!this.sync){m();return}try{do{let y=d(),R=Lc(this._writingBuf,this._len,y);this._len=R.len,this._writingBuf=R.writingBuf}while(this._writingBuf.length)}catch(y){this.release(y);return}}this._fsync&&xe.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,sa(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(TN,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function Lc(t,e,r){return typeof t=="string"&&Buffer.byteLength(t)!==r&&(r=Buffer.from(t).subarray(0,r).toString().length),e=Math.max(e-r,0),t=t.slice(r),{writingBuf:t,len:e}}function TN(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}EN(Vt,SN);function N_(t,e){return t.length===0?na:t.length===1?t[0]:Buffer.concat(t,e)}function $N(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||r[r.length-1].length+t.length>this.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function PN(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function k_(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{xe.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function AN(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&k_.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function CN(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&k_.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Vt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&xe.close(e,r=>{if(r)return this.emit("error",r)})}),I_(this.file,this)};Vt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():sa(this)))};function IN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t;){t.length<=0&&(t=this._bufs[0]);try{let e=xe.writeSync(this.fd,t,"utf8"),r=Lc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;qc(ra)}}try{xe.fsyncSync(this.fd)}catch{}}function NN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=na);let t=na;for(;this._bufs.length||t.length;){t.length<=0&&(t=N_(this._bufs[0],this._lens[0]));try{let e=xe.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;qc(ra)}}}Vt.prototype.destroy=function(){this.destroyed||sa(this)};function kN(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else xe.write(this.fd,this._writingBuf,"utf8",t)}function xN(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:N_(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else ON&&(this._writingBuf=Buffer.from(this._writingBuf)),xe.write(this.fd,this._writingBuf,t)}function sa(t){if(t.fd===-1){t.once("ready",sa.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],bN(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{xe.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?xe.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}Vt.SonicBoom=Vt;Vt.default=Vt;x_.exports=Vt});var jc=E((z8,M_)=>{"use strict";var zt={exit:[],beforeExit:[]},q_={exit:jN,beforeExit:DN},es;function LN(){es===void 0&&(es=new FinalizationRegistry(FN))}function qN(t){zt[t].length>0||process.on(t,q_[t])}function j_(t){zt[t].length>0||(process.removeListener(t,q_[t]),zt.exit.length===0&&zt.beforeExit.length===0&&(es=void 0))}function jN(){D_("exit")}function DN(){D_("beforeExit")}function D_(t){for(let e of zt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}zt[t]=[]}function FN(t){for(let e of["exit","beforeExit"]){let r=zt[e].indexOf(t);zt[e].splice(r,r+1),j_(e)}}function F_(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");qN(t);let n=new WeakRef(e);n.fn=r,LN(),es.register(e,n),zt[t].push(n)}function MN(t,e){F_("exit",t,e)}function HN(t,e){F_("beforeExit",t,e)}function VN(t){if(es!==void 0){es.unregister(t);for(let e of["exit","beforeExit"])zt[e]=zt[e].filter(r=>{let n=r.deref();return n&&n!==t}),j_(e)}}M_.exports={register:MN,registerBeforeExit:HN,unregister:VN}});var H_=E((U8,zN)=>{zN.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var z_=E((B8,V_)=>{"use strict";function UN(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{let a=Atomics.load(t,e);if(a===r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,a,l);u.async?u.value.then(o):setImmediate(o)};o()}function BN(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{if(Atomics.load(t,e)!==r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,r,l);u.async?u.value.then(o):setImmediate(o)};o()}V_.exports={wait:UN,waitDiff:BN}});var B_=E((G8,U_)=>{"use strict";U_.exports={WRITE_INDEX:4,READ_INDEX:8}});var Y_=E((W8,K_)=>{"use strict";var{version:GN}=H_(),{EventEmitter:WN}=V("events"),{Worker:JN}=V("worker_threads"),{join:KN}=V("path"),{pathToFileURL:YN}=V("url"),{wait:XN}=z_(),{WRITE_INDEX:yt,READ_INDEX:gt}=B_(),QN=V("buffer"),ZN=V("assert"),I=Symbol("kImpl"),ek=QN.constants.MAX_STRING_LENGTH,si=class{constructor(e){this._value=e}deref(){return this._value}},oa=class{register(){}unregister(){}},tk=process.env.NODE_V8_COVERAGE?oa:global.FinalizationRegistry||oa,rk=process.env.NODE_V8_COVERAGE?si:global.WeakRef||si,G_=new tk(t=>{t.exited||t.terminate()});function nk(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||KN(__dirname,"lib","worker.js"),o=new JN(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:YN(r).href,dataBuf:t[I].dataBuf,stateBuf:t[I].stateBuf,workerData:{$context:{threadStreamVersion:GN},...n}}});return o.stream=new si(t),o.on("message",sk),o.on("exit",J_),G_.register(t,o),o}function W_(t){ZN(!t[I].sync),t[I].needDrain&&(t[I].needDrain=!1,t.emit("drain"))}function ia(t){let e=Atomics.load(t[I].state,yt),r=t[I].data.length-e;if(r>0){if(t[I].buf.length===0){t[I].flushing=!1,t[I].ending?Vc(t):t[I].needDrain&&process.nextTick(W_,t);return}let n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[I].buf=t[I].buf.slice(r),aa(t,n,ia.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);s>t[I].data.length;)r=r/2,n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);t[I].buf=t[I].buf.slice(r),aa(t,n,ia.bind(null,t))}})}else if(r===0){if(e===0&&t[I].buf.length===0)return;t.flush(()=>{Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt),ia(t)})}else rr(t,new Error("overwritten"))}function sk(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new rk(e),e.flush(()=>{e[I].ready=!0,e.emit("ready")});break;case"ERROR":rr(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:rr(e,new Error("this should not happen: "+t.code))}}function J_(t){let e=this.stream.deref();e!==void 0&&(G_.unregister(e),e.worker.exited=!0,e.worker.off("exit",J_),rr(e,t!==0?new Error("the worker thread exited"):null))}var Fc=class extends WN{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[I]={},this[I].stateBuf=new SharedArrayBuffer(128),this[I].state=new Int32Array(this[I].stateBuf),this[I].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[I].data=Buffer.from(this[I].dataBuf),this[I].sync=e.sync||!1,this[I].ending=!1,this[I].ended=!1,this[I].needDrain=!1,this[I].destroyed=!1,this[I].flushing=!1,this[I].ready=!1,this[I].finished=!1,this[I].errored=null,this[I].closed=!1,this[I].buf="",this.worker=nk(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){if(this[I].destroyed)return Mc(this,new Error("the worker has exited")),!1;if(this[I].ending)return Mc(this,new Error("the worker is ending")),!1;if(this[I].flushing&&this[I].buf.length+e.length>=ek)try{Dc(this),this[I].flushing=!0}catch(r){return rr(this,r),!1}if(this[I].buf+=e,this[I].sync)try{return Dc(this),!0}catch(r){return rr(this,r),!1}return this[I].flushing||(this[I].flushing=!0,setImmediate(ia,this)),this[I].needDrain=this[I].data.length-this[I].buf.length-Atomics.load(this[I].state,yt)<=0,!this[I].needDrain}end(){this[I].destroyed||(this[I].ending=!0,Vc(this))}flush(e){if(this[I].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[I].state,yt);XN(this[I].state,gt,r,1/0,(n,s)=>{if(n){rr(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[I].destroyed||(Dc(this),Hc(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[I].ready}get destroyed(){return this[I].destroyed}get closed(){return this[I].closed}get writable(){return!this[I].destroyed&&!this[I].ending}get writableEnded(){return this[I].ending}get writableFinished(){return this[I].finished}get writableNeedDrain(){return this[I].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[I].errored}};function Mc(t,e){setImmediate(()=>{t.emit("error",e)})}function rr(t,e){t[I].destroyed||(t[I].destroyed=!0,e&&(t[I].errored=e,Mc(t,e)),t.worker.exited?setImmediate(()=>{t[I].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[I].closed=!0,t.emit("close")}))}function aa(t,e,r){let n=Atomics.load(t[I].state,yt),s=Buffer.byteLength(e);return t[I].data.write(e,n),Atomics.store(t[I].state,yt,n+s),Atomics.notify(t[I].state,yt),r(),!0}function Vc(t){if(!(t[I].ended||!t[I].ending||t[I].flushing)){t[I].ended=!0;try{t.flushSync();let e=Atomics.load(t[I].state,gt);Atomics.store(t[I].state,yt,-1),Atomics.notify(t[I].state,yt);let r=0;for(;e!==-1;){if(Atomics.wait(t[I].state,gt,e,1e3),e=Atomics.load(t[I].state,gt),e===-2){rr(t,new Error("end() failed"));return}if(++r===10){rr(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[I].finished=!0,t.emit("finish")})}catch(e){rr(t,e)}}}function Dc(t){let e=()=>{t[I].ending?Vc(t):t[I].needDrain&&process.nextTick(W_,t)};for(t[I].flushing=!1;t[I].buf.length!==0;){let r=Atomics.load(t[I].state,yt),n=t[I].data.length-r;if(n===0){Hc(t),Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);continue}else if(n<0)throw new Error("overwritten");let s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[I].buf=t[I].buf.slice(n),aa(t,s,e);else{for(Hc(t),Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);i>t[I].buf.length;)n=n/2,s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);t[I].buf=t[I].buf.slice(n),aa(t,s,e)}}}function Hc(t){if(t[I].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[I].state,yt),r=0;for(;;){let n=Atomics.load(t[I].state,gt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[I].state,gt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}K_.exports=Fc});var Bc=E((J8,X_)=>{"use strict";var{createRequire:ik}=V("module"),ok=Ac(),{join:zc,isAbsolute:ak,sep:lk}=V("node:path"),uk=xc(),Uc=jc(),ck=Y_();function fk(t){Uc.register(t,pk),Uc.registerBeforeExit(t,mk),t.on("close",function(){Uc.unregister(t)})}function dk(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function hk(t,e,r,n,s){!r.execArgv&&dk()&&V.main===void 0&&(r={...r,execArgv:[]}),r={...r,name:s};let i=new ck({filename:t,workerData:e,workerOpts:r,sync:n});i.on("ready",o),i.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function o(){process.removeListener("exit",a),i.unref(),r.autoEnd!==!1&&fk(i)}function a(){i.closed||(i.flushSync(),uk(100),i.end())}return i}function pk(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function mk(t){t.flushSync()}function gk(t){let{pipeline:e,targets:r,levels:n,dedupe:s,worker:i={},caller:o=ok(),sync:a=!1}=t,l={...t.options},u=typeof o=="string"?[o]:o,c=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),f=t.target;if(f&&r)throw new Error("only one of target or targets can be specified");r?(f=c["pino-worker"]||zc(__dirname,"worker.js"),l.targets=r.filter(d=>d.target).map(d=>({...d,target:h(d.target)})),l.pipelines=r.filter(d=>d.pipeline).map(d=>d.pipeline.map(m=>({...m,level:d.level,target:h(m.target)})))):e&&(f=c["pino-worker"]||zc(__dirname,"worker.js"),l.pipelines=[e.map(d=>({...d,target:h(d.target)}))]),n&&(l.levels=n),s&&(l.dedupe=s),l.pinoWillSendConfig=!0;let p=r||e?"pino.transport":f;return hk(h(f),l,i,a,p);function h(d){if(d=c[d]||d,ak(d)||d.indexOf("file://")===0)return d;if(d==="pino/file")return zc(__dirname,"..","file.js");let m;for(let g of u)try{let S=g==="node:repl"?process.cwd()+lk:g;m=ik(S).resolve(d);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${d}"`);return m}}X_.exports=gk});var ca=E((Y8,c0)=>{"use strict";var yk=V("node:diagnostics_channel"),Q_=$_(),{mapHttpRequest:_k,mapHttpResponse:Sk}=Pc(),Wc=L_(),Z_=jc(),{lsCacheSym:Ek,chindingsSym:s0,writeSym:e0,serializersSym:i0,formatOptsSym:t0,endSym:bk,stringifiersSym:o0,stringifySym:a0,stringifySafeSym:Jc,wildcardFirstSym:l0,nestedKeySym:vk,formattersSym:u0,messageKeySym:wk,errorKeySym:Rk,nestedKeyStrSym:Ok,msgPrefixSym:la}=Zn(),{isMainThread:Tk}=V("worker_threads"),$k=Bc(),[Pk]=process.versions.node.split(".").map(t=>Number(t)),r0=yk.tracingChannel("pino_asJson"),Gc=Pk>=25?t=>JSON.stringify(t):Ck;function ts(){}function Ak(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t)};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=_k(n):typeof n.setHeader=="function"&&(n=Sk(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[la]=="string"&&i!==void 0&&i!==null&&(i=this[la]+i),this[e0](n,Q_(i,o,this[t0]),t)}else{let i=n===void 0?s.shift():n;typeof this[la]=="string"&&i!==void 0&&i!==null&&(i=this[la]+i),this[e0](null,Q_(i,s,this[t0]),t)}}}function Ck(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o<i&&s>=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function Ik(t,e,r,n){if(r0.hasSubscribers===!1)return n0.call(this,t,e,r,n);let s={instance:this,arguments};return r0.traceSync(n0,s,this,t,e,r,n)}function n0(t,e,r,n){let s=this[a0],i=this[Jc],o=this[o0],a=this[bk],l=this[s0],u=this[i0],c=this[u0],f=this[wk],p=this[Rk],h=this[Ek][r]+n;h=h+l;let d;c.log&&(t=c.log(t));let m=o[l0],g="";for(let b in t)if(d=t[b],Object.prototype.hasOwnProperty.call(t,b)&&d!==void 0){u[b]?d=u[b](d):b===p&&u.err&&(d=u.err(d));let _=o[b]||m;switch(typeof d){case"undefined":case"function":continue;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":_&&(d=_(d));break;case"string":d=(_||Gc)(d);break;default:d=(_||s)(d,i)}if(d===void 0)continue;let y=Gc(b);g+=","+y+":"+d}let S="";if(e!==void 0){d=u[f]?u[f](e):e;let b=o[f]||m;switch(typeof d){case"function":break;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":b&&(d=b(d)),S=',"'+f+'":'+d;break;case"string":d=(b||Gc)(d),S=',"'+f+'":'+d;break;default:d=(b||s)(d,i),S=',"'+f+'":'+d}}return this[vk]&&g?h+this[Ok]+g.slice(1)+"}"+S+a:h+g+S+a}function Nk(t,e){let r,n=t[s0],s=t[a0],i=t[Jc],o=t[o0],a=o[l0],l=t[i0],u=t[u0].bindings;e=u(e);for(let c in e)if(r=e[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&e.hasOwnProperty(c)&&r!==void 0)===!0){if(r=l[c]?l[c](r):r,r=(o[c]||a||s)(r,i),r===void 0)continue;n+=',"'+c+'":'+r}return n}function kk(t){return t.write!==t.constructor.prototype.write}function ua(t){let e=new Wc(t);return e.on("error",r),!t.sync&&Tk&&(Z_.register(e,xk),e.on("close",function(){Z_.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=ts,e.end=ts,e.flushSync=ts,e.destroy=ts;return}e.removeListener("error",r),e.emit("error",n)}}function xk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Lk(t){return function(r,n,s={},i){if(typeof s=="string")i=ua({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=ua({dest:i})}else if(s instanceof Wc||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof Wc||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;s.customLevels&&(l=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=$k({caller:n,...s.transport,levels:l})}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=s;return o===!1&&(s.level="silent"),a||(s.onChild=ts),i||(kk(process.stdout)?i=process.stdout:i=ua({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function qk(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Jc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function jk(t,e,r){return{level:t,bindings:e,log:r}}function Dk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}c0.exports={noop:ts,buildSafeSonicBoom:ua,asChindings:Nk,asJson:Ik,genLog:Ak,createArgsNormalizer:Lk,stringify:qk,buildFormatters:jk,normalizeDestFileDescriptor:Dk}});var fa=E((X8,f0)=>{var Fk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Mk={ASC:"ASC",DESC:"DESC"};f0.exports={DEFAULT_LEVELS:Fk,SORTING_ORDER:Mk}});var Xc=E((Q8,m0)=>{"use strict";var{lsCacheSym:Hk,levelValSym:Kc,useOnlyCustomLevelsSym:Vk,streamSym:zk,formattersSym:Uk,hooksSym:Bk,levelCompSym:d0}=Zn(),{noop:Gk,genLog:pn}=ca(),{DEFAULT_LEVELS:nr,SORTING_ORDER:h0}=fa(),p0={fatal:t=>{let e=pn(nr.fatal,t);return function(...r){let n=this[zk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>pn(nr.error,t),warn:t=>pn(nr.warn,t),info:t=>pn(nr.info,t),debug:t=>pn(nr.debug,t),trace:t=>pn(nr.trace,t)},Yc=Object.keys(nr).reduce((t,e)=>(t[nr[e]]=e,t),{}),Wk=Object.keys(Yc).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Jk(t){let e=t[Uk].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1)}return t[Hk]=n,t}function Kk(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Yk(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Kc],s=this[Kc]=r[t],i=this[Vk],o=this[d0],a=this[Bk].logMethod;for(let l in r){if(o(r[l],s)===!1){this[l]=Gk;continue}this[l]=Kk(l,i)?p0[l](a):pn(r[l],a)}this.emit("level-change",t,s,e[n],n,this)}function Xk(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function Qk(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[d0](r,this[Kc])}function Zk(t,e,r){return t===h0.DESC?e<=r:e>=r}function ex(t){return typeof t=="string"?Zk.bind(null,t):t}function tx(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Yc,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:nr,t);return{labels:n,values:s}}function rx(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(Yc).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:nr,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function nx(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}function sx(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(h0).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}m0.exports={initialLsCache:Wk,genLsCache:Jk,levelMethods:p0,getLevel:Xk,setLevel:Yk,isLevelEnabled:Qk,mappings:tx,assertNoLevelCollisions:nx,assertDefaultLevelFound:rx,genLevelComparison:ex,assertLevelComparison:sx}});var Qc=E((Z8,g0)=>{"use strict";g0.exports={version:"10.3.0"}});var R0=E((tK,w0)=>{"use strict";var{EventEmitter:ix}=V("node:events"),{lsCacheSym:ox,levelValSym:ax,setLevelSym:ef,getLevelSym:y0,chindingsSym:ha,mixinSym:lx,asJsonSym:S0,writeSym:ux,mixinMergeStrategySym:cx,timeSym:fx,timeSliceIndexSym:dx,streamSym:E0,serializersSym:mn,formattersSym:ii,errorKeySym:hx,messageKeySym:px,useOnlyCustomLevelsSym:mx,needsMetadataGsym:gx,redactFmtSym:yx,stringifySym:_x,formatOptsSym:Sx,stringifiersSym:Ex,msgPrefixSym:tf,hooksSym:bx}=Zn(),{getLevel:vx,setLevel:wx,isLevelEnabled:Rx,mappings:Ox,initialLsCache:Tx,genLsCache:$x,assertNoLevelCollisions:Px}=Xc(),{asChindings:rf,asJson:Ax,buildFormatters:Zc,stringify:_0,noop:b0}=ca(),{version:Cx}=Qc(),Ix=Nc(),Nx=class{},v0={constructor:Nx,child:kx,bindings:xx,setBindings:Lx,flush:Dx,isLevelEnabled:Rx,version:Cx,get level(){return this[y0]()},set level(t){this[ef](t)},get levelVal(){return this[ax]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[tf]},get[Symbol.toStringTag](){return"Pino"},[ox]:Tx,[ux]:jx,[S0]:Ax,[y0]:vx,[ef]:wx};Object.setPrototypeOf(v0,ix.prototype);w0.exports=function(){return Object.create(v0)};var da=t=>t;function kx(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[mn],n=this[ii],s=Object.create(this);if(e==null)return s[ii].bindings!==da&&(s[ii]=Zc(n.level,da,n.log)),s[ha]=rf(s,t),this.onChild!==b0&&this.onChild(s),s;if(e.hasOwnProperty("serializers")===!0){s[mn]=Object.create(null);for(let u in r)s[mn][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var i=0;i<a.length;i++){let u=a[i];s[mn][u]=r[u]}for(let u in e.serializers)s[mn][u]=e.serializers[u];let l=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<l.length;o++){let u=l[o];s[mn][u]=e.serializers[u]}}else s[mn]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:l,log:u}=e.formatters;s[ii]=Zc(a||n.level,l||da,u||n.log)}else s[ii]=Zc(n.level,da,n.log);if(e.hasOwnProperty("customLevels")===!0&&(Px(this.levels,e.customLevels),s.levels=Ox(e.customLevels,s[mx]),$x(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let a=Ix(s.redact,_0),l={stringify:a[yx]};s[_x]=_0,s[Ex]=a,s[Sx]=l}if(typeof e.msgPrefix=="string"&&(s[tf]=(this[tf]||"")+e.msgPrefix),s[ha]=rf(s,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;s[ef](a)}return this.onChild(s),s}function xx(){let e=`{${this[ha].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function Lx(t){let e=rf(this,t);this[ha]=e}function qx(t,e){return Object.assign(e,t)}function jx(t,e,r){let n=this[fx](),s=this[lx],i=this[hx],o=this[px],a=this[cx]||qx,l,u=this[bx].streamWrite;t==null?l={}:t instanceof Error?(l={[i]:t},e===void 0&&(e=t.message)):(l=t,e===void 0&&t[o]===void 0&&t[i]&&(e=t[i].message)),s&&(l=a(l,s(l,r,this)));let c=this[S0](l,e,r,n),f=this[E0];f[gx]===!0&&(f.lastLevel=r,f.lastObj=l,f.lastMsg=e,f.lastTime=n.slice(this[dx]),f.lastLogger=this),f.write(u?u(c):c)}function Dx(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[E0];typeof e.flush=="function"?e.flush(t||b0):t&&t()}});var P0=E((af,$0)=>{"use strict";var{hasOwnProperty:oi}=Object.prototype,yn=of();yn.configure=of;yn.stringify=yn;yn.default=yn;af.stringify=yn;af.configure=of;$0.exports=yn;var Fx=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Mr(t){return t.length<5e3&&!Fx.test(t)?`"${t}"`:JSON.stringify(t)}function nf(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],s=r;for(;s!==0&&t[s-1]>n;)t[s]=t[s-1],s--;t[s]=n}return t}var Mx=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function sf(t){return Mx.call(t)!==void 0&&t.length!==0}function O0(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",s=`"0":${n}${t[0]}`;for(let i=1;i<r;i++)s+=`${e}"${i}":${n}${t[i]}`;return s}function Hx(t){if(oi.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Vx(t){let e;if(oi.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function zx(t,e){let r;if(oi.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function T0(t,e){let r;if(oi.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function gn(t){return t===1?"1 item":`${t} items`}function Ux(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function Bx(t){if(oi.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function of(t){t={...t};let e=Bx(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=Hx(t),n=zx(t,"bigint"),s=Vx(t),i=typeof s=="function"?s:void 0,o=T0(t,"maximumDepth"),a=T0(t,"maximumBreadth");function l(h,d,m,g,S,b){let _=d[h];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(h)),_=g.call(d,h,_),typeof _){case"string":return Mr(_);case"object":{if(_===null)return"null";if(m.indexOf(_)!==-1)return r;let y="",R=",",T=b;if(Array.isArray(_)){if(_.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(_),S!==""&&(b+=S,y+=`
|
|
27
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(s=>r.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function dg(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",s="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?s=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],s=i[4]),r&&s!=="0"?`${r}=${n}:${parseInt(s)+1}`:e})}hg.Command=Yu});var _g=E(At=>{var{Argument:mg}=xo(),{Command:Xu}=pg(),{CommanderError:sC,InvalidArgumentError:gg}=Ws(),{Help:iC}=Vu(),{Option:yg}=Gu();At.program=new Xu;At.createCommand=t=>new Xu(t);At.createOption=(t,e)=>new yg(t,e);At.createArgument=(t,e)=>new mg(t,e);At.Command=Xu;At.Option=yg;At.Argument=mg;At.Help=iC;At.CommanderError=sC;At.InvalidArgumentError=gg;At.InvalidOptionArgumentError=gg});var vg=E((l8,bg)=>{"use strict";function oC(t){var e=new t,r=e;function n(){var i=e;return i.next?e=i.next:(e=new t,r=e),i.next=null,i}function s(i){r.next=i,r=i}return{get:n,release:s}}bg.exports=oC});var Rg=E((u8,Qu)=>{"use strict";var aC=vg();function wg(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=aC(lC),s=null,i=null,o=0,a=null,l={push:m,drain:mt,saturated:mt,pause:c,paused:!1,get concurrency(){return r},set concurrency(T){if(!(T>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=T,!l.paused)for(;s&&o<r;)o++,S()},running:u,resume:h,idle:d,length:f,getQueue:p,unshift:g,empty:mt,kill:b,killAndDrain:_,error:R,abort:y};return l;function u(){return o}function c(){l.paused=!0}function f(){for(var T=s,O=0;T;)T=T.next,O++;return O}function p(){for(var T=s,O=[];T;)O.push(T.value),T=T.next;return O}function h(){if(l.paused){if(l.paused=!1,s===null){o++,S();return}for(;s&&o<r;)o++,S()}}function d(){return o===0&&l.length()===0}function m(T,O){var w=n.get();w.context=t,w.release=S,w.value=T,w.callback=O||mt,w.errorHandler=a,o>=r||l.paused?i?(i.next=w,i=w):(s=w,i=w,l.saturated()):(o++,e.call(t,w.value,w.worked))}function g(T,O){var w=n.get();w.context=t,w.release=S,w.value=T,w.callback=O||mt,w.errorHandler=a,o>=r||l.paused?s?(w.next=s,s=w):(s=w,i=w,l.saturated()):(o++,e.call(t,w.value,w.worked))}function S(T){T&&n.release(T);var O=s;O&&o<=r?l.paused?o--:(i===s&&(i=null),s=O.next,O.next=null,e.call(t,O.value,O.worked),i===null&&l.empty()):--o===0&&l.drain()}function b(){s=null,i=null,l.drain=mt}function _(){s=null,i=null,l.drain(),l.drain=mt}function y(){var T=s;for(s=null,i=null;T;){var O=T.next,w=T.callback,$=T.errorHandler,v=T.value,P=T.context;T.value=null,T.callback=mt,T.errorHandler=null,$&&$(new Error("abort"),v),w.call(P,new Error("abort")),T.release(T),T=O}l.drain=mt}function R(T){a=T}}function mt(){}function lC(){this.value=null,this.callback=mt,this.next=null,this.release=mt,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,i=t.errorHandler,o=t.value;t.value=null,t.callback=mt,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function uC(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(c,f){e.call(this,c).then(function(p){f(null,p)},f)}var s=wg(t,n,r),i=s.push,o=s.unshift;return s.push=a,s.unshift=l,s.drained=u,s;function a(c){var f=new Promise(function(p,h){i(c,function(d,m){if(d){h(d);return}p(m)})});return f.catch(mt),f}function l(c){var f=new Promise(function(p,h){o(c,function(d,m){if(d){h(d);return}p(m)})});return f.catch(mt),f}function u(){var c=new Promise(function(f){process.nextTick(function(){if(s.idle())f();else{var p=s.drain;s.drain=function(){typeof p=="function"&&p(),f(),s.drain=p}}})});return c}}Qu.exports=wg;Qu.exports.promise=uC});var Zu=E((c8,Js)=>{"use strict";var{format:cC}=V("node:util");function fC(){return`${this.name} [${this.code}]: ${this.message}`}var Lo=Symbol.for("fastify-error-generic");function Un(t,e,r=500,n=Error,s=Un.captureStackTrace){let i=t===Lo;if(i&&(t="FST_ERR"),!t)throw new Error("Fastify error code must not be empty");if(!e)throw new Error("Fastify error message must not be empty");t=t.toUpperCase(),!r&&(r=void 0);let o=Symbol.for(`fastify-error ${t}`);function a(...l){if(!new.target)return new a(...l);this.code=t,this.name="FastifyError",this.statusCode=r;let u=l.length-1;u!==-1&&l[u]&&typeof l[u]=="object"&&"cause"in l[u]&&(this.cause=l.pop().cause),this.message=cC(e,...l),Error.stackTraceLimit&&s&&Error.captureStackTrace(this,a)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0},[Lo]:{value:!0,enumerable:!1,writable:!1,configurable:!1},[o]:{value:!0,enumerable:!1,writable:!1,configurable:!1}}),i?Object.defineProperty(a,Symbol.hasInstance,{value(l){return l&&l[Lo]},configurable:!1,writable:!1,enumerable:!1}):Object.defineProperty(a,Symbol.hasInstance,{value(l){return l&&l[o]},configurable:!1,writable:!1,enumerable:!1}),a.prototype[Symbol.toStringTag]="Error",a.prototype.toString=fC,a}Un.captureStackTrace=!0;var dC=Un(Lo,"Fastify Error",500,Error);Js.exports=Un;Js.exports.FastifyError=dC;Js.exports.default=Un;Js.exports.createError=Un});var qo=E((f8,Og)=>{"use strict";var{createError:jr}=Zu();Og.exports={AVV_ERR_EXPOSE_ALREADY_DEFINED:jr("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' is already defined, specify an expose option for '%s'"),AVV_ERR_ATTRIBUTE_ALREADY_DEFINED:jr("AVV_ERR_ATTRIBUTE_ALREADY_DEFINED","'%s' is already defined"),AVV_ERR_CALLBACK_NOT_FN:jr("AVV_ERR_CALLBACK_NOT_FN","Callback for '%s' hook is not a function. Received: '%s'"),AVV_ERR_PLUGIN_NOT_VALID:jr("AVV_ERR_PLUGIN_NOT_VALID","Plugin must be a function or a promise. Received: '%s'"),AVV_ERR_ROOT_PLG_BOOTED:jr("AVV_ERR_ROOT_PLG_BOOTED","Root plugin has already booted"),AVV_ERR_PARENT_PLG_LOADED:jr("AVV_ERR_PARENT_PLG_LOADED","Impossible to load '%s' plugin because the parent '%s' was already loaded"),AVV_ERR_READY_TIMEOUT:jr("AVV_ERR_READY_TIMEOUT","Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"),AVV_ERR_PLUGIN_EXEC_TIMEOUT:jr("AVV_ERR_PLUGIN_EXEC_TIMEOUT","Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise")}});var Bn=E((d8,Tg)=>{"use strict";var hC=Symbol("avvio.Boot"),pC=Symbol("isOnCloseHandler"),mC=Symbol("avvio.ThenifyDoNotWrap"),gC=Symbol("avvio.TimeTree.untrackNode"),yC=Symbol("avvio.TimeTree.trackNode"),_C=Symbol("avvio.TimeTree.getParent"),SC=Symbol("avvio.TimeTree.getNode"),EC=Symbol("avvio.TimeTree.addNode"),bC=Symbol.for("plugin-meta");Tg.exports={kAvvio:hC,kIsOnCloseHandler:pC,kThenifyDoNotWrap:mC,kUntrackNode:gC,kTrackNode:yC,kGetParent:_C,kGetNode:SC,kAddNode:EC,kPluginMeta:bC}});var kg=E((h8,Ng)=>{"use strict";var{kUntrackNode:$g,kTrackNode:ec,kGetParent:Pg,kGetNode:Ag,kAddNode:Cg}=Bn(),tc=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[ec](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[$g](e){this.tableId.delete(e.id);let r=this.tableLabel.get(e.label);r.pop(),r.length===0&&this.tableLabel.delete(e.label)}[Pg](e){if(e===null)return null;if(this.tableLabel.has(e)){let r=this.tableLabel.get(e);return r[r.length-1]}else return null}[Ag](e){return this.tableId.get(e)}[Cg](e,r,n){let s=this[Pg](e);if(s===null)return this.root={parent:null,id:"root",label:r,nodes:[],start:n,stop:null,diff:-1},this[ec](this.root),this.root.id;let o=`${r}-${Math.random()}`,a={parent:e,id:o,label:r,nodes:[],start:n,stop:null,diff:-1};return s.nodes.push(a),this[ec](a),o}start(e,r,n=Date.now()){return this[Cg](e,r,n)}stop(e,r=Date.now()){let n=this[Ag](e);n&&(n.stop=r,n.diff=n.stop-n.start||0,this[$g](n))}toJSON(){return Object.assign({},this.root)}prettyPrint(){return Ig(this.toJSON())}};function Ig(t,e=""){let r=e,n=t.nodes.length,s=n-1;r+=`${t.label} ${t.diff} ms
|
|
28
|
+
`;for(let i=0;i<n;++i){let o=t.nodes[i],a=e+(i===s?" ":"\u2502 ");r+=e,r+=i===s?"\u2514\u2500":"\u251C\u2500",r+=o.nodes.length===0?"\u2500 ":"\u252C ",r+=Ig(o,a).slice(e.length+2)}return r}Ng.exports={TimeTree:tc}});var jo=E((p8,xg)=>{"use strict";var{debuglog:vC}=V("node:util"),wC=vC("avvio");xg.exports={debug:wC}});var qg=E((m8,Lg)=>{"use strict";function RC(){let t={resolve:null,reject:null,promise:null};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}Lg.exports={createPromise:RC}});var Dg=E((g8,jg)=>{"use strict";var{kPluginMeta:rc}=Bn();function OC(t,e){return t[rc]&&t[rc].name?t[rc].name:e&&e.name?e.name:t.name?t.name:t.toString().split(`
|
|
29
|
+
`).slice(0,2).map(r=>r.trim()).join(" -- ")}jg.exports={getPluginName:OC}});var Do=E((y8,Fg)=>{"use strict";function TC(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}Fg.exports={isPromiseLike:TC}});var Hg=E((_8,Mg)=>{"use strict";var{EventEmitter:$C}=V("node:events"),{inherits:PC}=V("node:util"),{debug:Ge}=jo(),{createPromise:AC}=qg(),{AVV_ERR_PLUGIN_EXEC_TIMEOUT:CC}=qo(),{getPluginName:IC}=Dg(),{isPromiseLike:NC}=Do();function Gn(t,e,r,n,s){this.queue=t,this.func=e,this.options=r,this.isAfter=n,this.timeout=s,this.started=!1,this.name=IC(e,r),this.queue.pause(),this._error=null,this.loaded=!1,this._promise=null,this.startTime=null}PC(Gn,$C);Gn.prototype.exec=function(t,e){Ge("exec",this.name),this.server=t;let r=this.func,n=this.name,s=!1;this.options=typeof this.options=="function"?this.options(this.server):this.options;let i=null,o=l=>{if(s){Ge("loading complete",n);return}this._error=l,Ge(l?"exec errored":"exec completed",n),s=!0,i&&clearTimeout(i),e(l)};this.timeout>0&&(Ge("setting up timeout",n,this.timeout),i=setTimeout(function(){Ge("timed out",n),i=null;let l=new CC(n);l.fn=r,o(l)},this.timeout)),this.started=!0,this.startTime=Date.now(),this.emit("start",this.server?this.server.name:null,this.name,Date.now());let a=r(this.server,this.options,o);NC(a)?(Ge("exec: resolving promise",n),a.then(()=>process.nextTick(o),l=>process.nextTick(o,l))):r.length<3&&o()};Gn.prototype.loadedSoFar=function(){if(Ge("loadedSoFar",this.name),this.loaded)return Promise.resolve();let t=()=>{this.server.after((r,n)=>{this._error=r,this.queue.pause(),this._promise&&(r?(Ge("rejecting promise",this.name,r),this._promise.reject(r)):(Ge("resolving promise",this.name),this._promise.resolve()),this._promise=null),process.nextTick(n,r)}),this.queue.resume()},e;return this._promise?e=Promise.resolve():(this._promise=AC(),e=this._promise.promise,this.server?t():this.on("start",t)),e};Gn.prototype.enqueue=function(t,e){Ge("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.queue.push(t,e)};Gn.prototype.finish=function(t,e){Ge("finish",this.name,t);let r=()=>{this.loaded||(Ge("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,e(t))};if(t){this._promise&&(this._promise.reject(t),this._promise=null),r();return}let n=()=>{if(Ge("check",this.name,this.queue.length(),this.queue.running(),this._promise),this.queue.length()===0&&this.queue.running()===0)if(this._promise){let s=()=>{Ge("wrap"),queueMicrotask(n)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else r();else Ge("delayed",this.name),this.queue.drain=()=>{Ge("drain",this.name),this.queue.drain=kC,queueMicrotask(n)}};queueMicrotask(n),this.queue.resume()};function kC(){}Mg.exports={Plugin:Gn}});var zg=E((S8,Vg)=>{"use strict";var{AVV_ERR_PLUGIN_NOT_VALID:nc}=qo();function xC(t){if(!(t&&(typeof t=="function"||typeof t.then=="function")))throw Array.isArray(t)?new nc("array"):t===null?new nc("null"):new nc(typeof t)}Vg.exports={validatePlugin:xC}});var Bg=E((E8,Ug)=>{"use strict";function LC(t){return t!==null&&typeof t=="object"&&typeof t.default=="function"}Ug.exports={isBundledOrTypescriptPlugin:LC}});var Jg=E((b8,Wg)=>{"use strict";var{debug:Gg}=jo(),{kThenifyDoNotWrap:sc}=Bn();function qC(){if(this.booted){Gg("thenify returning undefined because we are already booted");return}if(this[sc]){this[sc]=!1;return}return Gg("thenify"),(t,e)=>this._loadRegistered().then(()=>(this[sc]=!0,t(this._server)),e)}Wg.exports={thenify:qC}});var Yg=E((v8,Kg)=>{"use strict";var{isPromiseLike:jC}=Do(),{kAvvio:DC}=Bn();function FC(t,e,r){let n=t.apply(t,e);jC(n)&&!n[DC]?n.then(()=>process.nextTick(r),s=>process.nextTick(r,s)):r&&process.nextTick(r)}Kg.exports={executeWithThenable:FC}});var iy=E((w8,sy)=>{"use strict";var Fo=Rg(),MC=V("node:events").EventEmitter,HC=V("node:util").inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ks,AVV_ERR_CALLBACK_NOT_FN:Wn,AVV_ERR_ROOT_PLG_BOOTED:VC,AVV_ERR_READY_TIMEOUT:zC,AVV_ERR_ATTRIBUTE_ALREADY_DEFINED:UC}=qo(),{kAvvio:Zg,kIsOnCloseHandler:ey}=Bn(),{TimeTree:BC}=kg(),{Plugin:ty}=Hg(),{debug:Jn}=jo(),{validatePlugin:GC}=zg(),{isBundledOrTypescriptPlugin:WC}=Bg(),{isPromiseLike:JC}=Do(),{thenify:ry}=Jg(),{executeWithThenable:Xg}=Yg();function je(t,e,r){if(typeof t=="function"&&arguments.length===1&&(r=t,e={},t=null),typeof e=="function"&&(r=e,e={}),e=e||{},e.autostart=e.autostart!==!1,e.timeout=Number(e.timeout)||0,e.expose=e.expose||{},!new.target)return new je(t,e,r);this._server=t||this,this._opts=e,t&&this._expose(),this._current=[],this._error=null,this._lastUsed=null,this.setMaxListeners(0),r&&this.once("start",r),this.started=!1,this.booted=!1,this.pluginTree=new BC,this._readyQ=Fo(this,ny,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Qg},this._closeQ=Fo(this,YC,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Qg},this._doStart=null;let n=this;this._root=new ty(Fo(this,this._loadPluginNextTick,1),function(i,o,a){n._doStart=a,o.autostart&&n.start()},e,!1,0),this._trackPluginLoading(this._root),this._loadPlugin(this._root,s=>{Jn("root plugin ready");try{this.emit("preReady"),this._root=null}catch(i){s=s||this._error||i}if(s){if(this._error=s,this._readyQ.length()===0)throw s}else this.booted=!0;this._readyQ.resume()})}HC(je,MC);je.prototype.start=function(){return this.started=!0,process.nextTick(this._doStart),this};je.prototype.override=function(t,e,r){return t};je.prototype[Zg]=!0;je.prototype.use=function(t,e){return this._lastUsed=this._addPlugin(t,e,!1),this};je.prototype._loadRegistered=function(){let t=this._current[0];return!this.started&&!this.booted&&process.nextTick(()=>this._root.queue.resume()),t?t.loadedSoFar():Promise.resolve()};Object.defineProperty(je.prototype,"then",{get:ry});je.prototype._addPlugin=function(t,e,r){if(WC(t)&&(t=t.default),GC(t),e=e||{},this.booted)throw new VC;let n=this._current[0],s=this._opts.timeout;if(!n.loaded&&n.timeout>0){let o=Date.now()-n.startTime;s=n.timeout-(o+3)}let i=new ty(Fo(this,this._loadPluginNextTick,1),t,e,r,s);if(this._trackPluginLoading(i),n.loaded)throw new Error(i.name,n.name);return n.enqueue(i,o=>{o&&(this._error=o)}),i};je.prototype._expose=function(){let e=this,r=e._server,{use:n="use",after:s="after",ready:i="ready",onClose:o="onClose",close:a="close"}=this._opts.expose;if(r[n])throw new Ks(n,"use");if(r[n]=function(l,u){return e.use(l,u),this},r[s])throw new Ks(s,"after");if(r[s]=function(l){return typeof l!="function"?e._loadRegistered():(e.after(ic(l,this)),this)},r[i])throw new Ks(i,"ready");if(r[i]=function(l){if(l&&typeof l!="function")throw new Wn(i,typeof l);return e.ready(l?ic(l,this):void 0)},r[o])throw new Ks(o,"onClose");if(r[o]=function(l){if(typeof l!="function")throw new Wn(o,typeof l);return e.onClose(XC(l,this)),this},r[a])throw new Ks(a,"close");if(r[a]=function(l){if(l&&typeof l!="function")throw new Wn(a,typeof l);return l?(e.close(ic(l,this)),this):e.close()},r.then)throw new UC("then");Object.defineProperty(r,"then",{get:ry.bind(e)}),r[Zg]=!0};je.prototype.after=function(t){if(!t)return this._loadRegistered();this._addPlugin(e.bind(this),{},!0);function e(r,n,s){ny.call(this,t,s)}return this};je.prototype.onClose=function(t){if(typeof t!="function")throw new Wn("onClose",typeof t);return t[ey]=!0,this._closeQ.unshift(t,e=>{e&&(this._error=e)}),this};je.prototype.close=function(t){let e;if(t){if(typeof t!="function")throw new Wn("close",typeof t)}else e=new Promise(function(r,n){t=function(s){if(s)return n(s);r()}});return this.ready(()=>{this._error=null,this._closeQ.push(t),process.nextTick(this._closeQ.resume.bind(this._closeQ))}),e};je.prototype.ready=function(t){if(t){if(typeof t!="function")throw new Wn("ready",typeof t);this._readyQ.push(t),queueMicrotask(this.start.bind(this));return}return new Promise((e,r)=>{this._readyQ.push(s),this.start();let n=this._current[0].server;function s(i,o,a){i?r(i):e(n),process.nextTick(a)}})};je.prototype._trackPluginLoading=function(t){let e=this._current[0]?.name||null;t.once("start",(r,n,s)=>{let i=this.pluginTree.start(e||null,n,s);t.once("loaded",(o,a,l)=>{this.pluginTree.stop(i,l)})})};je.prototype.prettyPrint=function(){return this.pluginTree.prettyPrint()};je.prototype.toJSON=function(){return this.pluginTree.toJSON()};je.prototype._loadPlugin=function(t,e){let r=this;if(JC(t.func)){t.func.then(o=>{typeof o.default=="function"&&(o=o.default),t.func=o,this._loadPlugin(t,e)},e);return}let n=r._current[0];if(r._current.unshift(t),r._error&&!t.isAfter){Jn("skipping loading of plugin as instance errored and it is not an after",t.name),process.nextTick(i);return}let s=n&&n.server||r._server;if(!t.isAfter)try{s=r.override(s,t.func,t.options)}catch(o){return Jn("override errored",t.name),i(o)}t.exec(s,i);function i(o){t.finish(o,a=>{r._current.shift(),e(a)})}};je.prototype._loadPluginNextTick=function(t,e){process.nextTick(this._loadPlugin.bind(this),t,e)};function Qg(){}function ny(t,e){let r=this._server,n=this._error;if(this._error=null,t.length===0)this._error=n,Xg(t,[],e);else if(t.length===1)Xg(t,[n],e);else if(this._opts.timeout===0){let s=i=>{this._error=i,e(this._error)};t.length===2?t(n,s):t(n,r,s)}else KC.call(this,t,n,r,e)}function KC(t,e,r,n){let s=t.unwrappedName??t.name;Jn("setting up ready timeout",s,this._opts.timeout);let i=setTimeout(()=>{Jn("timed out",s),i=null;let a=new zC(s);a.fn=t,this._error=a,n(a)},this._opts.timeout);t.length===2?t(e,o.bind(this)):t(e,r,o.bind(this));function o(a){i&&(clearTimeout(i),this._error=a,n(this._error))}}function YC(t,e){let r=this._server,n=t[ey];if(t.length===0||t.length===1){let s;n?s=t(r):s=t(this._error),s&&typeof s.then=="function"?(Jn("resolving close/onClose promise"),s.then(()=>process.nextTick(e),i=>process.nextTick(e,i))):process.nextTick(e)}else t.length===2?t(n?r:this._error,e):n?t(r,e):t(this._error,r,e)}function XC(t,e){return r.bind(e);function r(n,s){let i;t.length===0?(i=t(),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t.length===1?(i=t(this),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t(this,s)}}function ic(t,e){let r=n.bind(e);return r.unwrappedName=t.name,r;function n(s,i){let o;t?t.length===0?(o=t(),o&&o.then?o.then(function(){process.nextTick(i,s)},i):process.nextTick(i,s)):t.length===1?(o=t(s),o&&o.then?o.then(function(){process.nextTick(i)},i):process.nextTick(i)):t.length===2?t(s,i):t(s,this,i):process.nextTick(i)}}sy.exports=je});var De=E((R8,oy)=>{"use strict";var QC={kAvvioBoot:Symbol("fastify.avvioBoot"),kChildren:Symbol("fastify.children"),kServerBindings:Symbol("fastify.serverBindings"),kBodyLimit:Symbol("fastify.bodyLimit"),kSupportedHTTPMethods:Symbol("fastify.acceptedHTTPMethods"),kRoutePrefix:Symbol("fastify.routePrefix"),kLogLevel:Symbol("fastify.logLevel"),kLogSerializers:Symbol("fastify.logSerializers"),kHooks:Symbol("fastify.hooks"),kContentTypeParser:Symbol("fastify.contentTypeParser"),kState:Symbol("fastify.state"),kOptions:Symbol("fastify.options"),kDisableRequestLogging:Symbol("fastify.disableRequestLogging"),kPluginNameChain:Symbol("fastify.pluginNameChain"),kRouteContext:Symbol("fastify.context"),kGenReqId:Symbol("fastify.genReqId"),kHttp2ServerSessions:Symbol("fastify.http2ServerSessions"),kSchemaController:Symbol("fastify.schemaController"),kSchemaHeaders:Symbol("headers-schema"),kSchemaParams:Symbol("params-schema"),kSchemaQuerystring:Symbol("querystring-schema"),kSchemaBody:Symbol("body-schema"),kSchemaResponse:Symbol("response-schema"),kSchemaErrorFormatter:Symbol("fastify.schemaErrorFormatter"),kSchemaVisited:Symbol("fastify.schemas.visited"),kRequest:Symbol("fastify.Request"),kRequestPayloadStream:Symbol("fastify.RequestPayloadStream"),kRequestAcceptVersion:Symbol("fastify.RequestAcceptVersion"),kRequestCacheValidateFns:Symbol("fastify.request.cache.validateFns"),kRequestOriginalUrl:Symbol("fastify.request.originalUrl"),kFourOhFour:Symbol("fastify.404"),kCanSetNotFoundHandler:Symbol("fastify.canSetNotFoundHandler"),kFourOhFourLevelInstance:Symbol("fastify.404LogLevelInstance"),kFourOhFourContext:Symbol("fastify.404ContextKey"),kDefaultJsonParse:Symbol("fastify.defaultJSONParse"),kReply:Symbol("fastify.Reply"),kReplySerializer:Symbol("fastify.reply.serializer"),kReplyIsError:Symbol("fastify.reply.isError"),kReplyHeaders:Symbol("fastify.reply.headers"),kReplyTrailers:Symbol("fastify.reply.trailers"),kReplyHasStatusCode:Symbol("fastify.reply.hasStatusCode"),kReplyHijacked:Symbol("fastify.reply.hijacked"),kReplyStartTime:Symbol("fastify.reply.startTime"),kReplyNextErrorHandler:Symbol("fastify.reply.nextErrorHandler"),kReplyEndTime:Symbol("fastify.reply.endTime"),kReplyErrorHandlerCalled:Symbol("fastify.reply.errorHandlerCalled"),kReplyIsRunningOnErrorHook:Symbol("fastify.reply.isRunningOnErrorHook"),kReplySerializerDefault:Symbol("fastify.replySerializerDefault"),kReplyCacheSerializeFns:Symbol("fastify.reply.cache.serializeFns"),kTestInternals:Symbol("fastify.testInternals"),kErrorHandler:Symbol("fastify.errorHandler"),kErrorHandlerAlreadySet:Symbol("fastify.errorHandlerAlreadySet"),kChildLoggerFactory:Symbol("fastify.childLoggerFactory"),kHasBeenDecorated:Symbol("fastify.hasBeenDecorated"),kKeepAliveConnections:Symbol("fastify.keepAliveConnections"),kRouteByFastify:Symbol("fastify.routeByFastify")};oy.exports=QC});var ly=E((O8,Mo)=>{"use strict";var{format:oc}=V("node:util");function ZC(t){return ay({...t,name:"DeprecationWarning"})}function ay({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=oc(r,o,a,l):o&&a?u=oc(r,o,a):o?u=oc(r,o):u=r,u},i}var ac={createWarning:ay,createDeprecation:ZC};Mo.exports=ac;Mo.exports.default=ac;Mo.exports.processWarning=ac});var Kn=E((T8,uy)=>{"use strict";var{createWarning:Ys}=ly(),eI=Ys({name:"FastifyWarning",code:"FSTWRN001",message:"The %s schema for %s: %s is missing. This may indicate the schema is not well specified.",unlimited:!0}),tI=Ys({name:"FastifyWarning",code:"FSTWRN003",message:"The %s mixes async and callback styles that may lead to unhandled rejections. Please use only one of them.",unlimited:!0}),rI=Ys({name:"FastifyWarning",code:"FSTWRN004",message:"It seems that you are overriding an errorHandler in the same scope, which can lead to subtle bugs.",unlimited:!0}),nI=Ys({name:"FastifySecurity",code:"FSTSEC001",message:'You are using /%s/ Content-Type which may be vulnerable to CORS attack. Please make sure your RegExp start with "^" or include ";?" to proper detection of the essence MIME type.',unlimited:!0}),sI=Ys({name:"FastifyWarning",code:"FSTDEP022",message:'The router options for %s property access is deprecated. Please use "options.routerOptions" instead for accessing router options. The router options will be removed in `fastify@6`.',unlimited:!0});uy.exports={FSTWRN001:eI,FSTWRN003:tI,FSTWRN004:rI,FSTSEC001:nI,FSTDEP022:sI}});var He=E(($8,Ho)=>{"use strict";var L=Zu(),fn={FST_ERR_NOT_FOUND:L("FST_ERR_NOT_FOUND","Not Found",404),FST_ERR_OPTIONS_NOT_OBJ:L("FST_ERR_OPTIONS_NOT_OBJ","Options must be an object",500,TypeError),FST_ERR_QSP_NOT_FN:L("FST_ERR_QSP_NOT_FN","querystringParser option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:L("FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN","schemaController.bucket option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:L("FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN","schemaErrorFormatter option should be a non async function. Instead got '%s'.",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ","ajv.customOptions option should be an object, instead got '%s'",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR","ajv.plugins option should be an array, instead got '%s'",500,TypeError),FST_ERR_VALIDATION:L("FST_ERR_VALIDATION","%s",400),FST_ERR_LISTEN_OPTIONS_INVALID:L("FST_ERR_LISTEN_OPTIONS_INVALID","Invalid listen options: '%s'",500,TypeError),FST_ERR_ERROR_HANDLER_NOT_FN:L("FST_ERR_ERROR_HANDLER_NOT_FN","Error Handler must be a function",500,TypeError),FST_ERR_ERROR_HANDLER_ALREADY_SET:L("FST_ERR_ERROR_HANDLER_ALREADY_SET","Error Handler already set in this scope. Set 'allowErrorHandlerOverride: true' to allow overriding.",500,TypeError),FST_ERR_CTP_ALREADY_PRESENT:L("FST_ERR_CTP_ALREADY_PRESENT","Content type parser '%s' already present."),FST_ERR_CTP_INVALID_TYPE:L("FST_ERR_CTP_INVALID_TYPE","The content type should be a string or a RegExp",500,TypeError),FST_ERR_CTP_EMPTY_TYPE:L("FST_ERR_CTP_EMPTY_TYPE","The content type cannot be an empty string",500,TypeError),FST_ERR_CTP_INVALID_HANDLER:L("FST_ERR_CTP_INVALID_HANDLER","The content type handler should be a function",500,TypeError),FST_ERR_CTP_INVALID_PARSE_TYPE:L("FST_ERR_CTP_INVALID_PARSE_TYPE","The body parser can only parse your data as 'string' or 'buffer', you asked '%s' which is not supported.",500,TypeError),FST_ERR_CTP_BODY_TOO_LARGE:L("FST_ERR_CTP_BODY_TOO_LARGE","Request body is too large",413,RangeError),FST_ERR_CTP_INVALID_MEDIA_TYPE:L("FST_ERR_CTP_INVALID_MEDIA_TYPE","Unsupported Media Type: %s",415),FST_ERR_CTP_INVALID_CONTENT_LENGTH:L("FST_ERR_CTP_INVALID_CONTENT_LENGTH","Request body size did not match Content-Length",400,RangeError),FST_ERR_CTP_EMPTY_JSON_BODY:L("FST_ERR_CTP_EMPTY_JSON_BODY","Body cannot be empty when content-type is set to 'application/json'",400),FST_ERR_CTP_INVALID_JSON_BODY:L("FST_ERR_CTP_INVALID_JSON_BODY","Body is not valid JSON but content-type is set to 'application/json'",400),FST_ERR_CTP_INSTANCE_ALREADY_STARTED:L("FST_ERR_CTP_INSTANCE_ALREADY_STARTED",'Cannot call "%s" when fastify instance is already started!',400),FST_ERR_DEC_ALREADY_PRESENT:L("FST_ERR_DEC_ALREADY_PRESENT","The decorator '%s' has already been added!"),FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:L("FST_ERR_DEC_DEPENDENCY_INVALID_TYPE","The dependencies of decorator '%s' must be of type Array.",500,TypeError),FST_ERR_DEC_MISSING_DEPENDENCY:L("FST_ERR_DEC_MISSING_DEPENDENCY","The decorator is missing dependency '%s'."),FST_ERR_DEC_AFTER_START:L("FST_ERR_DEC_AFTER_START","The decorator '%s' has been added after start!"),FST_ERR_DEC_REFERENCE_TYPE:L("FST_ERR_DEC_REFERENCE_TYPE","The decorator '%s' of type '%s' is a reference type. Use the { getter, setter } interface instead."),FST_ERR_DEC_UNDECLARED:L("FST_ERR_DEC_UNDECLARED","No decorator '%s' has been declared on %s."),FST_ERR_HOOK_INVALID_TYPE:L("FST_ERR_HOOK_INVALID_TYPE","The hook name must be a string",500,TypeError),FST_ERR_HOOK_INVALID_HANDLER:L("FST_ERR_HOOK_INVALID_HANDLER","%s hook should be a function, instead got %s",500,TypeError),FST_ERR_HOOK_INVALID_ASYNC_HANDLER:L("FST_ERR_HOOK_INVALID_ASYNC_HANDLER","Async function has too many arguments. Async hooks should not use the 'done' argument.",500,TypeError),FST_ERR_HOOK_NOT_SUPPORTED:L("FST_ERR_HOOK_NOT_SUPPORTED","%s hook not supported!",500,TypeError),FST_ERR_MISSING_MIDDLEWARE:L("FST_ERR_MISSING_MIDDLEWARE","You must register a plugin for handling middlewares, visit fastify.dev/docs/latest/Reference/Middleware/ for more info.",500),FST_ERR_HOOK_TIMEOUT:L("FST_ERR_HOOK_TIMEOUT","A callback for '%s' hook%s timed out. You may have forgotten to call 'done' function or to resolve a Promise"),FST_ERR_LOG_INVALID_DESTINATION:L("FST_ERR_LOG_INVALID_DESTINATION","Cannot specify both logger.stream and logger.file options"),FST_ERR_LOG_INVALID_LOGGER:L("FST_ERR_LOG_INVALID_LOGGER","Invalid logger object provided. The logger instance should have these functions(s): '%s'.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_INSTANCE:L("FST_ERR_LOG_INVALID_LOGGER_INSTANCE","loggerInstance only accepts a logger instance.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_CONFIG:L("FST_ERR_LOG_INVALID_LOGGER_CONFIG","logger options only accepts a configuration object.",500,TypeError),FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:L("FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED","You cannot provide both logger and loggerInstance. Please provide only one.",500,TypeError),FST_ERR_REP_INVALID_PAYLOAD_TYPE:L("FST_ERR_REP_INVALID_PAYLOAD_TYPE","Attempted to send payload of invalid type '%s'. Expected a string or Buffer.",500,TypeError),FST_ERR_REP_RESPONSE_BODY_CONSUMED:L("FST_ERR_REP_RESPONSE_BODY_CONSUMED","Response.body is already consumed."),FST_ERR_REP_READABLE_STREAM_LOCKED:L("FST_ERR_REP_READABLE_STREAM_LOCKED","ReadableStream was locked. You should call releaseLock() method on reader before sending."),FST_ERR_REP_ALREADY_SENT:L("FST_ERR_REP_ALREADY_SENT",'Reply was already sent, did you forget to "return reply" in "%s" (%s)?'),FST_ERR_REP_SENT_VALUE:L("FST_ERR_REP_SENT_VALUE","The only possible value for reply.sent is true.",500,TypeError),FST_ERR_SEND_INSIDE_ONERR:L("FST_ERR_SEND_INSIDE_ONERR","You cannot use `send` inside the `onError` hook"),FST_ERR_SEND_UNDEFINED_ERR:L("FST_ERR_SEND_UNDEFINED_ERR","Undefined error has occurred"),FST_ERR_BAD_STATUS_CODE:L("FST_ERR_BAD_STATUS_CODE","Called reply with an invalid status code: %s"),FST_ERR_BAD_TRAILER_NAME:L("FST_ERR_BAD_TRAILER_NAME","Called reply.trailer with an invalid header name: %s"),FST_ERR_BAD_TRAILER_VALUE:L("FST_ERR_BAD_TRAILER_VALUE","Called reply.trailer('%s', fn) with an invalid type: %s. Expected a function."),FST_ERR_FAILED_ERROR_SERIALIZATION:L("FST_ERR_FAILED_ERROR_SERIALIZATION","Failed to serialize an error. Error: %s. Original error: %s"),FST_ERR_MISSING_SERIALIZATION_FN:L("FST_ERR_MISSING_SERIALIZATION_FN",'Missing serialization function. Key "%s"'),FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:L("FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN",'Missing serialization function. Key "%s:%s"'),FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:L("FST_ERR_REQ_INVALID_VALIDATION_INVOCATION",'Invalid validation invocation. Missing validation function for HTTP part "%s" nor schema provided.'),FST_ERR_SCH_MISSING_ID:L("FST_ERR_SCH_MISSING_ID","Missing schema $id property"),FST_ERR_SCH_ALREADY_PRESENT:L("FST_ERR_SCH_ALREADY_PRESENT","Schema with id '%s' already declared!"),FST_ERR_SCH_CONTENT_MISSING_SCHEMA:L("FST_ERR_SCH_CONTENT_MISSING_SCHEMA","Schema is missing for the content type '%s'"),FST_ERR_SCH_DUPLICATE:L("FST_ERR_SCH_DUPLICATE","Schema with '%s' already present!"),FST_ERR_SCH_VALIDATION_BUILD:L("FST_ERR_SCH_VALIDATION_BUILD","Failed building the validation schema for %s: %s, due to error %s"),FST_ERR_SCH_SERIALIZATION_BUILD:L("FST_ERR_SCH_SERIALIZATION_BUILD","Failed building the serialization schema for %s: %s, due to error %s"),FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:L("FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX",'response schemas should be nested under a valid status code, e.g { 2xx: { type: "object" } }'),FST_ERR_INIT_OPTS_INVALID:L("FST_ERR_INIT_OPTS_INVALID","Invalid initialization options: '%s'"),FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:L("FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE","Cannot set forceCloseConnections to 'idle' as your HTTP server does not support closeIdleConnections method"),FST_ERR_DUPLICATED_ROUTE:L("FST_ERR_DUPLICATED_ROUTE","Method '%s' already declared for route '%s'"),FST_ERR_BAD_URL:L("FST_ERR_BAD_URL","'%s' is not a valid url component",400,URIError),FST_ERR_ASYNC_CONSTRAINT:L("FST_ERR_ASYNC_CONSTRAINT","Unexpected error from async constraint",500),FST_ERR_INVALID_URL:L("FST_ERR_INVALID_URL","URL must be a string. Received '%s'",400,TypeError),FST_ERR_ROUTE_OPTIONS_NOT_OBJ:L("FST_ERR_ROUTE_OPTIONS_NOT_OBJ",'Options for "%s:%s" route must be an object',500,TypeError),FST_ERR_ROUTE_DUPLICATED_HANDLER:L("FST_ERR_ROUTE_DUPLICATED_HANDLER",'Duplicate handler for "%s:%s" route is not allowed!',500),FST_ERR_ROUTE_HANDLER_NOT_FN:L("FST_ERR_ROUTE_HANDLER_NOT_FN","Error Handler for %s:%s route, if defined, must be a function",500,TypeError),FST_ERR_ROUTE_MISSING_HANDLER:L("FST_ERR_ROUTE_MISSING_HANDLER",'Missing handler function for "%s:%s" route.',500),FST_ERR_ROUTE_METHOD_INVALID:L("FST_ERR_ROUTE_METHOD_INVALID","Provided method is invalid!",500,TypeError),FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:L("FST_ERR_ROUTE_METHOD_NOT_SUPPORTED","%s method is not supported.",500),FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:L("FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED","Body validation schema for %s:%s route is not supported!",500),FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:L("FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT","'bodyLimit' option must be an integer > 0. Got '%s'",500,TypeError),FST_ERR_ROUTE_REWRITE_NOT_STR:L("FST_ERR_ROUTE_REWRITE_NOT_STR",'Rewrite url for "%s" needs to be of type "string" but received "%s"',500,TypeError),FST_ERR_REOPENED_CLOSE_SERVER:L("FST_ERR_REOPENED_CLOSE_SERVER","Fastify has already been closed and cannot be reopened"),FST_ERR_REOPENED_SERVER:L("FST_ERR_REOPENED_SERVER","Fastify is already listening"),FST_ERR_INSTANCE_ALREADY_LISTENING:L("FST_ERR_INSTANCE_ALREADY_LISTENING","Fastify instance is already listening. %s"),FST_ERR_PLUGIN_VERSION_MISMATCH:L("FST_ERR_PLUGIN_VERSION_MISMATCH","fastify-plugin: %s - expected '%s' fastify version, '%s' is installed"),FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:L("FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE","The decorator '%s'%s is not present in %s"),FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:L("FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER","The %s plugin being registered mixes async and callback styles. Async plugin should not mix async and callback style.",500,TypeError),FST_ERR_PLUGIN_CALLBACK_NOT_FN:L("FST_ERR_PLUGIN_CALLBACK_NOT_FN","fastify-plugin: %s",500,TypeError),FST_ERR_PLUGIN_NOT_VALID:L("FST_ERR_PLUGIN_NOT_VALID","fastify-plugin: %s"),FST_ERR_ROOT_PLG_BOOTED:L("FST_ERR_ROOT_PLG_BOOTED","fastify-plugin: %s"),FST_ERR_PARENT_PLUGIN_BOOTED:L("FST_ERR_PARENT_PLUGIN_BOOTED","fastify-plugin: %s"),FST_ERR_PLUGIN_TIMEOUT:L("FST_ERR_PLUGIN_TIMEOUT","fastify-plugin: %s")};function iI(t,e){return e.cause=t,e}Ho.exports=fn;Ho.exports.appendStackTrace=iI;Ho.exports.AVVIO_ERRORS_MAP={AVV_ERR_CALLBACK_NOT_FN:fn.FST_ERR_PLUGIN_CALLBACK_NOT_FN,AVV_ERR_PLUGIN_NOT_VALID:fn.FST_ERR_PLUGIN_NOT_VALID,AVV_ERR_ROOT_PLG_BOOTED:fn.FST_ERR_ROOT_PLG_BOOTED,AVV_ERR_PARENT_PLG_LOADED:fn.FST_ERR_PARENT_PLUGIN_BOOTED,AVV_ERR_READY_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT,AVV_ERR_PLUGIN_EXEC_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT}});var Dr=E((P8,_y)=>{"use strict";var oI=["onRoute","onRegister","onReady","onListen","preClose","onClose"],hy=["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError","onRequestAbort"],aI=hy.concat(oI),{FST_ERR_HOOK_INVALID_TYPE:lI,FST_ERR_HOOK_INVALID_HANDLER:uI,FST_ERR_SEND_UNDEFINED_ERR:Vo,FST_ERR_HOOK_TIMEOUT:cI,FST_ERR_HOOK_NOT_SUPPORTED:fI,AVVIO_ERRORS_MAP:cy,appendStackTrace:fy}=He(),{kChildren:Xs,kHooks:py,kRequestPayloadStream:dy}=De();function Qs(){this.onRequest=[],this.preParsing=[],this.preValidation=[],this.preSerialization=[],this.preHandler=[],this.onResponse=[],this.onSend=[],this.onError=[],this.onRoute=[],this.onRegister=[],this.onReady=[],this.onListen=[],this.onTimeout=[],this.onRequestAbort=[],this.preClose=[]}Qs.prototype=Object.create(null);Qs.prototype.validate=function(t,e){if(typeof t!="string")throw new lI;if(Array.isArray(this[t])===!1)throw new fI(t);if(typeof e!="function")throw new uI(t,Object.prototype.toString.call(e))};Qs.prototype.add=function(t,e){this.validate(t,e),this[t].push(e)};function dI(t){let e=new Qs;return e.onRequest=t.onRequest.slice(),e.preParsing=t.preParsing.slice(),e.preValidation=t.preValidation.slice(),e.preSerialization=t.preSerialization.slice(),e.preHandler=t.preHandler.slice(),e.onSend=t.onSend.slice(),e.onResponse=t.onResponse.slice(),e.onError=t.onError.slice(),e.onRoute=t.onRoute.slice(),e.onRegister=t.onRegister.slice(),e.onTimeout=t.onTimeout.slice(),e.onRequestAbort=t.onRequestAbort.slice(),e.onReady=[],e.onListen=[],e.preClose=[],e}function my(t,e,r,n){let s=r[py][t],i=0,o=0;l();function a(c){let f=s[i-1]?.name,p=f?` "${f}"`:"";if(c){c.code==="AVV_ERR_READY_TIMEOUT"?c=fy(c,new cI(t,p)):c=cy[c.code]!=null?fy(c,new cy[c.code](c.message)):c,n(c);return}n()}function l(c){if(c){a(c);return}if(i===s.length&&o===r[Xs].length){i===0&&o===0?a():e(function(p,h){a(p),h(p)});return}if(i===s.length&&o<r[Xs].length){let f=r[Xs][o++];my(t,e,f,l);return}e(u(s[i++],r)),l()}function u(c,f){return function(p,h){if(p){h(p);return}if(c.length===1){try{c.call(f,h)}catch(d){h(d)}return}try{let d=c.call(f);if(d&&typeof d.then=="function"){d.then(h,h);return}}catch(d){p=d}h(p)}}}function gy(t){let e=t[py].onListen,r=e.length,n=0,s=0;i();function i(a){if(a&&t.log.error(a),n===r){for(;s<t[Xs].length;){let l=t[Xs][s++];gy(l)}return}o(e[n++],t,i)}async function o(a,l,u){if(a.length===1){try{a.call(l,u)}catch(c){u(c)}return}try{let c=a.call(l);if(c&&typeof c.then=="function"){c.then(u,u);return}u()}catch(c){u(c)}}}function Yn(t){return function(r,n,s,i){let o=0;function a(c){if(c||o===r.length){i(c,n,s);return}let f;try{f=t(r[o++],n,s,a)}catch(p){i(p,n,s);return}f&&typeof f.then=="function"&&f.then(l,u)}function l(){a()}function u(c){c||(c=new Vo),i(c,n,s)}a()}}function hI(t,e,r,n){return t(e,r,n)}var pI=Yn(hI),mI=Yn(Zs),gI=Yn(Zs),yI=Yn(Zs),_I=Yn(Zs);function yy(t,e,r,n,s){let i=0;function o(u,c){if(u){s(u,e,r,n);return}if(c!==void 0&&(n=c),i===t.length){s(null,e,r,n);return}let f;try{f=t[i++](e,r,n,o)}catch(p){s(p,e,r);return}f&&typeof f.then=="function"&&f.then(a,l)}function a(u){o(null,u)}function l(u){u||(u=new Vo),s(u,e,r,n)}o()}var SI=yy;function EI(t,e,r,n){let s=0;function i(l,u){if(r.sent)return;if(u!==void 0&&(e[dy]=u),l||s===t.length){n(l,e,r);return}let c;try{c=t[s++](e,r,e[dy],i)}catch(f){n(f,e,r);return}c&&typeof c.then=="function"&&c.then(o,a)}function o(l){i(null,l)}function a(l){l||(l=new Vo),n(l,e,r)}i()}function bI(t,e,r){let n=0;function s(a){if(a||n===t.length){r(a,e);return}let l;try{l=t[n++](e,s)}catch(u){r(u,e);return}l&&typeof l.then=="function"&&l.then(i,o)}function i(){s()}function o(a){a||(a=new Vo),r(a,e)}s()}function Zs(t,e,r,n){if(r.sent!==!0)return t(e,r,n)}_y.exports={Hooks:Qs,buildHooks:dI,hookRunnerGenerator:Yn,preParsingHookRunner:EI,onResponseHookRunner:pI,onSendHookRunner:yy,preSerializationHookRunner:SI,onRequestAbortHookRunner:bI,hookIterator:Zs,hookRunnerApplication:my,onListenHookRunner:gy,preHandlerHookRunner:gI,preValidationHookRunner:mI,onRequestHookRunner:_I,onTimeoutHookRunner:yI,lifecycleHooks:hy,supportedHooks:aI}});var Ey=E((A8,Sy)=>{"use strict";Sy.exports=function(){return{[Symbol.iterator]:function*(){},add(){},delete(){},has(){return!0}}}});var lc=E((C8,vy)=>{"use strict";var{kTestInternals:vI}=De();function by(){let t,e;return{promise:new Promise((n,s)=>{t=n,e=s}),resolve:t,reject:e}}vy.exports={withResolvers:typeof Promise.withResolvers=="function"?Promise.withResolvers.bind(Promise):by,[vI]:{withResolvers:by}}});var ky=E((I8,Ny)=>{"use strict";var wI=V("node:http"),RI=V("node:https"),wy=V("node:http2"),OI=V("node:dns"),TI=V("node:os"),{kState:ke,kOptions:$I,kServerBindings:PI,kHttp2ServerSessions:dn}=De(),{FSTWRN003:AI}=Kn(),{onListenHookRunner:zo}=Dr(),{FST_ERR_REOPENED_CLOSE_SERVER:Oy,FST_ERR_REOPENED_SERVER:Ty,FST_ERR_LISTEN_OPTIONS_INVALID:CI,FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:II}=He(),NI=Ey(),$y=lc();Ny.exports.createServer=kI;function Py(t){return`Server listening at ${t}`}function kI(t,e){let r=Cy(t,e);function n(u={port:0,host:"localhost"},c=void 0){if(typeof c=="function"&&(c.constructor.name==="AsyncFunction"&&AI("listen method"),u.cb=c),u.signal){if(typeof u.signal.on!="function"&&typeof u.signal.addEventListener!="function")throw new CI("Invalid options.signal");if(this[ke].aborted=u.signal.aborted,this[ke].aborted)return this.close();{let p=()=>{this[ke].aborted=!0,this.close()};u.signal.addEventListener("abort",p,{once:!0})}}let f;if(u.path==null?f=u.host??"localhost":f=u.host,(!Object.hasOwn(u,"host")||u.host==null)&&(u.host=f),f==="localhost"?u.cb=(p,h)=>{if(p){c(p,h);return}Ry.call(this,r,e,t,u,()=>{this[ke].listening=!0,c(null,h),zo(this)})}:u.cb=(p,h)=>{if(p){c(p,h);return}this[ke].listening=!0,c(null,h),zo(this)},c===void 0)return xI.call(this,r,u).then(h=>{let{promise:d,resolve:m}=$y.withResolvers();return f==="localhost"?Ry.call(this,r,e,t,u,()=>{this[ke].listening=!0,m(h),zo(this)}):(m(h),zo(this)),d});this.ready(Ay.call(this,r,u))}let s=typeof r.closeAllConnections=="function",i=typeof r.closeIdleConnections=="function",o=typeof r.closeHttp2Sessions=="function",a=t.forceCloseConnections;if(a==="idle"&&!i)throw new II;typeof a!="boolean"&&(a=i?"idle":!1);let l=!s&&a===!0?new Set:NI();return{server:r,listen:n,forceCloseConnections:a,serverHasCloseAllConnections:s,serverHasCloseHttp2Sessions:o,keepAliveConnections:l}}function Ry(t,e,r,n,s){this[ke].listening=!1,OI.lookup(n.host,{all:!0},(i,o)=>{if(i||this[ke].aborted){s();return}let a=t.listening&&r.serverFactory,l=0,u=0;if(!a){let f=t.address();for(let p of o)if(p.address!==f.address){l++;let h=Object.assign({},n,{host:p.address,port:f.port,cb:g=>{u++,g||this[PI].push(d),u===l&&s()}}),d=Cy(r,e),m=()=>{d.close(()=>{}),typeof d.closeAllConnections=="function"&&r.forceCloseConnections===!0&&d.closeAllConnections(),typeof d.closeHttp2Sessions=="function"&&d.closeHttp2Sessions()};d.on("upgrade",t.emit.bind(t,"upgrade")),t.on("unref",m),t.on("close",m),t.on("error",m),this[ke].listening=!1,Ay.call(this,d,h)()}}if(l===0){s();return}let c=t.unref;t.unref=function(){c.call(t),t.emit("unref")}})}function Ay(t,e){let r=n=>{if(t.removeListener("error",r),t.removeListener("listening",r),n)this[ke].listening=!1,e.cb(n,null);else{let s=Iy.call(this,t,e.listenTextResolver||Py);e.cb(null,s)}};return n=>{if(n!=null)return e.cb(n);if(this[ke].listening&&this[ke].closing)return e.cb(new Oy,null);if(this[ke].listening)return e.cb(new Ty,null);t.once("error",r),this[ke].closing||(t.once("listening",r),t.listen(e),this[ke].listening=!0)}}function xI(t,e){return this[ke].listening&&this[ke].closing?Promise.reject(new Oy):this[ke].listening?Promise.reject(new Ty):this.ready().then(()=>{if(this[ke].aborted)return;let{promise:r,resolve:n,reject:s}=$y.withResolvers(),i=l=>{a(),this[ke].listening=!1,s(l)},o=()=>{a(),this[ke].listening=!0,n(Iy.call(this,t,e.listenTextResolver||Py))};function a(){t.removeListener("error",i),t.removeListener("listening",o)}return t.once("error",i),t.once("listening",o),t.listen(e),r})}function Cy(t,e){if(t.serverFactory)return t.serverFactory(e,t);let r=t.https===!0?{}:t.https;if(t.http2){let s=typeof r=="object"?wy.createSecureServer(r,e):wy.createServer(t.http,e);return s.on("session",i=>i.setTimeout(t.http2SessionTimeout,()=>{i.close()})),t.forceCloseConnections===!0&&(s.closeHttp2Sessions=qI(s)),s.setTimeout(t.connectionTimeout),s}let n=r?RI.createServer(r,e):wI.createServer(t.http,e);return n.keepAliveTimeout=t.keepAliveTimeout,n.requestTimeout=t.requestTimeout,n.setTimeout(t.connectionTimeout),t.maxRequestsPerSocket>0&&(n.maxRequestsPerSocket=t.maxRequestsPerSocket),n}function LI(t){return t.address==="0.0.0.0"?Object.values(TI.networkInterfaces()).flatMap(e=>e.filter(r=>r.family==="IPv4")).sort(e=>e.internal?-1:1).map(e=>e.address):[t.address]}function Iy(t,e){let r;typeof t.address()=="string"?r=[t.address()]:(t.address().address.indexOf(":")===-1?r=LI(t.address()).map(s=>s+":"+t.address().port):r=["["+t.address().address+"]:"+t.address().port],r=r.map(s=>"http"+(this[$I].https?"s":"")+"://"+s));for(let s of r)this.log.info(e(s));return r[0]}function qI(t){return t[dn]=new Set,t.on("session",function(e){e.once("connect",function(){t[dn].add(e)}),e.once("close",function(){t[dn].delete(e)}),e.once("frameError",function(r,n,s){s===0&&t[dn].delete(e)}),e.once("goaway",function(){t[dn].delete(e)})}),function(){if(t[dn].size!==0)for(let r of t[dn])r.close()}}});var fc=E((N8,qy)=>{"use strict";var uc=/([\w!#$%&'*+.^`|~-]+)=([^;]*)/gm,xy=/^[\w!#$%&'*+.^`|~-]+$/,Ly=/^[\w!#$%&'*+.^`|~-]+\s*/,cc=class{#e=!1;#t=!0;#r="";#n="";#s=new Map;#i;constructor(e){if(e==null||e===""||e==="undefined")return;let r=e.indexOf(";");if(r===-1){if(r=e.indexOf("/"),r===-1)return;let l=e.slice(0,r).trimStart().toLowerCase(),u=e.slice(r+1).trimEnd().toLowerCase();xy.test(l)===!0&&Ly.test(u)===!0&&(this.#e=!0,this.#t=!1,this.#r=l,this.#n=u);return}let n=e.slice(0,r).toLowerCase(),s=e.slice(r+1).trim();if(r=n.indexOf("/"),r===-1)return;let i=n.slice(0,r).trimStart(),o=n.slice(r+1).trimEnd();if(xy.test(i)===!1||Ly.test(o)===!1)return;this.#r=i,this.#n=o,this.#e=!0,this.#t=!1;let a=uc.exec(s);for(;a;){let l=a[1],u=a[2];if(u[0]==='"'){if(u.at(-1)!=='"'){this.#s.set(l,"invalid quoted string"),a=uc.exec(s);continue}this.#s.set(l,u.slice(1,u.length-1))}else this.#s.set(l,u);a=uc.exec(s)}}get[Symbol.toStringTag](){return"ContentType"}get isEmpty(){return this.#t}get isValid(){return this.#e}get mediaType(){return`${this.#r}/${this.#n}`}get type(){return this.#r}get subtype(){return this.#n}get parameters(){return this.#s}toString(){if(this.#i)return this.#i;let e=[];for(let[n,s]of this.#s.entries())e.push(`${n}="${s}"`);let r=[this.#r,"/",this.#n];return e.length>0&&(r.push("; "),r.push(e.join("; "))),this.#i=r.join(""),this.#i}};qy.exports=cc});var Uo=E((k8,jy)=>{"use strict";var{kReplyHasStatusCode:jI}=De();function DI(t,e){if(!t[jI]||t.statusCode===200){let r=e&&(e.statusCode||e.status);t.code(r>=400?r:500)}}jy.exports={setErrorStatusCode:DI}});var dc=E((x8,Fy)=>{"use strict";var{kReplyIsError:Dy,kReplyHijacked:FI}=De(),{setErrorStatusCode:MI}=Uo(),HI=V("node:diagnostics_channel"),ei=HI.tracingChannel("fastify.request.handler");function VI(t,e,r){r&&(r.async=!0),t.then(function(n){if(e[FI]!==!0){r&&ei.asyncStart.publish(r);try{if(n!==void 0||e.sent===!1&&e.raw.headersSent===!1&&e.request.raw.aborted===!1&&e.request.socket&&!e.request.socket.destroyed)try{e.send(n)}catch(s){e[Dy]=!0,e.send(s)}}finally{r&&ei.asyncEnd.publish(r)}}},function(n){r&&(r.error=n,MI(e,n),ei.error.publish(r),ei.asyncStart.publish(r));try{if(e.sent===!0){e.log.error({err:n},"Promise errored, but reply.sent = true was set");return}e[Dy]=!0,e.send(n)}catch(s){e.send(s)}finally{r&&ei.asyncEnd.publish(r)}})}Fy.exports=VI});var mc=E((L8,Hy)=>{"use strict";var{kSchemaHeaders:Wo,kSchemaParams:hc,kSchemaQuerystring:pc,kSchemaBody:hn,kSchemaResponse:My}=De(),zI=/^[1-5](?:\d{2}|xx)$|^default$/,{FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:UI}=He(),{FSTWRN001:Bo}=Kn();function BI(t,e){if(!t.schema||!t.schema.response)return;let{method:r,url:n}=t.config||{};t[My]=Object.keys(t.schema.response).reduce(function(s,i){let o=t.schema.response[i];if(i=i.toLowerCase(),!zI.test(i))throw new UI;if(o.content){let a={};for(let l of Object.keys(o.content)){let u=o.content[l].schema;a[l]=e({schema:u,url:n,method:r,httpStatus:i,contentType:l})}s[i]=a}else s[i]=e({schema:o,url:n,method:r,httpStatus:i});return s},{})}function GI(t,e,r){let{schema:n}=t;if(!n)return;let{method:s,url:i}=t.config||{},o=n.headers;if(o&&(r||Object.getPrototypeOf(o)!==Object.prototype))t[Wo]=e({schema:o,method:s,url:i,httpPart:"headers"});else if(o){let a={};Object.keys(o).forEach(l=>{a[l]=o[l]}),a.required instanceof Array&&(a.required=a.required.map(l=>l.toLowerCase())),o.properties&&(a.properties={},Object.keys(o.properties).forEach(l=>{a.properties[l.toLowerCase()]=o.properties[l]})),t[Wo]=e({schema:a,method:s,url:i,httpPart:"headers"})}else Object.hasOwn(n,"headers")&&Bo("headers",s,i);if(n.body){let a=n.body.content;if(a){let l={};for(let u of Object.keys(a)){let c=a[u].schema;l[u]=e({schema:c,method:s,url:i,httpPart:"body",contentType:u})}t[hn]=l}else t[hn]=e({schema:n.body,method:s,url:i,httpPart:"body"})}else Object.hasOwn(n,"body")&&Bo("body",s,i);n.querystring?t[pc]=e({schema:n.querystring,method:s,url:i,httpPart:"querystring"}):Object.hasOwn(n,"querystring")&&Bo("querystring",s,i),n.params?t[hc]=e({schema:n.params,method:s,url:i,httpPart:"params"}):Object.hasOwn(n,"params")&&Bo("params",s,i)}function Go(t,e,r){let n=e[r]===void 0,s;try{s=t?.(n?null:e[r])}catch(o){return o.statusCode=500,o}if(s&&typeof s.then=="function")return s.then(o=>i(o)).catch(o=>o);return i(s);function i(o){return o===!1?t.errors:o&&o.error?o.error:(o&&o.value&&(e[r]=o.value),!1)}}function Jo(t,e,r){let n=r===void 0;if(n||!r.skipParams){let i=Go(t[hc],e,"params");if(i)return typeof i.then!="function"?Fr(i,"params",t.schemaErrorFormatter):WI(i,t,e)}if(n||!r.skipBody){let i=null;if(typeof t[hn]=="function")i=t[hn];else if(t[hn]){let a=XI(e.headers["content-type"]),l=t[hn][a];l&&(i=l)}let o=Go(i,e,"body");if(o)return typeof o.then!="function"?Fr(o,"body",t.schemaErrorFormatter):JI(o,t,e)}if(n||!r.skipQuery){let i=Go(t[pc],e,"query");if(i)return typeof i.then!="function"?Fr(i,"querystring",t.schemaErrorFormatter):KI(i,t,e)}let s=Go(t[Wo],e,"headers");return s?typeof s.then!="function"?Fr(s,"headers",t.schemaErrorFormatter):YI(s,t,e):!1}function WI(t,e,r){return t.then(n=>n?Fr(n,"params",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0}))}function JI(t,e,r){return t.then(n=>n?Fr(n,"body",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0,skipBody:!0}))}function KI(t,e,r){return t.then(n=>n?Fr(n,"querystring",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0,skipBody:!0,skipQuery:!0}))}function YI(t,e,r){return t.then(n=>n?Fr(n,"headers",e.schemaErrorFormatter):!1)}function Fr(t,e,r){if(t instanceof Error)return t.statusCode=t.statusCode||400,t.code=t.code||"FST_ERR_VALIDATION",t.validationContext=t.validationContext||e,t;let n=r(t,e);return n.statusCode=n.statusCode||400,n.code=n.code||"FST_ERR_VALIDATION",n.validation=t,n.validationContext=e,n}function XI(t){return t?t.split(/[ ;]/,1)[0].trim().toLowerCase():""}Hy.exports={symbols:{bodySchema:hn,querystringSchema:pc,responseSchema:My,paramsSchema:hc,headersSchema:Wo},compileSchemasForValidation:GI,compileSchemasForSerialization:BI,validate:Jo}});var Sc=E((q8,_c)=>{"use strict";var QI=V("node:diagnostics_channel"),ZI=fc(),e1=dc(),{validate:t1}=mc(),{preValidationHookRunner:r1,preHandlerHookRunner:n1}=Dr(),{FST_ERR_CTP_INVALID_MEDIA_TYPE:s1}=He(),{setErrorStatusCode:Vy}=Uo(),{kReplyIsError:ri,kRouteContext:tr,kFourOhFourContext:i1,kSupportedHTTPMethods:zy}=De(),ti=QI.tracingChannel("fastify.request.handler");function o1(t,e,r){if(r.sent===!0)return;if(t!=null){r[ri]=!0,r.send(t);return}let n=e.method;if(this[zy].bodyless.has(n)){Xn(e,r);return}if(this[zy].bodywith.has(n)){let s=e.headers,i=s["content-type"];if(i===void 0){let a=s["content-length"];if(s["transfer-encoding"]===void 0&&(a===void 0||a==="0")){Xn(e,r);return}e[tr].contentTypeParser.run("",Xn,e,r);return}let o=new ZI(i);if(o.isValid===!1){r[ri]=!0,r.status(415).send(new s1);return}e[tr].contentTypeParser.run(o.toString(),Xn,e,r);return}Xn(e,r)}function Xn(t,e){try{t[tr].preValidation!==null?r1(t[tr].preValidation,t,e,gc):gc(null,t,e)}catch(r){gc(r,t,e)}}function gc(t,e,r){if(r.sent===!0)return;if(t!=null){r[ri]=!0,r.send(t);return}let n=t1(r[tr],e);if(n&&typeof n.then=="function"||!1){let i=Uy.bind(null,e,r);n.then(i,i)}else Uy(e,r,n)}function Uy(t,e,r){if(r){if(e[tr].attachValidation===!1){e.send(r);return}e.request.validationError=r}t[tr].preHandler!==null?n1(t[tr].preHandler,t,e,yc):yc(null,t,e)}function yc(t,e,r){if(r.sent)return;let n=e[tr];if(!ti.hasSubscribers||n[i1]===null)By(t,e,r);else{let s={request:e,reply:r,async:!1,route:{url:n.config.url,method:n.config.method}};ti.start.runStores(s,By,void 0,t,e,r,s)}}function By(t,e,r,n){let s=e[tr];try{if(t!=null){r[ri]=!0,n&&(n.error=t,Vy(r,t),ti.error.publish(n)),r.send(t);return}let i;try{i=s.handler(e,r)}catch(o){n&&(n.error=o,Vy(r,o),ti.error.publish(n)),r[ri]=!0,r.send(o);return}i!==void 0&&(i!==null&&typeof i.then=="function"?e1(i,r,n):r.send(i))}finally{n&&ti.end.publish(n)}}_c.exports=o1;_c.exports[Symbol.for("internals")]={handler:Xn,preHandlerCallback:yc}});var Wy=E((j8,Gy)=>{"use strict";function Qn(){}var a1={fatal:Qn,error:Qn,warn:Qn,info:Qn,debug:Qn,trace:Qn};Object.defineProperty(Gy,"exports",{get(){return Object.create(a1)}})});var bc=E((D8,Yy)=>{"use strict";var ni=t=>t&&typeof t.message=="string",Ec=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return ni(r)?r:void 0}else return ni(e)?e:void 0},Jy=(t,e)=>{if(!ni(t))return"";let r=t.stack||"";if(e.has(t))return r+`
|
|
30
|
+
causes have become circular...`;let n=Ec(t);return n?(e.add(t),r+`
|
|
31
|
+
caused by: `+Jy(n,e)):r},l1=t=>Jy(t,new Set),Ky=(t,e,r)=>{if(!ni(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Ec(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Ky(s,e,i)}else return n},u1=t=>Ky(t,new Set);Yy.exports={isErrorLike:ni,getErrorCause:Ec,stackWithCauses:l1,messageWithCauses:u1}});var vc=E((F8,Qy)=>{"use strict";var c1=Symbol("circular-ref-tag"),Ko=Symbol("pino-raw-err-ref"),Xy=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Ko]},set:function(t){this[Ko]=t}}});Object.defineProperty(Xy,Ko,{writable:!0,value:{}});Qy.exports={pinoErrProto:Xy,pinoErrorSymbols:{seen:c1,rawSymbol:Ko}}});var t_=E((M8,e_)=>{"use strict";e_.exports=Rc;var{messageWithCauses:f1,stackWithCauses:d1,isErrorLike:Zy}=bc(),{pinoErrProto:h1,pinoErrorSymbols:p1}=vc(),{seen:wc}=p1,{toString:m1}=Object.prototype;function Rc(t){if(!Zy(t))return t;t[wc]=void 0;let e=Object.create(h1);e.type=m1.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=f1(t),e.stack=d1(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Rc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Zy(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,wc)&&(e[r]=Rc(n)):e[r]=n}return delete t[wc],e.raw=t,e}});var n_=E((H8,r_)=>{"use strict";r_.exports=Xo;var{isErrorLike:Oc}=bc(),{pinoErrProto:g1,pinoErrorSymbols:y1}=vc(),{seen:Yo}=y1,{toString:_1}=Object.prototype;function Xo(t){if(!Oc(t))return t;t[Yo]=void 0;let e=Object.create(g1);e.type=_1.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Xo(r))),Oc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Yo)&&(e.cause=Xo(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Oc(n)?Object.prototype.hasOwnProperty.call(n,Yo)||(e[r]=Xo(n)):e[r]=n}return delete t[Yo],e.raw=t,e}});var a_=E((V8,o_)=>{"use strict";o_.exports={mapHttpRequest:S1,reqSerializer:i_};var Tc=Symbol("pino-raw-req-ref"),s_=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Tc]},set:function(t){this[Tc]=t}}});Object.defineProperty(s_,Tc,{writable:!0,value:{}});function i_(t){let e=t.info||t.socket,r=Object.create(s_);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function S1(t){return{req:i_(t)}}});var f_=E((z8,c_)=>{"use strict";c_.exports={mapHttpResponse:E1,resSerializer:u_};var $c=Symbol("pino-raw-res-ref"),l_=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[$c]},set:function(t){this[$c]=t}}});Object.defineProperty(l_,$c,{writable:!0,value:{}});function u_(t){let e=Object.create(l_);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function E1(t){return{res:u_(t)}}});var Ac=E((U8,d_)=>{"use strict";var Pc=t_(),b1=n_(),Qo=a_(),Zo=f_();d_.exports={err:Pc,errWithCause:b1,mapHttpRequest:Qo.mapHttpRequest,mapHttpResponse:Zo.mapHttpResponse,req:Qo.reqSerializer,res:Zo.resSerializer,wrapErrorSerializer:function(e){return e===Pc?e:function(n){return e(Pc(n))}},wrapRequestSerializer:function(e){return e===Qo.reqSerializer?e:function(n){return e(Qo.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Zo.resSerializer?e:function(n){return e(Zo.resSerializer(n))}}}});var Cc=E((B8,h_)=>{"use strict";function v1(t,e){return e}h_.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=v1;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s}});var S_=E((G8,__)=>{"use strict";function Ic(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=Ic(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=Ic(t[r]));return e}return t}function p_(t){let e=[],r="",n=!1,s=!1,i="";for(let o=0;o<t.length;o++){let a=t[o];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,s=!1):(a==='"'||a==="'")&&n?s?a===i?(s=!1,i=""):r+=a:(s=!0,i=a):r+=a}return r&&e.push(r),e}function m_(t,e,r){let n=t;for(let i=0;i<e.length-1;i++){let o=e[i];if(typeof n!="object"||n===null||!(o in n)||typeof n[o]!="object"||n[o]===null)return!1;n=n[o]}let s=e[e.length-1];if(s==="*"){if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=r;else if(typeof n=="object"&&n!==null)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r)}else typeof n=="object"&&n!==null&&s in n&&Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r);return!0}function g_(t,e){let r=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof r!="object"||r===null||!(i in r)||typeof r[i]!="object"||r[i]===null)return!1;r=r[i]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let s=0;s<r.length;s++)r[s]=void 0;else if(typeof r=="object"&&r!==null)for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var ea=Symbol("PATH_NOT_FOUND");function w1(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return ea;r=r[n]}return r}function R1(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function O1(t,e,r,n=!1){for(let s of e){let i=p_(s);if(i.includes("*"))y_(t,i,r,s,n);else if(n)g_(t,i);else{let o=w1(t,i);if(o===ea)continue;let a=typeof r=="function"?r(o,i):r;m_(t,i,a)}}}function y_(t,e,r,n,s=!1){let i=e.indexOf("*");if(i===e.length-1){let o=e.slice(0,-1),a=t;for(let l of o){if(a==null||typeof a!="object"||a===null)return;a=a[l]}if(Array.isArray(a))if(s)for(let l=0;l<a.length;l++)a[l]=void 0;else for(let l=0;l<a.length;l++){let u=[...o,l.toString()],c=typeof r=="function"?r(a[l],u):r;a[l]=c}else if(typeof a=="object"&&a!==null)if(s){let l=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&l.push(u);for(let u of l)delete a[u]}else for(let l in a){let u=[...o,l],c=typeof r=="function"?r(a[l],u):r;a[l]=c}}else T1(t,e,r,i,n,s)}function T1(t,e,r,n,s,i=!1){let o=e.slice(0,n),a=e.slice(n+1),l=[];function u(c,f){if(f===o.length){if(Array.isArray(c))for(let p=0;p<c.length;p++)l[f]=p.toString(),u(c[p],f+1);else if(typeof c=="object"&&c!==null)for(let p in c)l[f]=p,u(c[p],f+1)}else if(f<o.length){let p=o[f];c&&typeof c=="object"&&c!==null&&p in c&&(l[f]=p,u(c[p],f+1))}else if(a.includes("*"))y_(c,a,typeof r=="function"?(h,d)=>{let m=[...l.slice(0,f),...d];return r(h,m)}:r,s,i);else if(i)g_(c,a);else{let p=typeof r=="function"?r(R1(c,a),[...l.slice(0,f),...a]):r;m_(c,a,p)}}if(o.length===0)u(t,0);else{let c=t;for(let f=0;f<o.length;f++){let p=o[f];if(c==null||typeof c!="object"||c===null)return;c=c[p],l[f]=p}c!=null&&u(c,o.length)}}function $1(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=p_(r),s=e;for(let i=0;i<n.length;i++){let o=n[i];s.has(o)||s.set(o,new Map),s=s.get(o)}}return e}function P1(t,e){if(!e)return t;function r(n,s,i=0){if(!s||s.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let l=0;l<n.length;l++){let u=l.toString();s.has(u)||s.has("*")?a[l]=r(n[l],s.get(u)||s.get("*")):a[l]=n[l]}return a}let o=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(s.has(a)||s.has("*")?o[a]=r(n[a],s.get(a)||s.get("*")):o[a]=n[a]);return o}return r(t,e)}function A1(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let s=0;s<t.length;s++){let i=t[s];if((i==='"'||i==="'")&&e>0)r?i===n&&(r=!1,n=""):(r=!0,n=i);else if(i==="["&&!r)e++;else if(i==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function C1(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)A1(e)}function I1(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:s=!0,remove:i=!1}=t;C1(e);let o=$1(e);return function(l){if(s&&(l===null||typeof l!="object")&&(l==null||typeof l!="object"))return n?n(l):l;let u=P1(l,o),c=l,f=r;return typeof r=="function"&&(f=r),O1(u,e,f,i),n===!1?(u.restore=function(){return Ic(c)},u):typeof n=="function"?n(u):JSON.stringify(u)}}__.exports=I1});var Zn=E((W8,E_)=>{"use strict";var N1=Symbol("pino.setLevel"),k1=Symbol("pino.getLevel"),x1=Symbol("pino.levelVal"),L1=Symbol("pino.levelComp"),q1=Symbol("pino.useLevelLabels"),j1=Symbol("pino.useOnlyCustomLevels"),D1=Symbol("pino.mixin"),F1=Symbol("pino.lsCache"),M1=Symbol("pino.chindings"),H1=Symbol("pino.asJson"),V1=Symbol("pino.write"),z1=Symbol("pino.redactFmt"),U1=Symbol("pino.time"),B1=Symbol("pino.timeSliceIndex"),G1=Symbol("pino.stream"),W1=Symbol("pino.stringify"),J1=Symbol("pino.stringifySafe"),K1=Symbol("pino.stringifiers"),Y1=Symbol("pino.end"),X1=Symbol("pino.formatOpts"),Q1=Symbol("pino.messageKey"),Z1=Symbol("pino.errorKey"),eN=Symbol("pino.nestedKey"),tN=Symbol("pino.nestedKeyStr"),rN=Symbol("pino.mixinMergeStrategy"),nN=Symbol("pino.msgPrefix"),sN=Symbol("pino.wildcardFirst"),iN=Symbol.for("pino.serializers"),oN=Symbol.for("pino.formatters"),aN=Symbol.for("pino.hooks"),lN=Symbol.for("pino.metadata");E_.exports={setLevelSym:N1,getLevelSym:k1,levelValSym:x1,levelCompSym:L1,useLevelLabelsSym:q1,mixinSym:D1,lsCacheSym:F1,chindingsSym:M1,asJsonSym:H1,writeSym:V1,serializersSym:iN,redactFmtSym:z1,timeSym:U1,timeSliceIndexSym:B1,streamSym:G1,stringifySym:W1,stringifySafeSym:J1,stringifiersSym:K1,endSym:Y1,formatOptsSym:X1,messageKeySym:Q1,errorKeySym:Z1,nestedKeySym:eN,wildcardFirstSym:sN,needsMetadataGsym:lN,useOnlyCustomLevelsSym:j1,formattersSym:oN,hooksSym:aN,nestedKeyStrSym:tN,mixinMergeStrategySym:rN,msgPrefixSym:nN}});var kc=E((J8,R_)=>{"use strict";var b_=S_(),{redactFmtSym:uN,wildcardFirstSym:ta}=Zn(),Nc=/[^.[\]]+|\[([^[\]]*?)\]/g,v_="[Redacted]",w_=!1;function cN(t,e){let{paths:r,censor:n,remove:s}=fN(t),i=r.reduce((l,u)=>{Nc.lastIndex=0;let c=Nc.exec(u),f=Nc.exec(u),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=ta),f===null)return l[p]=null,l;if(l[p]===null)return l;let{index:h}=f,d=`${u.substr(h,u.length-1)}`;return l[p]=l[p]||[],p!==ta&&l[p].length===0&&l[p].push(...l[ta]||[]),p===ta&&Object.keys(l).forEach(function(m){l[m]&&l[m].push(d)}),l[p].push(d),l},{}),o={[uN]:b_({paths:r,censor:n,serialize:e,strict:w_,remove:s})},a=(...l)=>e(typeof n=="function"?n(...l):n);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((l,u)=>{if(i[u]===null)l[u]=c=>a(c,[u]);else{let c=typeof n=="function"?(f,p)=>n(f,[u,...p]):n;l[u]=b_({paths:i[u],censor:c,serialize:e,strict:w_,remove:s})}return l},o)}function fN(t){if(Array.isArray(t))return t={paths:t,censor:v_},t;let{paths:e,censor:r=v_,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}R_.exports=cN});var $_=E((K8,T_)=>{"use strict";var dN=()=>"",hN=()=>`,"time":${Date.now()}`,pN=()=>`,"time":${Math.round(Date.now()/1e3)}`,mN=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,gN=1000000n,O_=1000000000n,yN=BigInt(Date.now())*gN,_N=process.hrtime.bigint(),SN=()=>{let t=process.hrtime.bigint()-_N,e=yN+t,r=e/O_,n=e%O_,s=Number(r*1000n+n/1000000n),i=new Date(s),o=i.getUTCFullYear(),a=(i.getUTCMonth()+1).toString().padStart(2,"0"),l=i.getUTCDate().toString().padStart(2,"0"),u=i.getUTCHours().toString().padStart(2,"0"),c=i.getUTCMinutes().toString().padStart(2,"0"),f=i.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${o}-${a}-${l}T${u}:${c}:${f}.${n.toString().padStart(9,"0")}Z"`};T_.exports={nullTime:dN,epochTime:hN,unixTime:pN,isoTime:mN,isoTimeNano:SN}});var A_=E((Y8,P_)=>{"use strict";function EN(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}P_.exports=bN;function bN(t,e,r){var n=r&&r.stringify||EN,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var a=1;a<i;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var l=e.length;if(l===0)return t;for(var u="",c=1-s,f=-1,p=t&&t.length||0,h=0;h<p;){if(t.charCodeAt(h)===37&&h+1<p){switch(f=f>-1?f:0,t.charCodeAt(h+1)){case 100:case 102:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Number(e[c]),f=h+2,h++;break;case 105:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Math.floor(Number(e[c])),f=h+2,h++;break;case 79:case 111:case 106:if(c>=l||e[c]===void 0)break;f<h&&(u+=t.slice(f,h));var d=typeof e[c];if(d==="string"){u+="'"+e[c]+"'",f=h+2,h++;break}if(d==="function"){u+=e[c].name||"<anonymous>",f=h+2,h++;break}u+=n(e[c]),f=h+2,h++;break;case 115:if(c>=l)break;f<h&&(u+=t.slice(f,h)),u+=String(e[c]),f=h+2,h++;break;case 37:f<h&&(u+=t.slice(f,h)),u+="%",f=h+2,h++,c--;break}++c}++h}return f===-1?t:(f<p&&(u+=t.slice(f)),u)}});var Lc=E((X8,xc)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));xc.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};xc.exports=t}});var j_=E((Q8,q_)=>{"use strict";var xe=V("fs"),vN=V("events"),wN=V("util").inherits,C_=V("path"),jc=Lc(),RN=V("assert"),ra=100,na=Buffer.allocUnsafe(0),ON=16*1024,I_="buffer",N_="utf8",[TN,$N]=(process.versions.node||"0.0").split(".").map(Number),PN=TN>=22&&$N>=7;function k_(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i)}):e.emit("error",i);return}let a=e._reopening;e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&xe.mkdirSync(C_.dirname(t),{recursive:!0});let i=xe.openSync(t,n,s);r(null,i)}catch(i){throw r(i),i}else e.mkdir?xe.mkdir(C_.dirname(t),{recursive:!0},i=>{if(i)return r(i);xe.open(t,n,s,r)}):xe.open(t,n,s,r)}function Vt(t){if(!(this instanceof Vt))return new Vt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,periodicFlush:o,sync:a,append:l=!0,mkdir:u,retryEAGAIN:c,fsync:f,contentMode:p,mode:h}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||ON,this._periodicFlush=o||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=f||!1,this.append=l||!1,this.mode=h,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1;let d,m;if(p===I_)this._writingBuf=na,this.write=IN,this.flush=kN,this.flushSync=LN,this._actualWrite=jN,d=()=>xe.writeSync(this.fd,this._writingBuf),m=()=>xe.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===N_)this._writingBuf="",this.write=CN,this.flush=NN,this.flushSync=xN,this._actualWrite=qN,d=()=>xe.writeSync(this.fd,this._writingBuf,"utf8"),m=()=>xe.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${N_}" and "${I_}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")k_(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,S)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{jc(ra),this.release(void 0,0)}catch(y){this.release(y)}else setTimeout(m,ra);else this._writing=!1,this.emit("error",g);return}this.emit("write",S);let b=qc(this._writingBuf,this._len,S);if(this._len=b.len,this._writingBuf=b.writingBuf,this._writingBuf.length){if(!this.sync){m();return}try{do{let y=d(),R=qc(this._writingBuf,this._len,y);this._len=R.len,this._writingBuf=R.writingBuf}while(this._writingBuf.length)}catch(y){this.release(y);return}}this._fsync&&xe.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,sa(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(AN,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function qc(t,e,r){return typeof t=="string"&&Buffer.byteLength(t)!==r&&(r=Buffer.from(t).subarray(0,r).toString().length),e=Math.max(e-r,0),t=t.slice(r),{writingBuf:t,len:e}}function AN(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}wN(Vt,vN);function x_(t,e){return t.length===0?na:t.length===1?t[0]:Buffer.concat(t,e)}function CN(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||r[r.length-1].length+t.length>this.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function IN(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function L_(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{xe.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function NN(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&L_.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function kN(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&L_.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Vt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&xe.close(e,r=>{if(r)return this.emit("error",r)})}),k_(this.file,this)};Vt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():sa(this)))};function xN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t;){t.length<=0&&(t=this._bufs[0]);try{let e=xe.writeSync(this.fd,t,"utf8"),r=qc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;jc(ra)}}try{xe.fsyncSync(this.fd)}catch{}}function LN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=na);let t=na;for(;this._bufs.length||t.length;){t.length<=0&&(t=x_(this._bufs[0],this._lens[0]));try{let e=xe.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;jc(ra)}}}Vt.prototype.destroy=function(){this.destroyed||sa(this)};function qN(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else xe.write(this.fd,this._writingBuf,"utf8",t)}function jN(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:x_(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else PN&&(this._writingBuf=Buffer.from(this._writingBuf)),xe.write(this.fd,this._writingBuf,t)}function sa(t){if(t.fd===-1){t.once("ready",sa.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],RN(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{xe.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?xe.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}Vt.SonicBoom=Vt;Vt.default=Vt;q_.exports=Vt});var Dc=E((Z8,V_)=>{"use strict";var zt={exit:[],beforeExit:[]},D_={exit:MN,beforeExit:HN},es;function DN(){es===void 0&&(es=new FinalizationRegistry(VN))}function FN(t){zt[t].length>0||process.on(t,D_[t])}function F_(t){zt[t].length>0||(process.removeListener(t,D_[t]),zt.exit.length===0&&zt.beforeExit.length===0&&(es=void 0))}function MN(){M_("exit")}function HN(){M_("beforeExit")}function M_(t){for(let e of zt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}zt[t]=[]}function VN(t){for(let e of["exit","beforeExit"]){let r=zt[e].indexOf(t);zt[e].splice(r,r+1),F_(e)}}function H_(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");FN(t);let n=new WeakRef(e);n.fn=r,DN(),es.register(e,n),zt[t].push(n)}function zN(t,e){H_("exit",t,e)}function UN(t,e){H_("beforeExit",t,e)}function BN(t){if(es!==void 0){es.unregister(t);for(let e of["exit","beforeExit"])zt[e]=zt[e].filter(r=>{let n=r.deref();return n&&n!==t}),F_(e)}}V_.exports={register:zN,registerBeforeExit:UN,unregister:BN}});var z_=E((eK,GN)=>{GN.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var B_=E((tK,U_)=>{"use strict";function WN(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{let a=Atomics.load(t,e);if(a===r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,a,l);u.async?u.value.then(o):setImmediate(o)};o()}function JN(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{if(Atomics.load(t,e)!==r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,r,l);u.async?u.value.then(o):setImmediate(o)};o()}U_.exports={wait:WN,waitDiff:JN}});var W_=E((rK,G_)=>{"use strict";G_.exports={WRITE_INDEX:4,READ_INDEX:8}});var Q_=E((nK,X_)=>{"use strict";var{version:KN}=z_(),{EventEmitter:YN}=V("events"),{Worker:XN}=V("worker_threads"),{join:QN}=V("path"),{pathToFileURL:ZN}=V("url"),{wait:ek}=B_(),{WRITE_INDEX:yt,READ_INDEX:gt}=W_(),tk=V("buffer"),rk=V("assert"),I=Symbol("kImpl"),nk=tk.constants.MAX_STRING_LENGTH,si=class{constructor(e){this._value=e}deref(){return this._value}},oa=class{register(){}unregister(){}},sk=process.env.NODE_V8_COVERAGE?oa:global.FinalizationRegistry||oa,ik=process.env.NODE_V8_COVERAGE?si:global.WeakRef||si,J_=new sk(t=>{t.exited||t.terminate()});function ok(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||QN(__dirname,"lib","worker.js"),o=new XN(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:ZN(r).href,dataBuf:t[I].dataBuf,stateBuf:t[I].stateBuf,workerData:{$context:{threadStreamVersion:KN},...n}}});return o.stream=new si(t),o.on("message",ak),o.on("exit",Y_),J_.register(t,o),o}function K_(t){rk(!t[I].sync),t[I].needDrain&&(t[I].needDrain=!1,t.emit("drain"))}function ia(t){let e=Atomics.load(t[I].state,yt),r=t[I].data.length-e;if(r>0){if(t[I].buf.length===0){t[I].flushing=!1,t[I].ending?zc(t):t[I].needDrain&&process.nextTick(K_,t);return}let n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[I].buf=t[I].buf.slice(r),aa(t,n,ia.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);s>t[I].data.length;)r=r/2,n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);t[I].buf=t[I].buf.slice(r),aa(t,n,ia.bind(null,t))}})}else if(r===0){if(e===0&&t[I].buf.length===0)return;t.flush(()=>{Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt),ia(t)})}else rr(t,new Error("overwritten"))}function ak(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new ik(e),e.flush(()=>{e[I].ready=!0,e.emit("ready")});break;case"ERROR":rr(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:rr(e,new Error("this should not happen: "+t.code))}}function Y_(t){let e=this.stream.deref();e!==void 0&&(J_.unregister(e),e.worker.exited=!0,e.worker.off("exit",Y_),rr(e,t!==0?new Error("the worker thread exited"):null))}var Mc=class extends YN{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[I]={},this[I].stateBuf=new SharedArrayBuffer(128),this[I].state=new Int32Array(this[I].stateBuf),this[I].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[I].data=Buffer.from(this[I].dataBuf),this[I].sync=e.sync||!1,this[I].ending=!1,this[I].ended=!1,this[I].needDrain=!1,this[I].destroyed=!1,this[I].flushing=!1,this[I].ready=!1,this[I].finished=!1,this[I].errored=null,this[I].closed=!1,this[I].buf="",this.worker=ok(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){if(this[I].destroyed)return Hc(this,new Error("the worker has exited")),!1;if(this[I].ending)return Hc(this,new Error("the worker is ending")),!1;if(this[I].flushing&&this[I].buf.length+e.length>=nk)try{Fc(this),this[I].flushing=!0}catch(r){return rr(this,r),!1}if(this[I].buf+=e,this[I].sync)try{return Fc(this),!0}catch(r){return rr(this,r),!1}return this[I].flushing||(this[I].flushing=!0,setImmediate(ia,this)),this[I].needDrain=this[I].data.length-this[I].buf.length-Atomics.load(this[I].state,yt)<=0,!this[I].needDrain}end(){this[I].destroyed||(this[I].ending=!0,zc(this))}flush(e){if(this[I].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[I].state,yt);ek(this[I].state,gt,r,1/0,(n,s)=>{if(n){rr(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[I].destroyed||(Fc(this),Vc(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[I].ready}get destroyed(){return this[I].destroyed}get closed(){return this[I].closed}get writable(){return!this[I].destroyed&&!this[I].ending}get writableEnded(){return this[I].ending}get writableFinished(){return this[I].finished}get writableNeedDrain(){return this[I].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[I].errored}};function Hc(t,e){setImmediate(()=>{t.emit("error",e)})}function rr(t,e){t[I].destroyed||(t[I].destroyed=!0,e&&(t[I].errored=e,Hc(t,e)),t.worker.exited?setImmediate(()=>{t[I].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[I].closed=!0,t.emit("close")}))}function aa(t,e,r){let n=Atomics.load(t[I].state,yt),s=Buffer.byteLength(e);return t[I].data.write(e,n),Atomics.store(t[I].state,yt,n+s),Atomics.notify(t[I].state,yt),r(),!0}function zc(t){if(!(t[I].ended||!t[I].ending||t[I].flushing)){t[I].ended=!0;try{t.flushSync();let e=Atomics.load(t[I].state,gt);Atomics.store(t[I].state,yt,-1),Atomics.notify(t[I].state,yt);let r=0;for(;e!==-1;){if(Atomics.wait(t[I].state,gt,e,1e3),e=Atomics.load(t[I].state,gt),e===-2){rr(t,new Error("end() failed"));return}if(++r===10){rr(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[I].finished=!0,t.emit("finish")})}catch(e){rr(t,e)}}}function Fc(t){let e=()=>{t[I].ending?zc(t):t[I].needDrain&&process.nextTick(K_,t)};for(t[I].flushing=!1;t[I].buf.length!==0;){let r=Atomics.load(t[I].state,yt),n=t[I].data.length-r;if(n===0){Vc(t),Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);continue}else if(n<0)throw new Error("overwritten");let s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[I].buf=t[I].buf.slice(n),aa(t,s,e);else{for(Vc(t),Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);i>t[I].buf.length;)n=n/2,s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);t[I].buf=t[I].buf.slice(n),aa(t,s,e)}}}function Vc(t){if(t[I].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[I].state,yt),r=0;for(;;){let n=Atomics.load(t[I].state,gt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[I].state,gt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}X_.exports=Mc});var Gc=E((sK,Z_)=>{"use strict";var{createRequire:lk}=V("module"),uk=Cc(),{join:Uc,isAbsolute:ck,sep:fk}=V("node:path"),dk=Lc(),Bc=Dc(),hk=Q_();function pk(t){Bc.register(t,yk),Bc.registerBeforeExit(t,_k),t.on("close",function(){Bc.unregister(t)})}function mk(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function gk(t,e,r,n,s){!r.execArgv&&mk()&&V.main===void 0&&(r={...r,execArgv:[]}),r={...r,name:s};let i=new hk({filename:t,workerData:e,workerOpts:r,sync:n});i.on("ready",o),i.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function o(){process.removeListener("exit",a),i.unref(),r.autoEnd!==!1&&pk(i)}function a(){i.closed||(i.flushSync(),dk(100),i.end())}return i}function yk(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function _k(t){t.flushSync()}function Sk(t){let{pipeline:e,targets:r,levels:n,dedupe:s,worker:i={},caller:o=uk(),sync:a=!1}=t,l={...t.options},u=typeof o=="string"?[o]:o,c=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),f=t.target;if(f&&r)throw new Error("only one of target or targets can be specified");r?(f=c["pino-worker"]||Uc(__dirname,"worker.js"),l.targets=r.filter(d=>d.target).map(d=>({...d,target:h(d.target)})),l.pipelines=r.filter(d=>d.pipeline).map(d=>d.pipeline.map(m=>({...m,level:d.level,target:h(m.target)})))):e&&(f=c["pino-worker"]||Uc(__dirname,"worker.js"),l.pipelines=[e.map(d=>({...d,target:h(d.target)}))]),n&&(l.levels=n),s&&(l.dedupe=s),l.pinoWillSendConfig=!0;let p=r||e?"pino.transport":f;return gk(h(f),l,i,a,p);function h(d){if(d=c[d]||d,ck(d)||d.indexOf("file://")===0)return d;if(d==="pino/file")return Uc(__dirname,"..","file.js");let m;for(let g of u)try{let S=g==="node:repl"?process.cwd()+fk:g;m=lk(S).resolve(d);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${d}"`);return m}}Z_.exports=Sk});var ca=E((oK,d0)=>{"use strict";var Ek=V("node:diagnostics_channel"),e0=A_(),{mapHttpRequest:bk,mapHttpResponse:vk}=Ac(),Jc=j_(),t0=Dc(),{lsCacheSym:wk,chindingsSym:o0,writeSym:r0,serializersSym:a0,formatOptsSym:n0,endSym:Rk,stringifiersSym:l0,stringifySym:u0,stringifySafeSym:Kc,wildcardFirstSym:c0,nestedKeySym:Ok,formattersSym:f0,messageKeySym:Tk,errorKeySym:$k,nestedKeyStrSym:Pk,msgPrefixSym:la}=Zn(),{isMainThread:Ak}=V("worker_threads"),Ck=Gc(),[Ik]=process.versions.node.split(".").map(t=>Number(t)),s0=Ek.tracingChannel("pino_asJson"),Wc=Ik>=25?t=>JSON.stringify(t):kk;function ts(){}function Nk(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t)};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=bk(n):typeof n.setHeader=="function"&&(n=vk(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[la]=="string"&&i!==void 0&&i!==null&&(i=this[la]+i),this[r0](n,e0(i,o,this[n0]),t)}else{let i=n===void 0?s.shift():n;typeof this[la]=="string"&&i!==void 0&&i!==null&&(i=this[la]+i),this[r0](null,e0(i,s,this[n0]),t)}}}function kk(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o<i&&s>=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function xk(t,e,r,n){if(s0.hasSubscribers===!1)return i0.call(this,t,e,r,n);let s={instance:this,arguments};return s0.traceSync(i0,s,this,t,e,r,n)}function i0(t,e,r,n){let s=this[u0],i=this[Kc],o=this[l0],a=this[Rk],l=this[o0],u=this[a0],c=this[f0],f=this[Tk],p=this[$k],h=this[wk][r]+n;h=h+l;let d;c.log&&(t=c.log(t));let m=o[c0],g="";for(let b in t)if(d=t[b],Object.prototype.hasOwnProperty.call(t,b)&&d!==void 0){u[b]?d=u[b](d):b===p&&u.err&&(d=u.err(d));let _=o[b]||m;switch(typeof d){case"undefined":case"function":continue;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":_&&(d=_(d));break;case"string":d=(_||Wc)(d);break;default:d=(_||s)(d,i)}if(d===void 0)continue;let y=Wc(b);g+=","+y+":"+d}let S="";if(e!==void 0){d=u[f]?u[f](e):e;let b=o[f]||m;switch(typeof d){case"function":break;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":b&&(d=b(d)),S=',"'+f+'":'+d;break;case"string":d=(b||Wc)(d),S=',"'+f+'":'+d;break;default:d=(b||s)(d,i),S=',"'+f+'":'+d}}return this[Ok]&&g?h+this[Pk]+g.slice(1)+"}"+S+a:h+g+S+a}function Lk(t,e){let r,n=t[o0],s=t[u0],i=t[Kc],o=t[l0],a=o[c0],l=t[a0],u=t[f0].bindings;e=u(e);for(let c in e)if(r=e[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&e.hasOwnProperty(c)&&r!==void 0)===!0){if(r=l[c]?l[c](r):r,r=(o[c]||a||s)(r,i),r===void 0)continue;n+=',"'+c+'":'+r}return n}function qk(t){return t.write!==t.constructor.prototype.write}function ua(t){let e=new Jc(t);return e.on("error",r),!t.sync&&Ak&&(t0.register(e,jk),e.on("close",function(){t0.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=ts,e.end=ts,e.flushSync=ts,e.destroy=ts;return}e.removeListener("error",r),e.emit("error",n)}}function jk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Dk(t){return function(r,n,s={},i){if(typeof s=="string")i=ua({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=ua({dest:i})}else if(s instanceof Jc||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof Jc||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;s.customLevels&&(l=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=Ck({caller:n,...s.transport,levels:l})}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=s;return o===!1&&(s.level="silent"),a||(s.onChild=ts),i||(qk(process.stdout)?i=process.stdout:i=ua({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function Fk(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Kc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Mk(t,e,r){return{level:t,bindings:e,log:r}}function Hk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}d0.exports={noop:ts,buildSafeSonicBoom:ua,asChindings:Lk,asJson:xk,genLog:Nk,createArgsNormalizer:Dk,stringify:Fk,buildFormatters:Mk,normalizeDestFileDescriptor:Hk}});var fa=E((aK,h0)=>{var Vk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},zk={ASC:"ASC",DESC:"DESC"};h0.exports={DEFAULT_LEVELS:Vk,SORTING_ORDER:zk}});var Qc=E((lK,y0)=>{"use strict";var{lsCacheSym:Uk,levelValSym:Yc,useOnlyCustomLevelsSym:Bk,streamSym:Gk,formattersSym:Wk,hooksSym:Jk,levelCompSym:p0}=Zn(),{noop:Kk,genLog:pn}=ca(),{DEFAULT_LEVELS:nr,SORTING_ORDER:m0}=fa(),g0={fatal:t=>{let e=pn(nr.fatal,t);return function(...r){let n=this[Gk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>pn(nr.error,t),warn:t=>pn(nr.warn,t),info:t=>pn(nr.info,t),debug:t=>pn(nr.debug,t),trace:t=>pn(nr.trace,t)},Xc=Object.keys(nr).reduce((t,e)=>(t[nr[e]]=e,t),{}),Yk=Object.keys(Xc).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Xk(t){let e=t[Wk].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1)}return t[Uk]=n,t}function Qk(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Zk(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Yc],s=this[Yc]=r[t],i=this[Bk],o=this[p0],a=this[Jk].logMethod;for(let l in r){if(o(r[l],s)===!1){this[l]=Kk;continue}this[l]=Qk(l,i)?g0[l](a):pn(r[l],a)}this.emit("level-change",t,s,e[n],n,this)}function ex(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function tx(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[p0](r,this[Yc])}function rx(t,e,r){return t===m0.DESC?e<=r:e>=r}function nx(t){return typeof t=="string"?rx.bind(null,t):t}function sx(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Xc,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:nr,t);return{labels:n,values:s}}function ix(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(Xc).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:nr,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function ox(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}function ax(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(m0).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}y0.exports={initialLsCache:Yk,genLsCache:Xk,levelMethods:g0,getLevel:ex,setLevel:Zk,isLevelEnabled:tx,mappings:sx,assertNoLevelCollisions:ox,assertDefaultLevelFound:ix,genLevelComparison:nx,assertLevelComparison:ax}});var Zc=E((uK,_0)=>{"use strict";_0.exports={version:"10.3.0"}});var T0=E((fK,O0)=>{"use strict";var{EventEmitter:lx}=V("node:events"),{lsCacheSym:ux,levelValSym:cx,setLevelSym:tf,getLevelSym:S0,chindingsSym:ha,mixinSym:fx,asJsonSym:b0,writeSym:dx,mixinMergeStrategySym:hx,timeSym:px,timeSliceIndexSym:mx,streamSym:v0,serializersSym:mn,formattersSym:ii,errorKeySym:gx,messageKeySym:yx,useOnlyCustomLevelsSym:_x,needsMetadataGsym:Sx,redactFmtSym:Ex,stringifySym:bx,formatOptsSym:vx,stringifiersSym:wx,msgPrefixSym:rf,hooksSym:Rx}=Zn(),{getLevel:Ox,setLevel:Tx,isLevelEnabled:$x,mappings:Px,initialLsCache:Ax,genLsCache:Cx,assertNoLevelCollisions:Ix}=Qc(),{asChindings:nf,asJson:Nx,buildFormatters:ef,stringify:E0,noop:w0}=ca(),{version:kx}=Zc(),xx=kc(),Lx=class{},R0={constructor:Lx,child:qx,bindings:jx,setBindings:Dx,flush:Hx,isLevelEnabled:$x,version:kx,get level(){return this[S0]()},set level(t){this[tf](t)},get levelVal(){return this[cx]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[rf]},get[Symbol.toStringTag](){return"Pino"},[ux]:Ax,[dx]:Mx,[b0]:Nx,[S0]:Ox,[tf]:Tx};Object.setPrototypeOf(R0,lx.prototype);O0.exports=function(){return Object.create(R0)};var da=t=>t;function qx(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[mn],n=this[ii],s=Object.create(this);if(e==null)return s[ii].bindings!==da&&(s[ii]=ef(n.level,da,n.log)),s[ha]=nf(s,t),this.onChild!==w0&&this.onChild(s),s;if(e.hasOwnProperty("serializers")===!0){s[mn]=Object.create(null);for(let u in r)s[mn][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var i=0;i<a.length;i++){let u=a[i];s[mn][u]=r[u]}for(let u in e.serializers)s[mn][u]=e.serializers[u];let l=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<l.length;o++){let u=l[o];s[mn][u]=e.serializers[u]}}else s[mn]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:l,log:u}=e.formatters;s[ii]=ef(a||n.level,l||da,u||n.log)}else s[ii]=ef(n.level,da,n.log);if(e.hasOwnProperty("customLevels")===!0&&(Ix(this.levels,e.customLevels),s.levels=Px(e.customLevels,s[_x]),Cx(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let a=xx(s.redact,E0),l={stringify:a[Ex]};s[bx]=E0,s[wx]=a,s[vx]=l}if(typeof e.msgPrefix=="string"&&(s[rf]=(this[rf]||"")+e.msgPrefix),s[ha]=nf(s,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;s[tf](a)}return this.onChild(s),s}function jx(){let e=`{${this[ha].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function Dx(t){let e=nf(this,t);this[ha]=e}function Fx(t,e){return Object.assign(e,t)}function Mx(t,e,r){let n=this[px](),s=this[fx],i=this[gx],o=this[yx],a=this[hx]||Fx,l,u=this[Rx].streamWrite;t==null?l={}:t instanceof Error?(l={[i]:t},e===void 0&&(e=t.message)):(l=t,e===void 0&&t[o]===void 0&&t[i]&&(e=t[i].message)),s&&(l=a(l,s(l,r,this)));let c=this[b0](l,e,r,n),f=this[v0];f[Sx]===!0&&(f.lastLevel=r,f.lastObj=l,f.lastMsg=e,f.lastTime=n.slice(this[mx]),f.lastLogger=this),f.write(u?u(c):c)}function Hx(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[v0];typeof e.flush=="function"?e.flush(t||w0):t&&t()}});var C0=E((lf,A0)=>{"use strict";var{hasOwnProperty:oi}=Object.prototype,yn=af();yn.configure=af;yn.stringify=yn;yn.default=yn;lf.stringify=yn;lf.configure=af;A0.exports=yn;var Vx=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Mr(t){return t.length<5e3&&!Vx.test(t)?`"${t}"`:JSON.stringify(t)}function sf(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],s=r;for(;s!==0&&t[s-1]>n;)t[s]=t[s-1],s--;t[s]=n}return t}var zx=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function of(t){return zx.call(t)!==void 0&&t.length!==0}function $0(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",s=`"0":${n}${t[0]}`;for(let i=1;i<r;i++)s+=`${e}"${i}":${n}${t[i]}`;return s}function Ux(t){if(oi.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Bx(t){let e;if(oi.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function Gx(t,e){let r;if(oi.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function P0(t,e){let r;if(oi.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function gn(t){return t===1?"1 item":`${t} items`}function Wx(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function Jx(t){if(oi.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function af(t){t={...t};let e=Jx(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=Ux(t),n=Gx(t,"bigint"),s=Bx(t),i=typeof s=="function"?s:void 0,o=P0(t,"maximumDepth"),a=P0(t,"maximumBreadth");function l(h,d,m,g,S,b){let _=d[h];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(h)),_=g.call(d,h,_),typeof _){case"string":return Mr(_);case"object":{if(_===null)return"null";if(m.indexOf(_)!==-1)return r;let y="",R=",",T=b;if(Array.isArray(_)){if(_.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(_),S!==""&&(b+=S,y+=`
|
|
32
32
|
${b}`,R=`,
|
|
33
33
|
${b}`);let C=Math.min(_.length,a),k=0;for(;k<C-1;k++){let J=l(String(k),_,m,g,S,b);y+=J!==void 0?J:"null",y+=R}let M=l(String(k),_,m,g,S,b);if(y+=M!==void 0?M:"null",_.length-1>a){let J=_.length-a-1;y+=`${R}"... ${gn(J)} not stringified"`}return S!==""&&(y+=`
|
|
34
34
|
${T}`),m.pop(),`[${y}]`}let O=Object.keys(_),w=O.length;if(w===0)return"{}";if(o<m.length+1)return'"[Object]"';let $="",v="";S!==""&&(b+=S,R=`,
|
|
35
|
-
${b}`,$=" ");let P=Math.min(w,a);s&&!
|
|
35
|
+
${b}`,$=" ");let P=Math.min(w,a);s&&!of(_)&&(O=sf(O,i)),m.push(_);for(let C=0;C<P;C++){let k=O[C],M=l(k,_,m,g,S,b);M!==void 0&&(y+=`${v}${Mr(k)}:${$}${M}`,v=R)}if(w>a){let C=w-a;y+=`${v}"...":${$}"${gn(C)} not stringified"`,v=R}return S!==""&&v.length>1&&(y=`
|
|
36
36
|
${b}${y}
|
|
37
37
|
${T}`),m.pop(),`{${y}}`}case"number":return isFinite(_)?String(_):e?e(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(_);default:return e?e(_):void 0}}function u(h,d,m,g,S,b){switch(typeof d=="object"&&d!==null&&typeof d.toJSON=="function"&&(d=d.toJSON(h)),typeof d){case"string":return Mr(d);case"object":{if(d===null)return"null";if(m.indexOf(d)!==-1)return r;let _=b,y="",R=",";if(Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d),S!==""&&(b+=S,y+=`
|
|
38
38
|
${b}`,R=`,
|
|
@@ -44,19 +44,19 @@ ${_}`),m.pop(),`{${y}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";
|
|
|
44
44
|
${S}`,v=`,
|
|
45
45
|
${S}`,P=Math.min(d.length,a),C=0;for(;C<P-1;C++){let M=c(String(C),d[C],m,g,S);$+=M!==void 0?M:"null",$+=v}let k=c(String(C),d[C],m,g,S);if($+=k!==void 0?k:"null",d.length-1>a){let M=d.length-a-1;$+=`${v}"... ${gn(M)} not stringified"`}return $+=`
|
|
46
46
|
${b}`,m.pop(),`[${$}]`}let _=Object.keys(d),y=_.length;if(y===0)return"{}";if(o<m.length+1)return'"[Object]"';S+=g;let R=`,
|
|
47
|
-
${S}`,T="",O="",w=Math.min(y,a);
|
|
47
|
+
${S}`,T="",O="",w=Math.min(y,a);of(d)&&(T+=$0(d,R,a),_=_.slice(d.length),w-=d.length,O=R),s&&(_=sf(_,i)),m.push(d);for(let $=0;$<w;$++){let v=_[$],P=c(v,d[v],m,g,S);P!==void 0&&(T+=`${O}${Mr(v)}: ${P}`,O=R)}if(y>a){let $=y-a;T+=`${O}"...": "${gn($)} not stringified"`,O=R}return O!==""&&(T=`
|
|
48
48
|
${S}${T}
|
|
49
|
-
${b}`),m.pop(),`{${T}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function f(h,d,m){switch(typeof d){case"string":return Mr(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(h),typeof d!="object")return f(h,d,m);if(d===null)return"null"}if(m.indexOf(d)!==-1)return r;let g="",S=d.length!==void 0;if(S&&Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d);let T=Math.min(d.length,a),O=0;for(;O<T-1;O++){let $=f(String(O),d[O],m);g+=$!==void 0?$:"null",g+=","}let w=f(String(O),d[O],m);if(g+=w!==void 0?w:"null",d.length-1>a){let $=d.length-a-1;g+=`,"... ${gn($)} not stringified"`}return m.pop(),`[${g}]`}let b=Object.keys(d),_=b.length;if(_===0)return"{}";if(o<m.length+1)return'"[Object]"';let y="",R=Math.min(_,a);S&&
|
|
49
|
+
${b}`),m.pop(),`{${T}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function f(h,d,m){switch(typeof d){case"string":return Mr(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(h),typeof d!="object")return f(h,d,m);if(d===null)return"null"}if(m.indexOf(d)!==-1)return r;let g="",S=d.length!==void 0;if(S&&Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d);let T=Math.min(d.length,a),O=0;for(;O<T-1;O++){let $=f(String(O),d[O],m);g+=$!==void 0?$:"null",g+=","}let w=f(String(O),d[O],m);if(g+=w!==void 0?w:"null",d.length-1>a){let $=d.length-a-1;g+=`,"... ${gn($)} not stringified"`}return m.pop(),`[${g}]`}let b=Object.keys(d),_=b.length;if(_===0)return"{}";if(o<m.length+1)return'"[Object]"';let y="",R=Math.min(_,a);S&&of(d)&&(g+=$0(d,",",a),b=b.slice(d.length),R-=d.length,y=","),s&&(b=sf(b,i)),m.push(d);for(let T=0;T<R;T++){let O=b[T],w=f(O,d[O],m);w!==void 0&&(g+=`${y}${Mr(O)}:${w}`,y=",")}if(_>a){let T=_-a;g+=`${y}"...":"${gn(T)} not stringified"`}return m.pop(),`{${g}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function p(h,d,m){if(arguments.length>1){let g="";if(typeof m=="number"?g=" ".repeat(Math.min(m,10)):typeof m=="string"&&(g=m.slice(0,10)),d!=null){if(typeof d=="function")return l("",{"":h},[],d,g,"");if(Array.isArray(d))return u("",h,[],Wx(d),g,"")}if(g.length!==0)return c("",h,[],g,"")}return f("",h,[])}return p}});var x0=E((dK,k0)=>{"use strict";var uf=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:N0}=fa(),Kx=N0.info;function Yx(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(N0);r.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(f=>{r[f]=e.levels[f]});let n={write:s,add:a,remove:l,emit:i,flushSync:o,end:u,minLevel:0,lastId:0,streams:[],clone:c,[uf]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function s(f){let p,h=this.lastLevel,{streams:d}=this,m=0,g;for(let S=Xx(d.length,e.dedupe);Zx(S,d.length,e.dedupe);S=Qx(S,e.dedupe))if(p=d[S],p.level<=h){if(m!==0&&m!==p.level)break;if(g=p.stream,g[uf]){let{lastTime:b,lastMsg:_,lastObj:y,lastLogger:R}=this;g.lastLevel=h,g.lastTime=b,g.lastMsg=_,g.lastObj=y,g.lastLogger=R}g.write(f),e.dedupe&&(m=p.level)}else if(!e.dedupe)break}function i(...f){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...f)}function o(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync()}function a(f){if(!f)return n;let p=typeof f.write=="function"||f.stream,h=f.write?f:f.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d,streamLevels:m}=this,g;typeof f.levelVal=="number"?g=f.levelVal:typeof f.level=="string"?g=m[f.level]:typeof f.level=="number"?g=f.level:g=Kx;let S={stream:h,level:g,levelVal:void 0,id:++n.lastId};return d.unshift(S),d.sort(I0),this.minLevel=d[0].level,n}function l(f){let{streams:p}=this,h=p.findIndex(d=>d.id===f);return h>=0&&(p.splice(h,1),p.sort(I0),this.minLevel=p.length>0?p[0].level:-1),n}function u(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync(),f.end()}function c(f){let p=new Array(this.streams.length);for(let h=0;h<p.length;h++)p[h]={level:f,stream:this.streams[h].stream};return{write:s,add:a,remove:l,minLevel:f,streams:p,clone:c,emit:i,flushSync:o,[uf]:!0}}}function I0(t,e){return t.level-e.level}function Xx(t,e){return e?t-1:0}function Qx(t,e){return e?t-1:t+1}function Zx(t,e,r){return r?t>=0:t<e}k0.exports=Yx});var J0=E((hK,Ct)=>{"use strict";var eL=V("node:os"),V0=Ac(),tL=Cc(),rL=kc(),z0=$_(),nL=T0(),U0=Zn(),{configure:sL}=C0(),{assertDefaultLevelFound:iL,mappings:B0,genLsCache:oL,genLevelComparison:aL,assertLevelComparison:lL}=Qc(),{DEFAULT_LEVELS:G0,SORTING_ORDER:uL}=fa(),{createArgsNormalizer:cL,asChindings:fL,buildSafeSonicBoom:L0,buildFormatters:dL,stringify:cf,normalizeDestFileDescriptor:q0,noop:hL}=ca(),{version:pL}=Zc(),{chindingsSym:j0,redactFmtSym:mL,serializersSym:D0,timeSym:gL,timeSliceIndexSym:yL,streamSym:_L,stringifySym:F0,stringifySafeSym:ff,stringifiersSym:M0,setLevelSym:SL,endSym:EL,formatOptsSym:bL,messageKeySym:vL,errorKeySym:wL,nestedKeySym:RL,mixinSym:OL,levelCompSym:TL,useOnlyCustomLevelsSym:$L,formattersSym:H0,hooksSym:PL,nestedKeyStrSym:AL,mixinMergeStrategySym:CL,msgPrefixSym:IL}=U0,{epochTime:W0,nullTime:NL}=z0,{pid:kL}=process,xL=eL.hostname(),LL=V0.err,qL={level:"info",levelComparison:uL.ASC,levels:G0,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:kL,hostname:xL},serializers:Object.assign(Object.create(null),{err:LL}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:W0,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},jL=cL(qL),DL=Object.assign(Object.create(null),V0);function df(...t){let e={},{opts:r,stream:n}=jL(e,tL(),...t);r.level&&typeof r.level=="string"&&G0[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:s,crlf:i,serializers:o,timestamp:a,messageKey:l,errorKey:u,nestedKey:c,base:f,name:p,level:h,customLevels:d,levelComparison:m,mixin:g,mixinMergeStrategy:S,useOnlyCustomLevels:b,formatters:_,hooks:y,depthLimit:R,edgeLimit:T,onChild:O,msgPrefix:w}=r,$=sL({maximumDepth:R,maximumBreadth:T}),v=dL(_.level,_.bindings,_.log),P=cf.bind({[ff]:$}),C=s?rL(s,P):{},k=s?{stringify:C[mL]}:{stringify:P},M="}"+(i?`\r
|
|
50
50
|
`:`
|
|
51
|
-
`),J=lL.bind(null,{[L0]:"",[q0]:o,[D0]:C,[j0]:uf,[cf]:$,[F0]:v}),U="";f!==null&&(p===void 0?U=J(f):U=J(Object.assign({},f,{name:p})));let H=a instanceof Function?a:a?B0:AL,fe=H().indexOf(":")+1;if(b&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(w&&typeof w!="string")throw Error(`Unknown msgPrefix type "${typeof w}" - expected "string"`);rL(h,d,b);let ze=z0(d,b);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:ze,messageKey:l,errorKey:u}}),iL(m);let G=sL(m);return Object.assign(e,{levels:ze,[wL]:G,[RL]:b,[mL]:n,[hL]:H,[pL]:fe,[j0]:uf,[cf]:$,[D0]:C,[yL]:M,[_L]:k,[SL]:l,[EL]:u,[bL]:c,[TL]:c?`,${JSON.stringify(c)}:{`:"",[q0]:o,[vL]:g,[$L]:S,[L0]:U,[F0]:v,[OL]:y,silent:cL,onChild:O,[PL]:w}),Object.setPrototypeOf(e,eL()),nL(e),e[gL](h),e}Ct.exports=ff;Ct.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=x0(t.dest||process.stdout.fd),k0(t)):k0({dest:x0(t),minLength:0});Ct.exports.transport=Bc();Ct.exports.multistream=N0();Ct.exports.levels=z0();Ct.exports.stdSerializers=LL;Ct.exports.stdTimeFunctions=Object.assign({},H0);Ct.exports.symbols=V0;Ct.exports.version=fL;Ct.exports.default=ff;Ct.exports.pino=ff});var K0=E((sK,J0)=>{"use strict";var pa=G0(),{serializersSym:W0}=pa.symbols,{FST_ERR_LOG_INVALID_DESTINATION:qL}=He();function jL(t){if(t.stream&&t.file)throw new qL;t.file&&(t.stream=pa.destination(t.file),delete t.file);let e=t.logger,r=t.genReqId,n=null;return e?(t.logger=void 0,t.genReqId=void 0,e[W0]&&(t.serializers=Object.assign({},t.serializers,e[W0])),n=e.child({},t),t.logger=e,t.genReqId=r):n=pa(t,t.stream),n}var DL={req:function(e){return{method:e.method,url:e.url,version:e.headers&&e.headers["accept-version"],host:e.host,remoteAddress:e.ip,remotePort:e.socket?e.socket.remotePort:void 0}},err:pa.stdSerializers.err,res:function(e){return{statusCode:e.statusCode}}};J0.exports={serializers:DL,createPinoLogger:jL}});var ai=E((iK,X0)=>{"use strict";var{FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:FL,FST_ERR_LOG_INVALID_LOGGER_CONFIG:ML,FST_ERR_LOG_INVALID_LOGGER_INSTANCE:HL,FST_ERR_LOG_INVALID_LOGGER:VL}=He();function zL(t,e,r,n,s){let i={[t.requestIdLogLabel]:n},o=t.childLoggerFactory.call(t.server,e,i,s||{},r);return t.childLoggerFactory!==Y0&&ma(o,!0),o}function Y0(t,e,r){return t.child(e,r)}function ma(t,e){let r=["info","error","debug","fatal","warn","trace","child"],n=t?r.filter(s=>!t[s]||typeof t[s]!="function"):r;if(n.length){if(n.length===r.length&&!e)return!1;throw VL(n.join(","))}else return!0}function UL(t){if(t.logger&&t.loggerInstance)throw new FL;if(!t.loggerInstance&&!t.logger){let o=By();return o.child=()=>o,{logger:o,hasLogger:!1}}let{createPinoLogger:e,serializers:r}=K0();if(ma(t.loggerInstance))return{logger:e({logger:t.loggerInstance,serializers:Object.assign({},r,t.loggerInstance.serializers)}),hasLogger:!0};if(ma(t.logger))throw ML();if(t.loggerInstance)throw HL();let n={};return Object.prototype.toString.call(t.logger)==="[object Object]"&&Reflect.ownKeys(t.logger).forEach(i=>{Object.defineProperty(n,i,{value:t.logger[i],writable:!0,enumerable:!0,configurable:!0})}),n.level=n.level||"info",n.serializers=Object.assign({},r,n.serializers),t.logger=n,{logger:e(t.logger),hasLogger:!0}}function BL(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}X0.exports={createChildLogger:zL,defaultChildLoggerFactory:Y0,createLogger:UL,validateLogger:ma,now:BL}});var ga=E((oK,Q0)=>{"use strict";Q0.exports=GL;function rs(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function GL(t){if(t=t||{},t.circles)return WL(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,a)=>new Map(n(Array.from(o),a))),e.set(Set,(o,a)=>new Set(n(Array.from(o),a))),t.constructorHandlers)for(let o of t.constructorHandlers)e.set(o[0],o[1]);let r=null;return t.proto?i:s;function n(o,a){let l=Object.keys(o),u=new Array(l.length);for(let c=0;c<l.length;c++){let f=l[c],p=o[f];typeof p!="object"||p===null?u[f]=p:p.constructor!==Object&&(r=e.get(p.constructor))?u[f]=r(p,a):ArrayBuffer.isView(p)?u[f]=rs(p):u[f]=a(p)}return u}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,s);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,s);let a={};for(let l in o){if(Object.hasOwnProperty.call(o,l)===!1)continue;let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,s):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=s(u)}return a}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,i);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,i);let a={};for(let l in o){let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,i):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=i(u)}return a}}function WL(t){let e=[],r=[],n=new Map;if(n.set(Date,l=>new Date(l)),n.set(Map,(l,u)=>new Map(i(Array.from(l),u))),n.set(Set,(l,u)=>new Set(i(Array.from(l),u))),t.constructorHandlers)for(let l of t.constructorHandlers)n.set(l[0],l[1]);let s=null;return t.proto?a:o;function i(l,u){let c=Object.keys(l),f=new Array(c.length);for(let p=0;p<c.length;p++){let h=c[p],d=l[h];if(typeof d!="object"||d===null)f[h]=d;else if(d.constructor!==Object&&(s=n.get(d.constructor)))f[h]=s(d,u);else if(ArrayBuffer.isView(d))f[h]=rs(d);else{let m=e.indexOf(d);m!==-1?f[h]=r[m]:f[h]=u(d)}}return f}function o(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,o);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,o);let u={};e.push(l),r.push(u);for(let c in l){if(Object.hasOwnProperty.call(l,c)===!1)continue;let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,o);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=o(f)}}return e.pop(),r.pop(),u}function a(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,a);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,a);let u={};e.push(l),r.push(u);for(let c in l){let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,a);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=a(f)}}return e.pop(),r.pop(),u}}});var li=E((aK,nS)=>{"use strict";var JL=ga()({circles:!1,proto:!0}),{kSchemaVisited:Z0,kSchemaResponse:KL}=De(),df=Symbol.for("fluent-schema-object"),{FST_ERR_SCH_MISSING_ID:YL,FST_ERR_SCH_ALREADY_PRESENT:XL,FST_ERR_SCH_DUPLICATE:QL,FST_ERR_SCH_CONTENT_MISSING_SCHEMA:eS}=He(),rS=["params","body","querystring","query","headers"];function ya(t){this.store=t||{}}ya.prototype.add=function(t){let e=JL(t.isFluentSchema||t.isFluentJSONSchema||t[df]?t.valueOf():t),r=e.$id;if(!r)throw new YL;if(this.store[r])throw new XL(r);this.store[r]=e};ya.prototype.getSchemas=function(){return Object.assign({},this.store)};ya.prototype.getSchema=function(t){return this.store[t]};function tS(t){return typeof t=="object"&&Object.getPrototypeOf(t)!==Object.prototype}function ZL(t,e){if(t[Z0])return t;if(t.query){if(t.querystring)throw new QL("querystring");t.querystring=t.query}eq(t);for(let r of rS){let n=t[r];if(n&&!tS(n)&&r==="body"&&n.content){let s=n.content,i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new eS(a)}continue}}if(t.response){let r=Object.keys(t.response);for(let n of r){if(tS(t.response[n]))continue;let s=t.response[n].content;if(s){let i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new eS(a)}}}}return t[Z0]=!0,t}function eq(t){for(let e of rS)t[e]&&(t[e].isFluentSchema||t[e][df])&&(t[e]=t[e].valueOf());if(t.response){let e=Object.keys(t.response);for(let r of e)(t.response[r].isFluentSchema||t.response[r][df])&&(t.response[r]=t.response[r].valueOf())}}function tq(t,e,r){let n=t[KL];if(!n)return!1;if(n[e]){if(n[e].constructor===Object&&r){let i=r.split(";",1)[0];return n[e][i]?n[e][i]:n[e]["*/*"]?n[e]["*/*"]:!1}return n[e]}let s=(e+"")[0]+"xx";if(n[s]){if(n[s].constructor===Object&&r){let i=r.split(";",1)[0];return n[s][i]?n[s][i]:n[s]["*/*"]?n[s]["*/*"]:!1}return n[s]}if(n.default){if(n.default.constructor===Object&&r){let i=r.split(";",1)[0];return n.default[i]?n.default[i]:n.default["*/*"]?n.default["*/*"]:!1}return n.default}return!1}nS.exports={buildSchemas(t){return new ya(t)},getSchemaSerializer:tq,normalizeSchema:ZL}});var _a=E((lK,iS)=>{"use strict";var rq=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;iS.exports=class sS{constructor(e){switch(e&&e.rounding){case"floor":this.parseInteger=Math.floor;break;case"ceil":this.parseInteger=Math.ceil;break;case"round":this.parseInteger=Math.round;break;case"trunc":default:this.parseInteger=Math.trunc;break}this._options=e}asInteger(e){if(Number.isInteger(e))return""+e;if(typeof e=="bigint")return e.toString();let r=this.parseInteger(e);if(r===1/0||r===-1/0||r!==r)throw new Error(`The value "${e}" cannot be converted to an integer.`);return""+r}asNumber(e){let r=Number(e);if(r!==r)throw new Error(`The value "${e}" cannot be converted to a number.`);return r===1/0||r===-1/0?"null":""+r}asBoolean(e){return e&&"true"||"false"}asDateTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+e.toISOString()+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date-time.`)}asDate(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date.`)}asTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(11,19)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a time.`)}asString(e){let r=e.length;if(r===0)return'""';if(r<42){let n="",s=-1,i=255;for(let o=0;o<r;o++)if(i=e.charCodeAt(o),i===34||i===92)s===-1&&(s=0),n+=e.slice(s,o)+"\\",s=o;else if(i<32||i>=55296&&i<=57343)return JSON.stringify(e);return s===-1&&'"'+e+'"'||'"'+n+e.slice(s)+'"'}else return r<5e3&&rq.test(e)===!1?'"'+e+'"':JSON.stringify(e)}asUnsafeString(e){return'"'+e+'"'}getState(){return this._options}static restoreFromState(e){return new sS(e)}}});var aS=E((uK,oS)=>{"use strict";var nq=_a(),sq={mode:"standalone"},iq=nq.restoreFromState(sq),oq=null;oS.exports=function(e,r){let{asString:n,asNumber:s,asBoolean:i,asDateTime:o,asDate:a,asTime:l,asUnsafeString:u}=r,c=r.asInteger.bind(r),f="{",p="}",h="[",d="]",m=",",g=":",S='"',b=f+p,_=h+d,y=S+S,R="null";function T(w){let $=w&&typeof w.toJSON=="function"?w.toJSON():w;if($===null)return b;let v,P=f,C=!1;return v=$.statusCode,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"statusCode":',P+=s(v)),v=$.code,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"code":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.error,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"error":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.message,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"message":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),P+p}return T}(oq,iq)});var ui=E((cK,fS)=>{"use strict";var lS=V("node:http").STATUS_CODES,aq=fc(),{setErrorStatusCode:lq}=Uo(),{kReplyHeaders:_n,kReplyNextErrorHandler:Sa,kReplyIsRunningOnErrorHook:uq,kRouteContext:cS,kDisableRequestLogging:Ea}=De(),{FST_ERR_REP_INVALID_PAYLOAD_TYPE:cq,FST_ERR_FAILED_ERROR_SERIALIZATION:fq}=He(),{getSchemaSerializer:dq}=li(),hf=aS(),hq={func:mq,toJSON(){return this.func.name.toString()+"()"}};function pq(t,e,r){t[uq]=!1;let n=t[cS];if(t[Sa]===!1){uS(e,t,function(o,a){try{o.raw.writeHead(o.raw.statusCode,o[_n])}catch(l){o.log[Ea]||o.log.warn({req:o.request,res:o,err:l},l?.message),o.raw.writeHead(o.raw.statusCode)}o.raw.end(a)});return}let s=t[Sa]||n.errorHandler;t[Sa]=Object.getPrototypeOf(s),delete t[_n]["content-type"],delete t[_n]["content-length"];let i=s.func;if(!i){t[Sa]=!1,uS(e,t,r);return}try{let o=i(e,t.request,t);o!==void 0&&(o!==null&&typeof o.then=="function"?aq(o,t):t.send(o))}catch(o){t.send(o)}}function mq(t,e,r){yq(t,r),lq(r,t),r.statusCode<500?r.log[Ea]||r.log.info({res:r,err:t},t?.message):r.log[Ea]||r.log.error({req:e,res:r,err:t},t?.message),r.send(t)}function uS(t,e,r){let n=e.raw,s=e.statusCode;e[_n]["content-type"]=e[_n]["content-type"]??"application/json; charset=utf-8";let i;try{let o=dq(e[cS],s,e[_n]["content-type"]);o===!1?i=hf({error:lS[s+""],code:t.code,message:t.message,statusCode:s}):i=o(Object.create(t,{error:{value:lS[s+""]},message:{value:t.message},statusCode:{value:s}}))}catch(o){e.log[Ea]||e.log.error({err:o,statusCode:n.statusCode},"The serializer for the given status code failed"),e.code(500),i=hf(new fq(o.message,t.message))}typeof i!="string"&&!Buffer.isBuffer(i)&&(i=hf(new cq(typeof i))),e[_n]["content-length"]=""+Buffer.byteLength(i),r(e,i)}function gq(t=hq,e){if(!e)return t;let r=Object.create(t);return r.func=e,r}function yq(t,e){let r=e.raw,n=r.statusCode;n=n>=400?n:500,t!=null&&(t.headers!==void 0&&e.headers(t.headers),t.status>=400?n=t.status:t.statusCode>=400&&(n=t.statusCode)),r.statusCode=n}fS.exports={buildErrorHandler:gq,handleError:pq}});var di=E((fK,mS)=>{"use strict";var{kReply:pf,kRequest:mf,kState:_q,kHasBeenDecorated:Sq}=De(),{FST_ERR_DEC_ALREADY_PRESENT:dS,FST_ERR_DEC_MISSING_DEPENDENCY:Eq,FST_ERR_DEC_AFTER_START:bq,FST_ERR_DEC_REFERENCE_TYPE:vq,FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:wq,FST_ERR_DEC_UNDECLARED:Rq}=He();function Oq(t,e,r,n){if(Object.hasOwn(t,e))throw new dS(e);gf(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(t,e,{get:r.getter,set:r.setter}):t[e]=r}function Tq(t){if(!ci(this,t))throw new Rq(t,"instance");return typeof this[t]=="function"?this[t].bind(this):this[t]}function hS(t,e,r,n){let s=t.prototype;if(Object.hasOwn(s,e)||fi(t,e))throw new dS(e);t[Sq]=!0,gf(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(s,e,{get:r.getter,set:r.setter}):typeof r=="function"?s[e]=r:t.props.push({key:e,value:r})}function pS(t,e){if(typeof e=="object"&&e&&!(typeof e.getter=="function"||typeof e.setter=="function"))throw new vq(t,typeof e)}function $q(t,e,r){return yf(this,t),Oq(this,t,e,r),this}function ci(t,e){return e?e in t||t.prototype&&e in t.prototype||fi(t,e):t in this}function fi(t,e){return t.props?t.props.find(({key:r})=>r===e):!1}function Pq(t){return t&&fi(this[mf],t)?!0:ci(this[mf].prototype,t)}function Aq(t){return t&&fi(this[pf],t)?!0:ci(this[pf].prototype,t)}function gf(t,e,r){if(r!=null){if(!Array.isArray(r))throw new wq(e);for(let n=0;n!==r.length;++n)if(!ci(t,r[n]))throw new Eq(r[n])}}function Cq(t,e,r){return yf(this,t),pS(t,e),hS(this[pf],t,e,r),this}function Iq(t,e,r){return yf(this,t),pS(t,e),hS(this[mf],t,e,r),this}function yf(t,e){if(t[_q].started)throw new bq(e)}mS.exports={add:$q,exist:ci,existRequest:Pq,existReply:Aq,dependencies:gf,decorateReply:Cq,decorateRequest:Iq,getInstanceDecorator:Tq,hasKey:fi}});var Pa=E((dK,$a)=>{"use strict";var ba=V("node:stream").finished,{kFourOhFourContext:gS,kReplyErrorHandlerCalled:wS,kReplyHijacked:vf,kReplyStartTime:pi,kReplyEndTime:wf,kReplySerializer:_r,kReplySerializerDefault:va,kReplyIsError:wa,kReplyHeaders:ge,kReplyTrailers:Ve,kReplyHasStatusCode:Rf,kReplyIsRunningOnErrorHook:Of,kReplyNextErrorHandler:Nq,kDisableRequestLogging:RS,kSchemaResponse:Ra,kReplyCacheSerializeFns:Hr,kSchemaController:_f,kOptions:kq,kRouteContext:ne}=De(),{onSendHookRunner:OS,onResponseHookRunner:xq,preHandlerHookRunner:Lq,preSerializationHookRunner:qq}=Dr(),yS=_c()[Symbol.for("internals")],jq=ai(),bf=jq.now,{handleError:_S}=ui(),{getSchemaSerializer:Dq}=li(),Sf={JSON:"application/json; charset=utf-8",PLAIN:"text/plain; charset=utf-8",OCTET:"application/octet-stream"},{FST_ERR_REP_INVALID_PAYLOAD_TYPE:Fq,FST_ERR_REP_RESPONSE_BODY_CONSUMED:Mq,FST_ERR_REP_READABLE_STREAM_LOCKED:Hq,FST_ERR_REP_ALREADY_SENT:Vq,FST_ERR_SEND_INSIDE_ONERR:zq,FST_ERR_BAD_STATUS_CODE:Uq,FST_ERR_BAD_TRAILER_NAME:Bq,FST_ERR_BAD_TRAILER_VALUE:Gq,FST_ERR_MISSING_SERIALIZATION_FN:Wq,FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:Jq,FST_ERR_DEC_UNDECLARED:Kq}=He(),SS=di(),TS=Object.prototype.toString;function ye(t,e,r){this.raw=t,this[_r]=null,this[wS]=!1,this[wa]=!1,this[Of]=!1,this.request=e,this[ge]={},this[Ve]=null,this[Rf]=!1,this[pi]=void 0,this.log=r}ye.props=[];Object.defineProperties(ye.prototype,{[ne]:{get(){return this.request[ne]}},elapsedTime:{get(){return this[pi]===void 0?0:(this[wf]||bf())-this[pi]}},server:{get(){return this.request[ne].server}},sent:{enumerable:!0,get(){return(this[vf]||this.raw.writableEnded)===!0}},statusCode:{get(){return this.raw.statusCode},set(t){this.code(t)}},routeOptions:{get(){return this.request.routeOptions}}});ye.prototype.writeEarlyHints=function(t,e){return this.raw.writeEarlyHints(t,e),this};ye.prototype.hijack=function(){return this[vf]=!0,this};ye.prototype.send=function(t){if(this[Of])throw new zq;if(this.sent===!0)return this.log.warn({err:new Vq(this.request.url,this.request.method)}),this;if(this[wa]||t instanceof Error)return this[wa]=!1,ns(this,t,Sn),this;if(t===void 0)return Sn(this,t),this;let e=this.getHeader("content-type"),r=e!==void 0;if(t!==null){if(typeof t.pipe=="function"||typeof t.getReader=="function"||TS.call(t)==="[object Response]")return Sn(this,t),this;if(t.buffer instanceof ArrayBuffer){r||(this[ge]["content-type"]=Sf.OCTET);let n=Buffer.isBuffer(t)?t:Buffer.from(t.buffer,t.byteOffset,t.byteLength);return Sn(this,n),this}if(!r&&typeof t=="string")return this[ge]["content-type"]=Sf.PLAIN,Sn(this,t),this}if(this[_r]!==null){if(typeof t!="string")return ES(this,t),this;t=this[_r](t)}else if(!r||e.indexOf("json")!==-1){if(!r)this[ge]["content-type"]=Sf.JSON;else if(e.indexOf("charset")===-1){let n=e.trim();n.endsWith(";")?this[ge]["content-type"]=`${n} charset=utf-8`:this[ge]["content-type"]=`${n}; charset=utf-8`}if(typeof t!="string")return ES(this,t),this}return Sn(this,t),this};ye.prototype.getHeader=function(t){t=t.toLowerCase();let e=this[ge][t];return e!==void 0?e:this.raw.getHeader(t)};ye.prototype.getHeaders=function(){return{...this.raw.getHeaders(),...this[ge]}};ye.prototype.hasHeader=function(t){return t=t.toLowerCase(),this[ge][t]!==void 0||this.raw.hasHeader(t)};ye.prototype.removeHeader=function(t){return delete this[ge][t.toLowerCase()],this};ye.prototype.header=function(t,e=""){return t=t.toLowerCase(),this[ge][t]&&t==="set-cookie"?(typeof this[ge][t]=="string"&&(this[ge][t]=[this[ge][t]]),Array.isArray(e)?Array.prototype.push.apply(this[ge][t],e):this[ge][t].push(e)):this[ge][t]=e,this};ye.prototype.headers=function(t){let e=Object.keys(t);for(let r=0;r!==e.length;++r){let n=e[r];this.header(n,t[n])}return this};var Yq=new Set(["transfer-encoding","content-length","host","cache-control","max-forwards","te","authorization","set-cookie","content-encoding","content-type","content-range","trailer"]);ye.prototype.trailer=function(t,e){if(t=t.toLowerCase(),Yq.has(t))throw new Bq(t);if(typeof e!="function")throw new Gq(t,typeof e);return this[Ve]===null&&(this[Ve]={}),this[Ve][t]=e,this};ye.prototype.hasTrailer=function(t){return this[Ve]?.[t.toLowerCase()]!==void 0};ye.prototype.removeTrailer=function(t){return this[Ve]===null?this:(this[Ve][t.toLowerCase()]=void 0,this)};ye.prototype.code=function(t){let e=+t;if(!(e>=100&&e<=599))throw new Uq(t||String(t));return this.raw.statusCode=e,this[Rf]=!0,this};ye.prototype.status=ye.prototype.code;ye.prototype.getSerializationFunction=function(t,e){let r;return typeof t=="string"||typeof t=="number"?typeof e=="string"?r=this[ne][Ra]?.[t]?.[e]:r=this[ne][Ra]?.[t]:typeof t=="object"&&(r=this[ne][Hr]?.get(t)),r};ye.prototype.compileSerializationSchema=function(t,e=null,r=null){let{request:n}=this,{method:s,url:i}=n;if(this[ne][Hr]?.has(t))return this[ne][Hr].get(t);let a=(this[ne].serializerCompiler||this.server[_f].serializerCompiler||this.server[_f].setupSerializer(this.server[kq])||this.server[_f].serializerCompiler)({schema:t,method:s,url:i,httpStatus:e,contentType:r});return this[ne][Hr]==null&&(this[ne][Hr]=new WeakMap),this[ne][Hr].set(t,a),a};ye.prototype.serializeInput=function(t,e,r,n){let s=r,i;if(r=typeof e=="string"||typeof e=="number"?e:r,n=r&&s!==r?s:n,r!=null){if(n!=null?i=this[ne][Ra]?.[r]?.[n]:i=this[ne][Ra]?.[r],i==null)throw n?new Jq(r,n):new Wq(r)}else this[ne][Hr]?.has(e)?i=this[ne][Hr].get(e):i=this.compileSerializationSchema(e,r,n);return i(t)};ye.prototype.serialize=function(t){return this[_r]!==null?this[_r](t):this[ne]&&this[ne][va]?this[ne][va](t,this.raw.statusCode):PS(this[ne],t,this.raw.statusCode)};ye.prototype.serializer=function(t){return this[_r]=t,this};ye.prototype.type=function(t){return this[ge]["content-type"]=t,this};ye.prototype.redirect=function(t,e){return e||(e=this[Rf]?this.raw.statusCode:302),this.header("location",t).code(e).send()};ye.prototype.callNotFound=function(){return sj(this),this};ye.prototype.then=function(t,e){if(this.sent){t();return}ba(this.raw,r=>{r&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"?e?e(r):this.log&&this.log.warn("unhandled rejection on reply.then"):t()})};ye.prototype.getDecorator=function(t){if(!SS.hasKey(this,t)&&!SS.exist(this,t))throw new Kq(t,"reply");let e=this[t];return typeof e=="function"?e.bind(this):e};function ES(t,e){t[ne].preSerialization!==null?qq(t[ne].preSerialization,t.request,t,e,bS):bS(null,void 0,t,e)}function bS(t,e,r,n){if(t!=null){ns(r,t);return}try{r[_r]!==null?n=r[_r](n):r[ne]&&r[ne][va]?n=r[ne][va](n,r.raw.statusCode):n=PS(r[ne],n,r.raw.statusCode,r[ge]["content-type"])}catch(s){Xq(s,r),ns(r,s);return}Sn(r,n)}function Xq(t,e){t.serialization=e[ne].config}function Sn(t,e){t[ne].onSend!==null?OS(t[ne].onSend,t.request,t,e,Qq):$S(t,e)}function Qq(t,e,r,n){t!=null?ns(r,t):$S(r,n)}function Ef(t,e){let r=t.raw;try{r.writeHead(e,t[ge])}catch(n){throw n.code==="ERR_HTTP_HEADERS_SENT"&&t.log.warn(`Reply was already sent, did you forget to "return reply" in the "${t.request.raw.url}" (${t.request.raw.method}) route?`),n}}function $S(t,e){let r=t.raw,n=t.request;if(t[Ve]!==null){let i=Object.keys(t[Ve]),o="";for(let a of i)typeof t[Ve][a]=="function"&&(o+=" ",o+=a);t.header("Transfer-Encoding","chunked"),t.header("Trailer",o.trim())}if(TS.call(e)==="[object Response]"){if(typeof e.status=="number"&&t.code(e.status),typeof e.headers=="object"&&typeof e.headers.forEach=="function")for(let[i,o]of e.headers)t.header(i,o);if(e.body!==null&&e.bodyUsed)throw new Mq;e=e.body}let s=r.statusCode;if(e==null){s>=200&&s!==204&&s!==304&&n.method!=="HEAD"&&t[Ve]===null&&(t[ge]["content-length"]="0"),Ef(t,s),hi(e,r,t);return}if(s>=100&&s<200||s===204){t.removeHeader("content-type"),t.removeHeader("content-length"),Ef(t,s),hi(void 0,r,t),typeof e.resume=="function"&&(e.on("error",Ta),e.resume());return}if(typeof e.pipe=="function"){ej(e,r,t);return}if(typeof e.getReader=="function"){Zq(e,r,t);return}if(typeof e!="string"&&!Buffer.isBuffer(e))throw new Fq(typeof e);if(t[Ve]===null){let i=t[ge]["content-length"];(!i||n.raw.method!=="HEAD"&&Number(i)!==Buffer.byteLength(e))&&(t[ge]["content-length"]=""+Buffer.byteLength(e))}Ef(t,s),r.write(e),hi(e,r,t)}function Oa(t,e,r){e.code==="ERR_STREAM_PREMATURE_CLOSE"?t[RS]||t.info({res:r},"stream closed prematurely"):t.warn({err:e},"response terminated with an error with headers already sent")}function Zq(t,e,r){if(t.locked)throw new Hq;let n=!0,s=!1,i=t.getReader();if(ba(e,function(l){n&&(l!=null&&e.headersSent&&!s&&(s=!0,Oa(r.log,l,e)),i.cancel().catch(Ta))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let l in r[ge])e.setHeader(l,r[ge][l]);function o(l){if(l.done){n=!1,hi(null,e,r);return}if(e.destroyed){n=!1,i.cancel().catch(Ta);return}e.write(l.value),i.read().then(o,a)}function a(l){n=!1,e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Oa(r.log,l,r)),e.destroy()):ns(r,l)}i.read().then(o,a)}function ej(t,e,r){let n=!0,s=!1;if(tj(t,e,r),ba(t,{readable:!0,writable:!1},function(i){n=!1,i!=null&&(e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Oa(r.log,i,r)),e.destroy()):ns(r,i))}),ba(e,function(i){n&&(i!=null&&e.headersSent&&!s&&(s=!0,Oa(r.log,i,e)),typeof t.destroy=="function"?t.destroy():typeof t.close=="function"?t.close(Ta):typeof t.abort=="function"?t.abort():r.log.warn("stream payload does not end properly"))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let i in r[ge])e.setHeader(i,r[ge][i]);t.pipe(e)}function hi(t,e,r){if(r[Ve]===null){e.end(null,null,null);return}let n=Object.keys(r[Ve]),s={},i=0,o=!0;function a(){i===0&&(e.addTrailers(s),e.end(null,null,null))}for(let l of n){let u=function(f,p){i++,f?r.log.debug(f):s[l]=p,process.nextTick(a)};if(typeof r[Ve][l]!="function")continue;o=!1,i--;let c=r[Ve][l](r,t,u);typeof c=="object"&&typeof c.then=="function"&&c.then(f=>u(null,f),u)}o&&e.end(null,null,null)}function tj(t,e,r){r[Ve]!==null&&t.on("end",()=>hi(null,e,r))}function ns(t,e,r){t[ne].onError!==null&&!t[Nq]?(t[Of]=!0,OS(t[ne].onError,t.request,t,e,()=>_S(t,e,r))):_S(t,e,r)}function rj(t){t[pi]=bf();let e=r=>{t[wf]=bf(),t.raw.removeListener("finish",e),t.raw.removeListener("error",e);let n=t[ne];n&&n.onResponse!==null?xq(n.onResponse,t.request,t,vS):vS(r,t.request,t)};t.raw.on("finish",e),t.raw.on("error",e)}function vS(t,e,r){if(r.log[RS])return;let n=r.elapsedTime;if(t!=null){r.log.error({res:r,err:t,responseTime:n},"request errored");return}r.log.info({res:r,responseTime:n},"request completed")}function nj(t){let e=t.props.slice();function r(n,s,i){this.raw=n,this[wa]=!1,this[wS]=!1,this[vf]=!1,this[_r]=null,this.request=s,this[ge]={},this[Ve]=null,this[pi]=void 0,this[wf]=void 0,this.log=i;let o;for(let a=0;a<e.length;a++)o=e[a],this[o.key]=o.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.parent=t,r.props=e,r}function sj(t){if(t[ne][gS]===null){t.log.warn("Trying to send a NotFound error inside a 404 handler. Sending basic 404 response."),t.code(404).send("404 Not Found");return}t.request[ne]=t[ne][gS],t[ne].preHandler!==null?Lq(t[ne].preHandler,t.request,t,yS.preHandlerCallback):yS.preHandlerCallback(null,t.request,t)}function PS(t,e,r,n){let s=Dq(t,r,n);return s?s(e):JSON.stringify(e)}function Ta(){}$a.exports=ye;$a.exports.buildReply=nj;$a.exports.setupResponseListeners=rj});var AS=E((hK,Aa)=>{"use strict";function Tf(t){if(!t)throw new TypeError("argument req is required");let e=t.headers["x-forwarded-for"],r=t.socket.remoteAddress;if(!e||typeof e!="string")return[r];if(e.indexOf(",")===-1){let n=e.trim();return n.length?[r,n]:[r]}else return ij(e,r)}function ij(t,e){let r=[e],n=t.length,s=n,i,o;for(o=n-1;o>=0;--o)i=t[o],i===" "?s===n&&(s=n=o):i===","?(s!==n&&r.push(t.slice(s,n)),s=n=o):s=o;return s!==n&&r.push(t.substring(s,n)),r}Aa.exports=Tf;Aa.exports.default=Tf;Aa.exports.forwarded=Tf});var IS=E((CS,Ca)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",o="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${e}\\.${e}\\.${e}\\.${e}(${i})?$`,"i")};function l(h,d){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let m=0,g=-1,S=(h.match(a.zoneIndex)||[])[0],b,_;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)m++;if(h.substr(0,2)==="::"&&m--,h.substr(-2,2)==="::"&&m--,m>d)return null;for(_=d-m,b=":";_--;)b+="0:";return h=h.replace("::",b),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),d=function(){let y=h.split(":"),R=[];for(let T=0;T<y.length;T++)R.push(parseInt(y[T],16));return R}(),{parts:d,zoneId:S}}function u(h,d,m,g){if(h.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,b;for(;g>0;){if(b=m-g,b<0&&(b=0),h[S]>>b!==d[S]>>b)return!1;g-=m,S+=1}return!0}function c(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function f(h,d){for(;h.length<d;)h=`0${h}`;return h}let p={};p.IPv4=function(){function h(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let m,g;for(m=0;m<d.length;m++)if(g=d[m],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return u(this.octets,d.octets,8,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},S,b,_;for(S=3;S>=0;S-=1)if(b=this.octets[S],b in g){if(_=g[b],m&&_!==0)return null;_!==8&&(m=!0),d+=_}else return null;return 32-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),p.IPv4.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<4;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.isIPv4=function(h){return this.parser(h)!==null},p.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(h){return!!(p.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(h){let d=h.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(h)||!d?!1:p.IPv4.isValidFourPartDecimal(d[1])},p.IPv4.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<4;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.parse=function(h){let d=this.parser(h);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},p.IPv4.parseCIDR=function(h){let d;if(d=h.match(/^(.+)\/(\d+)$/)){let m=parseInt(d[2]);if(m>=0&&m<=32){let g=[this.parse(d[1]),m];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},p.IPv4.parser=function(h){let d,m,g;if(d=h.match(r.fourOctet))return function(){let S=d.slice(1,6),b=[];for(let _=0;_<S.length;_++)m=S[_],b.push(c(m));return b}();if(d=h.match(r.longValue)){if(g=c(d[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let S=[],b;for(b=0;b<=24;b+=8)S.push(g>>b&255);return S}().reverse()}else return(d=h.match(r.twoOctet))?function(){let S=d.slice(1,4),b=[];if(g=c(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(g>>16&255),b.push(g>>8&255),b.push(g&255),b}():(d=h.match(r.threeOctet))?function(){let S=d.slice(1,5),b=[];if(g=c(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(c(S[1])),b.push(g>>8&255),b.push(g&255),b}():null},p.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<4&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.IPv6=function(){function h(d,m){let g,S;if(d.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(d[g]<<8|d[g+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");m&&(this.zoneId=m)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return u(this.parts,d.parts,16,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},S,b;for(let _=7;_>=0;_-=1)if(S=this.parts[_],S in g){if(b=g[S],m&&b!==0)return null;b!==16&&(m=!0),d+=b}else return null;return 128-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let d,m=[],g=this.parts;for(let S=0;S<g.length;S++)d=g[S],m.push(d>>8),m.push(d&255);return m},h.prototype.toFixedLengthString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(f(this.parts[S].toString(16),4));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),m=d[0],g=d[1];return new p.IPv4([m>>8,m&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,m=this.toNormalizedString(),g=0,S=-1,b;for(;b=d.exec(m);)b[0].length>S&&(g=b.index,S=b[0].length);return S<0?m:`${m.substring(0,g)}::${m.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),p.IPv6.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<16;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},p.IPv6.isIPv6=function(h){return this.parser(h)!==null},p.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let d=this.parser(h);return new this(d.parts,d.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<16;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},p.IPv6.parse=function(h){let d=this.parser(h);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},p.IPv6.parseCIDR=function(h){let d,m,g;if((m=h.match(/^(.+)\/(\d+)$/))&&(d=parseInt(m[2]),d>=0&&d<=128))return g=[this.parse(m[1]),d],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},p.IPv6.parser=function(h){let d,m,g,S,b,_;if(g=h.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(h))return l(h,8);if((g=h.match(a.transitional))&&(_=g[6]||"",d=g[1],g[1].endsWith("::")||(d=d.slice(0,-1)),d=l(d+_,6),d.parts)){for(b=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],m=0;m<b.length;m++)if(S=b[m],!(0<=S&&S<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<16&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.fromByteArray=function(h){let d=h.length;if(d===4)return new p.IPv4(h);if(d===16)return new p.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},p.isValid=function(h){return p.IPv6.isValid(h)||p.IPv4.isValid(h)},p.isValidCIDR=function(h){return p.IPv6.isValidCIDR(h)||p.IPv4.isValidCIDR(h)},p.parse=function(h){if(p.IPv6.isValid(h))return p.IPv6.parse(h);if(p.IPv4.isValid(h))return p.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},p.parseCIDR=function(h){try{return p.IPv6.parseCIDR(h)}catch{try{return p.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},p.process=function(h){let d=this.parse(h);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},p.subnetMatch=function(h,d,m){let g,S,b,_;m==null&&(m="unicast");for(S in d)if(Object.prototype.hasOwnProperty.call(d,S)){for(b=d[S],b[0]&&!(b[0]instanceof Array)&&(b=[b]),g=0;g<b.length;g++)if(_=b[g],h.kind()===_[0].kind()&&h.match.apply(h,_))return S}return m},typeof Ca<"u"&&Ca.exports?Ca.exports=p:t.ipaddr=p})(CS)});var qS=E((pK,ss)=>{"use strict";ss.exports=$f;ss.exports.default=$f;ss.exports.proxyaddr=$f;ss.exports.all=xS;ss.exports.compile=LS;var oj=AS(),kS=IS(),aj=/^\d+$/u,Ia=kS.isValid,Na=kS.parse,NS={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function xS(t,e){let r=oj(t);if(!e)return r;typeof e!="function"&&(e=LS(e));for(let n=0;n<r.length-1;n++)e(r[n],n)||(r.length=n+1);return r}function LS(t){if(!t)throw new TypeError("argument is required");let e;if(typeof t=="string")e=[t];else if(Array.isArray(t))e=t.slice();else throw new TypeError("unsupported trust argument");for(let r=0;r<e.length;r++)t=e[r],Object.hasOwn(NS,t)&&(t=NS[t],e.splice.apply(e,[r,1].concat(t)),r+=t.length-1);return uj(lj(e))}function lj(t){let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=cj(t[r]);return e}function uj(t){let e=t.length;return e===0?dj:e===1?pj(t[0]):hj(t)}function cj(t){let e=t.lastIndexOf("/"),r=e!==-1?t.substring(0,e):t;if(!Ia(r))throw new TypeError("invalid IP address: "+r);let n=Na(r);e===-1&&n.kind()==="ipv6"&&n.isIPv4MappedAddress()&&(n=n.toIPv4Address());let s=n.kind()==="ipv6"?128:32,i=e!==-1?t.substring(e+1,t.length):null;if(i===null?i=s:aj.test(i)?i=parseInt(i,10):n.kind()==="ipv4"&&Ia(i)?i=fj(i):i=null,i<=0||i>s)throw new TypeError("invalid range on address: "+t);return[n,i]}function fj(t){let e=Na(t);return e.kind()==="ipv4"?e.prefixLengthFromSubnetMask():null}function $f(t,e){if(!t)throw new TypeError("req argument is required");if(!e)throw new TypeError("trust argument is required");let r=xS(t,e);return r[r.length-1]}function dj(){return!1}function hj(t){return function(r){if(!Ia(r))return!1;let n=Na(r),s,i=n.kind();for(let o=0;o<t.length;o++){let a=t[o],l=a[0],u=l.kind(),c=a[1],f=n;if(i!==u){let p=u==="ipv4";if(p&&!n.isIPv4MappedAddress())continue;s||(s=p?n.toIPv4Address():n.toIPv4MappedAddress()),f=s}if(f.match(l,c))return!0}return!1}}function pj(t){let e=t[0],r=e.kind(),n=r==="ipv4",s=t[1];return function(o){if(!Ia(o))return!1;let a=Na(o);if(a.kind()!==r){if(n&&!a.isIPv4MappedAddress())return!1;a=n?a.toIPv4Address():a.toIPv4MappedAddress()}return a.match(e,s)}}});var xa=E((mK,If)=>{"use strict";var ka=qS(),{kHasBeenDecorated:mj,kSchemaBody:gj,kSchemaHeaders:yj,kSchemaParams:_j,kSchemaQuerystring:jS,kSchemaController:Pf,kOptions:Sj,kRequestCacheValidateFns:Vr,kRouteContext:Xe,kRequestOriginalUrl:Af}=De(),{FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:Ej,FST_ERR_DEC_UNDECLARED:bj}=He(),DS=di(),FS={body:gj,headers:yj,params:_j,querystring:jS,query:jS};function Cf(t,e,r,n,s,i){this.id=t,this[Xe]=i,this.params=e,this.raw=r,this.query=n,this.log=s,this.body=void 0}Cf.props=[];function vj(t){if(typeof t=="function")return t;if(t===!0)return null;if(typeof t=="number")return function(e,r){return r<t};if(typeof t=="string"){let e=t.split(",").map(r=>r.trim());return ka.compile(e)}return ka.compile(t)}function wj(t,e){return e?Rj(t,e):VS(t)}function VS(t){let e=t.props.slice();function r(n,s,i,o,a,l){this.id=n,this[Xe]=l,this.params=s,this.raw=i,this.query=o,this.log=a,this.body=void 0;let u;for(let c=0;c<e.length;c++)u=e[c],this[u.key]=u.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.props=e,r.parent=t,r}function MS(t){let e=t.lastIndexOf(",");return e===-1?t.trim():t.slice(e+1).trim()}function Rj(t,e){let r=VS(t),n=vj(e);return r[mj]=!0,Object.defineProperties(r.prototype,{ip:{get(){let s=ka.all(this.raw,n);return s[s.length-1]}},ips:{get(){return ka.all(this.raw,n)}},host:{get(){return this.ip!==void 0&&this.headers["x-forwarded-host"]?MS(this.headers["x-forwarded-host"]):this.headers.host??this.headers[":authority"]??""}},protocol:{get(){if(this.headers["x-forwarded-proto"])return MS(this.headers["x-forwarded-proto"]);if(this.socket)return this.socket.encrypted?"https":"http"}}}),r}function HS(t,e){if(!DS.hasKey(t,e)&&!DS.exist(t,e))throw new bj(e,"request")}Object.defineProperties(Cf.prototype,{server:{get(){return this[Xe].server}},url:{get(){return this.raw.url}},originalUrl:{get(){return this[Af]||(this[Af]=this.raw.originalUrl||this.raw.url),this[Af]}},method:{get(){return this.raw.method}},routeOptions:{get(){let t=this[Xe],e=t._parserOptions.limit,r=t.server.initialConfig.bodyLimit,n=t.server.hasConstraintStrategy("version")?this.raw.headers["accept-version"]:void 0;return{method:t.config?.method,url:t.config?.url,bodyLimit:e||r,attachValidation:t.attachValidation,logLevel:t.logLevel,exposeHeadRoute:t.exposeHeadRoute,prefixTrailingSlash:t.prefixTrailingSlash,handler:t.handler,config:t.config,schema:t.schema,version:n}}},is404:{get(){return this[Xe].config?.url===void 0}},socket:{get(){return this.raw.socket}},ip:{get(){if(this.socket)return this.socket.remoteAddress}},host:{get(){return this.raw.headers.host??this.raw.headers[":authority"]??""}},hostname:{get(){return this.host[0]==="["?this.host.slice(0,this.host.indexOf("]")+1):this.host.split(":",1)[0]}},port:{get(){let t=parseInt(this.host.split(":").slice(-1)[0]);if(!isNaN(t))return t;let e=this.headers.host??this.headers[":authority"]??"",r=parseInt(e.split(":").slice(-1)[0]);return isNaN(r)?null:r}},protocol:{get(){if(this.socket)return this.socket.encrypted?"https":"http"}},headers:{get(){return this.additionalHeaders?Object.assign({},this.raw.headers,this.additionalHeaders):this.raw.headers},set(t){this.additionalHeaders=t}},getValidationFunction:{value:function(t){if(typeof t=="string"){let e=FS[t];return this[Xe][e]}else if(typeof t=="object")return this[Xe][Vr]?.get(t)}},compileValidationSchema:{value:function(t,e=null){let{method:r,url:n}=this;if(this[Xe][Vr]?.has(t))return this[Xe][Vr].get(t);let i=(this[Xe].validatorCompiler||this.server[Pf].validatorCompiler||this.server[Pf].setupValidator(this.server[Sj])||this.server[Pf].validatorCompiler)({schema:t,method:r,url:n,httpPart:e});return this[Xe][Vr]==null&&(this[Xe][Vr]=new WeakMap),this[Xe][Vr].set(t,i),i}},validateInput:{value:function(t,e,r){r=typeof e=="string"?e:r;let n=r!=null&&typeof r=="string"&&FS[r],s;if(n&&(s=this[Xe][n]),s==null&&(e==null||typeof e!="object"||Array.isArray(e)))throw new Ej(r);return s==null&&(this[Xe][Vr]?.has(e)?s=this[Xe][Vr].get(e):s=this.compileValidationSchema(e,r)),s(t)}},getDecorator:{value:function(t){HS(this,t);let e=this[t];return typeof e=="function"?e.bind(this):e}},setDecorator:{value:function(t,e){HS(this,t),this[t]=e}}});If.exports=Cf;If.exports.buildRequest=wj});var La=E((gK,zS)=>{"use strict";var{kFourOhFourContext:Oj,kReplySerializerDefault:Tj,kSchemaErrorFormatter:$j,kErrorHandler:Pj,kChildLoggerFactory:Aj,kOptions:Cj,kReply:Ij,kRequest:Nj,kBodyLimit:kj,kLogLevel:xj,kContentTypeParser:Lj,kRouteByFastify:qj,kRequestCacheValidateFns:jj,kReplyCacheSerializeFns:Dj}=De();function Fj({schema:t,handler:e,config:r,requestIdLogLabel:n,childLoggerFactory:s,errorHandler:i,bodyLimit:o,logLevel:a,logSerializers:l,attachValidation:u,validatorCompiler:c,serializerCompiler:f,replySerializer:p,schemaErrorFormatter:h,exposeHeadRoute:d,prefixTrailingSlash:m,server:g,isFastify:S}){this.schema=t,this.handler=e,this.Reply=g[Ij],this.Request=g[Nj],this.contentTypeParser=g[Lj],this.onRequest=null,this.onSend=null,this.onError=null,this.onTimeout=null,this.preHandler=null,this.onResponse=null,this.preSerialization=null,this.onRequestAbort=null,this.config=r,this.errorHandler=i||g[Pj],this.requestIdLogLabel=n||g[Cj].requestIdLogLabel,this.childLoggerFactory=s||g[Aj],this._middie=null,this._parserOptions={limit:o||g[kj]},this.exposeHeadRoute=d,this.prefixTrailingSlash=m,this.logLevel=a||g[xj],this.logSerializers=l,this[Oj]=null,this.attachValidation=u,this[Tj]=p,this.schemaErrorFormatter=h||g[$j]||Mj,this[qj]=S,this[jj]=null,this[Dj]=null,this.validatorCompiler=c||null,this.serializerCompiler=f||null,this.server=g}function Mj(t,e){let r="",n=", ";for(let s=0;s!==t.length;++s){let i=t[s];r+=e+(i.instancePath||"")+" "+i.message+n}return new Error(r.slice(0,-n.length))}zS.exports=Fj});var BS=E(sr=>{"use strict";var Nf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},kf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},mi=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}},qa=class{constructor(){this.records={}}initForCache(e,r){this.records[e]={[r]:{cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}}resetForCache(e){for(let r of Object.keys(this.records[e]))this.records[e][r]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}getStatistics(){return this.records}};function US(t){return`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")}`}var xf=class{constructor(e,r,n){this.cacheId=e,this.statisticTtlInHours=r,this.collectionStart=new Date,this.currentTimeStamp=US(this.collectionStart),this.records=n||new qa,this.records.initForCache(this.cacheId,this.currentTimeStamp)}get currentRecord(){return this.records.records[this.cacheId][this.currentTimeStamp]||(this.records.records[this.cacheId][this.currentTimeStamp]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,sets:0,invalidateOne:0,invalidateAll:0}),this.records.records[this.cacheId][this.currentTimeStamp]}hoursPassed(){return(Date.now()-this.collectionStart)/1e3/60/60}addHit(){this.archiveIfNeeded(),this.currentRecord.hits++}addFalsyHit(){this.archiveIfNeeded(),this.currentRecord.falsyHits++}addEmptyHit(){this.archiveIfNeeded(),this.currentRecord.emptyHits++}addMiss(){this.archiveIfNeeded(),this.currentRecord.misses++}addEviction(){this.archiveIfNeeded(),this.currentRecord.evictions++}setCacheSize(e){this.archiveIfNeeded(),this.currentRecord.cacheSize=e}addExpiration(){this.archiveIfNeeded(),this.currentRecord.expirations++}addSet(){this.archiveIfNeeded(),this.currentRecord.sets++}addInvalidateOne(){this.archiveIfNeeded(),this.currentRecord.invalidateOne++}addInvalidateAll(){this.archiveIfNeeded(),this.currentRecord.invalidateAll++}getStatistics(){return this.records.getStatistics()}archiveIfNeeded(){this.hoursPassed()>=this.statisticTtlInHours&&(this.collectionStart=new Date,this.currentTimeStamp=US(this.collectionStart),this.records.initForCache(this.cacheId,this.currentTimeStamp))}},ja=class extends mi{constructor(e,r,n,s,i){if(super(e||1e3,r||0),!n)throw new Error("Cache id is mandatory");this.hitStatistics=new xf(n,i!==void 0?i:24,s)}getStatistics(){return this.hitStatistics.getStatistics()}set(e,r){super.set(e,r),this.hitStatistics.addSet(),this.hitStatistics.setCacheSize(this.size)}evict(){super.evict(),this.hitStatistics.addEviction(),this.hitStatistics.setCacheSize(this.size)}delete(e,r=!1){super.delete(e),r||this.hitStatistics.addInvalidateOne(),this.hitStatistics.setCacheSize(this.size)}clear(){super.clear(),this.hitStatistics.addInvalidateAll(),this.hitStatistics.setCacheSize(this.size)}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e,!0),this.hitStatistics.addExpiration();return}return this.bumpLru(r),r.value||this.hitStatistics.addFalsyHit(),(r.value===void 0||r.value===null||r.value==="")&&this.hitStatistics.addEmptyHit(),this.hitStatistics.addHit(),r.value}this.hitStatistics.addMiss()}},Da=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}};sr.Fifo=Da;sr.FifoMap=Nf;sr.FifoObject=Da;sr.HitStatisticsRecord=qa;sr.Lru=mi;sr.LruHitStatistics=ja;sr.LruMap=kf;sr.LruObject=mi;sr.LruObjectHitStatistics=ja});var YS=E((_K,is)=>{"use strict";var Hj=typeof Buffer<"u",GS=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,WS=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function JS(t,e,r){r==null&&e!==null&&typeof e=="object"&&(r=e,e=void 0),Hj&&Buffer.isBuffer(t)&&(t=t.toString()),t&&t.charCodeAt(0)===65279&&(t=t.slice(1));let n=JSON.parse(t,e);if(n===null||typeof n!="object")return n;let s=r&&r.protoAction||"error",i=r&&r.constructorAction||"error";if(s==="ignore"&&i==="ignore")return n;if(s!=="ignore"&&i!=="ignore"){if(GS.test(t)===!1&&WS.test(t)===!1)return n}else if(s!=="ignore"&&i==="ignore"){if(GS.test(t)===!1)return n}else if(WS.test(t)===!1)return n;return KS(n,{protoAction:s,constructorAction:i,safe:r&&r.safe})}function KS(t,{protoAction:e="error",constructorAction:r="error",safe:n}={}){let s=[t];for(;s.length;){let i=s;s=[];for(let o of i){if(e!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(n===!0)return null;if(e==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(let a in o){let l=o[a];l&&typeof l=="object"&&s.push(l)}}}return t}function Lf(t,e,r){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return JS(t,e,r)}finally{Error.stackTraceLimit=n}}function Vj(t,e){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return JS(t,e,{safe:!0})}catch{return}finally{Error.stackTraceLimit=r}}is.exports=Lf;is.exports.default=Lf;is.exports.parse=Lf;is.exports.safeParse=Vj;is.exports.scan=KS});var Mf=E((SK,_i)=>{"use strict";var{AsyncResource:zj}=V("node:async_hooks"),{FifoMap:ZS}=BS(),{parse:Uj}=YS(),yi=cc(),{kDefaultJsonParse:gi,kContentTypeParser:os,kBodyLimit:Bj,kRequestPayloadStream:eE,kState:jf,kTestInternals:Gj,kReplyIsError:XS,kRouteContext:Wj}=De(),{FST_ERR_CTP_INVALID_TYPE:Fa,FST_ERR_CTP_EMPTY_TYPE:Jj,FST_ERR_CTP_ALREADY_PRESENT:Kj,FST_ERR_CTP_INVALID_HANDLER:Yj,FST_ERR_CTP_INVALID_PARSE_TYPE:Xj,FST_ERR_CTP_BODY_TOO_LARGE:QS,FST_ERR_CTP_INVALID_MEDIA_TYPE:Qj,FST_ERR_CTP_INVALID_CONTENT_LENGTH:Zj,FST_ERR_CTP_EMPTY_JSON_BODY:eD,FST_ERR_CTP_INSTANCE_ALREADY_STARTED:Df,FST_ERR_CTP_INVALID_JSON_BODY:tD}=He(),{FSTSEC001:rD}=Kn();function Sr(t,e,r){this[gi]=rE(e,r),this.customParsers=new Map,this.customParsers.set("application/json",new qf(!0,!1,t,this[gi])),this.customParsers.set("text/plain",new qf(!0,!1,t,Ff)),this.parserList=["application/json","text/plain"],this.parserRegExpList=[],this.cache=new ZS(100)}Sr.prototype.add=function(t,e,r){let n=typeof t=="string";if(n){if(t=t.trim().toLowerCase(),t.length===0)throw new Jj}else if(!(t instanceof RegExp))throw new Fa;if(typeof r!="function")throw new Yj;if(this.existingParser(t))throw new Kj(t);if(e.parseAs!==void 0&&e.parseAs!=="string"&&e.parseAs!=="buffer")throw new Xj(e.parseAs);let s=new qf(e.parseAs==="string",e.parseAs==="buffer",e.bodyLimit,r);if(t==="*")this.customParsers.set("",s);else if(n){let i=new yi(t);if(i.isValid===!1)throw new Fa;let o=i.toString();this.parserList.unshift(o),this.customParsers.set(o,s)}else lD(t),this.parserRegExpList.unshift(t),this.customParsers.set(t.toString(),s)};Sr.prototype.hasParser=function(t){if(typeof t=="string")t=new yi(t).toString();else{if(!(t instanceof RegExp))throw new Fa;t=t.toString()}return this.customParsers.has(t)};Sr.prototype.existingParser=function(t){if(typeof t=="string"){let e=new yi(t).toString();if(t==="application/json"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==this[gi];if(t==="text/plain"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==Ff}return this.hasParser(t)};Sr.prototype.getParser=function(t){typeof t=="string"&&(t=new yi(t));let e=t.toString(),r=this.cache.get(e);if(r!==void 0)return r;if(r=this.customParsers.get(e),r!==void 0)return this.cache.set(e,r),r;if(r=this.customParsers.get(t.mediaType),r!==void 0)return r;for(let n=0;n!==this.parserRegExpList.length;++n){let s=this.parserRegExpList[n];if(s.test(e))return r=this.customParsers.get(s.toString()),this.cache.set(e,r),r}return this.customParsers.get("")};Sr.prototype.removeAll=function(){this.customParsers=new Map,this.parserRegExpList=[],this.parserList=[],this.cache=new ZS(100)};Sr.prototype.remove=function(t){let e;if(typeof t=="string")t=new yi(t).toString(),e=this.parserList;else{if(!(t instanceof RegExp))throw new Fa;t=t.toString(),e=this.parserRegExpList}let r=this.customParsers.delete(t),n=e.findIndex(s=>s.toString()===t);return n>-1&&e.splice(n,1),r||n>-1};Sr.prototype.run=function(t,e,r,n){let s=this.getParser(t);if(s===void 0){if(r.is404===!0){e(r,n);return}n[XS]=!0,n.send(new Qj(t||void 0));return}let i=new zj("content-type-parser:run",r),o=i.bind(l);if(s.asString===!0||s.asBuffer===!0){tE(r,n,n[Wj]._parserOptions,s,o);return}let a=s.fn(r,r[eE],o);a&&typeof a.then=="function"&&a.then(u=>{o(null,u)},o);function l(u,c){if(i.emitDestroy(),u!=null){n.header("connection","close"),n[XS]=!0,n.send(u);return}r.body=c,e(r,n)}};function tE(t,e,r,n,s){let i=n.asString===!0,o=r.limit===null?n.bodyLimit:r.limit,a=Number(t.headers["content-length"]);if(a>o){s(new QS,void 0);return}let l=0,u=i?"":[],c=t[eE]||t.raw;i&&c.setEncoding("utf8"),c.on("data",f),c.on("end",p),c.on("error",p),c.resume();function f(h){l+=i?Buffer.byteLength(h):h.length;let{receivedEncodedLength:d=0}=c;if(l>o||d>o){c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),s(new QS,void 0);return}i?u+=h:u.push(h)}function p(h){if(c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),h!=null){typeof h.statusCode=="number"&&h.statusCode>=400||(h.statusCode=400),s(h,void 0);return}if(!Number.isNaN(a)&&(c.receivedEncodedLength||l)!==a){s(new Zj,void 0);return}i||(u=Buffer.concat(u));let d=n.fn(t,u,s);d&&typeof d.then=="function"&&d.then(m=>{s(null,m)},s)}}function rE(t,e){let r={protoAction:t,constructorAction:e};return n;function n(s,i,o){if(i.length===0){o(new eD,void 0);return}try{o(null,Uj(i,r))}catch{o(new tD,void 0)}}}function Ff(t,e,r){r(null,e)}function qf(t,e,r,n){this.asString=t,this.asBuffer=e,this.bodyLimit=r,this.fn=n}function nD(t){let e=new Sr;return e[gi]=t[gi],e.customParsers=new Map(t.customParsers.entries()),e.parserList=t.parserList.slice(),e.parserRegExpList=t.parserRegExpList.slice(),e}function sD(t,e,r){if(this[jf].started)throw new Df("addContentTypeParser");return typeof e=="function"&&(r=e,e={}),e||(e={}),e.bodyLimit||(e.bodyLimit=this[Bj]),Array.isArray(t)?t.forEach(n=>this[os].add(n,e,r)):this[os].add(t,e,r),this}function iD(t){return this[os].hasParser(t)}function oD(t){if(this[jf].started)throw new Df("removeContentTypeParser");if(Array.isArray(t))for(let e of t)this[os].remove(e);else this[os].remove(t)}function aD(){if(this[jf].started)throw new Df("removeAllContentTypeParsers");this[os].removeAll()}function lD(t){t.source[0]!=="^"&&t.source.includes(";?")===!1&&rD(t.source)}_i.exports=Sr;_i.exports.helpers={buildContentTypeParser:nD,addContentTypeParser:sD,hasContentTypeParser:iD,removeContentTypeParser:oD,removeAllContentTypeParsers:aD};_i.exports.defaultParsers={getDefaultJsonParser:rE,defaultTextParser:Ff};_i.exports[Gj]={rawBody:tE}});var as=E(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.regexpCode=ce.getEsmExportName=ce.getProperty=ce.safeStringify=ce.stringify=ce.strConcat=ce.addCodeArg=ce.str=ce._=ce.nil=ce._Code=ce.Name=ce.IDENTIFIER=ce._CodeOrName=void 0;var Si=class{};ce._CodeOrName=Si;ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var En=class extends Si{constructor(e){if(super(),!ce.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}}};ce.Name=En;var It=class extends Si{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,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof En&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ce._Code=It;ce.nil=new It("");function nE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Vf(r,e[n]),r.push(t[++n]);return new It(r)}ce._=nE;var Hf=new It("+");function sE(t,...e){let r=[Ei(t[0])],n=0;for(;n<e.length;)r.push(Hf),Vf(r,e[n]),r.push(Hf,Ei(t[++n]));return uD(r),new It(r)}ce.str=sE;function Vf(t,e){e instanceof It?t.push(...e._items):e instanceof En?t.push(e):t.push(dD(e))}ce.addCodeArg=Vf;function uD(t){let e=1;for(;e<t.length-1;){if(t[e]===Hf){let r=cD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function cD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof En||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 En))return`"${t}${e.slice(1)}`}function fD(t,e){return e.emptyStr()?t:t.emptyStr()?e:sE`${t}${e}`}ce.strConcat=fD;function dD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ei(Array.isArray(t)?t.join(","):t)}function hD(t){return new It(Ei(t))}ce.stringify=hD;function Ei(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ce.safeStringify=Ei;function pD(t){return typeof t=="string"&&ce.IDENTIFIER.test(t)?new It(`.${t}`):nE`[${t}]`}ce.getProperty=pD;function mD(t){if(typeof t=="string"&&ce.IDENTIFIER.test(t))return new It(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ce.getEsmExportName=mD;function gD(t){return new It(t.toString())}ce.regexpCode=gD});var za=E(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.ValueScope=St.ValueScopeName=St.Scope=St.varKinds=St.UsedValueState=void 0;var _t=as(),zf=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ma;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ma||(St.UsedValueState=Ma={}));St.varKinds={const:new _t.Name("const"),let:new _t.Name("let"),var:new _t.Name("var")};var Ha=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof _t.Name?e:this.name(e)}name(e){return new _t.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.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}}};St.Scope=Ha;var Va=class extends _t.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,_t._)`.${new _t.Name(r)}[${n}]`}};St.ValueScopeName=Va;var yD=(0,_t._)`\n`,Uf=class extends Ha{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?yD:_t.nil}}get(){return this._scope}name(e){return new Va(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let c=a.get(o);if(c)return c}else a=this._values[i]=new Map;a.set(o,s);let l=this._scope[i]||(this._scope[i]=[]),u=l.length;return l[u]=r.ref,s.setValue(r,{property:i,itemIndex:u}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,_t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=_t.nil;for(let o in e){let a=e[o];if(!a)continue;let l=n[o]=n[o]||new Map;a.forEach(u=>{if(l.has(u))return;l.set(u,Ma.Started);let c=r(u);if(c){let f=this.opts.es5?St.varKinds.var:St.varKinds.const;i=(0,_t._)`${i}${f} ${u} = ${c};${this.opts._n}`}else if(c=s?.(u))i=(0,_t._)`${i}${c}${this.opts._n}`;else throw new zf(u);l.set(u,Ma.Completed)})}return i}};St.ValueScope=Uf});var W=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.or=te.and=te.not=te.CodeGen=te.operators=te.varKinds=te.ValueScopeName=te.ValueScope=te.Scope=te.Name=te.regexpCode=te.stringify=te.getProperty=te.nil=te.strConcat=te.str=te._=void 0;var oe=as(),Ut=za(),zr=as();Object.defineProperty(te,"_",{enumerable:!0,get:function(){return zr._}});Object.defineProperty(te,"str",{enumerable:!0,get:function(){return zr.str}});Object.defineProperty(te,"strConcat",{enumerable:!0,get:function(){return zr.strConcat}});Object.defineProperty(te,"nil",{enumerable:!0,get:function(){return zr.nil}});Object.defineProperty(te,"getProperty",{enumerable:!0,get:function(){return zr.getProperty}});Object.defineProperty(te,"stringify",{enumerable:!0,get:function(){return zr.stringify}});Object.defineProperty(te,"regexpCode",{enumerable:!0,get:function(){return zr.regexpCode}});Object.defineProperty(te,"Name",{enumerable:!0,get:function(){return zr.Name}});var Wa=za();Object.defineProperty(te,"Scope",{enumerable:!0,get:function(){return Wa.Scope}});Object.defineProperty(te,"ValueScope",{enumerable:!0,get:function(){return Wa.ValueScope}});Object.defineProperty(te,"ValueScopeName",{enumerable:!0,get:function(){return Wa.ValueScopeName}});Object.defineProperty(te,"varKinds",{enumerable:!0,get:function(){return Wa.varKinds}});te.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};var Er=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Bf=class extends Er{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ut.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=us(this.rhs,e,r)),this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}},Ua=class extends Er{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=us(this.rhs,e,r),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return Ga(e,this.rhs)}},Gf=class extends Ua{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Wf=class extends Er{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Jf=class extends Er{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Kf=class extends Er{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Yf=class extends Er{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=us(this.code,e,r),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}},bi=class extends Er{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(_D(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>wn(e,r.names),{})}},br=class extends bi{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Xf=class extends bi{},ls=class extends br{};ls.kind="else";var bn=class t extends br{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 n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ls(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(iE(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=us(this.condition,e,r),this}get names(){let e=super.names;return Ga(e,this.condition),this.else&&wn(e,this.else.names),e}};bn.kind="if";var vn=class extends br{};vn.kind="for";var Qf=class extends vn{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=us(this.iteration,e,r),this}get names(){return wn(super.names,this.iteration.names)}},Zf=class extends vn{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ut.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=Ga(super.names,this.from);return Ga(e,this.to)}},Ba=class extends vn{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}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=us(this.iterable,e,r),this}get names(){return wn(super.names,this.iterable.names)}},vi=class extends br{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};vi.kind="func";var wi=class extends bi{render(e){return"return "+super.render(e)}};wi.kind="return";var ed=class extends br{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 n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&wn(e,this.catch.names),this.finally&&wn(e,this.finally.names),e}},Ri=class extends br{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ri.kind="catch";var Oi=class extends br{render(e){return"finally"+super.render(e)}};Oi.kind="finally";var td=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
52
|
-
`:""},this._extScope=e,this._scope=new Ut.Scope({parent:e}),this._nodes=[new Xf]}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 n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}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,n,s){let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Bf(e,i,n)),i}const(e,r,n){return this._def(Ut.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ut.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ut.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ua(e,r,n))}add(e,r){return this._leafNode(new Gf(e,te.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==oe.nil&&this._leafNode(new Yf(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,oe.addCodeArg)(r,s));return r.push("}"),new oe._Code(r)}if(e,r,n){if(this._blockNode(new bn(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new bn(e))}else(){return this._elseNode(new ls)}endIf(){return this._endBlockNode(bn,ls)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Qf(e),r)}forRange(e,r,n,s,i=this.opts.es5?Ut.varKinds.var:Ut.varKinds.let){let o=this._scope.toName(e);return this._for(new Zf(i,o,r,n),()=>s(o))}forOf(e,r,n,s=Ut.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof oe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,oe._)`${o}.length`,a=>{this.var(i,(0,oe._)`${o}[${a}]`),n(i)})}return this._for(new Ba("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?Ut.varKinds.var:Ut.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,oe._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new Ba("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(vn)}label(e){return this._leafNode(new Wf(e))}break(e){return this._leafNode(new Jf(e))}return(e){let r=new wi;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(wi)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new ed;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new Ri(i),r(i)}return n&&(this._currNode=s.finally=new Oi,this.code(n)),this._endBlockNode(Ri,Oi)}throw(e){return this._leafNode(new Kf(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 n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=oe.nil,n,s){return this._blockNode(new vi(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(vi)}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 n=this._currNode;if(n instanceof e||r&&n 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 bn))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}};te.CodeGen=td;function wn(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Ga(t,e){return e instanceof oe._CodeOrName?wn(t,e.names):t}function us(t,e,r){if(t instanceof oe.Name)return n(t);if(!s(t))return t;return new oe._Code(t._items.reduce((i,o)=>(o instanceof oe.Name&&(o=n(o)),o instanceof oe._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof oe._Code&&i._items.some(o=>o instanceof oe.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function _D(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function iE(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,oe._)`!${rd(t)}`}te.not=iE;var SD=oE(te.operators.AND);function ED(...t){return t.reduce(SD)}te.and=ED;var bD=oE(te.operators.OR);function vD(...t){return t.reduce(bD)}te.or=vD;function oE(t){return(e,r)=>e===oe.nil?r:r===oe.nil?e:(0,oe._)`${rd(e)} ${t} ${rd(r)}`}function rd(t){return t instanceof oe.Name?t:(0,oe._)`(${t})`}});var ee=E(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.checkStrictMode=re.getErrorPath=re.Type=re.useFunc=re.setEvaluated=re.evaluatedPropsToName=re.mergeEvaluated=re.eachItem=re.unescapeJsonPointer=re.escapeJsonPointer=re.escapeFragment=re.unescapeFragment=re.schemaRefOrVal=re.schemaHasRulesButRef=re.schemaHasRules=re.checkUnknownRules=re.alwaysValidSchema=re.toHash=void 0;var Se=W(),wD=as();function RD(t){let e={};for(let r of t)e[r]=!0;return e}re.toHash=RD;function OD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(uE(t,e),!cE(e,t.self.RULES.all))}re.alwaysValidSchema=OD;function uE(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||hE(t,`unknown keyword: "${i}"`)}re.checkUnknownRules=uE;function cE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}re.schemaHasRules=cE;function TD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}re.schemaHasRulesButRef=TD;function $D({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Se._)`${r}`}return(0,Se._)`${t}${e}${(0,Se.getProperty)(n)}`}re.schemaRefOrVal=$D;function PD(t){return fE(decodeURIComponent(t))}re.unescapeFragment=PD;function AD(t){return encodeURIComponent(sd(t))}re.escapeFragment=AD;function sd(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}re.escapeJsonPointer=sd;function fE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}re.unescapeJsonPointer=fE;function CD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}re.eachItem=CD;function aE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let l=o===void 0?i:o instanceof Se.Name?(i instanceof Se.Name?t(s,i,o):e(s,i,o),o):i instanceof Se.Name?(e(s,o,i),i):r(i,o);return a===Se.Name&&!(l instanceof Se.Name)?n(s,l):l}}re.mergeEvaluated={props:aE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Se._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Se._)`${r} || {}`).code((0,Se._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Se._)`${r} || {}`),id(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:dE}),items:aE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Se._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Se._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function dE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Se._)`{}`);return e!==void 0&&id(t,r,e),r}re.evaluatedPropsToName=dE;function id(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Se._)`${e}${(0,Se.getProperty)(n)}`,!0))}re.setEvaluated=id;var lE={};function ID(t,e){return t.scopeValue("func",{ref:e,code:lE[e.code]||(lE[e.code]=new wD._Code(e.code))})}re.useFunc=ID;var nd;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(nd||(re.Type=nd={}));function ND(t,e,r){if(t instanceof Se.Name){let n=e===nd.Num;return r?n?(0,Se._)`"[" + ${t} + "]"`:(0,Se._)`"['" + ${t} + "']"`:n?(0,Se._)`"/" + ${t}`:(0,Se._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Se.getProperty)(t).toString():"/"+sd(t)}re.getErrorPath=ND;function hE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}re.checkStrictMode=hE});var Nt=E(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var Qe=W(),kD={data:new Qe.Name("data"),valCxt:new Qe.Name("valCxt"),instancePath:new Qe.Name("instancePath"),parentData:new Qe.Name("parentData"),parentDataProperty:new Qe.Name("parentDataProperty"),rootData:new Qe.Name("rootData"),dynamicAnchors:new Qe.Name("dynamicAnchors"),vErrors:new Qe.Name("vErrors"),errors:new Qe.Name("errors"),this:new Qe.Name("this"),self:new Qe.Name("self"),scope:new Qe.Name("scope"),json:new Qe.Name("json"),jsonPos:new Qe.Name("jsonPos"),jsonLen:new Qe.Name("jsonLen"),jsonPart:new Qe.Name("jsonPart")};od.default=kD});var Ti=E(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extendErrors=Ze.resetErrorsCount=Ze.reportExtraError=Ze.reportError=Ze.keyword$DataError=Ze.keywordError=void 0;var le=W(),Ja=ee(),it=Nt();Ze.keywordError={message:({keyword:t})=>(0,le.str)`must pass "${t}" keyword validation`};Ze.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,le.str)`"${t}" keyword must be ${e} ($data)`:(0,le.str)`"${t}" keyword is invalid ($data)`};function xD(t,e=Ze.keywordError,r,n){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,l=gE(t,e,r);n??(o||a)?pE(i,l):mE(s,(0,le._)`[${l}]`)}Ze.reportError=xD;function LD(t,e=Ze.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:o}=n,a=gE(t,e,r);pE(s,a),i||o||mE(n,it.default.vErrors)}Ze.reportExtraError=LD;function qD(t,e){t.assign(it.default.errors,e),t.if((0,le._)`${it.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,le._)`${it.default.vErrors}.length`,e),()=>t.assign(it.default.vErrors,null)))}Ze.resetErrorsCount=qD;function jD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,it.default.errors,a=>{t.const(o,(0,le._)`${it.default.vErrors}[${a}]`),t.if((0,le._)`${o}.instancePath === undefined`,()=>t.assign((0,le._)`${o}.instancePath`,(0,le.strConcat)(it.default.instancePath,i.errorPath))),t.assign((0,le._)`${o}.schemaPath`,(0,le.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,le._)`${o}.schema`,r),t.assign((0,le._)`${o}.data`,n))})}Ze.extendErrors=jD;function pE(t,e){let r=t.const("err",e);t.if((0,le._)`${it.default.vErrors} === null`,()=>t.assign(it.default.vErrors,(0,le._)`[${r}]`),(0,le._)`${it.default.vErrors}.push(${r})`),t.code((0,le._)`${it.default.errors}++`)}function mE(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,le._)`new ${t.ValidationError}(${e})`):(r.assign((0,le._)`${n}.errors`,e),r.return(!1))}var Rn={keyword:new le.Name("keyword"),schemaPath:new le.Name("schemaPath"),params:new le.Name("params"),propertyName:new le.Name("propertyName"),message:new le.Name("message"),schema:new le.Name("schema"),parentSchema:new le.Name("parentSchema")};function gE(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,le._)`{}`:DD(t,e,r)}function DD(t,e,r={}){let{gen:n,it:s}=t,i=[FD(s,r),MD(t,r)];return HD(t,e,i),n.object(...i)}function FD({errorPath:t},{instancePath:e}){let r=e?(0,le.str)`${t}${(0,Ja.getErrorPath)(e,Ja.Type.Str)}`:t;return[it.default.instancePath,(0,le.strConcat)(it.default.instancePath,r)]}function MD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,le.str)`${e}/${t}`;return r&&(s=(0,le.str)`${s}${(0,Ja.getErrorPath)(r,Ja.Type.Str)}`),[Rn.schemaPath,s]}function HD(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:f}=a;n.push([Rn.keyword,s],[Rn.params,typeof e=="function"?e(t):e||(0,le._)`{}`]),l.messages&&n.push([Rn.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([Rn.schema,o],[Rn.parentSchema,(0,le._)`${c}${f}`],[it.default.data,i]),u&&n.push([Rn.propertyName,u])}});var _E=E(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.boolOrEmptySchema=cs.topBoolOrEmptySchema=void 0;var VD=Ti(),zD=W(),UD=Nt(),BD={message:"boolean schema is false"};function GD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?yE(t,!1):typeof r=="object"&&r.$async===!0?e.return(UD.default.data):(e.assign((0,zD._)`${n}.errors`,null),e.return(!0))}cs.topBoolOrEmptySchema=GD;function WD(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),yE(t)):r.var(e,!0)}cs.boolOrEmptySchema=WD;function yE(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,VD.reportError)(s,BD,void 0,e)}});var ad=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.getRules=fs.isJSONType=void 0;var JD=["string","number","integer","boolean","null","object","array"],KD=new Set(JD);function YD(t){return typeof t=="string"&&KD.has(t)}fs.isJSONType=YD;function XD(){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:{}}}fs.getRules=XD});var ld=E(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.shouldUseRule=Ur.shouldUseGroup=Ur.schemaHasRulesForType=void 0;function QD({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&SE(t,n)}Ur.schemaHasRulesForType=QD;function SE(t,e){return e.rules.some(r=>EE(t,r))}Ur.shouldUseGroup=SE;function EE(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ur.shouldUseRule=EE});var $i=E(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;var ZD=ad(),eF=ld(),tF=Ti(),Z=W(),bE=ee(),ds;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ds||(et.DataType=ds={}));function rF(t){let e=vE(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}et.getSchemaTypes=rF;function vE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(ZD.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}et.getJSONTypes=vE;function nF(t,e){let{gen:r,data:n,opts:s}=t,i=sF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,eF.schemaHasRulesForType)(t,e[0]));if(o){let a=cd(e,n,s.strictNumbers,ds.Wrong);r.if(a,()=>{i.length?iF(t,e,i):fd(t)})}return o}et.coerceAndCheckDataType=nF;var wE=new Set(["string","number","integer","boolean","null"]);function sF(t,e){return e?t.filter(r=>wE.has(r)||e==="array"&&r==="array"):[]}function iF(t,e,r){let{gen:n,data:s,opts:i}=t,o=n.let("dataType",(0,Z._)`typeof ${s}`),a=n.let("coerced",(0,Z._)`undefined`);i.coerceTypes==="array"&&n.if((0,Z._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,Z._)`${s}[0]`).assign(o,(0,Z._)`typeof ${s}`).if(cd(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,Z._)`${a} !== undefined`);for(let u of r)(wE.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);n.else(),fd(t),n.endIf(),n.if((0,Z._)`${a} !== undefined`,()=>{n.assign(s,a),oF(t,a)});function l(u){switch(u){case"string":n.elseIf((0,Z._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,Z._)`"" + ${s}`).elseIf((0,Z._)`${s} === null`).assign(a,(0,Z._)`""`);return;case"number":n.elseIf((0,Z._)`${o} == "boolean" || ${s} === null
|
|
51
|
+
`),J=fL.bind(null,{[j0]:"",[D0]:o,[M0]:C,[F0]:cf,[ff]:$,[H0]:v}),U="";f!==null&&(p===void 0?U=J(f):U=J(Object.assign({},f,{name:p})));let H=a instanceof Function?a:a?W0:NL,fe=H().indexOf(":")+1;if(b&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(w&&typeof w!="string")throw Error(`Unknown msgPrefix type "${typeof w}" - expected "string"`);iL(h,d,b);let ze=B0(d,b);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:ze,messageKey:l,errorKey:u}}),lL(m);let G=aL(m);return Object.assign(e,{levels:ze,[TL]:G,[$L]:b,[_L]:n,[gL]:H,[yL]:fe,[F0]:cf,[ff]:$,[M0]:C,[EL]:M,[bL]:k,[vL]:l,[wL]:u,[RL]:c,[AL]:c?`,${JSON.stringify(c)}:{`:"",[D0]:o,[OL]:g,[CL]:S,[j0]:U,[H0]:v,[PL]:y,silent:hL,onChild:O,[IL]:w}),Object.setPrototypeOf(e,nL()),oL(e),e[SL](h),e}Ct.exports=df;Ct.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=q0(t.dest||process.stdout.fd),L0(t)):L0({dest:q0(t),minLength:0});Ct.exports.transport=Gc();Ct.exports.multistream=x0();Ct.exports.levels=B0();Ct.exports.stdSerializers=DL;Ct.exports.stdTimeFunctions=Object.assign({},z0);Ct.exports.symbols=U0;Ct.exports.version=pL;Ct.exports.default=df;Ct.exports.pino=df});var X0=E((pK,Y0)=>{"use strict";var pa=J0(),{serializersSym:K0}=pa.symbols,{FST_ERR_LOG_INVALID_DESTINATION:FL}=He();function ML(t){if(t.stream&&t.file)throw new FL;t.file&&(t.stream=pa.destination(t.file),delete t.file);let e=t.logger,r=t.genReqId,n=null;return e?(t.logger=void 0,t.genReqId=void 0,e[K0]&&(t.serializers=Object.assign({},t.serializers,e[K0])),n=e.child({},t),t.logger=e,t.genReqId=r):n=pa(t,t.stream),n}var HL={req:function(e){return{method:e.method,url:e.url,version:e.headers&&e.headers["accept-version"],host:e.host,remoteAddress:e.ip,remotePort:e.socket?e.socket.remotePort:void 0}},err:pa.stdSerializers.err,res:function(e){return{statusCode:e.statusCode}}};Y0.exports={serializers:HL,createPinoLogger:ML}});var ai=E((mK,Z0)=>{"use strict";var{FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:VL,FST_ERR_LOG_INVALID_LOGGER_CONFIG:zL,FST_ERR_LOG_INVALID_LOGGER_INSTANCE:UL,FST_ERR_LOG_INVALID_LOGGER:BL}=He();function GL(t,e,r,n,s){let i={[t.requestIdLogLabel]:n},o=t.childLoggerFactory.call(t.server,e,i,s||{},r);return t.childLoggerFactory!==Q0&&ma(o,!0),o}function Q0(t,e,r){return t.child(e,r)}function ma(t,e){let r=["info","error","debug","fatal","warn","trace","child"],n=t?r.filter(s=>!t[s]||typeof t[s]!="function"):r;if(n.length){if(n.length===r.length&&!e)return!1;throw BL(n.join(","))}else return!0}function WL(t){if(t.logger&&t.loggerInstance)throw new VL;if(!t.loggerInstance&&!t.logger){let o=Wy();return o.child=()=>o,{logger:o,hasLogger:!1}}let{createPinoLogger:e,serializers:r}=X0();if(ma(t.loggerInstance))return{logger:e({logger:t.loggerInstance,serializers:Object.assign({},r,t.loggerInstance.serializers)}),hasLogger:!0};if(ma(t.logger))throw zL();if(t.loggerInstance)throw UL();let n={};return Object.prototype.toString.call(t.logger)==="[object Object]"&&Reflect.ownKeys(t.logger).forEach(i=>{Object.defineProperty(n,i,{value:t.logger[i],writable:!0,enumerable:!0,configurable:!0})}),n.level=n.level||"info",n.serializers=Object.assign({},r,n.serializers),t.logger=n,{logger:e(t.logger),hasLogger:!0}}function JL(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}Z0.exports={createChildLogger:GL,defaultChildLoggerFactory:Q0,createLogger:WL,validateLogger:ma,now:JL}});var ga=E((gK,eS)=>{"use strict";eS.exports=KL;function rs(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function KL(t){if(t=t||{},t.circles)return YL(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,a)=>new Map(n(Array.from(o),a))),e.set(Set,(o,a)=>new Set(n(Array.from(o),a))),t.constructorHandlers)for(let o of t.constructorHandlers)e.set(o[0],o[1]);let r=null;return t.proto?i:s;function n(o,a){let l=Object.keys(o),u=new Array(l.length);for(let c=0;c<l.length;c++){let f=l[c],p=o[f];typeof p!="object"||p===null?u[f]=p:p.constructor!==Object&&(r=e.get(p.constructor))?u[f]=r(p,a):ArrayBuffer.isView(p)?u[f]=rs(p):u[f]=a(p)}return u}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,s);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,s);let a={};for(let l in o){if(Object.hasOwnProperty.call(o,l)===!1)continue;let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,s):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=s(u)}return a}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,i);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,i);let a={};for(let l in o){let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,i):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=i(u)}return a}}function YL(t){let e=[],r=[],n=new Map;if(n.set(Date,l=>new Date(l)),n.set(Map,(l,u)=>new Map(i(Array.from(l),u))),n.set(Set,(l,u)=>new Set(i(Array.from(l),u))),t.constructorHandlers)for(let l of t.constructorHandlers)n.set(l[0],l[1]);let s=null;return t.proto?a:o;function i(l,u){let c=Object.keys(l),f=new Array(c.length);for(let p=0;p<c.length;p++){let h=c[p],d=l[h];if(typeof d!="object"||d===null)f[h]=d;else if(d.constructor!==Object&&(s=n.get(d.constructor)))f[h]=s(d,u);else if(ArrayBuffer.isView(d))f[h]=rs(d);else{let m=e.indexOf(d);m!==-1?f[h]=r[m]:f[h]=u(d)}}return f}function o(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,o);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,o);let u={};e.push(l),r.push(u);for(let c in l){if(Object.hasOwnProperty.call(l,c)===!1)continue;let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,o);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=o(f)}}return e.pop(),r.pop(),u}function a(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,a);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,a);let u={};e.push(l),r.push(u);for(let c in l){let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,a);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=a(f)}}return e.pop(),r.pop(),u}}});var li=E((yK,iS)=>{"use strict";var XL=ga()({circles:!1,proto:!0}),{kSchemaVisited:tS,kSchemaResponse:QL}=De(),hf=Symbol.for("fluent-schema-object"),{FST_ERR_SCH_MISSING_ID:ZL,FST_ERR_SCH_ALREADY_PRESENT:eq,FST_ERR_SCH_DUPLICATE:tq,FST_ERR_SCH_CONTENT_MISSING_SCHEMA:rS}=He(),sS=["params","body","querystring","query","headers"];function ya(t){this.store=t||{}}ya.prototype.add=function(t){let e=XL(t.isFluentSchema||t.isFluentJSONSchema||t[hf]?t.valueOf():t),r=e.$id;if(!r)throw new ZL;if(this.store[r])throw new eq(r);this.store[r]=e};ya.prototype.getSchemas=function(){return Object.assign({},this.store)};ya.prototype.getSchema=function(t){return this.store[t]};function nS(t){return typeof t=="object"&&Object.getPrototypeOf(t)!==Object.prototype}function rq(t,e){if(t[tS])return t;if(t.query){if(t.querystring)throw new tq("querystring");t.querystring=t.query}nq(t);for(let r of sS){let n=t[r];if(n&&!nS(n)&&r==="body"&&n.content){let s=n.content,i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new rS(a)}continue}}if(t.response){let r=Object.keys(t.response);for(let n of r){if(nS(t.response[n]))continue;let s=t.response[n].content;if(s){let i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new rS(a)}}}}return t[tS]=!0,t}function nq(t){for(let e of sS)t[e]&&(t[e].isFluentSchema||t[e][hf])&&(t[e]=t[e].valueOf());if(t.response){let e=Object.keys(t.response);for(let r of e)(t.response[r].isFluentSchema||t.response[r][hf])&&(t.response[r]=t.response[r].valueOf())}}function sq(t,e,r){let n=t[QL];if(!n)return!1;if(n[e]){if(n[e].constructor===Object&&r){let i=r.split(";",1)[0];return n[e][i]?n[e][i]:n[e]["*/*"]?n[e]["*/*"]:!1}return n[e]}let s=(e+"")[0]+"xx";if(n[s]){if(n[s].constructor===Object&&r){let i=r.split(";",1)[0];return n[s][i]?n[s][i]:n[s]["*/*"]?n[s]["*/*"]:!1}return n[s]}if(n.default){if(n.default.constructor===Object&&r){let i=r.split(";",1)[0];return n.default[i]?n.default[i]:n.default["*/*"]?n.default["*/*"]:!1}return n.default}return!1}iS.exports={buildSchemas(t){return new ya(t)},getSchemaSerializer:sq,normalizeSchema:rq}});var _a=E((_K,aS)=>{"use strict";var iq=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;aS.exports=class oS{constructor(e){switch(e&&e.rounding){case"floor":this.parseInteger=Math.floor;break;case"ceil":this.parseInteger=Math.ceil;break;case"round":this.parseInteger=Math.round;break;case"trunc":default:this.parseInteger=Math.trunc;break}this._options=e}asInteger(e){if(Number.isInteger(e))return""+e;if(typeof e=="bigint")return e.toString();let r=this.parseInteger(e);if(r===1/0||r===-1/0||r!==r)throw new Error(`The value "${e}" cannot be converted to an integer.`);return""+r}asNumber(e){let r=Number(e);if(r!==r)throw new Error(`The value "${e}" cannot be converted to a number.`);return r===1/0||r===-1/0?"null":""+r}asBoolean(e){return e&&"true"||"false"}asDateTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+e.toISOString()+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date-time.`)}asDate(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date.`)}asTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(11,19)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a time.`)}asString(e){let r=e.length;if(r===0)return'""';if(r<42){let n="",s=-1,i=255;for(let o=0;o<r;o++)if(i=e.charCodeAt(o),i===34||i===92)s===-1&&(s=0),n+=e.slice(s,o)+"\\",s=o;else if(i<32||i>=55296&&i<=57343)return JSON.stringify(e);return s===-1&&'"'+e+'"'||'"'+n+e.slice(s)+'"'}else return r<5e3&&iq.test(e)===!1?'"'+e+'"':JSON.stringify(e)}asUnsafeString(e){return'"'+e+'"'}getState(){return this._options}static restoreFromState(e){return new oS(e)}}});var uS=E((SK,lS)=>{"use strict";var oq=_a(),aq={mode:"standalone"},lq=oq.restoreFromState(aq),uq=null;lS.exports=function(e,r){let{asString:n,asNumber:s,asBoolean:i,asDateTime:o,asDate:a,asTime:l,asUnsafeString:u}=r,c=r.asInteger.bind(r),f="{",p="}",h="[",d="]",m=",",g=":",S='"',b=f+p,_=h+d,y=S+S,R="null";function T(w){let $=w&&typeof w.toJSON=="function"?w.toJSON():w;if($===null)return b;let v,P=f,C=!1;return v=$.statusCode,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"statusCode":',P+=s(v)),v=$.code,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"code":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.error,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"error":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.message,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"message":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),P+p}return T}(uq,lq)});var ui=E((EK,hS)=>{"use strict";var cS=V("node:http").STATUS_CODES,cq=dc(),{setErrorStatusCode:fq}=Uo(),{kReplyHeaders:_n,kReplyNextErrorHandler:Sa,kReplyIsRunningOnErrorHook:dq,kRouteContext:dS,kDisableRequestLogging:Ea}=De(),{FST_ERR_REP_INVALID_PAYLOAD_TYPE:hq,FST_ERR_FAILED_ERROR_SERIALIZATION:pq}=He(),{getSchemaSerializer:mq}=li(),pf=uS(),gq={func:_q,toJSON(){return this.func.name.toString()+"()"}};function yq(t,e,r){t[dq]=!1;let n=t[dS];if(t[Sa]===!1){fS(e,t,function(o,a){try{o.raw.writeHead(o.raw.statusCode,o[_n])}catch(l){o.log[Ea]||o.log.warn({req:o.request,res:o,err:l},l?.message),o.raw.writeHead(o.raw.statusCode)}o.raw.end(a)});return}let s=t[Sa]||n.errorHandler;t[Sa]=Object.getPrototypeOf(s),delete t[_n]["content-type"],delete t[_n]["content-length"];let i=s.func;if(!i){t[Sa]=!1,fS(e,t,r);return}try{let o=i(e,t.request,t);o!==void 0&&(o!==null&&typeof o.then=="function"?cq(o,t):t.send(o))}catch(o){t.send(o)}}function _q(t,e,r){Eq(t,r),fq(r,t),r.statusCode<500?r.log[Ea]||r.log.info({res:r,err:t},t?.message):r.log[Ea]||r.log.error({req:e,res:r,err:t},t?.message),r.send(t)}function fS(t,e,r){let n=e.raw,s=e.statusCode;e[_n]["content-type"]=e[_n]["content-type"]??"application/json; charset=utf-8";let i;try{let o=mq(e[dS],s,e[_n]["content-type"]);o===!1?i=pf({error:cS[s+""],code:t.code,message:t.message,statusCode:s}):i=o(Object.create(t,{error:{value:cS[s+""]},message:{value:t.message},statusCode:{value:s}}))}catch(o){e.log[Ea]||e.log.error({err:o,statusCode:n.statusCode},"The serializer for the given status code failed"),e.code(500),i=pf(new pq(o.message,t.message))}typeof i!="string"&&!Buffer.isBuffer(i)&&(i=pf(new hq(typeof i))),e[_n]["content-length"]=""+Buffer.byteLength(i),r(e,i)}function Sq(t=gq,e){if(!e)return t;let r=Object.create(t);return r.func=e,r}function Eq(t,e){let r=e.raw,n=r.statusCode;n=n>=400?n:500,t!=null&&(t.headers!==void 0&&e.headers(t.headers),t.status>=400?n=t.status:t.statusCode>=400&&(n=t.statusCode)),r.statusCode=n}hS.exports={buildErrorHandler:Sq,handleError:yq}});var di=E((bK,yS)=>{"use strict";var{kReply:mf,kRequest:gf,kState:bq,kHasBeenDecorated:vq}=De(),{FST_ERR_DEC_ALREADY_PRESENT:pS,FST_ERR_DEC_MISSING_DEPENDENCY:wq,FST_ERR_DEC_AFTER_START:Rq,FST_ERR_DEC_REFERENCE_TYPE:Oq,FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:Tq,FST_ERR_DEC_UNDECLARED:$q}=He();function Pq(t,e,r,n){if(Object.hasOwn(t,e))throw new pS(e);yf(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(t,e,{get:r.getter,set:r.setter}):t[e]=r}function Aq(t){if(!ci(this,t))throw new $q(t,"instance");return typeof this[t]=="function"?this[t].bind(this):this[t]}function mS(t,e,r,n){let s=t.prototype;if(Object.hasOwn(s,e)||fi(t,e))throw new pS(e);t[vq]=!0,yf(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(s,e,{get:r.getter,set:r.setter}):typeof r=="function"?s[e]=r:t.props.push({key:e,value:r})}function gS(t,e){if(typeof e=="object"&&e&&!(typeof e.getter=="function"||typeof e.setter=="function"))throw new Oq(t,typeof e)}function Cq(t,e,r){return _f(this,t),Pq(this,t,e,r),this}function ci(t,e){return e?e in t||t.prototype&&e in t.prototype||fi(t,e):t in this}function fi(t,e){return t.props?t.props.find(({key:r})=>r===e):!1}function Iq(t){return t&&fi(this[gf],t)?!0:ci(this[gf].prototype,t)}function Nq(t){return t&&fi(this[mf],t)?!0:ci(this[mf].prototype,t)}function yf(t,e,r){if(r!=null){if(!Array.isArray(r))throw new Tq(e);for(let n=0;n!==r.length;++n)if(!ci(t,r[n]))throw new wq(r[n])}}function kq(t,e,r){return _f(this,t),gS(t,e),mS(this[mf],t,e,r),this}function xq(t,e,r){return _f(this,t),gS(t,e),mS(this[gf],t,e,r),this}function _f(t,e){if(t[bq].started)throw new Rq(e)}yS.exports={add:Cq,exist:ci,existRequest:Iq,existReply:Nq,dependencies:yf,decorateReply:kq,decorateRequest:xq,getInstanceDecorator:Aq,hasKey:fi}});var Pa=E((vK,$a)=>{"use strict";var ba=V("node:stream").finished,{kFourOhFourContext:_S,kReplyErrorHandlerCalled:OS,kReplyHijacked:wf,kReplyStartTime:pi,kReplyEndTime:Rf,kReplySerializer:_r,kReplySerializerDefault:va,kReplyIsError:wa,kReplyHeaders:ge,kReplyTrailers:Ve,kReplyHasStatusCode:Of,kReplyIsRunningOnErrorHook:Tf,kReplyNextErrorHandler:Lq,kDisableRequestLogging:TS,kSchemaResponse:Ra,kReplyCacheSerializeFns:Hr,kSchemaController:Sf,kOptions:qq,kRouteContext:ne}=De(),{onSendHookRunner:$S,onResponseHookRunner:jq,preHandlerHookRunner:Dq,preSerializationHookRunner:Fq}=Dr(),SS=Sc()[Symbol.for("internals")],Mq=ai(),vf=Mq.now,{handleError:ES}=ui(),{getSchemaSerializer:Hq}=li(),Ef={JSON:"application/json; charset=utf-8",PLAIN:"text/plain; charset=utf-8",OCTET:"application/octet-stream"},{FST_ERR_REP_INVALID_PAYLOAD_TYPE:Vq,FST_ERR_REP_RESPONSE_BODY_CONSUMED:zq,FST_ERR_REP_READABLE_STREAM_LOCKED:Uq,FST_ERR_REP_ALREADY_SENT:Bq,FST_ERR_SEND_INSIDE_ONERR:Gq,FST_ERR_BAD_STATUS_CODE:Wq,FST_ERR_BAD_TRAILER_NAME:Jq,FST_ERR_BAD_TRAILER_VALUE:Kq,FST_ERR_MISSING_SERIALIZATION_FN:Yq,FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:Xq,FST_ERR_DEC_UNDECLARED:Qq}=He(),bS=di(),PS=Object.prototype.toString;function ye(t,e,r){this.raw=t,this[_r]=null,this[OS]=!1,this[wa]=!1,this[Tf]=!1,this.request=e,this[ge]={},this[Ve]=null,this[Of]=!1,this[pi]=void 0,this.log=r}ye.props=[];Object.defineProperties(ye.prototype,{[ne]:{get(){return this.request[ne]}},elapsedTime:{get(){return this[pi]===void 0?0:(this[Rf]||vf())-this[pi]}},server:{get(){return this.request[ne].server}},sent:{enumerable:!0,get(){return(this[wf]||this.raw.writableEnded)===!0}},statusCode:{get(){return this.raw.statusCode},set(t){this.code(t)}},routeOptions:{get(){return this.request.routeOptions}}});ye.prototype.writeEarlyHints=function(t,e){return this.raw.writeEarlyHints(t,e),this};ye.prototype.hijack=function(){return this[wf]=!0,this};ye.prototype.send=function(t){if(this[Tf])throw new Gq;if(this.sent===!0)return this.log.warn({err:new Bq(this.request.url,this.request.method)}),this;if(this[wa]||t instanceof Error)return this[wa]=!1,ns(this,t,Sn),this;if(t===void 0)return Sn(this,t),this;let e=this.getHeader("content-type"),r=e!==void 0;if(t!==null){if(typeof t.pipe=="function"||typeof t.getReader=="function"||PS.call(t)==="[object Response]")return Sn(this,t),this;if(t.buffer instanceof ArrayBuffer){r||(this[ge]["content-type"]=Ef.OCTET);let n=Buffer.isBuffer(t)?t:Buffer.from(t.buffer,t.byteOffset,t.byteLength);return Sn(this,n),this}if(!r&&typeof t=="string")return this[ge]["content-type"]=Ef.PLAIN,Sn(this,t),this}if(this[_r]!==null){if(typeof t!="string")return vS(this,t),this;t=this[_r](t)}else if(!r||e.indexOf("json")!==-1){if(!r)this[ge]["content-type"]=Ef.JSON;else if(e.indexOf("charset")===-1){let n=e.trim();n.endsWith(";")?this[ge]["content-type"]=`${n} charset=utf-8`:this[ge]["content-type"]=`${n}; charset=utf-8`}if(typeof t!="string")return vS(this,t),this}return Sn(this,t),this};ye.prototype.getHeader=function(t){t=t.toLowerCase();let e=this[ge][t];return e!==void 0?e:this.raw.getHeader(t)};ye.prototype.getHeaders=function(){return{...this.raw.getHeaders(),...this[ge]}};ye.prototype.hasHeader=function(t){return t=t.toLowerCase(),this[ge][t]!==void 0||this.raw.hasHeader(t)};ye.prototype.removeHeader=function(t){return delete this[ge][t.toLowerCase()],this};ye.prototype.header=function(t,e=""){return t=t.toLowerCase(),this[ge][t]&&t==="set-cookie"?(typeof this[ge][t]=="string"&&(this[ge][t]=[this[ge][t]]),Array.isArray(e)?Array.prototype.push.apply(this[ge][t],e):this[ge][t].push(e)):this[ge][t]=e,this};ye.prototype.headers=function(t){let e=Object.keys(t);for(let r=0;r!==e.length;++r){let n=e[r];this.header(n,t[n])}return this};var Zq=new Set(["transfer-encoding","content-length","host","cache-control","max-forwards","te","authorization","set-cookie","content-encoding","content-type","content-range","trailer"]);ye.prototype.trailer=function(t,e){if(t=t.toLowerCase(),Zq.has(t))throw new Jq(t);if(typeof e!="function")throw new Kq(t,typeof e);return this[Ve]===null&&(this[Ve]={}),this[Ve][t]=e,this};ye.prototype.hasTrailer=function(t){return this[Ve]?.[t.toLowerCase()]!==void 0};ye.prototype.removeTrailer=function(t){return this[Ve]===null?this:(this[Ve][t.toLowerCase()]=void 0,this)};ye.prototype.code=function(t){let e=+t;if(!(e>=100&&e<=599))throw new Wq(t||String(t));return this.raw.statusCode=e,this[Of]=!0,this};ye.prototype.status=ye.prototype.code;ye.prototype.getSerializationFunction=function(t,e){let r;return typeof t=="string"||typeof t=="number"?typeof e=="string"?r=this[ne][Ra]?.[t]?.[e]:r=this[ne][Ra]?.[t]:typeof t=="object"&&(r=this[ne][Hr]?.get(t)),r};ye.prototype.compileSerializationSchema=function(t,e=null,r=null){let{request:n}=this,{method:s,url:i}=n;if(this[ne][Hr]?.has(t))return this[ne][Hr].get(t);let a=(this[ne].serializerCompiler||this.server[Sf].serializerCompiler||this.server[Sf].setupSerializer(this.server[qq])||this.server[Sf].serializerCompiler)({schema:t,method:s,url:i,httpStatus:e,contentType:r});return this[ne][Hr]==null&&(this[ne][Hr]=new WeakMap),this[ne][Hr].set(t,a),a};ye.prototype.serializeInput=function(t,e,r,n){let s=r,i;if(r=typeof e=="string"||typeof e=="number"?e:r,n=r&&s!==r?s:n,r!=null){if(n!=null?i=this[ne][Ra]?.[r]?.[n]:i=this[ne][Ra]?.[r],i==null)throw n?new Xq(r,n):new Yq(r)}else this[ne][Hr]?.has(e)?i=this[ne][Hr].get(e):i=this.compileSerializationSchema(e,r,n);return i(t)};ye.prototype.serialize=function(t){return this[_r]!==null?this[_r](t):this[ne]&&this[ne][va]?this[ne][va](t,this.raw.statusCode):CS(this[ne],t,this.raw.statusCode)};ye.prototype.serializer=function(t){return this[_r]=t,this};ye.prototype.type=function(t){return this[ge]["content-type"]=t,this};ye.prototype.redirect=function(t,e){return e||(e=this[Of]?this.raw.statusCode:302),this.header("location",t).code(e).send()};ye.prototype.callNotFound=function(){return aj(this),this};ye.prototype.then=function(t,e){if(this.sent){t();return}ba(this.raw,r=>{r&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"?e?e(r):this.log&&this.log.warn("unhandled rejection on reply.then"):t()})};ye.prototype.getDecorator=function(t){if(!bS.hasKey(this,t)&&!bS.exist(this,t))throw new Qq(t,"reply");let e=this[t];return typeof e=="function"?e.bind(this):e};function vS(t,e){t[ne].preSerialization!==null?Fq(t[ne].preSerialization,t.request,t,e,wS):wS(null,void 0,t,e)}function wS(t,e,r,n){if(t!=null){ns(r,t);return}try{r[_r]!==null?n=r[_r](n):r[ne]&&r[ne][va]?n=r[ne][va](n,r.raw.statusCode):n=CS(r[ne],n,r.raw.statusCode,r[ge]["content-type"])}catch(s){ej(s,r),ns(r,s);return}Sn(r,n)}function ej(t,e){t.serialization=e[ne].config}function Sn(t,e){t[ne].onSend!==null?$S(t[ne].onSend,t.request,t,e,tj):AS(t,e)}function tj(t,e,r,n){t!=null?ns(r,t):AS(r,n)}function bf(t,e){let r=t.raw;try{r.writeHead(e,t[ge])}catch(n){throw n.code==="ERR_HTTP_HEADERS_SENT"&&t.log.warn(`Reply was already sent, did you forget to "return reply" in the "${t.request.raw.url}" (${t.request.raw.method}) route?`),n}}function AS(t,e){let r=t.raw,n=t.request;if(t[Ve]!==null){let i=Object.keys(t[Ve]),o="";for(let a of i)typeof t[Ve][a]=="function"&&(o+=" ",o+=a);t.header("Transfer-Encoding","chunked"),t.header("Trailer",o.trim())}if(PS.call(e)==="[object Response]"){if(typeof e.status=="number"&&t.code(e.status),typeof e.headers=="object"&&typeof e.headers.forEach=="function")for(let[i,o]of e.headers)t.header(i,o);if(e.body!==null&&e.bodyUsed)throw new zq;e=e.body}let s=r.statusCode;if(e==null){s>=200&&s!==204&&s!==304&&n.method!=="HEAD"&&t[Ve]===null&&(t[ge]["content-length"]="0"),bf(t,s),hi(e,r,t);return}if(s>=100&&s<200||s===204){t.removeHeader("content-type"),t.removeHeader("content-length"),bf(t,s),hi(void 0,r,t),typeof e.resume=="function"&&(e.on("error",Ta),e.resume());return}if(typeof e.pipe=="function"){nj(e,r,t);return}if(typeof e.getReader=="function"){rj(e,r,t);return}if(typeof e!="string"&&!Buffer.isBuffer(e))throw new Vq(typeof e);if(t[Ve]===null){let i=t[ge]["content-length"];(!i||n.raw.method!=="HEAD"&&Number(i)!==Buffer.byteLength(e))&&(t[ge]["content-length"]=""+Buffer.byteLength(e))}bf(t,s),r.write(e),hi(e,r,t)}function Oa(t,e,r){e.code==="ERR_STREAM_PREMATURE_CLOSE"?t[TS]||t.info({res:r},"stream closed prematurely"):t.warn({err:e},"response terminated with an error with headers already sent")}function rj(t,e,r){if(t.locked)throw new Uq;let n=!0,s=!1,i=t.getReader();if(ba(e,function(l){n&&(l!=null&&e.headersSent&&!s&&(s=!0,Oa(r.log,l,e)),i.cancel().catch(Ta))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let l in r[ge])e.setHeader(l,r[ge][l]);function o(l){if(l.done){n=!1,hi(null,e,r);return}if(e.destroyed){n=!1,i.cancel().catch(Ta);return}e.write(l.value),i.read().then(o,a)}function a(l){n=!1,e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Oa(r.log,l,r)),e.destroy()):ns(r,l)}i.read().then(o,a)}function nj(t,e,r){let n=!0,s=!1;if(sj(t,e,r),ba(t,{readable:!0,writable:!1},function(i){n=!1,i!=null&&(e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Oa(r.log,i,r)),e.destroy()):ns(r,i))}),ba(e,function(i){n&&(i!=null&&e.headersSent&&!s&&(s=!0,Oa(r.log,i,e)),typeof t.destroy=="function"?t.destroy():typeof t.close=="function"?t.close(Ta):typeof t.abort=="function"?t.abort():r.log.warn("stream payload does not end properly"))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let i in r[ge])e.setHeader(i,r[ge][i]);t.pipe(e)}function hi(t,e,r){if(r[Ve]===null){e.end(null,null,null);return}let n=Object.keys(r[Ve]),s={},i=0,o=!0;function a(){i===0&&(e.addTrailers(s),e.end(null,null,null))}for(let l of n){let u=function(f,p){i++,f?r.log.debug(f):s[l]=p,process.nextTick(a)};if(typeof r[Ve][l]!="function")continue;o=!1,i--;let c=r[Ve][l](r,t,u);typeof c=="object"&&typeof c.then=="function"&&c.then(f=>u(null,f),u)}o&&e.end(null,null,null)}function sj(t,e,r){r[Ve]!==null&&t.on("end",()=>hi(null,e,r))}function ns(t,e,r){t[ne].onError!==null&&!t[Lq]?(t[Tf]=!0,$S(t[ne].onError,t.request,t,e,()=>ES(t,e,r))):ES(t,e,r)}function ij(t){t[pi]=vf();let e=r=>{t[Rf]=vf(),t.raw.removeListener("finish",e),t.raw.removeListener("error",e);let n=t[ne];n&&n.onResponse!==null?jq(n.onResponse,t.request,t,RS):RS(r,t.request,t)};t.raw.on("finish",e),t.raw.on("error",e)}function RS(t,e,r){if(r.log[TS])return;let n=r.elapsedTime;if(t!=null){r.log.error({res:r,err:t,responseTime:n},"request errored");return}r.log.info({res:r,responseTime:n},"request completed")}function oj(t){let e=t.props.slice();function r(n,s,i){this.raw=n,this[wa]=!1,this[OS]=!1,this[wf]=!1,this[_r]=null,this.request=s,this[ge]={},this[Ve]=null,this[pi]=void 0,this[Rf]=void 0,this.log=i;let o;for(let a=0;a<e.length;a++)o=e[a],this[o.key]=o.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.parent=t,r.props=e,r}function aj(t){if(t[ne][_S]===null){t.log.warn("Trying to send a NotFound error inside a 404 handler. Sending basic 404 response."),t.code(404).send("404 Not Found");return}t.request[ne]=t[ne][_S],t[ne].preHandler!==null?Dq(t[ne].preHandler,t.request,t,SS.preHandlerCallback):SS.preHandlerCallback(null,t.request,t)}function CS(t,e,r,n){let s=Hq(t,r,n);return s?s(e):JSON.stringify(e)}function Ta(){}$a.exports=ye;$a.exports.buildReply=oj;$a.exports.setupResponseListeners=ij});var IS=E((wK,Aa)=>{"use strict";function $f(t){if(!t)throw new TypeError("argument req is required");let e=t.headers["x-forwarded-for"],r=t.socket.remoteAddress;if(!e||typeof e!="string")return[r];if(e.indexOf(",")===-1){let n=e.trim();return n.length?[r,n]:[r]}else return lj(e,r)}function lj(t,e){let r=[e],n=t.length,s=n,i,o;for(o=n-1;o>=0;--o)i=t[o],i===" "?s===n&&(s=n=o):i===","?(s!==n&&r.push(t.slice(s,n)),s=n=o):s=o;return s!==n&&r.push(t.substring(s,n)),r}Aa.exports=$f;Aa.exports.default=$f;Aa.exports.forwarded=$f});var kS=E((NS,Ca)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",o="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${e}\\.${e}\\.${e}\\.${e}(${i})?$`,"i")};function l(h,d){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let m=0,g=-1,S=(h.match(a.zoneIndex)||[])[0],b,_;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)m++;if(h.substr(0,2)==="::"&&m--,h.substr(-2,2)==="::"&&m--,m>d)return null;for(_=d-m,b=":";_--;)b+="0:";return h=h.replace("::",b),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),d=function(){let y=h.split(":"),R=[];for(let T=0;T<y.length;T++)R.push(parseInt(y[T],16));return R}(),{parts:d,zoneId:S}}function u(h,d,m,g){if(h.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,b;for(;g>0;){if(b=m-g,b<0&&(b=0),h[S]>>b!==d[S]>>b)return!1;g-=m,S+=1}return!0}function c(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function f(h,d){for(;h.length<d;)h=`0${h}`;return h}let p={};p.IPv4=function(){function h(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let m,g;for(m=0;m<d.length;m++)if(g=d[m],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return u(this.octets,d.octets,8,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},S,b,_;for(S=3;S>=0;S-=1)if(b=this.octets[S],b in g){if(_=g[b],m&&_!==0)return null;_!==8&&(m=!0),d+=_}else return null;return 32-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),p.IPv4.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<4;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.isIPv4=function(h){return this.parser(h)!==null},p.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(h){return!!(p.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(h){let d=h.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(h)||!d?!1:p.IPv4.isValidFourPartDecimal(d[1])},p.IPv4.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<4;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.parse=function(h){let d=this.parser(h);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},p.IPv4.parseCIDR=function(h){let d;if(d=h.match(/^(.+)\/(\d+)$/)){let m=parseInt(d[2]);if(m>=0&&m<=32){let g=[this.parse(d[1]),m];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},p.IPv4.parser=function(h){let d,m,g;if(d=h.match(r.fourOctet))return function(){let S=d.slice(1,6),b=[];for(let _=0;_<S.length;_++)m=S[_],b.push(c(m));return b}();if(d=h.match(r.longValue)){if(g=c(d[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let S=[],b;for(b=0;b<=24;b+=8)S.push(g>>b&255);return S}().reverse()}else return(d=h.match(r.twoOctet))?function(){let S=d.slice(1,4),b=[];if(g=c(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(g>>16&255),b.push(g>>8&255),b.push(g&255),b}():(d=h.match(r.threeOctet))?function(){let S=d.slice(1,5),b=[];if(g=c(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(c(S[1])),b.push(g>>8&255),b.push(g&255),b}():null},p.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<4&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.IPv6=function(){function h(d,m){let g,S;if(d.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(d[g]<<8|d[g+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");m&&(this.zoneId=m)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return u(this.parts,d.parts,16,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},S,b;for(let _=7;_>=0;_-=1)if(S=this.parts[_],S in g){if(b=g[S],m&&b!==0)return null;b!==16&&(m=!0),d+=b}else return null;return 128-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let d,m=[],g=this.parts;for(let S=0;S<g.length;S++)d=g[S],m.push(d>>8),m.push(d&255);return m},h.prototype.toFixedLengthString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(f(this.parts[S].toString(16),4));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),m=d[0],g=d[1];return new p.IPv4([m>>8,m&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,m=this.toNormalizedString(),g=0,S=-1,b;for(;b=d.exec(m);)b[0].length>S&&(g=b.index,S=b[0].length);return S<0?m:`${m.substring(0,g)}::${m.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),p.IPv6.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<16;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},p.IPv6.isIPv6=function(h){return this.parser(h)!==null},p.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let d=this.parser(h);return new this(d.parts,d.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<16;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},p.IPv6.parse=function(h){let d=this.parser(h);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},p.IPv6.parseCIDR=function(h){let d,m,g;if((m=h.match(/^(.+)\/(\d+)$/))&&(d=parseInt(m[2]),d>=0&&d<=128))return g=[this.parse(m[1]),d],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},p.IPv6.parser=function(h){let d,m,g,S,b,_;if(g=h.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(h))return l(h,8);if((g=h.match(a.transitional))&&(_=g[6]||"",d=g[1],g[1].endsWith("::")||(d=d.slice(0,-1)),d=l(d+_,6),d.parts)){for(b=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],m=0;m<b.length;m++)if(S=b[m],!(0<=S&&S<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<16&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.fromByteArray=function(h){let d=h.length;if(d===4)return new p.IPv4(h);if(d===16)return new p.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},p.isValid=function(h){return p.IPv6.isValid(h)||p.IPv4.isValid(h)},p.isValidCIDR=function(h){return p.IPv6.isValidCIDR(h)||p.IPv4.isValidCIDR(h)},p.parse=function(h){if(p.IPv6.isValid(h))return p.IPv6.parse(h);if(p.IPv4.isValid(h))return p.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},p.parseCIDR=function(h){try{return p.IPv6.parseCIDR(h)}catch{try{return p.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},p.process=function(h){let d=this.parse(h);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},p.subnetMatch=function(h,d,m){let g,S,b,_;m==null&&(m="unicast");for(S in d)if(Object.prototype.hasOwnProperty.call(d,S)){for(b=d[S],b[0]&&!(b[0]instanceof Array)&&(b=[b]),g=0;g<b.length;g++)if(_=b[g],h.kind()===_[0].kind()&&h.match.apply(h,_))return S}return m},typeof Ca<"u"&&Ca.exports?Ca.exports=p:t.ipaddr=p})(NS)});var DS=E((RK,ss)=>{"use strict";ss.exports=Pf;ss.exports.default=Pf;ss.exports.proxyaddr=Pf;ss.exports.all=qS;ss.exports.compile=jS;var uj=IS(),LS=kS(),cj=/^\d+$/u,Ia=LS.isValid,Na=LS.parse,xS={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function qS(t,e){let r=uj(t);if(!e)return r;typeof e!="function"&&(e=jS(e));for(let n=0;n<r.length-1;n++)e(r[n],n)||(r.length=n+1);return r}function jS(t){if(!t)throw new TypeError("argument is required");let e;if(typeof t=="string")e=[t];else if(Array.isArray(t))e=t.slice();else throw new TypeError("unsupported trust argument");for(let r=0;r<e.length;r++)t=e[r],Object.hasOwn(xS,t)&&(t=xS[t],e.splice.apply(e,[r,1].concat(t)),r+=t.length-1);return dj(fj(e))}function fj(t){let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=hj(t[r]);return e}function dj(t){let e=t.length;return e===0?mj:e===1?yj(t[0]):gj(t)}function hj(t){let e=t.lastIndexOf("/"),r=e!==-1?t.substring(0,e):t;if(!Ia(r))throw new TypeError("invalid IP address: "+r);let n=Na(r);e===-1&&n.kind()==="ipv6"&&n.isIPv4MappedAddress()&&(n=n.toIPv4Address());let s=n.kind()==="ipv6"?128:32,i=e!==-1?t.substring(e+1,t.length):null;if(i===null?i=s:cj.test(i)?i=parseInt(i,10):n.kind()==="ipv4"&&Ia(i)?i=pj(i):i=null,i<=0||i>s)throw new TypeError("invalid range on address: "+t);return[n,i]}function pj(t){let e=Na(t);return e.kind()==="ipv4"?e.prefixLengthFromSubnetMask():null}function Pf(t,e){if(!t)throw new TypeError("req argument is required");if(!e)throw new TypeError("trust argument is required");let r=qS(t,e);return r[r.length-1]}function mj(){return!1}function gj(t){return function(r){if(!Ia(r))return!1;let n=Na(r),s,i=n.kind();for(let o=0;o<t.length;o++){let a=t[o],l=a[0],u=l.kind(),c=a[1],f=n;if(i!==u){let p=u==="ipv4";if(p&&!n.isIPv4MappedAddress())continue;s||(s=p?n.toIPv4Address():n.toIPv4MappedAddress()),f=s}if(f.match(l,c))return!0}return!1}}function yj(t){let e=t[0],r=e.kind(),n=r==="ipv4",s=t[1];return function(o){if(!Ia(o))return!1;let a=Na(o);if(a.kind()!==r){if(n&&!a.isIPv4MappedAddress())return!1;a=n?a.toIPv4Address():a.toIPv4MappedAddress()}return a.match(e,s)}}});var xa=E((OK,Nf)=>{"use strict";var ka=DS(),{kHasBeenDecorated:_j,kSchemaBody:Sj,kSchemaHeaders:Ej,kSchemaParams:bj,kSchemaQuerystring:FS,kSchemaController:Af,kOptions:vj,kRequestCacheValidateFns:Vr,kRouteContext:Xe,kRequestOriginalUrl:Cf}=De(),{FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:wj,FST_ERR_DEC_UNDECLARED:Rj}=He(),MS=di(),HS={body:Sj,headers:Ej,params:bj,querystring:FS,query:FS};function If(t,e,r,n,s,i){this.id=t,this[Xe]=i,this.params=e,this.raw=r,this.query=n,this.log=s,this.body=void 0}If.props=[];function Oj(t){if(typeof t=="function")return t;if(t===!0)return null;if(typeof t=="number")return function(e,r){return r<t};if(typeof t=="string"){let e=t.split(",").map(r=>r.trim());return ka.compile(e)}return ka.compile(t)}function Tj(t,e){return e?$j(t,e):US(t)}function US(t){let e=t.props.slice();function r(n,s,i,o,a,l){this.id=n,this[Xe]=l,this.params=s,this.raw=i,this.query=o,this.log=a,this.body=void 0;let u;for(let c=0;c<e.length;c++)u=e[c],this[u.key]=u.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.props=e,r.parent=t,r}function VS(t){let e=t.lastIndexOf(",");return e===-1?t.trim():t.slice(e+1).trim()}function $j(t,e){let r=US(t),n=Oj(e);return r[_j]=!0,Object.defineProperties(r.prototype,{ip:{get(){let s=ka.all(this.raw,n);return s[s.length-1]}},ips:{get(){return ka.all(this.raw,n)}},host:{get(){return this.ip!==void 0&&this.headers["x-forwarded-host"]?VS(this.headers["x-forwarded-host"]):this.headers.host??this.headers[":authority"]??""}},protocol:{get(){if(this.headers["x-forwarded-proto"])return VS(this.headers["x-forwarded-proto"]);if(this.socket)return this.socket.encrypted?"https":"http"}}}),r}function zS(t,e){if(!MS.hasKey(t,e)&&!MS.exist(t,e))throw new Rj(e,"request")}Object.defineProperties(If.prototype,{server:{get(){return this[Xe].server}},url:{get(){return this.raw.url}},originalUrl:{get(){return this[Cf]||(this[Cf]=this.raw.originalUrl||this.raw.url),this[Cf]}},method:{get(){return this.raw.method}},routeOptions:{get(){let t=this[Xe],e=t._parserOptions.limit,r=t.server.initialConfig.bodyLimit,n=t.server.hasConstraintStrategy("version")?this.raw.headers["accept-version"]:void 0;return{method:t.config?.method,url:t.config?.url,bodyLimit:e||r,attachValidation:t.attachValidation,logLevel:t.logLevel,exposeHeadRoute:t.exposeHeadRoute,prefixTrailingSlash:t.prefixTrailingSlash,handler:t.handler,config:t.config,schema:t.schema,version:n}}},is404:{get(){return this[Xe].config?.url===void 0}},socket:{get(){return this.raw.socket}},ip:{get(){if(this.socket)return this.socket.remoteAddress}},host:{get(){return this.raw.headers.host??this.raw.headers[":authority"]??""}},hostname:{get(){return this.host[0]==="["?this.host.slice(0,this.host.indexOf("]")+1):this.host.split(":",1)[0]}},port:{get(){let t=parseInt(this.host.split(":").slice(-1)[0]);if(!isNaN(t))return t;let e=this.headers.host??this.headers[":authority"]??"",r=parseInt(e.split(":").slice(-1)[0]);return isNaN(r)?null:r}},protocol:{get(){if(this.socket)return this.socket.encrypted?"https":"http"}},headers:{get(){return this.additionalHeaders?Object.assign({},this.raw.headers,this.additionalHeaders):this.raw.headers},set(t){this.additionalHeaders=t}},getValidationFunction:{value:function(t){if(typeof t=="string"){let e=HS[t];return this[Xe][e]}else if(typeof t=="object")return this[Xe][Vr]?.get(t)}},compileValidationSchema:{value:function(t,e=null){let{method:r,url:n}=this;if(this[Xe][Vr]?.has(t))return this[Xe][Vr].get(t);let i=(this[Xe].validatorCompiler||this.server[Af].validatorCompiler||this.server[Af].setupValidator(this.server[vj])||this.server[Af].validatorCompiler)({schema:t,method:r,url:n,httpPart:e});return this[Xe][Vr]==null&&(this[Xe][Vr]=new WeakMap),this[Xe][Vr].set(t,i),i}},validateInput:{value:function(t,e,r){r=typeof e=="string"?e:r;let n=r!=null&&typeof r=="string"&&HS[r],s;if(n&&(s=this[Xe][n]),s==null&&(e==null||typeof e!="object"||Array.isArray(e)))throw new wj(r);return s==null&&(this[Xe][Vr]?.has(e)?s=this[Xe][Vr].get(e):s=this.compileValidationSchema(e,r)),s(t)}},getDecorator:{value:function(t){zS(this,t);let e=this[t];return typeof e=="function"?e.bind(this):e}},setDecorator:{value:function(t,e){zS(this,t),this[t]=e}}});Nf.exports=If;Nf.exports.buildRequest=Tj});var La=E((TK,BS)=>{"use strict";var{kFourOhFourContext:Pj,kReplySerializerDefault:Aj,kSchemaErrorFormatter:Cj,kErrorHandler:Ij,kChildLoggerFactory:Nj,kOptions:kj,kReply:xj,kRequest:Lj,kBodyLimit:qj,kLogLevel:jj,kContentTypeParser:Dj,kRouteByFastify:Fj,kRequestCacheValidateFns:Mj,kReplyCacheSerializeFns:Hj}=De();function Vj({schema:t,handler:e,config:r,requestIdLogLabel:n,childLoggerFactory:s,errorHandler:i,bodyLimit:o,logLevel:a,logSerializers:l,attachValidation:u,validatorCompiler:c,serializerCompiler:f,replySerializer:p,schemaErrorFormatter:h,exposeHeadRoute:d,prefixTrailingSlash:m,server:g,isFastify:S}){this.schema=t,this.handler=e,this.Reply=g[xj],this.Request=g[Lj],this.contentTypeParser=g[Dj],this.onRequest=null,this.onSend=null,this.onError=null,this.onTimeout=null,this.preHandler=null,this.onResponse=null,this.preSerialization=null,this.onRequestAbort=null,this.config=r,this.errorHandler=i||g[Ij],this.requestIdLogLabel=n||g[kj].requestIdLogLabel,this.childLoggerFactory=s||g[Nj],this._middie=null,this._parserOptions={limit:o||g[qj]},this.exposeHeadRoute=d,this.prefixTrailingSlash=m,this.logLevel=a||g[jj],this.logSerializers=l,this[Pj]=null,this.attachValidation=u,this[Aj]=p,this.schemaErrorFormatter=h||g[Cj]||zj,this[Fj]=S,this[Mj]=null,this[Hj]=null,this.validatorCompiler=c||null,this.serializerCompiler=f||null,this.server=g}function zj(t,e){let r="",n=", ";for(let s=0;s!==t.length;++s){let i=t[s];r+=e+(i.instancePath||"")+" "+i.message+n}return new Error(r.slice(0,-n.length))}BS.exports=Vj});var WS=E(sr=>{"use strict";var kf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},xf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},mi=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}},qa=class{constructor(){this.records={}}initForCache(e,r){this.records[e]={[r]:{cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}}resetForCache(e){for(let r of Object.keys(this.records[e]))this.records[e][r]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}getStatistics(){return this.records}};function GS(t){return`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")}`}var Lf=class{constructor(e,r,n){this.cacheId=e,this.statisticTtlInHours=r,this.collectionStart=new Date,this.currentTimeStamp=GS(this.collectionStart),this.records=n||new qa,this.records.initForCache(this.cacheId,this.currentTimeStamp)}get currentRecord(){return this.records.records[this.cacheId][this.currentTimeStamp]||(this.records.records[this.cacheId][this.currentTimeStamp]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,sets:0,invalidateOne:0,invalidateAll:0}),this.records.records[this.cacheId][this.currentTimeStamp]}hoursPassed(){return(Date.now()-this.collectionStart)/1e3/60/60}addHit(){this.archiveIfNeeded(),this.currentRecord.hits++}addFalsyHit(){this.archiveIfNeeded(),this.currentRecord.falsyHits++}addEmptyHit(){this.archiveIfNeeded(),this.currentRecord.emptyHits++}addMiss(){this.archiveIfNeeded(),this.currentRecord.misses++}addEviction(){this.archiveIfNeeded(),this.currentRecord.evictions++}setCacheSize(e){this.archiveIfNeeded(),this.currentRecord.cacheSize=e}addExpiration(){this.archiveIfNeeded(),this.currentRecord.expirations++}addSet(){this.archiveIfNeeded(),this.currentRecord.sets++}addInvalidateOne(){this.archiveIfNeeded(),this.currentRecord.invalidateOne++}addInvalidateAll(){this.archiveIfNeeded(),this.currentRecord.invalidateAll++}getStatistics(){return this.records.getStatistics()}archiveIfNeeded(){this.hoursPassed()>=this.statisticTtlInHours&&(this.collectionStart=new Date,this.currentTimeStamp=GS(this.collectionStart),this.records.initForCache(this.cacheId,this.currentTimeStamp))}},ja=class extends mi{constructor(e,r,n,s,i){if(super(e||1e3,r||0),!n)throw new Error("Cache id is mandatory");this.hitStatistics=new Lf(n,i!==void 0?i:24,s)}getStatistics(){return this.hitStatistics.getStatistics()}set(e,r){super.set(e,r),this.hitStatistics.addSet(),this.hitStatistics.setCacheSize(this.size)}evict(){super.evict(),this.hitStatistics.addEviction(),this.hitStatistics.setCacheSize(this.size)}delete(e,r=!1){super.delete(e),r||this.hitStatistics.addInvalidateOne(),this.hitStatistics.setCacheSize(this.size)}clear(){super.clear(),this.hitStatistics.addInvalidateAll(),this.hitStatistics.setCacheSize(this.size)}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e,!0),this.hitStatistics.addExpiration();return}return this.bumpLru(r),r.value||this.hitStatistics.addFalsyHit(),(r.value===void 0||r.value===null||r.value==="")&&this.hitStatistics.addEmptyHit(),this.hitStatistics.addHit(),r.value}this.hitStatistics.addMiss()}},Da=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}};sr.Fifo=Da;sr.FifoMap=kf;sr.FifoObject=Da;sr.HitStatisticsRecord=qa;sr.Lru=mi;sr.LruHitStatistics=ja;sr.LruMap=xf;sr.LruObject=mi;sr.LruObjectHitStatistics=ja});var QS=E((PK,is)=>{"use strict";var Uj=typeof Buffer<"u",JS=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,KS=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function YS(t,e,r){r==null&&e!==null&&typeof e=="object"&&(r=e,e=void 0),Uj&&Buffer.isBuffer(t)&&(t=t.toString()),t&&t.charCodeAt(0)===65279&&(t=t.slice(1));let n=JSON.parse(t,e);if(n===null||typeof n!="object")return n;let s=r&&r.protoAction||"error",i=r&&r.constructorAction||"error";if(s==="ignore"&&i==="ignore")return n;if(s!=="ignore"&&i!=="ignore"){if(JS.test(t)===!1&&KS.test(t)===!1)return n}else if(s!=="ignore"&&i==="ignore"){if(JS.test(t)===!1)return n}else if(KS.test(t)===!1)return n;return XS(n,{protoAction:s,constructorAction:i,safe:r&&r.safe})}function XS(t,{protoAction:e="error",constructorAction:r="error",safe:n}={}){let s=[t];for(;s.length;){let i=s;s=[];for(let o of i){if(e!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(n===!0)return null;if(e==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(let a in o){let l=o[a];l&&typeof l=="object"&&s.push(l)}}}return t}function qf(t,e,r){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return YS(t,e,r)}finally{Error.stackTraceLimit=n}}function Bj(t,e){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return YS(t,e,{safe:!0})}catch{return}finally{Error.stackTraceLimit=r}}is.exports=qf;is.exports.default=qf;is.exports.parse=qf;is.exports.safeParse=Bj;is.exports.scan=XS});var Hf=E((AK,_i)=>{"use strict";var{AsyncResource:Gj}=V("node:async_hooks"),{FifoMap:tE}=WS(),{parse:Wj}=QS(),yi=fc(),{kDefaultJsonParse:gi,kContentTypeParser:os,kBodyLimit:Jj,kRequestPayloadStream:rE,kState:Df,kTestInternals:Kj,kReplyIsError:ZS,kRouteContext:Yj}=De(),{FST_ERR_CTP_INVALID_TYPE:Fa,FST_ERR_CTP_EMPTY_TYPE:Xj,FST_ERR_CTP_ALREADY_PRESENT:Qj,FST_ERR_CTP_INVALID_HANDLER:Zj,FST_ERR_CTP_INVALID_PARSE_TYPE:eD,FST_ERR_CTP_BODY_TOO_LARGE:eE,FST_ERR_CTP_INVALID_MEDIA_TYPE:tD,FST_ERR_CTP_INVALID_CONTENT_LENGTH:rD,FST_ERR_CTP_EMPTY_JSON_BODY:nD,FST_ERR_CTP_INSTANCE_ALREADY_STARTED:Ff,FST_ERR_CTP_INVALID_JSON_BODY:sD}=He(),{FSTSEC001:iD}=Kn();function Sr(t,e,r){this[gi]=sE(e,r),this.customParsers=new Map,this.customParsers.set("application/json",new jf(!0,!1,t,this[gi])),this.customParsers.set("text/plain",new jf(!0,!1,t,Mf)),this.parserList=["application/json","text/plain"],this.parserRegExpList=[],this.cache=new tE(100)}Sr.prototype.add=function(t,e,r){let n=typeof t=="string";if(n){if(t=t.trim().toLowerCase(),t.length===0)throw new Xj}else if(!(t instanceof RegExp))throw new Fa;if(typeof r!="function")throw new Zj;if(this.existingParser(t))throw new Qj(t);if(e.parseAs!==void 0&&e.parseAs!=="string"&&e.parseAs!=="buffer")throw new eD(e.parseAs);let s=new jf(e.parseAs==="string",e.parseAs==="buffer",e.bodyLimit,r);if(t==="*")this.customParsers.set("",s);else if(n){let i=new yi(t);if(i.isValid===!1)throw new Fa;let o=i.toString();this.parserList.unshift(o),this.customParsers.set(o,s)}else fD(t),this.parserRegExpList.unshift(t),this.customParsers.set(t.toString(),s)};Sr.prototype.hasParser=function(t){if(typeof t=="string")t=new yi(t).toString();else{if(!(t instanceof RegExp))throw new Fa;t=t.toString()}return this.customParsers.has(t)};Sr.prototype.existingParser=function(t){if(typeof t=="string"){let e=new yi(t).toString();if(t==="application/json"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==this[gi];if(t==="text/plain"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==Mf}return this.hasParser(t)};Sr.prototype.getParser=function(t){typeof t=="string"&&(t=new yi(t));let e=t.toString(),r=this.cache.get(e);if(r!==void 0)return r;if(r=this.customParsers.get(e),r!==void 0)return this.cache.set(e,r),r;if(r=this.customParsers.get(t.mediaType),r!==void 0)return r;for(let n=0;n!==this.parserRegExpList.length;++n){let s=this.parserRegExpList[n];if(s.test(e))return r=this.customParsers.get(s.toString()),this.cache.set(e,r),r}return this.customParsers.get("")};Sr.prototype.removeAll=function(){this.customParsers=new Map,this.parserRegExpList=[],this.parserList=[],this.cache=new tE(100)};Sr.prototype.remove=function(t){let e;if(typeof t=="string")t=new yi(t).toString(),e=this.parserList;else{if(!(t instanceof RegExp))throw new Fa;t=t.toString(),e=this.parserRegExpList}let r=this.customParsers.delete(t),n=e.findIndex(s=>s.toString()===t);return n>-1&&e.splice(n,1),r||n>-1};Sr.prototype.run=function(t,e,r,n){let s=this.getParser(t);if(s===void 0){if(r.is404===!0){e(r,n);return}n[ZS]=!0,n.send(new tD(t||void 0));return}let i=new Gj("content-type-parser:run",r),o=i.bind(l);if(s.asString===!0||s.asBuffer===!0){nE(r,n,n[Yj]._parserOptions,s,o);return}let a=s.fn(r,r[rE],o);a&&typeof a.then=="function"&&a.then(u=>{o(null,u)},o);function l(u,c){if(i.emitDestroy(),u!=null){n.header("connection","close"),n[ZS]=!0,n.send(u);return}r.body=c,e(r,n)}};function nE(t,e,r,n,s){let i=n.asString===!0,o=r.limit===null?n.bodyLimit:r.limit,a=Number(t.headers["content-length"]);if(a>o){s(new eE,void 0);return}let l=0,u=i?"":[],c=t[rE]||t.raw;i&&c.setEncoding("utf8"),c.on("data",f),c.on("end",p),c.on("error",p),c.resume();function f(h){l+=i?Buffer.byteLength(h):h.length;let{receivedEncodedLength:d=0}=c;if(l>o||d>o){c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),s(new eE,void 0);return}i?u+=h:u.push(h)}function p(h){if(c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),h!=null){typeof h.statusCode=="number"&&h.statusCode>=400||(h.statusCode=400),s(h,void 0);return}if(!Number.isNaN(a)&&(c.receivedEncodedLength||l)!==a){s(new rD,void 0);return}i||(u=Buffer.concat(u));let d=n.fn(t,u,s);d&&typeof d.then=="function"&&d.then(m=>{s(null,m)},s)}}function sE(t,e){let r={protoAction:t,constructorAction:e};return n;function n(s,i,o){if(i.length===0){o(new nD,void 0);return}try{o(null,Wj(i,r))}catch{o(new sD,void 0)}}}function Mf(t,e,r){r(null,e)}function jf(t,e,r,n){this.asString=t,this.asBuffer=e,this.bodyLimit=r,this.fn=n}function oD(t){let e=new Sr;return e[gi]=t[gi],e.customParsers=new Map(t.customParsers.entries()),e.parserList=t.parserList.slice(),e.parserRegExpList=t.parserRegExpList.slice(),e}function aD(t,e,r){if(this[Df].started)throw new Ff("addContentTypeParser");return typeof e=="function"&&(r=e,e={}),e||(e={}),e.bodyLimit||(e.bodyLimit=this[Jj]),Array.isArray(t)?t.forEach(n=>this[os].add(n,e,r)):this[os].add(t,e,r),this}function lD(t){return this[os].hasParser(t)}function uD(t){if(this[Df].started)throw new Ff("removeContentTypeParser");if(Array.isArray(t))for(let e of t)this[os].remove(e);else this[os].remove(t)}function cD(){if(this[Df].started)throw new Ff("removeAllContentTypeParsers");this[os].removeAll()}function fD(t){t.source[0]!=="^"&&t.source.includes(";?")===!1&&iD(t.source)}_i.exports=Sr;_i.exports.helpers={buildContentTypeParser:oD,addContentTypeParser:aD,hasContentTypeParser:lD,removeContentTypeParser:uD,removeAllContentTypeParsers:cD};_i.exports.defaultParsers={getDefaultJsonParser:sE,defaultTextParser:Mf};_i.exports[Kj]={rawBody:nE}});var as=E(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.regexpCode=ce.getEsmExportName=ce.getProperty=ce.safeStringify=ce.stringify=ce.strConcat=ce.addCodeArg=ce.str=ce._=ce.nil=ce._Code=ce.Name=ce.IDENTIFIER=ce._CodeOrName=void 0;var Si=class{};ce._CodeOrName=Si;ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var En=class extends Si{constructor(e){if(super(),!ce.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}}};ce.Name=En;var It=class extends Si{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,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof En&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ce._Code=It;ce.nil=new It("");function iE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)zf(r,e[n]),r.push(t[++n]);return new It(r)}ce._=iE;var Vf=new It("+");function oE(t,...e){let r=[Ei(t[0])],n=0;for(;n<e.length;)r.push(Vf),zf(r,e[n]),r.push(Vf,Ei(t[++n]));return dD(r),new It(r)}ce.str=oE;function zf(t,e){e instanceof It?t.push(...e._items):e instanceof En?t.push(e):t.push(mD(e))}ce.addCodeArg=zf;function dD(t){let e=1;for(;e<t.length-1;){if(t[e]===Vf){let r=hD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function hD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof En||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 En))return`"${t}${e.slice(1)}`}function pD(t,e){return e.emptyStr()?t:t.emptyStr()?e:oE`${t}${e}`}ce.strConcat=pD;function mD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ei(Array.isArray(t)?t.join(","):t)}function gD(t){return new It(Ei(t))}ce.stringify=gD;function Ei(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ce.safeStringify=Ei;function yD(t){return typeof t=="string"&&ce.IDENTIFIER.test(t)?new It(`.${t}`):iE`[${t}]`}ce.getProperty=yD;function _D(t){if(typeof t=="string"&&ce.IDENTIFIER.test(t))return new It(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ce.getEsmExportName=_D;function SD(t){return new It(t.toString())}ce.regexpCode=SD});var za=E(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.ValueScope=St.ValueScopeName=St.Scope=St.varKinds=St.UsedValueState=void 0;var _t=as(),Uf=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ma;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ma||(St.UsedValueState=Ma={}));St.varKinds={const:new _t.Name("const"),let:new _t.Name("let"),var:new _t.Name("var")};var Ha=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof _t.Name?e:this.name(e)}name(e){return new _t.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.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}}};St.Scope=Ha;var Va=class extends _t.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,_t._)`.${new _t.Name(r)}[${n}]`}};St.ValueScopeName=Va;var ED=(0,_t._)`\n`,Bf=class extends Ha{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ED:_t.nil}}get(){return this._scope}name(e){return new Va(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let c=a.get(o);if(c)return c}else a=this._values[i]=new Map;a.set(o,s);let l=this._scope[i]||(this._scope[i]=[]),u=l.length;return l[u]=r.ref,s.setValue(r,{property:i,itemIndex:u}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,_t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=_t.nil;for(let o in e){let a=e[o];if(!a)continue;let l=n[o]=n[o]||new Map;a.forEach(u=>{if(l.has(u))return;l.set(u,Ma.Started);let c=r(u);if(c){let f=this.opts.es5?St.varKinds.var:St.varKinds.const;i=(0,_t._)`${i}${f} ${u} = ${c};${this.opts._n}`}else if(c=s?.(u))i=(0,_t._)`${i}${c}${this.opts._n}`;else throw new Uf(u);l.set(u,Ma.Completed)})}return i}};St.ValueScope=Bf});var W=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.or=te.and=te.not=te.CodeGen=te.operators=te.varKinds=te.ValueScopeName=te.ValueScope=te.Scope=te.Name=te.regexpCode=te.stringify=te.getProperty=te.nil=te.strConcat=te.str=te._=void 0;var oe=as(),Ut=za(),zr=as();Object.defineProperty(te,"_",{enumerable:!0,get:function(){return zr._}});Object.defineProperty(te,"str",{enumerable:!0,get:function(){return zr.str}});Object.defineProperty(te,"strConcat",{enumerable:!0,get:function(){return zr.strConcat}});Object.defineProperty(te,"nil",{enumerable:!0,get:function(){return zr.nil}});Object.defineProperty(te,"getProperty",{enumerable:!0,get:function(){return zr.getProperty}});Object.defineProperty(te,"stringify",{enumerable:!0,get:function(){return zr.stringify}});Object.defineProperty(te,"regexpCode",{enumerable:!0,get:function(){return zr.regexpCode}});Object.defineProperty(te,"Name",{enumerable:!0,get:function(){return zr.Name}});var Wa=za();Object.defineProperty(te,"Scope",{enumerable:!0,get:function(){return Wa.Scope}});Object.defineProperty(te,"ValueScope",{enumerable:!0,get:function(){return Wa.ValueScope}});Object.defineProperty(te,"ValueScopeName",{enumerable:!0,get:function(){return Wa.ValueScopeName}});Object.defineProperty(te,"varKinds",{enumerable:!0,get:function(){return Wa.varKinds}});te.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};var Er=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Gf=class extends Er{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ut.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=us(this.rhs,e,r)),this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}},Ua=class extends Er{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=us(this.rhs,e,r),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return Ga(e,this.rhs)}},Wf=class extends Ua{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Jf=class extends Er{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Kf=class extends Er{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yf=class extends Er{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Xf=class extends Er{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=us(this.code,e,r),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}},bi=class extends Er{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(bD(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>wn(e,r.names),{})}},br=class extends bi{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qf=class extends bi{},ls=class extends br{};ls.kind="else";var bn=class t extends br{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 n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ls(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(aE(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=us(this.condition,e,r),this}get names(){let e=super.names;return Ga(e,this.condition),this.else&&wn(e,this.else.names),e}};bn.kind="if";var vn=class extends br{};vn.kind="for";var Zf=class extends vn{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=us(this.iteration,e,r),this}get names(){return wn(super.names,this.iteration.names)}},ed=class extends vn{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ut.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=Ga(super.names,this.from);return Ga(e,this.to)}},Ba=class extends vn{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}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=us(this.iterable,e,r),this}get names(){return wn(super.names,this.iterable.names)}},vi=class extends br{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};vi.kind="func";var wi=class extends bi{render(e){return"return "+super.render(e)}};wi.kind="return";var td=class extends br{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 n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&wn(e,this.catch.names),this.finally&&wn(e,this.finally.names),e}},Ri=class extends br{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ri.kind="catch";var Oi=class extends br{render(e){return"finally"+super.render(e)}};Oi.kind="finally";var rd=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
52
|
+
`:""},this._extScope=e,this._scope=new Ut.Scope({parent:e}),this._nodes=[new Qf]}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 n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}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,n,s){let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Gf(e,i,n)),i}const(e,r,n){return this._def(Ut.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ut.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ut.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ua(e,r,n))}add(e,r){return this._leafNode(new Wf(e,te.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==oe.nil&&this._leafNode(new Xf(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,oe.addCodeArg)(r,s));return r.push("}"),new oe._Code(r)}if(e,r,n){if(this._blockNode(new bn(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new bn(e))}else(){return this._elseNode(new ls)}endIf(){return this._endBlockNode(bn,ls)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Zf(e),r)}forRange(e,r,n,s,i=this.opts.es5?Ut.varKinds.var:Ut.varKinds.let){let o=this._scope.toName(e);return this._for(new ed(i,o,r,n),()=>s(o))}forOf(e,r,n,s=Ut.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof oe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,oe._)`${o}.length`,a=>{this.var(i,(0,oe._)`${o}[${a}]`),n(i)})}return this._for(new Ba("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?Ut.varKinds.var:Ut.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,oe._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new Ba("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(vn)}label(e){return this._leafNode(new Jf(e))}break(e){return this._leafNode(new Kf(e))}return(e){let r=new wi;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(wi)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new td;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new Ri(i),r(i)}return n&&(this._currNode=s.finally=new Oi,this.code(n)),this._endBlockNode(Ri,Oi)}throw(e){return this._leafNode(new Yf(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 n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=oe.nil,n,s){return this._blockNode(new vi(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(vi)}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 n=this._currNode;if(n instanceof e||r&&n 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 bn))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}};te.CodeGen=rd;function wn(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Ga(t,e){return e instanceof oe._CodeOrName?wn(t,e.names):t}function us(t,e,r){if(t instanceof oe.Name)return n(t);if(!s(t))return t;return new oe._Code(t._items.reduce((i,o)=>(o instanceof oe.Name&&(o=n(o)),o instanceof oe._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof oe._Code&&i._items.some(o=>o instanceof oe.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function bD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function aE(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,oe._)`!${nd(t)}`}te.not=aE;var vD=lE(te.operators.AND);function wD(...t){return t.reduce(vD)}te.and=wD;var RD=lE(te.operators.OR);function OD(...t){return t.reduce(RD)}te.or=OD;function lE(t){return(e,r)=>e===oe.nil?r:r===oe.nil?e:(0,oe._)`${nd(e)} ${t} ${nd(r)}`}function nd(t){return t instanceof oe.Name?t:(0,oe._)`(${t})`}});var ee=E(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.checkStrictMode=re.getErrorPath=re.Type=re.useFunc=re.setEvaluated=re.evaluatedPropsToName=re.mergeEvaluated=re.eachItem=re.unescapeJsonPointer=re.escapeJsonPointer=re.escapeFragment=re.unescapeFragment=re.schemaRefOrVal=re.schemaHasRulesButRef=re.schemaHasRules=re.checkUnknownRules=re.alwaysValidSchema=re.toHash=void 0;var Se=W(),TD=as();function $D(t){let e={};for(let r of t)e[r]=!0;return e}re.toHash=$D;function PD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(fE(t,e),!dE(e,t.self.RULES.all))}re.alwaysValidSchema=PD;function fE(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||mE(t,`unknown keyword: "${i}"`)}re.checkUnknownRules=fE;function dE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}re.schemaHasRules=dE;function AD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}re.schemaHasRulesButRef=AD;function CD({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Se._)`${r}`}return(0,Se._)`${t}${e}${(0,Se.getProperty)(n)}`}re.schemaRefOrVal=CD;function ID(t){return hE(decodeURIComponent(t))}re.unescapeFragment=ID;function ND(t){return encodeURIComponent(id(t))}re.escapeFragment=ND;function id(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}re.escapeJsonPointer=id;function hE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}re.unescapeJsonPointer=hE;function kD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}re.eachItem=kD;function uE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let l=o===void 0?i:o instanceof Se.Name?(i instanceof Se.Name?t(s,i,o):e(s,i,o),o):i instanceof Se.Name?(e(s,o,i),i):r(i,o);return a===Se.Name&&!(l instanceof Se.Name)?n(s,l):l}}re.mergeEvaluated={props:uE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Se._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Se._)`${r} || {}`).code((0,Se._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Se._)`${r} || {}`),od(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:pE}),items:uE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Se._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Se._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function pE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Se._)`{}`);return e!==void 0&&od(t,r,e),r}re.evaluatedPropsToName=pE;function od(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Se._)`${e}${(0,Se.getProperty)(n)}`,!0))}re.setEvaluated=od;var cE={};function xD(t,e){return t.scopeValue("func",{ref:e,code:cE[e.code]||(cE[e.code]=new TD._Code(e.code))})}re.useFunc=xD;var sd;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(sd||(re.Type=sd={}));function LD(t,e,r){if(t instanceof Se.Name){let n=e===sd.Num;return r?n?(0,Se._)`"[" + ${t} + "]"`:(0,Se._)`"['" + ${t} + "']"`:n?(0,Se._)`"/" + ${t}`:(0,Se._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Se.getProperty)(t).toString():"/"+id(t)}re.getErrorPath=LD;function mE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}re.checkStrictMode=mE});var Nt=E(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var Qe=W(),qD={data:new Qe.Name("data"),valCxt:new Qe.Name("valCxt"),instancePath:new Qe.Name("instancePath"),parentData:new Qe.Name("parentData"),parentDataProperty:new Qe.Name("parentDataProperty"),rootData:new Qe.Name("rootData"),dynamicAnchors:new Qe.Name("dynamicAnchors"),vErrors:new Qe.Name("vErrors"),errors:new Qe.Name("errors"),this:new Qe.Name("this"),self:new Qe.Name("self"),scope:new Qe.Name("scope"),json:new Qe.Name("json"),jsonPos:new Qe.Name("jsonPos"),jsonLen:new Qe.Name("jsonLen"),jsonPart:new Qe.Name("jsonPart")};ad.default=qD});var Ti=E(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extendErrors=Ze.resetErrorsCount=Ze.reportExtraError=Ze.reportError=Ze.keyword$DataError=Ze.keywordError=void 0;var le=W(),Ja=ee(),it=Nt();Ze.keywordError={message:({keyword:t})=>(0,le.str)`must pass "${t}" keyword validation`};Ze.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,le.str)`"${t}" keyword must be ${e} ($data)`:(0,le.str)`"${t}" keyword is invalid ($data)`};function jD(t,e=Ze.keywordError,r,n){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,l=_E(t,e,r);n??(o||a)?gE(i,l):yE(s,(0,le._)`[${l}]`)}Ze.reportError=jD;function DD(t,e=Ze.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:o}=n,a=_E(t,e,r);gE(s,a),i||o||yE(n,it.default.vErrors)}Ze.reportExtraError=DD;function FD(t,e){t.assign(it.default.errors,e),t.if((0,le._)`${it.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,le._)`${it.default.vErrors}.length`,e),()=>t.assign(it.default.vErrors,null)))}Ze.resetErrorsCount=FD;function MD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,it.default.errors,a=>{t.const(o,(0,le._)`${it.default.vErrors}[${a}]`),t.if((0,le._)`${o}.instancePath === undefined`,()=>t.assign((0,le._)`${o}.instancePath`,(0,le.strConcat)(it.default.instancePath,i.errorPath))),t.assign((0,le._)`${o}.schemaPath`,(0,le.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,le._)`${o}.schema`,r),t.assign((0,le._)`${o}.data`,n))})}Ze.extendErrors=MD;function gE(t,e){let r=t.const("err",e);t.if((0,le._)`${it.default.vErrors} === null`,()=>t.assign(it.default.vErrors,(0,le._)`[${r}]`),(0,le._)`${it.default.vErrors}.push(${r})`),t.code((0,le._)`${it.default.errors}++`)}function yE(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,le._)`new ${t.ValidationError}(${e})`):(r.assign((0,le._)`${n}.errors`,e),r.return(!1))}var Rn={keyword:new le.Name("keyword"),schemaPath:new le.Name("schemaPath"),params:new le.Name("params"),propertyName:new le.Name("propertyName"),message:new le.Name("message"),schema:new le.Name("schema"),parentSchema:new le.Name("parentSchema")};function _E(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,le._)`{}`:HD(t,e,r)}function HD(t,e,r={}){let{gen:n,it:s}=t,i=[VD(s,r),zD(t,r)];return UD(t,e,i),n.object(...i)}function VD({errorPath:t},{instancePath:e}){let r=e?(0,le.str)`${t}${(0,Ja.getErrorPath)(e,Ja.Type.Str)}`:t;return[it.default.instancePath,(0,le.strConcat)(it.default.instancePath,r)]}function zD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,le.str)`${e}/${t}`;return r&&(s=(0,le.str)`${s}${(0,Ja.getErrorPath)(r,Ja.Type.Str)}`),[Rn.schemaPath,s]}function UD(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:f}=a;n.push([Rn.keyword,s],[Rn.params,typeof e=="function"?e(t):e||(0,le._)`{}`]),l.messages&&n.push([Rn.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([Rn.schema,o],[Rn.parentSchema,(0,le._)`${c}${f}`],[it.default.data,i]),u&&n.push([Rn.propertyName,u])}});var EE=E(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.boolOrEmptySchema=cs.topBoolOrEmptySchema=void 0;var BD=Ti(),GD=W(),WD=Nt(),JD={message:"boolean schema is false"};function KD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?SE(t,!1):typeof r=="object"&&r.$async===!0?e.return(WD.default.data):(e.assign((0,GD._)`${n}.errors`,null),e.return(!0))}cs.topBoolOrEmptySchema=KD;function YD(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),SE(t)):r.var(e,!0)}cs.boolOrEmptySchema=YD;function SE(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,BD.reportError)(s,JD,void 0,e)}});var ld=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.getRules=fs.isJSONType=void 0;var XD=["string","number","integer","boolean","null","object","array"],QD=new Set(XD);function ZD(t){return typeof t=="string"&&QD.has(t)}fs.isJSONType=ZD;function eF(){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:{}}}fs.getRules=eF});var ud=E(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.shouldUseRule=Ur.shouldUseGroup=Ur.schemaHasRulesForType=void 0;function tF({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&bE(t,n)}Ur.schemaHasRulesForType=tF;function bE(t,e){return e.rules.some(r=>vE(t,r))}Ur.shouldUseGroup=bE;function vE(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ur.shouldUseRule=vE});var $i=E(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;var rF=ld(),nF=ud(),sF=Ti(),Z=W(),wE=ee(),ds;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ds||(et.DataType=ds={}));function iF(t){let e=RE(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}et.getSchemaTypes=iF;function RE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(rF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}et.getJSONTypes=RE;function oF(t,e){let{gen:r,data:n,opts:s}=t,i=aF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,nF.schemaHasRulesForType)(t,e[0]));if(o){let a=fd(e,n,s.strictNumbers,ds.Wrong);r.if(a,()=>{i.length?lF(t,e,i):dd(t)})}return o}et.coerceAndCheckDataType=oF;var OE=new Set(["string","number","integer","boolean","null"]);function aF(t,e){return e?t.filter(r=>OE.has(r)||e==="array"&&r==="array"):[]}function lF(t,e,r){let{gen:n,data:s,opts:i}=t,o=n.let("dataType",(0,Z._)`typeof ${s}`),a=n.let("coerced",(0,Z._)`undefined`);i.coerceTypes==="array"&&n.if((0,Z._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,Z._)`${s}[0]`).assign(o,(0,Z._)`typeof ${s}`).if(fd(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,Z._)`${a} !== undefined`);for(let u of r)(OE.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);n.else(),dd(t),n.endIf(),n.if((0,Z._)`${a} !== undefined`,()=>{n.assign(s,a),uF(t,a)});function l(u){switch(u){case"string":n.elseIf((0,Z._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,Z._)`"" + ${s}`).elseIf((0,Z._)`${s} === null`).assign(a,(0,Z._)`""`);return;case"number":n.elseIf((0,Z._)`${o} == "boolean" || ${s} === null
|
|
53
53
|
|| (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,Z._)`+${s}`);return;case"integer":n.elseIf((0,Z._)`${o} === "boolean" || ${s} === null
|
|
54
54
|
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,Z._)`+${s}`);return;case"boolean":n.elseIf((0,Z._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,Z._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Z._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Z._)`${o} === "string" || ${o} === "number"
|
|
55
|
-
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,Z._)`[${s}]`)}}}function oF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Z._)`${e} !== undefined`,()=>t.assign((0,Z._)`${e}[${r}]`,n))}function ud(t,e,r,n=ds.Correct){let s=n===ds.Correct?Z.operators.EQ:Z.operators.NEQ,i;switch(t){case"null":return(0,Z._)`${e} ${s} null`;case"array":i=(0,Z._)`Array.isArray(${e})`;break;case"object":i=(0,Z._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,Z._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,Z._)`typeof ${e} ${s} ${t}`}return n===ds.Correct?i:(0,Z.not)(i);function o(a=Z.nil){return(0,Z.and)((0,Z._)`typeof ${e} == "number"`,a,r?(0,Z._)`isFinite(${e})`:Z.nil)}}et.checkDataType=ud;function cd(t,e,r,n){if(t.length===1)return ud(t[0],e,r,n);let s,i=(0,bE.toHash)(t);if(i.array&&i.object){let o=(0,Z._)`typeof ${e} != "object"`;s=i.null?o:(0,Z._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=Z.nil;i.number&&delete i.integer;for(let o in i)s=(0,Z.and)(s,ud(o,e,r,n));return s}et.checkDataTypes=cd;var aF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Z._)`{type: ${t}}`:(0,Z._)`{type: ${e}}`};function fd(t){let e=lF(t);(0,tF.reportError)(e,aF)}et.reportTypeError=fd;function lF(t){let{gen:e,data:r,schema:n}=t,s=(0,bE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var OE=E(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.assignDefaults=void 0;var hs=W(),uF=ee();function cF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)RE(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>RE(t,i,s.default))}Ka.assignDefaults=cF;function RE(t,e,r){let{gen:n,compositeRule:s,data:i,opts:o}=t;if(r===void 0)return;let a=(0,hs._)`${i}${(0,hs.getProperty)(e)}`;if(s){(0,uF.checkStrictMode)(t,`default is ignored for: ${a}`);return}let l=(0,hs._)`${a} === undefined`;o.useDefaults==="empty"&&(l=(0,hs._)`${l} || ${a} === null || ${a} === ""`),n.if(l,(0,hs._)`${a} = ${(0,hs.stringify)(r)}`)}});var We=E(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.validateUnion=_e.validateArray=_e.usePattern=_e.callValidateCode=_e.schemaProperties=_e.allSchemaProperties=_e.noPropertyInData=_e.propertyInData=_e.isOwnProperty=_e.hasPropFunc=_e.reportMissingProp=_e.checkMissingProp=_e.checkReportMissingProp=void 0;var be=W(),dd=ee(),Br=Nt(),fF=ee();function dF(t,e){let{gen:r,data:n,it:s}=t;r.if(pd(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,be._)`${e}`},!0),t.error()})}_e.checkReportMissingProp=dF;function hF({gen:t,data:e,it:{opts:r}},n,s){return(0,be.or)(...n.map(i=>(0,be.and)(pd(t,e,i,r.ownProperties),(0,be._)`${s} = ${i}`)))}_e.checkMissingProp=hF;function pF(t,e){t.setParams({missingProperty:e},!0),t.error()}_e.reportMissingProp=pF;function TE(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,be._)`Object.prototype.hasOwnProperty`})}_e.hasPropFunc=TE;function hd(t,e,r){return(0,be._)`${TE(t)}.call(${e}, ${r})`}_e.isOwnProperty=hd;function mF(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} !== undefined`;return n?(0,be._)`${s} && ${hd(t,e,r)}`:s}_e.propertyInData=mF;function pd(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} === undefined`;return n?(0,be.or)(s,(0,be.not)(hd(t,e,r))):s}_e.noPropertyInData=pd;function $E(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}_e.allSchemaProperties=$E;function gF(t,e){return $E(e).filter(r=>!(0,dd.alwaysValidSchema)(t,e[r]))}_e.schemaProperties=gF;function yF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,l,u){let c=u?(0,be._)`${t}, ${e}, ${n}${s}`:e,f=[[Br.default.instancePath,(0,be.strConcat)(Br.default.instancePath,i)],[Br.default.parentData,o.parentData],[Br.default.parentDataProperty,o.parentDataProperty],[Br.default.rootData,Br.default.rootData]];o.opts.dynamicRef&&f.push([Br.default.dynamicAnchors,Br.default.dynamicAnchors]);let p=(0,be._)`${c}, ${r.object(...f)}`;return l!==be.nil?(0,be._)`${a}.call(${l}, ${p})`:(0,be._)`${a}(${p})`}_e.callValidateCode=yF;var _F=(0,be._)`new RegExp`;function SF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,be._)`${s.code==="new RegExp"?_F:(0,fF.useFunc)(t,s)}(${r}, ${n})`})}_e.usePattern=SF;function EF(t){let{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.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 l=e.const("len",(0,be._)`${r}.length`);e.forRange("i",0,l,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:dd.Type.Num},i),e.if((0,be.not)(i),a)})}}_e.validateArray=EF;function bF(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,dd.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((l,u)=>{let c=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(o,(0,be._)`${o} || ${a}`),t.mergeValidEvaluated(c,a)||e.if((0,be.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}_e.validateUnion=bF});var CE=E(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.validateKeywordUsage=ir.validSchemaType=ir.funcKeywordCode=ir.macroKeywordCode=void 0;var ot=W(),On=Nt(),vF=We(),wF=Ti();function RF(t,e){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),l=AE(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ot.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}ir.macroKeywordCode=RF;function OF(t,e){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:l}=t;$F(l,e);let u=!a&&e.compile?e.compile.call(l.self,i,o,l):e.validate,c=AE(n,s,u),f=n.let("valid");t.block$data(f,p),t.ok((r=e.valid)!==null&&r!==void 0?r:f);function p(){if(e.errors===!1)m(),e.modifying&&PE(t),g(()=>t.error());else{let S=e.async?h():d();e.modifying&&PE(t),g(()=>TF(t,S))}}function h(){let S=n.let("ruleErrs",null);return n.try(()=>m((0,ot._)`await `),b=>n.assign(f,!1).if((0,ot._)`${b} instanceof ${l.ValidationError}`,()=>n.assign(S,(0,ot._)`${b}.errors`),()=>n.throw(b))),S}function d(){let S=(0,ot._)`${c}.errors`;return n.assign(S,null),m(ot.nil),S}function m(S=e.async?(0,ot._)`await `:ot.nil){let b=l.opts.passContext?On.default.this:On.default.self,_=!("compile"in e&&!a||e.schema===!1);n.assign(f,(0,ot._)`${S}${(0,vF.callValidateCode)(t,c,b,_)}`,e.modifying)}function g(S){var b;n.if((0,ot.not)((b=e.valid)!==null&&b!==void 0?b:f),S)}}ir.funcKeywordCode=OF;function PE(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,ot._)`${n.parentData}[${n.parentDataProperty}]`))}function TF(t,e){let{gen:r}=t;r.if((0,ot._)`Array.isArray(${e})`,()=>{r.assign(On.default.vErrors,(0,ot._)`${On.default.vErrors} === null ? ${e} : ${On.default.vErrors}.concat(${e})`).assign(On.default.errors,(0,ot._)`${On.default.vErrors}.length`),(0,wF.extendErrors)(t)},()=>t.error())}function $F({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function AE(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,ot.stringify)(r)})}function PF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ir.validSchemaType=PF;function AF({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let l=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}ir.validateKeywordUsage=AF});var NE=E(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.extendSubschemaMode=Gr.extendSubschemaData=Gr.getSubschema=void 0;var or=W(),IE=ee();function CF(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==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,or._)`${t.schemaPath}${(0,or.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,or._)`${t.schemaPath}${(0,or.getProperty)(e)}${(0,or.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,IE.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Gr.getSubschema=CF;function IF(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==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:c,opts:f}=e,p=a.let("data",(0,or._)`${e.data}${(0,or.getProperty)(r)}`,!0);l(p),t.errorPath=(0,or.str)`${u}${(0,IE.getErrorPath)(r,n,f.jsPropertySyntax)}`,t.parentDataProperty=(0,or._)`${r}`,t.dataPathArr=[...c,t.parentDataProperty]}if(s!==void 0){let u=s instanceof or.Name?s:a.let("data",s,!0);l(u),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function l(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Gr.extendSubschemaData=IF;function NF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}Gr.extendSubschemaMode=NF});var Pi=E((xK,kE)=>{"use strict";kE.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 n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var LE=E((LK,xE)=>{"use strict";var Wr=xE.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Ya(e,n,s,t,"",t)};Wr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Wr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Wr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Wr.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 Ya(t,e,r,n,s,i,o,a,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,l,u);for(var c in n){var f=n[c];if(Array.isArray(f)){if(c in Wr.arrayKeywords)for(var p=0;p<f.length;p++)Ya(t,e,r,f[p],s+"/"+c+"/"+p,i,s,c,n,p)}else if(c in Wr.propsKeywords){if(f&&typeof f=="object")for(var h in f)Ya(t,e,r,f[h],s+"/"+c+"/"+kF(h),i,s,c,n,h)}else(c in Wr.keywords||t.allKeys&&!(c in Wr.skipKeywords))&&Ya(t,e,r,f,s+"/"+c,i,s,c,n)}r(n,s,i,o,a,l,u)}}function kF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ai=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.getSchemaRefs=Et.resolveUrl=Et.normalizeId=Et._getFullPath=Et.getFullPath=Et.inlineRef=void 0;var xF=ee(),LF=Pi(),qF=LE(),jF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function DF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!md(t):e?qE(t)<=e:!1}Et.inlineRef=DF;var FF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function md(t){for(let e in t){if(FF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(md)||typeof r=="object"&&md(r))return!0}return!1}function qE(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!jF.has(r)&&(typeof t[r]=="object"&&(0,xF.eachItem)(t[r],n=>e+=qE(n)),e===1/0))return 1/0}return e}function jE(t,e="",r){r!==!1&&(e=ps(e));let n=t.parse(e);return DE(t,n)}Et.getFullPath=jE;function DE(t,e){return t.serialize(e).split("#")[0]+"#"}Et._getFullPath=DE;var MF=/#\/?$/;function ps(t){return t?t.replace(MF,""):""}Et.normalizeId=ps;function HF(t,e,r){return r=ps(r),t.resolve(e,r)}Et.resolveUrl=HF;var VF=/^[a-z_][-a-z0-9._]*$/i;function zF(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ps(t[r]||e),i={"":s},o=jE(n,s,!1),a={},l=new Set;return qF(t,{allKeys:!0},(f,p,h,d)=>{if(d===void 0)return;let m=o+p,g=i[d];typeof f[r]=="string"&&(g=S.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),i[p]=g;function S(_){let y=this.opts.uriResolver.resolve;if(_=ps(g?y(g,_):_),l.has(_))throw c(_);l.add(_);let R=this.refs[_];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?u(f,R.schema,_):_!==ps(m)&&(_[0]==="#"?(u(f,a[_],_),a[_]=f):this.refs[_]=m),_}function b(_){if(typeof _=="string"){if(!VF.test(_))throw new Error(`invalid anchor "${_}"`);S.call(this,`#${_}`)}}}),a;function u(f,p,h){if(p!==void 0&&!LF(f,p))throw c(h)}function c(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Et.getSchemaRefs=zF});var ms=E(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.getData=Jr.KeywordCxt=Jr.validateFunctionCode=void 0;var zE=_E(),FE=$i(),yd=ld(),Xa=$i(),UF=OE(),Ii=CE(),gd=NE(),z=W(),K=Nt(),BF=Ai(),vr=ee(),Ci=Ti();function GF(t){if(GE(t)&&(WE(t),BE(t))){KF(t);return}UE(t,()=>(0,zE.topBoolOrEmptySchema)(t))}Jr.validateFunctionCode=GF;function UE({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,z._)`${K.default.data}, ${K.default.valCxt}`,n.$async,()=>{t.code((0,z._)`"use strict"; ${ME(r,s)}`),JF(t,s),t.code(i)}):t.func(e,(0,z._)`${K.default.data}, ${WF(s)}`,n.$async,()=>t.code(ME(r,s)).code(i))}function WF(t){return(0,z._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,z._)`, ${K.default.dynamicAnchors}={}`:z.nil}}={}`}function JF(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,z._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,z._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,z._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,z._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,z._)`""`),t.var(K.default.parentData,(0,z._)`undefined`),t.var(K.default.parentDataProperty,(0,z._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`{}`)})}function KF(t){let{schema:e,opts:r,gen:n}=t;UE(t,()=>{r.$comment&&e.$comment&&KE(t),eM(t),n.let(K.default.vErrors,null),n.let(K.default.errors,0),r.unevaluated&&YF(t),JE(t),nM(t)})}function YF(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,z._)`${r}.evaluated`),e.if((0,z._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,z._)`${t.evaluated}.props`,(0,z._)`undefined`)),e.if((0,z._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,z._)`${t.evaluated}.items`,(0,z._)`undefined`))}function ME(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,z._)`/*# sourceURL=${r} */`:z.nil}function XF(t,e){if(GE(t)&&(WE(t),BE(t))){QF(t,e);return}(0,zE.boolOrEmptySchema)(t,e)}function BE({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 GE(t){return typeof t.schema!="boolean"}function QF(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&KE(t),tM(t),rM(t);let i=n.const("_errs",K.default.errors);JE(t,i),n.var(e,(0,z._)`${i} === ${K.default.errors}`)}function WE(t){(0,vr.checkUnknownRules)(t),ZF(t)}function JE(t,e){if(t.opts.jtd)return HE(t,[],!1,e);let r=(0,FE.getSchemaTypes)(t.schema),n=(0,FE.coerceAndCheckDataType)(t,r);HE(t,r,!n,e)}function ZF(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,vr.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function eM(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,vr.checkStrictMode)(t,"default is ignored in the schema root")}function tM(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,BF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function rM(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function KE({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)t.code((0,z._)`${K.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,z.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,z._)`${K.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function nM(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,z._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,z._)`new ${s}(${K.default.vErrors})`)):(e.assign((0,z._)`${n}.errors`,K.default.vErrors),i.unevaluated&&sM(t),e.return((0,z._)`${K.default.errors} === 0`))}function sM({gen:t,evaluated:e,props:r,items:n}){r instanceof z.Name&&t.assign((0,z._)`${e}.props`,r),n instanceof z.Name&&t.assign((0,z._)`${e}.items`,n)}function HE(t,e,r,n){let{gen:s,schema:i,data:o,allErrors:a,opts:l,self:u}=t,{RULES:c}=u;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,vr.schemaHasRulesButRef)(i,c))){s.block(()=>XE(t,"$ref",c.all.$ref.definition));return}l.jtd||iM(t,e),s.block(()=>{for(let p of c.rules)f(p);f(c.post)});function f(p){(0,yd.shouldUseGroup)(i,p)&&(p.type?(s.if((0,Xa.checkDataType)(p.type,o,l.strictNumbers)),VE(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,Xa.reportTypeError)(t)),s.endIf()):VE(t,p),a||s.if((0,z._)`${K.default.errors} === ${n||0}`))}}function VE(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,UF.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,yd.shouldUseRule)(n,i)&&XE(t,i.keyword,i.definition,e.type)})}function iM(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(oM(t,e),t.opts.allowUnionTypes||aM(t,e),lM(t,t.dataTypes))}function oM(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{YE(t.dataTypes,r)||_d(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),cM(t,e)}}function aM(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&_d(t,"use allowUnionTypes to allow union type keyword")}function lM(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,yd.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>uM(e,o))&&_d(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function uM(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function YE(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function cM(t,e){let r=[];for(let n of t.dataTypes)YE(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function _d(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,vr.checkStrictMode)(t,e,t.opts.strictTypes)}var Qa=class{constructor(e,r,n){if((0,Ii.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,vr.schemaRefOrVal)(e,this.schema,n,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",QE(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ii.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",K.default.errors))}result(e,r,n){this.failResult((0,z.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():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,z.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,z._)`${r} !== undefined && (${(0,z.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ci.reportExtraError:Ci.reportError)(this,this.def.error,r)}$dataError(){(0,Ci.reportError)(this,this.def.$dataError||Ci.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ci.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,n=z.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=z.nil,r=z.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,z.or)((0,z._)`${s} === undefined`,r)),e!==z.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==z.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,z.or)(o(),a());function o(){if(n.length){if(!(r instanceof z.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,z._)`${(0,Xa.checkDataTypes)(l,r,i.opts.strictNumbers,Xa.DataType.Wrong)}`}return z.nil}function a(){if(s.validateSchema){let l=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,z._)`!${l}(${r})`}return z.nil}}subschema(e,r){let n=(0,gd.getSubschema)(this.it,e);(0,gd.extendSubschemaData)(n,this.it,e),(0,gd.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return XF(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=vr.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=vr.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,z.Name)),!0}};Jr.KeywordCxt=Qa;function XE(t,e,r,n){let s=new Qa(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Ii.funcKeywordCode)(s,r):"macro"in r?(0,Ii.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Ii.funcKeywordCode)(s,r)}var fM=/^\/(?:[^~]|~0|~1)*$/,dM=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function QE(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!fM.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=K.default.rootData}else{let u=dM.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let c=+u[1];if(s=u[2],s==="#"){if(c>=e)throw new Error(l("property/index",c));return n[e-c]}if(c>e)throw new Error(l("data",c));if(i=r[e-c],!s)return i}let o=i,a=s.split("/");for(let u of a)u&&(i=(0,z._)`${i}${(0,z.getProperty)((0,vr.unescapeJsonPointer)(u))}`,o=(0,z._)`${o} && ${i}`);return o;function l(u,c){return`Cannot access ${u} ${c} levels up, current level is ${e}`}}Jr.getData=QE});var Ni=E(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var Sd=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Ed.default=Sd});var wr=E(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var bd=Ai(),vd=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,bd.resolveUrl)(e,r,n),this.missingSchema=(0,bd.normalizeId)((0,bd.getFullPath)(e,this.missingRef))}};wd.default=vd});var $n=E(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.resolveSchema=kt.getCompilingSchema=kt.resolveRef=kt.compileSchema=kt.SchemaEnv=void 0;var Bt=W(),hM=Ni(),Tn=Nt(),Gt=Ai(),ZE=ee(),pM=ms(),gs=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=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,Gt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};kt.SchemaEnv=gs;function Od(t){let e=eb.call(this,t);if(e)return e;let r=(0,Gt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Bt.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:hM.default,code:(0,Bt._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");t.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:Tn.default.data,parentData:Tn.default.parentData,parentDataProperty:Tn.default.parentDataProperty,dataNames:[Tn.default.data],dataPathArr:[Bt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Bt.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Bt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bt._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(t),(0,pM.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let f=o.toString();c=`${o.scopeRefs(Tn.default.scope)}return ${f}`,this.opts.code.process&&(c=this.opts.code.process(c,t));let h=new Function(`${Tn.default.self}`,`${Tn.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{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:l,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){let{props:d,items:m}=u;h.evaluated={props:d instanceof Bt.Name?void 0:d,items:m instanceof Bt.Name?void 0:m,dynamicProps:d instanceof Bt.Name,dynamicItems:m instanceof Bt.Name},h.source&&(h.source.evaluated=(0,Bt.stringify)(h.evaluated))}return t.validate=h,t}catch(f){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),f}finally{this._compilations.delete(t)}}kt.compileSchema=Od;function mM(t,e,r){var n;r=(0,Gt.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let i=_M.call(this,t,r);if(i===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new gs({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=gM.call(this,i)}kt.resolveRef=mM;function gM(t){return(0,Gt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Od.call(this,t)}function eb(t){for(let e of this._compilations)if(yM(e,t))return e}kt.getCompilingSchema=eb;function yM(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function _M(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Za.call(this,t,e)}function Za(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Gt._getFullPath)(this.opts.uriResolver,r),s=(0,Gt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return Rd.call(this,r,t);let i=(0,Gt.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Za.call(this,t,o);return typeof a?.schema!="object"?void 0:Rd.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||Od.call(this,o),i===(0,Gt.normalizeId)(e)){let{schema:a}=o,{schemaId:l}=this.opts,u=a[l];return u&&(s=(0,Gt.resolveUrl)(this.opts.uriResolver,s,u)),new gs({schema:a,schemaId:l,root:t,baseId:s})}return Rd.call(this,r,o)}}kt.resolveSchema=Za;var SM=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Rd(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,ZE.unescapeFragment)(a)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!SM.has(a)&&u&&(e=(0,Gt.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,ZE.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Gt.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Za.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new gs({schema:r,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var tb=E((HK,EM)=>{EM.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 $d=E((VK,ib)=>{"use strict";var bM=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),nb=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 Td(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var vM=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function rb(t){return t.length=0,!0}function wM(t,e,r){if(t.length){let n=Td(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function RM(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=wM;for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(o=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(s,n,r))break;a=rb}else{s.push(u);continue}}return s.length&&(a===rb?r.zone=s.join(""):o?n.push(s.join("")):n.push(Td(s))),r.address=n.join(""),r}function sb(t){if(OM(t,":")<2)return{host:t,isIPV6:!1};let e=RM(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function OM(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function TM(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===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(s===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((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function $M(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 PM(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!nb(r)){let n=sb(r);n.isIPV6===!0?r=`[${n.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}ib.exports={nonSimpleDomain:vM,recomposeAuthority:PM,normalizeComponentEncoding:$M,removeDotSegments:TM,isIPv4:nb,isUUID:bM,normalizeIPv6:sb,stringArrayToHexStripped:Td}});var cb=E((zK,ub)=>{"use strict";var{isUUID:AM}=$d(),CM=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,IM=["http","https","ws","wss","urn","urn:uuid"];function NM(t){return IM.indexOf(t)!==-1}function Pd(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 ob(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ab(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 kM(t){return t.secure=Pd(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function xM(t){if((t.port===(Pd(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 LM(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(CM);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,i=Ad(s);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function qM(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,i=Ad(s);i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function jM(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!AM(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function DM(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var lb={scheme:"http",domainHost:!0,parse:ob,serialize:ab},FM={scheme:"https",domainHost:lb.domainHost,parse:ob,serialize:ab},el={scheme:"ws",domainHost:!0,parse:kM,serialize:xM},MM={scheme:"wss",domainHost:el.domainHost,parse:el.parse,serialize:el.serialize},HM={scheme:"urn",parse:LM,serialize:qM,skipNormalize:!0},VM={scheme:"urn:uuid",parse:jM,serialize:DM,skipNormalize:!0},tl={http:lb,https:FM,ws:el,wss:MM,urn:HM,"urn:uuid":VM};Object.setPrototypeOf(tl,null);function Ad(t){return t&&(tl[t]||tl[t.toLowerCase()])||void 0}ub.exports={wsIsSecure:Pd,SCHEMES:tl,isValidSchemeName:NM,getSchemeHandler:Ad}});var sl=E((UK,nl)=>{"use strict";var{normalizeIPv6:zM,removeDotSegments:ki,recomposeAuthority:UM,normalizeComponentEncoding:rl,isIPv4:BM,nonSimpleDomain:GM}=$d(),{SCHEMES:WM,getSchemeHandler:fb}=cb();function JM(t,e){return typeof t=="string"?t=ar(Rr(t,e),e):typeof t=="object"&&(t=Rr(ar(t,e),e)),t}function KM(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=db(Rr(t,n),Rr(e,n),n,!0);return n.skipEscape=!0,ar(s,n)}function db(t,e,r,n){let s={};return n||(t=Rr(ar(t,r),r),e=Rr(ar(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ki(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ki(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=ki(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=ki(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function YM(t,e,r){return typeof t=="string"?(t=unescape(t),t=ar(rl(Rr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=ar(rl(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=ar(rl(Rr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=ar(rl(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function ar(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:""},n=Object.assign({},e),s=[],i=fb(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=UM(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=ki(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var XM=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Rr(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(XM);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(BM(n.host)===!1){let l=zM(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=fb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&GM(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var Cd={SCHEMES:WM,normalize:JM,resolve:KM,resolveComponent:db,equal:YM,serialize:ar,parse:Rr};nl.exports=Cd;nl.exports.default=Cd;nl.exports.fastUri=Cd});var pb=E(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});var hb=sl();hb.code='require("ajv/dist/runtime/uri").default';Id.default=hb});var xd=E(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.CodeGen=Je.Name=Je.nil=Je.stringify=Je.str=Je._=Je.KeywordCxt=void 0;var QM=ms();Object.defineProperty(Je,"KeywordCxt",{enumerable:!0,get:function(){return QM.KeywordCxt}});var ys=W();Object.defineProperty(Je,"_",{enumerable:!0,get:function(){return ys._}});Object.defineProperty(Je,"str",{enumerable:!0,get:function(){return ys.str}});Object.defineProperty(Je,"stringify",{enumerable:!0,get:function(){return ys.stringify}});Object.defineProperty(Je,"nil",{enumerable:!0,get:function(){return ys.nil}});Object.defineProperty(Je,"Name",{enumerable:!0,get:function(){return ys.Name}});Object.defineProperty(Je,"CodeGen",{enumerable:!0,get:function(){return ys.CodeGen}});var ZM=Ni(),Sb=wr(),eH=ad(),xi=$n(),tH=W(),Li=Ai(),il=$i(),kd=ee(),mb=tb(),rH=pb(),Eb=(t,e)=>new RegExp(t,e);Eb.code="new RegExp";var nH=["removeAdditional","useDefaults","coerceTypes"],sH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),iH={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."},oH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gb=200;function aH(t){var e,r,n,s,i,o,a,l,u,c,f,p,h,d,m,g,S,b,_,y,R,T,O,w,$;let v=t.strict,P=(e=t.code)===null||e===void 0?void 0:e.optimize,C=P===!0||P===void 0?1:P||0,k=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Eb,M=(s=t.uriResolver)!==null&&s!==void 0?s:rH.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:v)!==null&&o!==void 0?o:!0,strictNumbers:(l=(a=t.strictNumbers)!==null&&a!==void 0?a:v)!==null&&l!==void 0?l:!0,strictTypes:(c=(u=t.strictTypes)!==null&&u!==void 0?u:v)!==null&&c!==void 0?c:"log",strictTuples:(p=(f=t.strictTuples)!==null&&f!==void 0?f:v)!==null&&p!==void 0?p:"log",strictRequired:(d=(h=t.strictRequired)!==null&&h!==void 0?h:v)!==null&&d!==void 0?d:!1,code:t.code?{...t.code,optimize:C,regExp:k}:{optimize:C,regExp:k},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:gb,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:gb,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:(_=t.inlineRefs)!==null&&_!==void 0?_:!0,schemaId:(y=t.schemaId)!==null&&y!==void 0?y:"$id",addUsedSchema:(R=t.addUsedSchema)!==null&&R!==void 0?R:!0,validateSchema:(T=t.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(w=t.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:($=t.int32range)!==null&&$!==void 0?$:!0,uriResolver:M}}var qi=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...aH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new tH.ValueScope({scope:{},prefixes:sH,es5:r,lines:n}),this.logger=hH(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,eH.getRules)(),yb.call(this,iH,e,"NOT SUPPORTED"),yb.call(this,oH,e,"DEPRECATED","warn"),this._metaOpts=fH.call(this),e.formats&&uH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&cH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),lH.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=mb;n==="id"&&(s={...mb},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!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 n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(c,f){await i.call(this,c.$schema);let p=this._addSchema(c,f);return p.validate||o.call(this,p)}async function i(c){c&&!this.getSchema(c)&&await s.call(this,{$ref:c},!0)}async function o(c){try{return this._compileSchemaEnv(c)}catch(f){if(!(f instanceof Sb.default))throw f;return a.call(this,f),await l.call(this,f.missingSchema),o.call(this,c)}}function a({missingSchema:c,missingRef:f}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${f} cannot be resolved`)}async function l(c){let f=await u.call(this,c);this.refs[c]||await i.call(this,f.$schema),this.refs[c]||this.addSchema(f,c,r)}async function u(c){let f=this._loading[c];if(f)return f;try{return await(this._loading[c]=n(c))}finally{delete this._loading[c]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);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,Li.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let r;for(;typeof(r=_b.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new xi.SchemaEnv({schema:{},schemaId:n});if(r=xi.resolveSchema.call(this,s,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=_b.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 n=e[this.opts.schemaId];return n&&(n=(0,Li.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),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 n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(mH.call(this,n,r),!r)return(0,kd.eachItem)(n,i=>Nd.call(this,i)),this;yH.call(this,r);let s={...r,type:(0,il.getJSONTypes)(r.type),schemaType:(0,il.getJSONTypes)(r.schemaType)};return(0,kd.eachItem)(n,s.type.length===0?i=>Nd.call(this,i,s):i=>s.type.forEach(o=>Nd.call(this,i,s,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 n of r.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,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:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:u}=l.definition,c=o[a];u&&c&&(o[a]=bb(c))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=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 l=this._cache.get(e);if(l!==void 0)return l;n=(0,Li.normalizeId)(o||n);let u=Li.getSchemaRefs.call(this,e,n);return l=new xi.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(e,!0),l}_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):xi.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{xi.compileSchema.call(this,e)}finally{this.opts=r}}};qi.ValidationError=ZM.default;qi.MissingRefError=Sb.default;Je.default=qi;function yb(t,e,r,n="error"){for(let s in t){let i=s;i in e&&this.logger[n](`${r}: option ${s}. ${t[i]}`)}}function _b(t){return t=(0,Li.normalizeId)(t),this.schemas[t]||this.refs[t]}function lH(){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 uH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function cH(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 fH(){let t={...this.opts};for(let e of nH)delete t[e];return t}var dH={log(){},warn(){},error(){}};function hH(t){if(t===!1)return dH;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 pH=/^[a-z_$][a-z0-9_$:-]*$/i;function mH(t,e){let{RULES:r}=this;if((0,kd.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!pH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Nd(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:l})=>l===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,il.getJSONTypes)(e.type),schemaType:(0,il.getJSONTypes)(e.schemaType)}};e.before?gH.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function gH(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function yH(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=bb(e)),t.validateSchema=this.compile(e,!0))}var _H={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function bb(t){return{anyOf:[t,_H]}}});var vb=E(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var SH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ld.default=SH});var qd=E(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.callRef=Pn.getValidate=void 0;var EH=wr(),wb=We(),bt=W(),_s=Nt(),Rb=$n(),ol=ee(),bH={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:l}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return f();let c=Rb.resolveRef.call(l,u,s,r);if(c===void 0)throw new EH.default(n.opts.uriResolver,s,r);if(c instanceof Rb.SchemaEnv)return p(c);return h(c);function f(){if(i===u)return al(t,o,i,i.$async);let d=e.scopeValue("root",{ref:u});return al(t,(0,bt._)`${d}.validate`,u,u.$async)}function p(d){let m=Ob(t,d);al(t,m,d,d.$async)}function h(d){let m=e.scopeValue("schema",a.code.source===!0?{ref:d,code:(0,bt.stringify)(d)}:{ref:d}),g=e.name("valid"),S=t.subschema({schema:d,dataTypes:[],schemaPath:bt.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(S),t.ok(g)}}};function Ob(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,bt._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Pn.getValidate=Ob;function al(t,e,r,n){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:l}=i,u=l.passContext?_s.default.this:bt.nil;n?c():f();function c(){if(!a.$async)throw new Error("async schema referenced by sync schema");let d=s.let("valid");s.try(()=>{s.code((0,bt._)`await ${(0,wb.callValidateCode)(t,e,u)}`),h(e),o||s.assign(d,!0)},m=>{s.if((0,bt._)`!(${m} instanceof ${i.ValidationError})`,()=>s.throw(m)),p(m),o||s.assign(d,!1)}),t.ok(d)}function f(){t.result((0,wb.callValidateCode)(t,e,u),()=>h(e),()=>p(e))}function p(d){let m=(0,bt._)`${d}.errors`;s.assign(_s.default.vErrors,(0,bt._)`${_s.default.vErrors} === null ? ${m} : ${_s.default.vErrors}.concat(${m})`),s.assign(_s.default.errors,(0,bt._)`${_s.default.vErrors}.length`)}function h(d){var m;if(!i.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=ol.mergeEvaluated.props(s,g.props,i.props));else{let S=s.var("props",(0,bt._)`${d}.evaluated.props`);i.props=ol.mergeEvaluated.props(s,S,i.props,bt.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=ol.mergeEvaluated.items(s,g.items,i.items));else{let S=s.var("items",(0,bt._)`${d}.evaluated.items`);i.items=ol.mergeEvaluated.items(s,S,i.items,bt.Name)}}}Pn.callRef=al;Pn.default=bH});var Tb=E(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var vH=vb(),wH=qd(),RH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",vH.default,wH.default];jd.default=RH});var $b=E(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var ll=W(),Kr=ll.operators,ul={maximum:{okStr:"<=",ok:Kr.LTE,fail:Kr.GT},minimum:{okStr:">=",ok:Kr.GTE,fail:Kr.LT},exclusiveMaximum:{okStr:"<",ok:Kr.LT,fail:Kr.GTE},exclusiveMinimum:{okStr:">",ok:Kr.GT,fail:Kr.LTE}},OH={message:({keyword:t,schemaCode:e})=>(0,ll.str)`must be ${ul[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ll._)`{comparison: ${ul[t].okStr}, limit: ${e}}`},TH={keyword:Object.keys(ul),type:"number",schemaType:"number",$data:!0,error:OH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ll._)`${r} ${ul[e].fail} ${n} || isNaN(${r})`)}};Dd.default=TH});var Pb=E(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var ji=W(),$H={message:({schemaCode:t})=>(0,ji.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ji._)`{multipleOf: ${t}}`},PH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:$H,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,ji._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,ji._)`${o} !== parseInt(${o})`;t.fail$data((0,ji._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};Fd.default=PH});var Cb=E(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});function Ab(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Md.default=Ab;Ab.code='require("ajv/dist/runtime/ucs2length").default'});var Ib=E(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var An=W(),AH=ee(),CH=Cb(),IH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,An.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,An._)`{limit: ${t}}`},NH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:IH,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?An.operators.GT:An.operators.LT,o=s.opts.unicode===!1?(0,An._)`${r}.length`:(0,An._)`${(0,AH.useFunc)(t.gen,CH.default)}(${r})`;t.fail$data((0,An._)`${o} ${i} ${n}`)}};Hd.default=NH});var Nb=E(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var kH=We(),cl=W(),xH={message:({schemaCode:t})=>(0,cl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,cl._)`{pattern: ${t}}`},LH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xH,code(t){let{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,o=i.opts.unicodeRegExp?"u":"",a=r?(0,cl._)`(new RegExp(${s}, ${o}))`:(0,kH.usePattern)(t,n);t.fail$data((0,cl._)`!${a}.test(${e})`)}};Vd.default=LH});var kb=E(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var Di=W(),qH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Di.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Di._)`{limit: ${t}}`},jH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qH,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?Di.operators.GT:Di.operators.LT;t.fail$data((0,Di._)`Object.keys(${r}).length ${s} ${n}`)}};zd.default=jH});var xb=E(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var Fi=We(),Mi=W(),DH=ee(),FH={message:({params:{missingProperty:t}})=>(0,Mi.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Mi._)`{missingProperty: ${t}}`},MH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:FH,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&r.length===0)return;let l=r.length>=a.loopRequired;if(o.allErrors?u():c(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:d}=t.it;for(let m of r)if(h?.[m]===void 0&&!d.has(m)){let g=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,DH.checkStrictMode)(o,S,o.opts.strictRequired)}}function u(){if(l||i)t.block$data(Mi.nil,f);else for(let h of r)(0,Fi.checkReportMissingProp)(t,h)}function c(){let h=e.let("missing");if(l||i){let d=e.let("valid",!0);t.block$data(d,()=>p(h,d)),t.ok(d)}else e.if((0,Fi.checkMissingProp)(t,r,h)),(0,Fi.reportMissingProp)(t,h),e.else()}function f(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h}),e.if((0,Fi.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function p(h,d){t.setParams({missingProperty:h}),e.forOf(h,n,()=>{e.assign(d,(0,Fi.propertyInData)(e,s,h,a.ownProperties)),e.if((0,Mi.not)(d),()=>{t.error(),e.break()})},Mi.nil)}}};Ud.default=MH});var Lb=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var Hi=W(),HH={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Hi.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Hi._)`{limit: ${t}}`},VH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:HH,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Hi.operators.GT:Hi.operators.LT;t.fail$data((0,Hi._)`${r}.length ${s} ${n}`)}};Bd.default=VH});var Vi=E(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var qb=Pi();qb.code='require("ajv/dist/runtime/equal").default';Gd.default=qb});var jb=E(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var Wd=$i(),Ke=W(),zH=ee(),UH=Vi(),BH={message:({params:{i:t,j:e}})=>(0,Ke.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ke._)`{i: ${t}, j: ${e}}`},GH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:BH,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!n&&!s)return;let l=e.let("valid"),u=i.items?(0,Wd.getSchemaTypes)(i.items):[];t.block$data(l,c,(0,Ke._)`${o} === false`),t.ok(l);function c(){let d=e.let("i",(0,Ke._)`${r}.length`),m=e.let("j");t.setParams({i:d,j:m}),e.assign(l,!0),e.if((0,Ke._)`${d} > 1`,()=>(f()?p:h)(d,m))}function f(){return u.length>0&&!u.some(d=>d==="object"||d==="array")}function p(d,m){let g=e.name("item"),S=(0,Wd.checkDataTypes)(u,g,a.opts.strictNumbers,Wd.DataType.Wrong),b=e.const("indices",(0,Ke._)`{}`);e.for((0,Ke._)`;${d}--;`,()=>{e.let(g,(0,Ke._)`${r}[${d}]`),e.if(S,(0,Ke._)`continue`),u.length>1&&e.if((0,Ke._)`typeof ${g} == "string"`,(0,Ke._)`${g} += "_"`),e.if((0,Ke._)`typeof ${b}[${g}] == "number"`,()=>{e.assign(m,(0,Ke._)`${b}[${g}]`),t.error(),e.assign(l,!1).break()}).code((0,Ke._)`${b}[${g}] = ${d}`)})}function h(d,m){let g=(0,zH.useFunc)(e,UH.default),S=e.name("outer");e.label(S).for((0,Ke._)`;${d}--;`,()=>e.for((0,Ke._)`${m} = ${d}; ${m}--;`,()=>e.if((0,Ke._)`${g}(${r}[${d}], ${r}[${m}])`,()=>{t.error(),e.assign(l,!1).break(S)})))}}};Jd.default=GH});var Db=E(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var Kd=W(),WH=ee(),JH=Vi(),KH={message:"must be equal to constant",params:({schemaCode:t})=>(0,Kd._)`{allowedValue: ${t}}`},YH={keyword:"const",$data:!0,error:KH,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Kd._)`!${(0,WH.useFunc)(e,JH.default)}(${r}, ${s})`):t.fail((0,Kd._)`${i} !== ${r}`)}};Yd.default=YH});var Fb=E(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});var zi=W(),XH=ee(),QH=Vi(),ZH={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,zi._)`{allowedValues: ${t}}`},e2={keyword:"enum",schemaType:"array",$data:!0,error:ZH,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,XH.useFunc)(e,QH.default)),c;if(a||n)c=e.let("valid"),t.block$data(c,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",i);c=(0,zi.or)(...s.map((d,m)=>p(h,m)))}t.pass(c);function f(){e.assign(c,!1),e.forOf("v",i,h=>e.if((0,zi._)`${u()}(${r}, ${h})`,()=>e.assign(c,!0).break()))}function p(h,d){let m=s[d];return typeof m=="object"&&m!==null?(0,zi._)`${u()}(${r}, ${h}[${d}])`:(0,zi._)`${r} === ${m}`}}};Xd.default=e2});var Mb=E(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var t2=$b(),r2=Pb(),n2=Ib(),s2=Nb(),i2=kb(),o2=xb(),a2=Lb(),l2=jb(),u2=Db(),c2=Fb(),f2=[t2.default,r2.default,n2.default,s2.default,i2.default,o2.default,a2.default,l2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u2.default,c2.default];Qd.default=f2});var eh=E(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.validateAdditionalItems=void 0;var Cn=W(),Zd=ee(),d2={message:({params:{len:t}})=>(0,Cn.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Cn._)`{limit: ${t}}`},h2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:d2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Zd.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Hb(t,n)}};function Hb(t,e){let{gen:r,schema:n,data:s,keyword:i,it:o}=t;o.items=!0;let a=r.const("len",(0,Cn._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Cn._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,Zd.alwaysValidSchema)(o,n)){let u=r.var("valid",(0,Cn._)`${a} <= ${e.length}`);r.if((0,Cn.not)(u),()=>l(u)),t.ok(u)}function l(u){r.forRange("i",e.length,a,c=>{t.subschema({keyword:i,dataProp:c,dataPropType:Zd.Type.Num},u),o.allErrors||r.if((0,Cn.not)(u),()=>r.break())})}}Ui.validateAdditionalItems=Hb;Ui.default=h2});var th=E(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateTuple=void 0;var Vb=W(),fl=ee(),p2=We(),m2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return zb(t,"additionalItems",e);r.items=!0,!(0,fl.alwaysValidSchema)(r,e)&&t.ok((0,p2.validateArray)(t))}};function zb(t,e,r=t.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=t;c(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=fl.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),u=n.const("len",(0,Vb._)`${i}.length`);r.forEach((f,p)=>{(0,fl.alwaysValidSchema)(a,f)||(n.if((0,Vb._)`${u} > ${p}`,()=>t.subschema({keyword:o,schemaProp:p,dataProp:p},l)),t.ok(l))});function c(f){let{opts:p,errSchemaPath:h}=a,d=r.length,m=d===f.minItems&&(d===f.maxItems||f[e]===!1);if(p.strictTuples&&!m){let g=`"${o}" is ${d}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,fl.checkStrictMode)(a,g,p.strictTuples)}}}Bi.validateTuple=zb;Bi.default=m2});var Ub=E(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var g2=th(),y2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,g2.validateTuple)(t,"items")};rh.default=y2});var Gb=E(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var Bb=W(),_2=ee(),S2=We(),E2=eh(),b2={message:({params:{len:t}})=>(0,Bb.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Bb._)`{limit: ${t}}`},v2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:b2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,_2.alwaysValidSchema)(n,e)&&(s?(0,E2.validateAdditionalItems)(t,s):t.ok((0,S2.validateArray)(t)))}};nh.default=v2});var Wb=E(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var xt=W(),dl=ee(),w2={message:({params:{min:t,max:e}})=>e===void 0?(0,xt.str)`must contain at least ${t} valid item(s)`:(0,xt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,xt._)`{minContains: ${t}}`:(0,xt._)`{minContains: ${t}, maxContains: ${e}}`},R2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:w2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t,o,a,{minContains:l,maxContains:u}=n;i.opts.next?(o=l===void 0?1:l,a=u):o=1;let c=e.const("len",(0,xt._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,dl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,dl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,dl.alwaysValidSchema)(i,r)){let m=(0,xt._)`${c} >= ${o}`;a!==void 0&&(m=(0,xt._)`${m} && ${c} <= ${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,xt._)`${s}.length > 0`,p)):(e.let(f,!1),p()),t.result(f,()=>t.reset());function p(){let m=e.name("_valid"),g=e.let("count",0);h(m,()=>e.if(m,()=>d(g)))}function h(m,g){e.forRange("i",0,c,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:dl.Type.Num,compositeRule:!0},m),g()})}function d(m){e.code((0,xt._)`${m}++`),a===void 0?e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0).break()):(e.if((0,xt._)`${m} > ${a}`,()=>e.assign(f,!1).break()),o===1?e.assign(f,!0):e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0)))}}};sh.default=R2});var Yb=E(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.validateSchemaDeps=lr.validatePropertyDeps=lr.error=void 0;var ih=W(),O2=ee(),Gi=We();lr.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,ih.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,ih._)`{property: ${t},
|
|
55
|
+
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,Z._)`[${s}]`)}}}function uF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Z._)`${e} !== undefined`,()=>t.assign((0,Z._)`${e}[${r}]`,n))}function cd(t,e,r,n=ds.Correct){let s=n===ds.Correct?Z.operators.EQ:Z.operators.NEQ,i;switch(t){case"null":return(0,Z._)`${e} ${s} null`;case"array":i=(0,Z._)`Array.isArray(${e})`;break;case"object":i=(0,Z._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,Z._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,Z._)`typeof ${e} ${s} ${t}`}return n===ds.Correct?i:(0,Z.not)(i);function o(a=Z.nil){return(0,Z.and)((0,Z._)`typeof ${e} == "number"`,a,r?(0,Z._)`isFinite(${e})`:Z.nil)}}et.checkDataType=cd;function fd(t,e,r,n){if(t.length===1)return cd(t[0],e,r,n);let s,i=(0,wE.toHash)(t);if(i.array&&i.object){let o=(0,Z._)`typeof ${e} != "object"`;s=i.null?o:(0,Z._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=Z.nil;i.number&&delete i.integer;for(let o in i)s=(0,Z.and)(s,cd(o,e,r,n));return s}et.checkDataTypes=fd;var cF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Z._)`{type: ${t}}`:(0,Z._)`{type: ${e}}`};function dd(t){let e=fF(t);(0,sF.reportError)(e,cF)}et.reportTypeError=dd;function fF(t){let{gen:e,data:r,schema:n}=t,s=(0,wE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var $E=E(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.assignDefaults=void 0;var hs=W(),dF=ee();function hF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)TE(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>TE(t,i,s.default))}Ka.assignDefaults=hF;function TE(t,e,r){let{gen:n,compositeRule:s,data:i,opts:o}=t;if(r===void 0)return;let a=(0,hs._)`${i}${(0,hs.getProperty)(e)}`;if(s){(0,dF.checkStrictMode)(t,`default is ignored for: ${a}`);return}let l=(0,hs._)`${a} === undefined`;o.useDefaults==="empty"&&(l=(0,hs._)`${l} || ${a} === null || ${a} === ""`),n.if(l,(0,hs._)`${a} = ${(0,hs.stringify)(r)}`)}});var We=E(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.validateUnion=_e.validateArray=_e.usePattern=_e.callValidateCode=_e.schemaProperties=_e.allSchemaProperties=_e.noPropertyInData=_e.propertyInData=_e.isOwnProperty=_e.hasPropFunc=_e.reportMissingProp=_e.checkMissingProp=_e.checkReportMissingProp=void 0;var be=W(),hd=ee(),Br=Nt(),pF=ee();function mF(t,e){let{gen:r,data:n,it:s}=t;r.if(md(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,be._)`${e}`},!0),t.error()})}_e.checkReportMissingProp=mF;function gF({gen:t,data:e,it:{opts:r}},n,s){return(0,be.or)(...n.map(i=>(0,be.and)(md(t,e,i,r.ownProperties),(0,be._)`${s} = ${i}`)))}_e.checkMissingProp=gF;function yF(t,e){t.setParams({missingProperty:e},!0),t.error()}_e.reportMissingProp=yF;function PE(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,be._)`Object.prototype.hasOwnProperty`})}_e.hasPropFunc=PE;function pd(t,e,r){return(0,be._)`${PE(t)}.call(${e}, ${r})`}_e.isOwnProperty=pd;function _F(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} !== undefined`;return n?(0,be._)`${s} && ${pd(t,e,r)}`:s}_e.propertyInData=_F;function md(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} === undefined`;return n?(0,be.or)(s,(0,be.not)(pd(t,e,r))):s}_e.noPropertyInData=md;function AE(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}_e.allSchemaProperties=AE;function SF(t,e){return AE(e).filter(r=>!(0,hd.alwaysValidSchema)(t,e[r]))}_e.schemaProperties=SF;function EF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,l,u){let c=u?(0,be._)`${t}, ${e}, ${n}${s}`:e,f=[[Br.default.instancePath,(0,be.strConcat)(Br.default.instancePath,i)],[Br.default.parentData,o.parentData],[Br.default.parentDataProperty,o.parentDataProperty],[Br.default.rootData,Br.default.rootData]];o.opts.dynamicRef&&f.push([Br.default.dynamicAnchors,Br.default.dynamicAnchors]);let p=(0,be._)`${c}, ${r.object(...f)}`;return l!==be.nil?(0,be._)`${a}.call(${l}, ${p})`:(0,be._)`${a}(${p})`}_e.callValidateCode=EF;var bF=(0,be._)`new RegExp`;function vF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,be._)`${s.code==="new RegExp"?bF:(0,pF.useFunc)(t,s)}(${r}, ${n})`})}_e.usePattern=vF;function wF(t){let{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.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 l=e.const("len",(0,be._)`${r}.length`);e.forRange("i",0,l,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:hd.Type.Num},i),e.if((0,be.not)(i),a)})}}_e.validateArray=wF;function RF(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,hd.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((l,u)=>{let c=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(o,(0,be._)`${o} || ${a}`),t.mergeValidEvaluated(c,a)||e.if((0,be.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}_e.validateUnion=RF});var NE=E(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.validateKeywordUsage=ir.validSchemaType=ir.funcKeywordCode=ir.macroKeywordCode=void 0;var ot=W(),On=Nt(),OF=We(),TF=Ti();function $F(t,e){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),l=IE(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ot.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}ir.macroKeywordCode=$F;function PF(t,e){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:l}=t;CF(l,e);let u=!a&&e.compile?e.compile.call(l.self,i,o,l):e.validate,c=IE(n,s,u),f=n.let("valid");t.block$data(f,p),t.ok((r=e.valid)!==null&&r!==void 0?r:f);function p(){if(e.errors===!1)m(),e.modifying&&CE(t),g(()=>t.error());else{let S=e.async?h():d();e.modifying&&CE(t),g(()=>AF(t,S))}}function h(){let S=n.let("ruleErrs",null);return n.try(()=>m((0,ot._)`await `),b=>n.assign(f,!1).if((0,ot._)`${b} instanceof ${l.ValidationError}`,()=>n.assign(S,(0,ot._)`${b}.errors`),()=>n.throw(b))),S}function d(){let S=(0,ot._)`${c}.errors`;return n.assign(S,null),m(ot.nil),S}function m(S=e.async?(0,ot._)`await `:ot.nil){let b=l.opts.passContext?On.default.this:On.default.self,_=!("compile"in e&&!a||e.schema===!1);n.assign(f,(0,ot._)`${S}${(0,OF.callValidateCode)(t,c,b,_)}`,e.modifying)}function g(S){var b;n.if((0,ot.not)((b=e.valid)!==null&&b!==void 0?b:f),S)}}ir.funcKeywordCode=PF;function CE(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,ot._)`${n.parentData}[${n.parentDataProperty}]`))}function AF(t,e){let{gen:r}=t;r.if((0,ot._)`Array.isArray(${e})`,()=>{r.assign(On.default.vErrors,(0,ot._)`${On.default.vErrors} === null ? ${e} : ${On.default.vErrors}.concat(${e})`).assign(On.default.errors,(0,ot._)`${On.default.vErrors}.length`),(0,TF.extendErrors)(t)},()=>t.error())}function CF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function IE(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,ot.stringify)(r)})}function IF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ir.validSchemaType=IF;function NF({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let l=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}ir.validateKeywordUsage=NF});var xE=E(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.extendSubschemaMode=Gr.extendSubschemaData=Gr.getSubschema=void 0;var or=W(),kE=ee();function kF(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==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,or._)`${t.schemaPath}${(0,or.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,or._)`${t.schemaPath}${(0,or.getProperty)(e)}${(0,or.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,kE.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Gr.getSubschema=kF;function xF(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==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:c,opts:f}=e,p=a.let("data",(0,or._)`${e.data}${(0,or.getProperty)(r)}`,!0);l(p),t.errorPath=(0,or.str)`${u}${(0,kE.getErrorPath)(r,n,f.jsPropertySyntax)}`,t.parentDataProperty=(0,or._)`${r}`,t.dataPathArr=[...c,t.parentDataProperty]}if(s!==void 0){let u=s instanceof or.Name?s:a.let("data",s,!0);l(u),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function l(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Gr.extendSubschemaData=xF;function LF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}Gr.extendSubschemaMode=LF});var Pi=E((UK,LE)=>{"use strict";LE.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 n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var jE=E((BK,qE)=>{"use strict";var Wr=qE.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Ya(e,n,s,t,"",t)};Wr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Wr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Wr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Wr.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 Ya(t,e,r,n,s,i,o,a,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,l,u);for(var c in n){var f=n[c];if(Array.isArray(f)){if(c in Wr.arrayKeywords)for(var p=0;p<f.length;p++)Ya(t,e,r,f[p],s+"/"+c+"/"+p,i,s,c,n,p)}else if(c in Wr.propsKeywords){if(f&&typeof f=="object")for(var h in f)Ya(t,e,r,f[h],s+"/"+c+"/"+qF(h),i,s,c,n,h)}else(c in Wr.keywords||t.allKeys&&!(c in Wr.skipKeywords))&&Ya(t,e,r,f,s+"/"+c,i,s,c,n)}r(n,s,i,o,a,l,u)}}function qF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ai=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.getSchemaRefs=Et.resolveUrl=Et.normalizeId=Et._getFullPath=Et.getFullPath=Et.inlineRef=void 0;var jF=ee(),DF=Pi(),FF=jE(),MF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function HF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!gd(t):e?DE(t)<=e:!1}Et.inlineRef=HF;var VF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function gd(t){for(let e in t){if(VF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(gd)||typeof r=="object"&&gd(r))return!0}return!1}function DE(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!MF.has(r)&&(typeof t[r]=="object"&&(0,jF.eachItem)(t[r],n=>e+=DE(n)),e===1/0))return 1/0}return e}function FE(t,e="",r){r!==!1&&(e=ps(e));let n=t.parse(e);return ME(t,n)}Et.getFullPath=FE;function ME(t,e){return t.serialize(e).split("#")[0]+"#"}Et._getFullPath=ME;var zF=/#\/?$/;function ps(t){return t?t.replace(zF,""):""}Et.normalizeId=ps;function UF(t,e,r){return r=ps(r),t.resolve(e,r)}Et.resolveUrl=UF;var BF=/^[a-z_][-a-z0-9._]*$/i;function GF(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ps(t[r]||e),i={"":s},o=FE(n,s,!1),a={},l=new Set;return FF(t,{allKeys:!0},(f,p,h,d)=>{if(d===void 0)return;let m=o+p,g=i[d];typeof f[r]=="string"&&(g=S.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),i[p]=g;function S(_){let y=this.opts.uriResolver.resolve;if(_=ps(g?y(g,_):_),l.has(_))throw c(_);l.add(_);let R=this.refs[_];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?u(f,R.schema,_):_!==ps(m)&&(_[0]==="#"?(u(f,a[_],_),a[_]=f):this.refs[_]=m),_}function b(_){if(typeof _=="string"){if(!BF.test(_))throw new Error(`invalid anchor "${_}"`);S.call(this,`#${_}`)}}}),a;function u(f,p,h){if(p!==void 0&&!DF(f,p))throw c(h)}function c(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Et.getSchemaRefs=GF});var ms=E(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.getData=Jr.KeywordCxt=Jr.validateFunctionCode=void 0;var BE=EE(),HE=$i(),_d=ud(),Xa=$i(),WF=$E(),Ii=NE(),yd=xE(),z=W(),K=Nt(),JF=Ai(),vr=ee(),Ci=Ti();function KF(t){if(JE(t)&&(KE(t),WE(t))){QF(t);return}GE(t,()=>(0,BE.topBoolOrEmptySchema)(t))}Jr.validateFunctionCode=KF;function GE({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,z._)`${K.default.data}, ${K.default.valCxt}`,n.$async,()=>{t.code((0,z._)`"use strict"; ${VE(r,s)}`),XF(t,s),t.code(i)}):t.func(e,(0,z._)`${K.default.data}, ${YF(s)}`,n.$async,()=>t.code(VE(r,s)).code(i))}function YF(t){return(0,z._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,z._)`, ${K.default.dynamicAnchors}={}`:z.nil}}={}`}function XF(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,z._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,z._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,z._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,z._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,z._)`""`),t.var(K.default.parentData,(0,z._)`undefined`),t.var(K.default.parentDataProperty,(0,z._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`{}`)})}function QF(t){let{schema:e,opts:r,gen:n}=t;GE(t,()=>{r.$comment&&e.$comment&&XE(t),nM(t),n.let(K.default.vErrors,null),n.let(K.default.errors,0),r.unevaluated&&ZF(t),YE(t),oM(t)})}function ZF(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,z._)`${r}.evaluated`),e.if((0,z._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,z._)`${t.evaluated}.props`,(0,z._)`undefined`)),e.if((0,z._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,z._)`${t.evaluated}.items`,(0,z._)`undefined`))}function VE(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,z._)`/*# sourceURL=${r} */`:z.nil}function eM(t,e){if(JE(t)&&(KE(t),WE(t))){tM(t,e);return}(0,BE.boolOrEmptySchema)(t,e)}function WE({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 JE(t){return typeof t.schema!="boolean"}function tM(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&XE(t),sM(t),iM(t);let i=n.const("_errs",K.default.errors);YE(t,i),n.var(e,(0,z._)`${i} === ${K.default.errors}`)}function KE(t){(0,vr.checkUnknownRules)(t),rM(t)}function YE(t,e){if(t.opts.jtd)return zE(t,[],!1,e);let r=(0,HE.getSchemaTypes)(t.schema),n=(0,HE.coerceAndCheckDataType)(t,r);zE(t,r,!n,e)}function rM(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,vr.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function nM(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,vr.checkStrictMode)(t,"default is ignored in the schema root")}function sM(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,JF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function iM(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function XE({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)t.code((0,z._)`${K.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,z.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,z._)`${K.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function oM(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,z._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,z._)`new ${s}(${K.default.vErrors})`)):(e.assign((0,z._)`${n}.errors`,K.default.vErrors),i.unevaluated&&aM(t),e.return((0,z._)`${K.default.errors} === 0`))}function aM({gen:t,evaluated:e,props:r,items:n}){r instanceof z.Name&&t.assign((0,z._)`${e}.props`,r),n instanceof z.Name&&t.assign((0,z._)`${e}.items`,n)}function zE(t,e,r,n){let{gen:s,schema:i,data:o,allErrors:a,opts:l,self:u}=t,{RULES:c}=u;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,vr.schemaHasRulesButRef)(i,c))){s.block(()=>ZE(t,"$ref",c.all.$ref.definition));return}l.jtd||lM(t,e),s.block(()=>{for(let p of c.rules)f(p);f(c.post)});function f(p){(0,_d.shouldUseGroup)(i,p)&&(p.type?(s.if((0,Xa.checkDataType)(p.type,o,l.strictNumbers)),UE(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,Xa.reportTypeError)(t)),s.endIf()):UE(t,p),a||s.if((0,z._)`${K.default.errors} === ${n||0}`))}}function UE(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,WF.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,_d.shouldUseRule)(n,i)&&ZE(t,i.keyword,i.definition,e.type)})}function lM(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(uM(t,e),t.opts.allowUnionTypes||cM(t,e),fM(t,t.dataTypes))}function uM(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{QE(t.dataTypes,r)||Sd(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hM(t,e)}}function cM(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Sd(t,"use allowUnionTypes to allow union type keyword")}function fM(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,_d.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>dM(e,o))&&Sd(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function dM(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function QE(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hM(t,e){let r=[];for(let n of t.dataTypes)QE(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Sd(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,vr.checkStrictMode)(t,e,t.opts.strictTypes)}var Qa=class{constructor(e,r,n){if((0,Ii.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,vr.schemaRefOrVal)(e,this.schema,n,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",eb(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ii.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",K.default.errors))}result(e,r,n){this.failResult((0,z.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():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,z.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,z._)`${r} !== undefined && (${(0,z.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ci.reportExtraError:Ci.reportError)(this,this.def.error,r)}$dataError(){(0,Ci.reportError)(this,this.def.$dataError||Ci.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ci.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,n=z.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=z.nil,r=z.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,z.or)((0,z._)`${s} === undefined`,r)),e!==z.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==z.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,z.or)(o(),a());function o(){if(n.length){if(!(r instanceof z.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,z._)`${(0,Xa.checkDataTypes)(l,r,i.opts.strictNumbers,Xa.DataType.Wrong)}`}return z.nil}function a(){if(s.validateSchema){let l=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,z._)`!${l}(${r})`}return z.nil}}subschema(e,r){let n=(0,yd.getSubschema)(this.it,e);(0,yd.extendSubschemaData)(n,this.it,e),(0,yd.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return eM(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=vr.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=vr.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,z.Name)),!0}};Jr.KeywordCxt=Qa;function ZE(t,e,r,n){let s=new Qa(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Ii.funcKeywordCode)(s,r):"macro"in r?(0,Ii.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Ii.funcKeywordCode)(s,r)}var pM=/^\/(?:[^~]|~0|~1)*$/,mM=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function eb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!pM.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=K.default.rootData}else{let u=mM.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let c=+u[1];if(s=u[2],s==="#"){if(c>=e)throw new Error(l("property/index",c));return n[e-c]}if(c>e)throw new Error(l("data",c));if(i=r[e-c],!s)return i}let o=i,a=s.split("/");for(let u of a)u&&(i=(0,z._)`${i}${(0,z.getProperty)((0,vr.unescapeJsonPointer)(u))}`,o=(0,z._)`${o} && ${i}`);return o;function l(u,c){return`Cannot access ${u} ${c} levels up, current level is ${e}`}}Jr.getData=eb});var Ni=E(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var Ed=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};bd.default=Ed});var wr=E(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var vd=Ai(),wd=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,vd.resolveUrl)(e,r,n),this.missingSchema=(0,vd.normalizeId)((0,vd.getFullPath)(e,this.missingRef))}};Rd.default=wd});var $n=E(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.resolveSchema=kt.getCompilingSchema=kt.resolveRef=kt.compileSchema=kt.SchemaEnv=void 0;var Bt=W(),gM=Ni(),Tn=Nt(),Gt=Ai(),tb=ee(),yM=ms(),gs=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=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,Gt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};kt.SchemaEnv=gs;function Td(t){let e=rb.call(this,t);if(e)return e;let r=(0,Gt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Bt.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:gM.default,code:(0,Bt._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");t.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:Tn.default.data,parentData:Tn.default.parentData,parentDataProperty:Tn.default.parentDataProperty,dataNames:[Tn.default.data],dataPathArr:[Bt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Bt.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Bt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bt._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(t),(0,yM.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let f=o.toString();c=`${o.scopeRefs(Tn.default.scope)}return ${f}`,this.opts.code.process&&(c=this.opts.code.process(c,t));let h=new Function(`${Tn.default.self}`,`${Tn.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{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:l,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){let{props:d,items:m}=u;h.evaluated={props:d instanceof Bt.Name?void 0:d,items:m instanceof Bt.Name?void 0:m,dynamicProps:d instanceof Bt.Name,dynamicItems:m instanceof Bt.Name},h.source&&(h.source.evaluated=(0,Bt.stringify)(h.evaluated))}return t.validate=h,t}catch(f){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),f}finally{this._compilations.delete(t)}}kt.compileSchema=Td;function _M(t,e,r){var n;r=(0,Gt.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let i=bM.call(this,t,r);if(i===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new gs({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=SM.call(this,i)}kt.resolveRef=_M;function SM(t){return(0,Gt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Td.call(this,t)}function rb(t){for(let e of this._compilations)if(EM(e,t))return e}kt.getCompilingSchema=rb;function EM(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function bM(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Za.call(this,t,e)}function Za(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Gt._getFullPath)(this.opts.uriResolver,r),s=(0,Gt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return Od.call(this,r,t);let i=(0,Gt.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Za.call(this,t,o);return typeof a?.schema!="object"?void 0:Od.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||Td.call(this,o),i===(0,Gt.normalizeId)(e)){let{schema:a}=o,{schemaId:l}=this.opts,u=a[l];return u&&(s=(0,Gt.resolveUrl)(this.opts.uriResolver,s,u)),new gs({schema:a,schemaId:l,root:t,baseId:s})}return Od.call(this,r,o)}}kt.resolveSchema=Za;var vM=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Od(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,tb.unescapeFragment)(a)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!vM.has(a)&&u&&(e=(0,Gt.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,tb.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Gt.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Za.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new gs({schema:r,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var nb=E((XK,wM)=>{wM.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 Pd=E((QK,ab)=>{"use strict";var RM=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ib=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 $d(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var OM=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function sb(t){return t.length=0,!0}function TM(t,e,r){if(t.length){let n=$d(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function $M(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=TM;for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(o=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(s,n,r))break;a=sb}else{s.push(u);continue}}return s.length&&(a===sb?r.zone=s.join(""):o?n.push(s.join("")):n.push($d(s))),r.address=n.join(""),r}function ob(t){if(PM(t,":")<2)return{host:t,isIPV6:!1};let e=$M(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function PM(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function AM(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===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(s===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((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function CM(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 IM(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!ib(r)){let n=ob(r);n.isIPV6===!0?r=`[${n.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}ab.exports={nonSimpleDomain:OM,recomposeAuthority:IM,normalizeComponentEncoding:CM,removeDotSegments:AM,isIPv4:ib,isUUID:RM,normalizeIPv6:ob,stringArrayToHexStripped:$d}});var db=E((ZK,fb)=>{"use strict";var{isUUID:NM}=Pd(),kM=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xM=["http","https","ws","wss","urn","urn:uuid"];function LM(t){return xM.indexOf(t)!==-1}function Ad(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 lb(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ub(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 qM(t){return t.secure=Ad(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function jM(t){if((t.port===(Ad(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 DM(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(kM);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,i=Cd(s);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function FM(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,i=Cd(s);i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function MM(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!NM(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function HM(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var cb={scheme:"http",domainHost:!0,parse:lb,serialize:ub},VM={scheme:"https",domainHost:cb.domainHost,parse:lb,serialize:ub},el={scheme:"ws",domainHost:!0,parse:qM,serialize:jM},zM={scheme:"wss",domainHost:el.domainHost,parse:el.parse,serialize:el.serialize},UM={scheme:"urn",parse:DM,serialize:FM,skipNormalize:!0},BM={scheme:"urn:uuid",parse:MM,serialize:HM,skipNormalize:!0},tl={http:cb,https:VM,ws:el,wss:zM,urn:UM,"urn:uuid":BM};Object.setPrototypeOf(tl,null);function Cd(t){return t&&(tl[t]||tl[t.toLowerCase()])||void 0}fb.exports={wsIsSecure:Ad,SCHEMES:tl,isValidSchemeName:LM,getSchemeHandler:Cd}});var sl=E((eY,nl)=>{"use strict";var{normalizeIPv6:GM,removeDotSegments:ki,recomposeAuthority:WM,normalizeComponentEncoding:rl,isIPv4:JM,nonSimpleDomain:KM}=Pd(),{SCHEMES:YM,getSchemeHandler:hb}=db();function XM(t,e){return typeof t=="string"?t=ar(Rr(t,e),e):typeof t=="object"&&(t=Rr(ar(t,e),e)),t}function QM(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=pb(Rr(t,n),Rr(e,n),n,!0);return n.skipEscape=!0,ar(s,n)}function pb(t,e,r,n){let s={};return n||(t=Rr(ar(t,r),r),e=Rr(ar(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ki(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ki(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=ki(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=ki(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function ZM(t,e,r){return typeof t=="string"?(t=unescape(t),t=ar(rl(Rr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=ar(rl(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=ar(rl(Rr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=ar(rl(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function ar(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:""},n=Object.assign({},e),s=[],i=hb(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=WM(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=ki(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var eH=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Rr(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(eH);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(JM(n.host)===!1){let l=GM(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=hb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&KM(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var Id={SCHEMES:YM,normalize:XM,resolve:QM,resolveComponent:pb,equal:ZM,serialize:ar,parse:Rr};nl.exports=Id;nl.exports.default=Id;nl.exports.fastUri=Id});var gb=E(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var mb=sl();mb.code='require("ajv/dist/runtime/uri").default';Nd.default=mb});var Ld=E(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.CodeGen=Je.Name=Je.nil=Je.stringify=Je.str=Je._=Je.KeywordCxt=void 0;var tH=ms();Object.defineProperty(Je,"KeywordCxt",{enumerable:!0,get:function(){return tH.KeywordCxt}});var ys=W();Object.defineProperty(Je,"_",{enumerable:!0,get:function(){return ys._}});Object.defineProperty(Je,"str",{enumerable:!0,get:function(){return ys.str}});Object.defineProperty(Je,"stringify",{enumerable:!0,get:function(){return ys.stringify}});Object.defineProperty(Je,"nil",{enumerable:!0,get:function(){return ys.nil}});Object.defineProperty(Je,"Name",{enumerable:!0,get:function(){return ys.Name}});Object.defineProperty(Je,"CodeGen",{enumerable:!0,get:function(){return ys.CodeGen}});var rH=Ni(),bb=wr(),nH=ld(),xi=$n(),sH=W(),Li=Ai(),il=$i(),xd=ee(),yb=nb(),iH=gb(),vb=(t,e)=>new RegExp(t,e);vb.code="new RegExp";var oH=["removeAdditional","useDefaults","coerceTypes"],aH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),lH={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."},uH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},_b=200;function cH(t){var e,r,n,s,i,o,a,l,u,c,f,p,h,d,m,g,S,b,_,y,R,T,O,w,$;let v=t.strict,P=(e=t.code)===null||e===void 0?void 0:e.optimize,C=P===!0||P===void 0?1:P||0,k=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:vb,M=(s=t.uriResolver)!==null&&s!==void 0?s:iH.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:v)!==null&&o!==void 0?o:!0,strictNumbers:(l=(a=t.strictNumbers)!==null&&a!==void 0?a:v)!==null&&l!==void 0?l:!0,strictTypes:(c=(u=t.strictTypes)!==null&&u!==void 0?u:v)!==null&&c!==void 0?c:"log",strictTuples:(p=(f=t.strictTuples)!==null&&f!==void 0?f:v)!==null&&p!==void 0?p:"log",strictRequired:(d=(h=t.strictRequired)!==null&&h!==void 0?h:v)!==null&&d!==void 0?d:!1,code:t.code?{...t.code,optimize:C,regExp:k}:{optimize:C,regExp:k},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:_b,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:_b,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:(_=t.inlineRefs)!==null&&_!==void 0?_:!0,schemaId:(y=t.schemaId)!==null&&y!==void 0?y:"$id",addUsedSchema:(R=t.addUsedSchema)!==null&&R!==void 0?R:!0,validateSchema:(T=t.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(w=t.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:($=t.int32range)!==null&&$!==void 0?$:!0,uriResolver:M}}var qi=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...cH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new sH.ValueScope({scope:{},prefixes:aH,es5:r,lines:n}),this.logger=gH(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,nH.getRules)(),Sb.call(this,lH,e,"NOT SUPPORTED"),Sb.call(this,uH,e,"DEPRECATED","warn"),this._metaOpts=pH.call(this),e.formats&&dH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&hH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),fH.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=yb;n==="id"&&(s={...yb},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!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 n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(c,f){await i.call(this,c.$schema);let p=this._addSchema(c,f);return p.validate||o.call(this,p)}async function i(c){c&&!this.getSchema(c)&&await s.call(this,{$ref:c},!0)}async function o(c){try{return this._compileSchemaEnv(c)}catch(f){if(!(f instanceof bb.default))throw f;return a.call(this,f),await l.call(this,f.missingSchema),o.call(this,c)}}function a({missingSchema:c,missingRef:f}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${f} cannot be resolved`)}async function l(c){let f=await u.call(this,c);this.refs[c]||await i.call(this,f.$schema),this.refs[c]||this.addSchema(f,c,r)}async function u(c){let f=this._loading[c];if(f)return f;try{return await(this._loading[c]=n(c))}finally{delete this._loading[c]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);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,Li.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let r;for(;typeof(r=Eb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new xi.SchemaEnv({schema:{},schemaId:n});if(r=xi.resolveSchema.call(this,s,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=Eb.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 n=e[this.opts.schemaId];return n&&(n=(0,Li.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),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 n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(_H.call(this,n,r),!r)return(0,xd.eachItem)(n,i=>kd.call(this,i)),this;EH.call(this,r);let s={...r,type:(0,il.getJSONTypes)(r.type),schemaType:(0,il.getJSONTypes)(r.schemaType)};return(0,xd.eachItem)(n,s.type.length===0?i=>kd.call(this,i,s):i=>s.type.forEach(o=>kd.call(this,i,s,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 n of r.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,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:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:u}=l.definition,c=o[a];u&&c&&(o[a]=wb(c))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=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 l=this._cache.get(e);if(l!==void 0)return l;n=(0,Li.normalizeId)(o||n);let u=Li.getSchemaRefs.call(this,e,n);return l=new xi.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(e,!0),l}_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):xi.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{xi.compileSchema.call(this,e)}finally{this.opts=r}}};qi.ValidationError=rH.default;qi.MissingRefError=bb.default;Je.default=qi;function Sb(t,e,r,n="error"){for(let s in t){let i=s;i in e&&this.logger[n](`${r}: option ${s}. ${t[i]}`)}}function Eb(t){return t=(0,Li.normalizeId)(t),this.schemas[t]||this.refs[t]}function fH(){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 dH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function hH(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 pH(){let t={...this.opts};for(let e of oH)delete t[e];return t}var mH={log(){},warn(){},error(){}};function gH(t){if(t===!1)return mH;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 yH=/^[a-z_$][a-z0-9_$:-]*$/i;function _H(t,e){let{RULES:r}=this;if((0,xd.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!yH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function kd(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:l})=>l===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,il.getJSONTypes)(e.type),schemaType:(0,il.getJSONTypes)(e.schemaType)}};e.before?SH.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function SH(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function EH(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=wb(e)),t.validateSchema=this.compile(e,!0))}var bH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function wb(t){return{anyOf:[t,bH]}}});var Rb=E(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var vH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};qd.default=vH});var jd=E(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.callRef=Pn.getValidate=void 0;var wH=wr(),Ob=We(),bt=W(),_s=Nt(),Tb=$n(),ol=ee(),RH={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:l}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return f();let c=Tb.resolveRef.call(l,u,s,r);if(c===void 0)throw new wH.default(n.opts.uriResolver,s,r);if(c instanceof Tb.SchemaEnv)return p(c);return h(c);function f(){if(i===u)return al(t,o,i,i.$async);let d=e.scopeValue("root",{ref:u});return al(t,(0,bt._)`${d}.validate`,u,u.$async)}function p(d){let m=$b(t,d);al(t,m,d,d.$async)}function h(d){let m=e.scopeValue("schema",a.code.source===!0?{ref:d,code:(0,bt.stringify)(d)}:{ref:d}),g=e.name("valid"),S=t.subschema({schema:d,dataTypes:[],schemaPath:bt.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(S),t.ok(g)}}};function $b(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,bt._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Pn.getValidate=$b;function al(t,e,r,n){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:l}=i,u=l.passContext?_s.default.this:bt.nil;n?c():f();function c(){if(!a.$async)throw new Error("async schema referenced by sync schema");let d=s.let("valid");s.try(()=>{s.code((0,bt._)`await ${(0,Ob.callValidateCode)(t,e,u)}`),h(e),o||s.assign(d,!0)},m=>{s.if((0,bt._)`!(${m} instanceof ${i.ValidationError})`,()=>s.throw(m)),p(m),o||s.assign(d,!1)}),t.ok(d)}function f(){t.result((0,Ob.callValidateCode)(t,e,u),()=>h(e),()=>p(e))}function p(d){let m=(0,bt._)`${d}.errors`;s.assign(_s.default.vErrors,(0,bt._)`${_s.default.vErrors} === null ? ${m} : ${_s.default.vErrors}.concat(${m})`),s.assign(_s.default.errors,(0,bt._)`${_s.default.vErrors}.length`)}function h(d){var m;if(!i.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=ol.mergeEvaluated.props(s,g.props,i.props));else{let S=s.var("props",(0,bt._)`${d}.evaluated.props`);i.props=ol.mergeEvaluated.props(s,S,i.props,bt.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=ol.mergeEvaluated.items(s,g.items,i.items));else{let S=s.var("items",(0,bt._)`${d}.evaluated.items`);i.items=ol.mergeEvaluated.items(s,S,i.items,bt.Name)}}}Pn.callRef=al;Pn.default=RH});var Pb=E(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var OH=Rb(),TH=jd(),$H=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",OH.default,TH.default];Dd.default=$H});var Ab=E(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var ll=W(),Kr=ll.operators,ul={maximum:{okStr:"<=",ok:Kr.LTE,fail:Kr.GT},minimum:{okStr:">=",ok:Kr.GTE,fail:Kr.LT},exclusiveMaximum:{okStr:"<",ok:Kr.LT,fail:Kr.GTE},exclusiveMinimum:{okStr:">",ok:Kr.GT,fail:Kr.LTE}},PH={message:({keyword:t,schemaCode:e})=>(0,ll.str)`must be ${ul[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ll._)`{comparison: ${ul[t].okStr}, limit: ${e}}`},AH={keyword:Object.keys(ul),type:"number",schemaType:"number",$data:!0,error:PH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ll._)`${r} ${ul[e].fail} ${n} || isNaN(${r})`)}};Fd.default=AH});var Cb=E(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var ji=W(),CH={message:({schemaCode:t})=>(0,ji.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ji._)`{multipleOf: ${t}}`},IH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:CH,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,ji._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,ji._)`${o} !== parseInt(${o})`;t.fail$data((0,ji._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};Md.default=IH});var Nb=E(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});function Ib(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Hd.default=Ib;Ib.code='require("ajv/dist/runtime/ucs2length").default'});var kb=E(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var An=W(),NH=ee(),kH=Nb(),xH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,An.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,An._)`{limit: ${t}}`},LH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xH,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?An.operators.GT:An.operators.LT,o=s.opts.unicode===!1?(0,An._)`${r}.length`:(0,An._)`${(0,NH.useFunc)(t.gen,kH.default)}(${r})`;t.fail$data((0,An._)`${o} ${i} ${n}`)}};Vd.default=LH});var xb=E(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var qH=We(),cl=W(),jH={message:({schemaCode:t})=>(0,cl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,cl._)`{pattern: ${t}}`},DH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:jH,code(t){let{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,o=i.opts.unicodeRegExp?"u":"",a=r?(0,cl._)`(new RegExp(${s}, ${o}))`:(0,qH.usePattern)(t,n);t.fail$data((0,cl._)`!${a}.test(${e})`)}};zd.default=DH});var Lb=E(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var Di=W(),FH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Di.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Di._)`{limit: ${t}}`},MH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:FH,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?Di.operators.GT:Di.operators.LT;t.fail$data((0,Di._)`Object.keys(${r}).length ${s} ${n}`)}};Ud.default=MH});var qb=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var Fi=We(),Mi=W(),HH=ee(),VH={message:({params:{missingProperty:t}})=>(0,Mi.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Mi._)`{missingProperty: ${t}}`},zH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:VH,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&r.length===0)return;let l=r.length>=a.loopRequired;if(o.allErrors?u():c(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:d}=t.it;for(let m of r)if(h?.[m]===void 0&&!d.has(m)){let g=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,HH.checkStrictMode)(o,S,o.opts.strictRequired)}}function u(){if(l||i)t.block$data(Mi.nil,f);else for(let h of r)(0,Fi.checkReportMissingProp)(t,h)}function c(){let h=e.let("missing");if(l||i){let d=e.let("valid",!0);t.block$data(d,()=>p(h,d)),t.ok(d)}else e.if((0,Fi.checkMissingProp)(t,r,h)),(0,Fi.reportMissingProp)(t,h),e.else()}function f(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h}),e.if((0,Fi.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function p(h,d){t.setParams({missingProperty:h}),e.forOf(h,n,()=>{e.assign(d,(0,Fi.propertyInData)(e,s,h,a.ownProperties)),e.if((0,Mi.not)(d),()=>{t.error(),e.break()})},Mi.nil)}}};Bd.default=zH});var jb=E(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var Hi=W(),UH={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Hi.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Hi._)`{limit: ${t}}`},BH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:UH,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Hi.operators.GT:Hi.operators.LT;t.fail$data((0,Hi._)`${r}.length ${s} ${n}`)}};Gd.default=BH});var Vi=E(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var Db=Pi();Db.code='require("ajv/dist/runtime/equal").default';Wd.default=Db});var Fb=E(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});var Jd=$i(),Ke=W(),GH=ee(),WH=Vi(),JH={message:({params:{i:t,j:e}})=>(0,Ke.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ke._)`{i: ${t}, j: ${e}}`},KH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:JH,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!n&&!s)return;let l=e.let("valid"),u=i.items?(0,Jd.getSchemaTypes)(i.items):[];t.block$data(l,c,(0,Ke._)`${o} === false`),t.ok(l);function c(){let d=e.let("i",(0,Ke._)`${r}.length`),m=e.let("j");t.setParams({i:d,j:m}),e.assign(l,!0),e.if((0,Ke._)`${d} > 1`,()=>(f()?p:h)(d,m))}function f(){return u.length>0&&!u.some(d=>d==="object"||d==="array")}function p(d,m){let g=e.name("item"),S=(0,Jd.checkDataTypes)(u,g,a.opts.strictNumbers,Jd.DataType.Wrong),b=e.const("indices",(0,Ke._)`{}`);e.for((0,Ke._)`;${d}--;`,()=>{e.let(g,(0,Ke._)`${r}[${d}]`),e.if(S,(0,Ke._)`continue`),u.length>1&&e.if((0,Ke._)`typeof ${g} == "string"`,(0,Ke._)`${g} += "_"`),e.if((0,Ke._)`typeof ${b}[${g}] == "number"`,()=>{e.assign(m,(0,Ke._)`${b}[${g}]`),t.error(),e.assign(l,!1).break()}).code((0,Ke._)`${b}[${g}] = ${d}`)})}function h(d,m){let g=(0,GH.useFunc)(e,WH.default),S=e.name("outer");e.label(S).for((0,Ke._)`;${d}--;`,()=>e.for((0,Ke._)`${m} = ${d}; ${m}--;`,()=>e.if((0,Ke._)`${g}(${r}[${d}], ${r}[${m}])`,()=>{t.error(),e.assign(l,!1).break(S)})))}}};Kd.default=KH});var Mb=E(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});var Yd=W(),YH=ee(),XH=Vi(),QH={message:"must be equal to constant",params:({schemaCode:t})=>(0,Yd._)`{allowedValue: ${t}}`},ZH={keyword:"const",$data:!0,error:QH,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Yd._)`!${(0,YH.useFunc)(e,XH.default)}(${r}, ${s})`):t.fail((0,Yd._)`${i} !== ${r}`)}};Xd.default=ZH});var Hb=E(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var zi=W(),e2=ee(),t2=Vi(),r2={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,zi._)`{allowedValues: ${t}}`},n2={keyword:"enum",schemaType:"array",$data:!0,error:r2,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,e2.useFunc)(e,t2.default)),c;if(a||n)c=e.let("valid"),t.block$data(c,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",i);c=(0,zi.or)(...s.map((d,m)=>p(h,m)))}t.pass(c);function f(){e.assign(c,!1),e.forOf("v",i,h=>e.if((0,zi._)`${u()}(${r}, ${h})`,()=>e.assign(c,!0).break()))}function p(h,d){let m=s[d];return typeof m=="object"&&m!==null?(0,zi._)`${u()}(${r}, ${h}[${d}])`:(0,zi._)`${r} === ${m}`}}};Qd.default=n2});var Vb=E(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var s2=Ab(),i2=Cb(),o2=kb(),a2=xb(),l2=Lb(),u2=qb(),c2=jb(),f2=Fb(),d2=Mb(),h2=Hb(),p2=[s2.default,i2.default,o2.default,a2.default,l2.default,u2.default,c2.default,f2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d2.default,h2.default];Zd.default=p2});var th=E(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.validateAdditionalItems=void 0;var Cn=W(),eh=ee(),m2={message:({params:{len:t}})=>(0,Cn.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Cn._)`{limit: ${t}}`},g2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:m2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,eh.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}zb(t,n)}};function zb(t,e){let{gen:r,schema:n,data:s,keyword:i,it:o}=t;o.items=!0;let a=r.const("len",(0,Cn._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Cn._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,eh.alwaysValidSchema)(o,n)){let u=r.var("valid",(0,Cn._)`${a} <= ${e.length}`);r.if((0,Cn.not)(u),()=>l(u)),t.ok(u)}function l(u){r.forRange("i",e.length,a,c=>{t.subschema({keyword:i,dataProp:c,dataPropType:eh.Type.Num},u),o.allErrors||r.if((0,Cn.not)(u),()=>r.break())})}}Ui.validateAdditionalItems=zb;Ui.default=g2});var rh=E(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateTuple=void 0;var Ub=W(),fl=ee(),y2=We(),_2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Bb(t,"additionalItems",e);r.items=!0,!(0,fl.alwaysValidSchema)(r,e)&&t.ok((0,y2.validateArray)(t))}};function Bb(t,e,r=t.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=t;c(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=fl.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),u=n.const("len",(0,Ub._)`${i}.length`);r.forEach((f,p)=>{(0,fl.alwaysValidSchema)(a,f)||(n.if((0,Ub._)`${u} > ${p}`,()=>t.subschema({keyword:o,schemaProp:p,dataProp:p},l)),t.ok(l))});function c(f){let{opts:p,errSchemaPath:h}=a,d=r.length,m=d===f.minItems&&(d===f.maxItems||f[e]===!1);if(p.strictTuples&&!m){let g=`"${o}" is ${d}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,fl.checkStrictMode)(a,g,p.strictTuples)}}}Bi.validateTuple=Bb;Bi.default=_2});var Gb=E(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var S2=rh(),E2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,S2.validateTuple)(t,"items")};nh.default=E2});var Jb=E(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var Wb=W(),b2=ee(),v2=We(),w2=th(),R2={message:({params:{len:t}})=>(0,Wb.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Wb._)`{limit: ${t}}`},O2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:R2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,b2.alwaysValidSchema)(n,e)&&(s?(0,w2.validateAdditionalItems)(t,s):t.ok((0,v2.validateArray)(t)))}};sh.default=O2});var Kb=E(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var xt=W(),dl=ee(),T2={message:({params:{min:t,max:e}})=>e===void 0?(0,xt.str)`must contain at least ${t} valid item(s)`:(0,xt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,xt._)`{minContains: ${t}}`:(0,xt._)`{minContains: ${t}, maxContains: ${e}}`},$2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:T2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t,o,a,{minContains:l,maxContains:u}=n;i.opts.next?(o=l===void 0?1:l,a=u):o=1;let c=e.const("len",(0,xt._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,dl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,dl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,dl.alwaysValidSchema)(i,r)){let m=(0,xt._)`${c} >= ${o}`;a!==void 0&&(m=(0,xt._)`${m} && ${c} <= ${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,xt._)`${s}.length > 0`,p)):(e.let(f,!1),p()),t.result(f,()=>t.reset());function p(){let m=e.name("_valid"),g=e.let("count",0);h(m,()=>e.if(m,()=>d(g)))}function h(m,g){e.forRange("i",0,c,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:dl.Type.Num,compositeRule:!0},m),g()})}function d(m){e.code((0,xt._)`${m}++`),a===void 0?e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0).break()):(e.if((0,xt._)`${m} > ${a}`,()=>e.assign(f,!1).break()),o===1?e.assign(f,!0):e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0)))}}};ih.default=$2});var Qb=E(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.validateSchemaDeps=lr.validatePropertyDeps=lr.error=void 0;var oh=W(),P2=ee(),Gi=We();lr.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,oh.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,oh._)`{property: ${t},
|
|
56
56
|
missingProperty: ${n},
|
|
57
57
|
depsCount: ${e},
|
|
58
|
-
deps: ${r}}`};var T2={keyword:"dependencies",type:"object",schemaType:"object",error:lr.error,code(t){let[e,r]=$2(t);Jb(t,e),Kb(t,r)}};function $2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Jb(t,e=t.schema){let{gen:r,data:n,it:s}=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 l=(0,Gi.propertyInData)(r,n,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(l,()=>{for(let u of a)(0,Gi.checkReportMissingProp)(t,u)}):(r.if((0,ih._)`${l} && (${(0,Gi.checkMissingProp)(t,a,i)})`),(0,Gi.reportMissingProp)(t,i),r.else())}}lr.validatePropertyDeps=Jb;function Kb(t,e=t.schema){let{gen:r,data:n,keyword:s,it:i}=t,o=r.name("valid");for(let a in e)(0,O2.alwaysValidSchema)(i,e[a])||(r.if((0,Gi.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let l=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),t.ok(o))}lr.validateSchemaDeps=Kb;lr.default=T2});var Qb=E(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var Xb=W(),P2=ee(),A2={message:"property name must be valid",params:({params:t})=>(0,Xb._)`{propertyName: ${t.propertyName}}`},C2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:A2,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,P2.alwaysValidSchema)(s,r))return;let i=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,Xb.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};oh.default=C2});var lh=E(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var hl=We(),Wt=W(),I2=Nt(),pl=ee(),N2={message:"must NOT have additional properties",params:({params:t})=>(0,Wt._)`{additionalProperty: ${t.additionalProperty}}`},k2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:N2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,pl.alwaysValidSchema)(o,r))return;let u=(0,hl.allSchemaProperties)(n.properties),c=(0,hl.allSchemaProperties)(n.patternProperties);f(),t.ok((0,Wt._)`${i} === ${I2.default.errors}`);function f(){e.forIn("key",s,g=>{!u.length&&!c.length?d(g):e.if(p(g),()=>d(g))})}function p(g){let S;if(u.length>8){let b=(0,pl.schemaRefOrVal)(o,n.properties,"properties");S=(0,hl.isOwnProperty)(e,b,g)}else u.length?S=(0,Wt.or)(...u.map(b=>(0,Wt._)`${g} === ${b}`)):S=Wt.nil;return c.length&&(S=(0,Wt.or)(S,...c.map(b=>(0,Wt._)`${(0,hl.usePattern)(t,b)}.test(${g})`))),(0,Wt.not)(S)}function h(g){e.code((0,Wt._)`delete ${s}[${g}]`)}function d(g){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,pl.alwaysValidSchema)(o,r)){let S=e.name("valid");l.removeAdditional==="failing"?(m(g,S,!1),e.if((0,Wt.not)(S),()=>{t.reset(),h(g)})):(m(g,S),a||e.if((0,Wt.not)(S),()=>e.break()))}}function m(g,S,b){let _={keyword:"additionalProperties",dataProp:g,dataPropType:pl.Type.Str};b===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(_,S)}}};ah.default=k2});var tv=E(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var x2=ms(),Zb=We(),uh=ee(),ev=lh(),L2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&ev.default.code(new x2.KeywordCxt(i,ev.default,"additionalProperties"));let o=(0,Zb.allSchemaProperties)(r);for(let f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=uh.mergeEvaluated.props(e,(0,uh.toHash)(o),i.props));let a=o.filter(f=>!(0,uh.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let l=e.name("valid");for(let f of a)u(f)?c(f):(e.if((0,Zb.propertyInData)(e,s,f,i.opts.ownProperties)),c(f),i.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(f),t.ok(l);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function c(f){t.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};ch.default=L2});var iv=E(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var rv=We(),ml=W(),nv=ee(),sv=ee(),q2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,rv.allSchemaProperties)(r),l=a.filter(m=>(0,nv.alwaysValidSchema)(i,r[m]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,c=e.name("valid");i.props!==!0&&!(i.props instanceof ml.Name)&&(i.props=(0,sv.evaluatedPropsToName)(e,i.props));let{props:f}=i;p();function p(){for(let m of a)u&&h(m),i.allErrors?d(m):(e.var(c,!0),d(m),e.if(c))}function h(m){for(let g in u)new RegExp(m).test(g)&&(0,nv.checkStrictMode)(i,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function d(m){e.forIn("key",n,g=>{e.if((0,ml._)`${(0,rv.usePattern)(t,m)}.test(${g})`,()=>{let S=l.includes(m);S||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:sv.Type.Str},c),i.opts.unevaluated&&f!==!0?e.assign((0,ml._)`${f}[${g}]`,!0):!S&&!i.allErrors&&e.if((0,ml.not)(c),()=>e.break())})})}}};fh.default=q2});var ov=E(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var j2=ee(),D2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,j2.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};dh.default=D2});var av=E(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var F2=We(),M2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:F2.validateUnion,error:{message:"must match a schema in anyOf"}};hh.default=M2});var lv=E(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var gl=W(),H2=ee(),V2={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,gl._)`{passingSchemas: ${t.passing}}`},z2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:V2,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,o=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(o,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((c,f)=>{let p;(0,H2.alwaysValidSchema)(s,c)?e.var(l,!0):p=t.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&e.if((0,gl._)`${l} && ${o}`).assign(o,!1).assign(a,(0,gl._)`[${a}, ${f}]`).else(),e.if(l,()=>{e.assign(o,!0),e.assign(a,f),p&&t.mergeEvaluated(p,gl.Name)})})}}};ph.default=z2});var uv=E(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var U2=ee(),B2={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((i,o)=>{if((0,U2.alwaysValidSchema)(n,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};mh.default=B2});var dv=E(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var yl=W(),fv=ee(),G2={message:({params:t})=>(0,yl.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,yl._)`{failingKeyword: ${t.ifClause}}`},W2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:G2,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,fv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=cv(n,"then"),i=cv(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(l(),t.reset(),s&&i){let c=e.let("ifClause");t.setParams({ifClause:c}),e.if(a,u("then",c),u("else",c))}else s?e.if(a,u("then")):e.if((0,yl.not)(a),u("else"));t.pass(o,()=>t.error(!0));function l(){let c=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(c)}function u(c,f){return()=>{let p=t.subschema({keyword:c},a);e.assign(o,a),t.mergeValidEvaluated(p,o),f?e.assign(f,(0,yl._)`${c}`):t.setParams({ifClause:c})}}}};function cv(t,e){let r=t.schema[e];return r!==void 0&&!(0,fv.alwaysValidSchema)(t,r)}gh.default=W2});var hv=E(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});var J2=ee(),K2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,J2.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};yh.default=K2});var pv=E(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var Y2=eh(),X2=Ub(),Q2=th(),Z2=Gb(),eV=Wb(),tV=Yb(),rV=Qb(),nV=lh(),sV=tv(),iV=iv(),oV=ov(),aV=av(),lV=lv(),uV=uv(),cV=dv(),fV=hv();function dV(t=!1){let e=[oV.default,aV.default,lV.default,uV.default,cV.default,fV.default,rV.default,nV.default,tV.default,sV.default,iV.default];return t?e.push(X2.default,Z2.default):e.push(Y2.default,Q2.default),e.push(eV.default),e}_h.default=dV});var mv=E(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var Le=W(),hV={message:({schemaCode:t})=>(0,Le.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Le._)`{format: ${t}}`},pV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:hV,code(t,e){let{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:l,errSchemaPath:u,schemaEnv:c,self:f}=a;if(!l.validateFormats)return;s?p():h();function p(){let d=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=r.const("fDef",(0,Le._)`${d}[${o}]`),g=r.let("fType"),S=r.let("format");r.if((0,Le._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,Le._)`${m}.type || "string"`).assign(S,(0,Le._)`${m}.validate`),()=>r.assign(g,(0,Le._)`"string"`).assign(S,m)),t.fail$data((0,Le.or)(b(),_()));function b(){return l.strictSchema===!1?Le.nil:(0,Le._)`${o} && !${S}`}function _(){let y=c.$async?(0,Le._)`(${m}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,Le._)`${S}(${n})`,R=(0,Le._)`(typeof ${S} == "function" ? ${y} : ${S}.test(${n}))`;return(0,Le._)`${S} && ${S} !== true && ${g} === ${e} && !${R}`}}function h(){let d=f.formats[i];if(!d){b();return}if(d===!0)return;let[m,g,S]=_(d);m===e&&t.pass(y());function b(){if(l.strictSchema===!1){f.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function _(R){let T=R instanceof RegExp?(0,Le.regexpCode)(R):l.code.formats?(0,Le._)`${l.code.formats}${(0,Le.getProperty)(i)}`:void 0,O=r.scopeValue("formats",{key:i,ref:R,code:T});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,Le._)`${O}.validate`]:["string",R,O]}function y(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${S}(${n})`}return typeof g=="function"?(0,Le._)`${S}(${n})`:(0,Le._)`${S}.test(${n})`}}}};Sh.default=pV});var gv=E(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var mV=mv(),gV=[mV.default];Eh.default=gV});var yv=E(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.contentVocabulary=Ss.metadataVocabulary=void 0;Ss.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ss.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Sv=E(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var yV=Tb(),_V=Mb(),SV=pv(),EV=gv(),_v=yv(),bV=[yV.default,_V.default,(0,SV.default)(),EV.default,_v.metadataVocabulary,_v.contentVocabulary];bh.default=bV});var vh=E(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.DiscrError=void 0;var Ev;(function(t){t.Tag="tag",t.Mapping="mapping"})(Ev||(_l.DiscrError=Ev={}))});var vv=E(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});var Es=W(),wh=vh(),bv=$n(),vV=wr(),wV=ee(),RV={message:({params:{discrError:t,tagName:e}})=>t===wh.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Es._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},OV={keyword:"discriminator",type:"object",schemaType:"object",error:RV,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),u=e.const("tag",(0,Es._)`${r}${(0,Es.getProperty)(a)}`);e.if((0,Es._)`typeof ${u} == "string"`,()=>c(),()=>t.error(!1,{discrError:wh.DiscrError.Tag,tag:u,tagName:a})),t.ok(l);function c(){let h=p();e.if(!1);for(let d in h)e.elseIf((0,Es._)`${u} === ${d}`),e.assign(l,f(h[d]));e.else(),t.error(!1,{discrError:wh.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function f(h){let d=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},d);return t.mergeEvaluated(m,Es.Name),d}function p(){var h;let d={},m=S(s),g=!0;for(let y=0;y<o.length;y++){let R=o[y];if(R?.$ref&&!(0,wV.schemaHasRulesButRef)(R,i.self.RULES)){let O=R.$ref;if(R=bv.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,O),R instanceof bv.SchemaEnv&&(R=R.schema),R===void 0)throw new vV.default(i.opts.uriResolver,i.baseId,O)}let T=(h=R?.properties)===null||h===void 0?void 0:h[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||S(R)),b(T,y)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return d;function S({required:y}){return Array.isArray(y)&&y.includes(a)}function b(y,R){if(y.const)_(y.const,R);else if(y.enum)for(let T of y.enum)_(T,R);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function _(y,R){if(typeof y!="string"||y in d)throw new Error(`discriminator: "${a}" values must be unique strings`);d[y]=R}}}};Rh.default=OV});var wv=E((NY,TV)=>{TV.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 El=E((ve,Oh)=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.MissingRefError=ve.ValidationError=ve.CodeGen=ve.Name=ve.nil=ve.stringify=ve.str=ve._=ve.KeywordCxt=ve.Ajv=void 0;var $V=xd(),PV=Sv(),AV=vv(),Rv=wv(),CV=["/properties"],Sl="http://json-schema.org/draft-07/schema",bs=class extends $V.default{_addVocabularies(){super._addVocabularies(),PV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(AV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Rv,CV):Rv;this.addMetaSchema(e,Sl,!1),this.refs["http://json-schema.org/schema"]=Sl}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sl)?Sl:void 0)}};ve.Ajv=bs;Oh.exports=ve=bs;Oh.exports.Ajv=bs;Object.defineProperty(ve,"__esModule",{value:!0});ve.default=bs;var IV=ms();Object.defineProperty(ve,"KeywordCxt",{enumerable:!0,get:function(){return IV.KeywordCxt}});var vs=W();Object.defineProperty(ve,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(ve,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(ve,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(ve,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(ve,"Name",{enumerable:!0,get:function(){return vs.Name}});Object.defineProperty(ve,"CodeGen",{enumerable:!0,get:function(){return vs.CodeGen}});var NV=Ni();Object.defineProperty(ve,"ValidationError",{enumerable:!0,get:function(){return NV.default}});var kV=wr();Object.defineProperty(ve,"MissingRefError",{enumerable:!0,get:function(){return kV.default}})});var Or=E(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.checkMetadata=void 0;var xV=ee(),LV={keyword:"metadata",schemaType:"object",code(t){Ov(t);let{gen:e,schema:r,it:n}=t;if((0,xV.alwaysValidSchema)(n,r))return;let s=e.name("valid");t.subschema({keyword:"metadata",jtdMetadata:!0},s),t.ok(s)}};function Ov({it:t,keyword:e},r){if(t.jtdMetadata!==r)throw new Error(`JTD: "${e}" cannot be used in this schema location`)}Wi.checkMetadata=Ov;Wi.default=LV});var bl=E(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.hasRef=void 0;var Tv=$n(),Ji=W(),qV=wr(),$v=Nt(),Pv=qd(),jV=Or(),DV={keyword:"ref",schemaType:"string",code(t){(0,jV.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{schemaEnv:{root:o}}=i,a=e.name("valid");s.nullable?(e.var(a,(0,Ji._)`${r} === null`),e.if((0,Ji.not)(a),l)):(e.var(a,!1),l()),t.ok(a);function l(){var f;let p=(f=o.schema.definitions)===null||f===void 0?void 0:f[n];if(!p)throw new qV.default(i.opts.uriResolver,"",n,`No definition ${n}`);Th(p)||!i.opts.inlineRefs?u(p):c(p)}function u(f){let p=Tv.compileSchema.call(i.self,new Tv.SchemaEnv({schema:f,root:o,schemaPath:`/definitions/${n}`})),h=(0,Pv.getValidate)(t,p),d=e.const("_errs",$v.default.errors);(0,Pv.callRef)(t,h,p,p.$async),e.assign(a,(0,Ji._)`${d} === ${$v.default.errors}`)}function c(f){let p=e.scopeValue("schema",i.opts.code.source===!0?{ref:f,code:(0,Ji.stringify)(f)}:{ref:f});t.subschema({schema:f,dataTypes:[],schemaPath:Ji.nil,topSchemaRef:p,errSchemaPath:`/definitions/${n}`},a)}}};function Th(t){for(let e in t){let r;if(e==="ref"||typeof(r=t[e])=="object"&&Th(r))return!0}return!1}Ki.hasRef=Th;Ki.default=DV});var Ph=E($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});var FV=/t|\s/i,MV=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,HV=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,VV=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Cv(t,e){let r=t.split(FV);return r.length===2&&Av(r[0])&&zV(r[1])||e&&r.length===1&&Av(r[0])}$h.default=Cv;function Av(t){let e=MV.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&(s<=VV[n]||n===2&&s===29&&(r%100===0?r%400===0:r%4===0))}function zV(t){let e=HV.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3],i=+(e[4]||0),o=+(e[5]||0);return r<=23&&n<=59&&s<=59||r-i===23&&n-o===59&&s===60}Cv.code='require("ajv/dist/runtime/timestamp").default'});var ws=E(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.typeErrorParams=Yr.typeErrorMessage=Yr.typeError=void 0;var UV=W();function BV(t){return{message:e=>Iv(e,t),params:e=>Nv(e,t)}}Yr.typeError=BV;function Iv({parentSchema:t},e){return t?.nullable?`must be ${e} or null`:`must be ${e}`}Yr.typeErrorMessage=Iv;function Nv({parentSchema:t},e){return(0,UV._)`{type: ${e}, nullable: ${!!t?.nullable}}`}Yr.typeErrorParams=Nv});var Ah=E(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.intRange=void 0;var Ot=W(),GV=Ph(),WV=ee(),JV=Or(),kv=ws();Rs.intRange={int8:[-128,127,3],uint8:[0,255,3],int16:[-32768,32767,5],uint16:[0,65535,5],int32:[-2147483648,2147483647,10],uint32:[0,4294967295,10]};var KV={message:t=>(0,kv.typeErrorMessage)(t,t.schema),params:t=>(0,kv.typeErrorParams)(t,t.schema)};function YV(t){let{gen:e,data:r,it:n}=t,{timestamp:s,allowDate:i}=n.opts;if(s==="date")return(0,Ot._)`${r} instanceof Date `;let o=(0,WV.useFunc)(e,GV.default),a=i?(0,Ot._)`, true`:Ot.nil,l=(0,Ot._)`typeof ${r} == "string" && ${o}(${r}${a})`;return s==="string"?l:(0,Ot.or)((0,Ot._)`${r} instanceof Date`,l)}var XV={keyword:"type",schemaType:"string",error:KV,code(t){(0,JV.checkMetadata)(t);let{data:e,schema:r,parentSchema:n,it:s}=t,i;switch(r){case"boolean":case"string":i=(0,Ot._)`typeof ${e} == ${r}`;break;case"timestamp":{i=YV(t);break}case"float32":case"float64":i=(0,Ot._)`typeof ${e} == "number"`;break;default:{let o=r;if(i=(0,Ot._)`typeof ${e} == "number" && isFinite(${e}) && !(${e} % 1)`,!s.opts.int32range&&(o==="int32"||o==="uint32"))o==="uint32"&&(i=(0,Ot._)`${i} && ${e} >= 0`);else{let[a,l]=Rs.intRange[o];i=(0,Ot._)`${i} && ${e} >= ${a} && ${e} <= ${l}`}}}t.pass(n.nullable?(0,Ot.or)((0,Ot._)`${e} === null`,i):i)}};Rs.default=XV});var Ts=E(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.checkNullableObject=Os.checkNullable=void 0;var vl=W();function xv({gen:t,data:e,parentSchema:r},n=vl.nil){let s=t.name("valid");return r.nullable?(t.let(s,(0,vl._)`${e} === null`),n=(0,vl.not)(s)):t.let(s,!1),[s,n]}Os.checkNullable=xv;function QV(t,e){let[r,n]=xv(t,e);return[r,(0,vl._)`${n} && typeof ${t.data} == "object" && !Array.isArray(${t.data})`]}Os.checkNullableObject=QV});var Lv=E(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var Xr=W(),ZV=Or(),ez=Ts(),tz={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Xr._)`{allowedValues: ${t}}`},rz={keyword:"enum",schemaType:"array",error:tz,code(t){(0,ZV.checkMetadata)(t);let{gen:e,data:r,schema:n,schemaValue:s,parentSchema:i,it:o}=t;if(n.length===0)throw new Error("enum must have non-empty array");if(n.length!==new Set(n).size)throw new Error("enum items must be unique");let a,l=(0,Xr._)`typeof ${r} == "string"`;if(n.length>=o.opts.loopEnum){let c;[a,c]=(0,ez.checkNullable)(t,l),e.if(c,u)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");a=(0,Xr.and)(l,(0,Xr.or)(...n.map(c=>(0,Xr._)`${r} === ${c}`))),i.nullable&&(a=(0,Xr.or)((0,Xr._)`${r} === null`,a))}t.pass(a);function u(){e.forOf("v",s,c=>e.if((0,Xr._)`${a} = ${r} === ${c}`,()=>e.break()))}}};Ch.default=rz});var jv=E(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});var nz=ee(),sz=We(),qv=W(),iz=Or(),oz=Ts(),az=ws(),lz={keyword:"elements",schemaType:"object",error:(0,az.typeError)("array"),code(t){(0,iz.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t;if((0,nz.alwaysValidSchema)(s,n))return;let[i]=(0,oz.checkNullable)(t);e.if((0,qv.not)(i),()=>e.if((0,qv._)`Array.isArray(${r})`,()=>e.assign(i,(0,sz.validateArray)(t)),()=>t.error())),t.ok(i)}};Ih.default=lz});var kh=E(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.validateProperties=Qr.error=void 0;var Nh=We(),Dv=ee(),Tr=W(),uz=Or(),cz=Ts(),Fv=ws(),$s;(function(t){t.Additional="additional",t.Missing="missing"})($s||($s={}));Qr.error={message:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?"must NOT have additional properties":`must have property '${e.missingProperty}'`:(0,Fv.typeErrorMessage)(t,"object")},params:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?(0,Tr._)`{error: ${e.propError}, additionalProperty: ${e.additionalProperty}}`:(0,Tr._)`{error: ${e.propError}, missingProperty: ${e.missingProperty}}`:(0,Fv.typeErrorParams)(t,"object")}};var fz={keyword:"properties",schemaType:"object",error:Qr.error,code:Mv};function Mv(t){(0,uz.checkMetadata)(t);let{gen:e,data:r,parentSchema:n,it:s}=t,{additionalProperties:i,nullable:o}=n;if(s.jtdDiscriminator&&o)throw new Error("JTD: nullable inside discriminator mapping");if(h())throw new Error("JTD: properties and optionalProperties have common members");let[a,l]=d("properties"),[u,c]=d("optionalProperties");if(l.length===0&&c.length===0&&i)return;let[f,p]=s.jtdDiscriminator===void 0?(0,cz.checkNullableObject)(t,r):[e.let("valid",!1),!0];e.if(p,()=>e.assign(f,!0).block(()=>{m(l,"properties",!0),m(c,"optionalProperties"),i||S()})),t.pass(f);function h(){let _=n.properties,y=n.optionalProperties;if(!(_&&y))return!1;for(let R in _)if(Object.prototype.hasOwnProperty.call(y,R))return!0;return!1}function d(_){let y=n[_],R=y?(0,Nh.allSchemaProperties)(y):[];if(s.jtdDiscriminator&&R.some(O=>O===s.jtdDiscriminator))throw new Error(`JTD: discriminator tag used in ${_}`);let T=R.filter(O=>!(0,Dv.alwaysValidSchema)(s,y[O]));return[R,T]}function m(_,y,R){let T=e.var("valid");for(let w of _)e.if((0,Nh.propertyInData)(e,r,w,s.opts.ownProperties),()=>g(w,y,T),()=>O(w)),t.ok(T);function O(w){R?(e.assign(T,!1),t.error(!1,{propError:$s.Missing,missingProperty:w},{schemaPath:w})):e.assign(T,!0)}}function g(_,y,R){t.subschema({keyword:y,schemaProp:_,dataProp:_},R)}function S(){e.forIn("key",r,_=>{let y=b(_,a,"properties",s.jtdDiscriminator),R=b(_,u,"optionalProperties"),T=y===!0?R:R===!0?y:(0,Tr.and)(y,R);e.if(T,()=>{s.opts.removeAdditional?e.code((0,Tr._)`delete ${r}[${_}]`):(t.error(!1,{propError:$s.Additional,additionalProperty:_},{instancePath:_,parentSchema:!0}),s.opts.allErrors||e.break())})})}function b(_,y,R,T){let O;if(y.length>8){let w=(0,Dv.schemaRefOrVal)(s,n[R],R);O=(0,Tr.not)((0,Nh.isOwnProperty)(e,w,_)),T!==void 0&&(O=(0,Tr.and)(O,(0,Tr._)`${_} !== ${T}`))}else if(y.length||T!==void 0){let w=T===void 0?y:[T].concat(y);O=(0,Tr.and)(...w.map($=>(0,Tr._)`${_} !== ${$}`))}else O=!0;return O}}Qr.validateProperties=Mv;Qr.default=fz});var Vv=E(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});var Hv=kh(),dz={keyword:"optionalProperties",schemaType:"object",error:Hv.error,code(t){t.parentSchema.properties||(0,Hv.validateProperties)(t)}};xh.default=dz});var Uv=E(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});var In=W(),hz=Or(),pz=Ts(),zv=ws(),wl=vh(),mz={message:t=>{let{schema:e,params:r}=t;return r.discrError?r.discrError===wl.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in mapping`:(0,zv.typeErrorMessage)(t,"object")},params:t=>{let{schema:e,params:r}=t;return r.discrError?(0,In._)`{error: ${r.discrError}, tag: ${e}, tagValue: ${r.tag}}`:(0,zv.typeErrorParams)(t,"object")}},gz={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:mz,code(t){(0,hz.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s}=t,[i,o]=(0,pz.checkNullableObject)(t,r);e.if(o),a(),e.elseIf((0,In.not)(i)),t.error(),e.endIf(),t.ok(i);function a(){let c=e.const("tag",(0,In._)`${r}${(0,In.getProperty)(n)}`);e.if((0,In._)`${c} === undefined`),t.error(!1,{discrError:wl.DiscrError.Tag,tag:c}),e.elseIf((0,In._)`typeof ${c} == "string"`),l(c),e.else(),t.error(!1,{discrError:wl.DiscrError.Tag,tag:c},{instancePath:n}),e.endIf()}function l(c){e.if(!1);for(let f in s.mapping)e.elseIf((0,In._)`${c} === ${f}`),e.assign(i,u(f));e.else(),t.error(!1,{discrError:wl.DiscrError.Mapping,tag:c},{instancePath:n,schemaPath:"mapping",parentSchema:!0}),e.endIf()}function u(c){let f=e.name("valid");return t.subschema({keyword:"mapping",schemaProp:c,jtdDiscriminator:n},f),f}}};Lh.default=gz});var Gv=E(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var Bv=ee(),Rl=W(),yz=Or(),_z=Ts(),Sz=ws(),Ez={keyword:"values",schemaType:"object",error:(0,Sz.typeError)("object"),code(t){(0,yz.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t,[i,o]=(0,_z.checkNullableObject)(t,r);(0,Bv.alwaysValidSchema)(s,n)?e.if((0,Rl.not)((0,Rl.or)(o,i)),()=>t.error()):(e.if(o),e.assign(i,a()),e.elseIf((0,Rl.not)(i)),t.error(),e.endIf()),t.ok(i);function a(){let l=e.name("valid");if(s.allErrors){let c=e.let("valid",!0);return u(()=>e.assign(c,!1)),c}return e.var(l,!0),u(()=>e.break()),l;function u(c){e.forIn("key",r,f=>{t.subschema({keyword:"values",dataProp:f,dataPropType:Bv.Type.Str},l),e.if((0,Rl.not)(l),c)})}}}};qh.default=Ez});var Wv=E(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var bz=We(),vz={keyword:"union",schemaType:"array",trackErrors:!0,code:bz.validateUnion,error:{message:"must match a schema in union"}};jh.default=vz});var Jv=E(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var wz=bl(),Rz=Ah(),Oz=Lv(),Tz=jv(),$z=kh(),Pz=Vv(),Az=Uv(),Cz=Gv(),Iz=Wv(),Nz=Or(),kz=["definitions",wz.default,Rz.default,Oz.default,Tz.default,$z.default,Pz.default,Az.default,Cz.default,Iz.default,Nz.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];Dh.default=kz});var Qv=E(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var $r=t=>{let e={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return t&&(e.definitions={values:{ref:"schema"}}),e},xz=t=>({optionalProperties:$r(t)}),Lz=t=>({properties:{ref:{type:"string"}},optionalProperties:$r(t)}),qz=t=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:$r(t)}),jz=t=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:$r(t)}),Dz=t=>({properties:{elements:{ref:"schema"}},optionalProperties:$r(t)}),Yv=t=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:{optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"},...$r(t)}}),Xv=t=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:{additionalProperties:{type:"boolean"},...$r(t)}}),Fz=t=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[Yv(!1),Xv(!1)]}}}},optionalProperties:$r(t)}),Mz=t=>({properties:{values:{ref:"schema"}},optionalProperties:$r(t)}),Kv=t=>({metadata:{union:[xz,Lz,qz,jz,Dz,Yv,Xv,Fz,Mz].map(e=>e(t))}}),Hz={definitions:{schema:Kv(!1)},...Kv(!0)};Fh.default=Hz});var Mh=E(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.jtdForms=void 0;Ol.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"]});var ew=E(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});var Hh=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Vz={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function Zv(t){return Hh.lastIndex=0,'"'+(Hh.test(t)?t.replace(Hh,e=>{let r=Vz[e];return typeof r=="string"?r:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}):t)+'"'}Vh.default=Zv;Zv.code='require("ajv/dist/runtime/quote").default'});var ow=E(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});var zz=Mh(),rw=$n(),ie=W(),Uz=wr(),Ee=Nt(),Bz=We(),Gz=bl(),Wz=ee(),Jz=ew(),Kz={elements:Xz,values:Qz,discriminator:Zz,properties:tw,optionalProperties:tw,enum:Yi,type:eU,ref:rU};function nw(t,e){let r=rw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ie.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("serialize"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:Ee.default.data},u;try{this._compilations.add(t),t.serializeName=a,o.func(a,Ee.default.data,!1,()=>{o.let(Ee.default.json,(0,ie.str)``),Xi(l),o.return(Ee.default.json)}),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(Ee.default.scope)}return ${c}`;let p=new Function(`${Ee.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.serialize=p}catch(c){throw u&&this.logger.error("Error compiling serializer, function code:",u),delete t.serialize,delete t.serializeName,c}finally{this._compilations.delete(t)}return t}Uh.default=nw;function Xi(t){let e;for(let r of zz.jtdForms)if(r in t.schema){e=r;break}Yz(t,e?Kz[e]:sU)}function Yz(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);r.if((0,ie._)`${s} === undefined || ${s} === null`,()=>r.add(Ee.default.json,(0,ie._)`"null"`),()=>e(t))}function Xz(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`[`);let s=e.let("first",!0);e.forOf("el",n,i=>{zh(t,s),Xi({...t,schema:r.elements,data:i})}),e.add(Ee.default.json,(0,ie.str)`]`)}function Qz(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`{`);let s=e.let("first",!0);e.forIn("key",n,i=>sw(t,i,r.values,s)),e.add(Ee.default.json,(0,ie.str)`}`)}function sw(t,e,r,n){let{gen:s,data:i}=t;zh(t,n),Yi({...t,data:e}),s.add(Ee.default.json,(0,ie.str)`:`);let o=s.const("value",(0,ie._)`${i}${(0,ie.getProperty)(e)}`);Xi({...t,schema:r,data:o})}function Zz(t){let{gen:e,schema:r,data:n}=t,{discriminator:s}=r;e.add(Ee.default.json,(0,ie.str)`{${JSON.stringify(s)}:`);let i=e.const("tag",(0,ie._)`${n}${(0,ie.getProperty)(s)}`);Yi({...t,data:i}),e.if(!1);for(let o in r.mapping){e.elseIf((0,ie._)`${i} === ${o}`);let a=r.mapping[o];iw({...t,schema:a},s)}e.endIf(),e.add(Ee.default.json,(0,ie.str)`}`)}function tw(t){let{gen:e}=t;e.add(Ee.default.json,(0,ie.str)`{`),iw(t),e.add(Ee.default.json,(0,ie.str)`}`)}function iw(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o}=n,a=p(i),l=p(o),u=h(a.concat(l)),c=!e,f;for(let S of a)c?c=!1:r.add(Ee.default.json,(0,ie.str)`,`),m(S,i[S],d(S));c&&(f=r.let("first",!0));for(let S of l){let b=d(S);r.if((0,ie.and)((0,ie._)`${b} !== undefined`,(0,Bz.isOwnProperty)(r,s,S)),()=>{zh(t,f),m(S,o[S],b)})}n.additionalProperties&&r.forIn("key",s,S=>r.if(g(S,u),()=>sw(t,S,{},f)));function p(S){return S?Object.keys(S):[]}function h(S){if(e&&S.push(e),new Set(S).size!==S.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return S}function d(S){return r.const("value",(0,ie._)`${s}${(0,ie.getProperty)(S)}`)}function m(S,b,_){r.add(Ee.default.json,(0,ie.str)`${JSON.stringify(S)}:`),Xi({...t,schema:b,data:_})}function g(S,b){return b.length?(0,ie.and)(...b.map(_=>(0,ie._)`${S} !== ${_}`)):!0}}function eU(t){let{gen:e,schema:r,data:n}=t;switch(r.type){case"boolean":e.add(Ee.default.json,(0,ie._)`${n} ? "true" : "false"`);break;case"string":Yi(t);break;case"timestamp":e.if((0,ie._)`${n} instanceof Date`,()=>e.add(Ee.default.json,(0,ie._)`'"' + ${n}.toISOString() + '"'`),()=>Yi(t));break;default:tU(t)}}function Yi({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`${(0,Wz.useFunc)(t,Jz.default)}(${e})`)}function tU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`"" + ${e}`)}function rU(t){let{gen:e,self:r,data:n,definitions:s,schema:i,schemaEnv:o}=t,{ref:a}=i,l=s[a];if(!l)throw new Uz.default(r.opts.uriResolver,"",a,`No definition ${a}`);if(!(0,Gz.hasRef)(l))return Xi({...t,schema:l});let{root:u}=o,c=nw.call(r,new rw.SchemaEnv({schema:l,root:u}),s);e.add(Ee.default.json,(0,ie._)`${nU(e,c)}(${n})`)}function nU(t,e){return e.serialize?t.scopeValue("serialize",{ref:e.serialize}):(0,ie._)`${t.scopeValue("wrapper",{ref:e})}.serialize`}function sU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`JSON.stringify(${e})`)}function zh({gen:t},e){e?t.if(e,()=>t.assign(e,!1),()=>t.add(Ee.default.json,(0,ie.str)`,`)):t.add(Ee.default.json,(0,ie.str)`,`)}});var lw=E(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.parseJsonString=en.parseJsonNumber=en.parseJson=void 0;var iU=/position\s(\d+)(?: \(line \d+ column \d+\))?$/;function Pr(t,e){let r;Pr.message=void 0;let n;e&&(t=t.slice(e));try{return Pr.position=e+t.length,JSON.parse(t)}catch(s){if(n=iU.exec(s.message),!n){Pr.message="unexpected end";return}r=+n[1];let i=t[r];t=t.slice(0,r),Pr.position=e+r;try{return JSON.parse(t)}catch{Pr.message=`unexpected token ${i}`;return}}}en.parseJson=Pr;Pr.message=void 0;Pr.position=0;Pr.code='require("ajv/dist/runtime/parseJson").parseJson';function Ar(t,e,r){let n="",s;if(Ar.message=void 0,t[e]==="-"&&(n+="-",e++),t[e]==="0")n+="0",e++;else if(!i(r)){o();return}if(r)return Ar.position=e,+n;if(t[e]==="."&&(n+=".",e++,!i())){o();return}if(s=t[e],(s==="e"||s==="E")&&(n+="e",e++,s=t[e],(s==="+"||s==="-")&&(n+=s,e++),!i())){o();return}return Ar.position=e,+n;function i(a){let l=!1;for(;s=t[e],s>="0"&&s<="9"&&(a===void 0||a-- >0);)l=!0,n+=s,e++;return l}function o(){Ar.position=e,Ar.message=e<t.length?`unexpected token ${t[e]}`:"unexpected end"}}en.parseJsonNumber=Ar;Ar.message=void 0;Ar.position=0;Ar.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';var aw={b:"\b",f:"\f",n:`
|
|
59
|
-
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},oU=97,aU=48;function Zr(t,e){let r="",n;for(Zr.message=void 0;n=t[e++],n!=='"';)if(n==="\\")if(n=t[e],n in aw)r+=aw[n],e++;else if(n==="u"){e++;let i=4,o=0;for(;i--;){if(o<<=4,n=t[e],n===void 0){s("unexpected end");return}if(n=n.toLowerCase(),n>="a"&&n<="f")o+=n.charCodeAt(0)-oU+10;else if(n>="0"&&n<="9")o+=n.charCodeAt(0)-aU;else{s(`unexpected token ${n}`);return}e++}r+=String.fromCharCode(o)}else{s(`unexpected token ${n}`);return}else if(n===void 0){s("unexpected end");return}else if(n.charCodeAt(0)>=32)r+=n;else{s(`unexpected token ${n}`);return}return Zr.position=e,r;function s(i){Zr.position=e,Zr.message=i}}en.parseJsonString=Zr;Zr.message=void 0;Zr.position=0;Zr.code='require("ajv/dist/runtime/parseJson").parseJsonString'});var Sw=E(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});var lU=Mh(),dw=$n(),B=W(),uU=wr(),se=Nt(),cU=We(),fU=bl(),dU=Ah(),Wh=lw(),hw=ee(),hU=Ph(),pU={elements:_U,values:SU,discriminator:bU,properties:uw,optionalProperties:uw,enum:wU,type:vU,ref:RU};function pw(t,e){let r=dw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new B.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("parse"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:se.default.data,parseName:a,char:o.name("c")},u;try{this._compilations.add(t),t.parseName=a,mU(l),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(se.default.scope)}return ${c}`;let p=new Function(`${se.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.parse=p}catch(c){throw u&&this.logger.error("Error compiling parser, function code:",u),delete t.parse,delete t.parseName,c}finally{this._compilations.delete(t)}return t}Qh.default=pw;var Gh=(0,B._)`undefined`;function mU(t){let{gen:e,parseName:r,char:n}=t;e.func(r,(0,B._)`${se.default.json}, ${se.default.jsonPos}, ${se.default.jsonPart}`,!1,()=>{e.let(se.default.data),e.let(n),e.assign((0,B._)`${r}.message`,Gh),e.assign((0,B._)`${r}.position`,Gh),e.assign(se.default.jsonPos,(0,B._)`${se.default.jsonPos} || 0`),e.const(se.default.jsonLen,(0,B._)`${se.default.json}.length`),Tl(t),Xh(t),e.if(se.default.jsonPart,()=>{e.assign((0,B._)`${r}.position`,se.default.jsonPos),e.return(se.default.data)}),e.if((0,B._)`${se.default.jsonPos} === ${se.default.jsonLen}`,()=>e.return(se.default.data)),Ps(t)})}function Tl(t){let e;for(let r of lU.jtdForms)if(r in t.schema){e=r;break}e?yU(t,pU[e]):Kh(t)}var gU=fw(!0,fw(!1,Ps));function yU(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);Qi(t,"null",e,()=>r.assign(s,null))}function _U(t){let{gen:e,schema:r,data:n}=t;ur(t,"[");let s=e.let("i",0);e.assign(n,(0,B._)`[]`),Jh(t,"]",()=>{let i=e.let("el");Tl({...t,schema:r.elements,data:i}),e.assign((0,B._)`${n}[${s}++]`,i)})}function SU(t){let{gen:e,schema:r,data:n}=t;ur(t,"{"),e.assign(n,(0,B._)`{}`),Jh(t,"}",()=>EU(t,r.values))}function Jh(t,e,r){mw(t,e,r),ur(t,e)}function mw(t,e,r){let{gen:n}=t;n.for((0,B._)`;${se.default.jsonPos}<${se.default.jsonLen} && ${$l(1)}!==${e};`,()=>{r(),Qi(t,",",()=>n.break(),s)});function s(){Qi(t,e,()=>{},Ps)}}function EU(t,e){let{gen:r}=t,n=r.let("key");Nn({...t,data:n}),ur(t,":"),yw(t,n,e)}function bU(t){let{gen:e,data:r,schema:n}=t,{discriminator:s,mapping:i}=n;ur(t,"{"),e.assign(r,(0,B._)`{}`);let o=e.const("pos",se.default.jsonPos),a=e.let("value"),l=e.let("tag");mw(t,"}",()=>{let u=e.let("key");Nn({...t,data:u}),ur(t,":"),e.if((0,B._)`${u} === ${s}`,()=>{Nn({...t,data:l}),e.assign((0,B._)`${r}[${u}]`,l),e.break()},()=>Kh({...t,data:a}))}),e.assign(se.default.jsonPos,o),e.if((0,B._)`${l} === undefined`),Cr(t,(0,B.str)`discriminator tag not found`);for(let u in i)e.elseIf((0,B._)`${l} === ${u}`),gw({...t,schema:i[u]},s);e.else(),Cr(t,(0,B.str)`discriminator value not in schema`),e.endIf()}function uw(t){let{gen:e,data:r}=t;ur(t,"{"),e.assign(r,(0,B._)`{}`),gw(t)}function gw(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o,additionalProperties:a}=n;if(Jh(t,"}",()=>{let l=r.let("key");if(Nn({...t,data:l}),ur(t,":"),r.if(!1),cw(t,l,i),cw(t,l,o),e){r.elseIf((0,B._)`${l} === ${e}`);let u=r.let("tag");Nn({...t,data:u})}r.else(),a?Kh({...t,data:(0,B._)`${s}[${l}]`}):Cr(t,(0,B.str)`property ${l} not allowed`),r.endIf()}),i){let l=(0,cU.hasPropFunc)(r),u=(0,B.and)(...Object.keys(i).map(c=>(0,B._)`${l}.call(${s}, ${c})`));r.if((0,B.not)(u),()=>Cr(t,(0,B.str)`missing required properties`))}}function cw(t,e,r={}){let{gen:n}=t;for(let s in r)n.elseIf((0,B._)`${e} === ${s}`),yw(t,e,r[s])}function yw(t,e,r){Tl({...t,schema:r,data:(0,B._)`${t.data}[${e}]`})}function vU(t){let{gen:e,schema:r,data:n,self:s}=t;switch(r.type){case"boolean":gU(t);break;case"string":Nn(t);break;case"timestamp":{Nn(t);let i=(0,hw.useFunc)(e,hU.default),{allowDate:o,parseDate:a}=s.opts,l=o?(0,B._)`!${i}(${n}, true)`:(0,B._)`!${i}(${n})`,u=a?(0,B.or)(l,(0,B._)`(${n} = new Date(${n}), false)`,(0,B._)`isNaN(${n}.valueOf())`):l;e.if(u,()=>Cr(t,(0,B.str)`invalid timestamp`));break}case"float32":case"float64":Bh(t);break;default:{let i=r.type;if(!s.opts.int32range&&(i==="int32"||i==="uint32"))Bh(t,16),i==="uint32"&&e.if((0,B._)`${n} < 0`,()=>Cr(t,(0,B.str)`integer out of range`));else{let[o,a,l]=dU.intRange[i];Bh(t,l),e.if((0,B._)`${n} < ${o} || ${n} > ${a}`,()=>Cr(t,(0,B.str)`integer out of range`))}}}}function Nn(t){ur(t,'"'),Yh(t,Wh.parseJsonString)}function wU(t){let{gen:e,data:r,schema:n}=t,s=n.enum;ur(t,'"'),e.if(!1);for(let i of s){let o=JSON.stringify(i).slice(1);e.elseIf((0,B._)`${$l(o.length)} === ${o}`),e.assign(r,(0,B.str)`${i}`),e.add(se.default.jsonPos,o.length)}e.else(),Ps(t),e.endIf()}function Bh(t,e){let{gen:r}=t;Xh(t),r.if((0,B._)`"-0123456789".indexOf(${$l(1)}) < 0`,()=>Ps(t),()=>Yh(t,Wh.parseJsonNumber,e))}function fw(t,e){return r=>{let{gen:n,data:s}=r;Qi(r,`${t}`,()=>e(r),()=>n.assign(s,t))}}function RU(t){let{gen:e,self:r,definitions:n,schema:s,schemaEnv:i}=t,{ref:o}=s,a=n[o];if(!a)throw new uU.default(r.opts.uriResolver,"",o,`No definition ${o}`);if(!(0,fU.hasRef)(a))return Tl({...t,schema:a});let{root:l}=i,u=pw.call(r,new dw.SchemaEnv({schema:a,root:l}),n);_w(t,OU(e,u),!0)}function OU(t,e){return e.parse?t.scopeValue("parse",{ref:e.parse}):(0,B._)`${t.scopeValue("wrapper",{ref:e})}.parse`}function Kh(t){Yh(t,Wh.parseJson)}function Yh(t,e,r){_w(t,(0,hw.useFunc)(t.gen,e),r)}function _w(t,e,r){let{gen:n,data:s}=t;n.assign(s,(0,B._)`${e}(${se.default.json}, ${se.default.jsonPos}${r?(0,B._)`, ${r}`:B.nil})`),n.assign(se.default.jsonPos,(0,B._)`${e}.position`),n.if((0,B._)`${s} === undefined`,()=>Cr(t,(0,B._)`${e}.message`))}function ur(t,e){Qi(t,e,Ps)}function Qi(t,e,r,n){let{gen:s}=t,i=e.length;Xh(t),s.if((0,B._)`${$l(i)} === ${e}`,()=>{s.add(se.default.jsonPos,i),n?.(t)},()=>r(t))}function Xh({gen:t,char:e}){t.code((0,B._)`while((${e}=${se.default.json}[${se.default.jsonPos}],${e}===" "||${e}==="\\n"||${e}==="\\r"||${e}==="\\t"))${se.default.jsonPos}++;`)}function $l(t){return t===1?(0,B._)`${se.default.json}[${se.default.jsonPos}]`:(0,B._)`${se.default.json}.slice(${se.default.jsonPos}, ${se.default.jsonPos}+${t})`}function Ps(t){Cr(t,(0,B._)`"unexpected token " + ${se.default.json}[${se.default.jsonPos}]`)}function Cr({gen:t,parseName:e},r){t.assign((0,B._)`${e}.message`,r),t.assign((0,B._)`${e}.position`,se.default.jsonPos),t.return(Gh)}});var tp=E((we,ep)=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.MissingRefError=we.ValidationError=we.CodeGen=we.Name=we.nil=we.stringify=we.str=we._=we.KeywordCxt=we.Ajv=void 0;var TU=xd(),$U=Jv(),PU=Qv(),AU=ow(),CU=Sw(),Zh="JTD-meta-schema",As=class extends TU.default{constructor(e={}){super({...e,jtd:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary($U.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(PU.default,Zh,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Zh)?Zh:void 0)}compileSerializer(e){let r=this._addSchema(e);return r.serialize||this._compileSerializer(r)}compileParser(e){let r=this._addSchema(e);return r.parse||this._compileParser(r)}_compileSerializer(e){if(AU.default.call(this,e,e.schema.definitions||{}),!e.serialize)throw new Error("ajv implementation error");return e.serialize}_compileParser(e){if(CU.default.call(this,e,e.schema.definitions||{}),!e.parse)throw new Error("ajv implementation error");return e.parse}};we.Ajv=As;ep.exports=we=As;ep.exports.Ajv=As;Object.defineProperty(we,"__esModule",{value:!0});we.default=As;var IU=ms();Object.defineProperty(we,"KeywordCxt",{enumerable:!0,get:function(){return IU.KeywordCxt}});var Cs=W();Object.defineProperty(we,"_",{enumerable:!0,get:function(){return Cs._}});Object.defineProperty(we,"str",{enumerable:!0,get:function(){return Cs.str}});Object.defineProperty(we,"stringify",{enumerable:!0,get:function(){return Cs.stringify}});Object.defineProperty(we,"nil",{enumerable:!0,get:function(){return Cs.nil}});Object.defineProperty(we,"Name",{enumerable:!0,get:function(){return Cs.Name}});Object.defineProperty(we,"CodeGen",{enumerable:!0,get:function(){return Cs.CodeGen}});var NU=Ni();Object.defineProperty(we,"ValidationError",{enumerable:!0,get:function(){return NU.default}});var kU=wr();Object.defineProperty(we,"MissingRefError",{enumerable:!0,get:function(){return kU.default}})});var rp=E((ZY,Ew)=>{"use strict";var xU=sl();Ew.exports=Object.freeze({coerceTypes:"array",useDefaults:!0,removeAdditional:!0,uriResolver:xU,addUsedSchema:!1,allErrors:!1})});var Pl=E(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.formatNames=fr.fastFormats=fr.fullFormats=void 0;function cr(t,e){return{validate:t,compare:e}}fr.fullFormats={date:cr(Rw,op),time:cr(sp(!0),ap),"date-time":cr(bw(!0),Tw),"iso-time":cr(sp(),Ow),"iso-date-time":cr(bw(),$w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:MU,"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:WU,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:HU,int32:{type:"number",validate:UU},int64:{type:"number",validate:BU},float:{type:"number",validate:ww},double:{type:"number",validate:ww},password:!0,binary:!0};fr.fastFormats={...fr.fullFormats,date:cr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,op),time:cr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ap),"date-time":cr(/^\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,Tw),"iso-time":cr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ow),"iso-date-time":cr(/^\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,$w),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};fr.formatNames=Object.keys(fr.fullFormats);function LU(t){return t%4===0&&(t%100!==0||t%400===0)}var qU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,jU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Rw(t){let e=qU.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&LU(r)?29:jU[n])}function op(t,e){if(t&&e)return t>e?1:t<e?-1:0}var np=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function sp(t){return function(r){let n=np.exec(r);if(!n)return!1;let s=+n[1],i=+n[2],o=+n[3],a=n[4],l=n[5]==="-"?-1:1,u=+(n[6]||0),c=+(n[7]||0);if(u>23||c>59||t&&!a)return!1;if(s<=23&&i<=59&&o<60)return!0;let f=i-c*l,p=s-u*l-(f<0?1:0);return(p===23||p===-1)&&(f===59||f===-1)&&o<61}}function ap(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Ow(t,e){if(!(t&&e))return;let r=np.exec(t),n=np.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var ip=/t|\s/i;function bw(t){let e=sp(t);return function(n){let s=n.split(ip);return s.length===2&&Rw(s[0])&&e(s[1])}}function Tw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function $w(t,e){if(!(t&&e))return;let[r,n]=t.split(ip),[s,i]=e.split(ip),o=op(r,s);if(o!==void 0)return o||ap(n,i)}var DU=/\/|:/,FU=/^(?:[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 MU(t){return DU.test(t)&&FU.test(t)}var vw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function HU(t){return vw.lastIndex=0,vw.test(t)}var VU=-(2**31),zU=2**31-1;function UU(t){return Number.isInteger(t)&&t<=zU&&t>=VU}function BU(t){return Number.isInteger(t)}function ww(){return!0}var GU=/[^\\]\\Z/;function WU(t){if(GU.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Pw=E(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.formatLimitDefinition=void 0;var JU=El(),Jt=W(),tn=Jt.operators,Al={formatMaximum:{okStr:"<=",ok:tn.LTE,fail:tn.GT},formatMinimum:{okStr:">=",ok:tn.GTE,fail:tn.LT},formatExclusiveMaximum:{okStr:"<",ok:tn.LT,fail:tn.GTE},formatExclusiveMinimum:{okStr:">",ok:tn.GT,fail:tn.LTE}},KU={message:({keyword:t,schemaCode:e})=>(0,Jt.str)`should be ${Al[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Jt._)`{comparison: ${Al[t].okStr}, limit: ${e}}`};Is.formatLimitDefinition={keyword:Object.keys(Al),type:"string",schemaType:"string",$data:!0,error:KU,code(t){let{gen:e,data:r,schemaCode:n,keyword:s,it:i}=t,{opts:o,self:a}=i;if(!o.validateFormats)return;let l=new JU.KeywordCxt(i,a.RULES.all.format.definition,"format");l.$data?u():c();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),h=e.const("fmt",(0,Jt._)`${p}[${l.schemaCode}]`);t.fail$data((0,Jt.or)((0,Jt._)`typeof ${h} != "object"`,(0,Jt._)`${h} instanceof RegExp`,(0,Jt._)`typeof ${h}.compare != "function"`,f(h)))}function c(){let p=l.schema,h=a.formats[p];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${s}": format "${p}" does not define "compare" function`);let d=e.scopeValue("formats",{key:p,ref:h,code:o.code.formats?(0,Jt._)`${o.code.formats}${(0,Jt.getProperty)(p)}`:void 0});t.fail$data(f(d))}function f(p){return(0,Jt._)`${p}.compare(${r}, ${n}) ${Al[s].fail} 0`}},dependencies:["format"]};var YU=t=>(t.addKeyword(Is.formatLimitDefinition),t);Is.default=YU});var cp=E((Zi,Iw)=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var Ns=Pl(),XU=Pw(),lp=W(),Aw=new lp.Name("fullFormats"),QU=new lp.Name("fastFormats"),up=(t,e={keywords:!0})=>{if(Array.isArray(e))return Cw(t,e,Ns.fullFormats,Aw),t;let[r,n]=e.mode==="fast"?[Ns.fastFormats,QU]:[Ns.fullFormats,Aw],s=e.formats||Ns.formatNames;return Cw(t,s,r,n),e.keywords&&(0,XU.default)(t),t};up.get=(t,e="full")=>{let n=(e==="fast"?Ns.fastFormats:Ns.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Cw(t,e,r,n){var s,i;(s=(i=t.opts.code).formats)!==null&&s!==void 0||(i.formats=(0,lp._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}Iw.exports=Zi=up;Object.defineProperty(Zi,"__esModule",{value:!0});Zi.default=up});var xw=E((r7,kw)=>{"use strict";var ZU=El().default,e4=tp(),Nw=rp(),fp=class{constructor(e,r){r.mode==="JTD"?this.ajv=new e4(Object.assign({},Nw,r.customOptions)):this.ajv=new ZU(Object.assign({},Nw,r.customOptions));let n=!0;if(r.plugins&&r.plugins.length>0)for(let i of r.plugins)Array.isArray(i)?(n=n&&i[0].name!=="formatsPlugin",i[0](this.ajv,i[1])):(n=n&&i.name!=="formatsPlugin",i(this.ajv));n&&cp()(this.ajv),r.onCreate?.(this.ajv);let s=Object.values(e);for(let i of s)this.ajv.addSchema(i)}buildValidatorFunction({schema:e}){if(e.$id){let r=this.ajv.getSchema(e.$id);if(r)return r}return this.ajv.compile(e)}};kw.exports=fp});var qw=E((n7,Lw)=>{"use strict";var t4=tp(),r4=rp(),dp=class{constructor(e,r){this.ajv=new t4(Object.assign({},r4,r))}buildSerializerFunction({schema:e}){return this.ajv.compileSerializer(e)}};Lw.exports=dp});var Fw=E((to,Dw)=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});var eo=za(),Kt=as();function jw(t,e){if(!t.opts.code.source)throw new Error("moduleCode: ajv instance must have code.source option");let{_n:r}=t.scope.opts;return typeof e=="function"?s(e.source):e!==void 0?i(e,n):i(t.schemas,a=>a.meta?void 0:t.compile(a.schema));function n(a){let l=t.getSchema(a);if(!l)throw new Error(`moduleCode: no schema with id ${a}`);return l}function s(a){let l={},u=a?.validateName,c=o(l,a);return t.opts.code.esm?`"use strict";${r}export const validate = ${u};${r}export default ${u};${r}${c}`:`"use strict";${r}module.exports = ${u};${r}module.exports.default = ${u};${r}${c}`}function i(a,l){var u;let c={},f=(0,Kt._)`"use strict";`;for(let p in a){let h=l(a[p]);if(h){let d=o(c,h.source),m=t.opts.code.esm?(0,Kt._)`export const ${(0,Kt.getEsmExportName)(p)}`:(0,Kt._)`exports${(0,Kt.getProperty)(p)}`;f=(0,Kt._)`${f}${r}${m} = ${(u=h.source)===null||u===void 0?void 0:u.validateName};${r}${d}`}}return`${f}`}function o(a,l){if(!l)throw new Error('moduleCode: function does not have "source" property');if(p(l.validateName)===eo.UsedValueState.Completed)return Kt.nil;h(l.validateName,eo.UsedValueState.Started);let u=t.scope.scopeCode(l.scopeValues,a,f),c=new Kt._Code(`${u}${r}${l.validateCode}`);return l.evaluated?(0,Kt._)`${c}${l.validateName}.evaluated = ${l.evaluated};${r}`:c;function f(d){var m;let g=(m=d.value)===null||m===void 0?void 0:m.ref;if(d.prefix==="validate"&&typeof g=="function")return o(a,g.source);if((d.prefix==="root"||d.prefix==="wrapper")&&typeof g=="object"){let{validate:S,validateName:b}=g;if(!b)throw new Error("ajv internal error");let _=t.opts.code.es5?eo.varKinds.var:eo.varKinds.const,y=(0,Kt._)`${_} ${d} = {validate: ${b}};`;if(p(b)===eo.UsedValueState.Started)return y;let R=o(a,S?.source);return(0,Kt._)`${y}${r}${R}`}}function p(d){var m;return(m=a[d.prefix])===null||m===void 0?void 0:m.get(d)}function h(d,m){let{prefix:g}=d;(a[g]=a[g]||new Map).set(d,m)}}}Dw.exports=to=jw;Object.defineProperty(to,"__esModule",{value:!0});to.default=jw});var Vw=E((s7,Hw)=>{"use strict";var Mw=hp(),n4=Fw().default;function s4(t={readMode:!0}){if(t.readMode===!0&&!t.restoreFunction)throw new Error("You must provide a restoreFunction options when readMode ON");if(t.readMode!==!0&&!t.storeFunction)throw new Error("You must provide a storeFunction options when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=Mw();return function(n,s={}){(!s.customOptions||!s.customOptions.code)&&(s.customOptions=Object.assign({},s.customOptions,{code:{source:!0}}));let i=e(n,s);return function(o){let a=i(o),l=n4(i[Mw.AjvReference].ajv,a);return t.storeFunction(o,l),a}}}Hw.exports=s4});var hp=E((i7,ks)=>{"use strict";var Uw=Symbol.for("fastify.ajv-compiler.reference"),i4=xw(),o4=qw();function pp(t){let e=new Map,r=new Map;return t&&t.jtdSerializer===!0?function(s,i){let o=zw({},i);if(r.has(o))return r.get(o);let a=new o4(s,i),l=a.buildSerializerFunction.bind(a);return r.set(o,l),l}:function(s,i){let o=zw(s,i.customOptions);if(e.has(o))return e.get(o);let a=new i4(s,i),l=a.buildValidatorFunction.bind(a);return e.set(o,l),i.customOptions.code!==void 0&&(l[Uw]=a),l}}function zw(t,e){let r=JSON.stringify(t),n=JSON.stringify(e);return`${r}${n}`}ks.exports=pp;ks.exports.default=pp;ks.exports.AjvCompiler=pp;ks.exports.AjvReference=Uw;ks.exports.StandaloneValidator=Vw()});var Cl=E(Ww=>{var Bw=Object.prototype.hasOwnProperty;function Gw(t,e,r){for(r of t.keys())if(ro(r,e))return r}function ro(t,e){var r,n,s;if(t===e)return!0;if(t&&e&&(r=t.constructor)===e.constructor){if(r===Date)return t.getTime()===e.getTime();if(r===RegExp)return t.toString()===e.toString();if(r===Array){if((n=t.length)===e.length)for(;n--&&ro(t[n],e[n]););return n===-1}if(r===Set){if(t.size!==e.size)return!1;for(n of t)if(s=n,s&&typeof s=="object"&&(s=Gw(e,s),!s)||!e.has(s))return!1;return!0}if(r===Map){if(t.size!==e.size)return!1;for(n of t)if(s=n[0],s&&typeof s=="object"&&(s=Gw(e,s),!s)||!ro(n[1],e.get(s)))return!1;return!0}if(r===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(r===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return n===-1}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}if(!r||typeof t=="object"){n=0;for(r in t)if(Bw.call(t,r)&&++n&&!Bw.call(e,r)||!(r in e)||!ro(t[r],e[r]))return!1;return Object.keys(e).length===n}}return t!==t&&e!==e}Ww.dequal=ro});var Xw=E((a7,Yw)=>{"use strict";var{dequal:Jw}=Cl(),a4=Symbol.for("json-schema-ref"),mp=class{#e;#t;#r;#n;#s;constructor(e={}){this.#e={},this.#t={},this.#r=e.insertRefSymbol??!1,this.#n=e.allowEqualDuplicates??!0,this.#s=e.cloneSchemaWithoutRefs??!1}addSchema(e,r,n=!0){n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#l(e,r));let s=e.$id;s!==void 0&&typeof s=="string"&&(s.charAt(0)==="#"?this.#c(e,r,s):(this.#l(e,s),r=s));let i=e.$ref;if(i!==void 0&&typeof i=="string"){let{refSchemaId:o,refJsonPointer:a}=this.#i(i,r);this.#e[r].refs.push({schemaId:o,jsonPointer:a})}for(let o in e)typeof e[o]=="object"&&e[o]!==null&&this.addSchema(e[o],r,!1)}getSchema(e,r="#"){let n=this.#e[e];if(n===void 0)throw new Error(`Cannot resolve ref "${e}${r}". Schema with id "${e}" is not found.`);return n.anchors[r]!==void 0?n.anchors[r]:Kw(n.schema,r)}hasSchema(e){return this.#e[e]!==void 0}getSchemaRefs(e){let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);return r.refs}getSchemaDependencies(e,r={}){let n=this.#e[e];for(let s of n.refs){let i=s.schemaId;i===e||r[i]!==void 0||(r[i]=this.getSchema(i),this.getSchemaDependencies(i,r))}return r}derefSchema(e){if(this.#t[e]!==void 0)return;let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);!this.#s&&r.refs.length===0&&(this.#t[e]={schema:r.schema,anchors:r.anchors});let n=[];this.#o(r.schema,e,!0,n);let s=this.getSchemaDependencies(e);for(let i in s){let o=s[i];this.#o(o,i,!0,n)}for(let i of n){let{refSchemaId:o,refJsonPointer:a}=this.#i(i.ref,i.sourceSchemaId),l=this.getDerefSchema(o,a);if(l===null)throw new Error(`Cannot resolve ref "${i.ref}". Ref "${a}" is not found in schema "${o}".`);i.targetSchema=l,i.targetSchemaId=o}for(let i of n)this.#a(i,n)}getDerefSchema(e,r="#"){let n=this.#t[e];return n===void 0&&(this.derefSchema(e),n=this.#t[e]),n.anchors[r]!==void 0?n.anchors[r]:Kw(n.schema,r)}#i(e,r){let n=e.indexOf("#");return n===-1?{refSchemaId:e,refJsonPointer:"#"}:n===0?{refSchemaId:r,refJsonPointer:e}:{refSchemaId:e.slice(0,n),refJsonPointer:e.slice(n)}}#o(e,r,n,s=[]){let i=Array.isArray(e)?[...e]:{...e};n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#u(i,r));let o=i.$id;o!==void 0&&typeof o=="string"&&(o.charAt(0)==="#"?this.#f(i,r,o):(this.#u(i,o),r=o)),i.$ref!==void 0&&s.push({ref:i.$ref,sourceSchemaId:r,sourceSchema:i});for(let a in i){let l=i[a];typeof l=="object"&&l!==null&&(i[a]=this.#o(l,r,!1,s))}return i}#a(e,r){let{sourceSchema:n,targetSchema:s}=e;if(n.$ref){if(this.#r&&(n[a4]=n.$ref),delete n.$ref,s.$ref){let i=r.find(o=>o.sourceSchema===s);this.#a(i,r)}for(let i in s)if(i!=="$id"){if(n[i]!==void 0){if(Jw(n[i],s[i]))continue;throw new Error(`Cannot resolve ref "${e.ref}". Property "${i}" already exists in schema "${e.sourceSchemaId}".`)}n[i]=s[i]}e.isResolved=!0}}#l(e,r){let n=this.#e[r];if(n!==void 0){if(this.#n&&Jw(e,n.schema))return;throw new Error(`There is already another schema with id "${r}".`)}this.#e[r]={schema:e,anchors:{},refs:[]}}#c(e,r,n){let{anchors:s}=this.#e[r];if(s[n]!==void 0)throw new Error(`There is already another anchor "${n}" in schema "${r}".`);s[n]=e}#u(e,r){this.#t[r]===void 0&&(this.#t[r]={schema:e,anchors:{}})}#f(e,r,n){let{anchors:s}=this.#t[r];s[n]=e}};function Kw(t,e){let r=e.split("/"),n=t;for(let s of r)if(!(s===""||s==="#")){if(typeof n!="object"||n===null)return null;n=n[s]}return n??null}Yw.exports={RefResolver:mp}});var yp=E((l7,Qw)=>{"use strict";var l4=El(),u4=sl(),c4=cp(),f4=ga()({proto:!0}),gp=class t{constructor(e){this.ajv=new l4({...e,strictSchema:!1,validateSchema:!1,allowUnionTypes:!0,uriResolver:u4}),c4(this.ajv),this.ajv.addKeyword({keyword:"fjs_type",type:"object",errors:!1,validate:(r,n)=>n&&typeof n.toJSON=="function"}),this._ajvSchemas={},this._ajvOptions=e||{}}addSchema(e,r){let n=e.$id||r;if(e.$id!==void 0&&e.$id[0]==="#"&&(n=r+e.$id),this.ajv.refs[n]===void 0&&this.ajv.schemas[n]===void 0){let s=f4(e);this.convertSchemaToAjvFormat(s),this.ajv.addSchema(s,n),this._ajvSchemas[n]=e}}validate(e,r){return this.ajv.validate(e,r)}convertSchemaToAjvFormat(e){if(e!==null){e.type==="string"?(e.fjs_type="string",e.type=["string","object"]):Array.isArray(e.type)&&e.type.includes("string")&&!e.type.includes("object")&&(e.fjs_type="string",e.type.push("object"));for(let r in e)typeof e[r]=="object"&&this.convertSchemaToAjvFormat(e[r])}}getState(){return{ajvOptions:this._ajvOptions,ajvSchemas:this._ajvSchemas}}static restoreFromState(e){let r=new t(e.ajvOptions);for(let[n,s]of Object.entries(e.ajvSchemas))r.ajv.addSchema(s,n);return r}};Qw.exports=gp});var eR=E((u7,Zw)=>{"use strict";var _p=class t{constructor(e,r,n="#"){this.schema=e,this.schemaId=r,this.jsonPointer=n}getPropertyLocation(e){return new t(this.schema[e],this.schemaId,this.jsonPointer+"/"+e)}getSchemaRef(){return this.schemaId+this.jsonPointer}};Zw.exports=_p});var iR=E((c7,Ep)=>{"use strict";Ep.exports=x;Ep.exports.default=x;var d4={$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},tR={enum:["array","boolean","integer","null","number","object","string"]},rR=/^(?:[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,h4=Pl().fullFormats.uri,nR=Pl().fullFormats.regex;function Lt(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o;return typeof t=="number"&&!(t%1)&&!isNaN(t)&&isFinite(t)?o===a&&typeof t=="number"&&isFinite(t)&&(t<0||isNaN(t))?(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1):(Lt.errors=i,o===0):(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1)}var Sp={validate:x};function at(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(Array.isArray(t)){if(t.length<1)return at.errors=[{instancePath:e,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{var a=!0;let l=t.length;for(let u=0;u<l;u++){let c=o;Sp.validate(t[u],{instancePath:e+"/"+u,parentData:t,parentDataProperty:u,rootData:s})||(i=i===null?Sp.validate.errors:i.concat(Sp.validate.errors),o=i.length);var a=c===o;if(!a)break}}}else return at.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;return at.errors=i,o===0}var sR=Vi().default;function x(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(!(t&&typeof t=="object"&&!Array.isArray(t))&&typeof t!="boolean")return x.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:d4.type},message:"must be object,boolean"}],!1;if(o===0&&t&&typeof t=="object"&&!Array.isArray(t)){if(t.$id!==void 0){let _=t.$id,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!rR.test(_))return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$schema!==void 0){let _=t.$schema,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!h4(_))return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/format",keyword:"format",params:{format:"uri"},message:'must match format "uri"'}],!1}else return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$ref!==void 0){let _=t.$ref,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!rR.test(_))return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$comment!==void 0){let _=o;if(typeof t.$comment!="string")return x.errors=[{instancePath:e+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.title!==void 0){let _=o;if(typeof t.title!="string")return x.errors=[{instancePath:e+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.description!==void 0){let _=o;if(typeof t.description!="string")return x.errors=[{instancePath:e+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.readOnly!==void 0){let _=o;if(typeof t.readOnly!="boolean")return x.errors=[{instancePath:e+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.examples!==void 0){let _=o;if(o===_&&!Array.isArray(t.examples))return x.errors=[{instancePath:e+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=_===o}else var a=!0;if(a){if(t.multipleOf!==void 0){let _=t.multipleOf,y=o;if(o===y)if(typeof _=="number"&&isFinite(_)){if(_<=0||isNaN(_))return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0"}],!1}else return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maximum!==void 0){let _=t.maximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMaximum!==void 0){let _=t.exclusiveMaximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.minimum!==void 0){let _=t.minimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMinimum!==void 0){let _=t.exclusiveMinimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maxLength!==void 0){let _=t.maxLength,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minLength!==void 0){let _=o;Lt(t.minLength,{instancePath:e+"/minLength",parentData:t,parentDataProperty:"minLength",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.pattern!==void 0){let _=t.pattern,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!nR(_))return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"'}],!1}else return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalItems!==void 0){let _=o;x(t.additionalItems,{instancePath:e+"/additionalItems",parentData:t,parentDataProperty:"additionalItems",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.items!==void 0){let _=t.items,y=o,R=o,T=!1,O=o;x(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var l=O===o;if(T=T||l,!T){let $=o;at(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var l=$===o;T=T||l}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.maxItems!==void 0){let _=t.maxItems,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minItems!==void 0){let _=o;Lt(t.minItems,{instancePath:e+"/minItems",parentData:t,parentDataProperty:"minItems",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.uniqueItems!==void 0){let _=o;if(typeof t.uniqueItems!="boolean")return x.errors=[{instancePath:e+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.contains!==void 0){let _=o;x(t.contains,{instancePath:e+"/contains",parentData:t,parentDataProperty:"contains",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.maxProperties!==void 0){let _=t.maxProperties,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minProperties!==void 0){let _=o;Lt(t.minProperties,{instancePath:e+"/minProperties",parentData:t,parentDataProperty:"minProperties",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.required!==void 0){let _=t.required,y=o;if(o===o)if(Array.isArray(_)){var u=!0;let O=_.length;for(let w=0;w<O;w++){let $=o;if(typeof _[w]!="string")return x.errors=[{instancePath:e+"/required/"+w,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=$===o;if(!u)break}if(u){let w=_.length,$;if(w>1){let v={};for(;w--;){let P=_[w];if(typeof P=="string"){if(typeof v[P]=="number"){return $=v[P],x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:w,j:$},message:"must NOT have duplicate items (items ## "+$+" and "+w+" are identical)"}],!1;break}v[P]=w}}}}}else return x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalProperties!==void 0){let _=o;x(t.additionalProperties,{instancePath:e+"/additionalProperties",parentData:t,parentDataProperty:"additionalProperties",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.definitions!==void 0){let _=t.definitions,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/definitions/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var c=O===o;if(!c)break}else return x.errors=[{instancePath:e+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.properties!==void 0){let _=t.properties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/properties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var f=O===o;if(!f)break}else return x.errors=[{instancePath:e+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.patternProperties!==void 0){let _=t.patternProperties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_)){for(let T in _){let O=o;if(o===O&&typeof T=="string"&&!nR(T)){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"',propertyName:T};i===null?i=[w]:i.push(w),o++}var p=O===o;if(!p){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:T},message:"property name must be valid"};return i===null?i=[w]:i.push(w),o++,x.errors=i,!1;break}}if(p)for(let T in _){let O=o;x(_[T],{instancePath:e+"/patternProperties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var h=O===o;if(!h)break}}else return x.errors=[{instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.dependencies!==void 0){let _=t.dependencies,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=_[T],w=o,$=o,v=!1,P=o;x(O,{instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var d=P===o;if(v=v||d,!v){let C=o;if(o===o)if(Array.isArray(O)){var m=!0;let J=O.length;for(let U=0;U<J;U++){let H=o;if(typeof O[U]!="string"){let ze={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1")+"/"+U,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[ze]:i.push(ze),o++}var m=H===o;if(!m)break}if(m){let U=O.length,H;if(U>1){let fe={};for(;U--;){let ze=O[U];if(typeof ze=="string"){if(typeof fe[ze]=="number"){H=fe[ze];let G={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:U,j:H},message:"must NOT have duplicate items (items ## "+H+" and "+U+" are identical)"};i===null?i=[G]:i.push(G),o++;break}fe[ze]=U}}}}}else{let J={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[J]:i.push(J),o++}var d=C===o;v=v||d}if(v)o=$,i!==null&&($?i.length=$:i=null);else{let C={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[C]:i.push(C),o++,x.errors=i,!1}var g=w===o;if(!g)break}else return x.errors=[{instancePath:e+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.propertyNames!==void 0){let _=o;x(t.propertyNames,{instancePath:e+"/propertyNames",parentData:t,parentDataProperty:"propertyNames",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.enum!==void 0){let _=t.enum,y=o;if(o===y)if(Array.isArray(_)){if(_.length<1)return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{let T=_.length,O;if(T>1){e:for(;T--;)for(O=T;O--;)if(sR(_[T],_[O])){return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:T,j:O},message:"must NOT have duplicate items (items ## "+O+" and "+T+" are identical)"}],!1;break e}}}}else return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.type!==void 0){let _=t.type,y=o,R=o,T=!1,O=o;if(!(_==="array"||_==="boolean"||_==="integer"||_==="null"||_==="number"||_==="object"||_==="string")){let $={instancePath:e+"/type",schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:tR.enum},message:"must be equal to one of the allowed values"};i===null?i=[$]:i.push($),o++}var S=O===o;if(T=T||S,!T){let $=o;if(o===$)if(Array.isArray(_))if(_.length<1){let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};i===null?i=[P]:i.push(P),o++}else{var b=!0;let P=_.length;for(let C=0;C<P;C++){let k=_[C],M=o;if(!(k==="array"||k==="boolean"||k==="integer"||k==="null"||k==="number"||k==="object"||k==="string")){let U={instancePath:e+"/type/"+C,schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:tR.enum},message:"must be equal to one of the allowed values"};i===null?i=[U]:i.push(U),o++}var b=M===o;if(!b)break}if(b){let C=_.length,k;if(C>1){e:for(;C--;)for(k=C;k--;)if(sR(_[C],_[k])){let M={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:C,j:k},message:"must NOT have duplicate items (items ## "+k+" and "+C+" are identical)"};i===null?i=[M]:i.push(M),o++;break e}}}}else{let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[P]:i.push(P),o++}var S=$===o;T=T||S}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.format!==void 0){let _=o;if(typeof t.format!="string")return x.errors=[{instancePath:e+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentMediaType!==void 0){let _=o;if(typeof t.contentMediaType!="string")return x.errors=[{instancePath:e+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentEncoding!==void 0){let _=o;if(typeof t.contentEncoding!="string")return x.errors=[{instancePath:e+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.if!==void 0){let _=o;x(t.if,{instancePath:e+"/if",parentData:t,parentDataProperty:"if",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.then!==void 0){let _=o;x(t.then,{instancePath:e+"/then",parentData:t,parentDataProperty:"then",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.else!==void 0){let _=o;x(t.else,{instancePath:e+"/else",parentData:t,parentDataProperty:"else",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.allOf!==void 0){let _=o;at(t.allOf,{instancePath:e+"/allOf",parentData:t,parentDataProperty:"allOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.anyOf!==void 0){let _=o;at(t.anyOf,{instancePath:e+"/anyOf",parentData:t,parentDataProperty:"anyOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.oneOf!==void 0){let _=o;at(t.oneOf,{instancePath:e+"/oneOf",parentData:t,parentDataProperty:"oneOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a)if(t.not!==void 0){let _=o;x(t.not,{instancePath:e+"/not",parentData:t,parentDataProperty:"not",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return x.errors=i,o===0}});var Rp=E((f7,oR)=>{"use strict";var bp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Failed to merge "${e}" keyword schemas.`,this.schemas=r}},vp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Resolver for "${e}" keyword not found.`,this.schemas=r}},wp=class extends Error{constructor(e){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Invalid "onConflict" option: "${e}".`}};oR.exports={MergeError:bp,ResolverNotFoundError:vp,InvalidOnConflictOptionError:wp}});var uR=E((d7,lR)=>{"use strict";var{dequal:p4}=Cl(),{MergeError:Op}=Rp();function aR(t){let e=t[0];for(let r=1;r<t.length;r++)e=e.filter(n=>t[r].includes(n));return e}function m4(t,e,r){let n=aR(e);if(n.length===0)throw new Op(t,e);r[t]=n}function g4(t,e,r){for(let s=0;s<e.length;s++)Array.isArray(e[s])||(e[s]=[e[s]]);let n=aR(e);if(n.length===0)throw new Op(t,e);n.length===1?r[t]=n[0]:r[t]=n}function y4(t,e,r){let n=[];for(let s of e)for(let i of s)n.includes(i)||n.push(i);r[t]=n}function _4(t,e,r){r[t]=Math.min(...e)}function S4(t,e,r){r[t]=Math.max(...e)}function E4(t,e,r){let n=(a,l)=>l?n(l,a%l):a,s=(a,l)=>a*l/n(a,l),i=1;for(let a of e)for(;a*i%1!==0;)i*=10;let o=e[0]*i;for(let a of e)o=s(o,a*i);r[t]=o/i}function b4(t,e,r){let n=e[0];for(let s=1;s<e.length;s++)if(!p4(e[s],n))throw new Op(t,e);r[t]=n}function v4(){}function w4(t,e,r){for(let n of e)if(n===!1){r[t]=!1;return}r[t]=!0}function R4(t,e,r){for(let n of e)if(n===!0){r[t]=!0;return}r[t]=!1}lR.exports={arraysIntersection:m4,hybridArraysIntersection:g4,arraysUnion:y4,minNumber:_4,maxNumber:S4,commonMultiple:E4,allEqual:b4,booleanAnd:w4,booleanOr:R4,skip:v4}});var mR=E((h7,pR)=>{"use strict";var{dequal:O4}=Cl(),Oe=uR(),kl=Rp(),dR={$id:Oe.skip,type:Oe.hybridArraysIntersection,enum:Oe.arraysIntersection,minLength:Oe.maxNumber,maxLength:Oe.minNumber,minimum:Oe.maxNumber,maximum:Oe.minNumber,multipleOf:Oe.commonMultiple,exclusiveMinimum:Oe.maxNumber,exclusiveMaximum:Oe.minNumber,minItems:Oe.maxNumber,maxItems:Oe.minNumber,maxProperties:Oe.minNumber,minProperties:Oe.maxNumber,const:Oe.allEqual,default:Oe.allEqual,format:Oe.allEqual,required:Oe.arraysUnion,properties:I4,patternProperties:Nl,additionalProperties:Il,items:P4,additionalItems:A4,definitions:Nl,$defs:Nl,nullable:Oe.booleanAnd,oneOf:cR,anyOf:cR,allOf:Oe.arraysUnion,not:Il,if:N4,then:Oe.skip,else:Oe.skip,dependencies:fR,dependentRequired:fR,dependentSchemas:Nl,propertyNames:Il,uniqueItems:Oe.booleanOr,contains:Il};function Il(t,e,r,n,s){r[t]=Yt(e,s)}function T4(t){let e=[[]];for(let r of t){let n=[];for(let s of e)for(let i of r)n.push([...s,i]);e=n}return e}function cR(t,e,r,n,s){if(e.length===1){r[t]=e[0];return}let i=T4(e),o=[];for(let a of i)try{let l=Yt(a,s);l!==void 0&&o.push(l)}catch(l){if(l instanceof kl.MergeError)continue;throw l}r[t]=o}function $4(t,e){let{items:r,additionalItems:n}=t;return Array.isArray(r)?e<r.length?r[e]:n:r!==void 0?r:n}function P4(t,e,r,n,s){let i=0;for(let a of e)Array.isArray(a)&&(i=Math.max(i,a.length));if(i===0){r[t]=Yt(e,s);return}let o=[];for(let a=0;a<i;a++){let l=[];for(let u of n){let c=$4(u,a);c!==void 0&&l.push(c)}o[a]=Yt(l,s)}r[t]=o}function A4(t,e,r,n,s){let i=!1;for(let a of n)if(Array.isArray(a.items)){i=!0;break}if(!i){r[t]=Yt(e,s);return}let o=[];for(let a of n){let l=a.additionalItems;l===void 0&&!Array.isArray(a.items)&&(l=a.items),l!==void 0&&o.push(l)}r[t]=Yt(o,s)}function C4(t,e){let{properties:r,patternProperties:n,additionalProperties:s}=t;if(r?.[e]!==void 0)return r[e];for(let i of Object.keys(n??{}))if(new RegExp(i).test(e))return n[i];return s}function I4(t,e,r,n,s){let i={};for(let a of n){let l=a.properties??{};for(let u of Object.keys(l)){if(i[u]!==void 0)continue;let c=l[u];i[u]=[c];for(let f of n){if(a===f)continue;let p=C4(f,u);p!==void 0&&i[u].push(p)}}}let o={};for(let a of Object.keys(i)){let l=i[a];o[a]=Yt(l,s)}r[t]=o}function Nl(t,e,r,n,s){let i={};for(let a of e)for(let l of Object.keys(a))i[l]===void 0&&(i[l]=[]),i[l].push(a[l]);let o={};for(let a of Object.keys(i)){let l=i[a],u=Yt(l,s);o[a]=u}r[t]=o}function N4(t,e,r,n,s){for(let i=0;i<n.length;i++){let o={if:n[i].if,then:n[i].then,else:n[i].else};if(o.if!==void 0){if(r.if===void 0){r.if=o.if,o.then!==void 0&&(r.then=o.then),o.else!==void 0&&(r.else=o.else);continue}r.then!==void 0&&(r.then=Yt([r.then,o],s)),r.else!==void 0&&(r.else=Yt([r.else,o],s))}}}function fR(t,e,r){let n={};for(let s of e)for(let i of Object.keys(s)){n[i]===void 0&&(n[i]=[]);let o=n[i];for(let a of s[i])o.includes(a)||o.push(a)}r[t]=n}function Yt(t,e){if(t.length===0)return{};if(t.length===1)return t[0];let r={},n={},s=!0;for(let i of t){if(i===!1)return!1;if(i!==!0){s=!1;for(let o of Object.keys(i))n[o]===void 0&&(n[o]=[]),n[o].push(i[o])}}if(s)return!0;for(let i of Object.keys(n)){let o=n[i];(e.resolvers[i]??e.defaultResolver)(i,o,r,t,e)}return r}function hR(t,e,r,n,s){let i=s.onConflict??"throw";if(e.length===1||i==="first"){r[t]=e[0];return}let o=!0;for(let a=1;a<e.length;a++)if(!O4(e[a],e[0])){o=!1;break}if(o){r[t]=e[0];return}if(i==="throw")throw new kl.ResolverNotFoundError(t,e);if(i!=="skip")throw new kl.InvalidOnConflictOptionError(i)}function k4(t,e={}){return e.defaultResolver===void 0&&(e.defaultResolver=hR),e.resolvers={...dR,...e.resolvers},Yt(t,e)}pR.exports={mergeSchemas:k4,keywordsResolvers:dR,defaultResolver:hR,...kl}});var yR=E((p7,gR)=>{"use strict";var{mergeSchemas:x4}=mR();function L4(t){return x4(t,{onConflict:"skip"})}gR.exports=L4});var _R=E((m7,Tp)=>{"use strict";function q4(t,e,r,n){let s="";e.validatorSchemasIds.size>0?(s+=`const Validator = require('fast-json-stringify/lib/validator')
|
|
58
|
+
deps: ${r}}`};var A2={keyword:"dependencies",type:"object",schemaType:"object",error:lr.error,code(t){let[e,r]=C2(t);Yb(t,e),Xb(t,r)}};function C2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Yb(t,e=t.schema){let{gen:r,data:n,it:s}=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 l=(0,Gi.propertyInData)(r,n,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(l,()=>{for(let u of a)(0,Gi.checkReportMissingProp)(t,u)}):(r.if((0,oh._)`${l} && (${(0,Gi.checkMissingProp)(t,a,i)})`),(0,Gi.reportMissingProp)(t,i),r.else())}}lr.validatePropertyDeps=Yb;function Xb(t,e=t.schema){let{gen:r,data:n,keyword:s,it:i}=t,o=r.name("valid");for(let a in e)(0,P2.alwaysValidSchema)(i,e[a])||(r.if((0,Gi.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let l=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),t.ok(o))}lr.validateSchemaDeps=Xb;lr.default=A2});var ev=E(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var Zb=W(),I2=ee(),N2={message:"property name must be valid",params:({params:t})=>(0,Zb._)`{propertyName: ${t.propertyName}}`},k2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:N2,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,I2.alwaysValidSchema)(s,r))return;let i=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,Zb.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};ah.default=k2});var uh=E(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var hl=We(),Wt=W(),x2=Nt(),pl=ee(),L2={message:"must NOT have additional properties",params:({params:t})=>(0,Wt._)`{additionalProperty: ${t.additionalProperty}}`},q2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:L2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,pl.alwaysValidSchema)(o,r))return;let u=(0,hl.allSchemaProperties)(n.properties),c=(0,hl.allSchemaProperties)(n.patternProperties);f(),t.ok((0,Wt._)`${i} === ${x2.default.errors}`);function f(){e.forIn("key",s,g=>{!u.length&&!c.length?d(g):e.if(p(g),()=>d(g))})}function p(g){let S;if(u.length>8){let b=(0,pl.schemaRefOrVal)(o,n.properties,"properties");S=(0,hl.isOwnProperty)(e,b,g)}else u.length?S=(0,Wt.or)(...u.map(b=>(0,Wt._)`${g} === ${b}`)):S=Wt.nil;return c.length&&(S=(0,Wt.or)(S,...c.map(b=>(0,Wt._)`${(0,hl.usePattern)(t,b)}.test(${g})`))),(0,Wt.not)(S)}function h(g){e.code((0,Wt._)`delete ${s}[${g}]`)}function d(g){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,pl.alwaysValidSchema)(o,r)){let S=e.name("valid");l.removeAdditional==="failing"?(m(g,S,!1),e.if((0,Wt.not)(S),()=>{t.reset(),h(g)})):(m(g,S),a||e.if((0,Wt.not)(S),()=>e.break()))}}function m(g,S,b){let _={keyword:"additionalProperties",dataProp:g,dataPropType:pl.Type.Str};b===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(_,S)}}};lh.default=q2});var nv=E(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var j2=ms(),tv=We(),ch=ee(),rv=uh(),D2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&rv.default.code(new j2.KeywordCxt(i,rv.default,"additionalProperties"));let o=(0,tv.allSchemaProperties)(r);for(let f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=ch.mergeEvaluated.props(e,(0,ch.toHash)(o),i.props));let a=o.filter(f=>!(0,ch.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let l=e.name("valid");for(let f of a)u(f)?c(f):(e.if((0,tv.propertyInData)(e,s,f,i.opts.ownProperties)),c(f),i.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(f),t.ok(l);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function c(f){t.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};fh.default=D2});var av=E(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var sv=We(),ml=W(),iv=ee(),ov=ee(),F2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,sv.allSchemaProperties)(r),l=a.filter(m=>(0,iv.alwaysValidSchema)(i,r[m]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,c=e.name("valid");i.props!==!0&&!(i.props instanceof ml.Name)&&(i.props=(0,ov.evaluatedPropsToName)(e,i.props));let{props:f}=i;p();function p(){for(let m of a)u&&h(m),i.allErrors?d(m):(e.var(c,!0),d(m),e.if(c))}function h(m){for(let g in u)new RegExp(m).test(g)&&(0,iv.checkStrictMode)(i,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function d(m){e.forIn("key",n,g=>{e.if((0,ml._)`${(0,sv.usePattern)(t,m)}.test(${g})`,()=>{let S=l.includes(m);S||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:ov.Type.Str},c),i.opts.unevaluated&&f!==!0?e.assign((0,ml._)`${f}[${g}]`,!0):!S&&!i.allErrors&&e.if((0,ml.not)(c),()=>e.break())})})}}};dh.default=F2});var lv=E(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var M2=ee(),H2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,M2.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};hh.default=H2});var uv=E(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var V2=We(),z2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:V2.validateUnion,error:{message:"must match a schema in anyOf"}};ph.default=z2});var cv=E(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var gl=W(),U2=ee(),B2={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,gl._)`{passingSchemas: ${t.passing}}`},G2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:B2,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,o=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(o,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((c,f)=>{let p;(0,U2.alwaysValidSchema)(s,c)?e.var(l,!0):p=t.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&e.if((0,gl._)`${l} && ${o}`).assign(o,!1).assign(a,(0,gl._)`[${a}, ${f}]`).else(),e.if(l,()=>{e.assign(o,!0),e.assign(a,f),p&&t.mergeEvaluated(p,gl.Name)})})}}};mh.default=G2});var fv=E(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var W2=ee(),J2={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((i,o)=>{if((0,W2.alwaysValidSchema)(n,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};gh.default=J2});var pv=E(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});var yl=W(),hv=ee(),K2={message:({params:t})=>(0,yl.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,yl._)`{failingKeyword: ${t.ifClause}}`},Y2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:K2,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,hv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=dv(n,"then"),i=dv(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(l(),t.reset(),s&&i){let c=e.let("ifClause");t.setParams({ifClause:c}),e.if(a,u("then",c),u("else",c))}else s?e.if(a,u("then")):e.if((0,yl.not)(a),u("else"));t.pass(o,()=>t.error(!0));function l(){let c=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(c)}function u(c,f){return()=>{let p=t.subschema({keyword:c},a);e.assign(o,a),t.mergeValidEvaluated(p,o),f?e.assign(f,(0,yl._)`${c}`):t.setParams({ifClause:c})}}}};function dv(t,e){let r=t.schema[e];return r!==void 0&&!(0,hv.alwaysValidSchema)(t,r)}yh.default=Y2});var mv=E(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var X2=ee(),Q2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,X2.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};_h.default=Q2});var gv=E(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var Z2=th(),eV=Gb(),tV=rh(),rV=Jb(),nV=Kb(),sV=Qb(),iV=ev(),oV=uh(),aV=nv(),lV=av(),uV=lv(),cV=uv(),fV=cv(),dV=fv(),hV=pv(),pV=mv();function mV(t=!1){let e=[uV.default,cV.default,fV.default,dV.default,hV.default,pV.default,iV.default,oV.default,sV.default,aV.default,lV.default];return t?e.push(eV.default,rV.default):e.push(Z2.default,tV.default),e.push(nV.default),e}Sh.default=mV});var yv=E(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var Le=W(),gV={message:({schemaCode:t})=>(0,Le.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Le._)`{format: ${t}}`},yV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:gV,code(t,e){let{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:l,errSchemaPath:u,schemaEnv:c,self:f}=a;if(!l.validateFormats)return;s?p():h();function p(){let d=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=r.const("fDef",(0,Le._)`${d}[${o}]`),g=r.let("fType"),S=r.let("format");r.if((0,Le._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,Le._)`${m}.type || "string"`).assign(S,(0,Le._)`${m}.validate`),()=>r.assign(g,(0,Le._)`"string"`).assign(S,m)),t.fail$data((0,Le.or)(b(),_()));function b(){return l.strictSchema===!1?Le.nil:(0,Le._)`${o} && !${S}`}function _(){let y=c.$async?(0,Le._)`(${m}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,Le._)`${S}(${n})`,R=(0,Le._)`(typeof ${S} == "function" ? ${y} : ${S}.test(${n}))`;return(0,Le._)`${S} && ${S} !== true && ${g} === ${e} && !${R}`}}function h(){let d=f.formats[i];if(!d){b();return}if(d===!0)return;let[m,g,S]=_(d);m===e&&t.pass(y());function b(){if(l.strictSchema===!1){f.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function _(R){let T=R instanceof RegExp?(0,Le.regexpCode)(R):l.code.formats?(0,Le._)`${l.code.formats}${(0,Le.getProperty)(i)}`:void 0,O=r.scopeValue("formats",{key:i,ref:R,code:T});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,Le._)`${O}.validate`]:["string",R,O]}function y(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${S}(${n})`}return typeof g=="function"?(0,Le._)`${S}(${n})`:(0,Le._)`${S}.test(${n})`}}}};Eh.default=yV});var _v=E(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var _V=yv(),SV=[_V.default];bh.default=SV});var Sv=E(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.contentVocabulary=Ss.metadataVocabulary=void 0;Ss.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ss.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var bv=E(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var EV=Pb(),bV=Vb(),vV=gv(),wV=_v(),Ev=Sv(),RV=[EV.default,bV.default,(0,vV.default)(),wV.default,Ev.metadataVocabulary,Ev.contentVocabulary];vh.default=RV});var wh=E(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.DiscrError=void 0;var vv;(function(t){t.Tag="tag",t.Mapping="mapping"})(vv||(_l.DiscrError=vv={}))});var Rv=E(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var Es=W(),Rh=wh(),wv=$n(),OV=wr(),TV=ee(),$V={message:({params:{discrError:t,tagName:e}})=>t===Rh.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Es._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},PV={keyword:"discriminator",type:"object",schemaType:"object",error:$V,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),u=e.const("tag",(0,Es._)`${r}${(0,Es.getProperty)(a)}`);e.if((0,Es._)`typeof ${u} == "string"`,()=>c(),()=>t.error(!1,{discrError:Rh.DiscrError.Tag,tag:u,tagName:a})),t.ok(l);function c(){let h=p();e.if(!1);for(let d in h)e.elseIf((0,Es._)`${u} === ${d}`),e.assign(l,f(h[d]));e.else(),t.error(!1,{discrError:Rh.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function f(h){let d=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},d);return t.mergeEvaluated(m,Es.Name),d}function p(){var h;let d={},m=S(s),g=!0;for(let y=0;y<o.length;y++){let R=o[y];if(R?.$ref&&!(0,TV.schemaHasRulesButRef)(R,i.self.RULES)){let O=R.$ref;if(R=wv.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,O),R instanceof wv.SchemaEnv&&(R=R.schema),R===void 0)throw new OV.default(i.opts.uriResolver,i.baseId,O)}let T=(h=R?.properties)===null||h===void 0?void 0:h[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||S(R)),b(T,y)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return d;function S({required:y}){return Array.isArray(y)&&y.includes(a)}function b(y,R){if(y.const)_(y.const,R);else if(y.enum)for(let T of y.enum)_(T,R);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function _(y,R){if(typeof y!="string"||y in d)throw new Error(`discriminator: "${a}" values must be unique strings`);d[y]=R}}}};Oh.default=PV});var Ov=E((VY,AV)=>{AV.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 El=E((ve,Th)=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.MissingRefError=ve.ValidationError=ve.CodeGen=ve.Name=ve.nil=ve.stringify=ve.str=ve._=ve.KeywordCxt=ve.Ajv=void 0;var CV=Ld(),IV=bv(),NV=Rv(),Tv=Ov(),kV=["/properties"],Sl="http://json-schema.org/draft-07/schema",bs=class extends CV.default{_addVocabularies(){super._addVocabularies(),IV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(NV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Tv,kV):Tv;this.addMetaSchema(e,Sl,!1),this.refs["http://json-schema.org/schema"]=Sl}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sl)?Sl:void 0)}};ve.Ajv=bs;Th.exports=ve=bs;Th.exports.Ajv=bs;Object.defineProperty(ve,"__esModule",{value:!0});ve.default=bs;var xV=ms();Object.defineProperty(ve,"KeywordCxt",{enumerable:!0,get:function(){return xV.KeywordCxt}});var vs=W();Object.defineProperty(ve,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(ve,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(ve,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(ve,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(ve,"Name",{enumerable:!0,get:function(){return vs.Name}});Object.defineProperty(ve,"CodeGen",{enumerable:!0,get:function(){return vs.CodeGen}});var LV=Ni();Object.defineProperty(ve,"ValidationError",{enumerable:!0,get:function(){return LV.default}});var qV=wr();Object.defineProperty(ve,"MissingRefError",{enumerable:!0,get:function(){return qV.default}})});var Or=E(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.checkMetadata=void 0;var jV=ee(),DV={keyword:"metadata",schemaType:"object",code(t){$v(t);let{gen:e,schema:r,it:n}=t;if((0,jV.alwaysValidSchema)(n,r))return;let s=e.name("valid");t.subschema({keyword:"metadata",jtdMetadata:!0},s),t.ok(s)}};function $v({it:t,keyword:e},r){if(t.jtdMetadata!==r)throw new Error(`JTD: "${e}" cannot be used in this schema location`)}Wi.checkMetadata=$v;Wi.default=DV});var bl=E(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.hasRef=void 0;var Pv=$n(),Ji=W(),FV=wr(),Av=Nt(),Cv=jd(),MV=Or(),HV={keyword:"ref",schemaType:"string",code(t){(0,MV.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{schemaEnv:{root:o}}=i,a=e.name("valid");s.nullable?(e.var(a,(0,Ji._)`${r} === null`),e.if((0,Ji.not)(a),l)):(e.var(a,!1),l()),t.ok(a);function l(){var f;let p=(f=o.schema.definitions)===null||f===void 0?void 0:f[n];if(!p)throw new FV.default(i.opts.uriResolver,"",n,`No definition ${n}`);$h(p)||!i.opts.inlineRefs?u(p):c(p)}function u(f){let p=Pv.compileSchema.call(i.self,new Pv.SchemaEnv({schema:f,root:o,schemaPath:`/definitions/${n}`})),h=(0,Cv.getValidate)(t,p),d=e.const("_errs",Av.default.errors);(0,Cv.callRef)(t,h,p,p.$async),e.assign(a,(0,Ji._)`${d} === ${Av.default.errors}`)}function c(f){let p=e.scopeValue("schema",i.opts.code.source===!0?{ref:f,code:(0,Ji.stringify)(f)}:{ref:f});t.subschema({schema:f,dataTypes:[],schemaPath:Ji.nil,topSchemaRef:p,errSchemaPath:`/definitions/${n}`},a)}}};function $h(t){for(let e in t){let r;if(e==="ref"||typeof(r=t[e])=="object"&&$h(r))return!0}return!1}Ki.hasRef=$h;Ki.default=HV});var Ah=E(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});var VV=/t|\s/i,zV=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,UV=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,BV=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Nv(t,e){let r=t.split(VV);return r.length===2&&Iv(r[0])&&GV(r[1])||e&&r.length===1&&Iv(r[0])}Ph.default=Nv;function Iv(t){let e=zV.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&(s<=BV[n]||n===2&&s===29&&(r%100===0?r%400===0:r%4===0))}function GV(t){let e=UV.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3],i=+(e[4]||0),o=+(e[5]||0);return r<=23&&n<=59&&s<=59||r-i===23&&n-o===59&&s===60}Nv.code='require("ajv/dist/runtime/timestamp").default'});var ws=E(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.typeErrorParams=Yr.typeErrorMessage=Yr.typeError=void 0;var WV=W();function JV(t){return{message:e=>kv(e,t),params:e=>xv(e,t)}}Yr.typeError=JV;function kv({parentSchema:t},e){return t?.nullable?`must be ${e} or null`:`must be ${e}`}Yr.typeErrorMessage=kv;function xv({parentSchema:t},e){return(0,WV._)`{type: ${e}, nullable: ${!!t?.nullable}}`}Yr.typeErrorParams=xv});var Ch=E(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.intRange=void 0;var Ot=W(),KV=Ah(),YV=ee(),XV=Or(),Lv=ws();Rs.intRange={int8:[-128,127,3],uint8:[0,255,3],int16:[-32768,32767,5],uint16:[0,65535,5],int32:[-2147483648,2147483647,10],uint32:[0,4294967295,10]};var QV={message:t=>(0,Lv.typeErrorMessage)(t,t.schema),params:t=>(0,Lv.typeErrorParams)(t,t.schema)};function ZV(t){let{gen:e,data:r,it:n}=t,{timestamp:s,allowDate:i}=n.opts;if(s==="date")return(0,Ot._)`${r} instanceof Date `;let o=(0,YV.useFunc)(e,KV.default),a=i?(0,Ot._)`, true`:Ot.nil,l=(0,Ot._)`typeof ${r} == "string" && ${o}(${r}${a})`;return s==="string"?l:(0,Ot.or)((0,Ot._)`${r} instanceof Date`,l)}var ez={keyword:"type",schemaType:"string",error:QV,code(t){(0,XV.checkMetadata)(t);let{data:e,schema:r,parentSchema:n,it:s}=t,i;switch(r){case"boolean":case"string":i=(0,Ot._)`typeof ${e} == ${r}`;break;case"timestamp":{i=ZV(t);break}case"float32":case"float64":i=(0,Ot._)`typeof ${e} == "number"`;break;default:{let o=r;if(i=(0,Ot._)`typeof ${e} == "number" && isFinite(${e}) && !(${e} % 1)`,!s.opts.int32range&&(o==="int32"||o==="uint32"))o==="uint32"&&(i=(0,Ot._)`${i} && ${e} >= 0`);else{let[a,l]=Rs.intRange[o];i=(0,Ot._)`${i} && ${e} >= ${a} && ${e} <= ${l}`}}}t.pass(n.nullable?(0,Ot.or)((0,Ot._)`${e} === null`,i):i)}};Rs.default=ez});var Ts=E(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.checkNullableObject=Os.checkNullable=void 0;var vl=W();function qv({gen:t,data:e,parentSchema:r},n=vl.nil){let s=t.name("valid");return r.nullable?(t.let(s,(0,vl._)`${e} === null`),n=(0,vl.not)(s)):t.let(s,!1),[s,n]}Os.checkNullable=qv;function tz(t,e){let[r,n]=qv(t,e);return[r,(0,vl._)`${n} && typeof ${t.data} == "object" && !Array.isArray(${t.data})`]}Os.checkNullableObject=tz});var jv=E(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});var Xr=W(),rz=Or(),nz=Ts(),sz={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Xr._)`{allowedValues: ${t}}`},iz={keyword:"enum",schemaType:"array",error:sz,code(t){(0,rz.checkMetadata)(t);let{gen:e,data:r,schema:n,schemaValue:s,parentSchema:i,it:o}=t;if(n.length===0)throw new Error("enum must have non-empty array");if(n.length!==new Set(n).size)throw new Error("enum items must be unique");let a,l=(0,Xr._)`typeof ${r} == "string"`;if(n.length>=o.opts.loopEnum){let c;[a,c]=(0,nz.checkNullable)(t,l),e.if(c,u)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");a=(0,Xr.and)(l,(0,Xr.or)(...n.map(c=>(0,Xr._)`${r} === ${c}`))),i.nullable&&(a=(0,Xr.or)((0,Xr._)`${r} === null`,a))}t.pass(a);function u(){e.forOf("v",s,c=>e.if((0,Xr._)`${a} = ${r} === ${c}`,()=>e.break()))}}};Ih.default=iz});var Fv=E(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});var oz=ee(),az=We(),Dv=W(),lz=Or(),uz=Ts(),cz=ws(),fz={keyword:"elements",schemaType:"object",error:(0,cz.typeError)("array"),code(t){(0,lz.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t;if((0,oz.alwaysValidSchema)(s,n))return;let[i]=(0,uz.checkNullable)(t);e.if((0,Dv.not)(i),()=>e.if((0,Dv._)`Array.isArray(${r})`,()=>e.assign(i,(0,az.validateArray)(t)),()=>t.error())),t.ok(i)}};Nh.default=fz});var xh=E(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.validateProperties=Qr.error=void 0;var kh=We(),Mv=ee(),Tr=W(),dz=Or(),hz=Ts(),Hv=ws(),$s;(function(t){t.Additional="additional",t.Missing="missing"})($s||($s={}));Qr.error={message:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?"must NOT have additional properties":`must have property '${e.missingProperty}'`:(0,Hv.typeErrorMessage)(t,"object")},params:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?(0,Tr._)`{error: ${e.propError}, additionalProperty: ${e.additionalProperty}}`:(0,Tr._)`{error: ${e.propError}, missingProperty: ${e.missingProperty}}`:(0,Hv.typeErrorParams)(t,"object")}};var pz={keyword:"properties",schemaType:"object",error:Qr.error,code:Vv};function Vv(t){(0,dz.checkMetadata)(t);let{gen:e,data:r,parentSchema:n,it:s}=t,{additionalProperties:i,nullable:o}=n;if(s.jtdDiscriminator&&o)throw new Error("JTD: nullable inside discriminator mapping");if(h())throw new Error("JTD: properties and optionalProperties have common members");let[a,l]=d("properties"),[u,c]=d("optionalProperties");if(l.length===0&&c.length===0&&i)return;let[f,p]=s.jtdDiscriminator===void 0?(0,hz.checkNullableObject)(t,r):[e.let("valid",!1),!0];e.if(p,()=>e.assign(f,!0).block(()=>{m(l,"properties",!0),m(c,"optionalProperties"),i||S()})),t.pass(f);function h(){let _=n.properties,y=n.optionalProperties;if(!(_&&y))return!1;for(let R in _)if(Object.prototype.hasOwnProperty.call(y,R))return!0;return!1}function d(_){let y=n[_],R=y?(0,kh.allSchemaProperties)(y):[];if(s.jtdDiscriminator&&R.some(O=>O===s.jtdDiscriminator))throw new Error(`JTD: discriminator tag used in ${_}`);let T=R.filter(O=>!(0,Mv.alwaysValidSchema)(s,y[O]));return[R,T]}function m(_,y,R){let T=e.var("valid");for(let w of _)e.if((0,kh.propertyInData)(e,r,w,s.opts.ownProperties),()=>g(w,y,T),()=>O(w)),t.ok(T);function O(w){R?(e.assign(T,!1),t.error(!1,{propError:$s.Missing,missingProperty:w},{schemaPath:w})):e.assign(T,!0)}}function g(_,y,R){t.subschema({keyword:y,schemaProp:_,dataProp:_},R)}function S(){e.forIn("key",r,_=>{let y=b(_,a,"properties",s.jtdDiscriminator),R=b(_,u,"optionalProperties"),T=y===!0?R:R===!0?y:(0,Tr.and)(y,R);e.if(T,()=>{s.opts.removeAdditional?e.code((0,Tr._)`delete ${r}[${_}]`):(t.error(!1,{propError:$s.Additional,additionalProperty:_},{instancePath:_,parentSchema:!0}),s.opts.allErrors||e.break())})})}function b(_,y,R,T){let O;if(y.length>8){let w=(0,Mv.schemaRefOrVal)(s,n[R],R);O=(0,Tr.not)((0,kh.isOwnProperty)(e,w,_)),T!==void 0&&(O=(0,Tr.and)(O,(0,Tr._)`${_} !== ${T}`))}else if(y.length||T!==void 0){let w=T===void 0?y:[T].concat(y);O=(0,Tr.and)(...w.map($=>(0,Tr._)`${_} !== ${$}`))}else O=!0;return O}}Qr.validateProperties=Vv;Qr.default=pz});var Uv=E(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});var zv=xh(),mz={keyword:"optionalProperties",schemaType:"object",error:zv.error,code(t){t.parentSchema.properties||(0,zv.validateProperties)(t)}};Lh.default=mz});var Gv=E(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var In=W(),gz=Or(),yz=Ts(),Bv=ws(),wl=wh(),_z={message:t=>{let{schema:e,params:r}=t;return r.discrError?r.discrError===wl.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in mapping`:(0,Bv.typeErrorMessage)(t,"object")},params:t=>{let{schema:e,params:r}=t;return r.discrError?(0,In._)`{error: ${r.discrError}, tag: ${e}, tagValue: ${r.tag}}`:(0,Bv.typeErrorParams)(t,"object")}},Sz={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:_z,code(t){(0,gz.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s}=t,[i,o]=(0,yz.checkNullableObject)(t,r);e.if(o),a(),e.elseIf((0,In.not)(i)),t.error(),e.endIf(),t.ok(i);function a(){let c=e.const("tag",(0,In._)`${r}${(0,In.getProperty)(n)}`);e.if((0,In._)`${c} === undefined`),t.error(!1,{discrError:wl.DiscrError.Tag,tag:c}),e.elseIf((0,In._)`typeof ${c} == "string"`),l(c),e.else(),t.error(!1,{discrError:wl.DiscrError.Tag,tag:c},{instancePath:n}),e.endIf()}function l(c){e.if(!1);for(let f in s.mapping)e.elseIf((0,In._)`${c} === ${f}`),e.assign(i,u(f));e.else(),t.error(!1,{discrError:wl.DiscrError.Mapping,tag:c},{instancePath:n,schemaPath:"mapping",parentSchema:!0}),e.endIf()}function u(c){let f=e.name("valid");return t.subschema({keyword:"mapping",schemaProp:c,jtdDiscriminator:n},f),f}}};qh.default=Sz});var Jv=E(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var Wv=ee(),Rl=W(),Ez=Or(),bz=Ts(),vz=ws(),wz={keyword:"values",schemaType:"object",error:(0,vz.typeError)("object"),code(t){(0,Ez.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t,[i,o]=(0,bz.checkNullableObject)(t,r);(0,Wv.alwaysValidSchema)(s,n)?e.if((0,Rl.not)((0,Rl.or)(o,i)),()=>t.error()):(e.if(o),e.assign(i,a()),e.elseIf((0,Rl.not)(i)),t.error(),e.endIf()),t.ok(i);function a(){let l=e.name("valid");if(s.allErrors){let c=e.let("valid",!0);return u(()=>e.assign(c,!1)),c}return e.var(l,!0),u(()=>e.break()),l;function u(c){e.forIn("key",r,f=>{t.subschema({keyword:"values",dataProp:f,dataPropType:Wv.Type.Str},l),e.if((0,Rl.not)(l),c)})}}}};jh.default=wz});var Kv=E(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var Rz=We(),Oz={keyword:"union",schemaType:"array",trackErrors:!0,code:Rz.validateUnion,error:{message:"must match a schema in union"}};Dh.default=Oz});var Yv=E(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var Tz=bl(),$z=Ch(),Pz=jv(),Az=Fv(),Cz=xh(),Iz=Uv(),Nz=Gv(),kz=Jv(),xz=Kv(),Lz=Or(),qz=["definitions",Tz.default,$z.default,Pz.default,Az.default,Cz.default,Iz.default,Nz.default,kz.default,xz.default,Lz.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];Fh.default=qz});var ew=E(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});var $r=t=>{let e={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return t&&(e.definitions={values:{ref:"schema"}}),e},jz=t=>({optionalProperties:$r(t)}),Dz=t=>({properties:{ref:{type:"string"}},optionalProperties:$r(t)}),Fz=t=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:$r(t)}),Mz=t=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:$r(t)}),Hz=t=>({properties:{elements:{ref:"schema"}},optionalProperties:$r(t)}),Qv=t=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:{optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"},...$r(t)}}),Zv=t=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:{additionalProperties:{type:"boolean"},...$r(t)}}),Vz=t=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[Qv(!1),Zv(!1)]}}}},optionalProperties:$r(t)}),zz=t=>({properties:{values:{ref:"schema"}},optionalProperties:$r(t)}),Xv=t=>({metadata:{union:[jz,Dz,Fz,Mz,Hz,Qv,Zv,Vz,zz].map(e=>e(t))}}),Uz={definitions:{schema:Xv(!1)},...Xv(!0)};Mh.default=Uz});var Hh=E(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.jtdForms=void 0;Ol.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"]});var rw=E(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});var Vh=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Bz={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function tw(t){return Vh.lastIndex=0,'"'+(Vh.test(t)?t.replace(Vh,e=>{let r=Bz[e];return typeof r=="string"?r:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}):t)+'"'}zh.default=tw;tw.code='require("ajv/dist/runtime/quote").default'});var lw=E(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var Gz=Hh(),sw=$n(),ie=W(),Wz=wr(),Ee=Nt(),Jz=We(),Kz=bl(),Yz=ee(),Xz=rw(),Qz={elements:eU,values:tU,discriminator:rU,properties:nw,optionalProperties:nw,enum:Yi,type:nU,ref:iU};function iw(t,e){let r=sw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ie.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("serialize"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:Ee.default.data},u;try{this._compilations.add(t),t.serializeName=a,o.func(a,Ee.default.data,!1,()=>{o.let(Ee.default.json,(0,ie.str)``),Xi(l),o.return(Ee.default.json)}),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(Ee.default.scope)}return ${c}`;let p=new Function(`${Ee.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.serialize=p}catch(c){throw u&&this.logger.error("Error compiling serializer, function code:",u),delete t.serialize,delete t.serializeName,c}finally{this._compilations.delete(t)}return t}Bh.default=iw;function Xi(t){let e;for(let r of Gz.jtdForms)if(r in t.schema){e=r;break}Zz(t,e?Qz[e]:aU)}function Zz(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);r.if((0,ie._)`${s} === undefined || ${s} === null`,()=>r.add(Ee.default.json,(0,ie._)`"null"`),()=>e(t))}function eU(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`[`);let s=e.let("first",!0);e.forOf("el",n,i=>{Uh(t,s),Xi({...t,schema:r.elements,data:i})}),e.add(Ee.default.json,(0,ie.str)`]`)}function tU(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`{`);let s=e.let("first",!0);e.forIn("key",n,i=>ow(t,i,r.values,s)),e.add(Ee.default.json,(0,ie.str)`}`)}function ow(t,e,r,n){let{gen:s,data:i}=t;Uh(t,n),Yi({...t,data:e}),s.add(Ee.default.json,(0,ie.str)`:`);let o=s.const("value",(0,ie._)`${i}${(0,ie.getProperty)(e)}`);Xi({...t,schema:r,data:o})}function rU(t){let{gen:e,schema:r,data:n}=t,{discriminator:s}=r;e.add(Ee.default.json,(0,ie.str)`{${JSON.stringify(s)}:`);let i=e.const("tag",(0,ie._)`${n}${(0,ie.getProperty)(s)}`);Yi({...t,data:i}),e.if(!1);for(let o in r.mapping){e.elseIf((0,ie._)`${i} === ${o}`);let a=r.mapping[o];aw({...t,schema:a},s)}e.endIf(),e.add(Ee.default.json,(0,ie.str)`}`)}function nw(t){let{gen:e}=t;e.add(Ee.default.json,(0,ie.str)`{`),aw(t),e.add(Ee.default.json,(0,ie.str)`}`)}function aw(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o}=n,a=p(i),l=p(o),u=h(a.concat(l)),c=!e,f;for(let S of a)c?c=!1:r.add(Ee.default.json,(0,ie.str)`,`),m(S,i[S],d(S));c&&(f=r.let("first",!0));for(let S of l){let b=d(S);r.if((0,ie.and)((0,ie._)`${b} !== undefined`,(0,Jz.isOwnProperty)(r,s,S)),()=>{Uh(t,f),m(S,o[S],b)})}n.additionalProperties&&r.forIn("key",s,S=>r.if(g(S,u),()=>ow(t,S,{},f)));function p(S){return S?Object.keys(S):[]}function h(S){if(e&&S.push(e),new Set(S).size!==S.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return S}function d(S){return r.const("value",(0,ie._)`${s}${(0,ie.getProperty)(S)}`)}function m(S,b,_){r.add(Ee.default.json,(0,ie.str)`${JSON.stringify(S)}:`),Xi({...t,schema:b,data:_})}function g(S,b){return b.length?(0,ie.and)(...b.map(_=>(0,ie._)`${S} !== ${_}`)):!0}}function nU(t){let{gen:e,schema:r,data:n}=t;switch(r.type){case"boolean":e.add(Ee.default.json,(0,ie._)`${n} ? "true" : "false"`);break;case"string":Yi(t);break;case"timestamp":e.if((0,ie._)`${n} instanceof Date`,()=>e.add(Ee.default.json,(0,ie._)`'"' + ${n}.toISOString() + '"'`),()=>Yi(t));break;default:sU(t)}}function Yi({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`${(0,Yz.useFunc)(t,Xz.default)}(${e})`)}function sU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`"" + ${e}`)}function iU(t){let{gen:e,self:r,data:n,definitions:s,schema:i,schemaEnv:o}=t,{ref:a}=i,l=s[a];if(!l)throw new Wz.default(r.opts.uriResolver,"",a,`No definition ${a}`);if(!(0,Kz.hasRef)(l))return Xi({...t,schema:l});let{root:u}=o,c=iw.call(r,new sw.SchemaEnv({schema:l,root:u}),s);e.add(Ee.default.json,(0,ie._)`${oU(e,c)}(${n})`)}function oU(t,e){return e.serialize?t.scopeValue("serialize",{ref:e.serialize}):(0,ie._)`${t.scopeValue("wrapper",{ref:e})}.serialize`}function aU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`JSON.stringify(${e})`)}function Uh({gen:t},e){e?t.if(e,()=>t.assign(e,!1),()=>t.add(Ee.default.json,(0,ie.str)`,`)):t.add(Ee.default.json,(0,ie.str)`,`)}});var cw=E(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.parseJsonString=en.parseJsonNumber=en.parseJson=void 0;var lU=/position\s(\d+)(?: \(line \d+ column \d+\))?$/;function Pr(t,e){let r;Pr.message=void 0;let n;e&&(t=t.slice(e));try{return Pr.position=e+t.length,JSON.parse(t)}catch(s){if(n=lU.exec(s.message),!n){Pr.message="unexpected end";return}r=+n[1];let i=t[r];t=t.slice(0,r),Pr.position=e+r;try{return JSON.parse(t)}catch{Pr.message=`unexpected token ${i}`;return}}}en.parseJson=Pr;Pr.message=void 0;Pr.position=0;Pr.code='require("ajv/dist/runtime/parseJson").parseJson';function Ar(t,e,r){let n="",s;if(Ar.message=void 0,t[e]==="-"&&(n+="-",e++),t[e]==="0")n+="0",e++;else if(!i(r)){o();return}if(r)return Ar.position=e,+n;if(t[e]==="."&&(n+=".",e++,!i())){o();return}if(s=t[e],(s==="e"||s==="E")&&(n+="e",e++,s=t[e],(s==="+"||s==="-")&&(n+=s,e++),!i())){o();return}return Ar.position=e,+n;function i(a){let l=!1;for(;s=t[e],s>="0"&&s<="9"&&(a===void 0||a-- >0);)l=!0,n+=s,e++;return l}function o(){Ar.position=e,Ar.message=e<t.length?`unexpected token ${t[e]}`:"unexpected end"}}en.parseJsonNumber=Ar;Ar.message=void 0;Ar.position=0;Ar.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';var uw={b:"\b",f:"\f",n:`
|
|
59
|
+
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},uU=97,cU=48;function Zr(t,e){let r="",n;for(Zr.message=void 0;n=t[e++],n!=='"';)if(n==="\\")if(n=t[e],n in uw)r+=uw[n],e++;else if(n==="u"){e++;let i=4,o=0;for(;i--;){if(o<<=4,n=t[e],n===void 0){s("unexpected end");return}if(n=n.toLowerCase(),n>="a"&&n<="f")o+=n.charCodeAt(0)-uU+10;else if(n>="0"&&n<="9")o+=n.charCodeAt(0)-cU;else{s(`unexpected token ${n}`);return}e++}r+=String.fromCharCode(o)}else{s(`unexpected token ${n}`);return}else if(n===void 0){s("unexpected end");return}else if(n.charCodeAt(0)>=32)r+=n;else{s(`unexpected token ${n}`);return}return Zr.position=e,r;function s(i){Zr.position=e,Zr.message=i}}en.parseJsonString=Zr;Zr.message=void 0;Zr.position=0;Zr.code='require("ajv/dist/runtime/parseJson").parseJsonString'});var bw=E(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});var fU=Hh(),pw=$n(),B=W(),dU=wr(),se=Nt(),hU=We(),pU=bl(),mU=Ch(),Jh=cw(),mw=ee(),gU=Ah(),yU={elements:bU,values:vU,discriminator:RU,properties:fw,optionalProperties:fw,enum:TU,type:OU,ref:$U};function gw(t,e){let r=pw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new B.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("parse"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:se.default.data,parseName:a,char:o.name("c")},u;try{this._compilations.add(t),t.parseName=a,_U(l),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(se.default.scope)}return ${c}`;let p=new Function(`${se.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.parse=p}catch(c){throw u&&this.logger.error("Error compiling parser, function code:",u),delete t.parse,delete t.parseName,c}finally{this._compilations.delete(t)}return t}Zh.default=gw;var Wh=(0,B._)`undefined`;function _U(t){let{gen:e,parseName:r,char:n}=t;e.func(r,(0,B._)`${se.default.json}, ${se.default.jsonPos}, ${se.default.jsonPart}`,!1,()=>{e.let(se.default.data),e.let(n),e.assign((0,B._)`${r}.message`,Wh),e.assign((0,B._)`${r}.position`,Wh),e.assign(se.default.jsonPos,(0,B._)`${se.default.jsonPos} || 0`),e.const(se.default.jsonLen,(0,B._)`${se.default.json}.length`),Tl(t),Qh(t),e.if(se.default.jsonPart,()=>{e.assign((0,B._)`${r}.position`,se.default.jsonPos),e.return(se.default.data)}),e.if((0,B._)`${se.default.jsonPos} === ${se.default.jsonLen}`,()=>e.return(se.default.data)),Ps(t)})}function Tl(t){let e;for(let r of fU.jtdForms)if(r in t.schema){e=r;break}e?EU(t,yU[e]):Yh(t)}var SU=hw(!0,hw(!1,Ps));function EU(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);Qi(t,"null",e,()=>r.assign(s,null))}function bU(t){let{gen:e,schema:r,data:n}=t;ur(t,"[");let s=e.let("i",0);e.assign(n,(0,B._)`[]`),Kh(t,"]",()=>{let i=e.let("el");Tl({...t,schema:r.elements,data:i}),e.assign((0,B._)`${n}[${s}++]`,i)})}function vU(t){let{gen:e,schema:r,data:n}=t;ur(t,"{"),e.assign(n,(0,B._)`{}`),Kh(t,"}",()=>wU(t,r.values))}function Kh(t,e,r){yw(t,e,r),ur(t,e)}function yw(t,e,r){let{gen:n}=t;n.for((0,B._)`;${se.default.jsonPos}<${se.default.jsonLen} && ${$l(1)}!==${e};`,()=>{r(),Qi(t,",",()=>n.break(),s)});function s(){Qi(t,e,()=>{},Ps)}}function wU(t,e){let{gen:r}=t,n=r.let("key");Nn({...t,data:n}),ur(t,":"),Sw(t,n,e)}function RU(t){let{gen:e,data:r,schema:n}=t,{discriminator:s,mapping:i}=n;ur(t,"{"),e.assign(r,(0,B._)`{}`);let o=e.const("pos",se.default.jsonPos),a=e.let("value"),l=e.let("tag");yw(t,"}",()=>{let u=e.let("key");Nn({...t,data:u}),ur(t,":"),e.if((0,B._)`${u} === ${s}`,()=>{Nn({...t,data:l}),e.assign((0,B._)`${r}[${u}]`,l),e.break()},()=>Yh({...t,data:a}))}),e.assign(se.default.jsonPos,o),e.if((0,B._)`${l} === undefined`),Cr(t,(0,B.str)`discriminator tag not found`);for(let u in i)e.elseIf((0,B._)`${l} === ${u}`),_w({...t,schema:i[u]},s);e.else(),Cr(t,(0,B.str)`discriminator value not in schema`),e.endIf()}function fw(t){let{gen:e,data:r}=t;ur(t,"{"),e.assign(r,(0,B._)`{}`),_w(t)}function _w(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o,additionalProperties:a}=n;if(Kh(t,"}",()=>{let l=r.let("key");if(Nn({...t,data:l}),ur(t,":"),r.if(!1),dw(t,l,i),dw(t,l,o),e){r.elseIf((0,B._)`${l} === ${e}`);let u=r.let("tag");Nn({...t,data:u})}r.else(),a?Yh({...t,data:(0,B._)`${s}[${l}]`}):Cr(t,(0,B.str)`property ${l} not allowed`),r.endIf()}),i){let l=(0,hU.hasPropFunc)(r),u=(0,B.and)(...Object.keys(i).map(c=>(0,B._)`${l}.call(${s}, ${c})`));r.if((0,B.not)(u),()=>Cr(t,(0,B.str)`missing required properties`))}}function dw(t,e,r={}){let{gen:n}=t;for(let s in r)n.elseIf((0,B._)`${e} === ${s}`),Sw(t,e,r[s])}function Sw(t,e,r){Tl({...t,schema:r,data:(0,B._)`${t.data}[${e}]`})}function OU(t){let{gen:e,schema:r,data:n,self:s}=t;switch(r.type){case"boolean":SU(t);break;case"string":Nn(t);break;case"timestamp":{Nn(t);let i=(0,mw.useFunc)(e,gU.default),{allowDate:o,parseDate:a}=s.opts,l=o?(0,B._)`!${i}(${n}, true)`:(0,B._)`!${i}(${n})`,u=a?(0,B.or)(l,(0,B._)`(${n} = new Date(${n}), false)`,(0,B._)`isNaN(${n}.valueOf())`):l;e.if(u,()=>Cr(t,(0,B.str)`invalid timestamp`));break}case"float32":case"float64":Gh(t);break;default:{let i=r.type;if(!s.opts.int32range&&(i==="int32"||i==="uint32"))Gh(t,16),i==="uint32"&&e.if((0,B._)`${n} < 0`,()=>Cr(t,(0,B.str)`integer out of range`));else{let[o,a,l]=mU.intRange[i];Gh(t,l),e.if((0,B._)`${n} < ${o} || ${n} > ${a}`,()=>Cr(t,(0,B.str)`integer out of range`))}}}}function Nn(t){ur(t,'"'),Xh(t,Jh.parseJsonString)}function TU(t){let{gen:e,data:r,schema:n}=t,s=n.enum;ur(t,'"'),e.if(!1);for(let i of s){let o=JSON.stringify(i).slice(1);e.elseIf((0,B._)`${$l(o.length)} === ${o}`),e.assign(r,(0,B.str)`${i}`),e.add(se.default.jsonPos,o.length)}e.else(),Ps(t),e.endIf()}function Gh(t,e){let{gen:r}=t;Qh(t),r.if((0,B._)`"-0123456789".indexOf(${$l(1)}) < 0`,()=>Ps(t),()=>Xh(t,Jh.parseJsonNumber,e))}function hw(t,e){return r=>{let{gen:n,data:s}=r;Qi(r,`${t}`,()=>e(r),()=>n.assign(s,t))}}function $U(t){let{gen:e,self:r,definitions:n,schema:s,schemaEnv:i}=t,{ref:o}=s,a=n[o];if(!a)throw new dU.default(r.opts.uriResolver,"",o,`No definition ${o}`);if(!(0,pU.hasRef)(a))return Tl({...t,schema:a});let{root:l}=i,u=gw.call(r,new pw.SchemaEnv({schema:a,root:l}),n);Ew(t,PU(e,u),!0)}function PU(t,e){return e.parse?t.scopeValue("parse",{ref:e.parse}):(0,B._)`${t.scopeValue("wrapper",{ref:e})}.parse`}function Yh(t){Xh(t,Jh.parseJson)}function Xh(t,e,r){Ew(t,(0,mw.useFunc)(t.gen,e),r)}function Ew(t,e,r){let{gen:n,data:s}=t;n.assign(s,(0,B._)`${e}(${se.default.json}, ${se.default.jsonPos}${r?(0,B._)`, ${r}`:B.nil})`),n.assign(se.default.jsonPos,(0,B._)`${e}.position`),n.if((0,B._)`${s} === undefined`,()=>Cr(t,(0,B._)`${e}.message`))}function ur(t,e){Qi(t,e,Ps)}function Qi(t,e,r,n){let{gen:s}=t,i=e.length;Qh(t),s.if((0,B._)`${$l(i)} === ${e}`,()=>{s.add(se.default.jsonPos,i),n?.(t)},()=>r(t))}function Qh({gen:t,char:e}){t.code((0,B._)`while((${e}=${se.default.json}[${se.default.jsonPos}],${e}===" "||${e}==="\\n"||${e}==="\\r"||${e}==="\\t"))${se.default.jsonPos}++;`)}function $l(t){return t===1?(0,B._)`${se.default.json}[${se.default.jsonPos}]`:(0,B._)`${se.default.json}.slice(${se.default.jsonPos}, ${se.default.jsonPos}+${t})`}function Ps(t){Cr(t,(0,B._)`"unexpected token " + ${se.default.json}[${se.default.jsonPos}]`)}function Cr({gen:t,parseName:e},r){t.assign((0,B._)`${e}.message`,r),t.assign((0,B._)`${e}.position`,se.default.jsonPos),t.return(Wh)}});var rp=E((we,tp)=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.MissingRefError=we.ValidationError=we.CodeGen=we.Name=we.nil=we.stringify=we.str=we._=we.KeywordCxt=we.Ajv=void 0;var AU=Ld(),CU=Yv(),IU=ew(),NU=lw(),kU=bw(),ep="JTD-meta-schema",As=class extends AU.default{constructor(e={}){super({...e,jtd:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(CU.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(IU.default,ep,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ep)?ep:void 0)}compileSerializer(e){let r=this._addSchema(e);return r.serialize||this._compileSerializer(r)}compileParser(e){let r=this._addSchema(e);return r.parse||this._compileParser(r)}_compileSerializer(e){if(NU.default.call(this,e,e.schema.definitions||{}),!e.serialize)throw new Error("ajv implementation error");return e.serialize}_compileParser(e){if(kU.default.call(this,e,e.schema.definitions||{}),!e.parse)throw new Error("ajv implementation error");return e.parse}};we.Ajv=As;tp.exports=we=As;tp.exports.Ajv=As;Object.defineProperty(we,"__esModule",{value:!0});we.default=As;var xU=ms();Object.defineProperty(we,"KeywordCxt",{enumerable:!0,get:function(){return xU.KeywordCxt}});var Cs=W();Object.defineProperty(we,"_",{enumerable:!0,get:function(){return Cs._}});Object.defineProperty(we,"str",{enumerable:!0,get:function(){return Cs.str}});Object.defineProperty(we,"stringify",{enumerable:!0,get:function(){return Cs.stringify}});Object.defineProperty(we,"nil",{enumerable:!0,get:function(){return Cs.nil}});Object.defineProperty(we,"Name",{enumerable:!0,get:function(){return Cs.Name}});Object.defineProperty(we,"CodeGen",{enumerable:!0,get:function(){return Cs.CodeGen}});var LU=Ni();Object.defineProperty(we,"ValidationError",{enumerable:!0,get:function(){return LU.default}});var qU=wr();Object.defineProperty(we,"MissingRefError",{enumerable:!0,get:function(){return qU.default}})});var np=E((u7,vw)=>{"use strict";var jU=sl();vw.exports=Object.freeze({coerceTypes:"array",useDefaults:!0,removeAdditional:!0,uriResolver:jU,addUsedSchema:!1,allErrors:!1})});var Pl=E(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.formatNames=fr.fastFormats=fr.fullFormats=void 0;function cr(t,e){return{validate:t,compare:e}}fr.fullFormats={date:cr(Tw,ap),time:cr(ip(!0),lp),"date-time":cr(ww(!0),Pw),"iso-time":cr(ip(),$w),"iso-date-time":cr(ww(),Aw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:zU,"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:YU,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:UU,int32:{type:"number",validate:WU},int64:{type:"number",validate:JU},float:{type:"number",validate:Ow},double:{type:"number",validate:Ow},password:!0,binary:!0};fr.fastFormats={...fr.fullFormats,date:cr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ap),time:cr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lp),"date-time":cr(/^\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,Pw),"iso-time":cr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,$w),"iso-date-time":cr(/^\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,Aw),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};fr.formatNames=Object.keys(fr.fullFormats);function DU(t){return t%4===0&&(t%100!==0||t%400===0)}var FU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,MU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Tw(t){let e=FU.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&DU(r)?29:MU[n])}function ap(t,e){if(t&&e)return t>e?1:t<e?-1:0}var sp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function ip(t){return function(r){let n=sp.exec(r);if(!n)return!1;let s=+n[1],i=+n[2],o=+n[3],a=n[4],l=n[5]==="-"?-1:1,u=+(n[6]||0),c=+(n[7]||0);if(u>23||c>59||t&&!a)return!1;if(s<=23&&i<=59&&o<60)return!0;let f=i-c*l,p=s-u*l-(f<0?1:0);return(p===23||p===-1)&&(f===59||f===-1)&&o<61}}function lp(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function $w(t,e){if(!(t&&e))return;let r=sp.exec(t),n=sp.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var op=/t|\s/i;function ww(t){let e=ip(t);return function(n){let s=n.split(op);return s.length===2&&Tw(s[0])&&e(s[1])}}function Pw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Aw(t,e){if(!(t&&e))return;let[r,n]=t.split(op),[s,i]=e.split(op),o=ap(r,s);if(o!==void 0)return o||lp(n,i)}var HU=/\/|:/,VU=/^(?:[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 zU(t){return HU.test(t)&&VU.test(t)}var Rw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function UU(t){return Rw.lastIndex=0,Rw.test(t)}var BU=-(2**31),GU=2**31-1;function WU(t){return Number.isInteger(t)&&t<=GU&&t>=BU}function JU(t){return Number.isInteger(t)}function Ow(){return!0}var KU=/[^\\]\\Z/;function YU(t){if(KU.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Cw=E(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.formatLimitDefinition=void 0;var XU=El(),Jt=W(),tn=Jt.operators,Al={formatMaximum:{okStr:"<=",ok:tn.LTE,fail:tn.GT},formatMinimum:{okStr:">=",ok:tn.GTE,fail:tn.LT},formatExclusiveMaximum:{okStr:"<",ok:tn.LT,fail:tn.GTE},formatExclusiveMinimum:{okStr:">",ok:tn.GT,fail:tn.LTE}},QU={message:({keyword:t,schemaCode:e})=>(0,Jt.str)`should be ${Al[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Jt._)`{comparison: ${Al[t].okStr}, limit: ${e}}`};Is.formatLimitDefinition={keyword:Object.keys(Al),type:"string",schemaType:"string",$data:!0,error:QU,code(t){let{gen:e,data:r,schemaCode:n,keyword:s,it:i}=t,{opts:o,self:a}=i;if(!o.validateFormats)return;let l=new XU.KeywordCxt(i,a.RULES.all.format.definition,"format");l.$data?u():c();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),h=e.const("fmt",(0,Jt._)`${p}[${l.schemaCode}]`);t.fail$data((0,Jt.or)((0,Jt._)`typeof ${h} != "object"`,(0,Jt._)`${h} instanceof RegExp`,(0,Jt._)`typeof ${h}.compare != "function"`,f(h)))}function c(){let p=l.schema,h=a.formats[p];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${s}": format "${p}" does not define "compare" function`);let d=e.scopeValue("formats",{key:p,ref:h,code:o.code.formats?(0,Jt._)`${o.code.formats}${(0,Jt.getProperty)(p)}`:void 0});t.fail$data(f(d))}function f(p){return(0,Jt._)`${p}.compare(${r}, ${n}) ${Al[s].fail} 0`}},dependencies:["format"]};var ZU=t=>(t.addKeyword(Is.formatLimitDefinition),t);Is.default=ZU});var fp=E((Zi,kw)=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var Ns=Pl(),e4=Cw(),up=W(),Iw=new up.Name("fullFormats"),t4=new up.Name("fastFormats"),cp=(t,e={keywords:!0})=>{if(Array.isArray(e))return Nw(t,e,Ns.fullFormats,Iw),t;let[r,n]=e.mode==="fast"?[Ns.fastFormats,t4]:[Ns.fullFormats,Iw],s=e.formats||Ns.formatNames;return Nw(t,s,r,n),e.keywords&&(0,e4.default)(t),t};cp.get=(t,e="full")=>{let n=(e==="fast"?Ns.fastFormats:Ns.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Nw(t,e,r,n){var s,i;(s=(i=t.opts.code).formats)!==null&&s!==void 0||(i.formats=(0,up._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}kw.exports=Zi=cp;Object.defineProperty(Zi,"__esModule",{value:!0});Zi.default=cp});var qw=E((d7,Lw)=>{"use strict";var r4=El().default,n4=rp(),xw=np(),dp=class{constructor(e,r){r.mode==="JTD"?this.ajv=new n4(Object.assign({},xw,r.customOptions)):this.ajv=new r4(Object.assign({},xw,r.customOptions));let n=!0;if(r.plugins&&r.plugins.length>0)for(let i of r.plugins)Array.isArray(i)?(n=n&&i[0].name!=="formatsPlugin",i[0](this.ajv,i[1])):(n=n&&i.name!=="formatsPlugin",i(this.ajv));n&&fp()(this.ajv),r.onCreate?.(this.ajv);let s=Object.values(e);for(let i of s)this.ajv.addSchema(i)}buildValidatorFunction({schema:e}){if(e.$id){let r=this.ajv.getSchema(e.$id);if(r)return r}return this.ajv.compile(e)}};Lw.exports=dp});var Dw=E((h7,jw)=>{"use strict";var s4=rp(),i4=np(),hp=class{constructor(e,r){this.ajv=new s4(Object.assign({},i4,r))}buildSerializerFunction({schema:e}){return this.ajv.compileSerializer(e)}};jw.exports=hp});var Hw=E((to,Mw)=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});var eo=za(),Kt=as();function Fw(t,e){if(!t.opts.code.source)throw new Error("moduleCode: ajv instance must have code.source option");let{_n:r}=t.scope.opts;return typeof e=="function"?s(e.source):e!==void 0?i(e,n):i(t.schemas,a=>a.meta?void 0:t.compile(a.schema));function n(a){let l=t.getSchema(a);if(!l)throw new Error(`moduleCode: no schema with id ${a}`);return l}function s(a){let l={},u=a?.validateName,c=o(l,a);return t.opts.code.esm?`"use strict";${r}export const validate = ${u};${r}export default ${u};${r}${c}`:`"use strict";${r}module.exports = ${u};${r}module.exports.default = ${u};${r}${c}`}function i(a,l){var u;let c={},f=(0,Kt._)`"use strict";`;for(let p in a){let h=l(a[p]);if(h){let d=o(c,h.source),m=t.opts.code.esm?(0,Kt._)`export const ${(0,Kt.getEsmExportName)(p)}`:(0,Kt._)`exports${(0,Kt.getProperty)(p)}`;f=(0,Kt._)`${f}${r}${m} = ${(u=h.source)===null||u===void 0?void 0:u.validateName};${r}${d}`}}return`${f}`}function o(a,l){if(!l)throw new Error('moduleCode: function does not have "source" property');if(p(l.validateName)===eo.UsedValueState.Completed)return Kt.nil;h(l.validateName,eo.UsedValueState.Started);let u=t.scope.scopeCode(l.scopeValues,a,f),c=new Kt._Code(`${u}${r}${l.validateCode}`);return l.evaluated?(0,Kt._)`${c}${l.validateName}.evaluated = ${l.evaluated};${r}`:c;function f(d){var m;let g=(m=d.value)===null||m===void 0?void 0:m.ref;if(d.prefix==="validate"&&typeof g=="function")return o(a,g.source);if((d.prefix==="root"||d.prefix==="wrapper")&&typeof g=="object"){let{validate:S,validateName:b}=g;if(!b)throw new Error("ajv internal error");let _=t.opts.code.es5?eo.varKinds.var:eo.varKinds.const,y=(0,Kt._)`${_} ${d} = {validate: ${b}};`;if(p(b)===eo.UsedValueState.Started)return y;let R=o(a,S?.source);return(0,Kt._)`${y}${r}${R}`}}function p(d){var m;return(m=a[d.prefix])===null||m===void 0?void 0:m.get(d)}function h(d,m){let{prefix:g}=d;(a[g]=a[g]||new Map).set(d,m)}}}Mw.exports=to=Fw;Object.defineProperty(to,"__esModule",{value:!0});to.default=Fw});var Uw=E((p7,zw)=>{"use strict";var Vw=pp(),o4=Hw().default;function a4(t={readMode:!0}){if(t.readMode===!0&&!t.restoreFunction)throw new Error("You must provide a restoreFunction options when readMode ON");if(t.readMode!==!0&&!t.storeFunction)throw new Error("You must provide a storeFunction options when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=Vw();return function(n,s={}){(!s.customOptions||!s.customOptions.code)&&(s.customOptions=Object.assign({},s.customOptions,{code:{source:!0}}));let i=e(n,s);return function(o){let a=i(o),l=o4(i[Vw.AjvReference].ajv,a);return t.storeFunction(o,l),a}}}zw.exports=a4});var pp=E((m7,ks)=>{"use strict";var Gw=Symbol.for("fastify.ajv-compiler.reference"),l4=qw(),u4=Dw();function mp(t){let e=new Map,r=new Map;return t&&t.jtdSerializer===!0?function(s,i){let o=Bw({},i);if(r.has(o))return r.get(o);let a=new u4(s,i),l=a.buildSerializerFunction.bind(a);return r.set(o,l),l}:function(s,i){let o=Bw(s,i.customOptions);if(e.has(o))return e.get(o);let a=new l4(s,i),l=a.buildValidatorFunction.bind(a);return e.set(o,l),i.customOptions.code!==void 0&&(l[Gw]=a),l}}function Bw(t,e){let r=JSON.stringify(t),n=JSON.stringify(e);return`${r}${n}`}ks.exports=mp;ks.exports.default=mp;ks.exports.AjvCompiler=mp;ks.exports.AjvReference=Gw;ks.exports.StandaloneValidator=Uw()});var Cl=E(Kw=>{var Ww=Object.prototype.hasOwnProperty;function Jw(t,e,r){for(r of t.keys())if(ro(r,e))return r}function ro(t,e){var r,n,s;if(t===e)return!0;if(t&&e&&(r=t.constructor)===e.constructor){if(r===Date)return t.getTime()===e.getTime();if(r===RegExp)return t.toString()===e.toString();if(r===Array){if((n=t.length)===e.length)for(;n--&&ro(t[n],e[n]););return n===-1}if(r===Set){if(t.size!==e.size)return!1;for(n of t)if(s=n,s&&typeof s=="object"&&(s=Jw(e,s),!s)||!e.has(s))return!1;return!0}if(r===Map){if(t.size!==e.size)return!1;for(n of t)if(s=n[0],s&&typeof s=="object"&&(s=Jw(e,s),!s)||!ro(n[1],e.get(s)))return!1;return!0}if(r===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(r===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return n===-1}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}if(!r||typeof t=="object"){n=0;for(r in t)if(Ww.call(t,r)&&++n&&!Ww.call(e,r)||!(r in e)||!ro(t[r],e[r]))return!1;return Object.keys(e).length===n}}return t!==t&&e!==e}Kw.dequal=ro});var Zw=E((y7,Qw)=>{"use strict";var{dequal:Yw}=Cl(),c4=Symbol.for("json-schema-ref"),gp=class{#e;#t;#r;#n;#s;constructor(e={}){this.#e={},this.#t={},this.#r=e.insertRefSymbol??!1,this.#n=e.allowEqualDuplicates??!0,this.#s=e.cloneSchemaWithoutRefs??!1}addSchema(e,r,n=!0){n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#l(e,r));let s=e.$id;s!==void 0&&typeof s=="string"&&(s.charAt(0)==="#"?this.#c(e,r,s):(this.#l(e,s),r=s));let i=e.$ref;if(i!==void 0&&typeof i=="string"){let{refSchemaId:o,refJsonPointer:a}=this.#i(i,r);this.#e[r].refs.push({schemaId:o,jsonPointer:a})}for(let o in e)typeof e[o]=="object"&&e[o]!==null&&this.addSchema(e[o],r,!1)}getSchema(e,r="#"){let n=this.#e[e];if(n===void 0)throw new Error(`Cannot resolve ref "${e}${r}". Schema with id "${e}" is not found.`);return n.anchors[r]!==void 0?n.anchors[r]:Xw(n.schema,r)}hasSchema(e){return this.#e[e]!==void 0}getSchemaRefs(e){let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);return r.refs}getSchemaDependencies(e,r={}){let n=this.#e[e];for(let s of n.refs){let i=s.schemaId;i===e||r[i]!==void 0||(r[i]=this.getSchema(i),this.getSchemaDependencies(i,r))}return r}derefSchema(e){if(this.#t[e]!==void 0)return;let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);!this.#s&&r.refs.length===0&&(this.#t[e]={schema:r.schema,anchors:r.anchors});let n=[];this.#o(r.schema,e,!0,n);let s=this.getSchemaDependencies(e);for(let i in s){let o=s[i];this.#o(o,i,!0,n)}for(let i of n){let{refSchemaId:o,refJsonPointer:a}=this.#i(i.ref,i.sourceSchemaId),l=this.getDerefSchema(o,a);if(l===null)throw new Error(`Cannot resolve ref "${i.ref}". Ref "${a}" is not found in schema "${o}".`);i.targetSchema=l,i.targetSchemaId=o}for(let i of n)this.#a(i,n)}getDerefSchema(e,r="#"){let n=this.#t[e];return n===void 0&&(this.derefSchema(e),n=this.#t[e]),n.anchors[r]!==void 0?n.anchors[r]:Xw(n.schema,r)}#i(e,r){let n=e.indexOf("#");return n===-1?{refSchemaId:e,refJsonPointer:"#"}:n===0?{refSchemaId:r,refJsonPointer:e}:{refSchemaId:e.slice(0,n),refJsonPointer:e.slice(n)}}#o(e,r,n,s=[]){let i=Array.isArray(e)?[...e]:{...e};n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#u(i,r));let o=i.$id;o!==void 0&&typeof o=="string"&&(o.charAt(0)==="#"?this.#f(i,r,o):(this.#u(i,o),r=o)),i.$ref!==void 0&&s.push({ref:i.$ref,sourceSchemaId:r,sourceSchema:i});for(let a in i){let l=i[a];typeof l=="object"&&l!==null&&(i[a]=this.#o(l,r,!1,s))}return i}#a(e,r){let{sourceSchema:n,targetSchema:s}=e;if(n.$ref){if(this.#r&&(n[c4]=n.$ref),delete n.$ref,s.$ref){let i=r.find(o=>o.sourceSchema===s);this.#a(i,r)}for(let i in s)if(i!=="$id"){if(n[i]!==void 0){if(Yw(n[i],s[i]))continue;throw new Error(`Cannot resolve ref "${e.ref}". Property "${i}" already exists in schema "${e.sourceSchemaId}".`)}n[i]=s[i]}e.isResolved=!0}}#l(e,r){let n=this.#e[r];if(n!==void 0){if(this.#n&&Yw(e,n.schema))return;throw new Error(`There is already another schema with id "${r}".`)}this.#e[r]={schema:e,anchors:{},refs:[]}}#c(e,r,n){let{anchors:s}=this.#e[r];if(s[n]!==void 0)throw new Error(`There is already another anchor "${n}" in schema "${r}".`);s[n]=e}#u(e,r){this.#t[r]===void 0&&(this.#t[r]={schema:e,anchors:{}})}#f(e,r,n){let{anchors:s}=this.#t[r];s[n]=e}};function Xw(t,e){let r=e.split("/"),n=t;for(let s of r)if(!(s===""||s==="#")){if(typeof n!="object"||n===null)return null;n=n[s]}return n??null}Qw.exports={RefResolver:gp}});var _p=E((_7,eR)=>{"use strict";var f4=El(),d4=sl(),h4=fp(),p4=ga()({proto:!0}),yp=class t{constructor(e){this.ajv=new f4({...e,strictSchema:!1,validateSchema:!1,allowUnionTypes:!0,uriResolver:d4}),h4(this.ajv),this.ajv.addKeyword({keyword:"fjs_type",type:"object",errors:!1,validate:(r,n)=>n&&typeof n.toJSON=="function"}),this._ajvSchemas={},this._ajvOptions=e||{}}addSchema(e,r){let n=e.$id||r;if(e.$id!==void 0&&e.$id[0]==="#"&&(n=r+e.$id),this.ajv.refs[n]===void 0&&this.ajv.schemas[n]===void 0){let s=p4(e);this.convertSchemaToAjvFormat(s),this.ajv.addSchema(s,n),this._ajvSchemas[n]=e}}validate(e,r){return this.ajv.validate(e,r)}convertSchemaToAjvFormat(e){if(e!==null){e.type==="string"?(e.fjs_type="string",e.type=["string","object"]):Array.isArray(e.type)&&e.type.includes("string")&&!e.type.includes("object")&&(e.fjs_type="string",e.type.push("object"));for(let r in e)typeof e[r]=="object"&&this.convertSchemaToAjvFormat(e[r])}}getState(){return{ajvOptions:this._ajvOptions,ajvSchemas:this._ajvSchemas}}static restoreFromState(e){let r=new t(e.ajvOptions);for(let[n,s]of Object.entries(e.ajvSchemas))r.ajv.addSchema(s,n);return r}};eR.exports=yp});var rR=E((S7,tR)=>{"use strict";var Sp=class t{constructor(e,r,n="#"){this.schema=e,this.schemaId=r,this.jsonPointer=n}getPropertyLocation(e){return new t(this.schema[e],this.schemaId,this.jsonPointer+"/"+e)}getSchemaRef(){return this.schemaId+this.jsonPointer}};tR.exports=Sp});var aR=E((E7,bp)=>{"use strict";bp.exports=x;bp.exports.default=x;var m4={$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},nR={enum:["array","boolean","integer","null","number","object","string"]},sR=/^(?:[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,g4=Pl().fullFormats.uri,iR=Pl().fullFormats.regex;function Lt(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o;return typeof t=="number"&&!(t%1)&&!isNaN(t)&&isFinite(t)?o===a&&typeof t=="number"&&isFinite(t)&&(t<0||isNaN(t))?(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1):(Lt.errors=i,o===0):(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1)}var Ep={validate:x};function at(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(Array.isArray(t)){if(t.length<1)return at.errors=[{instancePath:e,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{var a=!0;let l=t.length;for(let u=0;u<l;u++){let c=o;Ep.validate(t[u],{instancePath:e+"/"+u,parentData:t,parentDataProperty:u,rootData:s})||(i=i===null?Ep.validate.errors:i.concat(Ep.validate.errors),o=i.length);var a=c===o;if(!a)break}}}else return at.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;return at.errors=i,o===0}var oR=Vi().default;function x(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(!(t&&typeof t=="object"&&!Array.isArray(t))&&typeof t!="boolean")return x.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:m4.type},message:"must be object,boolean"}],!1;if(o===0&&t&&typeof t=="object"&&!Array.isArray(t)){if(t.$id!==void 0){let _=t.$id,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!sR.test(_))return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$schema!==void 0){let _=t.$schema,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!g4(_))return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/format",keyword:"format",params:{format:"uri"},message:'must match format "uri"'}],!1}else return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$ref!==void 0){let _=t.$ref,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!sR.test(_))return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$comment!==void 0){let _=o;if(typeof t.$comment!="string")return x.errors=[{instancePath:e+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.title!==void 0){let _=o;if(typeof t.title!="string")return x.errors=[{instancePath:e+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.description!==void 0){let _=o;if(typeof t.description!="string")return x.errors=[{instancePath:e+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.readOnly!==void 0){let _=o;if(typeof t.readOnly!="boolean")return x.errors=[{instancePath:e+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.examples!==void 0){let _=o;if(o===_&&!Array.isArray(t.examples))return x.errors=[{instancePath:e+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=_===o}else var a=!0;if(a){if(t.multipleOf!==void 0){let _=t.multipleOf,y=o;if(o===y)if(typeof _=="number"&&isFinite(_)){if(_<=0||isNaN(_))return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0"}],!1}else return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maximum!==void 0){let _=t.maximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMaximum!==void 0){let _=t.exclusiveMaximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.minimum!==void 0){let _=t.minimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMinimum!==void 0){let _=t.exclusiveMinimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maxLength!==void 0){let _=t.maxLength,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minLength!==void 0){let _=o;Lt(t.minLength,{instancePath:e+"/minLength",parentData:t,parentDataProperty:"minLength",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.pattern!==void 0){let _=t.pattern,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!iR(_))return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"'}],!1}else return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalItems!==void 0){let _=o;x(t.additionalItems,{instancePath:e+"/additionalItems",parentData:t,parentDataProperty:"additionalItems",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.items!==void 0){let _=t.items,y=o,R=o,T=!1,O=o;x(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var l=O===o;if(T=T||l,!T){let $=o;at(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var l=$===o;T=T||l}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.maxItems!==void 0){let _=t.maxItems,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minItems!==void 0){let _=o;Lt(t.minItems,{instancePath:e+"/minItems",parentData:t,parentDataProperty:"minItems",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.uniqueItems!==void 0){let _=o;if(typeof t.uniqueItems!="boolean")return x.errors=[{instancePath:e+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.contains!==void 0){let _=o;x(t.contains,{instancePath:e+"/contains",parentData:t,parentDataProperty:"contains",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.maxProperties!==void 0){let _=t.maxProperties,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minProperties!==void 0){let _=o;Lt(t.minProperties,{instancePath:e+"/minProperties",parentData:t,parentDataProperty:"minProperties",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.required!==void 0){let _=t.required,y=o;if(o===o)if(Array.isArray(_)){var u=!0;let O=_.length;for(let w=0;w<O;w++){let $=o;if(typeof _[w]!="string")return x.errors=[{instancePath:e+"/required/"+w,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=$===o;if(!u)break}if(u){let w=_.length,$;if(w>1){let v={};for(;w--;){let P=_[w];if(typeof P=="string"){if(typeof v[P]=="number"){return $=v[P],x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:w,j:$},message:"must NOT have duplicate items (items ## "+$+" and "+w+" are identical)"}],!1;break}v[P]=w}}}}}else return x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalProperties!==void 0){let _=o;x(t.additionalProperties,{instancePath:e+"/additionalProperties",parentData:t,parentDataProperty:"additionalProperties",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.definitions!==void 0){let _=t.definitions,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/definitions/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var c=O===o;if(!c)break}else return x.errors=[{instancePath:e+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.properties!==void 0){let _=t.properties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/properties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var f=O===o;if(!f)break}else return x.errors=[{instancePath:e+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.patternProperties!==void 0){let _=t.patternProperties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_)){for(let T in _){let O=o;if(o===O&&typeof T=="string"&&!iR(T)){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"',propertyName:T};i===null?i=[w]:i.push(w),o++}var p=O===o;if(!p){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:T},message:"property name must be valid"};return i===null?i=[w]:i.push(w),o++,x.errors=i,!1;break}}if(p)for(let T in _){let O=o;x(_[T],{instancePath:e+"/patternProperties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var h=O===o;if(!h)break}}else return x.errors=[{instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.dependencies!==void 0){let _=t.dependencies,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=_[T],w=o,$=o,v=!1,P=o;x(O,{instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var d=P===o;if(v=v||d,!v){let C=o;if(o===o)if(Array.isArray(O)){var m=!0;let J=O.length;for(let U=0;U<J;U++){let H=o;if(typeof O[U]!="string"){let ze={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1")+"/"+U,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[ze]:i.push(ze),o++}var m=H===o;if(!m)break}if(m){let U=O.length,H;if(U>1){let fe={};for(;U--;){let ze=O[U];if(typeof ze=="string"){if(typeof fe[ze]=="number"){H=fe[ze];let G={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:U,j:H},message:"must NOT have duplicate items (items ## "+H+" and "+U+" are identical)"};i===null?i=[G]:i.push(G),o++;break}fe[ze]=U}}}}}else{let J={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[J]:i.push(J),o++}var d=C===o;v=v||d}if(v)o=$,i!==null&&($?i.length=$:i=null);else{let C={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[C]:i.push(C),o++,x.errors=i,!1}var g=w===o;if(!g)break}else return x.errors=[{instancePath:e+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.propertyNames!==void 0){let _=o;x(t.propertyNames,{instancePath:e+"/propertyNames",parentData:t,parentDataProperty:"propertyNames",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.enum!==void 0){let _=t.enum,y=o;if(o===y)if(Array.isArray(_)){if(_.length<1)return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{let T=_.length,O;if(T>1){e:for(;T--;)for(O=T;O--;)if(oR(_[T],_[O])){return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:T,j:O},message:"must NOT have duplicate items (items ## "+O+" and "+T+" are identical)"}],!1;break e}}}}else return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.type!==void 0){let _=t.type,y=o,R=o,T=!1,O=o;if(!(_==="array"||_==="boolean"||_==="integer"||_==="null"||_==="number"||_==="object"||_==="string")){let $={instancePath:e+"/type",schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:nR.enum},message:"must be equal to one of the allowed values"};i===null?i=[$]:i.push($),o++}var S=O===o;if(T=T||S,!T){let $=o;if(o===$)if(Array.isArray(_))if(_.length<1){let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};i===null?i=[P]:i.push(P),o++}else{var b=!0;let P=_.length;for(let C=0;C<P;C++){let k=_[C],M=o;if(!(k==="array"||k==="boolean"||k==="integer"||k==="null"||k==="number"||k==="object"||k==="string")){let U={instancePath:e+"/type/"+C,schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:nR.enum},message:"must be equal to one of the allowed values"};i===null?i=[U]:i.push(U),o++}var b=M===o;if(!b)break}if(b){let C=_.length,k;if(C>1){e:for(;C--;)for(k=C;k--;)if(oR(_[C],_[k])){let M={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:C,j:k},message:"must NOT have duplicate items (items ## "+k+" and "+C+" are identical)"};i===null?i=[M]:i.push(M),o++;break e}}}}else{let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[P]:i.push(P),o++}var S=$===o;T=T||S}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.format!==void 0){let _=o;if(typeof t.format!="string")return x.errors=[{instancePath:e+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentMediaType!==void 0){let _=o;if(typeof t.contentMediaType!="string")return x.errors=[{instancePath:e+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentEncoding!==void 0){let _=o;if(typeof t.contentEncoding!="string")return x.errors=[{instancePath:e+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.if!==void 0){let _=o;x(t.if,{instancePath:e+"/if",parentData:t,parentDataProperty:"if",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.then!==void 0){let _=o;x(t.then,{instancePath:e+"/then",parentData:t,parentDataProperty:"then",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.else!==void 0){let _=o;x(t.else,{instancePath:e+"/else",parentData:t,parentDataProperty:"else",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.allOf!==void 0){let _=o;at(t.allOf,{instancePath:e+"/allOf",parentData:t,parentDataProperty:"allOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.anyOf!==void 0){let _=o;at(t.anyOf,{instancePath:e+"/anyOf",parentData:t,parentDataProperty:"anyOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.oneOf!==void 0){let _=o;at(t.oneOf,{instancePath:e+"/oneOf",parentData:t,parentDataProperty:"oneOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a)if(t.not!==void 0){let _=o;x(t.not,{instancePath:e+"/not",parentData:t,parentDataProperty:"not",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return x.errors=i,o===0}});var Op=E((b7,lR)=>{"use strict";var vp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Failed to merge "${e}" keyword schemas.`,this.schemas=r}},wp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Resolver for "${e}" keyword not found.`,this.schemas=r}},Rp=class extends Error{constructor(e){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Invalid "onConflict" option: "${e}".`}};lR.exports={MergeError:vp,ResolverNotFoundError:wp,InvalidOnConflictOptionError:Rp}});var fR=E((v7,cR)=>{"use strict";var{dequal:y4}=Cl(),{MergeError:Tp}=Op();function uR(t){let e=t[0];for(let r=1;r<t.length;r++)e=e.filter(n=>t[r].includes(n));return e}function _4(t,e,r){let n=uR(e);if(n.length===0)throw new Tp(t,e);r[t]=n}function S4(t,e,r){for(let s=0;s<e.length;s++)Array.isArray(e[s])||(e[s]=[e[s]]);let n=uR(e);if(n.length===0)throw new Tp(t,e);n.length===1?r[t]=n[0]:r[t]=n}function E4(t,e,r){let n=[];for(let s of e)for(let i of s)n.includes(i)||n.push(i);r[t]=n}function b4(t,e,r){r[t]=Math.min(...e)}function v4(t,e,r){r[t]=Math.max(...e)}function w4(t,e,r){let n=(a,l)=>l?n(l,a%l):a,s=(a,l)=>a*l/n(a,l),i=1;for(let a of e)for(;a*i%1!==0;)i*=10;let o=e[0]*i;for(let a of e)o=s(o,a*i);r[t]=o/i}function R4(t,e,r){let n=e[0];for(let s=1;s<e.length;s++)if(!y4(e[s],n))throw new Tp(t,e);r[t]=n}function O4(){}function T4(t,e,r){for(let n of e)if(n===!1){r[t]=!1;return}r[t]=!0}function $4(t,e,r){for(let n of e)if(n===!0){r[t]=!0;return}r[t]=!1}cR.exports={arraysIntersection:_4,hybridArraysIntersection:S4,arraysUnion:E4,minNumber:b4,maxNumber:v4,commonMultiple:w4,allEqual:R4,booleanAnd:T4,booleanOr:$4,skip:O4}});var yR=E((w7,gR)=>{"use strict";var{dequal:P4}=Cl(),Oe=fR(),kl=Op(),pR={$id:Oe.skip,type:Oe.hybridArraysIntersection,enum:Oe.arraysIntersection,minLength:Oe.maxNumber,maxLength:Oe.minNumber,minimum:Oe.maxNumber,maximum:Oe.minNumber,multipleOf:Oe.commonMultiple,exclusiveMinimum:Oe.maxNumber,exclusiveMaximum:Oe.minNumber,minItems:Oe.maxNumber,maxItems:Oe.minNumber,maxProperties:Oe.minNumber,minProperties:Oe.maxNumber,const:Oe.allEqual,default:Oe.allEqual,format:Oe.allEqual,required:Oe.arraysUnion,properties:x4,patternProperties:Nl,additionalProperties:Il,items:I4,additionalItems:N4,definitions:Nl,$defs:Nl,nullable:Oe.booleanAnd,oneOf:dR,anyOf:dR,allOf:Oe.arraysUnion,not:Il,if:L4,then:Oe.skip,else:Oe.skip,dependencies:hR,dependentRequired:hR,dependentSchemas:Nl,propertyNames:Il,uniqueItems:Oe.booleanOr,contains:Il};function Il(t,e,r,n,s){r[t]=Yt(e,s)}function A4(t){let e=[[]];for(let r of t){let n=[];for(let s of e)for(let i of r)n.push([...s,i]);e=n}return e}function dR(t,e,r,n,s){if(e.length===1){r[t]=e[0];return}let i=A4(e),o=[];for(let a of i)try{let l=Yt(a,s);l!==void 0&&o.push(l)}catch(l){if(l instanceof kl.MergeError)continue;throw l}r[t]=o}function C4(t,e){let{items:r,additionalItems:n}=t;return Array.isArray(r)?e<r.length?r[e]:n:r!==void 0?r:n}function I4(t,e,r,n,s){let i=0;for(let a of e)Array.isArray(a)&&(i=Math.max(i,a.length));if(i===0){r[t]=Yt(e,s);return}let o=[];for(let a=0;a<i;a++){let l=[];for(let u of n){let c=C4(u,a);c!==void 0&&l.push(c)}o[a]=Yt(l,s)}r[t]=o}function N4(t,e,r,n,s){let i=!1;for(let a of n)if(Array.isArray(a.items)){i=!0;break}if(!i){r[t]=Yt(e,s);return}let o=[];for(let a of n){let l=a.additionalItems;l===void 0&&!Array.isArray(a.items)&&(l=a.items),l!==void 0&&o.push(l)}r[t]=Yt(o,s)}function k4(t,e){let{properties:r,patternProperties:n,additionalProperties:s}=t;if(r?.[e]!==void 0)return r[e];for(let i of Object.keys(n??{}))if(new RegExp(i).test(e))return n[i];return s}function x4(t,e,r,n,s){let i={};for(let a of n){let l=a.properties??{};for(let u of Object.keys(l)){if(i[u]!==void 0)continue;let c=l[u];i[u]=[c];for(let f of n){if(a===f)continue;let p=k4(f,u);p!==void 0&&i[u].push(p)}}}let o={};for(let a of Object.keys(i)){let l=i[a];o[a]=Yt(l,s)}r[t]=o}function Nl(t,e,r,n,s){let i={};for(let a of e)for(let l of Object.keys(a))i[l]===void 0&&(i[l]=[]),i[l].push(a[l]);let o={};for(let a of Object.keys(i)){let l=i[a],u=Yt(l,s);o[a]=u}r[t]=o}function L4(t,e,r,n,s){for(let i=0;i<n.length;i++){let o={if:n[i].if,then:n[i].then,else:n[i].else};if(o.if!==void 0){if(r.if===void 0){r.if=o.if,o.then!==void 0&&(r.then=o.then),o.else!==void 0&&(r.else=o.else);continue}r.then!==void 0&&(r.then=Yt([r.then,o],s)),r.else!==void 0&&(r.else=Yt([r.else,o],s))}}}function hR(t,e,r){let n={};for(let s of e)for(let i of Object.keys(s)){n[i]===void 0&&(n[i]=[]);let o=n[i];for(let a of s[i])o.includes(a)||o.push(a)}r[t]=n}function Yt(t,e){if(t.length===0)return{};if(t.length===1)return t[0];let r={},n={},s=!0;for(let i of t){if(i===!1)return!1;if(i!==!0){s=!1;for(let o of Object.keys(i))n[o]===void 0&&(n[o]=[]),n[o].push(i[o])}}if(s)return!0;for(let i of Object.keys(n)){let o=n[i];(e.resolvers[i]??e.defaultResolver)(i,o,r,t,e)}return r}function mR(t,e,r,n,s){let i=s.onConflict??"throw";if(e.length===1||i==="first"){r[t]=e[0];return}let o=!0;for(let a=1;a<e.length;a++)if(!P4(e[a],e[0])){o=!1;break}if(o){r[t]=e[0];return}if(i==="throw")throw new kl.ResolverNotFoundError(t,e);if(i!=="skip")throw new kl.InvalidOnConflictOptionError(i)}function q4(t,e={}){return e.defaultResolver===void 0&&(e.defaultResolver=mR),e.resolvers={...pR,...e.resolvers},Yt(t,e)}gR.exports={mergeSchemas:q4,keywordsResolvers:pR,defaultResolver:mR,...kl}});var SR=E((R7,_R)=>{"use strict";var{mergeSchemas:j4}=yR();function D4(t){return j4(t,{onConflict:"skip"})}_R.exports=D4});var ER=E((O7,$p)=>{"use strict";function F4(t,e,r,n){let s="";e.validatorSchemasIds.size>0?(s+=`const Validator = require('fast-json-stringify/lib/validator')
|
|
60
60
|
`,s+=`const validatorState = ${JSON.stringify(n.getState())}
|
|
61
61
|
`,s+=`const validator = Validator.restoreFromState(validatorState)
|
|
62
62
|
`):s+=`const validator = null
|
|
@@ -69,7 +69,7 @@ ${b}`),m.pop(),`{${T}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";
|
|
|
69
69
|
|
|
70
70
|
${s}
|
|
71
71
|
|
|
72
|
-
module.exports = ${t.toString()}(validator, serializer)`}
|
|
72
|
+
module.exports = ${t.toString()}(validator, serializer)`}$p.exports=F4;$p.exports.dependencies={Serializer:_a(),Validator:_p()}});var AR=E((T7,Ls)=>{"use strict";var{RefResolver:M4}=Zw(),H4=_a(),V4=_p(),kn=rR(),bR=aR(),z4=SR(),U4=/'/g,no=2e4,xl="default",B4=`
|
|
73
73
|
const {
|
|
74
74
|
asString,
|
|
75
75
|
asNumber,
|
|
@@ -82,8 +82,8 @@ const {
|
|
|
82
82
|
|
|
83
83
|
const asInteger = serializer.asInteger.bind(serializer)
|
|
84
84
|
|
|
85
|
-
`,
|
|
86
|
-
${
|
|
85
|
+
`,G4=new Set(["floor","ceil","round","trunc"]),OR=new Set(["default","json-stringify"]),so=0;function Pp(t,e){if(!bR(t)){e?e=`"${e}" `:e="";let r=bR.errors[0],n=new Error(`${e}schema is invalid: data${r.instancePath} ${r.message}`);throw n.errors=Pp.errors,n}}function xs(t,e){let r=e.schema.$ref,n=r.indexOf("#");n===-1&&(n=r.length);let s=r.slice(0,n)||e.schemaId,i=r.slice(n)||"#",o=t.refResolver.getSchema(s,i);if(o===null)throw new Error(`Cannot find reference "${r}"`);let a=new kn(o,s,i);return o.$ref!==void 0?xs(t,a):a}function Ll(t,e){let r=t.refResolver.getSchema(e,"#");return new kn(r,e,"#")}function vR(t,e){return t.$id&&t.$id.charAt(0)!=="#"?t.$id:e}function io(t,e){let r=e.getSchemaRef()||"";return r.startsWith(t.rootSchemaId)&&(r=r.replace(t.rootSchemaId,"")||"#"),r}function Cp(t,e){Pp(t),e=e||{};let r={functions:[],functionsCounter:0,functionsNamesBySchema:new Map,options:e,refResolver:new M4,rootSchemaId:t.$id||`__fjs_root_${so++}`,validatorSchemasIds:new Set,mergedSchemasIds:new Map,recursiveSchemas:new Set,recursivePaths:new Set,buildingSet:new Set,uid:0},n=vR(t,r.rootSchemaId);if(r.refResolver.hasSchema(n)||r.refResolver.addSchema(t,r.rootSchemaId),e.schema)for(let c in e.schema){let f=e.schema[c],p=vR(f,c);r.refResolver.hasSchema(p)||(Pp(f,c),r.refResolver.addSchema(f,c))}if(e.rounding&&!G4.has(e.rounding))throw new Error(`Unsupported integer rounding method ${e.rounding}`);if(e.largeArrayMechanism)if(OR.has(e.largeArrayMechanism))xl=e.largeArrayMechanism;else throw new Error(`Unsupported large array mechanism ${e.largeArrayMechanism}`);if(e.largeArraySize){let c=typeof e.largeArraySize,f;if(c==="string"&&Number.isFinite(f=Number.parseInt(e.largeArraySize,10)))no=f;else if(c==="number"&&Number.isInteger(e.largeArraySize))no=e.largeArraySize;else if(c==="bigint")no=Number(e.largeArraySize);else throw new Error(`Unsupported large array size. Expected integer-like, got ${typeof e.largeArraySize} with value ${e.largeArraySize}`)}let s=new kn(t,r.rootSchemaId);rB(r,s);let i=lt(r,s,"input"),o=`
|
|
86
|
+
${B4}
|
|
87
87
|
const JSON_STR_BEGIN_OBJECT = '{'
|
|
88
88
|
const JSON_STR_END_OBJECT = '}'
|
|
89
89
|
const JSON_STR_BEGIN_ARRAY = '['
|
|
@@ -109,9 +109,9 @@ const asInteger = serializer.asInteger.bind(serializer)
|
|
|
109
109
|
${r.functions.join(`
|
|
110
110
|
`)}
|
|
111
111
|
return main
|
|
112
|
-
`;let a=new
|
|
112
|
+
`;let a=new H4(e),l=new V4(e.ajv);for(let c of r.validatorSchemasIds){let f=r.refResolver.getSchema(c);l.addSchema(f,c);let p=r.refResolver.getSchemaDependencies(c);for(let[h,d]of Object.entries(p))l.addSchema(d,h)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:l,serializer:a,code:`validator
|
|
113
113
|
serializer
|
|
114
|
-
${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode==="standalone"?
|
|
114
|
+
${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode==="standalone"?ER()(u,r,a,l):u(l,a)}var W4=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],J4=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],K4=["maxLength","minLength","pattern"],Y4=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function X4(t){for(let e of W4)if(e in t)return"object";for(let e of J4)if(e in t)return"array";for(let e of K4)if(e in t)return"string";for(let e of Y4)if(e in t)return"number";return t.type}function Q4(t,e,r,n){let s=e.schema,i=Object.keys(s.properties||{}),o=`
|
|
115
115
|
const propertiesKeys = ${JSON.stringify(i)}
|
|
116
116
|
for (const [key, value] of Object.entries(${n})) {
|
|
117
117
|
if (
|
|
@@ -136,7 +136,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
136
136
|
${lt(t,f,"value")}
|
|
137
137
|
`}return o+=`
|
|
138
138
|
}
|
|
139
|
-
`,o}function
|
|
139
|
+
`,o}function wR(t,e,r){let n=e.schema,s=e.getPropertyLocation("properties"),i=n.required||[],o=Object.keys(n.properties||{}).sort((f,p)=>{let h=i.includes(f),d=i.includes(p);return h===d?0:h?-1:1}),a="";for(let f of i)if(!o.includes(f)){let p=JSON.stringify(f);a+=`if (${r}[${p}] === undefined) throw new Error('${p.replace(/'/g,"\\'")} is required!')
|
|
140
140
|
`}a+=`json += JSON_STR_BEGIN_OBJECT
|
|
141
141
|
`;let l=t.uid++,u="";(o.length>1||n.patternProperties||n.additionalProperties!==void 0&&n.additionalProperties!==!1)&&(a+=`let addComma_${l} = false
|
|
142
142
|
`,u=`!addComma_${l} && (addComma_${l} = true) || (json += JSON_STR_COMMA)`);for(let f of o){let p=s.getPropertyLocation(f);p.schema.$ref&&(p=xs(t,p));let h=JSON.stringify(f),d=`value_${f.replace(/[^a-zA-Z0-9]/g,"_")}_${t.uid++}`,m=p.schema.default,g=i.includes(f);a+=`
|
|
@@ -153,29 +153,29 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
153
153
|
throw new Error('${h.replace(/'/g,"\\'")} is required!')
|
|
154
154
|
}
|
|
155
155
|
`:a+=`
|
|
156
|
-
`}return(n.patternProperties||n.additionalProperties)&&(a+=
|
|
156
|
+
`}return(n.patternProperties||n.additionalProperties)&&(a+=Q4(t,e,u,r)),a+=`
|
|
157
157
|
json += JSON_STR_END_OBJECT
|
|
158
|
-
`,a}function ql(t,e,r){for(let o=0,a=r.length;o<a;o++){let l=r[o];l.schema.$ref&&(r[o]=xs(t,l))}let n=[];for(let o of r){let a=
|
|
158
|
+
`,a}function ql(t,e,r){for(let o=0,a=r.length;o<a;o++){let l=r[o];l.schema.$ref&&(r[o]=xs(t,l))}let n=[];for(let o of r){let a=TR(t,o.schema,o.schemaId);delete a.$id,n.push(a)}let s=z4(n),i=new kn(s,e);return t.refResolver.addSchema(s,e),i}function TR(t,e,r){let n=Array.isArray(e)?[]:{};e.$id!==void 0&&e.$id.charAt(0)!=="#"&&(r=e.$id);let s=t.mergedSchemasIds.get(e);s&&t.mergedSchemasIds.set(n,s);for(let i in e){let o=e[i];i==="$ref"&&typeof o=="string"&&o.charAt(0)==="#"&&(o=r+o),typeof o=="object"&&o!==null&&(o=TR(t,o,r)),n[i]=o}return n}function RR(t){return`(${t} && typeof ${t}.toJSON === 'function')
|
|
159
159
|
? ${t}.toJSON()
|
|
160
160
|
: ${t}
|
|
161
|
-
`}function
|
|
161
|
+
`}function Z4(t,e,r){let n=e.schema;if(t.functionsNamesBySchema.has(n))return`json += ${t.functionsNamesBySchema.get(n)}(${r})`;let s=n.nullable===!0,i=e.schemaId||"",o=e.jsonPointer||"",a=`${i}#${o}`;if(t.recursivePaths.has(a)||t.buildingSet.has(n)){let c=$R(t);t.functionsNamesBySchema.set(n,c);let p=`
|
|
162
162
|
// ${io(t,e)}
|
|
163
163
|
function ${c} (input) {
|
|
164
|
-
const obj = ${
|
|
164
|
+
const obj = ${RR("input")}
|
|
165
165
|
if (obj === null) return ${s?"JSON_STR_NULL":"JSON_STR_EMPTY_OBJECT"}
|
|
166
166
|
let json = ''
|
|
167
167
|
|
|
168
|
-
${
|
|
168
|
+
${wR(t,e,"obj")}
|
|
169
169
|
return json
|
|
170
170
|
}
|
|
171
171
|
`;return t.functions.push(p),`json += ${c}(${r})`}t.buildingSet.add(n);let l=`obj_${t.uid++}`,u=`
|
|
172
|
-
const ${l} = ${
|
|
172
|
+
const ${l} = ${RR(r)}
|
|
173
173
|
if (${l} === null) {
|
|
174
174
|
json += ${s?"JSON_STR_NULL":"JSON_STR_EMPTY_OBJECT"}
|
|
175
175
|
} else {
|
|
176
|
-
${
|
|
176
|
+
${wR(t,e,l)}
|
|
177
177
|
}
|
|
178
|
-
`;return t.buildingSet.delete(n),u}function
|
|
178
|
+
`;return t.buildingSet.delete(n),u}function eB(t,e,r){let n=e.schema,s=e.getPropertyLocation("items");s.schema=s.schema||{},s.schema.$ref&&(s=xs(t,s));let i=s.schema;if(t.functionsNamesBySchema.has(n))return`json += ${t.functionsNamesBySchema.get(n)}(${r})`;let o=n.nullable===!0,a=e.schemaId||"",l=e.jsonPointer||"",u=`${a}#${l}`;if(t.recursivePaths.has(u)||t.buildingSet.has(n)){let h=$R(t);t.functionsNamesBySchema.set(n,h);let d=io(t,e),m=`
|
|
179
179
|
function ${h} (obj) {
|
|
180
180
|
// ${d}
|
|
181
181
|
let json = ''
|
|
@@ -194,7 +194,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
194
194
|
json += JSON_STR_BEGIN_ARRAY
|
|
195
195
|
`,Array.isArray(i)){for(let g=0,S=i.length;g<S;g++){let b=i[g],_=`value_${g}`;m+=`const ${_} = obj[${g}]`;let y=lt(t,s.getPropertyLocation(g),_);m+=`
|
|
196
196
|
if (${g} < arrayLength) {
|
|
197
|
-
if (${
|
|
197
|
+
if (${Ap(b.type,_)}) {
|
|
198
198
|
if (${g}) {
|
|
199
199
|
json += JSON_STR_COMMA
|
|
200
200
|
}
|
|
@@ -236,7 +236,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
236
236
|
`,Array.isArray(i)){let h=t.uid++;p+=`let addComma_${h} = false
|
|
237
237
|
`;for(let d=0,m=i.length;d<m;d++){let g=i[d],S=`value_${d}_${t.uid++}`;p+=`const ${S} = ${f}[${d}]`;let b=lt(t,s.getPropertyLocation(d),S);p+=`
|
|
238
238
|
if (${d} < arrayLength_${f}) {
|
|
239
|
-
if (${
|
|
239
|
+
if (${Ap(g.type,S)}) {
|
|
240
240
|
!addComma_${h} && (addComma_${h} = true) || (json += JSON_STR_COMMA)
|
|
241
241
|
${b}
|
|
242
242
|
} else {
|
|
@@ -256,7 +256,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
256
256
|
${h}
|
|
257
257
|
}`}return p+=`
|
|
258
258
|
json += JSON_STR_END_ARRAY
|
|
259
|
-
`,xl==="json-stringify"&&(p+="}"),p+="}",t.buildingSet.delete(n),p}function
|
|
259
|
+
`,xl==="json-stringify"&&(p+="}"),p+="}",t.buildingSet.delete(n),p}function Ap(t,e){let r;switch(t){case"null":r=`${e} === null`;break;case"string":r=`typeof ${e} === 'string' ||
|
|
260
260
|
${e} === null ||
|
|
261
261
|
${e} instanceof Date ||
|
|
262
262
|
${e} instanceof RegExp ||
|
|
@@ -264,7 +264,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
264
264
|
typeof ${e} === "object" &&
|
|
265
265
|
typeof ${e}.toString === "function" &&
|
|
266
266
|
${e}.toString !== Object.prototype.toString
|
|
267
|
-
)`;break;case"integer":r=`Number.isInteger(${e})`;break;case"number":r=`Number.isFinite(${e})`;break;case"boolean":r=`typeof ${e} === 'boolean'`;break;case"object":r=`${e} && typeof ${e} === 'object' && ${e}.constructor === Object`;break;case"array":r=`Array.isArray(${e})`;break;default:Array.isArray(t)&&(r=`(${t.map(s=>
|
|
267
|
+
)`;break;case"integer":r=`Number.isInteger(${e})`;break;case"number":r=`Number.isFinite(${e})`;break;case"boolean":r=`typeof ${e} === 'boolean'`;break;case"object":r=`${e} && typeof ${e} === 'object' && ${e}.constructor === Object`;break;case"array":r=`Array.isArray(${e})`;break;default:Array.isArray(t)&&(r=`(${t.map(s=>Ap(s,e)).join(" || ")})`)}return r}function $R(t){return"anonymous"+t.functionsCounter++}function tB(t,e,r){let s=e.schema.type.sort(o=>o==="null"?-1:1),i="";return s.forEach((o,a)=>{e.schema={...e.schema,type:o};let l=PR(t,e,r),u=a===0?"if":"else if";switch(o){case"null":i+=`
|
|
268
268
|
${u} (${r} === null) {
|
|
269
269
|
${l}
|
|
270
270
|
}
|
|
@@ -296,7 +296,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
296
296
|
}
|
|
297
297
|
`;break}}}),i+=`
|
|
298
298
|
else throw new TypeError(\`The value of '${io(t,e)}' does not match schema definition.\`)
|
|
299
|
-
`,i}function
|
|
299
|
+
`,i}function PR(t,e,r){let n=e.schema;switch(n.type){case"null":return"json += JSON_STR_NULL";case"string":return n.format==="date-time"?`json += asDateTime(${r})`:n.format==="date"?`json += asDate(${r})`:n.format==="time"?`json += asTime(${r})`:n.format==="unsafe"?`json += asUnsafeString(${r})`:`
|
|
300
300
|
if (typeof ${r} !== 'string') {
|
|
301
301
|
if (${r} === null) {
|
|
302
302
|
json += JSON_STR_EMPTY_STRING
|
|
@@ -310,19 +310,19 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
310
310
|
} else {
|
|
311
311
|
json += asString(${r})
|
|
312
312
|
}
|
|
313
|
-
`;case"integer":return`json += asInteger(${r})`;case"number":return`json += asNumber(${r})`;case"boolean":return`json += asBoolean(${r})`;case"object":return
|
|
313
|
+
`;case"integer":return`json += asInteger(${r})`;case"number":return`json += asNumber(${r})`;case"boolean":return`json += asBoolean(${r})`;case"object":return Z4(t,e,r);case"array":return eB(t,e,r);case void 0:return`json += JSON.stringify(${r})`;default:throw new Error(`${n.type} unsupported`)}}function rB(t,e){let r=new Set;function n(s){let i=s.schema;if(typeof i!="object"||i===null)return;let o=s.schemaId||"",a=s.jsonPointer||"",l=`${o}#${a}`;if(r.has(l)){let u=!1;for(let c of r)c===l&&(u=!0),u&&t.recursivePaths.add(c);t.recursivePaths.add(l);return}if(r.add(l),i.$ref)try{let u=xs(t,s);n(u)}catch{}if(i.properties){let u=s.getPropertyLocation("properties");for(let c in i.properties)n(u.getPropertyLocation(c))}if(i.additionalProperties&&typeof i.additionalProperties=="object"&&n(s.getPropertyLocation("additionalProperties")),i.patternProperties){let u=s.getPropertyLocation("patternProperties");for(let c in i.patternProperties)n(u.getPropertyLocation(c))}if(i.items){let u=s.getPropertyLocation("items");if(Array.isArray(i.items))for(let c=0;c<i.items.length;c++)n(u.getPropertyLocation(c));else n(u)}if(i.additionalItems&&typeof i.additionalItems=="object"&&n(s.getPropertyLocation("additionalItems")),i.oneOf){let u=s.getPropertyLocation("oneOf");for(let c=0;c<i.oneOf.length;c++)n(u.getPropertyLocation(c))}if(i.anyOf){let u=s.getPropertyLocation("anyOf");for(let c=0;c<i.anyOf.length;c++)n(u.getPropertyLocation(c))}if(i.allOf){let u=s.getPropertyLocation("allOf");for(let c=0;c<i.allOf.length;c++)n(u.getPropertyLocation(c))}i.then&&n(s.getPropertyLocation("then")),i.else&&n(s.getPropertyLocation("else")),r.delete(l)}n(e)}function nB(t,e){let r=t.schema,n=r.type,s=Array.isArray(n)&&n.includes("null"),i="";return s&&(i+=`
|
|
314
314
|
if (${e} === null) {
|
|
315
315
|
json += JSON_STR_NULL
|
|
316
316
|
} else {
|
|
317
|
-
`),i+=`json += '${JSON.stringify(r.const).replace(
|
|
317
|
+
`),i+=`json += '${JSON.stringify(r.const).replace(U4,"\\'")}'`,s&&(i+=`
|
|
318
318
|
}
|
|
319
|
-
`),i}function
|
|
319
|
+
`),i}function sB(t,e,r){let n=e.schema,s=t.mergedSchemasIds.get(n);if(s){let c=Ll(t,s);return lt(t,c,r)}s=`__fjs_merged_${so++}`,t.mergedSchemasIds.set(n,s);let{allOf:i,...o}=e.schema,a=[new kn(o,e.schemaId,e.jsonPointer)],l=e.getPropertyLocation("allOf");for(let c=0,f=i.length;c<f;c++)a.push(l.getPropertyLocation(c));let u=ql(t,s,a);return lt(t,u,r)}function iB(t,e,r){t.validatorSchemasIds.add(e.schemaId);let s=e.schema.anyOf?"anyOf":"oneOf",{[s]:i,...o}=e.schema,a=new kn(o,e.schemaId,e.jsonPointer),l=e.getPropertyLocation(s),u="";for(let c=0,f=i.length;c<f;c++){let p=l.getPropertyLocation(c),h=p.schema,d=t.mergedSchemasIds.get(h),m=null;d?m=Ll(t,d):(d=`__fjs_merged_${so++}`,t.mergedSchemasIds.set(h,d),m=ql(t,d,[a,p]));let g=lt(t,m,r),S=p.getSchemaRef();u+=`
|
|
320
320
|
${c===0?"if":"else if"}(validator.validate("${S}", ${r})) {
|
|
321
321
|
${g}
|
|
322
322
|
}
|
|
323
323
|
`}return u+=`
|
|
324
324
|
else throw new TypeError(\`The value of '${io(t,e)}' does not match schema definition.\`)
|
|
325
|
-
`,u}function
|
|
325
|
+
`,u}function oB(t,e,r){t.validatorSchemasIds.add(e.schemaId);let{if:n,then:s,else:i,...o}=e.schema,a=new kn(o,e.schemaId,e.jsonPointer),u=e.getPropertyLocation("if").getSchemaRef(),c=e.getPropertyLocation("then"),f=t.mergedSchemasIds.get(s),p=null;if(f?p=Ll(t,f):(f=`__fjs_merged_${so++}`,t.mergedSchemasIds.set(s,f),p=ql(t,f,[a,c])),!i)return`
|
|
326
326
|
if (validator.validate("${u}", ${r})) {
|
|
327
327
|
${lt(t,p,r)}
|
|
328
328
|
} else {
|
|
@@ -334,20 +334,20 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
|
|
|
334
334
|
} else {
|
|
335
335
|
${lt(t,m,r)}
|
|
336
336
|
}
|
|
337
|
-
`}function lt(t,e,r){let n=e.schema;if(typeof n=="boolean")return`json += JSON.stringify(${r})`;if(n.$ref&&(e=xs(t,e),n=e.schema),n.allOf)return
|
|
337
|
+
`}function lt(t,e,r){let n=e.schema;if(typeof n=="boolean")return`json += JSON.stringify(${r})`;if(n.$ref&&(e=xs(t,e),n=e.schema),n.allOf)return sB(t,e,r);if(n.anyOf||n.oneOf)return iB(t,e,r);if(n.if&&n.then)return oB(t,e,r);if(n.type===void 0){let a=X4(n);a&&(n.type=a)}let s="",i=n.type,o=n.nullable===!0;return o&&(s+=`
|
|
338
338
|
if (${r} === null) {
|
|
339
339
|
json += JSON_STR_NULL
|
|
340
340
|
} else {
|
|
341
|
-
`),n.const!==void 0?s+=
|
|
341
|
+
`),n.const!==void 0?s+=nB(e,r):Array.isArray(i)?s+=tB(t,e,r):s+=PR(t,e,r),o&&(s+=`
|
|
342
342
|
}
|
|
343
|
-
`),s}Ls.exports=Ap;Ls.exports.default=Ap;Ls.exports.build=Ap;Ls.exports.validLargeArrayMechanisms=wR;Ls.exports.restore=function({code:t,validator:e,serializer:r}){return Function.apply(null,["validator","serializer",t]).apply(null,[e,r])}});var CR=E((y7,jl)=>{"use strict";var sB=$R();function PR(){return function(e,r){let n=Object.assign({},r,{schema:e});return iB.bind(null,n)}}function iB(t,{schema:e}){return t.schema&&e.$id&&t.schema[e.$id]&&(t.schema={...t.schema},delete t.schema[e.$id]),sB(e,t)}function AR(t={readMode:!0}){if(t.readMode===!0&&typeof t.restoreFunction!="function")throw new Error("You must provide a function for the restoreFunction-option when readMode ON");if(t.readMode!==!0&&typeof t.storeFunction!="function")throw new Error("You must provide a function for the storeFunction-option when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=PR();return function(n,s={}){s.mode="standalone";let i=e(n,s);return function(o){let a=i(o);return t.storeFunction(o,a),new Function(a)}}}jl.exports.SerializerSelector=PR;jl.exports.StandaloneSerializer=AR;jl.exports.default=AR});var IR=E((_7,oo)=>{"use strict";var{SerializerSelector:Cp,StandaloneSerializer:oB}=CR();oo.exports=Cp;oo.exports.default=Cp;oo.exports.SerializerSelector=Cp;oo.exports.StandaloneSerializer=oB});var Ip=E((S7,NR)=>{"use strict";var{buildSchemas:aB}=li();function lB(t,e){if(t)return new qs(t,e);let r=Object.assign({buildValidator:null,buildSerializer:null},e?.compilersFactory);if(!r.buildValidator){let s=hp();r.buildValidator=s()}if(!r.buildSerializer){let s=IR();r.buildSerializer=s()}let n={bucket:e&&e.bucket||aB,compilersFactory:r,isCustomValidatorCompiler:typeof e?.compilersFactory?.buildValidator=="function",isCustomSerializerCompiler:typeof e?.compilersFactory?.buildValidator=="function"};return new qs(void 0,n)}var qs=class{constructor(e,r){this.opts=r||e?.opts,this.addedSchemas=!1,this.compilersFactory=this.opts.compilersFactory,e?(this.schemaBucket=this.opts.bucket(e.getSchemas()),this.validatorCompiler=e.getValidatorCompiler(),this.serializerCompiler=e.getSerializerCompiler(),this.isCustomValidatorCompiler=e.isCustomValidatorCompiler,this.isCustomSerializerCompiler=e.isCustomSerializerCompiler,this.parent=e):(this.schemaBucket=this.opts.bucket(),this.isCustomValidatorCompiler=this.opts.isCustomValidatorCompiler||!1,this.isCustomSerializerCompiler=this.opts.isCustomSerializerCompiler||!1)}add(e){return this.addedSchemas=!0,this.schemaBucket.add(e)}getSchema(e){return this.schemaBucket.getSchema(e)}getSchemas(){return this.schemaBucket.getSchemas()}setValidatorCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildValidator:()=>e}),this.validatorCompiler=e,this.isCustomValidatorCompiler=!0}setSerializerCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildSerializer:()=>e}),this.serializerCompiler=e,this.isCustomSerializerCompiler=!0}getValidatorCompiler(){return this.validatorCompiler||this.parent&&this.parent.getValidatorCompiler()}getSerializerCompiler(){return this.serializerCompiler||this.parent&&this.parent.getSerializerCompiler()}getSerializerBuilder(){return this.compilersFactory.buildSerializer||this.parent&&this.parent.getSerializerBuilder()}getValidatorBuilder(){return this.compilersFactory.buildValidator||this.parent&&this.parent.getValidatorBuilder()}setupValidator(e){this.validatorCompiler!==void 0&&!this.addedSchemas||(this.validatorCompiler=this.getValidatorBuilder()(this.schemaBucket.getSchemas(),e.ajv))}setupSerializer(e){this.serializerCompiler!==void 0&&!this.addedSchemas||(this.serializerCompiler=this.getSerializerBuilder()(this.schemaBucket.getSchemas(),e.serializerOpts))}};qs.buildSchemaController=lB;NR.exports=qs});var ao=E((E7,kR)=>{"use strict";var uB="2.0.0",cB=Number.MAX_SAFE_INTEGER||9007199254740991,fB=16,dB=250,hB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];kR.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fB,MAX_SAFE_BUILD_LENGTH:dB,MAX_SAFE_INTEGER:cB,RELEASE_TYPES:hB,SEMVER_SPEC_VERSION:uB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var lo=E((b7,xR)=>{"use strict";var pB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};xR.exports=pB});var js=E((dr,LR)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Np,MAX_SAFE_BUILD_LENGTH:mB,MAX_LENGTH:gB}=ao(),yB=lo();dr=LR.exports={};var _B=dr.re=[],SB=dr.safeRe=[],D=dr.src=[],EB=dr.safeSrc=[],F=dr.t={},bB=0,kp="[a-zA-Z0-9-]",vB=[["\\s",1],["\\d",gB],[kp,mB]],wB=t=>{for(let[e,r]of vB)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},X=(t,e,r)=>{let n=wB(e),s=bB++;yB(t,s,e),F[t]=s,D[s]=e,EB[s]=n,_B[s]=new RegExp(e,r?"g":void 0),SB[s]=new RegExp(n,r?"g":void 0)};X("NUMERICIDENTIFIER","0|[1-9]\\d*");X("NUMERICIDENTIFIERLOOSE","\\d+");X("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${kp}*`);X("MAINVERSION",`(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})`);X("MAINVERSIONLOOSE",`(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASEIDENTIFIER",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIER]})`);X("PRERELEASEIDENTIFIERLOOSE",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASE",`(?:-(${D[F.PRERELEASEIDENTIFIER]}(?:\\.${D[F.PRERELEASEIDENTIFIER]})*))`);X("PRERELEASELOOSE",`(?:-?(${D[F.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[F.PRERELEASEIDENTIFIERLOOSE]})*))`);X("BUILDIDENTIFIER",`${kp}+`);X("BUILD",`(?:\\+(${D[F.BUILDIDENTIFIER]}(?:\\.${D[F.BUILDIDENTIFIER]})*))`);X("FULLPLAIN",`v?${D[F.MAINVERSION]}${D[F.PRERELEASE]}?${D[F.BUILD]}?`);X("FULL",`^${D[F.FULLPLAIN]}$`);X("LOOSEPLAIN",`[v=\\s]*${D[F.MAINVERSIONLOOSE]}${D[F.PRERELEASELOOSE]}?${D[F.BUILD]}?`);X("LOOSE",`^${D[F.LOOSEPLAIN]}$`);X("GTLT","((?:<|>)?=?)");X("XRANGEIDENTIFIERLOOSE",`${D[F.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);X("XRANGEIDENTIFIER",`${D[F.NUMERICIDENTIFIER]}|x|X|\\*`);X("XRANGEPLAIN",`[v=\\s]*(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:${D[F.PRERELEASE]})?${D[F.BUILD]}?)?)?`);X("XRANGEPLAINLOOSE",`[v=\\s]*(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:${D[F.PRERELEASELOOSE]})?${D[F.BUILD]}?)?)?`);X("XRANGE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAIN]}$`);X("XRANGELOOSE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAINLOOSE]}$`);X("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Np}})(?:\\.(\\d{1,${Np}}))?(?:\\.(\\d{1,${Np}}))?`);X("COERCE",`${D[F.COERCEPLAIN]}(?:$|[^\\d])`);X("COERCEFULL",D[F.COERCEPLAIN]+`(?:${D[F.PRERELEASE]})?(?:${D[F.BUILD]})?(?:$|[^\\d])`);X("COERCERTL",D[F.COERCE],!0);X("COERCERTLFULL",D[F.COERCEFULL],!0);X("LONETILDE","(?:~>?)");X("TILDETRIM",`(\\s*)${D[F.LONETILDE]}\\s+`,!0);dr.tildeTrimReplace="$1~";X("TILDE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAIN]}$`);X("TILDELOOSE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAINLOOSE]}$`);X("LONECARET","(?:\\^)");X("CARETTRIM",`(\\s*)${D[F.LONECARET]}\\s+`,!0);dr.caretTrimReplace="$1^";X("CARET",`^${D[F.LONECARET]}${D[F.XRANGEPLAIN]}$`);X("CARETLOOSE",`^${D[F.LONECARET]}${D[F.XRANGEPLAINLOOSE]}$`);X("COMPARATORLOOSE",`^${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]})$|^$`);X("COMPARATOR",`^${D[F.GTLT]}\\s*(${D[F.FULLPLAIN]})$|^$`);X("COMPARATORTRIM",`(\\s*)${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]}|${D[F.XRANGEPLAIN]})`,!0);dr.comparatorTrimReplace="$1$2$3";X("HYPHENRANGE",`^\\s*(${D[F.XRANGEPLAIN]})\\s+-\\s+(${D[F.XRANGEPLAIN]})\\s*$`);X("HYPHENRANGELOOSE",`^\\s*(${D[F.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[F.XRANGEPLAINLOOSE]})\\s*$`);X("STAR","(<|>)?=?\\s*\\*");X("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");X("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Dl=E((v7,qR)=>{"use strict";var RB=Object.freeze({loose:!0}),OB=Object.freeze({}),TB=t=>t?typeof t!="object"?RB:t:OB;qR.exports=TB});var xp=E((w7,FR)=>{"use strict";var jR=/^[0-9]+$/,DR=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=jR.test(t),n=jR.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},$B=(t,e)=>DR(e,t);FR.exports={compareIdentifiers:DR,rcompareIdentifiers:$B}});var tt=E((R7,HR)=>{"use strict";var Fl=lo(),{MAX_LENGTH:MR,MAX_SAFE_INTEGER:Ml}=ao(),{safeRe:Hl,t:Vl}=js(),PB=Dl(),{compareIdentifiers:Lp}=xp(),qp=class t{constructor(e,r){if(r=PB(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>MR)throw new TypeError(`version is longer than ${MR} characters`);Fl("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Hl[Vl.LOOSE]:Hl[Vl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ml||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ml||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ml||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<Ml)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Fl("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(Fl("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Lp(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(Fl("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Lp(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?Hl[Vl.PRERELEASELOOSE]:Hl[Vl.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];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(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Lp(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}};HR.exports=qp});var xn=E((O7,zR)=>{"use strict";var VR=tt(),AB=(t,e,r=!1)=>{if(t instanceof VR)return t;try{return new VR(t,e)}catch(n){if(!r)return null;throw n}};zR.exports=AB});var BR=E((T7,UR)=>{"use strict";var CB=xn(),IB=(t,e)=>{let r=CB(t,e);return r?r.version:null};UR.exports=IB});var WR=E(($7,GR)=>{"use strict";var NB=xn(),kB=(t,e)=>{let r=NB(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};GR.exports=kB});var YR=E((P7,KR)=>{"use strict";var JR=tt(),xB=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new JR(t instanceof JR?t.version:t,r).inc(e,n,s).version}catch{return null}};KR.exports=xB});var ZR=E((A7,QR)=>{"use strict";var XR=xn(),LB=(t,e)=>{let r=XR(t,null,!0),n=XR(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};QR.exports=LB});var tO=E((C7,eO)=>{"use strict";var qB=tt(),jB=(t,e)=>new qB(t,e).major;eO.exports=jB});var nO=E((I7,rO)=>{"use strict";var DB=tt(),FB=(t,e)=>new DB(t,e).minor;rO.exports=FB});var iO=E((N7,sO)=>{"use strict";var MB=tt(),HB=(t,e)=>new MB(t,e).patch;sO.exports=HB});var aO=E((k7,oO)=>{"use strict";var VB=xn(),zB=(t,e)=>{let r=VB(t,e);return r&&r.prerelease.length?r.prerelease:null};oO.exports=zB});var qt=E((x7,uO)=>{"use strict";var lO=tt(),UB=(t,e,r)=>new lO(t,r).compare(new lO(e,r));uO.exports=UB});var fO=E((L7,cO)=>{"use strict";var BB=qt(),GB=(t,e,r)=>BB(e,t,r);cO.exports=GB});var hO=E((q7,dO)=>{"use strict";var WB=qt(),JB=(t,e)=>WB(t,e,!0);dO.exports=JB});var zl=E((j7,mO)=>{"use strict";var pO=tt(),KB=(t,e,r)=>{let n=new pO(t,r),s=new pO(e,r);return n.compare(s)||n.compareBuild(s)};mO.exports=KB});var yO=E((D7,gO)=>{"use strict";var YB=zl(),XB=(t,e)=>t.sort((r,n)=>YB(r,n,e));gO.exports=XB});var SO=E((F7,_O)=>{"use strict";var QB=zl(),ZB=(t,e)=>t.sort((r,n)=>QB(n,r,e));_O.exports=ZB});var uo=E((M7,EO)=>{"use strict";var e5=qt(),t5=(t,e,r)=>e5(t,e,r)>0;EO.exports=t5});var Ul=E((H7,bO)=>{"use strict";var r5=qt(),n5=(t,e,r)=>r5(t,e,r)<0;bO.exports=n5});var jp=E((V7,vO)=>{"use strict";var s5=qt(),i5=(t,e,r)=>s5(t,e,r)===0;vO.exports=i5});var Dp=E((z7,wO)=>{"use strict";var o5=qt(),a5=(t,e,r)=>o5(t,e,r)!==0;wO.exports=a5});var Bl=E((U7,RO)=>{"use strict";var l5=qt(),u5=(t,e,r)=>l5(t,e,r)>=0;RO.exports=u5});var Gl=E((B7,OO)=>{"use strict";var c5=qt(),f5=(t,e,r)=>c5(t,e,r)<=0;OO.exports=f5});var Fp=E((G7,TO)=>{"use strict";var d5=jp(),h5=Dp(),p5=uo(),m5=Bl(),g5=Ul(),y5=Gl(),_5=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return d5(t,r,n);case"!=":return h5(t,r,n);case">":return p5(t,r,n);case">=":return m5(t,r,n);case"<":return g5(t,r,n);case"<=":return y5(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};TO.exports=_5});var PO=E((W7,$O)=>{"use strict";var S5=tt(),E5=xn(),{safeRe:Wl,t:Jl}=js(),b5=(t,e)=>{if(t instanceof S5)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?Wl[Jl.COERCEFULL]:Wl[Jl.COERCE]);else{let l=e.includePrerelease?Wl[Jl.COERCERTLFULL]:Wl[Jl.COERCERTL],u;for(;(u=l.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),l.lastIndex=u.index+u[1].length+u[2].length;l.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return E5(`${n}.${s}.${i}${o}${a}`,e)};$O.exports=b5});var CO=E((J7,AO)=>{"use strict";var Mp=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 s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};AO.exports=Mp});var jt=E((K7,xO)=>{"use strict";var v5=/\s+/g,Hp=class t{constructor(e,r){if(r=R5(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Vp)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(v5," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!NO(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&I5(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&A5)|(this.options.loose&&C5))+":"+e,s=IO.get(n);if(s)return s;let i=this.options.loose,o=i?ut[rt.HYPHENRANGELOOSE]:ut[rt.HYPHENRANGE];e=e.replace(o,H5(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(ut[rt.COMPARATORTRIM],T5),Re("comparator trim",e),e=e.replace(ut[rt.TILDETRIM],$5),Re("tilde trim",e),e=e.replace(ut[rt.CARETTRIM],P5),Re("caret trim",e);let a=e.split(" ").map(f=>N5(f,this.options)).join(" ").split(/\s+/).map(f=>M5(f,this.options));i&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(ut[rt.COMPARATORLOOSE])))),Re("range list",a);let l=new Map,u=a.map(f=>new Vp(f,this.options));for(let f of u){if(NO(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let c=[...l.values()];return IO.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>kO(n,r)&&e.set.some(s=>kO(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new O5(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(V5(this.set[r],e,this.options))return!0;return!1}};xO.exports=Hp;var w5=CO(),IO=new w5,R5=Dl(),Vp=co(),Re=lo(),O5=tt(),{safeRe:ut,t:rt,comparatorTrimReplace:T5,tildeTrimReplace:$5,caretTrimReplace:P5}=js(),{FLAG_INCLUDE_PRERELEASE:A5,FLAG_LOOSE:C5}=ao(),NO=t=>t.value==="<0.0.0-0",I5=t=>t.value==="",kO=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},N5=(t,e)=>(t=t.replace(ut[rt.BUILD],""),Re("comp",t,e),t=L5(t,e),Re("caret",t),t=k5(t,e),Re("tildes",t),t=j5(t,e),Re("xrange",t),t=F5(t,e),Re("stars",t),t),ct=t=>!t||t.toLowerCase()==="x"||t==="*",k5=(t,e)=>t.trim().split(/\s+/).map(r=>x5(r,e)).join(" "),x5=(t,e)=>{let r=e.loose?ut[rt.TILDELOOSE]:ut[rt.TILDE];return t.replace(r,(n,s,i,o,a)=>{Re("tilde",t,n,s,i,o,a);let l;return ct(s)?l="":ct(i)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:ct(o)?l=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Re("replaceTilde pr",a),l=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Re("tilde return",l),l})},L5=(t,e)=>t.trim().split(/\s+/).map(r=>q5(r,e)).join(" "),q5=(t,e)=>{Re("caret",t,e);let r=e.loose?ut[rt.CARETLOOSE]:ut[rt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,l)=>{Re("caret",t,s,i,o,a,l);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0${n} <${+i+1}.0.0-0`:ct(a)?i==="0"?u=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:l?(Re("replaceCaret pr",l),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${l} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${l} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${l} <${+i+1}.0.0-0`):(Re("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),Re("caret return",u),u})},j5=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>D5(r,e)).join(" ")),D5=(t,e)=>{t=t.trim();let r=e.loose?ut[rt.XRANGELOOSE]:ut[rt.XRANGE];return t.replace(r,(n,s,i,o,a,l)=>{Re("xRange",t,n,s,i,o,a,l);let u=ct(i),c=u||ct(o),f=c||ct(a),p=f;return s==="="&&p&&(s=""),l=e.includePrerelease?"-0":"",u?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&p?(c&&(o=0),a=0,s===">"?(s=">=",c?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",c?i=+i+1:o=+o+1),s==="<"&&(l="-0"),n=`${s+i}.${o}.${a}${l}`):c?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),Re("xRange return",n),n})},F5=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(ut[rt.STAR],"")),M5=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(ut[e.includePrerelease?rt.GTE0PRE:rt.GTE0],"")),H5=t=>(e,r,n,s,i,o,a,l,u,c,f,p)=>(ct(n)?r="":ct(s)?r=`>=${n}.0.0${t?"-0":""}`:ct(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ct(u)?l="":ct(c)?l=`<${+u+1}.0.0-0`:ct(f)?l=`<${u}.${+c+1}.0-0`:p?l=`<=${u}.${c}.${f}-${p}`:t?l=`<${u}.${c}.${+f+1}-0`:l=`<=${l}`,`${r} ${l}`.trim()),V5=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Re(t[n].semver),t[n].semver!==Vp.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var co=E((Y7,MO)=>{"use strict";var fo=Symbol("SemVer ANY"),Bp=class t{static get ANY(){return fo}constructor(e,r){if(r=LO(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Up("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===fo?this.value="":this.value=this.operator+this.semver.version,Up("comp",this)}parse(e){let r=this.options.loose?qO[jO.COMPARATORLOOSE]:qO[jO.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new DO(n[2],this.options.loose):this.semver=fo}toString(){return this.value}test(e){if(Up("Comparator.test",e,this.options.loose),this.semver===fo||e===fo)return!0;if(typeof e=="string")try{e=new DO(e,this.options)}catch{return!1}return zp(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 FO(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new FO(this.value,r).test(e.semver):(r=LO(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("=")||zp(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||zp(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};MO.exports=Bp;var LO=Dl(),{safeRe:qO,t:jO}=js(),zp=Fp(),Up=lo(),DO=tt(),FO=jt()});var ho=E((X7,HO)=>{"use strict";var z5=jt(),U5=(t,e,r)=>{try{e=new z5(e,r)}catch{return!1}return e.test(t)};HO.exports=U5});var zO=E((Q7,VO)=>{"use strict";var B5=jt(),G5=(t,e)=>new B5(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));VO.exports=G5});var BO=E((Z7,UO)=>{"use strict";var W5=tt(),J5=jt(),K5=(t,e,r)=>{let n=null,s=null,i=null;try{i=new J5(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new W5(n,r))}),n};UO.exports=K5});var WO=E((eX,GO)=>{"use strict";var Y5=tt(),X5=jt(),Q5=(t,e,r)=>{let n=null,s=null,i=null;try{i=new X5(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new Y5(n,r))}),n};GO.exports=Q5});var YO=E((tX,KO)=>{"use strict";var Gp=tt(),Z5=jt(),JO=uo(),eG=(t,e)=>{t=new Z5(t,e);let r=new Gp("0.0.0");if(t.test(r)||(r=new Gp("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new Gp(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||JO(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||JO(r,i))&&(r=i)}return r&&t.test(r)?r:null};KO.exports=eG});var QO=E((rX,XO)=>{"use strict";var tG=jt(),rG=(t,e)=>{try{return new tG(t,e).range||"*"}catch{return null}};XO.exports=rG});var Kl=E((nX,rT)=>{"use strict";var nG=tt(),tT=co(),{ANY:sG}=tT,iG=jt(),oG=ho(),ZO=uo(),eT=Ul(),aG=Gl(),lG=Bl(),uG=(t,e,r,n)=>{t=new nG(t,n),e=new iG(e,n);let s,i,o,a,l;switch(r){case">":s=ZO,i=aG,o=eT,a=">",l=">=";break;case"<":s=eT,i=lG,o=ZO,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(oG(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let c=e.set[u],f=null,p=null;if(c.forEach(h=>{h.semver===sG&&(h=new tT(">=0.0.0")),f=f||h,p=p||h,s(h.semver,f.semver,n)?f=h:o(h.semver,p.semver,n)&&(p=h)}),f.operator===a||f.operator===l||(!p.operator||p.operator===a)&&i(t,p.semver))return!1;if(p.operator===l&&o(t,p.semver))return!1}return!0};rT.exports=uG});var sT=E((sX,nT)=>{"use strict";var cG=Kl(),fG=(t,e,r)=>cG(t,e,">",r);nT.exports=fG});var oT=E((iX,iT)=>{"use strict";var dG=Kl(),hG=(t,e,r)=>dG(t,e,"<",r);iT.exports=hG});var uT=E((oX,lT)=>{"use strict";var aT=jt(),pG=(t,e,r)=>(t=new aT(t,r),e=new aT(e,r),t.intersects(e,r));lT.exports=pG});var fT=E((aX,cT)=>{"use strict";var mG=ho(),gG=qt();cT.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((c,f)=>gG(c,f,r));for(let c of o)mG(c,e,r)?(i=c,s||(s=c)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===o[0]?a.push("*"):f?c===o[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let l=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length<u.length?l:e}});var yT=E((lX,gT)=>{"use strict";var dT=jt(),Jp=co(),{ANY:Wp}=Jp,po=ho(),Kp=qt(),yG=(t,e,r={})=>{if(t===e)return!0;t=new dT(t,r),e=new dT(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=SG(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},_G=[new Jp(">=0.0.0-0")],hT=[new Jp(">=0.0.0")],SG=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Wp){if(e.length===1&&e[0].semver===Wp)return!0;r.includePrerelease?t=_G:t=hT}if(e.length===1&&e[0].semver===Wp){if(r.includePrerelease)return!0;e=hT}let n=new Set,s,i;for(let h of t)h.operator===">"||h.operator===">="?s=pT(s,h,r):h.operator==="<"||h.operator==="<="?i=mT(i,h,r):n.add(h.semver);if(n.size>1)return null;let o;if(s&&i){if(o=Kp(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let h of n){if(s&&!po(h,String(s),r)||i&&!po(h,String(i),r))return null;for(let d of e)if(!po(h,String(d),r))return!1;return!0}let a,l,u,c,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&i.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(c=c||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",s){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator===">"||h.operator===">="){if(a=pT(s,h,r),a===h&&a!==s)return!1}else if(s.operator===">="&&!po(s.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(l=mT(i,h,r),l===h&&l!==i)return!1}else if(i.operator==="<="&&!po(i.semver,String(h),r))return!1}if(!h.operator&&(i||s)&&o!==0)return!1}return!(s&&u&&!i&&o!==0||i&&c&&!s&&o!==0||p||f)},pT=(t,e,r)=>{if(!t)return e;let n=Kp(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},mT=(t,e,r)=>{if(!t)return e;let n=Kp(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};gT.exports=yG});var bT=E((uX,ET)=>{"use strict";var Yp=js(),_T=ao(),EG=tt(),ST=xp(),bG=xn(),vG=BR(),wG=WR(),RG=YR(),OG=ZR(),TG=tO(),$G=nO(),PG=iO(),AG=aO(),CG=qt(),IG=fO(),NG=hO(),kG=zl(),xG=yO(),LG=SO(),qG=uo(),jG=Ul(),DG=jp(),FG=Dp(),MG=Bl(),HG=Gl(),VG=Fp(),zG=PO(),UG=co(),BG=jt(),GG=ho(),WG=zO(),JG=BO(),KG=WO(),YG=YO(),XG=QO(),QG=Kl(),ZG=sT(),e3=oT(),t3=uT(),r3=fT(),n3=yT();ET.exports={parse:bG,valid:vG,clean:wG,inc:RG,diff:OG,major:TG,minor:$G,patch:PG,prerelease:AG,compare:CG,rcompare:IG,compareLoose:NG,compareBuild:kG,sort:xG,rsort:LG,gt:qG,lt:jG,eq:DG,neq:FG,gte:MG,lte:HG,cmp:VG,coerce:zG,Comparator:UG,Range:BG,satisfies:GG,toComparators:WG,maxSatisfying:JG,minSatisfying:KG,minVersion:YG,validRange:XG,outside:QG,gtr:ZG,ltr:e3,intersects:t3,simplifyRange:r3,subset:n3,SemVer:EG,re:Yp.re,src:Yp.src,tokens:Yp.t,SEMVER_SPEC_VERSION:_T.SEMVER_SPEC_VERSION,RELEASE_TYPES:_T.RELEASE_TYPES,compareIdentifiers:ST.compareIdentifiers,rcompareIdentifiers:ST.rcompareIdentifiers}});var rm=E((cX,tm)=>{"use strict";var Xp=bT(),Zp=V("node:assert"),em=Symbol.for("registered-plugin"),{kTestInternals:s3}=De(),{exist:i3,existReply:o3,existRequest:a3}=di(),{FST_ERR_PLUGIN_VERSION_MISMATCH:l3,FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:u3,FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:c3}=He(),f3=/-(?:rc|pre|alpha).+$/u;function mo(t){return t[Symbol.for("plugin-meta")]}function vT(t){let e=wT(t);if(e)return e;let r=V.cache;if(r){let n=Object.keys(r);for(let s=0;s<n.length;s++){let i=n[s];if(r[i].exports===t)return i}}return t.name?t.name:null}function d3(t){return t.toString().split(`
|
|
344
|
-
`,2).map(e=>e.trim()).join(" -- ")}function wT(t){return t[Symbol.for("fastify.display-name")]}function RT(t){return!!t[Symbol.for("skip-override")]}function OT(t){let e=mo(t);if(!e)return;let r=e.dependencies;r&&(Zp(Array.isArray(r),"The dependencies should be an array of strings"),r.forEach(n=>{Zp(this[em].indexOf(n)>-1,`The dependency '${n}' of plugin '${e.name}' is not registered`)}))}function TT(t){let e=mo(t);if(!e)return;let{decorators:r,name:n}=e;r&&(r.fastify&&Qp(this,"Fastify",r.fastify,n),r.reply&&Qp(this,"Reply",r.reply,n),r.request&&Qp(this,"Request",r.request,n))}var h3={Fastify:i3,Request:a3,Reply:o3};function Qp(t,e,r,n){Zp(Array.isArray(r),"The decorators should be an array of strings"),r.forEach(s=>{let i=typeof n=="string"?` required by '${n}'`:"";if(!h3[e].call(t,s))throw new u3(s,i,e)})}function p3(t){let e=mo(t);if(e?.fastify==null)return;let r=e.fastify,n=f3.test(this.version);if(!(n===!0&&Xp.gt(this.version,Xp.coerce(r))===!0)&&r&&Xp.satisfies(this.version,r,{includePrerelease:n})===!1)throw new l3(e.name,r,this.version)}function m3(t){let e=mo(t);if(!e)return;let r=e.name;if(r)return this[em].push(r),r}function g3(t,e){if(t.constructor.name==="AsyncFunction"&&t.length===3)throw new c3(e)}function y3(t){let e=m3.call(this,t)||vT(t);return g3.call(this,t,e),p3.call(this,t),TT.call(this,t),OT.call(this,t),RT(t)}tm.exports={getPluginName:vT,getFuncPreview:d3,kRegisteredPlugins:em,getDisplayName:wT,registerPlugin:y3};tm.exports[s3]={shouldSkipOverride:RT,getMeta:mo,checkDecorators:TT,checkDependencies:OT}});var Yl=E((dX,$T)=>{"use strict";function _3(t,e){let r=e||E3();return t?b3(t,r):r}function S3(t,e){return t.genReqId(e)}function E3(){let e=0;return function(){return e=e+1&2147483647,`req-${e.toString(36)}`}}function b3(t,e){return function(r){return r.headers[t]||e(r)}}$T.exports={getGenReqId:S3,reqIdGenFactory:_3}});var IT=E((hX,CT)=>{"use strict";var PT=12,v3=0,nm=[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,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,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,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function w3(t){var e=t.indexOf("%");if(e===-1)return t;for(var r=t.length,n="",s=0,i=0,o=e,a=PT;e>-1&&e<r;){var l=AT(t[e+1],4),u=AT(t[e+2],0),c=l|u,f=nm[c];if(a=nm[256+a+f],i=i<<6|c&nm[364+f],a===PT)n+=t.slice(s,o),n+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(i&1023)),i=0,s=e+3,e=o=t.indexOf("%",s);else{if(a===v3)return null;if(e+=3,e<r&&t.charCodeAt(e)===37)continue;return null}}return n+t.slice(s)}var R3={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function AT(t,e){var r=R3[t];return r===void 0?255:r<<e}CT.exports=w3});var qT=E((pX,LT)=>{"use strict";var NT=IT(),kT=/\+/g,xT=function(){};xT.prototype=Object.create(null);function O3(t){let e=new xT;if(typeof t!="string")return e;let r=t.length,n="",s="",i=-1,o=-1,a=!1,l=!1,u=!1,c=!1,f=!1,p=0;for(let h=0;h<r+1;h++)if(p=h!==r?t.charCodeAt(h):38,p===38){if(f=o>i,f||(o=h),n=t.slice(i+1,o),f||n.length>0){u&&(n=n.replace(kT," ")),a&&(n=NT(n)||n),f&&(s=t.slice(o+1,h),c&&(s=s.replace(kT," ")),l&&(s=NT(s)||s));let d=e[n];d===void 0?e[n]=s:d.pop?d.push(s):e[n]=[d,s]}s="",i=h,o=h,a=!1,l=!1,u=!1,c=!1}else p===61?o<=i?o=h:l=!0:p===43?o>i?c=!0:u=!0:p===37&&(o>i?l=!0:a=!0);return e}LT.exports=O3});var DT=E((mX,jT)=>{var hr=Array.from({length:256},(t,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase()),T3=new Int8Array([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,0,0,0,0,1,1,1,1,0,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,0,1,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,0]);function $3(t){let e=t.length;if(e===0)return"";let r="",n=0,s=0;e:for(;s<e;s++){let i=t.charCodeAt(s);for(;i<128;){if(T3[i]!==1&&(n<s&&(r+=t.slice(n,s)),n=s+1,r+=hr[i]),++s===e)break e;i=t.charCodeAt(s)}if(n<s&&(r+=t.slice(n,s)),i<2048){n=s+1,r+=hr[192|i>>6]+hr[128|i&63];continue}if(i<55296||i>=57344){n=s+1,r+=hr[224|i>>12]+hr[128|i>>6&63]+hr[128|i&63];continue}if(++s,s>=e)throw new Error("URI malformed");let o=t.charCodeAt(s)&1023;n=s+1,i=65536+((i&1023)<<10|o),r+=hr[240|i>>18]+hr[128|i>>12&63]+hr[128|i>>6&63]+hr[128|i&63]}return n===0?t:n<e?r+t.slice(n):r}jT.exports={encodeString:$3}});var HT=E((gX,MT)=>{"use strict";var{encodeString:sm}=DT();function FT(t){let e=typeof t;return e==="string"?sm(t):e==="bigint"?t.toString():e==="boolean"?t?"true":"false":e==="number"&&Number.isFinite(t)?t<1e21?""+t:sm(""+t):""}function P3(t){let e="";if(t===null||typeof t!="object")return e;let r="&",n=Object.keys(t),s=n.length,i=0;for(let o=0;o<s;o++){let a=n[o],l=t[a],u=sm(a)+"=";if(o&&(e+=r),Array.isArray(l)){i=l.length;for(let c=0;c<i;c++)c&&(e+=r),e+=u,e+=FT(l[c])}else e+=u,e+=FT(l)}return e}MT.exports=P3});var BT=E((yX,go)=>{"use strict";var VT=qT(),zT=HT(),UT={parse:VT,stringify:zT};go.exports=UT;go.exports.default=UT;go.exports.parse=VT;go.exports.stringify=zT});var WT=E(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0})});var JT=E(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.types=void 0;var A3;(function(t){t[t.ROOT=0]="ROOT",t[t.GROUP=1]="GROUP",t[t.POSITION=2]="POSITION",t[t.SET=3]="SET",t[t.RANGE=4]="RANGE",t[t.REPETITION=5]="REPETITION",t[t.REFERENCE=6]="REFERENCE",t[t.CHAR=7]="CHAR"})(A3=yo.types||(yo.types={}))});var YT=E(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0})});var Nr=E(Ir=>{"use strict";var C3=Ir&&Ir.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),im=Ir&&Ir.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C3(e,t,r)};Object.defineProperty(Ir,"__esModule",{value:!0});im(WT(),Ir);im(JT(),Ir);im(YT(),Ir)});var Xl=E(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.anyChar=nt.notWhitespace=nt.whitespace=nt.notInts=nt.ints=nt.notWords=nt.words=void 0;var he=Nr(),XT=()=>[{type:he.types.RANGE,from:48,to:57}],QT=()=>[{type:he.types.CHAR,value:95},{type:he.types.RANGE,from:97,to:122},{type:he.types.RANGE,from:65,to:90},{type:he.types.RANGE,from:48,to:57}],ZT=()=>[{type:he.types.CHAR,value:9},{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:11},{type:he.types.CHAR,value:12},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:32},{type:he.types.CHAR,value:160},{type:he.types.CHAR,value:5760},{type:he.types.RANGE,from:8192,to:8202},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233},{type:he.types.CHAR,value:8239},{type:he.types.CHAR,value:8287},{type:he.types.CHAR,value:12288},{type:he.types.CHAR,value:65279}],I3=()=>[{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233}];nt.words=()=>({type:he.types.SET,set:QT(),not:!1});nt.notWords=()=>({type:he.types.SET,set:QT(),not:!0});nt.ints=()=>({type:he.types.SET,set:XT(),not:!1});nt.notInts=()=>({type:he.types.SET,set:XT(),not:!0});nt.whitespace=()=>({type:he.types.SET,set:ZT(),not:!1});nt.notWhitespace=()=>({type:he.types.SET,set:ZT(),not:!0});nt.anyChar=()=>({type:he.types.SET,set:I3(),not:!0})});var t$=E(Dt=>{"use strict";var N3=Dt&&Dt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),k3=Dt&&Dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),x3=Dt&&Dt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&N3(e,t,r);return k3(e,t),e};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.tokenizeClass=Dt.strToChars=void 0;var e$=Nr(),Ds=x3(Xl()),L3="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?";Dt.strToChars=t=>{let e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return t.replace(e,(r,n,s,i,o,a,l)=>{if(s)return r;let u=n?8:i?parseInt(i,16):o?parseInt(o,16):a?L3.indexOf(a):{0:0,t:9,n:10,v:11,f:12,r:13}[l],c=String.fromCharCode(u);return/[[\]{}^$.|?*+()]/.test(c)?`\\${c}`:c})};Dt.tokenizeClass=(t,e)=>{var r,n,s,i,o,a,l;let u=[],c,f,p=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g;for(;(c=p.exec(t))!==null;){let h=(l=(a=(o=(i=(s=(n=(r=c[1]&&Ds.words())!==null&&r!==void 0?r:c[2]&&Ds.ints())!==null&&n!==void 0?n:c[3]&&Ds.whitespace())!==null&&s!==void 0?s:c[4]&&Ds.notWords())!==null&&i!==void 0?i:c[5]&&Ds.notInts())!==null&&o!==void 0?o:c[6]&&Ds.notWhitespace())!==null&&a!==void 0?a:c[7]&&{type:e$.types.RANGE,from:(c[8]||c[9]).charCodeAt(0),to:(f=c[10]).charCodeAt(f.length-1)})!==null&&l!==void 0?l:(f=c[16])&&{type:e$.types.CHAR,value:f.charCodeAt(0)};if(h)u.push(h);else return[u,p.lastIndex]}throw new SyntaxError(`Invalid regular expression: /${e}/: Unterminated character class`)}});var om=E(pr=>{"use strict";var q3=pr&&pr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j3=pr&&pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s$=pr&&pr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&q3(e,t,r);return j3(e,t),e};Object.defineProperty(pr,"__esModule",{value:!0});pr.tokenizer=void 0;var r$=s$(t$()),Ye=Nr(),Ln=s$(Xl()),D3=/^[a-zA-Z_$]$/i,F3=/^[a-zA-Z0-9_$]$/i,n$=/\d/;pr.tokenizer=t=>{let e=0,r,n={type:Ye.types.ROOT,stack:[]},s=n,i=n.stack,o=[],a=[],l=0,u=f=>{throw new SyntaxError(`Invalid regular expression: /${t}/: Nothing to repeat at column ${f-1}`)},c=r$.strToChars(t);for(;e<c.length;)switch(r=c[e++]){case"\\":if(e===c.length)throw new SyntaxError(`Invalid regular expression: /${t}/: \\ at end of pattern`);switch(r=c[e++]){case"b":i.push({type:Ye.types.POSITION,value:"b"});break;case"B":i.push({type:Ye.types.POSITION,value:"B"});break;case"w":i.push(Ln.words());break;case"W":i.push(Ln.notWords());break;case"d":i.push(Ln.ints());break;case"D":i.push(Ln.notInts());break;case"s":i.push(Ln.whitespace());break;case"S":i.push(Ln.notWhitespace());break;default:if(n$.test(r)){let f=r;for(;e<c.length&&n$.test(c[e]);)f+=c[e++];let p=parseInt(f,10),h={type:Ye.types.REFERENCE,value:p};i.push(h),a.push({reference:h,stack:i,index:i.length-1})}else i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}break;case"^":i.push({type:Ye.types.POSITION,value:"^"});break;case"$":i.push({type:Ye.types.POSITION,value:"$"});break;case"[":{let f;c[e]==="^"?(f=!0,e++):f=!1;let p=r$.tokenizeClass(c.slice(e),t);e+=p[1],i.push({type:Ye.types.SET,set:p[0],not:f});break}case".":i.push(Ln.anyChar());break;case"(":{let f={type:Ye.types.GROUP,stack:[],remember:!0};if(c[e]==="?")if(r=c[e+1],e+=2,r==="=")f.followedBy=!0,f.remember=!1;else if(r==="!")f.notFollowedBy=!0,f.remember=!1;else if(r==="<"){let p="";if(D3.test(c[e]))p+=c[e],e++;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);for(;e<c.length&&F3.test(c[e]);)p+=c[e],e++;if(!p)throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);if(c[e]!==">")throw new SyntaxError(`Invalid regular expression: /${t}/: Unclosed capture group name, expected '>', found '${c[e]}' at column ${e+1}`);f.name=p,e++}else if(r===":")f.remember=!1;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid group, character '${r}' after '?' at column ${e-1}`);else l+=1;i.push(f),o.push(s),s=f,i=f.stack;break}case")":if(o.length===0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unmatched ) at column ${e-1}`);s=o.pop(),i=s.options?s.options[s.options.length-1]:s.stack;break;case"|":{s.options||(s.options=[s.stack],delete s.stack);let f=[];s.options.push(f),i=f;break}case"{":{let f=/^(\d+)(,(\d+)?)?\}/.exec(c.slice(e)),p,h;f!==null?(i.length===0&&u(e),p=parseInt(f[1],10),h=f[2]?f[3]?parseInt(f[3],10):1/0:p,e+=f[0].length,i.push({type:Ye.types.REPETITION,min:p,max:h,value:i.pop()})):i.push({type:Ye.types.CHAR,value:123});break}case"?":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1,value:i.pop()});break;case"+":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:1,max:1/0,value:i.pop()});break;case"*":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1/0,value:i.pop()});break;default:i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}if(o.length!==0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unterminated group`);return M3(a,l),n};function M3(t,e){for(let r of t.reverse())if(e<r.reference.value){r.reference.type=Ye.types.CHAR;let n=r.reference.value.toString();if(r.reference.value=parseInt(n,8),!/^[0-7]+$/.test(n)){let s=0;for(;n[s]!=="8"&&n[s]!=="9";)s+=1;if(s===0?(r.reference.value=n.charCodeAt(0),s+=1):r.reference.value=parseInt(n.slice(0,s),8),n.length>s){let i=r.stack.splice(r.index+1);for(let o of n.slice(s))r.stack.push({type:Ye.types.CHAR,value:o.charCodeAt(0)});r.stack.push(...i)}}}}});var o$=E(st=>{"use strict";var H3=st&&st.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),V3=st&&st.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),z3=st&&st.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&H3(e,t,r);return V3(e,t),e};Object.defineProperty(st,"__esModule",{value:!0});st.NOTANYCHAR=st.WHITESPACE=st.WORDS=st.INTS=void 0;var Ql=z3(Xl()),i$=Nr();function Zl(t){let e={},r=0;for(let n of t)n.type===i$.types.CHAR&&(e[n.value]=!0),n.type===i$.types.RANGE&&(e[`${n.from}-${n.to}`]=!0),r+=1;return{lookup:()=>Object.assign({},e),len:r}}st.INTS=Zl(Ql.ints().set);st.WORDS=Zl(Ql.words().set);st.WHITESPACE=Zl(Ql.whitespace().set);st.NOTANYCHAR=Zl(Ql.anyChar().set)});var l$=E(Ft=>{"use strict";var U3=Ft&&Ft.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),B3=Ft&&Ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G3=Ft&&Ft.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&U3(e,t,r);return B3(e,t),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.writeSetTokens=Ft.setChar=void 0;var nu=Nr(),eu=G3(o$());function ru(t){return t===94?"\\^":t===92?"\\\\":t===93?"\\]":t===45?"\\-":String.fromCharCode(t)}Ft.setChar=ru;function tu(t,{lookup:e,len:r}){if(r!==t.length)return!1;let n=e();for(let s of t){if(s.type===nu.types.SET)return!1;let i=s.type===nu.types.CHAR?s.value:`${s.from}-${s.to}`;if(n[i])n[i]=!1;else return!1}return!0}function a$(t,e=!1){if(tu(t.set,eu.INTS))return t.not?"\\D":"\\d";if(tu(t.set,eu.WORDS))return t.not?"\\W":"\\w";if(t.not&&tu(t.set,eu.NOTANYCHAR))return".";if(tu(t.set,eu.WHITESPACE))return t.not?"\\S":"\\s";let r="";for(let s=0;s<t.set.length;s++){let i=t.set[s];r+=W3(i)}let n=`${t.not?"^":""}${r}`;return e?n:`[${n}]`}Ft.writeSetTokens=a$;function W3(t){return t.type===nu.types.CHAR?ru(t.value):t.type===nu.types.RANGE?`${ru(t.from)}-${ru(t.to)}`:a$(t,!0)}});var lm=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.reconstruct=void 0;var rn=Nr(),am=l$(),u$=t=>t.map(Fs.reconstruct).join(""),c$=t=>{if("options"in t)return t.options.map(u$).join("|");if("stack"in t)return u$(t.stack);throw new Error("options or stack must be Root or Group token")};Fs.reconstruct=t=>{switch(t.type){case rn.types.ROOT:return c$(t);case rn.types.CHAR:{let e=String.fromCharCode(t.value);return(/[[\\{}$^.|?*+()]/.test(e)?"\\":"")+e}case rn.types.POSITION:return t.value==="^"||t.value==="$"?t.value:`\\${t.value}`;case rn.types.REFERENCE:return`\\${t.value}`;case rn.types.SET:return am.writeSetTokens(t);case rn.types.GROUP:return`(${t.name?`?<${t.name}>`:t.remember?"":t.followedBy?"?=":t.notFollowedBy?"?!":"?:"}${c$(t)})`;case rn.types.REPETITION:{let{min:e,max:r}=t,n;return e===0&&r===1?n="?":e===1&&r===1/0?n="+":e===0&&r===1/0?n="*":r===1/0?n=`{${e},}`:e===r?n=`{${e}}`:n=`{${e},${r}}`,`${Fs.reconstruct(t.value)}${n}`}case rn.types.RANGE:return`${am.setChar(t.from)}-${am.setChar(t.to)}`;default:throw new Error(`Invalid token type ${t}`)}}});var h$=E((Mt,su)=>{"use strict";var J3=Mt&&Mt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),um=Mt&&Mt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&J3(e,t,r)};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.types=void 0;var f$=Nr();Object.defineProperty(Mt,"types",{enumerable:!0,get:function(){return f$.types}});um(om(),Mt);um(lm(),Mt);var d$=om(),K3=lm();um(Nr(),Mt);Mt.default=d$.tokenizer;su.exports=d$.tokenizer;su.exports.types=f$.types;su.exports.reconstruct=K3.reconstruct});var m$=E((PX,iu)=>{"use strict";var p$=h$(),Y3=p$.types;function cm(t,e){e||(e={});let r=e.limit===void 0?25:e.limit;X3(t)?t=t.source:typeof t!="string"&&(t=String(t));try{t=p$(t)}catch{return!1}let n=0;return function s(i,o){let a,l,u;if(i.type===Y3.REPETITION&&(o++,n++,o>1||n>r))return!1;if(i.options){for(a=0,u=i.options.length;a<u;a++)if(l=s({stack:i.options[a]},o),!l)return!1}let c=i.stack||i.value?.stack;if(!c)return!0;for(a=0;a<c.length;a++)if(l=s(c[a],o),!l)return!1;return!0}(t,0)}function X3(t){return{}.toString.call(t)==="[object RegExp]"}iu.exports=cm;iu.exports.default=cm;iu.exports.safeRegex=cm});var ou=E((AX,g$)=>{"use strict";g$.exports={name:"__fmw_internal_strategy_merged_tree_http_method__",storage:function(){let t=new Map;return{get:e=>t.get(e)||null,set:(e,r)=>{t.set(e,r)}}},deriveConstraint:t=>t.method,mustMatchWhenDerived:!0}});var w$=E((CX,v$)=>{"use strict";var y$=Pi(),_$=ou(),S$=Symbol("treeData");function E$(t,e=""){let r="",n=Object.keys(t);for(let s=0;s<n.length;s++){let i=n[s],o=t[i],a=s===n.length-1,l=a?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",u=a?" ":"\u2502 ",f=(o[S$]||"").replaceAll(`
|
|
343
|
+
`),s}Ls.exports=Cp;Ls.exports.default=Cp;Ls.exports.build=Cp;Ls.exports.validLargeArrayMechanisms=OR;Ls.exports.restore=function({code:t,validator:e,serializer:r}){return Function.apply(null,["validator","serializer",t]).apply(null,[e,r])}});var NR=E(($7,jl)=>{"use strict";var aB=AR();function CR(){return function(e,r){let n=Object.assign({},r,{schema:e});return lB.bind(null,n)}}function lB(t,{schema:e}){return t.schema&&e.$id&&t.schema[e.$id]&&(t.schema={...t.schema},delete t.schema[e.$id]),aB(e,t)}function IR(t={readMode:!0}){if(t.readMode===!0&&typeof t.restoreFunction!="function")throw new Error("You must provide a function for the restoreFunction-option when readMode ON");if(t.readMode!==!0&&typeof t.storeFunction!="function")throw new Error("You must provide a function for the storeFunction-option when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=CR();return function(n,s={}){s.mode="standalone";let i=e(n,s);return function(o){let a=i(o);return t.storeFunction(o,a),new Function(a)}}}jl.exports.SerializerSelector=CR;jl.exports.StandaloneSerializer=IR;jl.exports.default=IR});var kR=E((P7,oo)=>{"use strict";var{SerializerSelector:Ip,StandaloneSerializer:uB}=NR();oo.exports=Ip;oo.exports.default=Ip;oo.exports.SerializerSelector=Ip;oo.exports.StandaloneSerializer=uB});var Np=E((A7,xR)=>{"use strict";var{buildSchemas:cB}=li();function fB(t,e){if(t)return new qs(t,e);let r=Object.assign({buildValidator:null,buildSerializer:null},e?.compilersFactory);if(!r.buildValidator){let s=pp();r.buildValidator=s()}if(!r.buildSerializer){let s=kR();r.buildSerializer=s()}let n={bucket:e&&e.bucket||cB,compilersFactory:r,isCustomValidatorCompiler:typeof e?.compilersFactory?.buildValidator=="function",isCustomSerializerCompiler:typeof e?.compilersFactory?.buildValidator=="function"};return new qs(void 0,n)}var qs=class{constructor(e,r){this.opts=r||e?.opts,this.addedSchemas=!1,this.compilersFactory=this.opts.compilersFactory,e?(this.schemaBucket=this.opts.bucket(e.getSchemas()),this.validatorCompiler=e.getValidatorCompiler(),this.serializerCompiler=e.getSerializerCompiler(),this.isCustomValidatorCompiler=e.isCustomValidatorCompiler,this.isCustomSerializerCompiler=e.isCustomSerializerCompiler,this.parent=e):(this.schemaBucket=this.opts.bucket(),this.isCustomValidatorCompiler=this.opts.isCustomValidatorCompiler||!1,this.isCustomSerializerCompiler=this.opts.isCustomSerializerCompiler||!1)}add(e){return this.addedSchemas=!0,this.schemaBucket.add(e)}getSchema(e){return this.schemaBucket.getSchema(e)}getSchemas(){return this.schemaBucket.getSchemas()}setValidatorCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildValidator:()=>e}),this.validatorCompiler=e,this.isCustomValidatorCompiler=!0}setSerializerCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildSerializer:()=>e}),this.serializerCompiler=e,this.isCustomSerializerCompiler=!0}getValidatorCompiler(){return this.validatorCompiler||this.parent&&this.parent.getValidatorCompiler()}getSerializerCompiler(){return this.serializerCompiler||this.parent&&this.parent.getSerializerCompiler()}getSerializerBuilder(){return this.compilersFactory.buildSerializer||this.parent&&this.parent.getSerializerBuilder()}getValidatorBuilder(){return this.compilersFactory.buildValidator||this.parent&&this.parent.getValidatorBuilder()}setupValidator(e){this.validatorCompiler!==void 0&&!this.addedSchemas||(this.validatorCompiler=this.getValidatorBuilder()(this.schemaBucket.getSchemas(),e.ajv))}setupSerializer(e){this.serializerCompiler!==void 0&&!this.addedSchemas||(this.serializerCompiler=this.getSerializerBuilder()(this.schemaBucket.getSchemas(),e.serializerOpts))}};qs.buildSchemaController=fB;xR.exports=qs});var ao=E((C7,LR)=>{"use strict";var dB="2.0.0",hB=Number.MAX_SAFE_INTEGER||9007199254740991,pB=16,mB=250,gB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];LR.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:pB,MAX_SAFE_BUILD_LENGTH:mB,MAX_SAFE_INTEGER:hB,RELEASE_TYPES:gB,SEMVER_SPEC_VERSION:dB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var lo=E((I7,qR)=>{"use strict";var yB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};qR.exports=yB});var js=E((dr,jR)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:kp,MAX_SAFE_BUILD_LENGTH:_B,MAX_LENGTH:SB}=ao(),EB=lo();dr=jR.exports={};var bB=dr.re=[],vB=dr.safeRe=[],D=dr.src=[],wB=dr.safeSrc=[],F=dr.t={},RB=0,xp="[a-zA-Z0-9-]",OB=[["\\s",1],["\\d",SB],[xp,_B]],TB=t=>{for(let[e,r]of OB)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},X=(t,e,r)=>{let n=TB(e),s=RB++;EB(t,s,e),F[t]=s,D[s]=e,wB[s]=n,bB[s]=new RegExp(e,r?"g":void 0),vB[s]=new RegExp(n,r?"g":void 0)};X("NUMERICIDENTIFIER","0|[1-9]\\d*");X("NUMERICIDENTIFIERLOOSE","\\d+");X("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xp}*`);X("MAINVERSION",`(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})`);X("MAINVERSIONLOOSE",`(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASEIDENTIFIER",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIER]})`);X("PRERELEASEIDENTIFIERLOOSE",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASE",`(?:-(${D[F.PRERELEASEIDENTIFIER]}(?:\\.${D[F.PRERELEASEIDENTIFIER]})*))`);X("PRERELEASELOOSE",`(?:-?(${D[F.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[F.PRERELEASEIDENTIFIERLOOSE]})*))`);X("BUILDIDENTIFIER",`${xp}+`);X("BUILD",`(?:\\+(${D[F.BUILDIDENTIFIER]}(?:\\.${D[F.BUILDIDENTIFIER]})*))`);X("FULLPLAIN",`v?${D[F.MAINVERSION]}${D[F.PRERELEASE]}?${D[F.BUILD]}?`);X("FULL",`^${D[F.FULLPLAIN]}$`);X("LOOSEPLAIN",`[v=\\s]*${D[F.MAINVERSIONLOOSE]}${D[F.PRERELEASELOOSE]}?${D[F.BUILD]}?`);X("LOOSE",`^${D[F.LOOSEPLAIN]}$`);X("GTLT","((?:<|>)?=?)");X("XRANGEIDENTIFIERLOOSE",`${D[F.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);X("XRANGEIDENTIFIER",`${D[F.NUMERICIDENTIFIER]}|x|X|\\*`);X("XRANGEPLAIN",`[v=\\s]*(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:${D[F.PRERELEASE]})?${D[F.BUILD]}?)?)?`);X("XRANGEPLAINLOOSE",`[v=\\s]*(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:${D[F.PRERELEASELOOSE]})?${D[F.BUILD]}?)?)?`);X("XRANGE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAIN]}$`);X("XRANGELOOSE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAINLOOSE]}$`);X("COERCEPLAIN",`(^|[^\\d])(\\d{1,${kp}})(?:\\.(\\d{1,${kp}}))?(?:\\.(\\d{1,${kp}}))?`);X("COERCE",`${D[F.COERCEPLAIN]}(?:$|[^\\d])`);X("COERCEFULL",D[F.COERCEPLAIN]+`(?:${D[F.PRERELEASE]})?(?:${D[F.BUILD]})?(?:$|[^\\d])`);X("COERCERTL",D[F.COERCE],!0);X("COERCERTLFULL",D[F.COERCEFULL],!0);X("LONETILDE","(?:~>?)");X("TILDETRIM",`(\\s*)${D[F.LONETILDE]}\\s+`,!0);dr.tildeTrimReplace="$1~";X("TILDE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAIN]}$`);X("TILDELOOSE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAINLOOSE]}$`);X("LONECARET","(?:\\^)");X("CARETTRIM",`(\\s*)${D[F.LONECARET]}\\s+`,!0);dr.caretTrimReplace="$1^";X("CARET",`^${D[F.LONECARET]}${D[F.XRANGEPLAIN]}$`);X("CARETLOOSE",`^${D[F.LONECARET]}${D[F.XRANGEPLAINLOOSE]}$`);X("COMPARATORLOOSE",`^${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]})$|^$`);X("COMPARATOR",`^${D[F.GTLT]}\\s*(${D[F.FULLPLAIN]})$|^$`);X("COMPARATORTRIM",`(\\s*)${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]}|${D[F.XRANGEPLAIN]})`,!0);dr.comparatorTrimReplace="$1$2$3";X("HYPHENRANGE",`^\\s*(${D[F.XRANGEPLAIN]})\\s+-\\s+(${D[F.XRANGEPLAIN]})\\s*$`);X("HYPHENRANGELOOSE",`^\\s*(${D[F.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[F.XRANGEPLAINLOOSE]})\\s*$`);X("STAR","(<|>)?=?\\s*\\*");X("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");X("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Dl=E((N7,DR)=>{"use strict";var $B=Object.freeze({loose:!0}),PB=Object.freeze({}),AB=t=>t?typeof t!="object"?$B:t:PB;DR.exports=AB});var Lp=E((k7,HR)=>{"use strict";var FR=/^[0-9]+$/,MR=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=FR.test(t),n=FR.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},CB=(t,e)=>MR(e,t);HR.exports={compareIdentifiers:MR,rcompareIdentifiers:CB}});var tt=E((x7,zR)=>{"use strict";var Fl=lo(),{MAX_LENGTH:VR,MAX_SAFE_INTEGER:Ml}=ao(),{safeRe:Hl,t:Vl}=js(),IB=Dl(),{compareIdentifiers:qp}=Lp(),jp=class t{constructor(e,r){if(r=IB(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>VR)throw new TypeError(`version is longer than ${VR} characters`);Fl("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Hl[Vl.LOOSE]:Hl[Vl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ml||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ml||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ml||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<Ml)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Fl("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(Fl("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qp(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(Fl("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qp(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?Hl[Vl.PRERELEASELOOSE]:Hl[Vl.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];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(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),qp(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}};zR.exports=jp});var xn=E((L7,BR)=>{"use strict";var UR=tt(),NB=(t,e,r=!1)=>{if(t instanceof UR)return t;try{return new UR(t,e)}catch(n){if(!r)return null;throw n}};BR.exports=NB});var WR=E((q7,GR)=>{"use strict";var kB=xn(),xB=(t,e)=>{let r=kB(t,e);return r?r.version:null};GR.exports=xB});var KR=E((j7,JR)=>{"use strict";var LB=xn(),qB=(t,e)=>{let r=LB(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};JR.exports=qB});var QR=E((D7,XR)=>{"use strict";var YR=tt(),jB=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new YR(t instanceof YR?t.version:t,r).inc(e,n,s).version}catch{return null}};XR.exports=jB});var tO=E((F7,eO)=>{"use strict";var ZR=xn(),DB=(t,e)=>{let r=ZR(t,null,!0),n=ZR(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};eO.exports=DB});var nO=E((M7,rO)=>{"use strict";var FB=tt(),MB=(t,e)=>new FB(t,e).major;rO.exports=MB});var iO=E((H7,sO)=>{"use strict";var HB=tt(),VB=(t,e)=>new HB(t,e).minor;sO.exports=VB});var aO=E((V7,oO)=>{"use strict";var zB=tt(),UB=(t,e)=>new zB(t,e).patch;oO.exports=UB});var uO=E((z7,lO)=>{"use strict";var BB=xn(),GB=(t,e)=>{let r=BB(t,e);return r&&r.prerelease.length?r.prerelease:null};lO.exports=GB});var qt=E((U7,fO)=>{"use strict";var cO=tt(),WB=(t,e,r)=>new cO(t,r).compare(new cO(e,r));fO.exports=WB});var hO=E((B7,dO)=>{"use strict";var JB=qt(),KB=(t,e,r)=>JB(e,t,r);dO.exports=KB});var mO=E((G7,pO)=>{"use strict";var YB=qt(),XB=(t,e)=>YB(t,e,!0);pO.exports=XB});var zl=E((W7,yO)=>{"use strict";var gO=tt(),QB=(t,e,r)=>{let n=new gO(t,r),s=new gO(e,r);return n.compare(s)||n.compareBuild(s)};yO.exports=QB});var SO=E((J7,_O)=>{"use strict";var ZB=zl(),e5=(t,e)=>t.sort((r,n)=>ZB(r,n,e));_O.exports=e5});var bO=E((K7,EO)=>{"use strict";var t5=zl(),r5=(t,e)=>t.sort((r,n)=>t5(n,r,e));EO.exports=r5});var uo=E((Y7,vO)=>{"use strict";var n5=qt(),s5=(t,e,r)=>n5(t,e,r)>0;vO.exports=s5});var Ul=E((X7,wO)=>{"use strict";var i5=qt(),o5=(t,e,r)=>i5(t,e,r)<0;wO.exports=o5});var Dp=E((Q7,RO)=>{"use strict";var a5=qt(),l5=(t,e,r)=>a5(t,e,r)===0;RO.exports=l5});var Fp=E((Z7,OO)=>{"use strict";var u5=qt(),c5=(t,e,r)=>u5(t,e,r)!==0;OO.exports=c5});var Bl=E((eX,TO)=>{"use strict";var f5=qt(),d5=(t,e,r)=>f5(t,e,r)>=0;TO.exports=d5});var Gl=E((tX,$O)=>{"use strict";var h5=qt(),p5=(t,e,r)=>h5(t,e,r)<=0;$O.exports=p5});var Mp=E((rX,PO)=>{"use strict";var m5=Dp(),g5=Fp(),y5=uo(),_5=Bl(),S5=Ul(),E5=Gl(),b5=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return m5(t,r,n);case"!=":return g5(t,r,n);case">":return y5(t,r,n);case">=":return _5(t,r,n);case"<":return S5(t,r,n);case"<=":return E5(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};PO.exports=b5});var CO=E((nX,AO)=>{"use strict";var v5=tt(),w5=xn(),{safeRe:Wl,t:Jl}=js(),R5=(t,e)=>{if(t instanceof v5)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?Wl[Jl.COERCEFULL]:Wl[Jl.COERCE]);else{let l=e.includePrerelease?Wl[Jl.COERCERTLFULL]:Wl[Jl.COERCERTL],u;for(;(u=l.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),l.lastIndex=u.index+u[1].length+u[2].length;l.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return w5(`${n}.${s}.${i}${o}${a}`,e)};AO.exports=R5});var NO=E((sX,IO)=>{"use strict";var Hp=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 s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};IO.exports=Hp});var jt=E((iX,qO)=>{"use strict";var O5=/\s+/g,Vp=class t{constructor(e,r){if(r=$5(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof zp)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(O5," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!xO(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&x5(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&N5)|(this.options.loose&&k5))+":"+e,s=kO.get(n);if(s)return s;let i=this.options.loose,o=i?ut[rt.HYPHENRANGELOOSE]:ut[rt.HYPHENRANGE];e=e.replace(o,U5(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(ut[rt.COMPARATORTRIM],A5),Re("comparator trim",e),e=e.replace(ut[rt.TILDETRIM],C5),Re("tilde trim",e),e=e.replace(ut[rt.CARETTRIM],I5),Re("caret trim",e);let a=e.split(" ").map(f=>L5(f,this.options)).join(" ").split(/\s+/).map(f=>z5(f,this.options));i&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(ut[rt.COMPARATORLOOSE])))),Re("range list",a);let l=new Map,u=a.map(f=>new zp(f,this.options));for(let f of u){if(xO(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let c=[...l.values()];return kO.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>LO(n,r)&&e.set.some(s=>LO(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new P5(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(B5(this.set[r],e,this.options))return!0;return!1}};qO.exports=Vp;var T5=NO(),kO=new T5,$5=Dl(),zp=co(),Re=lo(),P5=tt(),{safeRe:ut,t:rt,comparatorTrimReplace:A5,tildeTrimReplace:C5,caretTrimReplace:I5}=js(),{FLAG_INCLUDE_PRERELEASE:N5,FLAG_LOOSE:k5}=ao(),xO=t=>t.value==="<0.0.0-0",x5=t=>t.value==="",LO=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},L5=(t,e)=>(t=t.replace(ut[rt.BUILD],""),Re("comp",t,e),t=D5(t,e),Re("caret",t),t=q5(t,e),Re("tildes",t),t=M5(t,e),Re("xrange",t),t=V5(t,e),Re("stars",t),t),ct=t=>!t||t.toLowerCase()==="x"||t==="*",q5=(t,e)=>t.trim().split(/\s+/).map(r=>j5(r,e)).join(" "),j5=(t,e)=>{let r=e.loose?ut[rt.TILDELOOSE]:ut[rt.TILDE];return t.replace(r,(n,s,i,o,a)=>{Re("tilde",t,n,s,i,o,a);let l;return ct(s)?l="":ct(i)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:ct(o)?l=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Re("replaceTilde pr",a),l=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Re("tilde return",l),l})},D5=(t,e)=>t.trim().split(/\s+/).map(r=>F5(r,e)).join(" "),F5=(t,e)=>{Re("caret",t,e);let r=e.loose?ut[rt.CARETLOOSE]:ut[rt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,l)=>{Re("caret",t,s,i,o,a,l);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0${n} <${+i+1}.0.0-0`:ct(a)?i==="0"?u=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:l?(Re("replaceCaret pr",l),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${l} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${l} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${l} <${+i+1}.0.0-0`):(Re("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),Re("caret return",u),u})},M5=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>H5(r,e)).join(" ")),H5=(t,e)=>{t=t.trim();let r=e.loose?ut[rt.XRANGELOOSE]:ut[rt.XRANGE];return t.replace(r,(n,s,i,o,a,l)=>{Re("xRange",t,n,s,i,o,a,l);let u=ct(i),c=u||ct(o),f=c||ct(a),p=f;return s==="="&&p&&(s=""),l=e.includePrerelease?"-0":"",u?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&p?(c&&(o=0),a=0,s===">"?(s=">=",c?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",c?i=+i+1:o=+o+1),s==="<"&&(l="-0"),n=`${s+i}.${o}.${a}${l}`):c?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),Re("xRange return",n),n})},V5=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(ut[rt.STAR],"")),z5=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(ut[e.includePrerelease?rt.GTE0PRE:rt.GTE0],"")),U5=t=>(e,r,n,s,i,o,a,l,u,c,f,p)=>(ct(n)?r="":ct(s)?r=`>=${n}.0.0${t?"-0":""}`:ct(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ct(u)?l="":ct(c)?l=`<${+u+1}.0.0-0`:ct(f)?l=`<${u}.${+c+1}.0-0`:p?l=`<=${u}.${c}.${f}-${p}`:t?l=`<${u}.${c}.${+f+1}-0`:l=`<=${l}`,`${r} ${l}`.trim()),B5=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Re(t[n].semver),t[n].semver!==zp.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var co=E((oX,VO)=>{"use strict";var fo=Symbol("SemVer ANY"),Gp=class t{static get ANY(){return fo}constructor(e,r){if(r=jO(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Bp("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===fo?this.value="":this.value=this.operator+this.semver.version,Bp("comp",this)}parse(e){let r=this.options.loose?DO[FO.COMPARATORLOOSE]:DO[FO.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new MO(n[2],this.options.loose):this.semver=fo}toString(){return this.value}test(e){if(Bp("Comparator.test",e,this.options.loose),this.semver===fo||e===fo)return!0;if(typeof e=="string")try{e=new MO(e,this.options)}catch{return!1}return Up(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 HO(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new HO(this.value,r).test(e.semver):(r=jO(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("=")||Up(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Up(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};VO.exports=Gp;var jO=Dl(),{safeRe:DO,t:FO}=js(),Up=Mp(),Bp=lo(),MO=tt(),HO=jt()});var ho=E((aX,zO)=>{"use strict";var G5=jt(),W5=(t,e,r)=>{try{e=new G5(e,r)}catch{return!1}return e.test(t)};zO.exports=W5});var BO=E((lX,UO)=>{"use strict";var J5=jt(),K5=(t,e)=>new J5(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));UO.exports=K5});var WO=E((uX,GO)=>{"use strict";var Y5=tt(),X5=jt(),Q5=(t,e,r)=>{let n=null,s=null,i=null;try{i=new X5(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new Y5(n,r))}),n};GO.exports=Q5});var KO=E((cX,JO)=>{"use strict";var Z5=tt(),eG=jt(),tG=(t,e,r)=>{let n=null,s=null,i=null;try{i=new eG(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new Z5(n,r))}),n};JO.exports=tG});var QO=E((fX,XO)=>{"use strict";var Wp=tt(),rG=jt(),YO=uo(),nG=(t,e)=>{t=new rG(t,e);let r=new Wp("0.0.0");if(t.test(r)||(r=new Wp("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new Wp(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||YO(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||YO(r,i))&&(r=i)}return r&&t.test(r)?r:null};XO.exports=nG});var eT=E((dX,ZO)=>{"use strict";var sG=jt(),iG=(t,e)=>{try{return new sG(t,e).range||"*"}catch{return null}};ZO.exports=iG});var Kl=E((hX,sT)=>{"use strict";var oG=tt(),nT=co(),{ANY:aG}=nT,lG=jt(),uG=ho(),tT=uo(),rT=Ul(),cG=Gl(),fG=Bl(),dG=(t,e,r,n)=>{t=new oG(t,n),e=new lG(e,n);let s,i,o,a,l;switch(r){case">":s=tT,i=cG,o=rT,a=">",l=">=";break;case"<":s=rT,i=fG,o=tT,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(uG(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let c=e.set[u],f=null,p=null;if(c.forEach(h=>{h.semver===aG&&(h=new nT(">=0.0.0")),f=f||h,p=p||h,s(h.semver,f.semver,n)?f=h:o(h.semver,p.semver,n)&&(p=h)}),f.operator===a||f.operator===l||(!p.operator||p.operator===a)&&i(t,p.semver))return!1;if(p.operator===l&&o(t,p.semver))return!1}return!0};sT.exports=dG});var oT=E((pX,iT)=>{"use strict";var hG=Kl(),pG=(t,e,r)=>hG(t,e,">",r);iT.exports=pG});var lT=E((mX,aT)=>{"use strict";var mG=Kl(),gG=(t,e,r)=>mG(t,e,"<",r);aT.exports=gG});var fT=E((gX,cT)=>{"use strict";var uT=jt(),yG=(t,e,r)=>(t=new uT(t,r),e=new uT(e,r),t.intersects(e,r));cT.exports=yG});var hT=E((yX,dT)=>{"use strict";var _G=ho(),SG=qt();dT.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((c,f)=>SG(c,f,r));for(let c of o)_G(c,e,r)?(i=c,s||(s=c)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===o[0]?a.push("*"):f?c===o[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let l=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length<u.length?l:e}});var ST=E((_X,_T)=>{"use strict";var pT=jt(),Kp=co(),{ANY:Jp}=Kp,po=ho(),Yp=qt(),EG=(t,e,r={})=>{if(t===e)return!0;t=new pT(t,r),e=new pT(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=vG(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},bG=[new Kp(">=0.0.0-0")],mT=[new Kp(">=0.0.0")],vG=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Jp){if(e.length===1&&e[0].semver===Jp)return!0;r.includePrerelease?t=bG:t=mT}if(e.length===1&&e[0].semver===Jp){if(r.includePrerelease)return!0;e=mT}let n=new Set,s,i;for(let h of t)h.operator===">"||h.operator===">="?s=gT(s,h,r):h.operator==="<"||h.operator==="<="?i=yT(i,h,r):n.add(h.semver);if(n.size>1)return null;let o;if(s&&i){if(o=Yp(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let h of n){if(s&&!po(h,String(s),r)||i&&!po(h,String(i),r))return null;for(let d of e)if(!po(h,String(d),r))return!1;return!0}let a,l,u,c,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&i.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(c=c||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",s){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator===">"||h.operator===">="){if(a=gT(s,h,r),a===h&&a!==s)return!1}else if(s.operator===">="&&!po(s.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(l=yT(i,h,r),l===h&&l!==i)return!1}else if(i.operator==="<="&&!po(i.semver,String(h),r))return!1}if(!h.operator&&(i||s)&&o!==0)return!1}return!(s&&u&&!i&&o!==0||i&&c&&!s&&o!==0||p||f)},gT=(t,e,r)=>{if(!t)return e;let n=Yp(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},yT=(t,e,r)=>{if(!t)return e;let n=Yp(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};_T.exports=EG});var wT=E((SX,vT)=>{"use strict";var Xp=js(),ET=ao(),wG=tt(),bT=Lp(),RG=xn(),OG=WR(),TG=KR(),$G=QR(),PG=tO(),AG=nO(),CG=iO(),IG=aO(),NG=uO(),kG=qt(),xG=hO(),LG=mO(),qG=zl(),jG=SO(),DG=bO(),FG=uo(),MG=Ul(),HG=Dp(),VG=Fp(),zG=Bl(),UG=Gl(),BG=Mp(),GG=CO(),WG=co(),JG=jt(),KG=ho(),YG=BO(),XG=WO(),QG=KO(),ZG=QO(),e3=eT(),t3=Kl(),r3=oT(),n3=lT(),s3=fT(),i3=hT(),o3=ST();vT.exports={parse:RG,valid:OG,clean:TG,inc:$G,diff:PG,major:AG,minor:CG,patch:IG,prerelease:NG,compare:kG,rcompare:xG,compareLoose:LG,compareBuild:qG,sort:jG,rsort:DG,gt:FG,lt:MG,eq:HG,neq:VG,gte:zG,lte:UG,cmp:BG,coerce:GG,Comparator:WG,Range:JG,satisfies:KG,toComparators:YG,maxSatisfying:XG,minSatisfying:QG,minVersion:ZG,validRange:e3,outside:t3,gtr:r3,ltr:n3,intersects:s3,simplifyRange:i3,subset:o3,SemVer:wG,re:Xp.re,src:Xp.src,tokens:Xp.t,SEMVER_SPEC_VERSION:ET.SEMVER_SPEC_VERSION,RELEASE_TYPES:ET.RELEASE_TYPES,compareIdentifiers:bT.compareIdentifiers,rcompareIdentifiers:bT.rcompareIdentifiers}});var nm=E((EX,rm)=>{"use strict";var Qp=wT(),em=V("node:assert"),tm=Symbol.for("registered-plugin"),{kTestInternals:a3}=De(),{exist:l3,existReply:u3,existRequest:c3}=di(),{FST_ERR_PLUGIN_VERSION_MISMATCH:f3,FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:d3,FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:h3}=He(),p3=/-(?:rc|pre|alpha).+$/u;function mo(t){return t[Symbol.for("plugin-meta")]}function RT(t){let e=OT(t);if(e)return e;let r=V.cache;if(r){let n=Object.keys(r);for(let s=0;s<n.length;s++){let i=n[s];if(r[i].exports===t)return i}}return t.name?t.name:null}function m3(t){return t.toString().split(`
|
|
344
|
+
`,2).map(e=>e.trim()).join(" -- ")}function OT(t){return t[Symbol.for("fastify.display-name")]}function TT(t){return!!t[Symbol.for("skip-override")]}function $T(t){let e=mo(t);if(!e)return;let r=e.dependencies;r&&(em(Array.isArray(r),"The dependencies should be an array of strings"),r.forEach(n=>{em(this[tm].indexOf(n)>-1,`The dependency '${n}' of plugin '${e.name}' is not registered`)}))}function PT(t){let e=mo(t);if(!e)return;let{decorators:r,name:n}=e;r&&(r.fastify&&Zp(this,"Fastify",r.fastify,n),r.reply&&Zp(this,"Reply",r.reply,n),r.request&&Zp(this,"Request",r.request,n))}var g3={Fastify:l3,Request:c3,Reply:u3};function Zp(t,e,r,n){em(Array.isArray(r),"The decorators should be an array of strings"),r.forEach(s=>{let i=typeof n=="string"?` required by '${n}'`:"";if(!g3[e].call(t,s))throw new d3(s,i,e)})}function y3(t){let e=mo(t);if(e?.fastify==null)return;let r=e.fastify,n=p3.test(this.version);if(!(n===!0&&Qp.gt(this.version,Qp.coerce(r))===!0)&&r&&Qp.satisfies(this.version,r,{includePrerelease:n})===!1)throw new f3(e.name,r,this.version)}function _3(t){let e=mo(t);if(!e)return;let r=e.name;if(r)return this[tm].push(r),r}function S3(t,e){if(t.constructor.name==="AsyncFunction"&&t.length===3)throw new h3(e)}function E3(t){let e=_3.call(this,t)||RT(t);return S3.call(this,t,e),y3.call(this,t),PT.call(this,t),$T.call(this,t),TT(t)}rm.exports={getPluginName:RT,getFuncPreview:m3,kRegisteredPlugins:tm,getDisplayName:OT,registerPlugin:E3};rm.exports[a3]={shouldSkipOverride:TT,getMeta:mo,checkDecorators:PT,checkDependencies:$T}});var Yl=E((vX,AT)=>{"use strict";function b3(t,e){let r=e||w3();return t?R3(t,r):r}function v3(t,e){return t.genReqId(e)}function w3(){let e=0;return function(){return e=e+1&2147483647,`req-${e.toString(36)}`}}function R3(t,e){return function(r){return r.headers[t]||e(r)}}AT.exports={getGenReqId:v3,reqIdGenFactory:b3}});var kT=E((wX,NT)=>{"use strict";var CT=12,O3=0,sm=[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,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,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,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function T3(t){var e=t.indexOf("%");if(e===-1)return t;for(var r=t.length,n="",s=0,i=0,o=e,a=CT;e>-1&&e<r;){var l=IT(t[e+1],4),u=IT(t[e+2],0),c=l|u,f=sm[c];if(a=sm[256+a+f],i=i<<6|c&sm[364+f],a===CT)n+=t.slice(s,o),n+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(i&1023)),i=0,s=e+3,e=o=t.indexOf("%",s);else{if(a===O3)return null;if(e+=3,e<r&&t.charCodeAt(e)===37)continue;return null}}return n+t.slice(s)}var $3={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function IT(t,e){var r=$3[t];return r===void 0?255:r<<e}NT.exports=T3});var DT=E((RX,jT)=>{"use strict";var xT=kT(),LT=/\+/g,qT=function(){};qT.prototype=Object.create(null);function P3(t){let e=new qT;if(typeof t!="string")return e;let r=t.length,n="",s="",i=-1,o=-1,a=!1,l=!1,u=!1,c=!1,f=!1,p=0;for(let h=0;h<r+1;h++)if(p=h!==r?t.charCodeAt(h):38,p===38){if(f=o>i,f||(o=h),n=t.slice(i+1,o),f||n.length>0){u&&(n=n.replace(LT," ")),a&&(n=xT(n)||n),f&&(s=t.slice(o+1,h),c&&(s=s.replace(LT," ")),l&&(s=xT(s)||s));let d=e[n];d===void 0?e[n]=s:d.pop?d.push(s):e[n]=[d,s]}s="",i=h,o=h,a=!1,l=!1,u=!1,c=!1}else p===61?o<=i?o=h:l=!0:p===43?o>i?c=!0:u=!0:p===37&&(o>i?l=!0:a=!0);return e}jT.exports=P3});var MT=E((OX,FT)=>{var hr=Array.from({length:256},(t,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase()),A3=new Int8Array([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,0,0,0,0,1,1,1,1,0,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,0,1,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,0]);function C3(t){let e=t.length;if(e===0)return"";let r="",n=0,s=0;e:for(;s<e;s++){let i=t.charCodeAt(s);for(;i<128;){if(A3[i]!==1&&(n<s&&(r+=t.slice(n,s)),n=s+1,r+=hr[i]),++s===e)break e;i=t.charCodeAt(s)}if(n<s&&(r+=t.slice(n,s)),i<2048){n=s+1,r+=hr[192|i>>6]+hr[128|i&63];continue}if(i<55296||i>=57344){n=s+1,r+=hr[224|i>>12]+hr[128|i>>6&63]+hr[128|i&63];continue}if(++s,s>=e)throw new Error("URI malformed");let o=t.charCodeAt(s)&1023;n=s+1,i=65536+((i&1023)<<10|o),r+=hr[240|i>>18]+hr[128|i>>12&63]+hr[128|i>>6&63]+hr[128|i&63]}return n===0?t:n<e?r+t.slice(n):r}FT.exports={encodeString:C3}});var zT=E((TX,VT)=>{"use strict";var{encodeString:im}=MT();function HT(t){let e=typeof t;return e==="string"?im(t):e==="bigint"?t.toString():e==="boolean"?t?"true":"false":e==="number"&&Number.isFinite(t)?t<1e21?""+t:im(""+t):""}function I3(t){let e="";if(t===null||typeof t!="object")return e;let r="&",n=Object.keys(t),s=n.length,i=0;for(let o=0;o<s;o++){let a=n[o],l=t[a],u=im(a)+"=";if(o&&(e+=r),Array.isArray(l)){i=l.length;for(let c=0;c<i;c++)c&&(e+=r),e+=u,e+=HT(l[c])}else e+=u,e+=HT(l)}return e}VT.exports=I3});var WT=E(($X,go)=>{"use strict";var UT=DT(),BT=zT(),GT={parse:UT,stringify:BT};go.exports=GT;go.exports.default=GT;go.exports.parse=UT;go.exports.stringify=BT});var KT=E(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0})});var YT=E(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.types=void 0;var N3;(function(t){t[t.ROOT=0]="ROOT",t[t.GROUP=1]="GROUP",t[t.POSITION=2]="POSITION",t[t.SET=3]="SET",t[t.RANGE=4]="RANGE",t[t.REPETITION=5]="REPETITION",t[t.REFERENCE=6]="REFERENCE",t[t.CHAR=7]="CHAR"})(N3=yo.types||(yo.types={}))});var QT=E(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0})});var Nr=E(Ir=>{"use strict";var k3=Ir&&Ir.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),om=Ir&&Ir.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k3(e,t,r)};Object.defineProperty(Ir,"__esModule",{value:!0});om(KT(),Ir);om(YT(),Ir);om(QT(),Ir)});var Xl=E(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.anyChar=nt.notWhitespace=nt.whitespace=nt.notInts=nt.ints=nt.notWords=nt.words=void 0;var he=Nr(),ZT=()=>[{type:he.types.RANGE,from:48,to:57}],e$=()=>[{type:he.types.CHAR,value:95},{type:he.types.RANGE,from:97,to:122},{type:he.types.RANGE,from:65,to:90},{type:he.types.RANGE,from:48,to:57}],t$=()=>[{type:he.types.CHAR,value:9},{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:11},{type:he.types.CHAR,value:12},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:32},{type:he.types.CHAR,value:160},{type:he.types.CHAR,value:5760},{type:he.types.RANGE,from:8192,to:8202},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233},{type:he.types.CHAR,value:8239},{type:he.types.CHAR,value:8287},{type:he.types.CHAR,value:12288},{type:he.types.CHAR,value:65279}],x3=()=>[{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233}];nt.words=()=>({type:he.types.SET,set:e$(),not:!1});nt.notWords=()=>({type:he.types.SET,set:e$(),not:!0});nt.ints=()=>({type:he.types.SET,set:ZT(),not:!1});nt.notInts=()=>({type:he.types.SET,set:ZT(),not:!0});nt.whitespace=()=>({type:he.types.SET,set:t$(),not:!1});nt.notWhitespace=()=>({type:he.types.SET,set:t$(),not:!0});nt.anyChar=()=>({type:he.types.SET,set:x3(),not:!0})});var n$=E(Dt=>{"use strict";var L3=Dt&&Dt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),q3=Dt&&Dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),j3=Dt&&Dt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&L3(e,t,r);return q3(e,t),e};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.tokenizeClass=Dt.strToChars=void 0;var r$=Nr(),Ds=j3(Xl()),D3="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?";Dt.strToChars=t=>{let e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return t.replace(e,(r,n,s,i,o,a,l)=>{if(s)return r;let u=n?8:i?parseInt(i,16):o?parseInt(o,16):a?D3.indexOf(a):{0:0,t:9,n:10,v:11,f:12,r:13}[l],c=String.fromCharCode(u);return/[[\]{}^$.|?*+()]/.test(c)?`\\${c}`:c})};Dt.tokenizeClass=(t,e)=>{var r,n,s,i,o,a,l;let u=[],c,f,p=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g;for(;(c=p.exec(t))!==null;){let h=(l=(a=(o=(i=(s=(n=(r=c[1]&&Ds.words())!==null&&r!==void 0?r:c[2]&&Ds.ints())!==null&&n!==void 0?n:c[3]&&Ds.whitespace())!==null&&s!==void 0?s:c[4]&&Ds.notWords())!==null&&i!==void 0?i:c[5]&&Ds.notInts())!==null&&o!==void 0?o:c[6]&&Ds.notWhitespace())!==null&&a!==void 0?a:c[7]&&{type:r$.types.RANGE,from:(c[8]||c[9]).charCodeAt(0),to:(f=c[10]).charCodeAt(f.length-1)})!==null&&l!==void 0?l:(f=c[16])&&{type:r$.types.CHAR,value:f.charCodeAt(0)};if(h)u.push(h);else return[u,p.lastIndex]}throw new SyntaxError(`Invalid regular expression: /${e}/: Unterminated character class`)}});var am=E(pr=>{"use strict";var F3=pr&&pr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),M3=pr&&pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o$=pr&&pr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&F3(e,t,r);return M3(e,t),e};Object.defineProperty(pr,"__esModule",{value:!0});pr.tokenizer=void 0;var s$=o$(n$()),Ye=Nr(),Ln=o$(Xl()),H3=/^[a-zA-Z_$]$/i,V3=/^[a-zA-Z0-9_$]$/i,i$=/\d/;pr.tokenizer=t=>{let e=0,r,n={type:Ye.types.ROOT,stack:[]},s=n,i=n.stack,o=[],a=[],l=0,u=f=>{throw new SyntaxError(`Invalid regular expression: /${t}/: Nothing to repeat at column ${f-1}`)},c=s$.strToChars(t);for(;e<c.length;)switch(r=c[e++]){case"\\":if(e===c.length)throw new SyntaxError(`Invalid regular expression: /${t}/: \\ at end of pattern`);switch(r=c[e++]){case"b":i.push({type:Ye.types.POSITION,value:"b"});break;case"B":i.push({type:Ye.types.POSITION,value:"B"});break;case"w":i.push(Ln.words());break;case"W":i.push(Ln.notWords());break;case"d":i.push(Ln.ints());break;case"D":i.push(Ln.notInts());break;case"s":i.push(Ln.whitespace());break;case"S":i.push(Ln.notWhitespace());break;default:if(i$.test(r)){let f=r;for(;e<c.length&&i$.test(c[e]);)f+=c[e++];let p=parseInt(f,10),h={type:Ye.types.REFERENCE,value:p};i.push(h),a.push({reference:h,stack:i,index:i.length-1})}else i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}break;case"^":i.push({type:Ye.types.POSITION,value:"^"});break;case"$":i.push({type:Ye.types.POSITION,value:"$"});break;case"[":{let f;c[e]==="^"?(f=!0,e++):f=!1;let p=s$.tokenizeClass(c.slice(e),t);e+=p[1],i.push({type:Ye.types.SET,set:p[0],not:f});break}case".":i.push(Ln.anyChar());break;case"(":{let f={type:Ye.types.GROUP,stack:[],remember:!0};if(c[e]==="?")if(r=c[e+1],e+=2,r==="=")f.followedBy=!0,f.remember=!1;else if(r==="!")f.notFollowedBy=!0,f.remember=!1;else if(r==="<"){let p="";if(H3.test(c[e]))p+=c[e],e++;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);for(;e<c.length&&V3.test(c[e]);)p+=c[e],e++;if(!p)throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);if(c[e]!==">")throw new SyntaxError(`Invalid regular expression: /${t}/: Unclosed capture group name, expected '>', found '${c[e]}' at column ${e+1}`);f.name=p,e++}else if(r===":")f.remember=!1;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid group, character '${r}' after '?' at column ${e-1}`);else l+=1;i.push(f),o.push(s),s=f,i=f.stack;break}case")":if(o.length===0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unmatched ) at column ${e-1}`);s=o.pop(),i=s.options?s.options[s.options.length-1]:s.stack;break;case"|":{s.options||(s.options=[s.stack],delete s.stack);let f=[];s.options.push(f),i=f;break}case"{":{let f=/^(\d+)(,(\d+)?)?\}/.exec(c.slice(e)),p,h;f!==null?(i.length===0&&u(e),p=parseInt(f[1],10),h=f[2]?f[3]?parseInt(f[3],10):1/0:p,e+=f[0].length,i.push({type:Ye.types.REPETITION,min:p,max:h,value:i.pop()})):i.push({type:Ye.types.CHAR,value:123});break}case"?":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1,value:i.pop()});break;case"+":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:1,max:1/0,value:i.pop()});break;case"*":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1/0,value:i.pop()});break;default:i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}if(o.length!==0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unterminated group`);return z3(a,l),n};function z3(t,e){for(let r of t.reverse())if(e<r.reference.value){r.reference.type=Ye.types.CHAR;let n=r.reference.value.toString();if(r.reference.value=parseInt(n,8),!/^[0-7]+$/.test(n)){let s=0;for(;n[s]!=="8"&&n[s]!=="9";)s+=1;if(s===0?(r.reference.value=n.charCodeAt(0),s+=1):r.reference.value=parseInt(n.slice(0,s),8),n.length>s){let i=r.stack.splice(r.index+1);for(let o of n.slice(s))r.stack.push({type:Ye.types.CHAR,value:o.charCodeAt(0)});r.stack.push(...i)}}}}});var l$=E(st=>{"use strict";var U3=st&&st.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),B3=st&&st.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G3=st&&st.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&U3(e,t,r);return B3(e,t),e};Object.defineProperty(st,"__esModule",{value:!0});st.NOTANYCHAR=st.WHITESPACE=st.WORDS=st.INTS=void 0;var Ql=G3(Xl()),a$=Nr();function Zl(t){let e={},r=0;for(let n of t)n.type===a$.types.CHAR&&(e[n.value]=!0),n.type===a$.types.RANGE&&(e[`${n.from}-${n.to}`]=!0),r+=1;return{lookup:()=>Object.assign({},e),len:r}}st.INTS=Zl(Ql.ints().set);st.WORDS=Zl(Ql.words().set);st.WHITESPACE=Zl(Ql.whitespace().set);st.NOTANYCHAR=Zl(Ql.anyChar().set)});var c$=E(Ft=>{"use strict";var W3=Ft&&Ft.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),J3=Ft&&Ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),K3=Ft&&Ft.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&W3(e,t,r);return J3(e,t),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.writeSetTokens=Ft.setChar=void 0;var nu=Nr(),eu=K3(l$());function ru(t){return t===94?"\\^":t===92?"\\\\":t===93?"\\]":t===45?"\\-":String.fromCharCode(t)}Ft.setChar=ru;function tu(t,{lookup:e,len:r}){if(r!==t.length)return!1;let n=e();for(let s of t){if(s.type===nu.types.SET)return!1;let i=s.type===nu.types.CHAR?s.value:`${s.from}-${s.to}`;if(n[i])n[i]=!1;else return!1}return!0}function u$(t,e=!1){if(tu(t.set,eu.INTS))return t.not?"\\D":"\\d";if(tu(t.set,eu.WORDS))return t.not?"\\W":"\\w";if(t.not&&tu(t.set,eu.NOTANYCHAR))return".";if(tu(t.set,eu.WHITESPACE))return t.not?"\\S":"\\s";let r="";for(let s=0;s<t.set.length;s++){let i=t.set[s];r+=Y3(i)}let n=`${t.not?"^":""}${r}`;return e?n:`[${n}]`}Ft.writeSetTokens=u$;function Y3(t){return t.type===nu.types.CHAR?ru(t.value):t.type===nu.types.RANGE?`${ru(t.from)}-${ru(t.to)}`:u$(t,!0)}});var um=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.reconstruct=void 0;var rn=Nr(),lm=c$(),f$=t=>t.map(Fs.reconstruct).join(""),d$=t=>{if("options"in t)return t.options.map(f$).join("|");if("stack"in t)return f$(t.stack);throw new Error("options or stack must be Root or Group token")};Fs.reconstruct=t=>{switch(t.type){case rn.types.ROOT:return d$(t);case rn.types.CHAR:{let e=String.fromCharCode(t.value);return(/[[\\{}$^.|?*+()]/.test(e)?"\\":"")+e}case rn.types.POSITION:return t.value==="^"||t.value==="$"?t.value:`\\${t.value}`;case rn.types.REFERENCE:return`\\${t.value}`;case rn.types.SET:return lm.writeSetTokens(t);case rn.types.GROUP:return`(${t.name?`?<${t.name}>`:t.remember?"":t.followedBy?"?=":t.notFollowedBy?"?!":"?:"}${d$(t)})`;case rn.types.REPETITION:{let{min:e,max:r}=t,n;return e===0&&r===1?n="?":e===1&&r===1/0?n="+":e===0&&r===1/0?n="*":r===1/0?n=`{${e},}`:e===r?n=`{${e}}`:n=`{${e},${r}}`,`${Fs.reconstruct(t.value)}${n}`}case rn.types.RANGE:return`${lm.setChar(t.from)}-${lm.setChar(t.to)}`;default:throw new Error(`Invalid token type ${t}`)}}});var m$=E((Mt,su)=>{"use strict";var X3=Mt&&Mt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cm=Mt&&Mt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X3(e,t,r)};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.types=void 0;var h$=Nr();Object.defineProperty(Mt,"types",{enumerable:!0,get:function(){return h$.types}});cm(am(),Mt);cm(um(),Mt);var p$=am(),Q3=um();cm(Nr(),Mt);Mt.default=p$.tokenizer;su.exports=p$.tokenizer;su.exports.types=h$.types;su.exports.reconstruct=Q3.reconstruct});var y$=E((DX,iu)=>{"use strict";var g$=m$(),Z3=g$.types;function fm(t,e){e||(e={});let r=e.limit===void 0?25:e.limit;e9(t)?t=t.source:typeof t!="string"&&(t=String(t));try{t=g$(t)}catch{return!1}let n=0;return function s(i,o){let a,l,u;if(i.type===Z3.REPETITION&&(o++,n++,o>1||n>r))return!1;if(i.options){for(a=0,u=i.options.length;a<u;a++)if(l=s({stack:i.options[a]},o),!l)return!1}let c=i.stack||i.value?.stack;if(!c)return!0;for(a=0;a<c.length;a++)if(l=s(c[a],o),!l)return!1;return!0}(t,0)}function e9(t){return{}.toString.call(t)==="[object RegExp]"}iu.exports=fm;iu.exports.default=fm;iu.exports.safeRegex=fm});var ou=E((FX,_$)=>{"use strict";_$.exports={name:"__fmw_internal_strategy_merged_tree_http_method__",storage:function(){let t=new Map;return{get:e=>t.get(e)||null,set:(e,r)=>{t.set(e,r)}}},deriveConstraint:t=>t.method,mustMatchWhenDerived:!0}});var O$=E((MX,R$)=>{"use strict";var S$=Pi(),E$=ou(),b$=Symbol("treeData");function v$(t,e=""){let r="",n=Object.keys(t);for(let s=0;s<n.length;s++){let i=n[s],o=t[i],a=s===n.length-1,l=a?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",u=a?" ":"\u2502 ",f=(o[b$]||"").replaceAll(`
|
|
345
345
|
`,`
|
|
346
346
|
`+e+u);r+=e+l+i+f+`
|
|
347
|
-
`,r+=
|
|
348
|
-
\u2022 (${r}) ${n}`;return e}function
|
|
349
|
-
${e}`)}function au(t,e,r,n){if((t.isLeafNode||n.commonPrefix!==!1)&&(r=r||"(empty root node)",e=e[r]={},t.isLeafNode&&(e[
|
|
350
|
-
`))(
|
|
347
|
+
`,r+=v$(o,e+u)}return r}function t9(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function w$(t){return Array.isArray(t)?t.map(e=>w$(e)):typeof t=="symbol"?t.toString():typeof t=="function"?t9(t):t}function r9(t,e){if(!e.includeMeta)return{};let r=e.buildPrettyMeta(t),n={},s=e.includeMeta;Array.isArray(s)||(s=Reflect.ownKeys(r));for(let i of s){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=i.toString(),a=r[i];if(a!=null){let l=JSON.stringify(w$(a));n[o]=l}}return n}function n9(t){let e="";for(let[r,n]of Object.entries(t))e+=`
|
|
348
|
+
\u2022 (${r}) ${n}`;return e}function s9(t){let e={...t.opts.constraints},r=e[E$.name];return delete e[E$.name],{...t,method:r,opts:{constraints:e}}}function i9(t){let e=` (${t.method})`,r=t.opts.constraints||{};return Object.keys(r).length!==0&&(e+=" "+JSON.stringify(r)),e+=n9(t.metaData),e}function o9(t){return t.reduce((e,r)=>{for(let n of e)if(S$(r.opts.constraints,n.opts.constraints)&&S$(r.metaData,n.metaData))return n.method+=", "+r.method,e;return e.push(r),e},[])}function a9(t,e,r){let n=t.routes;return r.method===void 0&&(n=n.map(s9)),n=n.map(s=>(s.metaData=r9(s,r),s)),r.method===void 0&&(n=o9(n)),n.map(i9).join(`
|
|
349
|
+
${e}`)}function au(t,e,r,n){if((t.isLeafNode||n.commonPrefix!==!1)&&(r=r||"(empty root node)",e=e[r]={},t.isLeafNode&&(e[b$]=a9(t,r,n)),r=""),t.staticChildren)for(let s of Object.values(t.staticChildren))au(s,e,r+s.prefix,n);if(t.parametricChildren)for(let s of Object.values(t.parametricChildren)){let i=Array.from(s.nodePaths).join("|");au(s,e,r+i,n)}t.wildcardChild&&au(t.wildcardChild,e,"*",n)}function l9(t,e){let r={};return au(t,r,t.prefix,e),v$(r)}R$.exports={prettyPrintTree:l9}});var P$=E((HX,$$)=>{"use strict";var T$=function(){};T$.prototype=Object.create(null);$$.exports={NullObject:T$}});var C$=E((VX,A$)=>{"use strict";var{NullObject:u9}=P$(),c9=ou(),dm=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,r){let n=r.params,s=r.opts.constraints||{},i={params:n,constraints:s,handler:r.handler,store:r.store||null,_createParamsObject:this._compileCreateParamsObject(n)},o=Object.keys(s);o.length===0&&(this.unconstrainedHandler=i);for(let l of o)this.constraints.includes(l)||(l==="version"?this.constraints.unshift(l):this.constraints.push(l));let a=o.includes(c9.name);if(!a&&this.handlers.length>=31)throw new Error("find-my-way supports a maximum of 31 route handlers per node when there are constraints, limit reached");this.handlers.push(i),this.handlers.sort((l,u)=>Object.keys(l.constraints).length-Object.keys(u.constraints).length),a||this._compileGetHandlerMatchingConstraints(e,s)}_compileCreateParamsObject(e){let r=[];r.push("const fn = function _createParamsObject (paramsArray) {"),r.push("const params = new NullObject()");for(let n=0;n<e.length;n++)r.push(`params['${e[n]}'] = paramsArray[${n}]`);return r.push("return params"),r.push("}"),r.push("return fn"),new Function("NullObject",r.join(`
|
|
350
|
+
`))(u9)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,r){for(let n=0;n<this.handlers.length;n++){let i=this.handlers[n].constraints[r];if(i!==void 0){let o=e.get(i)||0;o|=1<<n,e.set(i,o)}}}_constrainedIndexBitmask(e){let r=0;for(let n=0;n<this.handlers.length;n++)this.handlers[n].constraints[e]!==void 0&&(r|=1<<n);return~r}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let n of this.constraints){let s=e.newStoreForConstraint(n);this.constrainedHandlerStores[n]=s,this._buildConstraintStore(s,n)}let r=[];r.push(`
|
|
351
351
|
let candidates = ${(1<<this.handlers.length)-1}
|
|
352
352
|
let mask, matches
|
|
353
353
|
`);for(let n of this.constraints){r.push(`
|
|
@@ -362,8 +362,8 @@ ${e}`)}function au(t,e,r,n){if((t.isLeafNode||n.commonPrefix!==!1)&&(r=r||"(empt
|
|
|
362
362
|
}
|
|
363
363
|
if (candidates === 0) return null;
|
|
364
364
|
`)}for(let n in e.strategies)e.strategies[n].mustMatchWhenDerived&&!this.constraints.includes(n)&&r.push(`if (derivedConstraints.${n} !== undefined) return null`);r.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",r.join(`
|
|
365
|
-
`))}}
|
|
366
|
-
`)).bind(this)}};L$.exports=hm});var D$=E((jX,j$)=>{"use strict";var p9=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];j$.exports=p9});var H$=E((DX,M$)=>{"use strict";function F$(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function m9(t,e){let r=!1,n=!1,s="";for(let o=1;o<t.length;o++){let a=t.charCodeAt(o);if(a===37){let l=t.charCodeAt(o+1),u=t.charCodeAt(o+2);F$(l,u)===null?r=!0:(n=!0,l===50&&u===53&&(r=!0,t=t.slice(0,o+1)+"25"+t.slice(o+1),o+=2),o+=2)}else if(a===63||a===35||a===59&&e){s=t.slice(o+1),t=t.slice(0,o);break}}return{path:r?decodeURI(t):t,querystring:s,shouldDecodeParam:n}}function g9(t){let e=t.indexOf("%");if(e===-1)return t;let r="",n=e;for(let s=e;s<t.length;s++)if(t.charCodeAt(s)===37){let i=t.charCodeAt(s+1),o=t.charCodeAt(s+2),a=F$(i,o);r+=t.slice(n,s)+a,n=s+3}return t.slice(0,e)+r+t.slice(n)}M$.exports={safeDecodeURI:m9,safeDecodeURIComponent:g9}});var Sm=E((FX,X$)=>{"use strict";var qe=V("node:assert"),y9=BT(),Hs=m$(),gm=Pi(),{prettyPrintTree:_9}=w$(),{StaticNode:V$,NODE_TYPES:z$}=C$(),S9=q$(),Ms=D$(),pm=ou(),{safeDecodeURI:U$,safeDecodeURIComponent:mm}=H$(),B$=/^https?:\/\/.*?\//,qn=/(\/:[^/()]*?)\?(\/?)/,G$=/[.*+?^${}()|[\]\\]/g,W$=/\/\/+/g;if(!Hs(B$))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!Hs(qn))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");if(!Hs(G$))throw new Error("the ESCAPE_REGEXP is not safe, update this module");if(!Hs(W$))throw new Error("the REMOVE_DUPLICATE_SLASHES_REGEXP is not safe, update this module");function Te(t){if(!(this instanceof Te))return new Te(t);t=t||{},this._opts=t,t.defaultRoute?(qe(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(qe(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(qe(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=E9,t.querystringParser?(qe(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e.length===0?{}:y9.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.constrainer=new S9(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Te.prototype.on=function(e,r,n,s,i){typeof n=="function"&&(s!==void 0&&(i=s),s=n,n={}),qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof s=="function","Handler should be a function");let o=r.match(qn);if(o){qe(r.length===o.index+o[0].length,"Optional Parameter needs to be the last parameter of the path");let u=r.replace(qn,"$1$2"),c=r.replace(qn,"$2")||"/";this.on(e,u,n,s,i),this.on(e,c,n,s,i);return}let a=r;this.ignoreDuplicateSlashes&&(r=ym(r)),this.ignoreTrailingSlash&&(r=_m(r));let l=Array.isArray(e)?e:[e];for(let u of l)qe(typeof u=="string","Method should be a string"),qe(Ms.includes(u),`Method '${u}' is not an http method.`),this._on(u,r,n,s,i,a)};Te.prototype._on=function(e,r,n,s,i){let o={};n.constraints!==void 0&&(qe(typeof n.constraints=="object"&&n.constraints!==null,"Constraints should be an object"),Object.keys(n.constraints).length!==0&&(o=n.constraints)),this.constrainer.validateConstraints(o),this.constrainer.noteUsage(o),this.trees[e]===void 0&&(this.trees[e]=new V$("/"));let a=r;if(a==="*"&&this.trees[e].prefix.length!==0){let p=this.trees[e];this.trees[e]=new V$(""),this.trees[e].staticChildren["/"]=p}let l=this.trees[e],u=l.prefix.length,c=[];for(let p=0;p<=a.length;p++){if(a.charCodeAt(p)===58&&a.charCodeAt(p+1)===58){p++;continue}let h=a.charCodeAt(p)===58&&a.charCodeAt(p+1)!==58,d=a.charCodeAt(p)===42;if(h||d||p===a.length&&p!==u){let m=a.slice(u,p);this.caseSensitive||(m=m.toLowerCase()),m=m.replaceAll("::",":"),m=m.replaceAll("%","%25"),l=l.createStaticChild(m)}if(h){let m=!1,g=!0,S="",b=[],_=p+1;for(let y=_;;y++){let R=a.charCodeAt(y),T=R===40,O=R===45||R===46,w=R===47||y===a.length;if(T||O||w){let $=a.slice(_,y);if(c.push($),m=m||T||O,T){let C=Y$(a,y),k=a.slice(y,C+1);this.allowUnsafeRegex||qe(Hs(new RegExp(k)),`The regex '${k}' is not safe!`),b.push(K$(k)),y=C+1,g=!0}else b.push(g?"(.*?)":`(${S}|(?:(?!${S}).)*)`),g=!1;let v=y;for(;y<a.length;y++){let C=a.charCodeAt(y);if(C===47)break;if(C===58)if(a.charCodeAt(y+1)===58)y++;else break}let P=a.slice(v,y);if(P&&(P=P.replaceAll("::",":"),P=P.replaceAll("%","%25"),b.push(S=J$(P))),_=y+1,w||a.charCodeAt(y)===47||y===a.length){let C=m?"()"+P:P,k=a.slice(p,y);a=a.slice(0,p+1)+C+a.slice(y),p+=C.length;let M=m?new RegExp("^"+b.join("")+"$"):null;l=l.createParametricChild(M,P||null,k),u=p+1;break}}}}else if(d&&(c.push("*"),l=l.createWildcardChild(),u=p+1,p!==a.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(a=a.toLowerCase()),a==="*"&&(a="/*");for(let p of this.routes){let h=p.opts.constraints||{};if(p.method===e&&p.pattern===a&&gm(h,o))throw new Error(`Method '${e}' already declared for route '${a}' with constraints '${JSON.stringify(o)}'`)}let f={method:e,path:r,pattern:a,params:c,opts:n,handler:s,store:i};this.routes.push(f),l.addRoute(f,this.constrainer)};Te.prototype.hasRoute=function(e,r,n){return this.findRoute(e,r,n)!==null};Te.prototype.findRoute=function(e,r,n={}){if(this.trees[e]===void 0)return null;let s=r,i=this.trees[e],o=i.prefix.length,a=[];for(let l=0;l<=s.length;l++){if(s.charCodeAt(l)===58&&s.charCodeAt(l+1)===58){l++;continue}let u=s.charCodeAt(l)===58&&s.charCodeAt(l+1)!==58,c=s.charCodeAt(l)===42;if(u||c||l===s.length&&l!==o){let f=s.slice(o,l);if(this.caseSensitive||(f=f.toLowerCase()),f=f.replaceAll("::",":"),f=f.replaceAll("%","%25"),i=i.getStaticChild(f),i===null)return null}if(u){let f=!1,p=!0,h="",d=[],m=l+1;for(let g=m;;g++){let S=s.charCodeAt(g),b=S===40,_=S===45||S===46,y=S===47||g===s.length;if(b||_||y){let R=s.slice(m,g);if(a.push(R),f=f||b||_,b){let w=Y$(s,g),$=s.slice(g,w+1);this.allowUnsafeRegex||qe(Hs(new RegExp($)),`The regex '${$}' is not safe!`),d.push(K$($)),g=w+1,p=!1}else d.push(p?"(.*?)":`(${h}|(?:(?!${h}).)*)`),p=!1;let T=g;for(;g<s.length;g++){let w=s.charCodeAt(g);if(w===47)break;if(w===58)if(s.charCodeAt(g+1)===58)g++;else break}let O=s.slice(T,g);if(O&&(O=O.replaceAll("::",":"),O=O.replaceAll("%","%25"),d.push(h=J$(O))),m=g+1,y||s.charCodeAt(g)===47||g===s.length){let w=f?"()"+O:O,$=s.slice(l,g);s=s.slice(0,l+1)+w+s.slice(g),l+=w.length;let v=f?new RegExp("^"+d.join("")+"$"):null;if(i=i.getParametricChild(v,O||null,$),i===null)return null;o=l+1;break}}}}else if(c&&(a.push("*"),i=i.getWildcardChild(),o=l+1,l!==s.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(s=s.toLowerCase());for(let l of this.routes){let u=l.opts.constraints||{};if(l.method===e&&l.pattern===s&&gm(u,n))return{handler:l.handler,store:l.store,params:l.params}}return null};Te.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)};Te.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)};Te.prototype.reset=function(){this.trees={},this.routes=[]};Te.prototype.off=function(e,r,n){qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof n>"u"||typeof n=="object"&&!Array.isArray(n)&&n!==null,"Constraints should be an object or undefined.");let s=r.match(qn);if(s){qe(r.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let o=r.replace(qn,"$1$2"),a=r.replace(qn,"$2");this.off(e,o,n),this.off(e,a,n);return}this.ignoreDuplicateSlashes&&(r=ym(r)),this.ignoreTrailingSlash&&(r=_m(r));let i=Array.isArray(e)?e:[e];for(let o of i)this._off(o,r,n)};Te.prototype._off=function(e,r,n){qe(typeof e=="string","Method should be a string"),qe(Ms.includes(e),`Method '${e}' is not an http method.`);function s(l){return e!==l.method||r!==l.path}function i(l){return s(l)||!gm(n,l.opts.constraints||{})}let o=n?i:s,a=this.routes.filter(o);this._rebuild(a)};Te.prototype.lookup=function(e,r,n,s){if(typeof n=="function"&&(s=n,n=void 0),s===void 0){let i=this.constrainer.deriveConstraints(e,n),o=this.find(e.method,e.url,i);return this.callHandler(o,e,r,n)}this.constrainer.deriveConstraints(e,n,(i,o)=>{if(i!==null){s(i);return}try{let a=this.find(e.method,e.url,o),l=this.callHandler(a,e,r,n);s(null,l)}catch(a){s(a)}})};Te.prototype.callHandler=function(e,r,n,s){return e===null?this._defaultRoute(r,n,s):s===void 0?e.handler(r,n,e.params,e.store,e.searchParams):e.handler.call(s,r,n,e.params,e.store,e.searchParams)};Te.prototype.find=function(e,r,n){let s=this.trees[e];if(s===void 0)return null;r.charCodeAt(0)!==47&&(r=r.replace(B$,"/")),this.ignoreDuplicateSlashes&&(r=ym(r));let i,o,a;try{i=U$(r,this.useSemicolonDelimiter),r=i.path,o=i.querystring,a=i.shouldDecodeParam}catch{return this._onBadUrl(r)}this.ignoreTrailingSlash&&(r=_m(r));let l=r;this.caseSensitive===!1&&(r=r.toLowerCase());let u=this.maxParamLength,c=s.prefix.length,f=[],p=r.length,h=[];for(;;){if(c===p&&s.isLeafNode){let S=s.handlerStorage.getMatchingHandler(n);if(S!==null)return{handler:S.handler,store:S.store,params:S._createParamsObject(f),searchParams:this.querystringParser(o)}}let d=s.getNextNode(r,c,h,f.length);if(d===null){if(h.length===0)return null;let S=h.pop();c=S.brotherPathIndex,f.splice(S.paramsCount),d=S.brotherNode}if(s=d,s.kind===z$.STATIC){c+=s.prefix.length;continue}if(s.kind===z$.WILDCARD){let S=l.slice(c);a&&(S=mm(S)),f.push(S),c=p;continue}let m=l.indexOf("/",c);m===-1&&(m=p);let g=l.slice(c,m);if(a&&(g=mm(g)),s.isRegex){let S=s.regex.exec(g);if(S===null)continue;for(let b=1;b<S.length;b++){let _=S[b];if(_.length>u)return null;f.push(_)}}else{if(g.length>u)return null;f.push(g)}c=m}};Te.prototype._rebuild=function(t){this.reset();for(let e of t){let{method:r,path:n,opts:s,handler:i,store:o}=e;this._on(r,n,s,i,o)}};Te.prototype._defaultRoute=function(t,e,r){if(this.defaultRoute!==null)return r===void 0?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()};Te.prototype._onBadUrl=function(t){if(this.onBadUrl===null)return null;let e=this.onBadUrl;return{handler:(r,n,s)=>e(t,r,n),params:{},store:null}};Te.prototype.prettyPrint=function(t={}){let e=t.method;t.buildPrettyMeta=this.buildPrettyMeta.bind(this);let r=null;if(e===void 0){let{version:n,host:s,...i}=this.constrainer.strategies;i[pm.name]=pm;let o=new Te({...this._opts,constraints:i}),a=this.routes.map(l=>{let u={...l.opts.constraints,[pm.name]:l.method};return{...l,method:"MERGED",opts:{constraints:u}}});o._rebuild(a),r=o.trees.MERGED}else r=this.trees[e];return r==null?"(empty tree)":_9(r,t)};for(let t in Ms){if(!Ms.hasOwnProperty(t))continue;let e=Ms[t],r=e.toLowerCase();Te.prototype[r]=function(n,s,i){return this.on(e,n,s,i)}}Te.prototype.all=function(t,e,r){this.on(Ms,t,e,r)};Te.sanitizeUrlPath=function(e,r){let n=U$(e,r);return n.shouldDecodeParam?mm(n.path):n.path};X$.exports=Te;function J$(t){return t.replace(G$,"\\$&")}function ym(t){return t.indexOf("//")!==-1?t.replace(W$,"/"):t}function _m(t){return t.length>1&&t.charCodeAt(t.length-1)===47?t.slice(0,-1):t}function K$(t){return t.charCodeAt(1)===94&&(t=t.slice(0,1)+t.slice(2)),t.charCodeAt(t.length-2)===36&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function Y$(t,e){let r=1;for(;e<t.length;){if(e++,t.charCodeAt(e)===92){e++;continue}if(t.charCodeAt(e)===41?r--:t.charCodeAt(e)===40&&r++,!r)return e}throw new TypeError('Invalid regexp expression in "'+t+'"')}function E9(t){return t?t.store?Object.assign({},t.store):{}:{}}});var Z$=E((MX,Q$)=>{"use strict";function Em(t,e,r,n){if(r===void 0){e.header("content-length","0"),n(null,null);return}if(typeof r.resume=="function"){r.on("error",i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),r.resume(),n(null,null);return}if(typeof r.getReader=="function"){r.cancel("Stream cancelled by HEAD route").catch(i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),n(null,null);return}let s=""+Buffer.byteLength(r);e.header("content-length",s),n(null,null)}function b9(t){return t==null?Em:Array.isArray(t)?[...t,Em]:[t,Em]}Q$.exports={parseHeadOnSendHandlers:b9}});var yP=E((HX,gP)=>{"use strict";var v9=Sm(),w9=La(),eP=_c(),{onRequestAbortHookRunner:R9,lifecycleHooks:tP,preParsingHookRunner:O9,onTimeoutHookRunner:T9,onRequestHookRunner:$9}=Dr(),{normalizeSchema:P9}=li(),{parseHeadOnSendHandlers:A9}=Z$(),{compileSchemasForValidation:C9,compileSchemasForSerialization:I9}=pc(),{FST_ERR_SCH_VALIDATION_BUILD:N9,FST_ERR_SCH_SERIALIZATION_BUILD:k9,FST_ERR_DUPLICATED_ROUTE:x9,FST_ERR_INVALID_URL:L9,FST_ERR_HOOK_INVALID_HANDLER:rP,FST_ERR_ROUTE_OPTIONS_NOT_OBJ:q9,FST_ERR_ROUTE_DUPLICATED_HANDLER:j9,FST_ERR_ROUTE_HANDLER_NOT_FN:nP,FST_ERR_ROUTE_MISSING_HANDLER:D9,FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:F9,FST_ERR_ROUTE_METHOD_INVALID:M9,FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:H9,FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:V9,FST_ERR_HOOK_INVALID_ASYNC_HANDLER:bm}=He(),{kRoutePrefix:z9,kSupportedHTTPMethods:Rm,kLogLevel:U9,kLogSerializers:sP,kHooks:iP,kSchemaController:B9,kOptions:oP,kReplySerializerDefault:vm,kReplyIsError:G9,kRequestPayloadStream:W9,kDisableRequestLogging:aP,kSchemaErrorFormatter:J9,kErrorHandler:lP,kHasBeenDecorated:uP,kRequestAcceptVersion:wm,kRouteByFastify:K9,kRouteContext:cP}=De(),{buildErrorHandler:Y9}=ui(),{createChildLogger:X9}=ai(),{getGenReqId:Q9}=Yl(),{FSTDEP022:Z9}=Kn(),fP=["allowUnsafeRegex","buildPrettyMeta","caseSensitive","constraints","defaultRoute","ignoreDuplicateSlashes","ignoreTrailingSlash","maxParamLength","onBadUrl","querystringParser","useSemicolonDelimiter"];function e6(t){let e=v9(t),r,n,s,i,o,a,l,u,c,f,p,h,d,m=!1;return{setup(w,$){r=$.avvio,n=$.fourOhFour,s=w.logger,i=$.hasLogger,o=$.setupResponseListeners,a=$.throwIfAlreadyStarted,h=w.exposeHeadRoutes,l=w.disableRequestLogging,typeof l=="function"&&(u=w.disableRequestLogging),c=w.routerOptions.ignoreTrailingSlash,f=w.routerOptions.ignoreDuplicateSlashes,p=Object.hasOwn(w,"return503OnClosing")?w.return503OnClosing:!0,d=$.keepAliveConnections},routing:e.lookup.bind(e),route:T,hasRoute:y,prepareRoute:_,routeHandler:O,closeRoutes:()=>{m=!0},printRoutes:e.prettyPrint.bind(e),addConstraintStrategy:g,hasConstraintStrategy:S,isAsyncConstraint:b,findRoute:R};function g(w){return a("Cannot add constraint strategy!"),e.addConstraintStrategy(w)}function S(w){return e.hasConstraintStrategy(w)}function b(){return e.constrainer.asyncStrategiesInUse.size>0}function _({method:w,url:$,options:v,handler:P,isFastify:C}){if(typeof $!="string")throw new L9(typeof $);if(!P&&typeof v=="function")P=v,v={};else if(P&&typeof P=="function"){if(Object.prototype.toString.call(v)!=="[object Object]")throw new q9(w,$);if(v.handler)throw typeof v.handler=="function"?new j9(w,$):new nP(w,$)}return v=Object.assign({},v,{method:w,url:$,path:$,handler:P||v&&v.handler}),T.call(this,{options:v,isFastify:C})}function y({options:w}){let $=w.method?.toUpperCase()??"";return e.hasRoute($,w.url||"",w.constraints)}function R(w){let $=e.find(w.method,w.url||"",w.constraints);return $?{handler:$.handler,params:$.params,searchParams:$.searchParams}:null}function T({options:w,isFastify:$}){a("Cannot add route!");let v={...w},P=v.url||v.path||"";if(!v.handler)throw new D9(v.method,P);if(v.errorHandler!==void 0&&typeof v.errorHandler!="function")throw new nP(v.method,P);mP(v.bodyLimit);let C=v.exposeHeadRoute??h,k=!1,M=!1;if(Array.isArray(v.method))for(let fe=0;fe<v.method.length;++fe)v.method[fe]=dP.call(this,v.method[fe]),hP.call(this,v.method[fe],P,v.schema),k=v.method.includes("GET"),M=v.method.includes("HEAD");else v.method=dP.call(this,v.method),hP.call(this,v.method,P,v.schema),k=v.method==="GET",M=v.method==="HEAD";let J=C&&k?{...w}:null,U=this[z9];if(P==="/"&&U.length>0&&v.method!=="HEAD")switch(v.prefixTrailingSlash){case"slash":H.call(this,{path:P,isFastify:$});break;case"no-slash":H.call(this,{path:"",isFastify:$});break;case"both":default:H.call(this,{path:"",isFastify:$}),c!==!0&&(f!==!0||!U.endsWith("/"))&&H.call(this,{path:P,prefixing:!0,isFastify:$})}else P[0]==="/"&&U.endsWith("/")?H.call(this,{path:P.slice(1),isFastify:$}):H.call(this,{path:P,isFastify:$});return this;function H({path:fe,prefixing:ze=!1,isFastify:G=!1}){let wt=U+fe;if(v.url=wt,v.path=wt,v.routePath=fe,v.prefix=U,v.logLevel=v.logLevel||this[U9],(this[sP]||v.logSerializers)&&(v.logSerializers=Object.assign(Object.create(this[sP]),v.logSerializers)),v.attachValidation==null&&(v.attachValidation=!1),ze===!1)for(let N of this[iP].onRoute)N.call(this,v);for(let N of tP)if(v&&N in v){if(Array.isArray(v[N]))for(let q of v[N]){if(typeof q!="function")throw new rP(N,Object.prototype.toString.call(q));if(N==="onSend"||N==="preSerialization"||N==="onError"||N==="preParsing"){if(q.constructor.name==="AsyncFunction"&&q.length===4)throw new bm}else if(N==="onRequestAbort"){if(q.constructor.name==="AsyncFunction"&&q.length!==1)throw new bm}else if(q.constructor.name==="AsyncFunction"&&q.length===3)throw new bm}else if(v[N]!==void 0&&typeof v[N]!="function")throw new rP(N,Object.prototype.toString.call(v[N]))}let xr=v.constraints||{},me={...v.config,url:wt,method:v.method},pe=new w9({schema:v.schema,handler:v.handler.bind(this),config:me,errorHandler:v.errorHandler,childLoggerFactory:v.childLoggerFactory,bodyLimit:v.bodyLimit,logLevel:v.logLevel,logSerializers:v.logSerializers,attachValidation:v.attachValidation,schemaErrorFormatter:v.schemaErrorFormatter,replySerializer:this[vm],validatorCompiler:v.validatorCompiler,serializerCompiler:v.serializerCompiler,exposeHeadRoute:C,prefixTrailingSlash:v.prefixTrailingSlash||"both",server:this,isFastify:G}),A=e.findRoute("HEAD",v.url,xr)!==null;try{e.on(v.method,v.url,{constraints:xr},O,pe)}catch(N){if(!pe[K9])throw N.message.includes(`Method '${v.method}' already declared for route`)?new x9(v.method,v.url):N}if(this.after((N,q)=>{pe.errorHandler=v.errorHandler?Y9(this[lP],v.errorHandler):this[lP],pe._parserOptions.limit=v.bodyLimit||null,pe.logLevel=v.logLevel,pe.logSerializers=v.logSerializers,pe.attachValidation=v.attachValidation,pe[vm]=this[vm],pe.schemaErrorFormatter=v.schemaErrorFormatter||this[J9]||pe.schemaErrorFormatter,r.once("preReady",()=>{for(let j of tP){let ue=this[iP][j].concat(v[j]||[]).map(de=>de.bind(this));pe[j]=ue.length?ue:null}for(;!pe.Request[uP]&&pe.Request.parent;)pe.Request=pe.Request.parent;for(;!pe.Reply[uP]&&pe.Reply.parent;)pe.Reply=pe.Reply.parent;if(n.setContext(this,pe),v.schema){pe.schema=P9(pe.schema,this.initialConfig);let j=this[B9],ue=v.schema.body||v.schema.headers||v.schema.querystring||v.schema.params;!v.validatorCompiler&&ue&&j.setupValidator(this[oP]);try{let de=typeof v?.validatorCompiler=="function"||j.isCustomValidatorCompiler;C9(pe,v.validatorCompiler||j.validatorCompiler,de)}catch(de){throw new N9(v.method,wt,de.message)}v.schema.response&&!v.serializerCompiler&&j.setupSerializer(this[oP]);try{I9(pe,v.serializerCompiler||j.serializerCompiler)}catch(de){throw new k9(v.method,wt,de.message)}}}),q(N)}),C&&k&&!M&&!A){let N=A9(J.onSend);_.call(this,{method:"HEAD",url:fe,options:{...J,onSend:N},isFastify:!0})}}}function O(w,$,v,P,C){let k=Q9(P.server,w),M={level:P.logLevel};P.logSerializers&&(M.serializers=P.logSerializers);let J=X9(P,s,w,k,M);if(J[aP]=u?!1:l,m===!0&&(w.httpVersionMajor!==2&&$.setHeader("Connection","close"),p)){let G={"Content-Type":"application/json","Content-Length":"80"};$.writeHead(503,G),$.end('{"error":"Service Unavailable","message":"Service Unavailable","statusCode":503}'),J.info({res:{statusCode:503}},"request aborted - refusing to accept new requests as server is closing");return}String.prototype.toLowerCase.call(w.headers.connection||"")==="keep-alive"&&d.has(w.socket)===!1&&(d.add(w.socket),w.socket.on("close",s6.bind({keepAliveConnections:d,socket:w.socket}))),w.headers[wm]!==void 0&&(w.headers["accept-version"]=w.headers[wm],w.headers[wm]=void 0);let H=new P.Request(k,v,w,C,J,P),fe=new P.Reply($,H,J),ze=u?u(H):l;J[aP]=ze,ze===!1&&J.info({req:H},"incoming request"),(i===!0||P.onResponse!==null)&&o(fe),P.onRequest!==null?$9(P.onRequest,H,fe,pP):pP(null,H,fe),P.onRequestAbort!==null&&w.on("close",()=>{w.aborted&&R9(P.onRequestAbort,H,t6.bind(null,fe))}),P.onTimeout!==null&&(H.raw.socket._meta||H.raw.socket.on("timeout",r6),H.raw.socket._meta={context:P,request:H,reply:fe})}}function t6(t,e){e&&t.log.error({err:e},"onRequestAborted hook failed")}function r6(){let{context:t,request:e,reply:r}=this._meta;T9(t.onTimeout,e,r,i6)}function dP(t){if(typeof t!="string")throw new M9;if(t=t.toUpperCase(),!this[Rm].bodyless.has(t)&&!this[Rm].bodywith.has(t))throw new F9(t);return t}function hP(t,e,r){if(this[Rm].bodyless.has(t)&&r?.body)throw new H9(t,e)}function mP(t){if(t!==void 0&&(!Number.isInteger(t)||t<=0))throw new V9(t)}function pP(t,e,r){if(r.sent!==!0){if(t!=null){r[G9]=!0,r.send(t);return}e[W9]=e.raw,e[cP].preParsing!==null?O9(e[cP].preParsing,e,r,eP.bind(e.server)):eP.call(e.server,null,e,r)}}function n6(t,e){let r=t.routerOptions||Object.create(null),n=fP.filter(s=>Object.hasOwn(t,s));n.length>0&&Z9(n.join(", "));for(let s of fP)Object.hasOwn(r,s)||(r[s]=t[s]??e[s]);return r}function s6(){this.keepAliveConnections.delete(this.socket)}function i6(){}gP.exports={buildRouting:e6,validateBodyLimitOption:mP,buildRouterOptions:n6}});var RP=E((VX,wP)=>{"use strict";var o6=Sm(),_P=Pa(),SP=xa(),a6=La(),{kRoutePrefix:l6,kCanSetNotFoundHandler:So,kFourOhFourLevelInstance:Eo,kFourOhFourContext:mr,kHooks:u6,kErrorHandler:EP}=De(),{lifecycleHooks:c6}=Dr(),{buildErrorHandler:f6}=ui(),{FST_ERR_NOT_FOUND:d6}=He(),{createChildLogger:bP}=ai(),{getGenReqId:vP}=Yl();function h6(t){let{logger:e,disableRequestLogging:r}=t,n=o6({onBadUrl:a(),defaultRoute:f}),s=null;return{router:n,setNotFoundHandler:u,setContext:l,arrange404:i};function i(p){p[Eo]=p,p[So]=!0,n.onBadUrl=n.onBadUrl.bind(p),n.defaultRoute=n.defaultRoute.bind(p)}function o(p,h){let{url:d,method:m}=p.raw,g=`Route ${m}:${d} not found`;(typeof r=="function"?r(p.raw):r)||p.log.info(g),h.code(404).send({message:g,error:"Not Found",statusCode:404})}function a(){return function(h,d,m){let g=this[Eo][mr],S=vP(g.server,d),b=bP(g,e,d,S),_=new SP(S,null,d,null,b,g),y=new _P(m,_,b);s(_,y)}}function l(p,h){let d=Object.assign({},p[mr]);d.onSend=h.onSend,h[mr]=d}function u(p,h,d,m){this[So]===void 0&&(this[So]=!0),this[mr]===void 0&&(this[mr]=null);let g=this,S=this[l6]||"/";if(this[So]===!1)throw new Error(`Not found handler already set for Fastify instance with prefix: '${S}'`);typeof p=="object"&&(p.preHandler&&(Array.isArray(p.preHandler)?p.preHandler=p.preHandler.map(b=>b.bind(g)):p.preHandler=p.preHandler.bind(g)),p.preValidation&&(Array.isArray(p.preValidation)?p.preValidation=p.preValidation.map(b=>b.bind(g)):p.preValidation=p.preValidation.bind(g))),typeof p=="function"&&(h=p,p=void 0),p=p||{},h?(this[Eo][So]=!1,h=h.bind(this),s=h):(h=o,s=o),this.after((b,_)=>{c.call(this,S,p,h,d,m),_(b)})}function c(p,h,d,m,g){let S=new a6({schema:h.schema,handler:d,config:h.config||{},server:this});if(m.once("preReady",()=>{let b=this[mr];for(let _ of c6){let y=this[u6][_].concat(h[_]||[]).map(R=>R.bind(this));b[_]=y.length?y:null}b.errorHandler=h.errorHandler?f6(this[EP],h.errorHandler):this[EP]}),this[mr]!==null&&p==="/"){Object.assign(this[mr],S);return}this[Eo][mr]=S,n.all(p+(p.endsWith("/")?"*":"/*"),g,S),n.all(p,g,S)}function f(p,h){let d=this[Eo][mr],m=vP(d.server,p),g=bP(d,e,p,m);g.info({req:p},"incoming request");let S=new SP(m,null,p,null,g,d),b=new _P(h,S,g);S.log.warn("the default handler for 404 did not catch this, this is likely a fastify bug, please report it"),S.log.warn(n.prettyPrint()),b.code(404).send(new d6)}}wP.exports=h6});var OP=E((zX,pu)=>{"use strict";pu.exports=ae;pu.exports.default=ae;var p6={type:"object",additionalProperties:!1,properties:{connectionTimeout:{type:"integer",default:0},keepAliveTimeout:{type:"integer",default:72e3},forceCloseConnections:{oneOf:[{type:"string",pattern:"idle"},{type:"boolean"}]},maxRequestsPerSocket:{type:"integer",default:0,nullable:!0},requestTimeout:{type:"integer",default:0},bodyLimit:{type:"integer",default:1048576},caseSensitive:{type:"boolean",default:!0},allowUnsafeRegex:{type:"boolean",default:!1},http2:{type:"boolean"},https:{if:{not:{oneOf:[{type:"boolean"},{type:"null"},{type:"object",additionalProperties:!1,required:["allowHTTP1"],properties:{allowHTTP1:{type:"boolean"}}}]}},then:{setDefaultValue:!0}},ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},disableRequestLogging:{default:!1},maxParamLength:{type:"integer",default:100},onProtoPoisoning:{type:"string",default:"error"},onConstructorPoisoning:{type:"string",default:"error"},pluginTimeout:{type:"integer",default:1e4},requestIdHeader:{anyOf:[{type:"boolean"},{type:"string"}],default:!1},requestIdLogLabel:{type:"string",default:"reqId"},http2SessionTimeout:{type:"integer",default:72e3},exposeHeadRoutes:{type:"boolean",default:!0},useSemicolonDelimiter:{type:"boolean",default:!1},routerOptions:{type:"object",additionalProperties:!0,properties:{ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},maxParamLength:{type:"integer",default:100},allowUnsafeRegex:{type:"boolean",default:!1},useSemicolonDelimiter:{type:"boolean",default:!1}}},constraints:{type:"object",additionalProperties:{type:"object",required:["name","storage","validate","deriveConstraint"],additionalProperties:!0,properties:{name:{type:"string"},storage:{},validate:{},deriveConstraint:{}}}}}},m6=Object.prototype.hasOwnProperty,g6=new RegExp("idle","u");function ae(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){t.connectionTimeout===void 0&&(t.connectionTimeout=0),t.keepAliveTimeout===void 0&&(t.keepAliveTimeout=72e3),t.maxRequestsPerSocket===void 0&&(t.maxRequestsPerSocket=0),t.requestTimeout===void 0&&(t.requestTimeout=0),t.bodyLimit===void 0&&(t.bodyLimit=1048576),t.caseSensitive===void 0&&(t.caseSensitive=!0),t.allowUnsafeRegex===void 0&&(t.allowUnsafeRegex=!1),t.ignoreTrailingSlash===void 0&&(t.ignoreTrailingSlash=!1),t.ignoreDuplicateSlashes===void 0&&(t.ignoreDuplicateSlashes=!1),t.disableRequestLogging===void 0&&(t.disableRequestLogging=!1),t.maxParamLength===void 0&&(t.maxParamLength=100),t.onProtoPoisoning===void 0&&(t.onProtoPoisoning="error"),t.onConstructorPoisoning===void 0&&(t.onConstructorPoisoning="error"),t.pluginTimeout===void 0&&(t.pluginTimeout=1e4),t.requestIdHeader===void 0&&(t.requestIdHeader=!1),t.requestIdLogLabel===void 0&&(t.requestIdLogLabel="reqId"),t.http2SessionTimeout===void 0&&(t.http2SessionTimeout=72e3),t.exposeHeadRoutes===void 0&&(t.exposeHeadRoutes=!0),t.useSemicolonDelimiter===void 0&&(t.useSemicolonDelimiter=!1);let m=o;for(let g in t)m6.call(p6.properties,g)||delete t[g];if(m===o){let g=t.connectionTimeout,S=o;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let b=typeof g,_;if(_===void 0)if(b==="boolean"||g===null||b==="string"&&g&&g==+g&&!(g%1))_=+g;else return ae.errors=[{instancePath:e+"/connectionTimeout",schemaPath:"#/properties/connectionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;_!==void 0&&(g=_,t!==void 0&&(t.connectionTimeout=_))}var a=S===o;if(a){let b=t.keepAliveTimeout,_=o;if(!(typeof b=="number"&&!(b%1)&&!isNaN(b)&&isFinite(b))){let R=typeof b,T;if(T===void 0)if(R==="boolean"||b===null||R==="string"&&b&&b==+b&&!(b%1))T=+b;else return ae.errors=[{instancePath:e+"/keepAliveTimeout",schemaPath:"#/properties/keepAliveTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;T!==void 0&&(b=T,t!==void 0&&(t.keepAliveTimeout=T))}var a=_===o;if(a){if(t.forceCloseConnections!==void 0){let R=t.forceCloseConnections,T=o,O=o,w=!1,$=null,v=o;if(typeof R!="string"){let k=typeof R,M;if(M===void 0)if(k=="number"||k=="boolean")M=""+R;else if(R===null)M="";else{let J={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[J]:i.push(J),o++}M!==void 0&&(R=M,t!==void 0&&(t.forceCloseConnections=M))}if(o===v&&typeof R=="string"&&!g6.test(R)){let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/pattern",keyword:"pattern",params:{pattern:"idle"},message:'must match pattern "idle"'};i===null?i=[k]:i.push(k),o++}var l=v===o;l&&(w=!0,$=0);let P=o;if(typeof R!="boolean"){let k;if(k===void 0)if(R==="false"||R===0||R===null)k=!1;else if(R==="true"||R===1)k=!0;else{let M={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/1/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(R=k,t!==void 0&&(t.forceCloseConnections=k))}var l=P===o;if(l&&w?(w=!1,$=[$,1]):l&&(w=!0,$=1),w)o=O,i!==null&&(O?i.length=O:i=null);else{let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf",keyword:"oneOf",params:{passingSchemas:$},message:"must match exactly one schema in oneOf"};return i===null?i=[k]:i.push(k),o++,ae.errors=i,!1}var a=T===o}else var a=!0;if(a){let R=t.maxRequestsPerSocket,T=o;if(!(typeof R=="number"&&!(R%1)&&!isNaN(R)&&isFinite(R))&&R!==null){let w=typeof R,$;if($===void 0)if(w==="boolean"||R===null||w==="string"&&R&&R==+R&&!(R%1))$=+R;else if(R===""||R===0||R===!1)$=null;else return ae.errors=[{instancePath:e+"/maxRequestsPerSocket",schemaPath:"#/properties/maxRequestsPerSocket/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;$!==void 0&&(R=$,t!==void 0&&(t.maxRequestsPerSocket=$))}var a=T===o;if(a){let w=t.requestTimeout,$=o;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){let P=typeof w,C;if(C===void 0)if(P==="boolean"||w===null||P==="string"&&w&&w==+w&&!(w%1))C=+w;else return ae.errors=[{instancePath:e+"/requestTimeout",schemaPath:"#/properties/requestTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;C!==void 0&&(w=C,t!==void 0&&(t.requestTimeout=C))}var a=$===o;if(a){let P=t.bodyLimit,C=o;if(!(typeof P=="number"&&!(P%1)&&!isNaN(P)&&isFinite(P))){let M=typeof P,J;if(J===void 0)if(M==="boolean"||P===null||M==="string"&&P&&P==+P&&!(P%1))J=+P;else return ae.errors=[{instancePath:e+"/bodyLimit",schemaPath:"#/properties/bodyLimit/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;J!==void 0&&(P=J,t!==void 0&&(t.bodyLimit=J))}var a=C===o;if(a){let M=t.caseSensitive,J=o;if(typeof M!="boolean"){let H;if(H===void 0)if(M==="false"||M===0||M===null)H=!1;else if(M==="true"||M===1)H=!0;else return ae.errors=[{instancePath:e+"/caseSensitive",schemaPath:"#/properties/caseSensitive/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;H!==void 0&&(M=H,t!==void 0&&(t.caseSensitive=H))}var a=J===o;if(a){let H=t.allowUnsafeRegex,fe=o;if(typeof H!="boolean"){let G;if(G===void 0)if(H==="false"||H===0||H===null)G=!1;else if(H==="true"||H===1)G=!0;else return ae.errors=[{instancePath:e+"/allowUnsafeRegex",schemaPath:"#/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;G!==void 0&&(H=G,t!==void 0&&(t.allowUnsafeRegex=G))}var a=fe===o;if(a){if(t.http2!==void 0){let G=t.http2,wt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/http2",schemaPath:"#/properties/http2/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.http2=me))}var a=wt===o}else var a=!0;if(a){if(t.https!==void 0){let G=t.https,wt=o,xr=o,me=!0,pe=o,Hn=o,A=o,N=o,q=!1,j=null,ue=o;if(typeof G!="boolean"){let Y;if(Y===void 0)if(G==="false"||G===0||G===null)Y=!1;else if(G==="true"||G===1)Y=!0;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=ue===o;u&&(q=!0,j=0);let de=o;if(G!==null){let Y;if(Y===void 0)if(G===""||G===0||G===!1)Y=null;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=de===o;if(u&&q)q=!1,j=[j,1];else{u&&(q=!0,j=1);let Y=o;if(o===Y)if(G&&typeof G=="object"&&!Array.isArray(G)){let Pe;if(G.allowHTTP1===void 0&&(Pe="allowHTTP1")){let dt={};i===null?i=[dt]:i.push(dt),o++}else{let dt=o;for(let Xt in G)Xt!=="allowHTTP1"&&delete G[Xt];if(dt===o&&G.allowHTTP1!==void 0){let Xt=G.allowHTTP1;if(typeof Xt!="boolean"){let Ae;if(Ae===void 0)if(Xt==="false"||Xt===0||Xt===null)Ae=!1;else if(Xt==="true"||Xt===1)Ae=!0;else{let Qt={};i===null?i=[Qt]:i.push(Qt),o++}Ae!==void 0&&(Xt=Ae,G!==void 0&&(G.allowHTTP1=Ae))}}}}else{let Pe={};i===null?i=[Pe]:i.push(Pe),o++}var u=Y===o;u&&q?(q=!1,j=[j,2]):u&&(q=!0,j=2)}if(q)o=N,i!==null&&(N?i.length=N:i=null);else{let Y={};i===null?i=[Y]:i.push(Y),o++}var c=A===o;if(c){let Y={};i===null?i=[Y]:i.push(Y),o++}else o=Hn,i!==null&&(Hn?i.length=Hn:i=null);var f=pe===o;if(o=xr,i!==null&&(xr?i.length=xr:i=null),f){let Y=o;t.https=!0;var f=Y===o;me=f}if(!me){let Y={instancePath:e+"/https",schemaPath:"#/properties/https/if",keyword:"if",params:{failingKeyword:"then"},message:'must match "then" schema'};return i===null?i=[Y]:i.push(Y),o++,ae.errors=i,!1}var a=wt===o}else var a=!0;if(a){let G=t.ignoreTrailingSlash,wt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/ignoreTrailingSlash",schemaPath:"#/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.ignoreTrailingSlash=me))}var a=wt===o;if(a){let me=t.ignoreDuplicateSlashes,pe=o;if(typeof me!="boolean"){let A;if(A===void 0)if(me==="false"||me===0||me===null)A=!1;else if(me==="true"||me===1)A=!0;else return ae.errors=[{instancePath:e+"/ignoreDuplicateSlashes",schemaPath:"#/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;A!==void 0&&(me=A,t!==void 0&&(t.ignoreDuplicateSlashes=A))}var a=pe===o;if(a){let A=t.maxParamLength,N=o;if(!(typeof A=="number"&&!(A%1)&&!isNaN(A)&&isFinite(A))){let j=typeof A,ue;if(ue===void 0)if(j==="boolean"||A===null||j==="string"&&A&&A==+A&&!(A%1))ue=+A;else return ae.errors=[{instancePath:e+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;ue!==void 0&&(A=ue,t!==void 0&&(t.maxParamLength=ue))}var a=N===o;if(a){let j=t.onProtoPoisoning,ue=o;if(typeof j!="string"){let Me=typeof j,Y;if(Y===void 0)if(Me=="number"||Me=="boolean")Y=""+j;else if(j===null)Y="";else return ae.errors=[{instancePath:e+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Y!==void 0&&(j=Y,t!==void 0&&(t.onProtoPoisoning=Y))}var a=ue===o;if(a){let Me=t.onConstructorPoisoning,Y=o;if(typeof Me!="string"){let Pe=typeof Me,dt;if(dt===void 0)if(Pe=="number"||Pe=="boolean")dt=""+Me;else if(Me===null)dt="";else return ae.errors=[{instancePath:e+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;dt!==void 0&&(Me=dt,t!==void 0&&(t.onConstructorPoisoning=dt))}var a=Y===o;if(a){let Pe=t.pluginTimeout,dt=o;if(!(typeof Pe=="number"&&!(Pe%1)&&!isNaN(Pe)&&isFinite(Pe))){let Ae=typeof Pe,Qt;if(Qt===void 0)if(Ae==="boolean"||Pe===null||Ae==="string"&&Pe&&Pe==+Pe&&!(Pe%1))Qt=+Pe;else return ae.errors=[{instancePath:e+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;Qt!==void 0&&(Pe=Qt,t!==void 0&&(t.pluginTimeout=Qt))}var a=dt===o;if(a){let Ae=t.requestIdHeader,Qt=o,Lu=o,Vn=!1,kA=o;if(typeof Ae!="boolean"){let Ue;if(Ue===void 0)if(Ae==="false"||Ae===0||Ae===null)Ue=!1;else if(Ae==="true"||Ae===1)Ue=!0;else{let No={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[No]:i.push(No),o++}Ue!==void 0&&(Ae=Ue,t!==void 0&&(t.requestIdHeader=Ue))}var p=kA===o;if(Vn=Vn||p,!Vn){let Ue=o;if(typeof Ae!="string"){let rg=typeof Ae,Ce;if(Ce===void 0)if(rg=="number"||rg=="boolean")Ce=""+Ae;else if(Ae===null)Ce="";else{let Ht={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[Ht]:i.push(Ht),o++}Ce!==void 0&&(Ae=Ce,t!==void 0&&(t.requestIdHeader=Ce))}var p=Ue===o;Vn=Vn||p}if(Vn)o=Lu,i!==null&&(Lu?i.length=Lu:i=null);else{let Ue={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[Ue]:i.push(Ue),o++,ae.errors=i,!1}var a=Qt===o;if(a){let Ue=t.requestIdLogLabel,No=o;if(typeof Ue!="string"){let Ce=typeof Ue,Ht;if(Ht===void 0)if(Ce=="number"||Ce=="boolean")Ht=""+Ue;else if(Ue===null)Ht="";else return ae.errors=[{instancePath:e+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Ht!==void 0&&(Ue=Ht,t!==void 0&&(t.requestIdLogLabel=Ht))}var a=No===o;if(a){let Ce=t.http2SessionTimeout,Ht=o;if(!(typeof Ce=="number"&&!(Ce%1)&&!isNaN(Ce)&&isFinite(Ce))){let Zt=typeof Ce,un;if(un===void 0)if(Zt==="boolean"||Ce===null||Zt==="string"&&Ce&&Ce==+Ce&&!(Ce%1))un=+Ce;else return ae.errors=[{instancePath:e+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;un!==void 0&&(Ce=un,t!==void 0&&(t.http2SessionTimeout=un))}var a=Ht===o;if(a){let Zt=t.exposeHeadRoutes,un=o;if(typeof Zt!="boolean"){let ht;if(ht===void 0)if(Zt==="false"||Zt===0||Zt===null)ht=!1;else if(Zt==="true"||Zt===1)ht=!0;else return ae.errors=[{instancePath:e+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;ht!==void 0&&(Zt=ht,t!==void 0&&(t.exposeHeadRoutes=ht))}var a=un===o;if(a){let ht=t.useSemicolonDelimiter,xA=o;if(typeof ht!="boolean"){let Q;if(Q===void 0)if(ht==="false"||ht===0||ht===null)Q=!1;else if(ht==="true"||ht===1)Q=!0;else return ae.errors=[{instancePath:e+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Q!==void 0&&(ht=Q,t!==void 0&&(t.useSemicolonDelimiter=Q))}var a=xA===o;if(a){if(t.routerOptions!==void 0){let Q=t.routerOptions,Bs=o;if(o===Bs)if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Q.ignoreTrailingSlash===void 0&&(Q.ignoreTrailingSlash=!1),Q.ignoreDuplicateSlashes===void 0&&(Q.ignoreDuplicateSlashes=!1),Q.maxParamLength===void 0&&(Q.maxParamLength=100),Q.allowUnsafeRegex===void 0&&(Q.allowUnsafeRegex=!1),Q.useSemicolonDelimiter===void 0&&(Q.useSemicolonDelimiter=!1);let Pt=Q.ignoreTrailingSlash,Rt=o;if(typeof Pt!="boolean"){let Be;if(Be===void 0)if(Pt==="false"||Pt===0||Pt===null)Be=!1;else if(Pt==="true"||Pt===1)Be=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Be!==void 0&&(Pt=Be,Q!==void 0&&(Q.ignoreTrailingSlash=Be))}var h=Rt===o;if(h){let Be=Q.ignoreDuplicateSlashes,Lr=o;if(typeof Be!="boolean"){let Ie;if(Ie===void 0)if(Be==="false"||Be===0||Be===null)Ie=!1;else if(Be==="true"||Be===1)Ie=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Ie!==void 0&&(Be=Ie,Q!==void 0&&(Q.ignoreDuplicateSlashes=Ie))}var h=Lr===o;if(h){let Ie=Q.maxParamLength,qr=o;if(!(typeof Ie=="number"&&!(Ie%1)&&!isNaN(Ie)&&isFinite(Ie))){let er=typeof Ie,cn;if(cn===void 0)if(er==="boolean"||Ie===null||er==="string"&&Ie&&Ie==+Ie&&!(Ie%1))cn=+Ie;else return ae.errors=[{instancePath:e+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;cn!==void 0&&(Ie=cn,Q!==void 0&&(Q.maxParamLength=cn))}var h=qr===o;if(h){let er=Q.allowUnsafeRegex,cn=o;if(typeof er!="boolean"){let pt;if(pt===void 0)if(er==="false"||er===0||er===null)pt=!1;else if(er==="true"||er===1)pt=!0;else return ae.errors=[{instancePath:e+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;pt!==void 0&&(er=pt,Q!==void 0&&(Q.allowUnsafeRegex=pt))}var h=cn===o;if(h){let pt=Q.useSemicolonDelimiter,LA=o;if(typeof pt!="boolean"){let zn;if(zn===void 0)if(pt==="false"||pt===0||pt===null)zn=!1;else if(pt==="true"||pt===1)zn=!0;else return ae.errors=[{instancePath:e+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;zn!==void 0&&(pt=zn,Q!==void 0&&(Q.useSemicolonDelimiter=zn))}var h=LA===o}}}}}else return ae.errors=[{instancePath:e+"/routerOptions",schemaPath:"#/properties/routerOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Bs===o}else var a=!0;if(a)if(t.constraints!==void 0){let Q=t.constraints,Bs=o;if(o===Bs)if(Q&&typeof Q=="object"&&!Array.isArray(Q))for(let Pt in Q){let Rt=Q[Pt],Be=o;if(o===Be)if(Rt&&typeof Rt=="object"&&!Array.isArray(Rt)){let Lr;if(Rt.name===void 0&&(Lr="name")||Rt.storage===void 0&&(Lr="storage")||Rt.validate===void 0&&(Lr="validate")||Rt.deriveConstraint===void 0&&(Lr="deriveConstraint"))return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty:Lr},message:"must have required property '"+Lr+"'"}],!1;if(Rt.name!==void 0){let Gs=Rt.name;if(typeof Gs!="string"){let Ie=typeof Gs,qr;if(qr===void 0)if(Ie=="number"||Ie=="boolean")qr=""+Gs;else if(Gs===null)qr="";else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;qr!==void 0&&(Gs=qr,Rt!==void 0&&(Rt.name=qr))}}}else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var d=Be===o;if(!d)break}else return ae.errors=[{instancePath:e+"/constraints",schemaPath:"#/properties/constraints/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Bs===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}else return ae.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ae.errors=i,o===0}pu.exports.defaultInitOptions={connectionTimeout:0,keepAliveTimeout:72e3,maxRequestsPerSocket:0,requestTimeout:0,bodyLimit:1048576,caseSensitive:!0,allowUnsafeRegex:!1,disableRequestLogging:!1,ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,onProtoPoisoning:"error",onConstructorPoisoning:"error",pluginTimeout:1e4,requestIdHeader:!1,requestIdLogLabel:"reqId",http2SessionTimeout:72e3,exposeHeadRoutes:!0,useSemicolonDelimiter:!1,allowErrorHandlerOverride:!0,routerOptions:{ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,allowUnsafeRegex:!1,useSemicolonDelimiter:!1}}});var TP=E((UX,gu)=>{"use strict";var mu=OP(),y6=ga()({circles:!0,proto:!1}),{FST_ERR_INIT_OPTS_INVALID:_6}=He();function S6(t){let e=y6(t);if(!mu(e)){let r=new _6(JSON.stringify(mu.errors.map(n=>n.message)));throw r.errors=mu.errors,r}return Om(e)}function Om(t){let e=Object.getOwnPropertyNames(t);for(let r of e){let n=t[r];ArrayBuffer.isView(n)&&!(n instanceof DataView)||(t[r]=n&&typeof n=="object"?Om(n):n)}return Object.freeze(t)}gu.exports=S6;gu.exports.defaultInitOptions=mu.defaultInitOptions;gu.exports.utils={deepFreezeObject:Om}});var LP=E((BX,xP)=>{"use strict";var{kAvvioBoot:E6,kChildren:$P,kRoutePrefix:PP,kLogLevel:AP,kLogSerializers:Tm,kHooks:$m,kSchemaController:Vs,kContentTypeParser:CP,kReply:IP,kRequest:NP,kFourOhFour:b6,kPluginNameChain:kP,kErrorHandlerAlreadySet:v6}=De(),w6=Pa(),R6=xa(),O6=Ip(),T6=Mf(),{buildHooks:$6}=Dr(),bo=rm();xP.exports=function(e,r,n){let s=bo.registerPlugin.call(e,r),i=bo.getPluginName(r)||bo.getFuncPreview(r);if(s)return e[kP].push(i),e;let o=Object.create(e);e[$P].push(o),o.ready=e[E6].bind(o),o[$P]=[],o[IP]=w6.buildReply(o[IP]),o[NP]=R6.buildRequest(o[NP]),o[CP]=T6.helpers.buildContentTypeParser(o[CP]),o[$m]=$6(o[$m]),o[PP]=P6(o[PP],n.prefix),o[AP]=n.logLevel||o[AP],o[Vs]=O6.buildSchemaController(e[Vs]),o.getSchema=o[Vs].getSchema.bind(o[Vs]),o.getSchemas=o[Vs].getSchemas.bind(o[Vs]),o[bo.kRegisteredPlugins]=Object.create(o[bo.kRegisteredPlugins]),o[kP]=[i],o[v6]=!1,(o[Tm]||n.logSerializers)&&(o[Tm]=Object.assign(Object.create(o[Tm]),n.logSerializers)),n.prefix&&o[b6].arrange404(o);for(let a of o[$m].onRegister)a.call(e,o,n);return o};function P6(t,e){return e?(t.endsWith("/")&&e[0]==="/"?e=e.slice(1):e[0]!=="/"&&(e="/"+e),t+e):t}});var MP=E(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.parseCookie=DP;gr.parse=DP;gr.stringifyCookie=x6;gr.stringifySetCookie=yu;gr.serialize=yu;gr.parseSetCookie=L6;gr.stringifySetCookie=yu;gr.serialize=yu;var qP=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,jP=/^[\u0021-\u003A\u003C-\u007E]*$/,A6=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,C6=/^[\u0020-\u003A\u003D-\u007E]*$/,I6=/^-?\d+$/,N6=Object.prototype.toString,k6=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function DP(t,e){let r=new k6,n=t.length;if(n<2)return r;let s=e?.decode||FP,i=0;do{let o=Am(t,i,n);if(o===-1)break;let a=Pm(t,i,n);if(o>a){i=t.lastIndexOf(";",o-1)+1;continue}let l=nn(t,i,o);r[l]===void 0&&(r[l]=s(nn(t,o+1,a))),i=a+1}while(i<n);return r}function x6(t,e){let r=e?.encode||encodeURIComponent,n=[];for(let s of Object.keys(t)){let i=t[s];if(i===void 0)continue;if(!qP.test(s))throw new TypeError(`cookie name is invalid: ${s}`);let o=r(i);if(!jP.test(o))throw new TypeError(`cookie val is invalid: ${i}`);n.push(`${s}=${o}`)}return n.join("; ")}function yu(t,e,r){let n=typeof t=="object"?t:{...r,name:t,value:String(e)},i=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!qP.test(n.name))throw new TypeError(`argument name is invalid: ${n.name}`);let o=n.value?i(n.value):"";if(!jP.test(o))throw new TypeError(`argument val is invalid: ${n.value}`);let a=n.name+"="+o;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!A6.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!C6.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!q6(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}return a}function L6(t,e){let r=e?.decode||FP,n=t.length,s=Pm(t,0,n),i=Am(t,0,s),o=i===-1?{name:"",value:r(nn(t,0,s))}:{name:nn(t,0,i),value:r(nn(t,i+1,s))},a=s+1;for(;a<n;){let l=Pm(t,a,n),u=Am(t,a,l),c=u===-1?nn(t,a,l):nn(t,a,u),f=u===-1?void 0:nn(t,u+1,l);switch(c.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=f;break;case"path":o.path=f;break;case"max-age":f&&I6.test(f)&&(o.maxAge=Number(f));break;case"expires":if(!f)break;let p=new Date(f);Number.isFinite(p.valueOf())&&(o.expires=p);break;case"priority":if(!f)break;let h=f.toLowerCase();(h==="low"||h==="medium"||h==="high")&&(o.priority=h);break;case"samesite":if(!f)break;let d=f.toLowerCase();(d==="lax"||d==="strict"||d==="none")&&(o.sameSite=d);break}a=l+1}return o}function Pm(t,e,r){let n=t.indexOf(";",e);return n===-1?r:n}function Am(t,e,r){let n=t.indexOf("=",e);return n<r?n:-1}function nn(t,e,r){let n=e,s=r;do{let i=t.charCodeAt(n);if(i!==32&&i!==9)break}while(++n<s);for(;s>n;){let i=t.charCodeAt(s-1);if(i!==32&&i!==9)break;s--}return t.slice(n,s)}function FP(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function q6(t){return N6.call(t)==="[object Date]"}});var VP=E((WX,_u)=>{"use strict";var{format:Cm}=V("node:util");function j6(t){return HP({...t,name:"DeprecationWarning"})}function HP({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=Cm(r,o,a,l):o&&a?u=Cm(r,o,a):o?u=Cm(r,o):u=r,u},i}var Im={createWarning:HP,createDeprecation:j6};_u.exports=Im;_u.exports.default=Im;_u.exports.processWarning=Im});var BP=E((JX,UP)=>{"use strict";var{URL:zP}=V("node:url"),Nm="http://localhost";UP.exports=function(e,r){(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]")&&e.startsWith("//")&&(e=Nm+e);let n=typeof e=="object"?Object.assign(new zP(Nm),e):new zP(e,Nm);if(typeof r=="string"){r=new URLSearchParams(r);for(let s of r.keys()){n.searchParams.delete(s);for(let i of r.getAll(s))n.searchParams.append(s,i)}}else{let s=Object.assign({},e.query,r);for(let i in s){let o=s[i];if(Array.isArray(o)){n.searchParams.delete(i);for(let a of o)n.searchParams.append(i,a)}else n.searchParams.set(i,o)}}return n}});var GP=E((KX,km)=>{"use strict";var{randomUUID:D6}=V("node:crypto"),{Readable:F6}=V("node:stream"),zs;function M6(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}function H6(t){zs=zs??new TextEncoder;let e=`----formdata-${D6()}`,r=`--${e}\r
|
|
365
|
+
`))}};A$.exports=dm});var N$=E((zX,I$)=>{"use strict";var f9=C$(),hu={STATIC:0,PARAMETRIC:1,WILDCARD:2},lu=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,r){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new f9),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(r,e)}},uu=class extends lu{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,r){let n=this.staticChildren[e.charAt(r)];return n===void 0||!n.matchPrefix(e,r)?null:n}getStaticChild(e,r=0){if(e.length===r)return this;let n=this.findStaticMatchingChild(e,r);return n?n.getStaticChild(e,r+n.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let r=this.staticChildren[e.charAt(0)];if(r){let s=1;for(;s<r.prefix.length;s++)if(e.charCodeAt(s)!==r.prefix.charCodeAt(s)){r=r.split(this,s);break}return r.createStaticChild(e.slice(s))}let n=e.charAt(0);return this.staticChildren[n]=new cu(e),this.staticChildren[n]}},cu=class t extends uu{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=hu.STATIC,this._compilePrefixMatch()}getParametricChild(e){let r=e&&e.source,n=this.parametricChildren.find(s=>(s.regex&&s.regex.source)===r);return n||null}createParametricChild(e,r,n){let s=this.getParametricChild(e);return s?(s.nodePaths.add(n),s):(s=new fu(e,r,n),this.parametricChildren.push(s),this.parametricChildren.sort((i,o)=>i.isRegex?o.isRegex?i.staticSuffix===null?1:o.staticSuffix===null?-1:o.staticSuffix.endsWith(i.staticSuffix)?1:i.staticSuffix.endsWith(o.staticSuffix)?-1:0:-1:1),s)}getWildcardChild(){return this.wildcardChild}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new du,this.wildcardChild}split(e,r){let n=this.prefix.slice(0,r),s=this.prefix.slice(r);this.prefix=s,this._compilePrefixMatch();let i=new t(n);return i.staticChildren[s.charAt(0)]=this,e.staticChildren[n.charAt(0)]=i,i}getNextNode(e,r,n,s){let i=this.findStaticMatchingChild(e,r),o=0;if(i===null){if(this.parametricChildren.length===0)return this.wildcardChild;i=this.parametricChildren[0],o=1}this.wildcardChild!==null&&n.push({paramsCount:s,brotherPathIndex:r,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=o;a--)n.push({paramsCount:s,brotherPathIndex:r,brotherNode:this.parametricChildren[a]});return i}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let r=1;r<this.prefix.length;r++){let n=this.prefix.charCodeAt(r);e.push(`path.charCodeAt(i + ${r}) === ${n}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},fu=class extends uu{constructor(e,r,n){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=r||null,this.kind=hu.PARAMETRIC,this.nodePaths=new Set([n])}getNextNode(e,r){return this.findStaticMatchingChild(e,r)}},du=class extends lu{constructor(){super(),this.kind=hu.WILDCARD}getNextNode(){return null}};I$.exports={StaticNode:cu,ParametricNode:fu,WildcardNode:du,NODE_TYPES:hu}});var x$=E((UX,k$)=>{"use strict";var d9=V("node:assert");function _o(){if(!(this instanceof _o))return new _o;this.store=new Map,this.maxMajor=0,this.maxMinors={},this.maxPatches={}}_o.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[r,n,s]=t.split(".",3);if(isNaN(r))throw new TypeError("Major version must be a numeric value");return r=Number(r),n=Number(n)||0,s=Number(s)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.set("x",e),this.store.set("*",e),this.store.set("x.x",e),this.store.set("x.x.x",e)),n>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=n,this.store.set(`${r}.x`,e),this.store.set(`${r}.x.x`,e)),s>=(this.maxPatches[`${r}.${n}`]||0)&&(this.maxPatches[`${r}.${n}`]=s,this.store.set(`${r}.${n}.x`,e)),this.store.set(`${r}.${n}.${s}`,e),this};_o.prototype.get=function(t){return this.store.get(t)};k$.exports={name:"version",mustMatchWhenDerived:!0,storage:_o,validate(t){d9(typeof t=="string","Version should be a string")}}});var q$=E((BX,L$)=>{"use strict";var h9=V("node:assert");function p9(){let t=new Map,e=[];return{get:r=>{let n=t.get(r);if(n)return n;for(let s of e)if(s.host.test(r))return s.value},set:(r,n)=>{r instanceof RegExp?e.push({host:r,value:n}):t.set(r,n)}}}L$.exports={name:"host",mustMatchWhenDerived:!1,storage:p9,validate(t){h9(typeof t=="string"||Object.prototype.toString.call(t)==="[object RegExp]","Host should be a string or a RegExp")}}});var D$=E((GX,j$)=>{"use strict";var m9=x$(),g9=q$(),hm=V("node:assert"),pm=class{constructor(e){if(this.strategies={version:m9,host:g9},this.strategiesInUse=new Set,this.asyncStrategiesInUse=new Set,e)for(let r of Object.values(e))this.addConstraintStrategy(r)}isStrategyUsed(e){return this.strategiesInUse.has(e)||this.asyncStrategiesInUse.has(e)}hasConstraintStrategy(e){let r=this.strategies[e];return r!==void 0?r.isCustom||this.isStrategyUsed(e):!1}addConstraintStrategy(e){if(hm(typeof e.name=="string"&&e.name!=="","strategy.name is required."),hm(e.storage&&typeof e.storage=="function","strategy.storage function is required."),hm(e.deriveConstraint&&typeof e.deriveConstraint=="function","strategy.deriveConstraint function is required."),this.strategies[e.name]&&this.strategies[e.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${e.name}.`);if(this.isStrategyUsed(e.name))throw new Error(`There already exists a route with ${e.name} constraint.`);e.isCustom=!0,e.isAsync=e.deriveConstraint.length===3,this.strategies[e.name]=e,e.mustMatchWhenDerived&&this.noteUsage({[e.name]:e})}deriveConstraints(e,r,n){let s=this.deriveSyncConstraints(e,r);if(n===void 0)return s;this.deriveAsyncConstraints(s,e,r,n)}deriveSyncConstraints(e,r){}noteUsage(e){if(e){let r=this.strategiesInUse.size;for(let n in e)this.strategies[n].isAsync?this.asyncStrategiesInUse.add(n):this.strategiesInUse.add(n);r!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(e){if(!this.strategies[e])throw new Error(`No strategy registered for constraint key ${e}`);return this.strategies[e].storage()}validateConstraints(e){for(let r in e){let n=e[r];if(typeof n>"u")throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");let s=this.strategies[r];if(!s)throw new Error(`No strategy registered for constraint key ${r}`);s.validate&&s.validate(n)}}deriveAsyncConstraints(e,r,n,s){let i=this.asyncStrategiesInUse.size;if(i===0){s(null,e);return}e=e||{};for(let o of this.asyncStrategiesInUse)this.strategies[o].deriveConstraint(r,n,(l,u)=>{if(l!==null){s(l);return}e[o]=u,--i===0&&s(null,e)})}_buildDeriveConstraints(){if(this.strategiesInUse.size===0)return;let e=["return {"];for(let r of this.strategiesInUse){let n=this.strategies[r];n.isCustom?e.push(` ${n.name}: this.strategies.${r}.deriveConstraint(req, ctx),`):r==="version"?e.push(" version: req.headers['accept-version'],"):e.push(" host: req.headers.host || req.headers[':authority'],")}e.push("}"),this.deriveSyncConstraints=new Function("req","ctx",e.join(`
|
|
366
|
+
`)).bind(this)}};j$.exports=pm});var M$=E((WX,F$)=>{"use strict";var y9=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];F$.exports=y9});var z$=E((JX,V$)=>{"use strict";function H$(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function _9(t,e){let r=!1,n=!1,s="";for(let o=1;o<t.length;o++){let a=t.charCodeAt(o);if(a===37){let l=t.charCodeAt(o+1),u=t.charCodeAt(o+2);H$(l,u)===null?r=!0:(n=!0,l===50&&u===53&&(r=!0,t=t.slice(0,o+1)+"25"+t.slice(o+1),o+=2),o+=2)}else if(a===63||a===35||a===59&&e){s=t.slice(o+1),t=t.slice(0,o);break}}return{path:r?decodeURI(t):t,querystring:s,shouldDecodeParam:n}}function S9(t){let e=t.indexOf("%");if(e===-1)return t;let r="",n=e;for(let s=e;s<t.length;s++)if(t.charCodeAt(s)===37){let i=t.charCodeAt(s+1),o=t.charCodeAt(s+2),a=H$(i,o);r+=t.slice(n,s)+a,n=s+3}return t.slice(0,e)+r+t.slice(n)}V$.exports={safeDecodeURI:_9,safeDecodeURIComponent:S9}});var Em=E((KX,Z$)=>{"use strict";var qe=V("node:assert"),E9=WT(),Hs=y$(),ym=Pi(),{prettyPrintTree:b9}=O$(),{StaticNode:U$,NODE_TYPES:B$}=N$(),v9=D$(),Ms=M$(),mm=ou(),{safeDecodeURI:G$,safeDecodeURIComponent:gm}=z$(),W$=/^https?:\/\/.*?\//,qn=/(\/:[^/()]*?)\?(\/?)/,J$=/[.*+?^${}()|[\]\\]/g,K$=/\/\/+/g;if(!Hs(W$))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!Hs(qn))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");if(!Hs(J$))throw new Error("the ESCAPE_REGEXP is not safe, update this module");if(!Hs(K$))throw new Error("the REMOVE_DUPLICATE_SLASHES_REGEXP is not safe, update this module");function Te(t){if(!(this instanceof Te))return new Te(t);t=t||{},this._opts=t,t.defaultRoute?(qe(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(qe(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(qe(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=w9,t.querystringParser?(qe(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e.length===0?{}:E9.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.constrainer=new v9(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Te.prototype.on=function(e,r,n,s,i){typeof n=="function"&&(s!==void 0&&(i=s),s=n,n={}),qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof s=="function","Handler should be a function");let o=r.match(qn);if(o){qe(r.length===o.index+o[0].length,"Optional Parameter needs to be the last parameter of the path");let u=r.replace(qn,"$1$2"),c=r.replace(qn,"$2")||"/";this.on(e,u,n,s,i),this.on(e,c,n,s,i);return}let a=r;this.ignoreDuplicateSlashes&&(r=_m(r)),this.ignoreTrailingSlash&&(r=Sm(r));let l=Array.isArray(e)?e:[e];for(let u of l)qe(typeof u=="string","Method should be a string"),qe(Ms.includes(u),`Method '${u}' is not an http method.`),this._on(u,r,n,s,i,a)};Te.prototype._on=function(e,r,n,s,i){let o={};n.constraints!==void 0&&(qe(typeof n.constraints=="object"&&n.constraints!==null,"Constraints should be an object"),Object.keys(n.constraints).length!==0&&(o=n.constraints)),this.constrainer.validateConstraints(o),this.constrainer.noteUsage(o),this.trees[e]===void 0&&(this.trees[e]=new U$("/"));let a=r;if(a==="*"&&this.trees[e].prefix.length!==0){let p=this.trees[e];this.trees[e]=new U$(""),this.trees[e].staticChildren["/"]=p}let l=this.trees[e],u=l.prefix.length,c=[];for(let p=0;p<=a.length;p++){if(a.charCodeAt(p)===58&&a.charCodeAt(p+1)===58){p++;continue}let h=a.charCodeAt(p)===58&&a.charCodeAt(p+1)!==58,d=a.charCodeAt(p)===42;if(h||d||p===a.length&&p!==u){let m=a.slice(u,p);this.caseSensitive||(m=m.toLowerCase()),m=m.replaceAll("::",":"),m=m.replaceAll("%","%25"),l=l.createStaticChild(m)}if(h){let m=!1,g=!0,S="",b=[],_=p+1;for(let y=_;;y++){let R=a.charCodeAt(y),T=R===40,O=R===45||R===46,w=R===47||y===a.length;if(T||O||w){let $=a.slice(_,y);if(c.push($),m=m||T||O,T){let C=Q$(a,y),k=a.slice(y,C+1);this.allowUnsafeRegex||qe(Hs(new RegExp(k)),`The regex '${k}' is not safe!`),b.push(X$(k)),y=C+1,g=!0}else b.push(g?"(.*?)":`(${S}|(?:(?!${S}).)*)`),g=!1;let v=y;for(;y<a.length;y++){let C=a.charCodeAt(y);if(C===47)break;if(C===58)if(a.charCodeAt(y+1)===58)y++;else break}let P=a.slice(v,y);if(P&&(P=P.replaceAll("::",":"),P=P.replaceAll("%","%25"),b.push(S=Y$(P))),_=y+1,w||a.charCodeAt(y)===47||y===a.length){let C=m?"()"+P:P,k=a.slice(p,y);a=a.slice(0,p+1)+C+a.slice(y),p+=C.length;let M=m?new RegExp("^"+b.join("")+"$"):null;l=l.createParametricChild(M,P||null,k),u=p+1;break}}}}else if(d&&(c.push("*"),l=l.createWildcardChild(),u=p+1,p!==a.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(a=a.toLowerCase()),a==="*"&&(a="/*");for(let p of this.routes){let h=p.opts.constraints||{};if(p.method===e&&p.pattern===a&&ym(h,o))throw new Error(`Method '${e}' already declared for route '${a}' with constraints '${JSON.stringify(o)}'`)}let f={method:e,path:r,pattern:a,params:c,opts:n,handler:s,store:i};this.routes.push(f),l.addRoute(f,this.constrainer)};Te.prototype.hasRoute=function(e,r,n){return this.findRoute(e,r,n)!==null};Te.prototype.findRoute=function(e,r,n={}){if(this.trees[e]===void 0)return null;let s=r,i=this.trees[e],o=i.prefix.length,a=[];for(let l=0;l<=s.length;l++){if(s.charCodeAt(l)===58&&s.charCodeAt(l+1)===58){l++;continue}let u=s.charCodeAt(l)===58&&s.charCodeAt(l+1)!==58,c=s.charCodeAt(l)===42;if(u||c||l===s.length&&l!==o){let f=s.slice(o,l);if(this.caseSensitive||(f=f.toLowerCase()),f=f.replaceAll("::",":"),f=f.replaceAll("%","%25"),i=i.getStaticChild(f),i===null)return null}if(u){let f=!1,p=!0,h="",d=[],m=l+1;for(let g=m;;g++){let S=s.charCodeAt(g),b=S===40,_=S===45||S===46,y=S===47||g===s.length;if(b||_||y){let R=s.slice(m,g);if(a.push(R),f=f||b||_,b){let w=Q$(s,g),$=s.slice(g,w+1);this.allowUnsafeRegex||qe(Hs(new RegExp($)),`The regex '${$}' is not safe!`),d.push(X$($)),g=w+1,p=!1}else d.push(p?"(.*?)":`(${h}|(?:(?!${h}).)*)`),p=!1;let T=g;for(;g<s.length;g++){let w=s.charCodeAt(g);if(w===47)break;if(w===58)if(s.charCodeAt(g+1)===58)g++;else break}let O=s.slice(T,g);if(O&&(O=O.replaceAll("::",":"),O=O.replaceAll("%","%25"),d.push(h=Y$(O))),m=g+1,y||s.charCodeAt(g)===47||g===s.length){let w=f?"()"+O:O,$=s.slice(l,g);s=s.slice(0,l+1)+w+s.slice(g),l+=w.length;let v=f?new RegExp("^"+d.join("")+"$"):null;if(i=i.getParametricChild(v,O||null,$),i===null)return null;o=l+1;break}}}}else if(c&&(a.push("*"),i=i.getWildcardChild(),o=l+1,l!==s.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(s=s.toLowerCase());for(let l of this.routes){let u=l.opts.constraints||{};if(l.method===e&&l.pattern===s&&ym(u,n))return{handler:l.handler,store:l.store,params:l.params}}return null};Te.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)};Te.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)};Te.prototype.reset=function(){this.trees={},this.routes=[]};Te.prototype.off=function(e,r,n){qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof n>"u"||typeof n=="object"&&!Array.isArray(n)&&n!==null,"Constraints should be an object or undefined.");let s=r.match(qn);if(s){qe(r.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let o=r.replace(qn,"$1$2"),a=r.replace(qn,"$2");this.off(e,o,n),this.off(e,a,n);return}this.ignoreDuplicateSlashes&&(r=_m(r)),this.ignoreTrailingSlash&&(r=Sm(r));let i=Array.isArray(e)?e:[e];for(let o of i)this._off(o,r,n)};Te.prototype._off=function(e,r,n){qe(typeof e=="string","Method should be a string"),qe(Ms.includes(e),`Method '${e}' is not an http method.`);function s(l){return e!==l.method||r!==l.path}function i(l){return s(l)||!ym(n,l.opts.constraints||{})}let o=n?i:s,a=this.routes.filter(o);this._rebuild(a)};Te.prototype.lookup=function(e,r,n,s){if(typeof n=="function"&&(s=n,n=void 0),s===void 0){let i=this.constrainer.deriveConstraints(e,n),o=this.find(e.method,e.url,i);return this.callHandler(o,e,r,n)}this.constrainer.deriveConstraints(e,n,(i,o)=>{if(i!==null){s(i);return}try{let a=this.find(e.method,e.url,o),l=this.callHandler(a,e,r,n);s(null,l)}catch(a){s(a)}})};Te.prototype.callHandler=function(e,r,n,s){return e===null?this._defaultRoute(r,n,s):s===void 0?e.handler(r,n,e.params,e.store,e.searchParams):e.handler.call(s,r,n,e.params,e.store,e.searchParams)};Te.prototype.find=function(e,r,n){let s=this.trees[e];if(s===void 0)return null;r.charCodeAt(0)!==47&&(r=r.replace(W$,"/")),this.ignoreDuplicateSlashes&&(r=_m(r));let i,o,a;try{i=G$(r,this.useSemicolonDelimiter),r=i.path,o=i.querystring,a=i.shouldDecodeParam}catch{return this._onBadUrl(r)}this.ignoreTrailingSlash&&(r=Sm(r));let l=r;this.caseSensitive===!1&&(r=r.toLowerCase());let u=this.maxParamLength,c=s.prefix.length,f=[],p=r.length,h=[];for(;;){if(c===p&&s.isLeafNode){let S=s.handlerStorage.getMatchingHandler(n);if(S!==null)return{handler:S.handler,store:S.store,params:S._createParamsObject(f),searchParams:this.querystringParser(o)}}let d=s.getNextNode(r,c,h,f.length);if(d===null){if(h.length===0)return null;let S=h.pop();c=S.brotherPathIndex,f.splice(S.paramsCount),d=S.brotherNode}if(s=d,s.kind===B$.STATIC){c+=s.prefix.length;continue}if(s.kind===B$.WILDCARD){let S=l.slice(c);a&&(S=gm(S)),f.push(S),c=p;continue}let m=l.indexOf("/",c);m===-1&&(m=p);let g=l.slice(c,m);if(a&&(g=gm(g)),s.isRegex){let S=s.regex.exec(g);if(S===null)continue;for(let b=1;b<S.length;b++){let _=S[b];if(_.length>u)return null;f.push(_)}}else{if(g.length>u)return null;f.push(g)}c=m}};Te.prototype._rebuild=function(t){this.reset();for(let e of t){let{method:r,path:n,opts:s,handler:i,store:o}=e;this._on(r,n,s,i,o)}};Te.prototype._defaultRoute=function(t,e,r){if(this.defaultRoute!==null)return r===void 0?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()};Te.prototype._onBadUrl=function(t){if(this.onBadUrl===null)return null;let e=this.onBadUrl;return{handler:(r,n,s)=>e(t,r,n),params:{},store:null}};Te.prototype.prettyPrint=function(t={}){let e=t.method;t.buildPrettyMeta=this.buildPrettyMeta.bind(this);let r=null;if(e===void 0){let{version:n,host:s,...i}=this.constrainer.strategies;i[mm.name]=mm;let o=new Te({...this._opts,constraints:i}),a=this.routes.map(l=>{let u={...l.opts.constraints,[mm.name]:l.method};return{...l,method:"MERGED",opts:{constraints:u}}});o._rebuild(a),r=o.trees.MERGED}else r=this.trees[e];return r==null?"(empty tree)":b9(r,t)};for(let t in Ms){if(!Ms.hasOwnProperty(t))continue;let e=Ms[t],r=e.toLowerCase();Te.prototype[r]=function(n,s,i){return this.on(e,n,s,i)}}Te.prototype.all=function(t,e,r){this.on(Ms,t,e,r)};Te.sanitizeUrlPath=function(e,r){let n=G$(e,r);return n.shouldDecodeParam?gm(n.path):n.path};Z$.exports=Te;function Y$(t){return t.replace(J$,"\\$&")}function _m(t){return t.indexOf("//")!==-1?t.replace(K$,"/"):t}function Sm(t){return t.length>1&&t.charCodeAt(t.length-1)===47?t.slice(0,-1):t}function X$(t){return t.charCodeAt(1)===94&&(t=t.slice(0,1)+t.slice(2)),t.charCodeAt(t.length-2)===36&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function Q$(t,e){let r=1;for(;e<t.length;){if(e++,t.charCodeAt(e)===92){e++;continue}if(t.charCodeAt(e)===41?r--:t.charCodeAt(e)===40&&r++,!r)return e}throw new TypeError('Invalid regexp expression in "'+t+'"')}function w9(t){return t?t.store?Object.assign({},t.store):{}:{}}});var tP=E((YX,eP)=>{"use strict";function bm(t,e,r,n){if(r===void 0){e.header("content-length","0"),n(null,null);return}if(typeof r.resume=="function"){r.on("error",i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),r.resume(),n(null,null);return}if(typeof r.getReader=="function"){r.cancel("Stream cancelled by HEAD route").catch(i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),n(null,null);return}let s=""+Buffer.byteLength(r);e.header("content-length",s),n(null,null)}function R9(t){return t==null?bm:Array.isArray(t)?[...t,bm]:[t,bm]}eP.exports={parseHeadOnSendHandlers:R9}});var SP=E((XX,_P)=>{"use strict";var O9=Em(),T9=La(),rP=Sc(),{onRequestAbortHookRunner:$9,lifecycleHooks:nP,preParsingHookRunner:P9,onTimeoutHookRunner:A9,onRequestHookRunner:C9}=Dr(),{normalizeSchema:I9}=li(),{parseHeadOnSendHandlers:N9}=tP(),{compileSchemasForValidation:k9,compileSchemasForSerialization:x9}=mc(),{FST_ERR_SCH_VALIDATION_BUILD:L9,FST_ERR_SCH_SERIALIZATION_BUILD:q9,FST_ERR_DUPLICATED_ROUTE:j9,FST_ERR_INVALID_URL:D9,FST_ERR_HOOK_INVALID_HANDLER:sP,FST_ERR_ROUTE_OPTIONS_NOT_OBJ:F9,FST_ERR_ROUTE_DUPLICATED_HANDLER:M9,FST_ERR_ROUTE_HANDLER_NOT_FN:iP,FST_ERR_ROUTE_MISSING_HANDLER:H9,FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:V9,FST_ERR_ROUTE_METHOD_INVALID:z9,FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:U9,FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:B9,FST_ERR_HOOK_INVALID_ASYNC_HANDLER:vm}=He(),{kRoutePrefix:G9,kSupportedHTTPMethods:Om,kLogLevel:W9,kLogSerializers:oP,kHooks:aP,kSchemaController:J9,kOptions:lP,kReplySerializerDefault:wm,kReplyIsError:K9,kRequestPayloadStream:Y9,kDisableRequestLogging:uP,kSchemaErrorFormatter:X9,kErrorHandler:cP,kHasBeenDecorated:fP,kRequestAcceptVersion:Rm,kRouteByFastify:Q9,kRouteContext:dP}=De(),{buildErrorHandler:Z9}=ui(),{createChildLogger:e6}=ai(),{getGenReqId:t6}=Yl(),{FSTDEP022:r6}=Kn(),hP=["allowUnsafeRegex","buildPrettyMeta","caseSensitive","constraints","defaultRoute","ignoreDuplicateSlashes","ignoreTrailingSlash","maxParamLength","onBadUrl","querystringParser","useSemicolonDelimiter"];function n6(t){let e=O9(t),r,n,s,i,o,a,l,u,c,f,p,h,d,m=!1;return{setup(w,$){r=$.avvio,n=$.fourOhFour,s=w.logger,i=$.hasLogger,o=$.setupResponseListeners,a=$.throwIfAlreadyStarted,h=w.exposeHeadRoutes,l=w.disableRequestLogging,typeof l=="function"&&(u=w.disableRequestLogging),c=w.routerOptions.ignoreTrailingSlash,f=w.routerOptions.ignoreDuplicateSlashes,p=Object.hasOwn(w,"return503OnClosing")?w.return503OnClosing:!0,d=$.keepAliveConnections},routing:e.lookup.bind(e),route:T,hasRoute:y,prepareRoute:_,routeHandler:O,closeRoutes:()=>{m=!0},printRoutes:e.prettyPrint.bind(e),addConstraintStrategy:g,hasConstraintStrategy:S,isAsyncConstraint:b,findRoute:R};function g(w){return a("Cannot add constraint strategy!"),e.addConstraintStrategy(w)}function S(w){return e.hasConstraintStrategy(w)}function b(){return e.constrainer.asyncStrategiesInUse.size>0}function _({method:w,url:$,options:v,handler:P,isFastify:C}){if(typeof $!="string")throw new D9(typeof $);if(!P&&typeof v=="function")P=v,v={};else if(P&&typeof P=="function"){if(Object.prototype.toString.call(v)!=="[object Object]")throw new F9(w,$);if(v.handler)throw typeof v.handler=="function"?new M9(w,$):new iP(w,$)}return v=Object.assign({},v,{method:w,url:$,path:$,handler:P||v&&v.handler}),T.call(this,{options:v,isFastify:C})}function y({options:w}){let $=w.method?.toUpperCase()??"";return e.hasRoute($,w.url||"",w.constraints)}function R(w){let $=e.find(w.method,w.url||"",w.constraints);return $?{handler:$.handler,params:$.params,searchParams:$.searchParams}:null}function T({options:w,isFastify:$}){a("Cannot add route!");let v={...w},P=v.url||v.path||"";if(!v.handler)throw new H9(v.method,P);if(v.errorHandler!==void 0&&typeof v.errorHandler!="function")throw new iP(v.method,P);yP(v.bodyLimit);let C=v.exposeHeadRoute??h,k=!1,M=!1;if(Array.isArray(v.method))for(let fe=0;fe<v.method.length;++fe)v.method[fe]=pP.call(this,v.method[fe]),mP.call(this,v.method[fe],P,v.schema),k=v.method.includes("GET"),M=v.method.includes("HEAD");else v.method=pP.call(this,v.method),mP.call(this,v.method,P,v.schema),k=v.method==="GET",M=v.method==="HEAD";let J=C&&k?{...w}:null,U=this[G9];if(P==="/"&&U.length>0&&v.method!=="HEAD")switch(v.prefixTrailingSlash){case"slash":H.call(this,{path:P,isFastify:$});break;case"no-slash":H.call(this,{path:"",isFastify:$});break;case"both":default:H.call(this,{path:"",isFastify:$}),c!==!0&&(f!==!0||!U.endsWith("/"))&&H.call(this,{path:P,prefixing:!0,isFastify:$})}else P[0]==="/"&&U.endsWith("/")?H.call(this,{path:P.slice(1),isFastify:$}):H.call(this,{path:P,isFastify:$});return this;function H({path:fe,prefixing:ze=!1,isFastify:G=!1}){let wt=U+fe;if(v.url=wt,v.path=wt,v.routePath=fe,v.prefix=U,v.logLevel=v.logLevel||this[W9],(this[oP]||v.logSerializers)&&(v.logSerializers=Object.assign(Object.create(this[oP]),v.logSerializers)),v.attachValidation==null&&(v.attachValidation=!1),ze===!1)for(let N of this[aP].onRoute)N.call(this,v);for(let N of nP)if(v&&N in v){if(Array.isArray(v[N]))for(let q of v[N]){if(typeof q!="function")throw new sP(N,Object.prototype.toString.call(q));if(N==="onSend"||N==="preSerialization"||N==="onError"||N==="preParsing"){if(q.constructor.name==="AsyncFunction"&&q.length===4)throw new vm}else if(N==="onRequestAbort"){if(q.constructor.name==="AsyncFunction"&&q.length!==1)throw new vm}else if(q.constructor.name==="AsyncFunction"&&q.length===3)throw new vm}else if(v[N]!==void 0&&typeof v[N]!="function")throw new sP(N,Object.prototype.toString.call(v[N]))}let xr=v.constraints||{},me={...v.config,url:wt,method:v.method},pe=new T9({schema:v.schema,handler:v.handler.bind(this),config:me,errorHandler:v.errorHandler,childLoggerFactory:v.childLoggerFactory,bodyLimit:v.bodyLimit,logLevel:v.logLevel,logSerializers:v.logSerializers,attachValidation:v.attachValidation,schemaErrorFormatter:v.schemaErrorFormatter,replySerializer:this[wm],validatorCompiler:v.validatorCompiler,serializerCompiler:v.serializerCompiler,exposeHeadRoute:C,prefixTrailingSlash:v.prefixTrailingSlash||"both",server:this,isFastify:G}),A=e.findRoute("HEAD",v.url,xr)!==null;try{e.on(v.method,v.url,{constraints:xr},O,pe)}catch(N){if(!pe[Q9])throw N.message.includes(`Method '${v.method}' already declared for route`)?new j9(v.method,v.url):N}if(this.after((N,q)=>{pe.errorHandler=v.errorHandler?Z9(this[cP],v.errorHandler):this[cP],pe._parserOptions.limit=v.bodyLimit||null,pe.logLevel=v.logLevel,pe.logSerializers=v.logSerializers,pe.attachValidation=v.attachValidation,pe[wm]=this[wm],pe.schemaErrorFormatter=v.schemaErrorFormatter||this[X9]||pe.schemaErrorFormatter,r.once("preReady",()=>{for(let j of nP){let ue=this[aP][j].concat(v[j]||[]).map(de=>de.bind(this));pe[j]=ue.length?ue:null}for(;!pe.Request[fP]&&pe.Request.parent;)pe.Request=pe.Request.parent;for(;!pe.Reply[fP]&&pe.Reply.parent;)pe.Reply=pe.Reply.parent;if(n.setContext(this,pe),v.schema){pe.schema=I9(pe.schema,this.initialConfig);let j=this[J9],ue=v.schema.body||v.schema.headers||v.schema.querystring||v.schema.params;!v.validatorCompiler&&ue&&j.setupValidator(this[lP]);try{let de=typeof v?.validatorCompiler=="function"||j.isCustomValidatorCompiler;k9(pe,v.validatorCompiler||j.validatorCompiler,de)}catch(de){throw new L9(v.method,wt,de.message)}v.schema.response&&!v.serializerCompiler&&j.setupSerializer(this[lP]);try{x9(pe,v.serializerCompiler||j.serializerCompiler)}catch(de){throw new q9(v.method,wt,de.message)}}}),q(N)}),C&&k&&!M&&!A){let N=N9(J.onSend);_.call(this,{method:"HEAD",url:fe,options:{...J,onSend:N},isFastify:!0})}}}function O(w,$,v,P,C){let k=t6(P.server,w),M={level:P.logLevel};P.logSerializers&&(M.serializers=P.logSerializers);let J=e6(P,s,w,k,M);if(J[uP]=u?!1:l,m===!0&&(w.httpVersionMajor!==2&&$.setHeader("Connection","close"),p)){let G={"Content-Type":"application/json","Content-Length":"80"};$.writeHead(503,G),$.end('{"error":"Service Unavailable","message":"Service Unavailable","statusCode":503}'),J.info({res:{statusCode:503}},"request aborted - refusing to accept new requests as server is closing");return}String.prototype.toLowerCase.call(w.headers.connection||"")==="keep-alive"&&d.has(w.socket)===!1&&(d.add(w.socket),w.socket.on("close",a6.bind({keepAliveConnections:d,socket:w.socket}))),w.headers[Rm]!==void 0&&(w.headers["accept-version"]=w.headers[Rm],w.headers[Rm]=void 0);let H=new P.Request(k,v,w,C,J,P),fe=new P.Reply($,H,J),ze=u?u(H):l;J[uP]=ze,ze===!1&&J.info({req:H},"incoming request"),(i===!0||P.onResponse!==null)&&o(fe),P.onRequest!==null?C9(P.onRequest,H,fe,gP):gP(null,H,fe),P.onRequestAbort!==null&&w.on("close",()=>{w.aborted&&$9(P.onRequestAbort,H,s6.bind(null,fe))}),P.onTimeout!==null&&(H.raw.socket._meta||H.raw.socket.on("timeout",i6),H.raw.socket._meta={context:P,request:H,reply:fe})}}function s6(t,e){e&&t.log.error({err:e},"onRequestAborted hook failed")}function i6(){let{context:t,request:e,reply:r}=this._meta;A9(t.onTimeout,e,r,l6)}function pP(t){if(typeof t!="string")throw new z9;if(t=t.toUpperCase(),!this[Om].bodyless.has(t)&&!this[Om].bodywith.has(t))throw new V9(t);return t}function mP(t,e,r){if(this[Om].bodyless.has(t)&&r?.body)throw new U9(t,e)}function yP(t){if(t!==void 0&&(!Number.isInteger(t)||t<=0))throw new B9(t)}function gP(t,e,r){if(r.sent!==!0){if(t!=null){r[K9]=!0,r.send(t);return}e[Y9]=e.raw,e[dP].preParsing!==null?P9(e[dP].preParsing,e,r,rP.bind(e.server)):rP.call(e.server,null,e,r)}}function o6(t,e){let r=t.routerOptions||Object.create(null),n=hP.filter(s=>Object.hasOwn(t,s));n.length>0&&r6(n.join(", "));for(let s of hP)Object.hasOwn(r,s)||(r[s]=t[s]??e[s]);return r}function a6(){this.keepAliveConnections.delete(this.socket)}function l6(){}_P.exports={buildRouting:n6,validateBodyLimitOption:yP,buildRouterOptions:o6}});var TP=E((QX,OP)=>{"use strict";var u6=Em(),EP=Pa(),bP=xa(),c6=La(),{kRoutePrefix:f6,kCanSetNotFoundHandler:So,kFourOhFourLevelInstance:Eo,kFourOhFourContext:mr,kHooks:d6,kErrorHandler:vP}=De(),{lifecycleHooks:h6}=Dr(),{buildErrorHandler:p6}=ui(),{FST_ERR_NOT_FOUND:m6}=He(),{createChildLogger:wP}=ai(),{getGenReqId:RP}=Yl();function g6(t){let{logger:e,disableRequestLogging:r}=t,n=u6({onBadUrl:a(),defaultRoute:f}),s=null;return{router:n,setNotFoundHandler:u,setContext:l,arrange404:i};function i(p){p[Eo]=p,p[So]=!0,n.onBadUrl=n.onBadUrl.bind(p),n.defaultRoute=n.defaultRoute.bind(p)}function o(p,h){let{url:d,method:m}=p.raw,g=`Route ${m}:${d} not found`;(typeof r=="function"?r(p.raw):r)||p.log.info(g),h.code(404).send({message:g,error:"Not Found",statusCode:404})}function a(){return function(h,d,m){let g=this[Eo][mr],S=RP(g.server,d),b=wP(g,e,d,S),_=new bP(S,null,d,null,b,g),y=new EP(m,_,b);s(_,y)}}function l(p,h){let d=Object.assign({},p[mr]);d.onSend=h.onSend,h[mr]=d}function u(p,h,d,m){this[So]===void 0&&(this[So]=!0),this[mr]===void 0&&(this[mr]=null);let g=this,S=this[f6]||"/";if(this[So]===!1)throw new Error(`Not found handler already set for Fastify instance with prefix: '${S}'`);typeof p=="object"&&(p.preHandler&&(Array.isArray(p.preHandler)?p.preHandler=p.preHandler.map(b=>b.bind(g)):p.preHandler=p.preHandler.bind(g)),p.preValidation&&(Array.isArray(p.preValidation)?p.preValidation=p.preValidation.map(b=>b.bind(g)):p.preValidation=p.preValidation.bind(g))),typeof p=="function"&&(h=p,p=void 0),p=p||{},h?(this[Eo][So]=!1,h=h.bind(this),s=h):(h=o,s=o),this.after((b,_)=>{c.call(this,S,p,h,d,m),_(b)})}function c(p,h,d,m,g){let S=new c6({schema:h.schema,handler:d,config:h.config||{},server:this});if(m.once("preReady",()=>{let b=this[mr];for(let _ of h6){let y=this[d6][_].concat(h[_]||[]).map(R=>R.bind(this));b[_]=y.length?y:null}b.errorHandler=h.errorHandler?p6(this[vP],h.errorHandler):this[vP]}),this[mr]!==null&&p==="/"){Object.assign(this[mr],S);return}this[Eo][mr]=S,n.all(p+(p.endsWith("/")?"*":"/*"),g,S),n.all(p,g,S)}function f(p,h){let d=this[Eo][mr],m=RP(d.server,p),g=wP(d,e,p,m);g.info({req:p},"incoming request");let S=new bP(m,null,p,null,g,d),b=new EP(h,S,g);S.log.warn("the default handler for 404 did not catch this, this is likely a fastify bug, please report it"),S.log.warn(n.prettyPrint()),b.code(404).send(new m6)}}OP.exports=g6});var $P=E((ZX,pu)=>{"use strict";pu.exports=ae;pu.exports.default=ae;var y6={type:"object",additionalProperties:!1,properties:{connectionTimeout:{type:"integer",default:0},keepAliveTimeout:{type:"integer",default:72e3},forceCloseConnections:{oneOf:[{type:"string",pattern:"idle"},{type:"boolean"}]},maxRequestsPerSocket:{type:"integer",default:0,nullable:!0},requestTimeout:{type:"integer",default:0},bodyLimit:{type:"integer",default:1048576},caseSensitive:{type:"boolean",default:!0},allowUnsafeRegex:{type:"boolean",default:!1},http2:{type:"boolean"},https:{if:{not:{oneOf:[{type:"boolean"},{type:"null"},{type:"object",additionalProperties:!1,required:["allowHTTP1"],properties:{allowHTTP1:{type:"boolean"}}}]}},then:{setDefaultValue:!0}},ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},disableRequestLogging:{default:!1},maxParamLength:{type:"integer",default:100},onProtoPoisoning:{type:"string",default:"error"},onConstructorPoisoning:{type:"string",default:"error"},pluginTimeout:{type:"integer",default:1e4},requestIdHeader:{anyOf:[{type:"boolean"},{type:"string"}],default:!1},requestIdLogLabel:{type:"string",default:"reqId"},http2SessionTimeout:{type:"integer",default:72e3},exposeHeadRoutes:{type:"boolean",default:!0},useSemicolonDelimiter:{type:"boolean",default:!1},routerOptions:{type:"object",additionalProperties:!0,properties:{ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},maxParamLength:{type:"integer",default:100},allowUnsafeRegex:{type:"boolean",default:!1},useSemicolonDelimiter:{type:"boolean",default:!1}}},constraints:{type:"object",additionalProperties:{type:"object",required:["name","storage","validate","deriveConstraint"],additionalProperties:!0,properties:{name:{type:"string"},storage:{},validate:{},deriveConstraint:{}}}}}},_6=Object.prototype.hasOwnProperty,S6=new RegExp("idle","u");function ae(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){t.connectionTimeout===void 0&&(t.connectionTimeout=0),t.keepAliveTimeout===void 0&&(t.keepAliveTimeout=72e3),t.maxRequestsPerSocket===void 0&&(t.maxRequestsPerSocket=0),t.requestTimeout===void 0&&(t.requestTimeout=0),t.bodyLimit===void 0&&(t.bodyLimit=1048576),t.caseSensitive===void 0&&(t.caseSensitive=!0),t.allowUnsafeRegex===void 0&&(t.allowUnsafeRegex=!1),t.ignoreTrailingSlash===void 0&&(t.ignoreTrailingSlash=!1),t.ignoreDuplicateSlashes===void 0&&(t.ignoreDuplicateSlashes=!1),t.disableRequestLogging===void 0&&(t.disableRequestLogging=!1),t.maxParamLength===void 0&&(t.maxParamLength=100),t.onProtoPoisoning===void 0&&(t.onProtoPoisoning="error"),t.onConstructorPoisoning===void 0&&(t.onConstructorPoisoning="error"),t.pluginTimeout===void 0&&(t.pluginTimeout=1e4),t.requestIdHeader===void 0&&(t.requestIdHeader=!1),t.requestIdLogLabel===void 0&&(t.requestIdLogLabel="reqId"),t.http2SessionTimeout===void 0&&(t.http2SessionTimeout=72e3),t.exposeHeadRoutes===void 0&&(t.exposeHeadRoutes=!0),t.useSemicolonDelimiter===void 0&&(t.useSemicolonDelimiter=!1);let m=o;for(let g in t)_6.call(y6.properties,g)||delete t[g];if(m===o){let g=t.connectionTimeout,S=o;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let b=typeof g,_;if(_===void 0)if(b==="boolean"||g===null||b==="string"&&g&&g==+g&&!(g%1))_=+g;else return ae.errors=[{instancePath:e+"/connectionTimeout",schemaPath:"#/properties/connectionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;_!==void 0&&(g=_,t!==void 0&&(t.connectionTimeout=_))}var a=S===o;if(a){let b=t.keepAliveTimeout,_=o;if(!(typeof b=="number"&&!(b%1)&&!isNaN(b)&&isFinite(b))){let R=typeof b,T;if(T===void 0)if(R==="boolean"||b===null||R==="string"&&b&&b==+b&&!(b%1))T=+b;else return ae.errors=[{instancePath:e+"/keepAliveTimeout",schemaPath:"#/properties/keepAliveTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;T!==void 0&&(b=T,t!==void 0&&(t.keepAliveTimeout=T))}var a=_===o;if(a){if(t.forceCloseConnections!==void 0){let R=t.forceCloseConnections,T=o,O=o,w=!1,$=null,v=o;if(typeof R!="string"){let k=typeof R,M;if(M===void 0)if(k=="number"||k=="boolean")M=""+R;else if(R===null)M="";else{let J={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[J]:i.push(J),o++}M!==void 0&&(R=M,t!==void 0&&(t.forceCloseConnections=M))}if(o===v&&typeof R=="string"&&!S6.test(R)){let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/pattern",keyword:"pattern",params:{pattern:"idle"},message:'must match pattern "idle"'};i===null?i=[k]:i.push(k),o++}var l=v===o;l&&(w=!0,$=0);let P=o;if(typeof R!="boolean"){let k;if(k===void 0)if(R==="false"||R===0||R===null)k=!1;else if(R==="true"||R===1)k=!0;else{let M={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/1/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(R=k,t!==void 0&&(t.forceCloseConnections=k))}var l=P===o;if(l&&w?(w=!1,$=[$,1]):l&&(w=!0,$=1),w)o=O,i!==null&&(O?i.length=O:i=null);else{let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf",keyword:"oneOf",params:{passingSchemas:$},message:"must match exactly one schema in oneOf"};return i===null?i=[k]:i.push(k),o++,ae.errors=i,!1}var a=T===o}else var a=!0;if(a){let R=t.maxRequestsPerSocket,T=o;if(!(typeof R=="number"&&!(R%1)&&!isNaN(R)&&isFinite(R))&&R!==null){let w=typeof R,$;if($===void 0)if(w==="boolean"||R===null||w==="string"&&R&&R==+R&&!(R%1))$=+R;else if(R===""||R===0||R===!1)$=null;else return ae.errors=[{instancePath:e+"/maxRequestsPerSocket",schemaPath:"#/properties/maxRequestsPerSocket/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;$!==void 0&&(R=$,t!==void 0&&(t.maxRequestsPerSocket=$))}var a=T===o;if(a){let w=t.requestTimeout,$=o;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){let P=typeof w,C;if(C===void 0)if(P==="boolean"||w===null||P==="string"&&w&&w==+w&&!(w%1))C=+w;else return ae.errors=[{instancePath:e+"/requestTimeout",schemaPath:"#/properties/requestTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;C!==void 0&&(w=C,t!==void 0&&(t.requestTimeout=C))}var a=$===o;if(a){let P=t.bodyLimit,C=o;if(!(typeof P=="number"&&!(P%1)&&!isNaN(P)&&isFinite(P))){let M=typeof P,J;if(J===void 0)if(M==="boolean"||P===null||M==="string"&&P&&P==+P&&!(P%1))J=+P;else return ae.errors=[{instancePath:e+"/bodyLimit",schemaPath:"#/properties/bodyLimit/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;J!==void 0&&(P=J,t!==void 0&&(t.bodyLimit=J))}var a=C===o;if(a){let M=t.caseSensitive,J=o;if(typeof M!="boolean"){let H;if(H===void 0)if(M==="false"||M===0||M===null)H=!1;else if(M==="true"||M===1)H=!0;else return ae.errors=[{instancePath:e+"/caseSensitive",schemaPath:"#/properties/caseSensitive/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;H!==void 0&&(M=H,t!==void 0&&(t.caseSensitive=H))}var a=J===o;if(a){let H=t.allowUnsafeRegex,fe=o;if(typeof H!="boolean"){let G;if(G===void 0)if(H==="false"||H===0||H===null)G=!1;else if(H==="true"||H===1)G=!0;else return ae.errors=[{instancePath:e+"/allowUnsafeRegex",schemaPath:"#/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;G!==void 0&&(H=G,t!==void 0&&(t.allowUnsafeRegex=G))}var a=fe===o;if(a){if(t.http2!==void 0){let G=t.http2,wt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/http2",schemaPath:"#/properties/http2/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.http2=me))}var a=wt===o}else var a=!0;if(a){if(t.https!==void 0){let G=t.https,wt=o,xr=o,me=!0,pe=o,Hn=o,A=o,N=o,q=!1,j=null,ue=o;if(typeof G!="boolean"){let Y;if(Y===void 0)if(G==="false"||G===0||G===null)Y=!1;else if(G==="true"||G===1)Y=!0;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=ue===o;u&&(q=!0,j=0);let de=o;if(G!==null){let Y;if(Y===void 0)if(G===""||G===0||G===!1)Y=null;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=de===o;if(u&&q)q=!1,j=[j,1];else{u&&(q=!0,j=1);let Y=o;if(o===Y)if(G&&typeof G=="object"&&!Array.isArray(G)){let Pe;if(G.allowHTTP1===void 0&&(Pe="allowHTTP1")){let dt={};i===null?i=[dt]:i.push(dt),o++}else{let dt=o;for(let Xt in G)Xt!=="allowHTTP1"&&delete G[Xt];if(dt===o&&G.allowHTTP1!==void 0){let Xt=G.allowHTTP1;if(typeof Xt!="boolean"){let Ae;if(Ae===void 0)if(Xt==="false"||Xt===0||Xt===null)Ae=!1;else if(Xt==="true"||Xt===1)Ae=!0;else{let Qt={};i===null?i=[Qt]:i.push(Qt),o++}Ae!==void 0&&(Xt=Ae,G!==void 0&&(G.allowHTTP1=Ae))}}}}else{let Pe={};i===null?i=[Pe]:i.push(Pe),o++}var u=Y===o;u&&q?(q=!1,j=[j,2]):u&&(q=!0,j=2)}if(q)o=N,i!==null&&(N?i.length=N:i=null);else{let Y={};i===null?i=[Y]:i.push(Y),o++}var c=A===o;if(c){let Y={};i===null?i=[Y]:i.push(Y),o++}else o=Hn,i!==null&&(Hn?i.length=Hn:i=null);var f=pe===o;if(o=xr,i!==null&&(xr?i.length=xr:i=null),f){let Y=o;t.https=!0;var f=Y===o;me=f}if(!me){let Y={instancePath:e+"/https",schemaPath:"#/properties/https/if",keyword:"if",params:{failingKeyword:"then"},message:'must match "then" schema'};return i===null?i=[Y]:i.push(Y),o++,ae.errors=i,!1}var a=wt===o}else var a=!0;if(a){let G=t.ignoreTrailingSlash,wt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/ignoreTrailingSlash",schemaPath:"#/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.ignoreTrailingSlash=me))}var a=wt===o;if(a){let me=t.ignoreDuplicateSlashes,pe=o;if(typeof me!="boolean"){let A;if(A===void 0)if(me==="false"||me===0||me===null)A=!1;else if(me==="true"||me===1)A=!0;else return ae.errors=[{instancePath:e+"/ignoreDuplicateSlashes",schemaPath:"#/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;A!==void 0&&(me=A,t!==void 0&&(t.ignoreDuplicateSlashes=A))}var a=pe===o;if(a){let A=t.maxParamLength,N=o;if(!(typeof A=="number"&&!(A%1)&&!isNaN(A)&&isFinite(A))){let j=typeof A,ue;if(ue===void 0)if(j==="boolean"||A===null||j==="string"&&A&&A==+A&&!(A%1))ue=+A;else return ae.errors=[{instancePath:e+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;ue!==void 0&&(A=ue,t!==void 0&&(t.maxParamLength=ue))}var a=N===o;if(a){let j=t.onProtoPoisoning,ue=o;if(typeof j!="string"){let Me=typeof j,Y;if(Y===void 0)if(Me=="number"||Me=="boolean")Y=""+j;else if(j===null)Y="";else return ae.errors=[{instancePath:e+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Y!==void 0&&(j=Y,t!==void 0&&(t.onProtoPoisoning=Y))}var a=ue===o;if(a){let Me=t.onConstructorPoisoning,Y=o;if(typeof Me!="string"){let Pe=typeof Me,dt;if(dt===void 0)if(Pe=="number"||Pe=="boolean")dt=""+Me;else if(Me===null)dt="";else return ae.errors=[{instancePath:e+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;dt!==void 0&&(Me=dt,t!==void 0&&(t.onConstructorPoisoning=dt))}var a=Y===o;if(a){let Pe=t.pluginTimeout,dt=o;if(!(typeof Pe=="number"&&!(Pe%1)&&!isNaN(Pe)&&isFinite(Pe))){let Ae=typeof Pe,Qt;if(Qt===void 0)if(Ae==="boolean"||Pe===null||Ae==="string"&&Pe&&Pe==+Pe&&!(Pe%1))Qt=+Pe;else return ae.errors=[{instancePath:e+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;Qt!==void 0&&(Pe=Qt,t!==void 0&&(t.pluginTimeout=Qt))}var a=dt===o;if(a){let Ae=t.requestIdHeader,Qt=o,qu=o,Vn=!1,qA=o;if(typeof Ae!="boolean"){let Ue;if(Ue===void 0)if(Ae==="false"||Ae===0||Ae===null)Ue=!1;else if(Ae==="true"||Ae===1)Ue=!0;else{let No={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[No]:i.push(No),o++}Ue!==void 0&&(Ae=Ue,t!==void 0&&(t.requestIdHeader=Ue))}var p=qA===o;if(Vn=Vn||p,!Vn){let Ue=o;if(typeof Ae!="string"){let sg=typeof Ae,Ce;if(Ce===void 0)if(sg=="number"||sg=="boolean")Ce=""+Ae;else if(Ae===null)Ce="";else{let Ht={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[Ht]:i.push(Ht),o++}Ce!==void 0&&(Ae=Ce,t!==void 0&&(t.requestIdHeader=Ce))}var p=Ue===o;Vn=Vn||p}if(Vn)o=qu,i!==null&&(qu?i.length=qu:i=null);else{let Ue={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[Ue]:i.push(Ue),o++,ae.errors=i,!1}var a=Qt===o;if(a){let Ue=t.requestIdLogLabel,No=o;if(typeof Ue!="string"){let Ce=typeof Ue,Ht;if(Ht===void 0)if(Ce=="number"||Ce=="boolean")Ht=""+Ue;else if(Ue===null)Ht="";else return ae.errors=[{instancePath:e+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Ht!==void 0&&(Ue=Ht,t!==void 0&&(t.requestIdLogLabel=Ht))}var a=No===o;if(a){let Ce=t.http2SessionTimeout,Ht=o;if(!(typeof Ce=="number"&&!(Ce%1)&&!isNaN(Ce)&&isFinite(Ce))){let Zt=typeof Ce,un;if(un===void 0)if(Zt==="boolean"||Ce===null||Zt==="string"&&Ce&&Ce==+Ce&&!(Ce%1))un=+Ce;else return ae.errors=[{instancePath:e+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;un!==void 0&&(Ce=un,t!==void 0&&(t.http2SessionTimeout=un))}var a=Ht===o;if(a){let Zt=t.exposeHeadRoutes,un=o;if(typeof Zt!="boolean"){let ht;if(ht===void 0)if(Zt==="false"||Zt===0||Zt===null)ht=!1;else if(Zt==="true"||Zt===1)ht=!0;else return ae.errors=[{instancePath:e+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;ht!==void 0&&(Zt=ht,t!==void 0&&(t.exposeHeadRoutes=ht))}var a=un===o;if(a){let ht=t.useSemicolonDelimiter,jA=o;if(typeof ht!="boolean"){let Q;if(Q===void 0)if(ht==="false"||ht===0||ht===null)Q=!1;else if(ht==="true"||ht===1)Q=!0;else return ae.errors=[{instancePath:e+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Q!==void 0&&(ht=Q,t!==void 0&&(t.useSemicolonDelimiter=Q))}var a=jA===o;if(a){if(t.routerOptions!==void 0){let Q=t.routerOptions,Bs=o;if(o===Bs)if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Q.ignoreTrailingSlash===void 0&&(Q.ignoreTrailingSlash=!1),Q.ignoreDuplicateSlashes===void 0&&(Q.ignoreDuplicateSlashes=!1),Q.maxParamLength===void 0&&(Q.maxParamLength=100),Q.allowUnsafeRegex===void 0&&(Q.allowUnsafeRegex=!1),Q.useSemicolonDelimiter===void 0&&(Q.useSemicolonDelimiter=!1);let Pt=Q.ignoreTrailingSlash,Rt=o;if(typeof Pt!="boolean"){let Be;if(Be===void 0)if(Pt==="false"||Pt===0||Pt===null)Be=!1;else if(Pt==="true"||Pt===1)Be=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Be!==void 0&&(Pt=Be,Q!==void 0&&(Q.ignoreTrailingSlash=Be))}var h=Rt===o;if(h){let Be=Q.ignoreDuplicateSlashes,Lr=o;if(typeof Be!="boolean"){let Ie;if(Ie===void 0)if(Be==="false"||Be===0||Be===null)Ie=!1;else if(Be==="true"||Be===1)Ie=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Ie!==void 0&&(Be=Ie,Q!==void 0&&(Q.ignoreDuplicateSlashes=Ie))}var h=Lr===o;if(h){let Ie=Q.maxParamLength,qr=o;if(!(typeof Ie=="number"&&!(Ie%1)&&!isNaN(Ie)&&isFinite(Ie))){let er=typeof Ie,cn;if(cn===void 0)if(er==="boolean"||Ie===null||er==="string"&&Ie&&Ie==+Ie&&!(Ie%1))cn=+Ie;else return ae.errors=[{instancePath:e+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;cn!==void 0&&(Ie=cn,Q!==void 0&&(Q.maxParamLength=cn))}var h=qr===o;if(h){let er=Q.allowUnsafeRegex,cn=o;if(typeof er!="boolean"){let pt;if(pt===void 0)if(er==="false"||er===0||er===null)pt=!1;else if(er==="true"||er===1)pt=!0;else return ae.errors=[{instancePath:e+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;pt!==void 0&&(er=pt,Q!==void 0&&(Q.allowUnsafeRegex=pt))}var h=cn===o;if(h){let pt=Q.useSemicolonDelimiter,DA=o;if(typeof pt!="boolean"){let zn;if(zn===void 0)if(pt==="false"||pt===0||pt===null)zn=!1;else if(pt==="true"||pt===1)zn=!0;else return ae.errors=[{instancePath:e+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;zn!==void 0&&(pt=zn,Q!==void 0&&(Q.useSemicolonDelimiter=zn))}var h=DA===o}}}}}else return ae.errors=[{instancePath:e+"/routerOptions",schemaPath:"#/properties/routerOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Bs===o}else var a=!0;if(a)if(t.constraints!==void 0){let Q=t.constraints,Bs=o;if(o===Bs)if(Q&&typeof Q=="object"&&!Array.isArray(Q))for(let Pt in Q){let Rt=Q[Pt],Be=o;if(o===Be)if(Rt&&typeof Rt=="object"&&!Array.isArray(Rt)){let Lr;if(Rt.name===void 0&&(Lr="name")||Rt.storage===void 0&&(Lr="storage")||Rt.validate===void 0&&(Lr="validate")||Rt.deriveConstraint===void 0&&(Lr="deriveConstraint"))return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty:Lr},message:"must have required property '"+Lr+"'"}],!1;if(Rt.name!==void 0){let Gs=Rt.name;if(typeof Gs!="string"){let Ie=typeof Gs,qr;if(qr===void 0)if(Ie=="number"||Ie=="boolean")qr=""+Gs;else if(Gs===null)qr="";else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;qr!==void 0&&(Gs=qr,Rt!==void 0&&(Rt.name=qr))}}}else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var d=Be===o;if(!d)break}else return ae.errors=[{instancePath:e+"/constraints",schemaPath:"#/properties/constraints/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Bs===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}else return ae.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ae.errors=i,o===0}pu.exports.defaultInitOptions={connectionTimeout:0,keepAliveTimeout:72e3,maxRequestsPerSocket:0,requestTimeout:0,bodyLimit:1048576,caseSensitive:!0,allowUnsafeRegex:!1,disableRequestLogging:!1,ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,onProtoPoisoning:"error",onConstructorPoisoning:"error",pluginTimeout:1e4,requestIdHeader:!1,requestIdLogLabel:"reqId",http2SessionTimeout:72e3,exposeHeadRoutes:!0,useSemicolonDelimiter:!1,allowErrorHandlerOverride:!0,routerOptions:{ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,allowUnsafeRegex:!1,useSemicolonDelimiter:!1}}});var PP=E((eQ,gu)=>{"use strict";var mu=$P(),E6=ga()({circles:!0,proto:!1}),{FST_ERR_INIT_OPTS_INVALID:b6}=He();function v6(t){let e=E6(t);if(!mu(e)){let r=new b6(JSON.stringify(mu.errors.map(n=>n.message)));throw r.errors=mu.errors,r}return Tm(e)}function Tm(t){let e=Object.getOwnPropertyNames(t);for(let r of e){let n=t[r];ArrayBuffer.isView(n)&&!(n instanceof DataView)||(t[r]=n&&typeof n=="object"?Tm(n):n)}return Object.freeze(t)}gu.exports=v6;gu.exports.defaultInitOptions=mu.defaultInitOptions;gu.exports.utils={deepFreezeObject:Tm}});var jP=E((tQ,qP)=>{"use strict";var{kAvvioBoot:w6,kChildren:AP,kRoutePrefix:CP,kLogLevel:IP,kLogSerializers:$m,kHooks:Pm,kSchemaController:Vs,kContentTypeParser:NP,kReply:kP,kRequest:xP,kFourOhFour:R6,kPluginNameChain:LP,kErrorHandlerAlreadySet:O6}=De(),T6=Pa(),$6=xa(),P6=Np(),A6=Hf(),{buildHooks:C6}=Dr(),bo=nm();qP.exports=function(e,r,n){let s=bo.registerPlugin.call(e,r),i=bo.getPluginName(r)||bo.getFuncPreview(r);if(s)return e[LP].push(i),e;let o=Object.create(e);e[AP].push(o),o.ready=e[w6].bind(o),o[AP]=[],o[kP]=T6.buildReply(o[kP]),o[xP]=$6.buildRequest(o[xP]),o[NP]=A6.helpers.buildContentTypeParser(o[NP]),o[Pm]=C6(o[Pm]),o[CP]=I6(o[CP],n.prefix),o[IP]=n.logLevel||o[IP],o[Vs]=P6.buildSchemaController(e[Vs]),o.getSchema=o[Vs].getSchema.bind(o[Vs]),o.getSchemas=o[Vs].getSchemas.bind(o[Vs]),o[bo.kRegisteredPlugins]=Object.create(o[bo.kRegisteredPlugins]),o[LP]=[i],o[O6]=!1,(o[$m]||n.logSerializers)&&(o[$m]=Object.assign(Object.create(o[$m]),n.logSerializers)),n.prefix&&o[R6].arrange404(o);for(let a of o[Pm].onRegister)a.call(e,o,n);return o};function I6(t,e){return e?(t.endsWith("/")&&e[0]==="/"?e=e.slice(1):e[0]!=="/"&&(e="/"+e),t+e):t}});var VP=E(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.parseCookie=MP;gr.parse=MP;gr.stringifyCookie=j6;gr.stringifySetCookie=yu;gr.serialize=yu;gr.parseSetCookie=D6;gr.stringifySetCookie=yu;gr.serialize=yu;var DP=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,FP=/^[\u0021-\u003A\u003C-\u007E]*$/,N6=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,k6=/^[\u0020-\u003A\u003D-\u007E]*$/,x6=/^-?\d+$/,L6=Object.prototype.toString,q6=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function MP(t,e){let r=new q6,n=t.length;if(n<2)return r;let s=e?.decode||HP,i=0;do{let o=Cm(t,i,n);if(o===-1)break;let a=Am(t,i,n);if(o>a){i=t.lastIndexOf(";",o-1)+1;continue}let l=nn(t,i,o);r[l]===void 0&&(r[l]=s(nn(t,o+1,a))),i=a+1}while(i<n);return r}function j6(t,e){let r=e?.encode||encodeURIComponent,n=[];for(let s of Object.keys(t)){let i=t[s];if(i===void 0)continue;if(!DP.test(s))throw new TypeError(`cookie name is invalid: ${s}`);let o=r(i);if(!FP.test(o))throw new TypeError(`cookie val is invalid: ${i}`);n.push(`${s}=${o}`)}return n.join("; ")}function yu(t,e,r){let n=typeof t=="object"?t:{...r,name:t,value:String(e)},i=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!DP.test(n.name))throw new TypeError(`argument name is invalid: ${n.name}`);let o=n.value?i(n.value):"";if(!FP.test(o))throw new TypeError(`argument val is invalid: ${n.value}`);let a=n.name+"="+o;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!N6.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!k6.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!F6(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}return a}function D6(t,e){let r=e?.decode||HP,n=t.length,s=Am(t,0,n),i=Cm(t,0,s),o=i===-1?{name:"",value:r(nn(t,0,s))}:{name:nn(t,0,i),value:r(nn(t,i+1,s))},a=s+1;for(;a<n;){let l=Am(t,a,n),u=Cm(t,a,l),c=u===-1?nn(t,a,l):nn(t,a,u),f=u===-1?void 0:nn(t,u+1,l);switch(c.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=f;break;case"path":o.path=f;break;case"max-age":f&&x6.test(f)&&(o.maxAge=Number(f));break;case"expires":if(!f)break;let p=new Date(f);Number.isFinite(p.valueOf())&&(o.expires=p);break;case"priority":if(!f)break;let h=f.toLowerCase();(h==="low"||h==="medium"||h==="high")&&(o.priority=h);break;case"samesite":if(!f)break;let d=f.toLowerCase();(d==="lax"||d==="strict"||d==="none")&&(o.sameSite=d);break}a=l+1}return o}function Am(t,e,r){let n=t.indexOf(";",e);return n===-1?r:n}function Cm(t,e,r){let n=t.indexOf("=",e);return n<r?n:-1}function nn(t,e,r){let n=e,s=r;do{let i=t.charCodeAt(n);if(i!==32&&i!==9)break}while(++n<s);for(;s>n;){let i=t.charCodeAt(s-1);if(i!==32&&i!==9)break;s--}return t.slice(n,s)}function HP(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function F6(t){return L6.call(t)==="[object Date]"}});var UP=E((nQ,_u)=>{"use strict";var{format:Im}=V("node:util");function M6(t){return zP({...t,name:"DeprecationWarning"})}function zP({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=Im(r,o,a,l):o&&a?u=Im(r,o,a):o?u=Im(r,o):u=r,u},i}var Nm={createWarning:zP,createDeprecation:M6};_u.exports=Nm;_u.exports.default=Nm;_u.exports.processWarning=Nm});var WP=E((sQ,GP)=>{"use strict";var{URL:BP}=V("node:url"),km="http://localhost";GP.exports=function(e,r){(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]")&&e.startsWith("//")&&(e=km+e);let n=typeof e=="object"?Object.assign(new BP(km),e):new BP(e,km);if(typeof r=="string"){r=new URLSearchParams(r);for(let s of r.keys()){n.searchParams.delete(s);for(let i of r.getAll(s))n.searchParams.append(s,i)}}else{let s=Object.assign({},e.query,r);for(let i in s){let o=s[i];if(Array.isArray(o)){n.searchParams.delete(i);for(let a of o)n.searchParams.append(i,a)}else n.searchParams.set(i,o)}}return n}});var JP=E((iQ,xm)=>{"use strict";var{randomUUID:H6}=V("node:crypto"),{Readable:V6}=V("node:stream"),zs;function z6(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}function U6(t){zs=zs??new TextEncoder;let e=`----formdata-${H6()}`,r=`--${e}\r
|
|
367
367
|
Content-Disposition: form-data`;let n=l=>l.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),s=l=>l.replace(/\r?\n|\r/g,`\r
|
|
368
368
|
`),i=new Uint8Array([13,10]);async function*o(){for(let[l,u]of t)if(typeof u=="string")yield zs.encode(`${r}; name="${n(s(l))}"\r
|
|
369
369
|
\r
|
|
@@ -371,23 +371,23 @@ Content-Disposition: form-data`;let n=l=>l.replace(/\n/g,"%0A").replace(/\r/g,"%
|
|
|
371
371
|
`);else{let c=`${r}; name="${n(s(l))}"`;u.name&&(c+=`; filename="${n(u.name)}"`),c+=`\r
|
|
372
372
|
Content-Type: ${u.type||"application/octet-stream"}\r
|
|
373
373
|
\r
|
|
374
|
-
`,yield zs.encode(c),u.stream?yield*u.stream():yield u,yield i}yield zs.encode(`--${e}--`)}return{stream:F6.from(o()),contentType:`multipart/form-data; boundary=${e}`}}km.exports.isFormDataLike=M6;km.exports.formDataToStream=H6});var KP=E((YX,Su)=>{"use strict";var{Readable:WP,addAbortSignal:V6}=V("node:stream"),Lm=V("node:util"),z6=MP(),U6=V("node:assert"),{createDeprecation:B6}=VP(),G6=BP(),{isFormDataLike:W6,formDataToStream:J6}=GP(),{EventEmitter:K6}=V("node:events"),Y6=B6({name:"FastifyDeprecationLightMyRequest",code:"FST_LIGHTMYREQUEST_DEP01",message:'You are accessing "request.connection", use "request.socket" instead.'});function X6(t){return t.port?t.host:t.hostname+(t.protocol==="https:"?":443":":80")}var xm=class extends K6{constructor(e){super(),this.remoteAddress=e}};function JP(t){return new e(this);function e(r){sn.call(r,{...t,Request:void 0}),Object.assign(this,r);for(let n of Object.keys(sn.prototype))this.constructor.prototype[n]=sn.prototype[n];return Lm.inherits(this.constructor,t.Request),this}}function sn(t){WP.call(this,{autoDestroy:!1});let e=G6(t.url||t.path,t.query);this.url=e.pathname+e.search,this.aborted=!1,this.httpVersionMajor=1,this.httpVersionMinor=1,this.httpVersion="1.1",this.method=t.method?t.method.toUpperCase():"GET",this.headers={},this.rawHeaders=[];let r=t.headers||{};for(let o in r){let a=o.toLowerCase();if((a==="user-agent"||a==="content-type")&&r[o]===void 0){this.headers[a]=void 0;continue}let l=r[o];U6(l!==void 0,'invalid value "undefined" for header '+o),this.headers[a]=""+l}if("user-agent"in this.headers||(this.headers["user-agent"]="lightMyRequest"),this.headers.host=this.headers.host||t.authority||X6(e),t.cookies){let{cookies:o}=t,a=Object.keys(o).map(l=>z6.serialize(l,o[l]));this.headers.cookie&&a.unshift(this.headers.cookie),this.headers.cookie=a.join("; ")}this.socket=new xm(t.remoteAddress||"127.0.0.1"),Object.defineProperty(this,"connection",{get(){return Y6(),this.socket},configurable:!0});let n=t.payload||t.body||null,s=n&&typeof n.resume=="function";if(W6(n)){let o=J6(n);n=o.stream,s=!0,this.headers["content-type"]=o.contentType,this.headers["transfer-encoding"]="chunked"}n&&typeof n!="string"&&!s&&!Buffer.isBuffer(n)&&(n=JSON.stringify(n),"content-type"in this.headers||(this.headers["content-type"]="application/json")),n&&!s&&!Object.hasOwn(this.headers,"content-length")&&(this.headers["content-length"]=(Buffer.isBuffer(n)?n.length:Buffer.byteLength(n)).toString());for(let o of Object.keys(this.headers))this.rawHeaders.push(o,this.headers[o]);this._lightMyRequest={payload:n,isDone:!1,simulate:t.simulate||{},payloadAsStream:t.payloadAsStream,signal:t.signal};let i=t.signal;i&&V6(i,this);{let o=this._lightMyRequest.payload;o?._readableState?(this._read=Q6,o.on("error",a=>{this.destroy(a)}),o.on("end",()=>{this.push(null)})):this._read=Z6}return this}function Q6(){let t=this._lightMyRequest.payload,e=!0,r=!1,n;for(;e&&(n=t.read());)r=!0,e=this.push(n);e&&!r&&this._lightMyRequest.payload.once("readable",this._read.bind(this))}function Z6(){setImmediate(()=>{if(this._lightMyRequest.isDone){this._lightMyRequest.simulate.end!==!1&&this.push(null);return}this._lightMyRequest.isDone=!0,this._lightMyRequest.payload&&(this._lightMyRequest.simulate.split?(this.push(this._lightMyRequest.payload.slice(0,1)),this.push(this._lightMyRequest.payload.slice(1))):this.push(this._lightMyRequest.payload)),this._lightMyRequest.simulate.error&&this.emit("error",new Error("Simulated")),this._lightMyRequest.simulate.close&&this.emit("close"),this._lightMyRequest.simulate.end!==!1&&this.push(null)})}Lm.inherits(sn,WP);Lm.inherits(JP,sn);sn.prototype.destroy=function(t){this.destroyed||this._lightMyRequest.isDone||(this.destroyed=!0,t&&(this._error=!0,process.nextTick(()=>this.emit("error",t))),process.nextTick(()=>this.emit("close")))};Su.exports=sn;Su.exports.Request=sn;Su.exports.CustomRequest=JP});var XP=E((XX,vo)=>{"use strict";var Eu={decodeValues:!0,map:!1,silent:!1};function qm(t){return typeof t!="string"||t in{}}function jm(){return Object.create(null)}function Dm(t){return typeof t=="string"&&!!t.trim()}function Fm(t,e){var r=t.split(";").filter(Dm),n=r.shift(),s=eW(n),i=s.name,o=s.value;if(e=e?Object.assign({},Eu,e):Eu,qm(i))return null;try{o=e.decodeValues?decodeURIComponent(o):o}catch(l){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",l)}var a=jm();return a.name=i,a.value=o,r.forEach(function(l){var u=l.split("="),c=u.shift().trimLeft().toLowerCase();if(!qm(c)){var f=u.join("=");if(c==="expires")a.expires=new Date(f);else if(c==="max-age"){var p=parseInt(f,10);Number.isNaN(p)||(a.maxAge=p)}else c==="secure"?a.secure=!0:c==="httponly"?a.httpOnly=!0:c==="samesite"?a.sameSite=f:c==="partitioned"?a.partitioned=!0:c&&(a[c]=f)}}),a}function eW(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function YP(t,e){if(e=e?Object.assign({},Eu,e):Eu,!t)return e.map?jm():[];if(t.headers)if(typeof t.headers.getSetCookie=="function")t=t.headers.getSetCookie();else if(t.headers["set-cookie"])t=t.headers["set-cookie"];else{var r=t.headers[Object.keys(t.headers).find(function(s){return s.toLowerCase()==="set-cookie"})];!r&&t.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),t=r}if(Array.isArray(t)||(t=[t]),e.map){var n=jm();return t.filter(Dm).reduce(function(s,i){var o=Fm(i,e);return o&&!qm(o.name)&&(s[o.name]=o),s},n)}else return t.filter(Dm).map(function(s){return Fm(s,e)}).filter(Boolean)}function tW(t){if(Array.isArray(t))return t;if(typeof t!="string")return[];var e=[],r=0,n,s,i,o,a;function l(){for(;r<t.length&&/\s/.test(t.charAt(r));)r+=1;return r<t.length}function u(){return s=t.charAt(r),s!=="="&&s!==";"&&s!==","}for(;r<t.length;){for(n=r,a=!1;l();)if(s=t.charAt(r),s===","){for(i=r,r+=1,l(),o=r;r<t.length&&u();)r+=1;r<t.length&&t.charAt(r)==="="?(a=!0,r=o,e.push(t.substring(n,i)),n=r):r=i+1}else r+=1;(!a||r>=t.length)&&e.push(t.substring(n,t.length))}return e}vo.exports=YP;vo.exports.parse=YP;vo.exports.parseString=Fm;vo.exports.splitCookiesString=tW});var rA=E((QX,tA)=>{"use strict";var wo=V("node:http"),{Writable:rW,Readable:QP,addAbortSignal:nW}=V("node:stream"),sW=V("node:util"),iW=XP();function on(t,e,r){if(wo.ServerResponse.call(this,t),t._lightMyRequest?.payloadAsStream){let a=this.emit.bind(this,"drain");this._lightMyRequest={headers:null,trailers:{},stream:new QP({read:a})};let l=t._lightMyRequest.signal;l&&nW(l,this._lightMyRequest.stream)}else this._lightMyRequest={headers:null,trailers:{},payloadChunks:[]};this.setHeader("foo","bar"),this.removeHeader("foo"),this.assignSocket(oW()),this._promiseCallback=typeof r=="function";let n=!1,s=a=>{if(!n){if(n=!0,this._promiseCallback)return process.nextTick(()=>e(a));process.nextTick(()=>e(null,a))}};this._lightMyRequest.onEndSuccess=s;let i=!1,o=a=>{if(n){this._lightMyRequest.stream&&!i&&(a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._lightMyRequest.stream.destroy(a),this._lightMyRequest.stream.on("error",()=>{}));return}if(n=!0,a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._promiseCallback)return process.nextTick(()=>r(a));process.nextTick(()=>e(a,null))};this._lightMyRequest.stream?this.once("finish",()=>{i=!0,this._lightMyRequest.stream.push(null)}):this.once("finish",()=>{let a=ZP(this);a.raw.req=t,s(a)}),this.connection.once("error",o),this.once("error",o),this.once("close",o)}sW.inherits(on,wo.ServerResponse);on.prototype.setTimeout=function(t,e){return this.timeoutHandle=setTimeout(()=>{this.emit("timeout")},t),this.on("timeout",e),this};on.prototype.writeHead=function(){let t=wo.ServerResponse.prototype.writeHead.apply(this,arguments);return eA(this),this._lightMyRequest.stream&&this._lightMyRequest.onEndSuccess(ZP(this)),t};on.prototype.write=function(t,e,r){return this.timeoutHandle&&clearTimeout(this.timeoutHandle),wo.ServerResponse.prototype.write.call(this,t,e,r),this._lightMyRequest.stream?this._lightMyRequest.stream.push(Buffer.from(t,e)):(this._lightMyRequest.payloadChunks.push(Buffer.from(t,e)),!0)};on.prototype.end=function(t,e,r){t&&this.write(t,e),wo.ServerResponse.prototype.end.call(this,r),this.emit("finish"),this.destroy()};on.prototype.destroy=function(t){this.destroyed||(this.destroyed=!0,t&&process.nextTick(()=>this.emit("error",t)),process.nextTick(()=>this.emit("close")))};on.prototype.addTrailers=function(t){for(let e in t)this._lightMyRequest.trailers[e.toLowerCase().trim()]=t[e].toString().trim()};function ZP(t){t._lightMyRequest.headers===null&&eA(t),aW(t);let e={raw:{res:t},headers:t._lightMyRequest.headers,statusCode:t.statusCode,statusMessage:t.statusMessage,trailers:{},get cookies(){return iW.parse(this)}};if(e.trailers=t._lightMyRequest.trailers,t._lightMyRequest.payloadChunks){let r=Buffer.concat(t._lightMyRequest.payloadChunks);e.rawPayload=r,e.payload=r.toString(),e.body=e.payload,e.json=function(){return JSON.parse(e.payload)}}else e.json=function(){throw new Error("Response payload is not available with payloadAsStream: true")};return e.stream=function(){return t._lightMyRequest.stream?t._lightMyRequest.stream:QP.from(t._lightMyRequest.payloadChunks)},e}function oW(){return new rW({write(t,e,r){setImmediate(r)}})}function aW(t){let e=t._lightMyRequest.headers;for(let r of Object.keys(e)){let n=e[r];Array.isArray(n)?e[r]=n.map(s=>""+s):e[r]=""+n}}function eA(t){t._lightMyRequest.headers=Object.assign({},t.getHeaders()),["Date","Connection","Transfer-Encoding"].forEach(e=>{let r=new RegExp("\\r\\n"+e+": ([^\\r]*)\\r\\n"),n=t._header?.match(r);n&&(t._lightMyRequest.headers[e.toLowerCase()]=n[1])})}tA.exports=on});var nA=E((ZX,Mm)=>{"use strict";Mm.exports=Fe;Mm.exports.default=Fe;var lW={type:"object",properties:{url:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},path:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},cookies:{type:"object",additionalProperties:!0},headers:{type:"object",additionalProperties:!0},query:{anyOf:[{type:"object",additionalProperties:!0},{type:"string"}]},simulate:{type:"object",properties:{end:{type:"boolean"},split:{type:"boolean"},error:{type:"boolean"},close:{type:"boolean"}}},authority:{type:"string"},remoteAddress:{type:"string"},method:{type:"string",enum:["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE","acl","bind","checkout","connect","copy","delete","get","head","link","lock","m-search","merge","mkactivity","mkcalendar","mkcol","move","notify","options","patch","post","propfind","proppatch","purge","put","query","rebind","report","search","source","subscribe","trace","unbind","unlink","unlock","unsubscribe"]},validate:{type:"boolean"}},additionalProperties:!0,oneOf:[{required:["url"]},{required:["path"]}]};function Fe(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o,l=!1,u=null,c=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.url===void 0&&(y="url")){let R={instancePath:e,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=c===o;p&&(l=!0,u=0);let f=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.path===void 0&&(y="path")){let R={instancePath:e,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=f===o;if(p&&l?(l=!1,u=[u,1]):p&&(l=!0,u=1),l)o=a,i!==null&&(a?i.length=a:i=null);else{let y={instancePath:e,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:u},message:"must match exactly one schema in oneOf"};return i===null?i=[y]:i.push(y),o++,Fe.errors=i,!1}if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.url!==void 0){let y=t.url,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let P=typeof y,C;if(C===void 0)if(P=="number"||P=="boolean")C=""+y;else if(y===null)C="";else{let k={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[k]:i.push(k),o++}C!==void 0&&(y=C,t!==void 0&&(t.url=C))}var d=$===o;d&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let P;if(y.pathname===void 0&&(P="pathname")){let C={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/required",keyword:"required",params:{missingProperty:P},message:"must have required property '"+P+"'"};i===null?i=[C]:i.push(C),o++}else{if(y.protocol!==void 0){let C=y.protocol,k=o;if(typeof C!="string"){let M=typeof C,J;if(J===void 0)if(M=="number"||M=="boolean")J=""+C;else if(C===null)J="";else{let U={instancePath:e+"/url/protocol",schemaPath:"#/properties/url/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[U]:i.push(U),o++}J!==void 0&&(C=J,y!==void 0&&(y.protocol=J))}var h=k===o}else var h=!0;if(h){if(y.hostname!==void 0){let C=y.hostname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/hostname",schemaPath:"#/properties/url/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.hostname=U))}var h=k===o}else var h=!0;if(h)if(y.pathname!==void 0){let C=y.pathname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/pathname",schemaPath:"#/properties/url/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.pathname=U))}var h=k===o}else var h=!0}}}else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[P]:i.push(P),o++}var d=v===o;if(d&&O?(O=!1,w=[w,1]):d&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[P]:i.push(P),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.path!==void 0){let y=t.path,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.path=k))}var S=$===o;S&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let C;if(y.pathname===void 0&&(C="pathname")){let k={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/required",keyword:"required",params:{missingProperty:C},message:"must have required property '"+C+"'"};i===null?i=[k]:i.push(k),o++}else{if(y.protocol!==void 0){let k=y.protocol,M=o;if(typeof k!="string"){let J=typeof k,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+k;else if(k===null)U="";else{let H={instancePath:e+"/path/protocol",schemaPath:"#/properties/path/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(k=U,y!==void 0&&(y.protocol=U))}var g=M===o}else var g=!0;if(g){if(y.hostname!==void 0){let k=y.hostname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/hostname",schemaPath:"#/properties/path/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.hostname=H))}var g=M===o}else var g=!0;if(g)if(y.pathname!==void 0){let k=y.pathname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/pathname",schemaPath:"#/properties/path/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.pathname=H))}var g=M===o}else var g=!0}}}else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[C]:i.push(C),o++}var S=v===o;if(S&&O?(O=!1,w=[w,1]):S&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[C]:i.push(C),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.cookies!==void 0){let y=t.cookies,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/cookies",schemaPath:"#/properties/cookies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.headers!==void 0){let y=t.headers,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/headers",schemaPath:"#/properties/headers/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.query!==void 0){let y=t.query,R=o,T=o,O=!1,w=o;if(o===w&&!(y&&typeof y=="object"&&!Array.isArray(y))){let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[v]:i.push(v),o++}var b=w===o;if(O=O||b,!O){let v=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.query=k))}var b=v===o;O=O||b}if(O)o=T,i!==null&&(T?i.length=T:i=null);else{let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[v]:i.push(v),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.simulate!==void 0){let y=t.simulate,R=o;if(o===R)if(y&&typeof y=="object"&&!Array.isArray(y)){if(y.end!==void 0){let O=y.end,w=o;if(typeof O!="boolean"){let $;if($===void 0)if(O==="false"||O===0||O===null)$=!1;else if(O==="true"||O===1)$=!0;else return Fe.errors=[{instancePath:e+"/simulate/end",schemaPath:"#/properties/simulate/properties/end/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;$!==void 0&&(O=$,y!==void 0&&(y.end=$))}var _=w===o}else var _=!0;if(_){if(y.split!==void 0){let O=y.split,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/split",schemaPath:"#/properties/simulate/properties/split/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.split=v))}var _=w===o}else var _=!0;if(_){if(y.error!==void 0){let O=y.error,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/error",schemaPath:"#/properties/simulate/properties/error/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.error=v))}var _=w===o}else var _=!0;if(_)if(y.close!==void 0){let O=y.close,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/close",schemaPath:"#/properties/simulate/properties/close/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.close=v))}var _=w===o}else var _=!0}}}else return Fe.errors=[{instancePath:e+"/simulate",schemaPath:"#/properties/simulate/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.authority!==void 0){let y=t.authority,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/authority",schemaPath:"#/properties/authority/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.authority=w))}var m=R===o}else var m=!0;if(m){if(t.remoteAddress!==void 0){let y=t.remoteAddress,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/remoteAddress",schemaPath:"#/properties/remoteAddress/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.remoteAddress=w))}var m=R===o}else var m=!0;if(m){if(t.method!==void 0){let y=t.method,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.method=w))}if(!(y==="ACL"||y==="BIND"||y==="CHECKOUT"||y==="CONNECT"||y==="COPY"||y==="DELETE"||y==="GET"||y==="HEAD"||y==="LINK"||y==="LOCK"||y==="M-SEARCH"||y==="MERGE"||y==="MKACTIVITY"||y==="MKCALENDAR"||y==="MKCOL"||y==="MOVE"||y==="NOTIFY"||y==="OPTIONS"||y==="PATCH"||y==="POST"||y==="PROPFIND"||y==="PROPPATCH"||y==="PURGE"||y==="PUT"||y==="QUERY"||y==="REBIND"||y==="REPORT"||y==="SEARCH"||y==="SOURCE"||y==="SUBSCRIBE"||y==="TRACE"||y==="UNBIND"||y==="UNLINK"||y==="UNLOCK"||y==="UNSUBSCRIBE"||y==="acl"||y==="bind"||y==="checkout"||y==="connect"||y==="copy"||y==="delete"||y==="get"||y==="head"||y==="link"||y==="lock"||y==="m-search"||y==="merge"||y==="mkactivity"||y==="mkcalendar"||y==="mkcol"||y==="move"||y==="notify"||y==="options"||y==="patch"||y==="post"||y==="propfind"||y==="proppatch"||y==="purge"||y==="put"||y==="query"||y==="rebind"||y==="report"||y==="search"||y==="source"||y==="subscribe"||y==="trace"||y==="unbind"||y==="unlink"||y==="unlock"||y==="unsubscribe"))return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/enum",keyword:"enum",params:{allowedValues:lW.properties.method.enum},message:"must be equal to one of the allowed values"}],!1;var m=R===o}else var m=!0;if(m)if(t.validate!==void 0){let y=t.validate,R=o;if(typeof y!="boolean"){let O;if(O===void 0)if(y==="false"||y===0||y===null)O=!1;else if(y==="true"||y===1)O=!0;else return Fe.errors=[{instancePath:e+"/validate",schemaPath:"#/properties/validate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;O!==void 0&&(y=O,t!==void 0&&(t.validate=O))}var m=R===o}else var m=!0}}}}}}}}}else return Fe.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Fe.errors=i,o===0}});var oA=E((eQ,Oo)=>{"use strict";var uW=V("node:assert"),Hm=KP(),bu=rA(),wu="The dispatch function has already been invoked",sA=nA();function Vm(t,e,r){return r===void 0?new Ro(t,e):vu(t,e,r)}function cW(t,e){let r=t._lightMyRequest.payload;if(!r||r._readableState||typeof r.resume!="function")return e();let n=[];r.on("data",s=>n.push(Buffer.from(s))),r.on("end",()=>{let s=Buffer.concat(n);return t.headers["content-length"]=t.headers["content-length"]||""+s.length,delete t.headers["transfer-encoding"],t._lightMyRequest.payload=s,e()}),r.resume()}function iA(t,e,r,n){return r.once("error",function(s){this.destroyed&&n.destroy(s)}),r.once("close",function(){this.destroyed&&!this._error&&n.destroy()}),cW(r,()=>t.call(e,r,n))}function vu(t,e,r){if(e=typeof e=="string"?{url:e}:e,e.validate!==!1&&(uW(typeof t=="function","dispatchFunc should be a function"),!sA(e)))throw new Error(sA.errors.map(o=>o.message));let n=e.server||{},s=e.Request?Hm.CustomRequest:Hm;if(t.request&&t.request.app===t&&(Object.setPrototypeOf(Object.getPrototypeOf(t.request),s.prototype),Object.setPrototypeOf(Object.getPrototypeOf(t.response),bu.prototype)),typeof r=="function"){let i=new s(e),o=new bu(i,r);return iA(t,n,i,o)}else return new Promise((i,o)=>{let a=new s(e),l=new bu(a,i,o);iA(t,n,a,l)})}function Ro(t,e){typeof e=="string"?this.option={url:e}:this.option=Object.assign({},e),this.dispatch=t,this._hasInvoked=!1,this._promise=null,this.option.autoStart!==!1&&process.nextTick(()=>{this._hasInvoked||this.end()})}var fW=["delete","get","head","options","patch","post","put","trace"];fW.forEach(t=>{Ro.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(wu);return this.option.url=e,this.option.method=t.toUpperCase(),this}});var dW=["body","cookies","headers","payload","query"];dW.forEach(t=>{Ro.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(wu);return this.option[t]=e,this}});Ro.prototype.end=function(t){if(this._hasInvoked===!0||this._promise)throw new Error(wu);if(this._hasInvoked=!0,typeof t=="function")vu(this.dispatch,this.option,t);else return this._promise=vu(this.dispatch,this.option),this._promise};Object.getOwnPropertyNames(Promise.prototype).forEach(t=>{t!=="constructor"&&(Ro.prototype[t]=function(...e){if(!this._promise){if(this._hasInvoked===!0)throw new Error(wu);this._hasInvoked=!0,this._promise=vu(this.dispatch,this.option)}return this._promise[t](...e)})});function hW(t){return t instanceof Hm||t instanceof bu||t?.constructor?.name==="_CustomLMRRequest"}Oo.exports=Vm;Oo.exports.default=Vm;Oo.exports.inject=Vm;Oo.exports.isInjection=hW});var vA=E((tQ,Co)=>{"use strict";var pW="5.7.2",mW=ny(),$u=V("node:http"),gW=V("node:diagnostics_channel"),To,{kAvvioBoot:$o,kChildren:zm,kServerBindings:aA,kBodyLimit:yW,kSupportedHTTPMethods:jn,kRoutePrefix:lA,kLogLevel:_W,kLogSerializers:SW,kHooks:Um,kSchemaController:an,kRequestAcceptVersion:EW,kReplySerializerDefault:uA,kContentTypeParser:bW,kReply:vW,kRequest:wW,kFourOhFour:RW,kState:$e,kOptions:Bm,kPluginNameChain:Po,kSchemaErrorFormatter:Gm,kErrorHandler:Ru,kKeepAliveConnections:Wm,kChildLoggerFactory:Jm,kGenReqId:Km,kErrorHandlerAlreadySet:Ou}=De(),{createServer:OW}=Iy(),Ao=Pa(),Tu=xa(),TW=La(),Dn=di(),Fn=Mf(),cA=Ip(),{Hooks:$W,hookRunnerApplication:fA,supportedHooks:Ym}=Dr(),{createChildLogger:dA,defaultChildLoggerFactory:PW,createLogger:AW}=ai(),hA=rm(),{getGenReqId:pA,reqIdGenFactory:EA}=Yl(),{buildRouting:CW,validateBodyLimitOption:IW,buildRouterOptions:NW}=yP(),kW=RP(),bA=TP(),xW=LP(),{appendStackTrace:LW,AVVIO_ERRORS_MAP:mA,...Mn}=He(),qW=ac(),{defaultInitOptions:vt}=bA,{FST_ERR_ASYNC_CONSTRAINT:jW,FST_ERR_BAD_URL:DW,FST_ERR_OPTIONS_NOT_OBJ:FW,FST_ERR_QSP_NOT_FN:MW,FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:HW,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:VW,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:zW,FST_ERR_INSTANCE_ALREADY_LISTENING:UW,FST_ERR_REOPENED_CLOSE_SERVER:BW,FST_ERR_ROUTE_REWRITE_NOT_STR:GW,FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:gA,FST_ERR_ERROR_HANDLER_NOT_FN:WW,FST_ERR_ERROR_HANDLER_ALREADY_SET:JW,FST_ERR_ROUTE_METHOD_INVALID:KW}=Mn,{buildErrorHandler:yA}=ui(),{FSTWRN004:YW}=Kn(),_A=gW.channel("fastify.initialization");function Xm(t){let{options:e,genReqId:r,disableRequestLogging:n,hasLogger:s,initialConfig:i}=XW(t,P,C),o=CW(e.routerOptions),a=kW(e),l=me(o,e),{server:u,listen:c,forceCloseConnections:f,serverHasCloseAllConnections:p,serverHasCloseHttp2Sessions:h,keepAliveConnections:d}=OW(e,l),m=Ao.setupResponseListeners,g=cA.buildSchemaController(null,e.schemaController),S={[$e]:{listening:!1,closing:!1,started:!1,ready:!1,booting:!1,aborted:!1,readyResolver:null},[Wm]:d,[jn]:{bodyless:new Set(["GET","HEAD","TRACE"]),bodywith:new Set(["DELETE","OPTIONS","PATCH","PUT","POST"])},[Bm]:e,[zm]:[],[aA]:[],[yW]:e.bodyLimit,[lA]:"",[_W]:"",[SW]:null,[Um]:new $W,[an]:g,[Gm]:null,[Ru]:yA(),[Ou]:!1,[Jm]:e.childLoggerFactory||PW,[uA]:null,[bW]:new Fn(e.bodyLimit,e.onProtoPoisoning||vt.onProtoPoisoning,e.onConstructorPoisoning||vt.onConstructorPoisoning),[vW]:Ao.buildReply(Ao),[wW]:Tu.buildRequest(Tu,e.trustProxy),[RW]:a,[hA.kRegisteredPlugins]:[],[Po]:["fastify"],[$o]:null,[Km]:r,routing:l,delete:function(N,q,j){return o.prepareRoute.call(this,{method:"DELETE",url:N,options:q,handler:j})},get:function(N,q,j){return o.prepareRoute.call(this,{method:"GET",url:N,options:q,handler:j})},head:function(N,q,j){return o.prepareRoute.call(this,{method:"HEAD",url:N,options:q,handler:j})},trace:function(N,q,j){return o.prepareRoute.call(this,{method:"TRACE",url:N,options:q,handler:j})},patch:function(N,q,j){return o.prepareRoute.call(this,{method:"PATCH",url:N,options:q,handler:j})},post:function(N,q,j){return o.prepareRoute.call(this,{method:"POST",url:N,options:q,handler:j})},put:function(N,q,j){return o.prepareRoute.call(this,{method:"PUT",url:N,options:q,handler:j})},options:function(N,q,j){return o.prepareRoute.call(this,{method:"OPTIONS",url:N,options:q,handler:j})},all:function(N,q,j){return o.prepareRoute.call(this,{method:this.supportedMethods,url:N,options:q,handler:j})},route:function(N){return o.route.call(this,{options:N})},hasRoute:function(N){return o.hasRoute.call(this,{options:N})},findRoute:function(N){return o.findRoute(N)},log:e.logger,withTypeProvider:w,addHook:$,addSchema:v,getSchema:g.getSchema.bind(g),getSchemas:g.getSchemas.bind(g),setValidatorCompiler:J,setSerializerCompiler:H,setSchemaController:fe,setReplySerializer:ze,setSchemaErrorFormatter:U,setGenReqId:pe,addContentTypeParser:Fn.helpers.addContentTypeParser,hasContentTypeParser:Fn.helpers.hasContentTypeParser,getDefaultJsonParser:Fn.defaultParsers.getDefaultJsonParser,defaultTextParser:Fn.defaultParsers.defaultTextParser,removeContentTypeParser:Fn.helpers.removeContentTypeParser,removeAllContentTypeParsers:Fn.helpers.removeAllContentTypeParsers,register:null,after:null,ready:null,onClose:null,close:null,printPlugins:null,hasPlugin:function(A){return this[hA.kRegisteredPlugins].includes(A)||this[Po].includes(A)},listen:c,server:u,addresses:function(){let A=this[aA].map(N=>N.address());return A.push(this.server.address()),A.filter(N=>N)},decorate:Dn.add,hasDecorator:Dn.exist,decorateReply:Dn.decorateReply,decorateRequest:Dn.decorateRequest,hasRequestDecorator:Dn.existRequest,hasReplyDecorator:Dn.existReply,getDecorator:Dn.getInstanceDecorator,addHttpMethod:Hn,inject:T,printRoutes:xr,setNotFoundHandler:M,setErrorHandler:G,setChildLoggerFactory:wt,initialConfig:i,addConstraintStrategy:o.addConstraintStrategy.bind(o),hasConstraintStrategy:o.hasConstraintStrategy.bind(o)};Object.defineProperties(S,{listeningOrigin:{get(){let A=this.addresses().slice(-1).pop();if(typeof A=="string")return A;let N=A.family==="IPv6"?`[${A.address}]`:A.address;return`${this[Bm].https?"https":"http"}://${N}:${A.port}`}},pluginName:{configurable:!0,get(){return this[Po].length>1?this[Po].join(" -> "):this[Po][0]}},prefix:{configurable:!0,get(){return this[lA]}},validatorCompiler:{configurable:!0,get(){return this[an].getValidatorCompiler()}},serializerCompiler:{configurable:!0,get(){return this[an].getSerializerCompiler()}},childLoggerFactory:{configurable:!0,get(){return this[Jm]}},version:{configurable:!0,get(){return pW}},errorHandler:{configurable:!0,get(){return this[Ru].func}},genReqId:{configurable:!0,get(){return this[Km]}},supportedMethods:{configurable:!1,get(){return[...this[jn].bodyless,...this[jn].bodywith]}}}),e.schemaErrorFormatter&&(SA(e.schemaErrorFormatter),S[Gm]=e.schemaErrorFormatter.bind(S));let b=Number(e.pluginTimeout),_=mW(S,{autostart:!1,timeout:isNaN(b)===!1?b:vt.pluginTimeout,expose:{use:"register"}});_.override=xW,_.on("start",()=>S[$e].started=!0),S[$o]=S.ready,S.ready=O,S.printPlugins=_.prettyPrint.bind(_),_.once("preReady",()=>{S.onClose((A,N)=>{S[$e].closing=!0,o.closeRoutes(),fA("preClose",S[$o],S,function(){if(S[$e].listening){if(f==="idle")A.server.closeIdleConnections();else if(p&&f)A.server.closeAllConnections();else if(f===!0)for(let q of S[Wm])q.destroy(),S[Wm].delete(q)}h&&A.server.closeHttp2Sessions(),!e.serverFactory||S[$e].listening?A.server.close(function(q){q&&q.code!=="ERR_SERVER_NOT_RUNNING"?N(null):N()}):process.nextTick(N,null)})})});let y=new TW({server:S,config:{}});return S.setNotFoundHandler(),a.arrange404(S),o.setup(e,{avvio:_,fourOhFour:a,hasLogger:s,setupResponseListeners:m,throwIfAlreadyStarted:R,keepAliveConnections:d}),u.on("clientError",e.clientErrorHandler.bind(S)),_A.hasSubscribers&&_A.publish({fastify:S}),"asyncDispose"in Symbol&&(S[Symbol.asyncDispose]=function(){return S.close()}),S;function R(A){if(S[$e].started)throw new UW(A)}function T(A,N){if(To===void 0&&(To=oA()),S[$e].started){if(S[$e].closing){let q=new BW;if(N){N(q);return}else return Promise.reject(q)}return To(l,A,N)}if(N)this.ready(q=>{q?N(q,null):To(l,A,N)});else return To((q,j)=>{this.ready(function(ue){if(ue){j.emit("error",ue);return}l(q,j)})},A)}function O(A){if(this[$e].readyResolver!==null){if(A!=null){this[$e].readyResolver.promise.then(()=>A(null,S),A);return}return this[$e].readyResolver.promise}if(process.nextTick(N),this[$e].readyResolver=qW.withResolvers(),A)this[$e].readyResolver.promise.then(()=>A(null,S),A);else return this[$e].readyResolver.promise;function N(){S[$o]((j,ue)=>{j||S[$e].started||S[$e].ready||S[$e].booting?q(j):(S[$e].booting=!0,fA("onReady",S[$o],S,q)),ue()})}function q(j){if(j=j!=null&&mA[j.code]!=null?LW(j,new mA[j.code](j.message)):j,j)return S[$e].readyResolver.reject(j);S[$e].readyResolver.resolve(S),S[$e].booting=!1,S[$e].ready=!0,S[$e].readyResolver=null}}function w(){return this}function $(A,N){if(R('Cannot call "addHook"!'),N==null)throw new Mn.FST_ERR_HOOK_INVALID_HANDLER(A,N);if(A==="onSend"||A==="preSerialization"||A==="onError"||A==="preParsing"){if(N.constructor.name==="AsyncFunction"&&N.length===4)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onReady"||A==="onListen"){if(N.constructor.name==="AsyncFunction"&&N.length!==0)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onRequestAbort"){if(N.constructor.name==="AsyncFunction"&&N.length!==1)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(N.constructor.name==="AsyncFunction"&&N.length===3)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER;return A==="onClose"?this.onClose(N.bind(this)):A==="onReady"||A==="onListen"||A==="onRoute"?this[Um].add(A,N):this.after((j,ue)=>{try{q.call(this,A,N),ue(j)}catch(de){ue(de)}}),this;function q(j,ue){this[Um].add(j,ue),this[zm].forEach(de=>q.call(de,j,ue))}}function v(A){return R('Cannot call "addSchema"!'),this[an].add(A),this[zm].forEach(N=>N.addSchema(A)),this}function P(A,N){A.headers["accept-version"]!==void 0&&(A.headers[EW]=A.headers["accept-version"],A.headers["accept-version"]=void 0),a.router.lookup(A,N)}function C(A,N,q){if(e.frameworkErrors){let ue=pA(y.server,N),de=dA(y,e.logger,N,ue),Me=new Tu(ue,null,N,null,de,y),Y=new Ao(q,Me,de);return(typeof n=="function"?n(N):n)===!1&&de.info({req:Me},"incoming request"),e.frameworkErrors(new DW(A),Me,Y)}let j=JSON.stringify({error:"Bad Request",code:"FST_ERR_BAD_URL",message:`'${A}' is not a valid url component`,statusCode:400});q.writeHead(400,{"Content-Type":"application/json","Content-Length":Buffer.byteLength(j)}),q.end(j)}function k(A,N,q){if(A!==!1)return function(ue){if(ue){if(e.frameworkErrors){let Me=pA(y.server,N),Y=dA(y,e.logger,N,Me),$t=new Tu(Me,null,N,null,Y,y),Pe=new Ao(q,$t,Y);return(typeof n=="function"?n(N):n)===!1&&Y.info({req:$t},"incoming request"),e.frameworkErrors(new jW,$t,Pe)}let de='{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}';q.writeHead(500,{"Content-Type":"application/json","Content-Length":de.length}),q.end(de)}}}function M(A,N){return R('Cannot call "setNotFoundHandler"!'),a.setNotFoundHandler.call(this,A,N,_,o.routeHandler),this}function J(A){return R('Cannot call "setValidatorCompiler"!'),this[an].setValidatorCompiler(A),this}function U(A){return R('Cannot call "setSchemaErrorFormatter"!'),SA(A),this[Gm]=A.bind(this),this}function H(A){return R('Cannot call "setSerializerCompiler"!'),this[an].setSerializerCompiler(A),this}function fe(A){R('Cannot call "setSchemaController"!');let N=this[an],q=cA.buildSchemaController(N,Object.assign({},N.opts,A));return this[an]=q,this.getSchema=q.getSchema.bind(q),this.getSchemas=q.getSchemas.bind(q),this}function ze(A){return R('Cannot call "setReplySerializer"!'),this[uA]=A,this}function G(A){if(R('Cannot call "setErrorHandler"!'),typeof A!="function")throw new WW;if(!e.allowErrorHandlerOverride&&this[Ou])throw new JW;return this[Ou]&&YW("To disable this behavior, set 'allowErrorHandlerOverride' to false or ignore this message. For more information, visit: https://fastify.dev/docs/latest/Reference/Server/#allowerrorhandleroverride"),this[Ou]=!0,this[Ru]=yA(this[Ru],A.bind(this)),this}function wt(A){return R('Cannot call "setChildLoggerFactory"!'),this[Jm]=A,this}function xr(A={}){return A.includeMeta=A.includeHooks?A.includeMeta?Ym.concat(A.includeMeta):Ym:A.includeMeta,o.printRoutes(A)}function me(A,{rewriteUrl:N,logger:q}){let j;return function(de,Me){if(j===void 0&&(j=A.isAsyncConstraint()),N){de.originalUrl=de.url;let Y=N.call(S,de);if(typeof Y=="string")de.url=Y;else{let $t=new GW(de.url,typeof Y);de.destroy($t)}}A.routing(de,Me,k(j,de,Me))}}function pe(A){return R('Cannot call "setGenReqId"!'),this[Km]=EA(this[Bm].requestIdHeader,A),this}function Hn(A,{hasBody:N=!1}={}){if(typeof A!="string"||$u.METHODS.indexOf(A)===-1)throw new KW;N===!0?(this[jn].bodywith.add(A),this[jn].bodyless.delete(A)):(this[jn].bodywith.delete(A),this[jn].bodyless.add(A));let q=A.toLowerCase();return this.hasDecorator(q)||this.decorate(q,function(j,ue,de){return o.prepareRoute.call(this,{method:A,url:j,options:ue,handler:de})}),this}}function XW(t,e,r){if(t&&typeof t!="object")throw new FW;if(t=Object.assign({},t),t.querystringParser&&typeof t.querystringParser!="function"||t.routerOptions?.querystringParser&&typeof t.routerOptions.querystringParser!="function")throw new MW(typeof(t.querystringParser??t.routerOptions.querystringParser));if(t.schemaController&&t.schemaController.bucket&&typeof t.schemaController.bucket!="function")throw new HW(typeof t.schemaController.bucket);IW(t.bodyLimit);let n=typeof t.requestIdHeader=="string"&&t.requestIdHeader.length!==0?t.requestIdHeader.toLowerCase():t.requestIdHeader===!0&&"request-id",s=EA(n,t.genReqId),i=t.requestIdLogLabel||"reqId";t.bodyLimit=t.bodyLimit||vt.bodyLimit;let o=t.disableRequestLogging||!1,a=Object.assign({customOptions:{},plugins:[]},t.ajv);if(!a.customOptions||Object.prototype.toString.call(a.customOptions)!=="[object Object]")throw new VW(typeof a.customOptions);if(!a.plugins||!Array.isArray(a.plugins))throw new zW(typeof a.plugins);let{logger:l,hasLogger:u}=AW(t);t.connectionTimeout=t.connectionTimeout||vt.connectionTimeout,t.keepAliveTimeout=t.keepAliveTimeout||vt.keepAliveTimeout,t.maxRequestsPerSocket=t.maxRequestsPerSocket||vt.maxRequestsPerSocket,t.requestTimeout=t.requestTimeout||vt.requestTimeout,t.logger=l,t.requestIdHeader=n,t.requestIdLogLabel=i,t.disableRequestLogging=o,t.ajv=a,t.clientErrorHandler=t.clientErrorHandler||ZW,t.allowErrorHandlerOverride=t.allowErrorHandlerOverride??vt.allowErrorHandlerOverride;let c=bA(t);return t.exposeHeadRoutes=c.exposeHeadRoutes,t.http2SessionTimeout=c.http2SessionTimeout,t.routerOptions=NW(t,{defaultRoute:e,onBadUrl:r,ignoreTrailingSlash:vt.ignoreTrailingSlash,ignoreDuplicateSlashes:vt.ignoreDuplicateSlashes,maxParamLength:vt.maxParamLength,allowUnsafeRegex:vt.allowUnsafeRegex,buildPrettyMeta:QW,useSemicolonDelimiter:vt.useSemicolonDelimiter}),{options:t,genReqId:s,disableRequestLogging:o,hasLogger:u,initialConfig:c}}function QW(t){let e={};return["errorHandler","logLevel","logSerializers"].concat(Ym).forEach(n=>{e[n]=t.store[n]}),Object.assign({},e)}function ZW(t,e){if(t.code==="ECONNRESET"||e.destroyed)return;let r,n,s,i;t.code==="ERR_HTTP_REQUEST_TIMEOUT"?(n="408",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Timeout","statusCode":408}`,i="timeout"):t.code==="HPE_HEADER_OVERFLOW"?(n="431",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Exceeded maximum allowed HTTP header size","statusCode":431}`,i="header_overflow"):(n="400",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Error","statusCode":400}`,i="error"),this.log.trace({err:t},`client ${i}`),e.writable&&e.write(`HTTP/1.1 ${n} ${s}\r
|
|
374
|
+
`,yield zs.encode(c),u.stream?yield*u.stream():yield u,yield i}yield zs.encode(`--${e}--`)}return{stream:V6.from(o()),contentType:`multipart/form-data; boundary=${e}`}}xm.exports.isFormDataLike=z6;xm.exports.formDataToStream=U6});var XP=E((oQ,Su)=>{"use strict";var{Readable:KP,addAbortSignal:B6}=V("node:stream"),qm=V("node:util"),G6=VP(),W6=V("node:assert"),{createDeprecation:J6}=UP(),K6=WP(),{isFormDataLike:Y6,formDataToStream:X6}=JP(),{EventEmitter:Q6}=V("node:events"),Z6=J6({name:"FastifyDeprecationLightMyRequest",code:"FST_LIGHTMYREQUEST_DEP01",message:'You are accessing "request.connection", use "request.socket" instead.'});function eW(t){return t.port?t.host:t.hostname+(t.protocol==="https:"?":443":":80")}var Lm=class extends Q6{constructor(e){super(),this.remoteAddress=e}};function YP(t){return new e(this);function e(r){sn.call(r,{...t,Request:void 0}),Object.assign(this,r);for(let n of Object.keys(sn.prototype))this.constructor.prototype[n]=sn.prototype[n];return qm.inherits(this.constructor,t.Request),this}}function sn(t){KP.call(this,{autoDestroy:!1});let e=K6(t.url||t.path,t.query);this.url=e.pathname+e.search,this.aborted=!1,this.httpVersionMajor=1,this.httpVersionMinor=1,this.httpVersion="1.1",this.method=t.method?t.method.toUpperCase():"GET",this.headers={},this.rawHeaders=[];let r=t.headers||{};for(let o in r){let a=o.toLowerCase();if((a==="user-agent"||a==="content-type")&&r[o]===void 0){this.headers[a]=void 0;continue}let l=r[o];W6(l!==void 0,'invalid value "undefined" for header '+o),this.headers[a]=""+l}if("user-agent"in this.headers||(this.headers["user-agent"]="lightMyRequest"),this.headers.host=this.headers.host||t.authority||eW(e),t.cookies){let{cookies:o}=t,a=Object.keys(o).map(l=>G6.serialize(l,o[l]));this.headers.cookie&&a.unshift(this.headers.cookie),this.headers.cookie=a.join("; ")}this.socket=new Lm(t.remoteAddress||"127.0.0.1"),Object.defineProperty(this,"connection",{get(){return Z6(),this.socket},configurable:!0});let n=t.payload||t.body||null,s=n&&typeof n.resume=="function";if(Y6(n)){let o=X6(n);n=o.stream,s=!0,this.headers["content-type"]=o.contentType,this.headers["transfer-encoding"]="chunked"}n&&typeof n!="string"&&!s&&!Buffer.isBuffer(n)&&(n=JSON.stringify(n),"content-type"in this.headers||(this.headers["content-type"]="application/json")),n&&!s&&!Object.hasOwn(this.headers,"content-length")&&(this.headers["content-length"]=(Buffer.isBuffer(n)?n.length:Buffer.byteLength(n)).toString());for(let o of Object.keys(this.headers))this.rawHeaders.push(o,this.headers[o]);this._lightMyRequest={payload:n,isDone:!1,simulate:t.simulate||{},payloadAsStream:t.payloadAsStream,signal:t.signal};let i=t.signal;i&&B6(i,this);{let o=this._lightMyRequest.payload;o?._readableState?(this._read=tW,o.on("error",a=>{this.destroy(a)}),o.on("end",()=>{this.push(null)})):this._read=rW}return this}function tW(){let t=this._lightMyRequest.payload,e=!0,r=!1,n;for(;e&&(n=t.read());)r=!0,e=this.push(n);e&&!r&&this._lightMyRequest.payload.once("readable",this._read.bind(this))}function rW(){setImmediate(()=>{if(this._lightMyRequest.isDone){this._lightMyRequest.simulate.end!==!1&&this.push(null);return}this._lightMyRequest.isDone=!0,this._lightMyRequest.payload&&(this._lightMyRequest.simulate.split?(this.push(this._lightMyRequest.payload.slice(0,1)),this.push(this._lightMyRequest.payload.slice(1))):this.push(this._lightMyRequest.payload)),this._lightMyRequest.simulate.error&&this.emit("error",new Error("Simulated")),this._lightMyRequest.simulate.close&&this.emit("close"),this._lightMyRequest.simulate.end!==!1&&this.push(null)})}qm.inherits(sn,KP);qm.inherits(YP,sn);sn.prototype.destroy=function(t){this.destroyed||this._lightMyRequest.isDone||(this.destroyed=!0,t&&(this._error=!0,process.nextTick(()=>this.emit("error",t))),process.nextTick(()=>this.emit("close")))};Su.exports=sn;Su.exports.Request=sn;Su.exports.CustomRequest=YP});var ZP=E((aQ,vo)=>{"use strict";var Eu={decodeValues:!0,map:!1,silent:!1};function jm(t){return typeof t!="string"||t in{}}function Dm(){return Object.create(null)}function Fm(t){return typeof t=="string"&&!!t.trim()}function Mm(t,e){var r=t.split(";").filter(Fm),n=r.shift(),s=nW(n),i=s.name,o=s.value;if(e=e?Object.assign({},Eu,e):Eu,jm(i))return null;try{o=e.decodeValues?decodeURIComponent(o):o}catch(l){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",l)}var a=Dm();return a.name=i,a.value=o,r.forEach(function(l){var u=l.split("="),c=u.shift().trimLeft().toLowerCase();if(!jm(c)){var f=u.join("=");if(c==="expires")a.expires=new Date(f);else if(c==="max-age"){var p=parseInt(f,10);Number.isNaN(p)||(a.maxAge=p)}else c==="secure"?a.secure=!0:c==="httponly"?a.httpOnly=!0:c==="samesite"?a.sameSite=f:c==="partitioned"?a.partitioned=!0:c&&(a[c]=f)}}),a}function nW(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function QP(t,e){if(e=e?Object.assign({},Eu,e):Eu,!t)return e.map?Dm():[];if(t.headers)if(typeof t.headers.getSetCookie=="function")t=t.headers.getSetCookie();else if(t.headers["set-cookie"])t=t.headers["set-cookie"];else{var r=t.headers[Object.keys(t.headers).find(function(s){return s.toLowerCase()==="set-cookie"})];!r&&t.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),t=r}if(Array.isArray(t)||(t=[t]),e.map){var n=Dm();return t.filter(Fm).reduce(function(s,i){var o=Mm(i,e);return o&&!jm(o.name)&&(s[o.name]=o),s},n)}else return t.filter(Fm).map(function(s){return Mm(s,e)}).filter(Boolean)}function sW(t){if(Array.isArray(t))return t;if(typeof t!="string")return[];var e=[],r=0,n,s,i,o,a;function l(){for(;r<t.length&&/\s/.test(t.charAt(r));)r+=1;return r<t.length}function u(){return s=t.charAt(r),s!=="="&&s!==";"&&s!==","}for(;r<t.length;){for(n=r,a=!1;l();)if(s=t.charAt(r),s===","){for(i=r,r+=1,l(),o=r;r<t.length&&u();)r+=1;r<t.length&&t.charAt(r)==="="?(a=!0,r=o,e.push(t.substring(n,i)),n=r):r=i+1}else r+=1;(!a||r>=t.length)&&e.push(t.substring(n,t.length))}return e}vo.exports=QP;vo.exports.parse=QP;vo.exports.parseString=Mm;vo.exports.splitCookiesString=sW});var sA=E((lQ,nA)=>{"use strict";var wo=V("node:http"),{Writable:iW,Readable:eA,addAbortSignal:oW}=V("node:stream"),aW=V("node:util"),lW=ZP();function on(t,e,r){if(wo.ServerResponse.call(this,t),t._lightMyRequest?.payloadAsStream){let a=this.emit.bind(this,"drain");this._lightMyRequest={headers:null,trailers:{},stream:new eA({read:a})};let l=t._lightMyRequest.signal;l&&oW(l,this._lightMyRequest.stream)}else this._lightMyRequest={headers:null,trailers:{},payloadChunks:[]};this.setHeader("foo","bar"),this.removeHeader("foo"),this.assignSocket(uW()),this._promiseCallback=typeof r=="function";let n=!1,s=a=>{if(!n){if(n=!0,this._promiseCallback)return process.nextTick(()=>e(a));process.nextTick(()=>e(null,a))}};this._lightMyRequest.onEndSuccess=s;let i=!1,o=a=>{if(n){this._lightMyRequest.stream&&!i&&(a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._lightMyRequest.stream.destroy(a),this._lightMyRequest.stream.on("error",()=>{}));return}if(n=!0,a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._promiseCallback)return process.nextTick(()=>r(a));process.nextTick(()=>e(a,null))};this._lightMyRequest.stream?this.once("finish",()=>{i=!0,this._lightMyRequest.stream.push(null)}):this.once("finish",()=>{let a=tA(this);a.raw.req=t,s(a)}),this.connection.once("error",o),this.once("error",o),this.once("close",o)}aW.inherits(on,wo.ServerResponse);on.prototype.setTimeout=function(t,e){return this.timeoutHandle=setTimeout(()=>{this.emit("timeout")},t),this.on("timeout",e),this};on.prototype.writeHead=function(){let t=wo.ServerResponse.prototype.writeHead.apply(this,arguments);return rA(this),this._lightMyRequest.stream&&this._lightMyRequest.onEndSuccess(tA(this)),t};on.prototype.write=function(t,e,r){return this.timeoutHandle&&clearTimeout(this.timeoutHandle),wo.ServerResponse.prototype.write.call(this,t,e,r),this._lightMyRequest.stream?this._lightMyRequest.stream.push(Buffer.from(t,e)):(this._lightMyRequest.payloadChunks.push(Buffer.from(t,e)),!0)};on.prototype.end=function(t,e,r){t&&this.write(t,e),wo.ServerResponse.prototype.end.call(this,r),this.emit("finish"),this.destroy()};on.prototype.destroy=function(t){this.destroyed||(this.destroyed=!0,t&&process.nextTick(()=>this.emit("error",t)),process.nextTick(()=>this.emit("close")))};on.prototype.addTrailers=function(t){for(let e in t)this._lightMyRequest.trailers[e.toLowerCase().trim()]=t[e].toString().trim()};function tA(t){t._lightMyRequest.headers===null&&rA(t),cW(t);let e={raw:{res:t},headers:t._lightMyRequest.headers,statusCode:t.statusCode,statusMessage:t.statusMessage,trailers:{},get cookies(){return lW.parse(this)}};if(e.trailers=t._lightMyRequest.trailers,t._lightMyRequest.payloadChunks){let r=Buffer.concat(t._lightMyRequest.payloadChunks);e.rawPayload=r,e.payload=r.toString(),e.body=e.payload,e.json=function(){return JSON.parse(e.payload)}}else e.json=function(){throw new Error("Response payload is not available with payloadAsStream: true")};return e.stream=function(){return t._lightMyRequest.stream?t._lightMyRequest.stream:eA.from(t._lightMyRequest.payloadChunks)},e}function uW(){return new iW({write(t,e,r){setImmediate(r)}})}function cW(t){let e=t._lightMyRequest.headers;for(let r of Object.keys(e)){let n=e[r];Array.isArray(n)?e[r]=n.map(s=>""+s):e[r]=""+n}}function rA(t){t._lightMyRequest.headers=Object.assign({},t.getHeaders()),["Date","Connection","Transfer-Encoding"].forEach(e=>{let r=new RegExp("\\r\\n"+e+": ([^\\r]*)\\r\\n"),n=t._header?.match(r);n&&(t._lightMyRequest.headers[e.toLowerCase()]=n[1])})}nA.exports=on});var iA=E((uQ,Hm)=>{"use strict";Hm.exports=Fe;Hm.exports.default=Fe;var fW={type:"object",properties:{url:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},path:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},cookies:{type:"object",additionalProperties:!0},headers:{type:"object",additionalProperties:!0},query:{anyOf:[{type:"object",additionalProperties:!0},{type:"string"}]},simulate:{type:"object",properties:{end:{type:"boolean"},split:{type:"boolean"},error:{type:"boolean"},close:{type:"boolean"}}},authority:{type:"string"},remoteAddress:{type:"string"},method:{type:"string",enum:["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE","acl","bind","checkout","connect","copy","delete","get","head","link","lock","m-search","merge","mkactivity","mkcalendar","mkcol","move","notify","options","patch","post","propfind","proppatch","purge","put","query","rebind","report","search","source","subscribe","trace","unbind","unlink","unlock","unsubscribe"]},validate:{type:"boolean"}},additionalProperties:!0,oneOf:[{required:["url"]},{required:["path"]}]};function Fe(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o,l=!1,u=null,c=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.url===void 0&&(y="url")){let R={instancePath:e,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=c===o;p&&(l=!0,u=0);let f=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.path===void 0&&(y="path")){let R={instancePath:e,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=f===o;if(p&&l?(l=!1,u=[u,1]):p&&(l=!0,u=1),l)o=a,i!==null&&(a?i.length=a:i=null);else{let y={instancePath:e,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:u},message:"must match exactly one schema in oneOf"};return i===null?i=[y]:i.push(y),o++,Fe.errors=i,!1}if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.url!==void 0){let y=t.url,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let P=typeof y,C;if(C===void 0)if(P=="number"||P=="boolean")C=""+y;else if(y===null)C="";else{let k={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[k]:i.push(k),o++}C!==void 0&&(y=C,t!==void 0&&(t.url=C))}var d=$===o;d&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let P;if(y.pathname===void 0&&(P="pathname")){let C={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/required",keyword:"required",params:{missingProperty:P},message:"must have required property '"+P+"'"};i===null?i=[C]:i.push(C),o++}else{if(y.protocol!==void 0){let C=y.protocol,k=o;if(typeof C!="string"){let M=typeof C,J;if(J===void 0)if(M=="number"||M=="boolean")J=""+C;else if(C===null)J="";else{let U={instancePath:e+"/url/protocol",schemaPath:"#/properties/url/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[U]:i.push(U),o++}J!==void 0&&(C=J,y!==void 0&&(y.protocol=J))}var h=k===o}else var h=!0;if(h){if(y.hostname!==void 0){let C=y.hostname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/hostname",schemaPath:"#/properties/url/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.hostname=U))}var h=k===o}else var h=!0;if(h)if(y.pathname!==void 0){let C=y.pathname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/pathname",schemaPath:"#/properties/url/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.pathname=U))}var h=k===o}else var h=!0}}}else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[P]:i.push(P),o++}var d=v===o;if(d&&O?(O=!1,w=[w,1]):d&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[P]:i.push(P),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.path!==void 0){let y=t.path,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.path=k))}var S=$===o;S&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let C;if(y.pathname===void 0&&(C="pathname")){let k={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/required",keyword:"required",params:{missingProperty:C},message:"must have required property '"+C+"'"};i===null?i=[k]:i.push(k),o++}else{if(y.protocol!==void 0){let k=y.protocol,M=o;if(typeof k!="string"){let J=typeof k,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+k;else if(k===null)U="";else{let H={instancePath:e+"/path/protocol",schemaPath:"#/properties/path/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(k=U,y!==void 0&&(y.protocol=U))}var g=M===o}else var g=!0;if(g){if(y.hostname!==void 0){let k=y.hostname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/hostname",schemaPath:"#/properties/path/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.hostname=H))}var g=M===o}else var g=!0;if(g)if(y.pathname!==void 0){let k=y.pathname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/pathname",schemaPath:"#/properties/path/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.pathname=H))}var g=M===o}else var g=!0}}}else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[C]:i.push(C),o++}var S=v===o;if(S&&O?(O=!1,w=[w,1]):S&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[C]:i.push(C),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.cookies!==void 0){let y=t.cookies,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/cookies",schemaPath:"#/properties/cookies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.headers!==void 0){let y=t.headers,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/headers",schemaPath:"#/properties/headers/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.query!==void 0){let y=t.query,R=o,T=o,O=!1,w=o;if(o===w&&!(y&&typeof y=="object"&&!Array.isArray(y))){let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[v]:i.push(v),o++}var b=w===o;if(O=O||b,!O){let v=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.query=k))}var b=v===o;O=O||b}if(O)o=T,i!==null&&(T?i.length=T:i=null);else{let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[v]:i.push(v),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.simulate!==void 0){let y=t.simulate,R=o;if(o===R)if(y&&typeof y=="object"&&!Array.isArray(y)){if(y.end!==void 0){let O=y.end,w=o;if(typeof O!="boolean"){let $;if($===void 0)if(O==="false"||O===0||O===null)$=!1;else if(O==="true"||O===1)$=!0;else return Fe.errors=[{instancePath:e+"/simulate/end",schemaPath:"#/properties/simulate/properties/end/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;$!==void 0&&(O=$,y!==void 0&&(y.end=$))}var _=w===o}else var _=!0;if(_){if(y.split!==void 0){let O=y.split,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/split",schemaPath:"#/properties/simulate/properties/split/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.split=v))}var _=w===o}else var _=!0;if(_){if(y.error!==void 0){let O=y.error,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/error",schemaPath:"#/properties/simulate/properties/error/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.error=v))}var _=w===o}else var _=!0;if(_)if(y.close!==void 0){let O=y.close,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/close",schemaPath:"#/properties/simulate/properties/close/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.close=v))}var _=w===o}else var _=!0}}}else return Fe.errors=[{instancePath:e+"/simulate",schemaPath:"#/properties/simulate/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.authority!==void 0){let y=t.authority,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/authority",schemaPath:"#/properties/authority/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.authority=w))}var m=R===o}else var m=!0;if(m){if(t.remoteAddress!==void 0){let y=t.remoteAddress,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/remoteAddress",schemaPath:"#/properties/remoteAddress/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.remoteAddress=w))}var m=R===o}else var m=!0;if(m){if(t.method!==void 0){let y=t.method,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.method=w))}if(!(y==="ACL"||y==="BIND"||y==="CHECKOUT"||y==="CONNECT"||y==="COPY"||y==="DELETE"||y==="GET"||y==="HEAD"||y==="LINK"||y==="LOCK"||y==="M-SEARCH"||y==="MERGE"||y==="MKACTIVITY"||y==="MKCALENDAR"||y==="MKCOL"||y==="MOVE"||y==="NOTIFY"||y==="OPTIONS"||y==="PATCH"||y==="POST"||y==="PROPFIND"||y==="PROPPATCH"||y==="PURGE"||y==="PUT"||y==="QUERY"||y==="REBIND"||y==="REPORT"||y==="SEARCH"||y==="SOURCE"||y==="SUBSCRIBE"||y==="TRACE"||y==="UNBIND"||y==="UNLINK"||y==="UNLOCK"||y==="UNSUBSCRIBE"||y==="acl"||y==="bind"||y==="checkout"||y==="connect"||y==="copy"||y==="delete"||y==="get"||y==="head"||y==="link"||y==="lock"||y==="m-search"||y==="merge"||y==="mkactivity"||y==="mkcalendar"||y==="mkcol"||y==="move"||y==="notify"||y==="options"||y==="patch"||y==="post"||y==="propfind"||y==="proppatch"||y==="purge"||y==="put"||y==="query"||y==="rebind"||y==="report"||y==="search"||y==="source"||y==="subscribe"||y==="trace"||y==="unbind"||y==="unlink"||y==="unlock"||y==="unsubscribe"))return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/enum",keyword:"enum",params:{allowedValues:fW.properties.method.enum},message:"must be equal to one of the allowed values"}],!1;var m=R===o}else var m=!0;if(m)if(t.validate!==void 0){let y=t.validate,R=o;if(typeof y!="boolean"){let O;if(O===void 0)if(y==="false"||y===0||y===null)O=!1;else if(y==="true"||y===1)O=!0;else return Fe.errors=[{instancePath:e+"/validate",schemaPath:"#/properties/validate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;O!==void 0&&(y=O,t!==void 0&&(t.validate=O))}var m=R===o}else var m=!0}}}}}}}}}else return Fe.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Fe.errors=i,o===0}});var lA=E((cQ,Oo)=>{"use strict";var dW=V("node:assert"),Vm=XP(),bu=sA(),wu="The dispatch function has already been invoked",oA=iA();function zm(t,e,r){return r===void 0?new Ro(t,e):vu(t,e,r)}function hW(t,e){let r=t._lightMyRequest.payload;if(!r||r._readableState||typeof r.resume!="function")return e();let n=[];r.on("data",s=>n.push(Buffer.from(s))),r.on("end",()=>{let s=Buffer.concat(n);return t.headers["content-length"]=t.headers["content-length"]||""+s.length,delete t.headers["transfer-encoding"],t._lightMyRequest.payload=s,e()}),r.resume()}function aA(t,e,r,n){return r.once("error",function(s){this.destroyed&&n.destroy(s)}),r.once("close",function(){this.destroyed&&!this._error&&n.destroy()}),hW(r,()=>t.call(e,r,n))}function vu(t,e,r){if(e=typeof e=="string"?{url:e}:e,e.validate!==!1&&(dW(typeof t=="function","dispatchFunc should be a function"),!oA(e)))throw new Error(oA.errors.map(o=>o.message));let n=e.server||{},s=e.Request?Vm.CustomRequest:Vm;if(t.request&&t.request.app===t&&(Object.setPrototypeOf(Object.getPrototypeOf(t.request),s.prototype),Object.setPrototypeOf(Object.getPrototypeOf(t.response),bu.prototype)),typeof r=="function"){let i=new s(e),o=new bu(i,r);return aA(t,n,i,o)}else return new Promise((i,o)=>{let a=new s(e),l=new bu(a,i,o);aA(t,n,a,l)})}function Ro(t,e){typeof e=="string"?this.option={url:e}:this.option=Object.assign({},e),this.dispatch=t,this._hasInvoked=!1,this._promise=null,this.option.autoStart!==!1&&process.nextTick(()=>{this._hasInvoked||this.end()})}var pW=["delete","get","head","options","patch","post","put","trace"];pW.forEach(t=>{Ro.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(wu);return this.option.url=e,this.option.method=t.toUpperCase(),this}});var mW=["body","cookies","headers","payload","query"];mW.forEach(t=>{Ro.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(wu);return this.option[t]=e,this}});Ro.prototype.end=function(t){if(this._hasInvoked===!0||this._promise)throw new Error(wu);if(this._hasInvoked=!0,typeof t=="function")vu(this.dispatch,this.option,t);else return this._promise=vu(this.dispatch,this.option),this._promise};Object.getOwnPropertyNames(Promise.prototype).forEach(t=>{t!=="constructor"&&(Ro.prototype[t]=function(...e){if(!this._promise){if(this._hasInvoked===!0)throw new Error(wu);this._hasInvoked=!0,this._promise=vu(this.dispatch,this.option)}return this._promise[t](...e)})});function gW(t){return t instanceof Vm||t instanceof bu||t?.constructor?.name==="_CustomLMRRequest"}Oo.exports=zm;Oo.exports.default=zm;Oo.exports.inject=zm;Oo.exports.isInjection=gW});var RA=E((fQ,Co)=>{"use strict";var yW="5.7.2",_W=iy(),$u=V("node:http"),SW=V("node:diagnostics_channel"),To,{kAvvioBoot:$o,kChildren:Um,kServerBindings:uA,kBodyLimit:EW,kSupportedHTTPMethods:jn,kRoutePrefix:cA,kLogLevel:bW,kLogSerializers:vW,kHooks:Bm,kSchemaController:an,kRequestAcceptVersion:wW,kReplySerializerDefault:fA,kContentTypeParser:RW,kReply:OW,kRequest:TW,kFourOhFour:$W,kState:$e,kOptions:Gm,kPluginNameChain:Po,kSchemaErrorFormatter:Wm,kErrorHandler:Ru,kKeepAliveConnections:Jm,kChildLoggerFactory:Km,kGenReqId:Ym,kErrorHandlerAlreadySet:Ou}=De(),{createServer:PW}=ky(),Ao=Pa(),Tu=xa(),AW=La(),Dn=di(),Fn=Hf(),dA=Np(),{Hooks:CW,hookRunnerApplication:hA,supportedHooks:Xm}=Dr(),{createChildLogger:pA,defaultChildLoggerFactory:IW,createLogger:NW}=ai(),mA=nm(),{getGenReqId:gA,reqIdGenFactory:vA}=Yl(),{buildRouting:kW,validateBodyLimitOption:xW,buildRouterOptions:LW}=SP(),qW=TP(),wA=PP(),jW=jP(),{appendStackTrace:DW,AVVIO_ERRORS_MAP:yA,...Mn}=He(),FW=lc(),{defaultInitOptions:vt}=wA,{FST_ERR_ASYNC_CONSTRAINT:MW,FST_ERR_BAD_URL:HW,FST_ERR_OPTIONS_NOT_OBJ:VW,FST_ERR_QSP_NOT_FN:zW,FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:UW,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:BW,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:GW,FST_ERR_INSTANCE_ALREADY_LISTENING:WW,FST_ERR_REOPENED_CLOSE_SERVER:JW,FST_ERR_ROUTE_REWRITE_NOT_STR:KW,FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:_A,FST_ERR_ERROR_HANDLER_NOT_FN:YW,FST_ERR_ERROR_HANDLER_ALREADY_SET:XW,FST_ERR_ROUTE_METHOD_INVALID:QW}=Mn,{buildErrorHandler:SA}=ui(),{FSTWRN004:ZW}=Kn(),EA=SW.channel("fastify.initialization");function Qm(t){let{options:e,genReqId:r,disableRequestLogging:n,hasLogger:s,initialConfig:i}=eJ(t,P,C),o=kW(e.routerOptions),a=qW(e),l=me(o,e),{server:u,listen:c,forceCloseConnections:f,serverHasCloseAllConnections:p,serverHasCloseHttp2Sessions:h,keepAliveConnections:d}=PW(e,l),m=Ao.setupResponseListeners,g=dA.buildSchemaController(null,e.schemaController),S={[$e]:{listening:!1,closing:!1,started:!1,ready:!1,booting:!1,aborted:!1,readyResolver:null},[Jm]:d,[jn]:{bodyless:new Set(["GET","HEAD","TRACE"]),bodywith:new Set(["DELETE","OPTIONS","PATCH","PUT","POST"])},[Gm]:e,[Um]:[],[uA]:[],[EW]:e.bodyLimit,[cA]:"",[bW]:"",[vW]:null,[Bm]:new CW,[an]:g,[Wm]:null,[Ru]:SA(),[Ou]:!1,[Km]:e.childLoggerFactory||IW,[fA]:null,[RW]:new Fn(e.bodyLimit,e.onProtoPoisoning||vt.onProtoPoisoning,e.onConstructorPoisoning||vt.onConstructorPoisoning),[OW]:Ao.buildReply(Ao),[TW]:Tu.buildRequest(Tu,e.trustProxy),[$W]:a,[mA.kRegisteredPlugins]:[],[Po]:["fastify"],[$o]:null,[Ym]:r,routing:l,delete:function(N,q,j){return o.prepareRoute.call(this,{method:"DELETE",url:N,options:q,handler:j})},get:function(N,q,j){return o.prepareRoute.call(this,{method:"GET",url:N,options:q,handler:j})},head:function(N,q,j){return o.prepareRoute.call(this,{method:"HEAD",url:N,options:q,handler:j})},trace:function(N,q,j){return o.prepareRoute.call(this,{method:"TRACE",url:N,options:q,handler:j})},patch:function(N,q,j){return o.prepareRoute.call(this,{method:"PATCH",url:N,options:q,handler:j})},post:function(N,q,j){return o.prepareRoute.call(this,{method:"POST",url:N,options:q,handler:j})},put:function(N,q,j){return o.prepareRoute.call(this,{method:"PUT",url:N,options:q,handler:j})},options:function(N,q,j){return o.prepareRoute.call(this,{method:"OPTIONS",url:N,options:q,handler:j})},all:function(N,q,j){return o.prepareRoute.call(this,{method:this.supportedMethods,url:N,options:q,handler:j})},route:function(N){return o.route.call(this,{options:N})},hasRoute:function(N){return o.hasRoute.call(this,{options:N})},findRoute:function(N){return o.findRoute(N)},log:e.logger,withTypeProvider:w,addHook:$,addSchema:v,getSchema:g.getSchema.bind(g),getSchemas:g.getSchemas.bind(g),setValidatorCompiler:J,setSerializerCompiler:H,setSchemaController:fe,setReplySerializer:ze,setSchemaErrorFormatter:U,setGenReqId:pe,addContentTypeParser:Fn.helpers.addContentTypeParser,hasContentTypeParser:Fn.helpers.hasContentTypeParser,getDefaultJsonParser:Fn.defaultParsers.getDefaultJsonParser,defaultTextParser:Fn.defaultParsers.defaultTextParser,removeContentTypeParser:Fn.helpers.removeContentTypeParser,removeAllContentTypeParsers:Fn.helpers.removeAllContentTypeParsers,register:null,after:null,ready:null,onClose:null,close:null,printPlugins:null,hasPlugin:function(A){return this[mA.kRegisteredPlugins].includes(A)||this[Po].includes(A)},listen:c,server:u,addresses:function(){let A=this[uA].map(N=>N.address());return A.push(this.server.address()),A.filter(N=>N)},decorate:Dn.add,hasDecorator:Dn.exist,decorateReply:Dn.decorateReply,decorateRequest:Dn.decorateRequest,hasRequestDecorator:Dn.existRequest,hasReplyDecorator:Dn.existReply,getDecorator:Dn.getInstanceDecorator,addHttpMethod:Hn,inject:T,printRoutes:xr,setNotFoundHandler:M,setErrorHandler:G,setChildLoggerFactory:wt,initialConfig:i,addConstraintStrategy:o.addConstraintStrategy.bind(o),hasConstraintStrategy:o.hasConstraintStrategy.bind(o)};Object.defineProperties(S,{listeningOrigin:{get(){let A=this.addresses().slice(-1).pop();if(typeof A=="string")return A;let N=A.family==="IPv6"?`[${A.address}]`:A.address;return`${this[Gm].https?"https":"http"}://${N}:${A.port}`}},pluginName:{configurable:!0,get(){return this[Po].length>1?this[Po].join(" -> "):this[Po][0]}},prefix:{configurable:!0,get(){return this[cA]}},validatorCompiler:{configurable:!0,get(){return this[an].getValidatorCompiler()}},serializerCompiler:{configurable:!0,get(){return this[an].getSerializerCompiler()}},childLoggerFactory:{configurable:!0,get(){return this[Km]}},version:{configurable:!0,get(){return yW}},errorHandler:{configurable:!0,get(){return this[Ru].func}},genReqId:{configurable:!0,get(){return this[Ym]}},supportedMethods:{configurable:!1,get(){return[...this[jn].bodyless,...this[jn].bodywith]}}}),e.schemaErrorFormatter&&(bA(e.schemaErrorFormatter),S[Wm]=e.schemaErrorFormatter.bind(S));let b=Number(e.pluginTimeout),_=_W(S,{autostart:!1,timeout:isNaN(b)===!1?b:vt.pluginTimeout,expose:{use:"register"}});_.override=jW,_.on("start",()=>S[$e].started=!0),S[$o]=S.ready,S.ready=O,S.printPlugins=_.prettyPrint.bind(_),_.once("preReady",()=>{S.onClose((A,N)=>{S[$e].closing=!0,o.closeRoutes(),hA("preClose",S[$o],S,function(){if(S[$e].listening){if(f==="idle")A.server.closeIdleConnections();else if(p&&f)A.server.closeAllConnections();else if(f===!0)for(let q of S[Jm])q.destroy(),S[Jm].delete(q)}h&&A.server.closeHttp2Sessions(),!e.serverFactory||S[$e].listening?A.server.close(function(q){q&&q.code!=="ERR_SERVER_NOT_RUNNING"?N(null):N()}):process.nextTick(N,null)})})});let y=new AW({server:S,config:{}});return S.setNotFoundHandler(),a.arrange404(S),o.setup(e,{avvio:_,fourOhFour:a,hasLogger:s,setupResponseListeners:m,throwIfAlreadyStarted:R,keepAliveConnections:d}),u.on("clientError",e.clientErrorHandler.bind(S)),EA.hasSubscribers&&EA.publish({fastify:S}),"asyncDispose"in Symbol&&(S[Symbol.asyncDispose]=function(){return S.close()}),S;function R(A){if(S[$e].started)throw new WW(A)}function T(A,N){if(To===void 0&&(To=lA()),S[$e].started){if(S[$e].closing){let q=new JW;if(N){N(q);return}else return Promise.reject(q)}return To(l,A,N)}if(N)this.ready(q=>{q?N(q,null):To(l,A,N)});else return To((q,j)=>{this.ready(function(ue){if(ue){j.emit("error",ue);return}l(q,j)})},A)}function O(A){if(this[$e].readyResolver!==null){if(A!=null){this[$e].readyResolver.promise.then(()=>A(null,S),A);return}return this[$e].readyResolver.promise}if(process.nextTick(N),this[$e].readyResolver=FW.withResolvers(),A)this[$e].readyResolver.promise.then(()=>A(null,S),A);else return this[$e].readyResolver.promise;function N(){S[$o]((j,ue)=>{j||S[$e].started||S[$e].ready||S[$e].booting?q(j):(S[$e].booting=!0,hA("onReady",S[$o],S,q)),ue()})}function q(j){if(j=j!=null&&yA[j.code]!=null?DW(j,new yA[j.code](j.message)):j,j)return S[$e].readyResolver.reject(j);S[$e].readyResolver.resolve(S),S[$e].booting=!1,S[$e].ready=!0,S[$e].readyResolver=null}}function w(){return this}function $(A,N){if(R('Cannot call "addHook"!'),N==null)throw new Mn.FST_ERR_HOOK_INVALID_HANDLER(A,N);if(A==="onSend"||A==="preSerialization"||A==="onError"||A==="preParsing"){if(N.constructor.name==="AsyncFunction"&&N.length===4)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onReady"||A==="onListen"){if(N.constructor.name==="AsyncFunction"&&N.length!==0)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onRequestAbort"){if(N.constructor.name==="AsyncFunction"&&N.length!==1)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(N.constructor.name==="AsyncFunction"&&N.length===3)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER;return A==="onClose"?this.onClose(N.bind(this)):A==="onReady"||A==="onListen"||A==="onRoute"?this[Bm].add(A,N):this.after((j,ue)=>{try{q.call(this,A,N),ue(j)}catch(de){ue(de)}}),this;function q(j,ue){this[Bm].add(j,ue),this[Um].forEach(de=>q.call(de,j,ue))}}function v(A){return R('Cannot call "addSchema"!'),this[an].add(A),this[Um].forEach(N=>N.addSchema(A)),this}function P(A,N){A.headers["accept-version"]!==void 0&&(A.headers[wW]=A.headers["accept-version"],A.headers["accept-version"]=void 0),a.router.lookup(A,N)}function C(A,N,q){if(e.frameworkErrors){let ue=gA(y.server,N),de=pA(y,e.logger,N,ue),Me=new Tu(ue,null,N,null,de,y),Y=new Ao(q,Me,de);return(typeof n=="function"?n(N):n)===!1&&de.info({req:Me},"incoming request"),e.frameworkErrors(new HW(A),Me,Y)}let j=JSON.stringify({error:"Bad Request",code:"FST_ERR_BAD_URL",message:`'${A}' is not a valid url component`,statusCode:400});q.writeHead(400,{"Content-Type":"application/json","Content-Length":Buffer.byteLength(j)}),q.end(j)}function k(A,N,q){if(A!==!1)return function(ue){if(ue){if(e.frameworkErrors){let Me=gA(y.server,N),Y=pA(y,e.logger,N,Me),$t=new Tu(Me,null,N,null,Y,y),Pe=new Ao(q,$t,Y);return(typeof n=="function"?n(N):n)===!1&&Y.info({req:$t},"incoming request"),e.frameworkErrors(new MW,$t,Pe)}let de='{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}';q.writeHead(500,{"Content-Type":"application/json","Content-Length":de.length}),q.end(de)}}}function M(A,N){return R('Cannot call "setNotFoundHandler"!'),a.setNotFoundHandler.call(this,A,N,_,o.routeHandler),this}function J(A){return R('Cannot call "setValidatorCompiler"!'),this[an].setValidatorCompiler(A),this}function U(A){return R('Cannot call "setSchemaErrorFormatter"!'),bA(A),this[Wm]=A.bind(this),this}function H(A){return R('Cannot call "setSerializerCompiler"!'),this[an].setSerializerCompiler(A),this}function fe(A){R('Cannot call "setSchemaController"!');let N=this[an],q=dA.buildSchemaController(N,Object.assign({},N.opts,A));return this[an]=q,this.getSchema=q.getSchema.bind(q),this.getSchemas=q.getSchemas.bind(q),this}function ze(A){return R('Cannot call "setReplySerializer"!'),this[fA]=A,this}function G(A){if(R('Cannot call "setErrorHandler"!'),typeof A!="function")throw new YW;if(!e.allowErrorHandlerOverride&&this[Ou])throw new XW;return this[Ou]&&ZW("To disable this behavior, set 'allowErrorHandlerOverride' to false or ignore this message. For more information, visit: https://fastify.dev/docs/latest/Reference/Server/#allowerrorhandleroverride"),this[Ou]=!0,this[Ru]=SA(this[Ru],A.bind(this)),this}function wt(A){return R('Cannot call "setChildLoggerFactory"!'),this[Km]=A,this}function xr(A={}){return A.includeMeta=A.includeHooks?A.includeMeta?Xm.concat(A.includeMeta):Xm:A.includeMeta,o.printRoutes(A)}function me(A,{rewriteUrl:N,logger:q}){let j;return function(de,Me){if(j===void 0&&(j=A.isAsyncConstraint()),N){de.originalUrl=de.url;let Y=N.call(S,de);if(typeof Y=="string")de.url=Y;else{let $t=new KW(de.url,typeof Y);de.destroy($t)}}A.routing(de,Me,k(j,de,Me))}}function pe(A){return R('Cannot call "setGenReqId"!'),this[Ym]=vA(this[Gm].requestIdHeader,A),this}function Hn(A,{hasBody:N=!1}={}){if(typeof A!="string"||$u.METHODS.indexOf(A)===-1)throw new QW;N===!0?(this[jn].bodywith.add(A),this[jn].bodyless.delete(A)):(this[jn].bodywith.delete(A),this[jn].bodyless.add(A));let q=A.toLowerCase();return this.hasDecorator(q)||this.decorate(q,function(j,ue,de){return o.prepareRoute.call(this,{method:A,url:j,options:ue,handler:de})}),this}}function eJ(t,e,r){if(t&&typeof t!="object")throw new VW;if(t=Object.assign({},t),t.querystringParser&&typeof t.querystringParser!="function"||t.routerOptions?.querystringParser&&typeof t.routerOptions.querystringParser!="function")throw new zW(typeof(t.querystringParser??t.routerOptions.querystringParser));if(t.schemaController&&t.schemaController.bucket&&typeof t.schemaController.bucket!="function")throw new UW(typeof t.schemaController.bucket);xW(t.bodyLimit);let n=typeof t.requestIdHeader=="string"&&t.requestIdHeader.length!==0?t.requestIdHeader.toLowerCase():t.requestIdHeader===!0&&"request-id",s=vA(n,t.genReqId),i=t.requestIdLogLabel||"reqId";t.bodyLimit=t.bodyLimit||vt.bodyLimit;let o=t.disableRequestLogging||!1,a=Object.assign({customOptions:{},plugins:[]},t.ajv);if(!a.customOptions||Object.prototype.toString.call(a.customOptions)!=="[object Object]")throw new BW(typeof a.customOptions);if(!a.plugins||!Array.isArray(a.plugins))throw new GW(typeof a.plugins);let{logger:l,hasLogger:u}=NW(t);t.connectionTimeout=t.connectionTimeout||vt.connectionTimeout,t.keepAliveTimeout=t.keepAliveTimeout||vt.keepAliveTimeout,t.maxRequestsPerSocket=t.maxRequestsPerSocket||vt.maxRequestsPerSocket,t.requestTimeout=t.requestTimeout||vt.requestTimeout,t.logger=l,t.requestIdHeader=n,t.requestIdLogLabel=i,t.disableRequestLogging=o,t.ajv=a,t.clientErrorHandler=t.clientErrorHandler||rJ,t.allowErrorHandlerOverride=t.allowErrorHandlerOverride??vt.allowErrorHandlerOverride;let c=wA(t);return t.exposeHeadRoutes=c.exposeHeadRoutes,t.http2SessionTimeout=c.http2SessionTimeout,t.routerOptions=LW(t,{defaultRoute:e,onBadUrl:r,ignoreTrailingSlash:vt.ignoreTrailingSlash,ignoreDuplicateSlashes:vt.ignoreDuplicateSlashes,maxParamLength:vt.maxParamLength,allowUnsafeRegex:vt.allowUnsafeRegex,buildPrettyMeta:tJ,useSemicolonDelimiter:vt.useSemicolonDelimiter}),{options:t,genReqId:s,disableRequestLogging:o,hasLogger:u,initialConfig:c}}function tJ(t){let e={};return["errorHandler","logLevel","logSerializers"].concat(Xm).forEach(n=>{e[n]=t.store[n]}),Object.assign({},e)}function rJ(t,e){if(t.code==="ECONNRESET"||e.destroyed)return;let r,n,s,i;t.code==="ERR_HTTP_REQUEST_TIMEOUT"?(n="408",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Timeout","statusCode":408}`,i="timeout"):t.code==="HPE_HEADER_OVERFLOW"?(n="431",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Exceeded maximum allowed HTTP header size","statusCode":431}`,i="header_overflow"):(n="400",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Error","statusCode":400}`,i="error"),this.log.trace({err:t},`client ${i}`),e.writable&&e.write(`HTTP/1.1 ${n} ${s}\r
|
|
375
375
|
Content-Length: ${r.length}\r
|
|
376
376
|
Content-Type: application/json\r
|
|
377
377
|
\r
|
|
378
|
-
${r}`),e.destroy(t)}function
|
|
378
|
+
${r}`),e.destroy(t)}function bA(t){if(typeof t!="function")throw new _A(typeof t);if(t.constructor.name==="AsyncFunction")throw new _A("AsyncFunction")}Co.exports=Qm;Co.exports.errorCodes=Mn;Co.exports.fastify=Qm;Co.exports.default=Qm});import{spawn as NJ}from"node:child_process";var Sg=og(_g(),1),{program:XJ,createCommand:QJ,createArgument:ZJ,createOption:e8,CommanderError:t8,InvalidArgumentError:r8,InvalidOptionArgumentError:n8,Command:Eg,Argument:s8,Option:i8,Help:o8}=Sg.default;var fJ=og(RA(),1);import{readFile as nJ,writeFile as sJ,mkdir as iJ}from"node:fs/promises";import{homedir as oJ}from"node:os";import{join as TA,dirname as aJ}from"node:path";var OA="Iv1.b507a08c87ecfe98";async function Zm(){let t=await fetch("https://github.com/login/device/code",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:OA,scope:"read:user"})});if(!t.ok)throw new Error(`Device flow initiation failed: ${t.statusText}`);return t.json()}async function eg(t,e=5){let r=e;for(;;){await new Promise(i=>setTimeout(i,r*1e3));let s=await(await fetch("https://github.com/login/oauth/access_token",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:OA,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(s.access_token)return s.access_token;if(s.error!=="authorization_pending"){if(s.error==="slow_down"){r+=5;continue}throw new Error(`Authentication failed: ${s.error||"Unknown error"}`)}}}async function Us(t){let e=await fetch("https://api.github.com/copilot_internal/v2/token",{method:"GET",headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(!e.ok){let n=await e.text();throw new Error(`Failed to get Copilot token: ${e.status} ${e.statusText} - ${n}`)}let r=await e.json();return{token:r.token,expiresAt:r.expires_at*1e3}}var lJ=TA(oJ(),".config","claude-pilot"),tg=TA(lJ,"auth.json");async function kr(t=tg){try{let e=await nJ(t,"utf-8");return JSON.parse(e)}catch{return null}}async function Pu(t,e=tg){await iJ(aJ(e),{recursive:!0}),await sJ(e,JSON.stringify(t,null,2))}async function Au(t,e=tg){let n=Date.now();if(t.copilotTokenExpiresAt-n>3e5)return t.copilotToken;console.log("Refreshing Copilot token...");let s=await Us(t.githubToken);return t.copilotToken=s.token,t.copilotTokenExpiresAt=s.expiresAt,await Pu(t,e),console.log("Copilot token refreshed"),s.token}var RQ=process.env.COPILOT_PATH||"copilot",OQ=parseInt(process.env.WEB_SEARCH_TIMEOUT||"60000",10),TQ=process.env.WEB_SEARCH_MODEL||"gpt-4.1";import{exec as uJ}from"child_process";import{promisify as cJ}from"util";var CQ=cJ(uJ);import{homedir as dJ}from"node:os";import{join as Io}from"node:path";var ln=Io(dJ(),".config","claude-pilot"),ft=Io(ln,"auth.json"),Cu=Io(ln,"daemon.json"),Iu=Io(ln,"server.log"),PZ=Io(ln,"requests.jsonl"),Nu=51080;async function $A(){console.log(`Claude Pilot - GitHub Copilot Authentication
|
|
379
379
|
`);let t=await kr(ft);if(t){console.log("Existing credentials found."),console.log(`To re-authenticate, delete ${ft}
|
|
380
380
|
`);try{let s=await Us(t.githubToken);console.log("\u2713 Credentials are valid"),console.log(` Copilot token expires: ${new Date(s.expiresAt).toLocaleString()}`);return}catch{console.log(`\u2717 Credentials are invalid, re-authenticating...
|
|
381
381
|
`)}}console.log(`Starting GitHub OAuth device flow...
|
|
382
|
-
`);let e=await
|
|
383
|
-
Waiting for authorization...`);let r=await
|
|
382
|
+
`);let e=await Zm();console.log("Please visit:",e.verification_uri),console.log("And enter code:",e.user_code),console.log(`
|
|
383
|
+
Waiting for authorization...`);let r=await eg(e.device_code,e.interval);console.log(`
|
|
384
384
|
\u2713 GitHub authentication successful`),console.log("Exchanging for Copilot token...");let n=await Us(r);console.log("\u2713 Copilot token obtained"),await Pu({githubToken:r,copilotToken:n.token,copilotTokenExpiresAt:n.expiresAt},ft),console.log(`
|
|
385
385
|
\u2713 Credentials saved to ${ft}`),console.log(`
|
|
386
|
-
You can now start the proxy with: claude-pilot start`)}import{unlink as
|
|
386
|
+
You can now start the proxy with: claude-pilot start`)}import{unlink as SJ}from"node:fs/promises";import{readFile as hJ,writeFile as pJ,mkdir as mJ,unlink as gJ}from"node:fs/promises";async function yJ(){try{let t=await hJ(Cu,"utf-8");return JSON.parse(t)}catch{return null}}async function PA(t){await mJ(ln,{recursive:!0}),await pJ(Cu,JSON.stringify(t,null,2))}async function ku(){try{await gJ(Cu)}catch{}}function _J(t){try{return process.kill(t,0),!0}catch{return!1}}async function Tt(){let t=await yJ();return t?_J(t.pid)?{running:!0,state:t}:(await ku(),{running:!1,state:null}):{running:!1,state:null}}async function xu(){let{running:t,state:e}=await Tt();if(!t||!e){console.log("Proxy is not running");return}console.log(`Stopping proxy (PID: ${e.pid})...`);try{process.kill(e.pid,"SIGTERM"),await new Promise(r=>setTimeout(r,1e3));try{process.kill(e.pid,0),console.log("Process did not exit gracefully, forcing..."),process.kill(e.pid,"SIGKILL")}catch{}await ku(),console.log("\u2713 Proxy stopped")}catch{await ku(),console.log("\u2713 Proxy stopped (was already exiting)")}}async function AA(){let{running:t}=await Tt();t&&await xu();try{await SJ(ft),console.log("\u2713 Logged out successfully"),console.log(` Removed ${ft}`)}catch(e){if(e.code==="ENOENT")console.log("Already logged out (no credentials found)");else throw e}}import{spawn as EJ}from"node:child_process";import{createServer as bJ}from"node:net";import{fileURLToPath as vJ}from"node:url";import{dirname as wJ,join as CA}from"node:path";import{openSync as RJ,existsSync as IA}from"node:fs";import{mkdir as OJ}from"node:fs/promises";function TJ(t){return new Promise(e=>{let r=bJ();r.once("error",()=>e(!1)),r.once("listening",()=>{r.close(),e(!0)}),r.listen(t,"127.0.0.1")})}async function $J(t){let e=t;for(;e<t+100;){if(await TJ(e))return e;e++}throw new Error(`Could not find available port in range ${t}-${t+100}`)}async function rg(t){let{running:e,state:r}=await Tt();if(e&&r){console.log(`Proxy is already running (PID: ${r.pid})`),console.log(` http://localhost:${r.port}`),console.log(` Dashboard: http://localhost:${r.port}/`);return}let n=await kr(ft);n||(console.log("No credentials found"),console.log("Run 'claude-pilot login' first to authenticate"),process.exit(1));try{await Au(n,ft)}catch(f){console.log("Failed to validate/refresh token:",f instanceof Error?f.message:f),console.log("Run 'claude-pilot login' to re-authenticate"),process.exit(1)}let s=t.port||Nu,i=await $J(s);i!==s&&console.log(`Port ${s} in use, using ${i}`);let o=vJ(import.meta.url),a=wJ(o),l=CA(a,"server.js");IA(l)||(l=CA(a,"..","dist","server.js")),IA(l)||(console.log("Error: server.js not found"),console.log("If developing, run `pnpm build` first"),process.exit(1)),console.log("Starting proxy..."),await OJ(ln,{recursive:!0});let u=RJ(Iu,"a"),c=EJ("node",[l],{detached:!0,stdio:["ignore",u,u],env:{...process.env,PROXY_PORT:String(i)}});c.unref(),await PA({pid:c.pid,port:i,startedAt:new Date().toISOString()}),await new Promise(f=>setTimeout(f,1500));try{if((await fetch(`http://localhost:${i}/health`,{signal:AbortSignal.timeout(2e3)})).ok){console.log("Proxy started successfully"),console.log(` PID: ${c.pid}`),console.log(` http://localhost:${i}`),console.log(` Dashboard: http://localhost:${i}/`),console.log(` Logs: ${Iu}`),console.log(`
|
|
387
387
|
Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://localhost:${i}`),console.log(" export ANTHROPIC_AUTH_TOKEN=dummy");return}}catch{}console.log("Proxy started (PID: "+c.pid+")"),console.log(` http://localhost:${i}`),console.log(` Logs: ${Iu}`),console.log(`
|
|
388
|
-
Note: Check logs if the proxy is not responding`)}async function
|
|
389
|
-
`);let t=await kr(ft);if(t){let n=new Date(t.copilotTokenExpiresAt),s=n<new Date;console.log(`Authentication: ${s?"\u2717 expired":"\u2713 valid"}`),console.log(` Token expires: ${n.toLocaleString()}`)}else console.log("Authentication: \u2717 not configured"),console.log(" Run 'claude-pilot login' to authenticate");console.log();let{running:e,state:r}=await Tt();if(e&&r){let n=new Date(r.startedAt),s=
|
|
390
|
-
Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://localhost:${r.port}`),console.log(" export ANTHROPIC_AUTH_TOKEN=dummy")}else console.log("Proxy: \u2717 not running"),console.log(" Run 'claude-pilot start' to start the proxy")}function
|
|
388
|
+
Note: Check logs if the proxy is not responding`)}async function NA(){console.log(`Claude Pilot Status
|
|
389
|
+
`);let t=await kr(ft);if(t){let n=new Date(t.copilotTokenExpiresAt),s=n<new Date;console.log(`Authentication: ${s?"\u2717 expired":"\u2713 valid"}`),console.log(` Token expires: ${n.toLocaleString()}`)}else console.log("Authentication: \u2717 not configured"),console.log(" Run 'claude-pilot login' to authenticate");console.log();let{running:e,state:r}=await Tt();if(e&&r){let n=new Date(r.startedAt),s=PJ(Date.now()-n.getTime());console.log("Proxy: \u2713 running"),console.log(` PID: ${r.pid}`),console.log(` Port: ${r.port}`),console.log(` Dashboard: http://localhost:${r.port}/`),console.log(` Uptime: ${s}`),console.log(` Started: ${n.toLocaleString()}`),console.log(`
|
|
390
|
+
Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://localhost:${r.port}`),console.log(" export ANTHROPIC_AUTH_TOKEN=dummy")}else console.log("Proxy: \u2717 not running"),console.log(" Run 'claude-pilot start' to start the proxy")}function PJ(t){let e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60),s=Math.floor(n/24);return s>0?`${s}d ${n%24}h ${r%60}m`:n>0?`${n}h ${r%60}m ${e%60}s`:r>0?`${r}m ${e%60}s`:`${e}s`}import{exec as AJ}from"node:child_process";import{platform as CJ}from"node:os";async function kA(){let{running:t,state:e}=await Tt();if(!t||!e){console.log("Proxy is not running"),console.log("Run 'claude-pilot start' first");return}let r=`http://localhost:${e.port}`;console.log(`Opening dashboard at ${r}`);let n=CJ(),s;if(n==="darwin")s=`open "${r}"`;else if(n==="linux")s=`xdg-open "${r}"`;else{console.log(`Please open ${r} in your browser`);return}AJ(s,i=>{i&&(console.log("Could not open browser automatically"),console.log(`Please open ${r} in your browser`))})}import{execSync as ng}from"node:child_process";var Lu="@lioneltay/claude-pilot";function IJ(){try{let t=ng(`npm list -g ${Lu} --depth=0 --json`,{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]});return JSON.parse(t).dependencies?.[Lu]?.version||null}catch{return null}}async function xA(){try{let t=IJ();if(!t||ng(`npm view ${Lu} version`,{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()===t)return;ng(`npm install -g ${Lu}@latest`,{encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]})}catch{}}import{readFileSync as kJ}from"node:fs";import{fileURLToPath as xJ}from"node:url";import{dirname as LJ,join as qJ}from"node:path";function jJ(){try{let t=xJ(import.meta.url),e=LJ(t),r=qJ(e,"..","package.json");return JSON.parse(kJ(r,"utf-8")).version||"0.0.0"}catch{return"0.0.0"}}var DJ=jJ(),FJ=["login","logout","start","stop","status","dashboard","help"];function MJ(t){let e=t[0];return e?FJ.includes(e)||e.startsWith("-"):!1}async function HJ(t){let{running:e,state:r}=await Tt();if(e)LA(t,r.port);else{await kr(ft)||(console.error("Not authenticated. Run `claude-pilot login` first."),process.exit(1)),console.log("Proxy not running, starting..."),await rg({port:Nu});let{running:s,state:i}=await Tt();(!s||!i)&&(console.error("Failed to start proxy. Check logs with: cat ~/.config/claude-pilot/server.log"),process.exit(1)),console.log(),LA(t,i.port)}}function LA(t,e){let r=NJ("claude",t,{stdio:"inherit",env:{...process.env,ANTHROPIC_BASE_URL:`http://localhost:${e}`,ANTHROPIC_AUTH_TOKEN:"dummy"}});r.on("error",n=>{n.code==="ENOENT"?console.error("Claude CLI not found. Install it with: npm install -g @anthropic-ai/claude-code"):console.error("Failed to run claude:",n.message),process.exit(1)}),r.on("exit",n=>{process.exit(n??0)})}async function VJ(){await xA();let t=process.argv.slice(2);if(t.length===0||!MJ(t)){await HJ(t);return}let e=new Eg;e.name("claude-pilot").description("Run Claude Code through GitHub Copilot API").version(DJ),e.command("login").description("Authenticate with GitHub Copilot").action(async()=>{try{await $A()}catch(r){console.error("Login failed:",r instanceof Error?r.message:r),process.exit(1)}}),e.command("logout").description("Clear credentials and stop proxy").action(async()=>{try{await AA()}catch(r){console.error("Logout failed:",r instanceof Error?r.message:r),process.exit(1)}}),e.command("start").description("Start the proxy server in background").option("-p, --port <port>","Port for proxy and dashboard").action(async r=>{try{await rg({port:r.port?parseInt(r.port,10):void 0})}catch(n){console.error("Start failed:",n instanceof Error?n.message:n),process.exit(1)}}),e.command("stop").description("Stop the running proxy server").action(async()=>{try{await xu()}catch(r){console.error("Stop failed:",r instanceof Error?r.message:r),process.exit(1)}}),e.command("status").description("Show proxy status and configuration").action(async()=>{try{await NA()}catch(r){console.error("Status failed:",r instanceof Error?r.message:r),process.exit(1)}}),e.command("dashboard").description("Open the log viewer dashboard in browser").action(async()=>{try{await kA()}catch(r){console.error("Dashboard failed:",r instanceof Error?r.message:r),process.exit(1)}}),e.parse()}VJ().catch(t=>{console.error("Error:",t instanceof Error?t.message:t),process.exit(1)});
|
|
391
391
|
/*! Bundled license information:
|
|
392
392
|
|
|
393
393
|
@fastify/proxy-addr/index.js:
|