UNPKG

brave-search-mcp

Version:

MCP Server that uses Brave Search API to search for images, general web search, video, news and points of interest.

5 lines 574 kB
#!/usr/bin/env node import{createRequire as e}from"module";e(import.meta.url);var t=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>function(){return t||(0,e[i(e)[0]])((t={exports:{}}).exports,t),t.exports},l=(e,s,l)=>(l=null!=e?t(a(e)):{},((e,t,a,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of i(t))o.call(e,a)||void 0===a||r(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(!s&&e&&e.__esModule?l:r(l,"default",{value:e,enumerable:!0}),e));import u from"path";import{fileURLToPath as c}from"url";var d,m,p=(d={"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.8_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"(){}},function(){return d&&(m=(0,d[i(d)[0]])(d=0)),m}),h=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var n=class extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}};function i(e,...t){const r=[e[0]];let i=0;for(;i<t.length;)s(r,t[i]),r.push(e[++i]);return new n(r)}e._Code=n,e.nil=new n(""),e._=i;var a=new n("+");function o(e,...t){const r=[u(e[0])];let i=0;for(;i<t.length;)r.push(a),s(r,t[i]),r.push(a,u(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new n(r)}function s(e,t){var i;t instanceof n?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(i=t)||"boolean"==typeof i||null===i?i:u(Array.isArray(i)?i.join(","):i))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=o,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},e.stringify=function(e){return new n(u(e))},e.safeStringify=u,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new n(`.${t}`):i`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new n(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new n(e.toString())}}}),f=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t,r,n=h(),i=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}};(r=t||(e.UsedValueState=t={}))[r.Started=0]="Started",r[r.Completed=1]="Completed",e.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};var a=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.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}}};e.Scope=a;var o=class extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}};e.ValueScopeName=o;var s=n._`\n`;e.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:n.nil}}get(){return this._scope}name(e){return new o(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:i}=n,a=null!==(r=t.key)&&void 0!==r?r:t.ref;let o=this._values[i];if(o){const e=o.get(a);if(e)return e}else o=this._values[i]=new Map;o.set(a,n);const s=this._scope[i]||(this._scope[i]=[]),l=s.length;return s[l]=t.ref,n.setValue(t,{property:i,itemIndex:l}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(r,a,o={},s){let l=n.nil;for(const u in r){const c=r[u];if(!c)continue;const d=o[u]=o[u]||new Map;c.forEach(r=>{if(d.has(r))return;d.set(r,t.Started);let o=a(r);if(o){const t=this.opts.es5?e.varKinds.var:e.varKinds.const;l=n._`${l}${t} ${r} = ${o};${this.opts._n}`}else{if(!(o=null==s?void 0:s(r)))throw new i(r);l=n._`${l}${o}${this.opts._n}`}d.set(r,t.Completed)})}return l}}}}),g=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=h(),r=f(),n=h();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=f();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=O(this.rhs,e,r),this}get names(){return z(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends s{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},c=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},m=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=O(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},g=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(N(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>E(e,t.names),{})}},v=class extends g{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},y=class extends g{},b=class extends v{};b.kind="else";var _=class e extends v{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(!0===t)return this.nodes;let r=this.else;if(r){const e=r.optimizeNodes();r=this.else=Array.isArray(e)?new b(e):e}return r?!1===t?r instanceof e?r:r.nodes:this.nodes.length?this:new e(U(t),r instanceof e?[r]:r.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=O(this.condition,e,t),this}get names(){const e=super.names;return z(e,this.condition),this.else&&E(e,this.else.names),e}};_.kind="if";var $=class extends v{};$.kind="for";var w=class extends ${constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=O(this.iteration,e,t),this}get names(){return E(super.names,this.iteration.names)}},k=class extends ${constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:a}=this;return`for(${t} ${n}=${i}; ${n}<${a}; ${n}++)`+super.render(e)}get names(){const e=z(super.names,this.from);return z(e,this.to)}},S=class extends ${constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=O(this.iterable,e,t),this}get names(){return E(super.names,this.iterable.names)}},x=class extends v{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};x.kind="func";var I=class extends g{render(e){return"return "+super.render(e)}};I.kind="return";var j=class extends v{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&E(e,this.catch.names),this.finally&&E(e,this.finally.names),e}},P=class extends v{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};P.kind="catch";var T=class extends v{render(e){return"finally"+super.render(e)}};function E(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function z(e,r){return r instanceof t._CodeOrName?E(e,r.names):e}function O(e,r,n){return e instanceof t.Name?a(e):(i=e)instanceof t._Code&&i._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str])?new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=a(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[])):e;var i;function a(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function N(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function U(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${A(e)}`}T.kind="finally",e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new o(e,i,r)),i}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new l(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new m(e)),this}object(...e){const r=["{"];for(const[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,i));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,n,i,a=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const o=this._scope.toName(e);return this._for(new k(a,o,t,n),()=>i(o))}forOf(e,n,i,a=r.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,r=>{this.var(o,t._`${e}[${r}]`),i(o)})}return this._for(new S("of",a,o,n),()=>i(o))}forIn(e,n,i,a=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,i);const o=this._scope.toName(e);return this._for(new S("in",a,o,n),()=>i(o))}endFor(){return this._endBlockNode($)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new c(e))}return(e){const t=new I;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new j;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new T,this.code(r)),this._endBlockNode(P,T)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,i){return this._blockNode(new x(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(x)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=U;var R=D(e.operators.AND);e.and=function(...e){return e.reduce(R)};var C=D(e.operators.OR);function D(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${A(r)} ${e} ${A(n)}`}function A(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(C)}}}),v=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=g(),r=h();function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||f(e,`unknown keyword: "${r}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function o(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:i}){return(a,o,s,l)=>{const u=void 0===s?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):r(a,o,s),s):o instanceof t.Name?(r(a,s,o),o):n(o,s);return l!==t.Name||u instanceof t.Name?u:i(a,u)}}function l(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach(n=>e.assign(t._`${r}${(0,t.getProperty)(n)}`,!0))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!i(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=i,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,i,a){if(!a){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${(0,t.getProperty)(i)}`},e.unescapeFragment=function(e){return o(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(a(e))},e.escapeJsonPointer=a,e.unescapeJsonPointer=o,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,()=>{e.if(t._`${r} === true`,()=>e.assign(n,!0),()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`))}),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`)),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=l,e.setEvaluated=u;var c,d,m={};function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:m[t.code]||(m[t.code]=new r._Code(t.code))})},(d=c||(e.Type=c={}))[d.Num=0]="Num",d[d.Str=1]="Str",e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const i=r===c.Num;return n?i?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:i?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,t.getProperty)(e).toString():"/"+a(e)},e.checkStrictMode=f}}),y=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0});var t=g(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}}),b=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=g(),r=v(),n=y();function i(e,r){const i=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,()=>e.assign(n.default.vErrors,t._`[${i}]`),t._`${n.default.vErrors}.push(${i})`),e.code(t._`${n.default.errors}++`)}function a(e,r){const{gen:n,validateName:i,schemaEnv:a}=e;a.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${i}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,o,l){const{it:u}=r,{gen:c,compositeRule:d,allErrors:m}=u,p=s(r,n,o);(null!=l?l:d||m)?i(c,p):a(u,t._`[${p}]`)},e.reportExtraError=function(t,r=e.keywordError,o){const{it:l}=t,{gen:u,compositeRule:c,allErrors:d}=l;i(u,s(t,r,o)),c||d||a(l,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,()=>e.if(r,()=>e.assign(t._`${n.default.vErrors}.length`,r),()=>e.assign(n.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:i,data:a,errsCount:o,it:s}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,n.default.errors,o=>{e.const(l,t._`${n.default.vErrors}[${o}]`),e.if(t._`${l}.instancePath === undefined`,()=>e.assign(t._`${l}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath))),e.assign(t._`${l}.schemaPath`,t.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign(t._`${l}.schema`,i),e.assign(t._`${l}.data`,a))})};var o={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,r,i){const{createErrors:a}=e.it;return!1===a?t._`{}`:function(e,r,i={}){const{gen:a,it:s}=e,c=[l(s,i),u(e,i)];return function(e,{params:r,message:i},a){const{keyword:s,data:l,schemaValue:u,it:c}=e,{opts:d,propertyName:m,topSchemaRef:p,schemaPath:h}=c;a.push([o.keyword,s],[o.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&a.push([o.message,"function"==typeof i?i(e):i]),d.verbose&&a.push([o.schema,u],[o.parentSchema,t._`${p}${h}`],[n.default.data,l]),m&&a.push([o.propertyName,m])}(e,r,c),a.object(...c)}(e,r,i)}function l({errorPath:e},{instancePath:i}){const a=i?t.str`${e}${(0,r.getErrorPath)(i,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,a)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:i,parentSchema:a}){let s=a?n:t.str`${n}/${e}`;return i&&(s=t.str`${s}${(0,r.getErrorPath)(i,r.Type.Str)}`),[o.schemaPath,s]}}}),_=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=b(),r=g(),n=y(),i={message:"boolean schema is false"};function a(e,r){const{gen:n,data:a}=e,o={gen:n,keyword:"false schema",data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,r)}e.topBoolOrEmptySchema=function(e){const{gen:t,schema:i,validateName:o}=e;!1===i?a(e,!1):"object"==typeof i&&!0===i.$async?t.return(n.default.data):(t.assign(r._`${o}.errors`,null),t.return(!0))},e.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}}}),$=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(e){return"string"==typeof e&&t.has(e)},e.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}}}),w=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js"(e){function t(e,t){return t.rules.some(t=>r(e,t))}function r(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}p(),Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:e,self:r},n){const i=r.RULES.types[n];return i&&!0!==i&&t(e,i)},e.shouldUseGroup=t,e.shouldUseRule=r}}),k=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t,r,n=$(),i=w(),a=b(),o=g(),s=v();function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}(r=t||(e.DataType=t={}))[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong",e.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=l,e.coerceAndCheckDataType=function(e,r){const{gen:n,data:a,opts:s}=e,l=function(e,t){return t?e.filter(e=>u.has(e)||"array"===t&&"array"===e):[]}(r,s.coerceTypes),c=r.length>0&&!(0===l.length&&1===r.length&&(0,i.schemaHasRulesForType)(e,r[0]));if(c){const i=d(r,a,s.strictNumbers,t.Wrong);n.if(i,()=>{l.length?function(e,t,r){const{gen:n,data:i,opts:a}=e,s=n.let("dataType",o._`typeof ${i}`),l=n.let("coerced",o._`undefined`);"array"===a.coerceTypes&&n.if(o._`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,o._`${i}[0]`).assign(s,o._`typeof ${i}`).if(d(t,i,a.strictNumbers),()=>n.assign(l,i))),n.if(o._`${l} !== undefined`);for(const e of r)(u.has(e)||"array"===e&&"array"===a.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void n.elseIf(o._`${s} == "number" || ${s} == "boolean"`).assign(l,o._`"" + ${i}`).elseIf(o._`${i} === null`).assign(l,o._`""`);case"number":return void n.elseIf(o._`${s} == "boolean" || ${i} === null || (${s} == "string" && ${i} && ${i} == +${i})`).assign(l,o._`+${i}`);case"integer":return void n.elseIf(o._`${s} === "boolean" || ${i} === null || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,o._`+${i}`);case"boolean":return void n.elseIf(o._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf(o._`${i} === "true" || ${i} === 1`).assign(l,!0);case"null":return n.elseIf(o._`${i} === "" || ${i} === 0 || ${i} === false`),void n.assign(l,null);case"array":n.elseIf(o._`${s} === "string" || ${s} === "number" || ${s} === "boolean" || ${i} === null`).assign(l,o._`[${i}]`)}}n.else(),h(e),n.endIf(),n.if(o._`${l} !== undefined`,()=>{n.assign(i,l),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(o._`${t} !== undefined`,()=>e.assign(o._`${t}[${r}]`,n))}(e,l)})}(e,r,l):h(e)})}return c};var u=new Set(["string","number","integer","boolean","null"]);function c(e,r,n,i=t.Correct){const a=i===t.Correct?o.operators.EQ:o.operators.NEQ;let s;switch(e){case"null":return o._`${r} ${a} null`;case"array":s=o._`Array.isArray(${r})`;break;case"object":s=o._`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":s=l(o._`!(${r} % 1) && !isNaN(${r})`);break;case"number":s=l();break;default:return o._`typeof ${r} ${a} ${e}`}return i===t.Correct?s:(0,o.not)(s);function l(e=o.nil){return(0,o.and)(o._`typeof ${r} == "number"`,e,n?o._`isFinite(${r})`:o.nil)}}function d(e,t,r,n){if(1===e.length)return c(e[0],t,r,n);let i;const a=(0,s.toHash)(e);if(a.array&&a.object){const e=o._`typeof ${t} != "object"`;i=a.null?e:o._`!${t} || ${e}`,delete a.null,delete a.array,delete a.object}else i=o.nil;a.number&&delete a.integer;for(const e in a)i=(0,o.and)(i,c(e,t,r,n));return i}e.checkDataType=c,e.checkDataTypes=d;var m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function h(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,s.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,a.reportError)(t,m)}e.reportTypeError=h}}),S=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;var t=g(),r=v();function n(e,n,i){const{gen:a,compositeRule:o,data:s,opts:l}=e;if(void 0===i)return;const u=t._`${s}${(0,t.getProperty)(n)}`;if(o)return void(0,r.checkStrictMode)(e,`default is ignored for: ${u}`);let c=t._`${u} === undefined`;"empty"===l.useDefaults&&(c=t._`${c} || ${u} === null || ${u} === ""`),a.if(c,t._`${u} = ${(0,t.stringify)(i)}`)}e.assignDefaults=function(e,t){const{properties:r,items:i}=e.schema;if("object"===t&&r)for(const t in r)n(e,t,r[t].default);else"array"===t&&Array.isArray(i)&&i.forEach((t,r)=>n(e,r,t.default))}}}),x=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js"(e){p(),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 t=g(),r=v(),n=y(),i=v();function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}function o(e,r,n){return t._`${a(e)}.call(${r}, ${n})`}function s(e,r,n,i){const a=t._`${r}${(0,t.getProperty)(n)} === undefined`;return i?(0,t.or)(a,(0,t.not)(o(e,r,n))):a}function l(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}e.checkReportMissingProp=function(e,r){const{gen:n,data:i,it:a}=e;n.if(s(n,i,r,a.opts.ownProperties),()=>{e.setParams({missingProperty:t._`${r}`},!0),e.error()})},e.checkMissingProp=function({gen:e,data:r,it:{opts:n}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(s(e,r,i,n.ownProperties),t._`${a} = ${i}`)))},e.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},e.hasPropFunc=a,e.isOwnProperty=o,e.propertyInData=function(e,r,n,i){const a=t._`${r}${(0,t.getProperty)(n)} !== undefined`;return i?t._`${a} && ${o(e,r,n)}`:a},e.noPropertyInData=s,e.allSchemaProperties=l,e.schemaProperties=function(e,t){return l(t).filter(n=>!(0,r.alwaysValidSchema)(e,t[n]))},e.callValidateCode=function({schemaCode:e,data:r,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:l},u,c,d){const m=d?t._`${e}, ${r}, ${a}${o}`:r,p=[[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,s)],[n.default.parentData,l.parentData],[n.default.parentDataProperty,l.parentDataProperty],[n.default.rootData,n.default.rootData]];l.opts.dynamicRef&&p.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const h=t._`${m}, ${i.object(...p)}`;return c!==t.nil?t._`${u}.call(${c}, ${h})`:t._`${u}(${h})`};var u=t._`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},n){const a=r.unicodeRegExp?"u":"",{regExp:o}=r.code,s=o(n,a);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:t._`${"new RegExp"===o.code?u:(0,i.useFunc)(e,o)}(${n}, ${a})`})},e.validateArray=function(e){const{gen:n,data:i,keyword:a,it:o}=e,s=n.name("valid");if(o.allErrors){const e=n.let("valid",!0);return l(()=>n.assign(e,!1)),e}return n.var(s,!0),l(()=>n.break()),s;function l(o){const l=n.const("len",t._`${i}.length`);n.forRange("i",0,l,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:r.Type.Num},s),n.if((0,t.not)(s),o)})}},e.validateUnion=function(e){const{gen:n,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw new Error("ajv implementation error");if(i.some(e=>(0,r.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;const s=n.let("valid",!1),l=n.name("_valid");n.block(()=>i.forEach((r,i)=>{const o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},l);n.assign(s,t._`${s} || ${l}`),e.mergeValidEvaluated(o,l)||n.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}}}),I=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=g(),r=y(),n=x(),i=b();function a(e){const{gen:r,data:n,it:i}=e;r.if(i.parentData,()=>r.assign(n,t._`${i.parentData}[${i.parentDataProperty}]`))}function o(e,r,n){if(void 0===n)throw new Error(`keyword "${r}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,t.stringify)(n)})}e.macroKeywordCode=function(e,r){const{gen:n,keyword:i,schema:a,parentSchema:s,it:l}=e,u=r.macro.call(l.self,a,s,l),c=o(n,i,u);!1!==l.opts.validateSchema&&l.self.validateSchema(u,!0);const d=n.name("valid");e.subschema({schema:u,schemaPath:t.nil,errSchemaPath:`${l.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},e.funcKeywordCode=function(e,s){var l;const{gen:u,keyword:c,schema:d,parentSchema:m,$data:p,it:h}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,s);const f=!p&&s.compile?s.compile.call(h.self,d,m,h):s.validate,g=o(u,c,f),v=u.let("valid");function y(i=(s.async?t._`await `:t.nil)){const a=h.opts.passContext?r.default.this:r.default.self,o=!("compile"in s&&!p||!1===s.schema);u.assign(v,t._`${i}${(0,n.callValidateCode)(e,g,a,o)}`,s.modifying)}function b(e){var r;u.if((0,t.not)(null!==(r=s.valid)&&void 0!==r?r:v),e)}e.block$data(v,function(){if(!1===s.errors)y(),s.modifying&&a(e),b(()=>e.error());else{const n=s.async?function(){const e=u.let("ruleErrs",null);return u.try(()=>y(t._`await `),r=>u.assign(v,!1).if(t._`${r} instanceof ${h.ValidationError}`,()=>u.assign(e,t._`${r}.errors`),()=>u.throw(r))),e}():function(){const e=t._`${g}.errors`;return u.assign(e,null),y(t.nil),e}();s.modifying&&a(e),b(()=>function(e,n){const{gen:a}=e;a.if(t._`Array.isArray(${n})`,()=>{a.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${n} : ${r.default.vErrors}.concat(${n})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}(e,n))}}),e.ok(null!==(l=s.valid)&&void 0!==l?l:v)},e.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},e.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw new Error("ajv implementation error");const o=i.dependencies;if(null==o?void 0:o.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[a])){const e=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}}}),j=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=g(),r=v();e.getSubschema=function(e,{keyword:n,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:l}){if(void 0!==n&&void 0!==a)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==n){const a=e.schema[n];return void 0===i?{schema:a,schemaPath:t._`${e.schemaPath}${(0,t.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${n}`}:{schema:a[i],schemaPath:t._`${e.schemaPath}${(0,t.getProperty)(n)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${n}/${(0,r.escapeFragment)(i)}`}}if(void 0!==a){if(void 0===o||void 0===s||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:a,schemaPath:o,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,n,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:l}){if(void 0!==o&&void 0!==i)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=n;if(void 0!==i){const{errorPath:o,dataPathArr:s,opts:l}=n;c(u.let("data",t._`${n.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=t.str`${o}${(0,r.getErrorPath)(i,a,l.jsPropertySyntax)}`,e.parentDataProperty=t._`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}function c(t){e.data=t,e.dataLevel=n.dataLevel+1,e.dataTypes=[],n.definedProperties=new Set,e.parentData=n.data,e.dataNames=[...n.dataNames,t]}void 0!==o&&(c(o instanceof t.Name?o:u.let("data",o,!0)),void 0!==l&&(e.propertyName=l)),s&&(e.dataTypes=s)},e.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:a}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}}}),P=s({"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(e,t){p(),t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!==i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!==i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;0!==i--;){var o=a[i];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}}}),T=s({"../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js"(e,t){p();var r=t.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,t,a,o,s,l,u,c,d,m){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var p in t(o,s,l,u,c,d,m),o){var h=o[p];if(Array.isArray(h)){if(p in r.arrayKeywords)for(var f=0;f<h.length;f++)n(e,t,a,h[f],s+"/"+p+"/"+f,l,s,p,o,f)}else if(p in r.propsKeywords){if(h&&"object"==typeof h)for(var g in h)n(e,t,a,h[g],s+"/"+p+"/"+i(g),l,s,p,o,g)}else(p in r.keywords||e.allKeys&&!(p in r.skipKeywords))&&n(e,t,a,h,s+"/"+p,l,s,p,o)}a(o,s,l,u,c,d,m)}}function i(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}}}),E=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=v(),r=P(),n=T(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!o(e):!!t&&s(e)<=t)};var a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(o))return!0;if("object"==typeof r&&o(r))return!0}return!1}function s(e){let r=0;for(const n in e){if("$ref"===n)return 1/0;if(r++,!i.has(n)&&("object"==typeof e[n]&&(0,t.eachItem)(e[n],e=>r+=s(e)),r===1/0))return 1/0}return r}function l(e,t="",r){!1!==r&&(t=d(t));const n=e.parse(t);return u(e,n)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=l,e._getFullPath=u;var c=/#\/?$/;function d(e){return e?e.replace(c,""):""}e.normalizeId=d,e.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};var m=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:i,uriResolver:a}=this.opts,o=d(e[i]||t),s={"":o},u=l(a,o,!1),c={},p=new Set;return n(e,{allKeys:!0},(e,t,r,n)=>{if(void 0===n)return;const a=u+t;let o=s[n];function l(t){const r=this.opts.uriResolver.resolve;if(t=d(o?r(o,t):t),p.has(t))throw f(t);p.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?h(e,n.schema,t):t!==d(a)&&("#"===t[0]?(h(e,c[t],t),c[t]=e):this.refs[t]=a),t}function g(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[i]&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o}),c;function h(e,t,n){if(void 0!==t&&!r(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}}}),z=s({"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js"(e){p(),Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=_(),r=k(),n=w(),i=k(),a=S(),o=I(),s=j(),l=g(),u=y(),c=E(),d=v(),m=b();function h({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},a){i.code.es5?e.func(t,l._`${u.default.data}, ${u.default.valCxt}`,n.$async,()=>{e.code(l._`"use strict"; ${f(r,i)}`),function(e,t){e.if(u.default.valCxt,()=>{e.var(u.default.instancePath,l._`${u.default.valCxt}.${u.default.instancePath}`),e.var(u.default.parentData,l._`${u.default.valCxt}.${u.default.parentData}`),e.var(u.default.parentDataProperty,l._`${u.default.valCxt}.${u.default.parentDataProperty}`),e.var(u.default.rootData,l._`${u.default.valCxt}.${u.default.rootData}`),t.dynamicRef&&e.var(u.default.dynamicAnchors,l._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{e.var(u.default.instancePath,l._`""`),e.var(u.default.parentData,l._`undefined`),e.var(u.default.parentDataProperty,l._`undefined`),e.var(u.default.rootData,u.default.data),t.dynamicRef&&e.var(u.default.dynamicAnchors,l._`{}`)})}(e,i),e.code(a)}):e.func(t,l._`${u.default.data}, ${function(e){return l._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${e.dynamicRef?l._`, ${u.default.dynamicAnchors}={}`:l.nil}}={}`}(i)}`,n.$async,()=>e.code(f(r,i)).code(a))}function f(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?l._`/*# sourceURL=${r} */`:l.nil}function $({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function x(e){return"boolean"!=typeof e.schema}function P(e){(0,d.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function T(e,t){if(e.opts.jtd)return O(e,[],!1,t);const n=(0,r.getSchemaTypes)(e.schema);O(e,n,!(0,r.coerceAndCheckDataType)(e,n),t)}function z({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const a=r.$comment;if(!0===i.$comment)e.code(l._`${u.default.self}.logger.log(${a})`);else if("function"==typeof i.$comment){const r=l.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(l._`${u.default.self}.opts.$comment(${a}, ${r}, ${i}.schema)`)}}function O(e,t,r,a){const{gen:o,schema:s,data:c,allErrors:m,opts:p,self:h}=e,{RULES:f}=h;function g(d){(0,n.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,c,p.strictNumbers)),N(e,d),1===t.length&&t[0]===d.type&&r&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):N(e,d),m||o.if(l._`${u.default.errors} === ${a||0}`))}!s.$ref||!p.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(s,f)?(p.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{U(e.dataTypes,t)||R(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const r=[];for(const n of e.dataTypes)U(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&R(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const i in r){const a=r[i];if("object"==typeof a&&(0,n.shouldUseRule)(e.schema,a)){const{type:r}=a.definition;r.length&&!r.some(e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n})&&R(e,`missing type "${r.join(",")}" for keyword "${i}"`)}}}(e,e.dataTypes))}(e,t),o.block(()=>{for(const e of f.rules)g(e);g(f.post)})):o.block(()=>D(e,"$ref",f.all.$ref.definition))}function N(e,t){const{gen:r,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),r.block(()=>{for(const r of t.rules)(0,n.shouldUseRule)(i,r)&&D(e,r.keyword,r.definition,t.type)})}function U(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function R(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}e.validateFunctionCode=function(e){x(e)&&(P(e),$(e))?function(e){const{schema:t,opts:r,gen:n}=e;h(e,()=>{r.$comment&&t.$comment&&z(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(u.default.vErrors,null),n.let(u.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",l._`${r}.evaluated`),t.if(l._`${e.evaluated}.dynamicProps`,()=>t.assign(l._`${e.evaluated}.props`,l._`undefined`)),t.if(l._`${e.evaluated}.dynamicItems`,()=>t.assign(l._`${e.evaluated}.items`,l._`undefined`))}(e),T(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:a}=e;r.$async?t.if(l._`${u.default.errors} === 0`,()=>t.return(u.default.data),()=>t.throw(l._`new ${i}(${u.default.vErrors})`)):(t.assign(l._`${n}.errors`,u.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof l.Name&&e.assign(l._`${t}.props`,r),n instanceof l.Name&&e.assign(l._`${t}.items`,n)}(e),t.return(l._`${u.default.errors} === 0`))}(e)})}(e):h(e,()=>(0,t.topBoolOrEmptySchema)(e))};var C=class{constructor(e,t,r){if((0,o.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",M(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",u.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,