| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 var __create = Object.create; 2 var __defProp = Object.defineProperty; 3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 4 var __getOwnPropNames = Object.getOwnPropertyNames; 5 var __getProtoOf = Object.getPrototypeOf; 6 var __hasOwnProp = Object.prototype.hasOwnProperty; 7 var __commonJS = (cb, mod) => function __require() { 8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 9 }; 10 var __export = (target, all) => { 11 for (var name in all) 12 __defProp(target, name, { get: all[name], enumerable: true }); 13 }; 14 var __copyProps = (to, from, except, desc) => { 15 if (from && typeof from === "object" || typeof from === "function") { 16 for (let key of __getOwnPropNames(from)) 17 if (!__hasOwnProp.call(to, key) && key !== except) 18 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 19 } 20 return to; 21 }; 22 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 23 // If the importer is in node compatibility mode or this is not an ESM 24 // file that has been converted to a CommonJS file using a Babel- 25 // compatible transform (i.e. "__esModule" has not been set), then set 26 // "default" to the CommonJS "module.exports" for node compatibility. 27 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 28 mod 29 )); 30 31 // package-external:@wordpress/data 32 var require_data = __commonJS({ 33 "package-external:@wordpress/data"(exports, module) { 34 module.exports = window.wp.data; 35 } 36 }); 37 38 // package-external:@wordpress/i18n 39 var require_i18n = __commonJS({ 40 "package-external:@wordpress/i18n"(exports, module) { 41 module.exports = window.wp.i18n; 42 } 43 }); 44 45 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/codegen/code.js 46 var require_code = __commonJS({ 47 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/codegen/code.js"(exports) { 48 "use strict"; 49 Object.defineProperty(exports, "__esModule", { value: true }); 50 exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; 51 var _CodeOrName = class { 52 }; 53 exports._CodeOrName = _CodeOrName; 54 exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; 55 var Name = class extends _CodeOrName { 56 constructor(s) { 57 super(); 58 if (!exports.IDENTIFIER.test(s)) 59 throw new Error("CodeGen: name must be a valid identifier"); 60 this.str = s; 61 } 62 toString() { 63 return this.str; 64 } 65 emptyStr() { 66 return false; 67 } 68 get names() { 69 return { [this.str]: 1 }; 70 } 71 }; 72 exports.Name = Name; 73 var _Code = class extends _CodeOrName { 74 constructor(code) { 75 super(); 76 this._items = typeof code === "string" ? [code] : code; 77 } 78 toString() { 79 return this.str; 80 } 81 emptyStr() { 82 if (this._items.length > 1) 83 return false; 84 const item = this._items[0]; 85 return item === "" || item === '""'; 86 } 87 get str() { 88 var _a; 89 return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `$s}$c}`, ""); 90 } 91 get names() { 92 var _a; 93 return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => { 94 if (c instanceof Name) 95 names[c.str] = (names[c.str] || 0) + 1; 96 return names; 97 }, {}); 98 } 99 }; 100 exports._Code = _Code; 101 exports.nil = new _Code(""); 102 function _(strs, ...args) { 103 const code = [strs[0]]; 104 let i = 0; 105 while (i < args.length) { 106 addCodeArg(code, args[i]); 107 code.push(strs[++i]); 108 } 109 return new _Code(code); 110 } 111 exports._ = _; 112 var plus = new _Code("+"); 113 function str(strs, ...args) { 114 const expr = [safeStringify(strs[0])]; 115 let i = 0; 116 while (i < args.length) { 117 expr.push(plus); 118 addCodeArg(expr, args[i]); 119 expr.push(plus, safeStringify(strs[++i])); 120 } 121 optimize(expr); 122 return new _Code(expr); 123 } 124 exports.str = str; 125 function addCodeArg(code, arg) { 126 if (arg instanceof _Code) 127 code.push(...arg._items); 128 else if (arg instanceof Name) 129 code.push(arg); 130 else 131 code.push(interpolate(arg)); 132 } 133 exports.addCodeArg = addCodeArg; 134 function optimize(expr) { 135 let i = 1; 136 while (i < expr.length - 1) { 137 if (expr[i] === plus) { 138 const res = mergeExprItems(expr[i - 1], expr[i + 1]); 139 if (res !== void 0) { 140 expr.splice(i - 1, 3, res); 141 continue; 142 } 143 expr[i++] = "+"; 144 } 145 i++; 146 } 147 } 148 function mergeExprItems(a, b) { 149 if (b === '""') 150 return a; 151 if (a === '""') 152 return b; 153 if (typeof a == "string") { 154 if (b instanceof Name || a[a.length - 1] !== '"') 155 return; 156 if (typeof b != "string") 157 return `$a.slice(0, -1)}$b}"`; 158 if (b[0] === '"') 159 return a.slice(0, -1) + b.slice(1); 160 return; 161 } 162 if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) 163 return `"$a}$b.slice(1)}`; 164 return; 165 } 166 function strConcat(c1, c2) { 167 return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`$c1}$c2}`; 168 } 169 exports.strConcat = strConcat; 170 function interpolate(x) { 171 return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x); 172 } 173 function stringify(x) { 174 return new _Code(safeStringify(x)); 175 } 176 exports.stringify = stringify; 177 function safeStringify(x) { 178 return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); 179 } 180 exports.safeStringify = safeStringify; 181 function getProperty(key) { 182 return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.$key}`) : _`[$key}]`; 183 } 184 exports.getProperty = getProperty; 185 function getEsmExportName(key) { 186 if (typeof key == "string" && exports.IDENTIFIER.test(key)) { 187 return new _Code(`$key}`); 188 } 189 throw new Error(`CodeGen: invalid export name: $key}, use explicit $id name mapping`); 190 } 191 exports.getEsmExportName = getEsmExportName; 192 function regexpCode(rx) { 193 return new _Code(rx.toString()); 194 } 195 exports.regexpCode = regexpCode; 196 } 197 }); 198 199 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/codegen/scope.js 200 var require_scope = __commonJS({ 201 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/codegen/scope.js"(exports) { 202 "use strict"; 203 Object.defineProperty(exports, "__esModule", { value: true }); 204 exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; 205 var code_1 = require_code(); 206 var ValueError = class extends Error { 207 constructor(name) { 208 super(`CodeGen: "code" for $name} not defined`); 209 this.value = name.value; 210 } 211 }; 212 var UsedValueState; 213 (function(UsedValueState2) { 214 UsedValueState2[UsedValueState2["Started"] = 0] = "Started"; 215 UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed"; 216 })(UsedValueState || (exports.UsedValueState = UsedValueState = {})); 217 exports.varKinds = { 218 const: new code_1.Name("const"), 219 let: new code_1.Name("let"), 220 var: new code_1.Name("var") 221 }; 222 var Scope = class { 223 constructor({ prefixes, parent } = {}) { 224 this._names = {}; 225 this._prefixes = prefixes; 226 this._parent = parent; 227 } 228 toName(nameOrPrefix) { 229 return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); 230 } 231 name(prefix) { 232 return new code_1.Name(this._newName(prefix)); 233 } 234 _newName(prefix) { 235 const ng = this._names[prefix] || this._nameGroup(prefix); 236 return `$prefix}$ng.index++}`; 237 } 238 _nameGroup(prefix) { 239 var _a, _b; 240 if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { 241 throw new Error(`CodeGen: prefix "$prefix}" is not allowed in this scope`); 242 } 243 return this._names[prefix] = { prefix, index: 0 }; 244 } 245 }; 246 exports.Scope = Scope; 247 var ValueScopeName = class extends code_1.Name { 248 constructor(prefix, nameStr) { 249 super(nameStr); 250 this.prefix = prefix; 251 } 252 setValue(value, { property, itemIndex }) { 253 this.value = value; 254 this.scopePath = (0, code_1._)`.$new code_1.Name(property)}[$itemIndex}]`; 255 } 256 }; 257 exports.ValueScopeName = ValueScopeName; 258 var line = (0, code_1._)`\n`; 259 var ValueScope = class extends Scope { 260 constructor(opts) { 261 super(opts); 262 this._values = {}; 263 this._scope = opts.scope; 264 this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; 265 } 266 get() { 267 return this._scope; 268 } 269 name(prefix) { 270 return new ValueScopeName(prefix, this._newName(prefix)); 271 } 272 value(nameOrPrefix, value) { 273 var _a; 274 if (value.ref === void 0) 275 throw new Error("CodeGen: ref must be passed in value"); 276 const name = this.toName(nameOrPrefix); 277 const { prefix } = name; 278 const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; 279 let vs = this._values[prefix]; 280 if (vs) { 281 const _name = vs.get(valueKey); 282 if (_name) 283 return _name; 284 } else { 285 vs = this._values[prefix] = /* @__PURE__ */ new Map(); 286 } 287 vs.set(valueKey, name); 288 const s = this._scope[prefix] || (this._scope[prefix] = []); 289 const itemIndex = s.length; 290 s[itemIndex] = value.ref; 291 name.setValue(value, { property: prefix, itemIndex }); 292 return name; 293 } 294 getValue(prefix, keyOrRef) { 295 const vs = this._values[prefix]; 296 if (!vs) 297 return; 298 return vs.get(keyOrRef); 299 } 300 scopeRefs(scopeName, values = this._values) { 301 return this._reduceValues(values, (name) => { 302 if (name.scopePath === void 0) 303 throw new Error(`CodeGen: name "$name}" has no value`); 304 return (0, code_1._)`$scopeName}$name.scopePath}`; 305 }); 306 } 307 scopeCode(values = this._values, usedValues, getCode) { 308 return this._reduceValues(values, (name) => { 309 if (name.value === void 0) 310 throw new Error(`CodeGen: name "$name}" has no value`); 311 return name.value.code; 312 }, usedValues, getCode); 313 } 314 _reduceValues(values, valueCode, usedValues = {}, getCode) { 315 let code = code_1.nil; 316 for (const prefix in values) { 317 const vs = values[prefix]; 318 if (!vs) 319 continue; 320 const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map(); 321 vs.forEach((name) => { 322 if (nameSet.has(name)) 323 return; 324 nameSet.set(name, UsedValueState.Started); 325 let c = valueCode(name); 326 if (c) { 327 const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; 328 code = (0, code_1._)`$code}$def} $name} = $c};$this.opts._n}`; 329 } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) { 330 code = (0, code_1._)`$code}$c}$this.opts._n}`; 331 } else { 332 throw new ValueError(name); 333 } 334 nameSet.set(name, UsedValueState.Completed); 335 }); 336 } 337 return code; 338 } 339 }; 340 exports.ValueScope = ValueScope; 341 } 342 }); 343 344 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/codegen/index.js 345 var require_codegen = __commonJS({ 346 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/codegen/index.js"(exports) { 347 "use strict"; 348 Object.defineProperty(exports, "__esModule", { value: true }); 349 exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; 350 var code_1 = require_code(); 351 var scope_1 = require_scope(); 352 var code_2 = require_code(); 353 Object.defineProperty(exports, "_", { enumerable: true, get: function() { 354 return code_2._; 355 } }); 356 Object.defineProperty(exports, "str", { enumerable: true, get: function() { 357 return code_2.str; 358 } }); 359 Object.defineProperty(exports, "strConcat", { enumerable: true, get: function() { 360 return code_2.strConcat; 361 } }); 362 Object.defineProperty(exports, "nil", { enumerable: true, get: function() { 363 return code_2.nil; 364 } }); 365 Object.defineProperty(exports, "getProperty", { enumerable: true, get: function() { 366 return code_2.getProperty; 367 } }); 368 Object.defineProperty(exports, "stringify", { enumerable: true, get: function() { 369 return code_2.stringify; 370 } }); 371 Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function() { 372 return code_2.regexpCode; 373 } }); 374 Object.defineProperty(exports, "Name", { enumerable: true, get: function() { 375 return code_2.Name; 376 } }); 377 var scope_2 = require_scope(); 378 Object.defineProperty(exports, "Scope", { enumerable: true, get: function() { 379 return scope_2.Scope; 380 } }); 381 Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function() { 382 return scope_2.ValueScope; 383 } }); 384 Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function() { 385 return scope_2.ValueScopeName; 386 } }); 387 Object.defineProperty(exports, "varKinds", { enumerable: true, get: function() { 388 return scope_2.varKinds; 389 } }); 390 exports.operators = { 391 GT: new code_1._Code(">"), 392 GTE: new code_1._Code(">="), 393 LT: new code_1._Code("<"), 394 LTE: new code_1._Code("<="), 395 EQ: new code_1._Code("==="), 396 NEQ: new code_1._Code("!=="), 397 NOT: new code_1._Code("!"), 398 OR: new code_1._Code("||"), 399 AND: new code_1._Code("&&"), 400 ADD: new code_1._Code("+") 401 }; 402 var Node = class { 403 optimizeNodes() { 404 return this; 405 } 406 optimizeNames(_names, _constants) { 407 return this; 408 } 409 }; 410 var Def = class extends Node { 411 constructor(varKind, name, rhs) { 412 super(); 413 this.varKind = varKind; 414 this.name = name; 415 this.rhs = rhs; 416 } 417 render({ es5, _n }) { 418 const varKind = es5 ? scope_1.varKinds.var : this.varKind; 419 const rhs = this.rhs === void 0 ? "" : ` = $this.rhs}`; 420 return `$varKind} $this.name}$rhs};` + _n; 421 } 422 optimizeNames(names, constants) { 423 if (!names[this.name.str]) 424 return; 425 if (this.rhs) 426 this.rhs = optimizeExpr(this.rhs, names, constants); 427 return this; 428 } 429 get names() { 430 return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; 431 } 432 }; 433 var Assign = class extends Node { 434 constructor(lhs, rhs, sideEffects) { 435 super(); 436 this.lhs = lhs; 437 this.rhs = rhs; 438 this.sideEffects = sideEffects; 439 } 440 render({ _n }) { 441 return `$this.lhs} = $this.rhs};` + _n; 442 } 443 optimizeNames(names, constants) { 444 if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) 445 return; 446 this.rhs = optimizeExpr(this.rhs, names, constants); 447 return this; 448 } 449 get names() { 450 const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; 451 return addExprNames(names, this.rhs); 452 } 453 }; 454 var AssignOp = class extends Assign { 455 constructor(lhs, op, rhs, sideEffects) { 456 super(lhs, rhs, sideEffects); 457 this.op = op; 458 } 459 render({ _n }) { 460 return `$this.lhs} $this.op}= $this.rhs};` + _n; 461 } 462 }; 463 var Label = class extends Node { 464 constructor(label) { 465 super(); 466 this.label = label; 467 this.names = {}; 468 } 469 render({ _n }) { 470 return `$this.label}:` + _n; 471 } 472 }; 473 var Break = class extends Node { 474 constructor(label) { 475 super(); 476 this.label = label; 477 this.names = {}; 478 } 479 render({ _n }) { 480 const label = this.label ? ` $this.label}` : ""; 481 return `break$label};` + _n; 482 } 483 }; 484 var Throw = class extends Node { 485 constructor(error) { 486 super(); 487 this.error = error; 488 } 489 render({ _n }) { 490 return `throw $this.error};` + _n; 491 } 492 get names() { 493 return this.error.names; 494 } 495 }; 496 var AnyCode = class extends Node { 497 constructor(code) { 498 super(); 499 this.code = code; 500 } 501 render({ _n }) { 502 return `$this.code};` + _n; 503 } 504 optimizeNodes() { 505 return `$this.code}` ? this : void 0; 506 } 507 optimizeNames(names, constants) { 508 this.code = optimizeExpr(this.code, names, constants); 509 return this; 510 } 511 get names() { 512 return this.code instanceof code_1._CodeOrName ? this.code.names : {}; 513 } 514 }; 515 var ParentNode = class extends Node { 516 constructor(nodes = []) { 517 super(); 518 this.nodes = nodes; 519 } 520 render(opts) { 521 return this.nodes.reduce((code, n) => code + n.render(opts), ""); 522 } 523 optimizeNodes() { 524 const { nodes } = this; 525 let i = nodes.length; 526 while (i--) { 527 const n = nodes[i].optimizeNodes(); 528 if (Array.isArray(n)) 529 nodes.splice(i, 1, ...n); 530 else if (n) 531 nodes[i] = n; 532 else 533 nodes.splice(i, 1); 534 } 535 return nodes.length > 0 ? this : void 0; 536 } 537 optimizeNames(names, constants) { 538 const { nodes } = this; 539 let i = nodes.length; 540 while (i--) { 541 const n = nodes[i]; 542 if (n.optimizeNames(names, constants)) 543 continue; 544 subtractNames(names, n.names); 545 nodes.splice(i, 1); 546 } 547 return nodes.length > 0 ? this : void 0; 548 } 549 get names() { 550 return this.nodes.reduce((names, n) => addNames(names, n.names), {}); 551 } 552 }; 553 var BlockNode = class extends ParentNode { 554 render(opts) { 555 return "{" + opts._n + super.render(opts) + "}" + opts._n; 556 } 557 }; 558 var Root = class extends ParentNode { 559 }; 560 var Else = class extends BlockNode { 561 }; 562 Else.kind = "else"; 563 var If = class _If extends BlockNode { 564 constructor(condition, nodes) { 565 super(nodes); 566 this.condition = condition; 567 } 568 render(opts) { 569 let code = `if($this.condition})` + super.render(opts); 570 if (this.else) 571 code += "else " + this.else.render(opts); 572 return code; 573 } 574 optimizeNodes() { 575 super.optimizeNodes(); 576 const cond = this.condition; 577 if (cond === true) 578 return this.nodes; 579 let e = this.else; 580 if (e) { 581 const ns = e.optimizeNodes(); 582 e = this.else = Array.isArray(ns) ? new Else(ns) : ns; 583 } 584 if (e) { 585 if (cond === false) 586 return e instanceof _If ? e : e.nodes; 587 if (this.nodes.length) 588 return this; 589 return new _If(not(cond), e instanceof _If ? [e] : e.nodes); 590 } 591 if (cond === false || !this.nodes.length) 592 return void 0; 593 return this; 594 } 595 optimizeNames(names, constants) { 596 var _a; 597 this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); 598 if (!(super.optimizeNames(names, constants) || this.else)) 599 return; 600 this.condition = optimizeExpr(this.condition, names, constants); 601 return this; 602 } 603 get names() { 604 const names = super.names; 605 addExprNames(names, this.condition); 606 if (this.else) 607 addNames(names, this.else.names); 608 return names; 609 } 610 }; 611 If.kind = "if"; 612 var For = class extends BlockNode { 613 }; 614 For.kind = "for"; 615 var ForLoop = class extends For { 616 constructor(iteration) { 617 super(); 618 this.iteration = iteration; 619 } 620 render(opts) { 621 return `for($this.iteration})` + super.render(opts); 622 } 623 optimizeNames(names, constants) { 624 if (!super.optimizeNames(names, constants)) 625 return; 626 this.iteration = optimizeExpr(this.iteration, names, constants); 627 return this; 628 } 629 get names() { 630 return addNames(super.names, this.iteration.names); 631 } 632 }; 633 var ForRange = class extends For { 634 constructor(varKind, name, from, to) { 635 super(); 636 this.varKind = varKind; 637 this.name = name; 638 this.from = from; 639 this.to = to; 640 } 641 render(opts) { 642 const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; 643 const { name, from, to } = this; 644 return `for($varKind} $name}=$from}; $name}<$to}; $name}++)` + super.render(opts); 645 } 646 get names() { 647 const names = addExprNames(super.names, this.from); 648 return addExprNames(names, this.to); 649 } 650 }; 651 var ForIter = class extends For { 652 constructor(loop, varKind, name, iterable) { 653 super(); 654 this.loop = loop; 655 this.varKind = varKind; 656 this.name = name; 657 this.iterable = iterable; 658 } 659 render(opts) { 660 return `for($this.varKind} $this.name} $this.loop} $this.iterable})` + super.render(opts); 661 } 662 optimizeNames(names, constants) { 663 if (!super.optimizeNames(names, constants)) 664 return; 665 this.iterable = optimizeExpr(this.iterable, names, constants); 666 return this; 667 } 668 get names() { 669 return addNames(super.names, this.iterable.names); 670 } 671 }; 672 var Func = class extends BlockNode { 673 constructor(name, args, async) { 674 super(); 675 this.name = name; 676 this.args = args; 677 this.async = async; 678 } 679 render(opts) { 680 const _async = this.async ? "async " : ""; 681 return `$_async}function $this.name}($this.args})` + super.render(opts); 682 } 683 }; 684 Func.kind = "func"; 685 var Return = class extends ParentNode { 686 render(opts) { 687 return "return " + super.render(opts); 688 } 689 }; 690 Return.kind = "return"; 691 var Try = class extends BlockNode { 692 render(opts) { 693 let code = "try" + super.render(opts); 694 if (this.catch) 695 code += this.catch.render(opts); 696 if (this.finally) 697 code += this.finally.render(opts); 698 return code; 699 } 700 optimizeNodes() { 701 var _a, _b; 702 super.optimizeNodes(); 703 (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); 704 (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); 705 return this; 706 } 707 optimizeNames(names, constants) { 708 var _a, _b; 709 super.optimizeNames(names, constants); 710 (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); 711 (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); 712 return this; 713 } 714 get names() { 715 const names = super.names; 716 if (this.catch) 717 addNames(names, this.catch.names); 718 if (this.finally) 719 addNames(names, this.finally.names); 720 return names; 721 } 722 }; 723 var Catch = class extends BlockNode { 724 constructor(error) { 725 super(); 726 this.error = error; 727 } 728 render(opts) { 729 return `catch($this.error})` + super.render(opts); 730 } 731 }; 732 Catch.kind = "catch"; 733 var Finally = class extends BlockNode { 734 render(opts) { 735 return "finally" + super.render(opts); 736 } 737 }; 738 Finally.kind = "finally"; 739 var CodeGen = class { 740 constructor(extScope, opts = {}) { 741 this._values = {}; 742 this._blockStarts = []; 743 this._constants = {}; 744 this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; 745 this._extScope = extScope; 746 this._scope = new scope_1.Scope({ parent: extScope }); 747 this._nodes = [new Root()]; 748 } 749 toString() { 750 return this._root.render(this.opts); 751 } 752 // returns unique name in the internal scope 753 name(prefix) { 754 return this._scope.name(prefix); 755 } 756 // reserves unique name in the external scope 757 scopeName(prefix) { 758 return this._extScope.name(prefix); 759 } 760 // reserves unique name in the external scope and assigns value to it 761 scopeValue(prefixOrName, value) { 762 const name = this._extScope.value(prefixOrName, value); 763 const vs = this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set()); 764 vs.add(name); 765 return name; 766 } 767 getScopeValue(prefix, keyOrRef) { 768 return this._extScope.getValue(prefix, keyOrRef); 769 } 770 // return code that assigns values in the external scope to the names that are used internally 771 // (same names that were returned by gen.scopeName or gen.scopeValue) 772 scopeRefs(scopeName) { 773 return this._extScope.scopeRefs(scopeName, this._values); 774 } 775 scopeCode() { 776 return this._extScope.scopeCode(this._values); 777 } 778 _def(varKind, nameOrPrefix, rhs, constant) { 779 const name = this._scope.toName(nameOrPrefix); 780 if (rhs !== void 0 && constant) 781 this._constants[name.str] = rhs; 782 this._leafNode(new Def(varKind, name, rhs)); 783 return name; 784 } 785 // `const` declaration (`var` in es5 mode) 786 const(nameOrPrefix, rhs, _constant) { 787 return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); 788 } 789 // `let` declaration with optional assignment (`var` in es5 mode) 790 let(nameOrPrefix, rhs, _constant) { 791 return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); 792 } 793 // `var` declaration with optional assignment 794 var(nameOrPrefix, rhs, _constant) { 795 return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); 796 } 797 // assignment code 798 assign(lhs, rhs, sideEffects) { 799 return this._leafNode(new Assign(lhs, rhs, sideEffects)); 800 } 801 // `+=` code 802 add(lhs, rhs) { 803 return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); 804 } 805 // appends passed SafeExpr to code or executes Block 806 code(c) { 807 if (typeof c == "function") 808 c(); 809 else if (c !== code_1.nil) 810 this._leafNode(new AnyCode(c)); 811 return this; 812 } 813 // returns code for object literal for the passed argument list of key-value pairs 814 object(...keyValues) { 815 const code = ["{"]; 816 for (const [key, value] of keyValues) { 817 if (code.length > 1) 818 code.push(","); 819 code.push(key); 820 if (key !== value || this.opts.es5) { 821 code.push(":"); 822 (0, code_1.addCodeArg)(code, value); 823 } 824 } 825 code.push("}"); 826 return new code_1._Code(code); 827 } 828 // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) 829 if(condition, thenBody, elseBody) { 830 this._blockNode(new If(condition)); 831 if (thenBody && elseBody) { 832 this.code(thenBody).else().code(elseBody).endIf(); 833 } else if (thenBody) { 834 this.code(thenBody).endIf(); 835 } else if (elseBody) { 836 throw new Error('CodeGen: "else" body without "then" body'); 837 } 838 return this; 839 } 840 // `else if` clause - invalid without `if` or after `else` clauses 841 elseIf(condition) { 842 return this._elseNode(new If(condition)); 843 } 844 // `else` clause - only valid after `if` or `else if` clauses 845 else() { 846 return this._elseNode(new Else()); 847 } 848 // end `if` statement (needed if gen.if was used only with condition) 849 endIf() { 850 return this._endBlockNode(If, Else); 851 } 852 _for(node, forBody) { 853 this._blockNode(node); 854 if (forBody) 855 this.code(forBody).endFor(); 856 return this; 857 } 858 // a generic `for` clause (or statement if `forBody` is passed) 859 for(iteration, forBody) { 860 return this._for(new ForLoop(iteration), forBody); 861 } 862 // `for` statement for a range of values 863 forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { 864 const name = this._scope.toName(nameOrPrefix); 865 return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); 866 } 867 // `for-of` statement (in es5 mode replace with a normal for loop) 868 forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { 869 const name = this._scope.toName(nameOrPrefix); 870 if (this.opts.es5) { 871 const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); 872 return this.forRange("_i", 0, (0, code_1._)`$arr}.length`, (i) => { 873 this.var(name, (0, code_1._)`$arr}[$i}]`); 874 forBody(name); 875 }); 876 } 877 return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); 878 } 879 // `for-in` statement. 880 // With option `ownProperties` replaced with a `for-of` loop for object keys 881 forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { 882 if (this.opts.ownProperties) { 883 return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys($obj})`, forBody); 884 } 885 const name = this._scope.toName(nameOrPrefix); 886 return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); 887 } 888 // end `for` loop 889 endFor() { 890 return this._endBlockNode(For); 891 } 892 // `label` statement 893 label(label) { 894 return this._leafNode(new Label(label)); 895 } 896 // `break` statement 897 break(label) { 898 return this._leafNode(new Break(label)); 899 } 900 // `return` statement 901 return(value) { 902 const node = new Return(); 903 this._blockNode(node); 904 this.code(value); 905 if (node.nodes.length !== 1) 906 throw new Error('CodeGen: "return" should have one node'); 907 return this._endBlockNode(Return); 908 } 909 // `try` statement 910 try(tryBody, catchCode, finallyCode) { 911 if (!catchCode && !finallyCode) 912 throw new Error('CodeGen: "try" without "catch" and "finally"'); 913 const node = new Try(); 914 this._blockNode(node); 915 this.code(tryBody); 916 if (catchCode) { 917 const error = this.name("e"); 918 this._currNode = node.catch = new Catch(error); 919 catchCode(error); 920 } 921 if (finallyCode) { 922 this._currNode = node.finally = new Finally(); 923 this.code(finallyCode); 924 } 925 return this._endBlockNode(Catch, Finally); 926 } 927 // `throw` statement 928 throw(error) { 929 return this._leafNode(new Throw(error)); 930 } 931 // start self-balancing block 932 block(body, nodeCount) { 933 this._blockStarts.push(this._nodes.length); 934 if (body) 935 this.code(body).endBlock(nodeCount); 936 return this; 937 } 938 // end the current self-balancing block 939 endBlock(nodeCount) { 940 const len = this._blockStarts.pop(); 941 if (len === void 0) 942 throw new Error("CodeGen: not in self-balancing block"); 943 const toClose = this._nodes.length - len; 944 if (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) { 945 throw new Error(`CodeGen: wrong number of nodes: $toClose} vs $nodeCount} expected`); 946 } 947 this._nodes.length = len; 948 return this; 949 } 950 // `function` heading (or definition if funcBody is passed) 951 func(name, args = code_1.nil, async, funcBody) { 952 this._blockNode(new Func(name, args, async)); 953 if (funcBody) 954 this.code(funcBody).endFunc(); 955 return this; 956 } 957 // end function definition 958 endFunc() { 959 return this._endBlockNode(Func); 960 } 961 optimize(n = 1) { 962 while (n-- > 0) { 963 this._root.optimizeNodes(); 964 this._root.optimizeNames(this._root.names, this._constants); 965 } 966 } 967 _leafNode(node) { 968 this._currNode.nodes.push(node); 969 return this; 970 } 971 _blockNode(node) { 972 this._currNode.nodes.push(node); 973 this._nodes.push(node); 974 } 975 _endBlockNode(N1, N2) { 976 const n = this._currNode; 977 if (n instanceof N1 || N2 && n instanceof N2) { 978 this._nodes.pop(); 979 return this; 980 } 981 throw new Error(`CodeGen: not in block "$N2 ? `$N1.kind}/$N2.kind}` : N1.kind}"`); 982 } 983 _elseNode(node) { 984 const n = this._currNode; 985 if (!(n instanceof If)) { 986 throw new Error('CodeGen: "else" without "if"'); 987 } 988 this._currNode = n.else = node; 989 return this; 990 } 991 get _root() { 992 return this._nodes[0]; 993 } 994 get _currNode() { 995 const ns = this._nodes; 996 return ns[ns.length - 1]; 997 } 998 set _currNode(node) { 999 const ns = this._nodes; 1000 ns[ns.length - 1] = node; 1001 } 1002 }; 1003 exports.CodeGen = CodeGen; 1004 function addNames(names, from) { 1005 for (const n in from) 1006 names[n] = (names[n] || 0) + (from[n] || 0); 1007 return names; 1008 } 1009 function addExprNames(names, from) { 1010 return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; 1011 } 1012 function optimizeExpr(expr, names, constants) { 1013 if (expr instanceof code_1.Name) 1014 return replaceName(expr); 1015 if (!canOptimize(expr)) 1016 return expr; 1017 return new code_1._Code(expr._items.reduce((items, c) => { 1018 if (c instanceof code_1.Name) 1019 c = replaceName(c); 1020 if (c instanceof code_1._Code) 1021 items.push(...c._items); 1022 else 1023 items.push(c); 1024 return items; 1025 }, [])); 1026 function replaceName(n) { 1027 const c = constants[n.str]; 1028 if (c === void 0 || names[n.str] !== 1) 1029 return n; 1030 delete names[n.str]; 1031 return c; 1032 } 1033 function canOptimize(e) { 1034 return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0); 1035 } 1036 } 1037 function subtractNames(names, from) { 1038 for (const n in from) 1039 names[n] = (names[n] || 0) - (from[n] || 0); 1040 } 1041 function not(x) { 1042 return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!$par(x)}`; 1043 } 1044 exports.not = not; 1045 var andCode = mappend(exports.operators.AND); 1046 function and(...args) { 1047 return args.reduce(andCode); 1048 } 1049 exports.and = and; 1050 var orCode = mappend(exports.operators.OR); 1051 function or(...args) { 1052 return args.reduce(orCode); 1053 } 1054 exports.or = or; 1055 function mappend(op) { 1056 return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`$par(x)} $op} $par(y)}`; 1057 } 1058 function par(x) { 1059 return x instanceof code_1.Name ? x : (0, code_1._)`($x})`; 1060 } 1061 } 1062 }); 1063 1064 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/util.js 1065 var require_util = __commonJS({ 1066 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/util.js"(exports) { 1067 "use strict"; 1068 Object.defineProperty(exports, "__esModule", { value: true }); 1069 exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; 1070 var codegen_1 = require_codegen(); 1071 var code_1 = require_code(); 1072 function toHash(arr) { 1073 const hash = {}; 1074 for (const item of arr) 1075 hash[item] = true; 1076 return hash; 1077 } 1078 exports.toHash = toHash; 1079 function alwaysValidSchema(it, schema) { 1080 if (typeof schema == "boolean") 1081 return schema; 1082 if (Object.keys(schema).length === 0) 1083 return true; 1084 checkUnknownRules(it, schema); 1085 return !schemaHasRules(schema, it.self.RULES.all); 1086 } 1087 exports.alwaysValidSchema = alwaysValidSchema; 1088 function checkUnknownRules(it, schema = it.schema) { 1089 const { opts, self } = it; 1090 if (!opts.strictSchema) 1091 return; 1092 if (typeof schema === "boolean") 1093 return; 1094 const rules = self.RULES.keywords; 1095 for (const key in schema) { 1096 if (!rules[key]) 1097 checkStrictMode(it, `unknown keyword: "$key}"`); 1098 } 1099 } 1100 exports.checkUnknownRules = checkUnknownRules; 1101 function schemaHasRules(schema, rules) { 1102 if (typeof schema == "boolean") 1103 return !schema; 1104 for (const key in schema) 1105 if (rules[key]) 1106 return true; 1107 return false; 1108 } 1109 exports.schemaHasRules = schemaHasRules; 1110 function schemaHasRulesButRef(schema, RULES) { 1111 if (typeof schema == "boolean") 1112 return !schema; 1113 for (const key in schema) 1114 if (key !== "$ref" && RULES.all[key]) 1115 return true; 1116 return false; 1117 } 1118 exports.schemaHasRulesButRef = schemaHasRulesButRef; 1119 function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { 1120 if (!$data) { 1121 if (typeof schema == "number" || typeof schema == "boolean") 1122 return schema; 1123 if (typeof schema == "string") 1124 return (0, codegen_1._)`$schema}`; 1125 } 1126 return (0, codegen_1._)`$topSchemaRef}$schemaPath}${(0, codegen_1.getProperty)(keyword)}`; 1127 } 1128 exports.schemaRefOrVal = schemaRefOrVal; 1129 function unescapeFragment(str) { 1130 return unescapeJsonPointer(decodeURIComponent(str)); 1131 } 1132 exports.unescapeFragment = unescapeFragment; 1133 function escapeFragment(str) { 1134 return encodeURIComponent(escapeJsonPointer(str)); 1135 } 1136 exports.escapeFragment = escapeFragment; 1137 function escapeJsonPointer(str) { 1138 if (typeof str == "number") 1139 return `$str}`; 1140 return str.replace(/~/g, "~0").replace(/\//g, "~1"); 1141 } 1142 exports.escapeJsonPointer = escapeJsonPointer; 1143 function unescapeJsonPointer(str) { 1144 return str.replace(/~1/g, "/").replace(/~0/g, "~"); 1145 } 1146 exports.unescapeJsonPointer = unescapeJsonPointer; 1147 function eachItem(xs, f) { 1148 if (Array.isArray(xs)) { 1149 for (const x of xs) 1150 f(x); 1151 } else { 1152 f(xs); 1153 } 1154 } 1155 exports.eachItem = eachItem; 1156 function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) { 1157 return (gen, from, to, toName) => { 1158 const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues(from, to); 1159 return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; 1160 }; 1161 } 1162 exports.mergeEvaluated = { 1163 props: makeMergeEvaluated({ 1164 mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`$to} !== true && $from} !== undefined`, () => { 1165 gen.if((0, codegen_1._)`$from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`$to} || {}`).code((0, codegen_1._)`Object.assign($to}, $from})`)); 1166 }), 1167 mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`$to} !== true`, () => { 1168 if (from === true) { 1169 gen.assign(to, true); 1170 } else { 1171 gen.assign(to, (0, codegen_1._)`$to} || {}`); 1172 setEvaluated(gen, to, from); 1173 } 1174 }), 1175 mergeValues: (from, to) => from === true ? true : { ...from, ...to }, 1176 resultToName: evaluatedPropsToName 1177 }), 1178 items: makeMergeEvaluated({ 1179 mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`$to} !== true && $from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`$from} === true ? true : $to} > $from} ? $to} : $from}`)), 1180 mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`$to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`$to} > $from} ? $to} : $from}`)), 1181 mergeValues: (from, to) => from === true ? true : Math.max(from, to), 1182 resultToName: (gen, items) => gen.var("items", items) 1183 }) 1184 }; 1185 function evaluatedPropsToName(gen, ps) { 1186 if (ps === true) 1187 return gen.var("props", true); 1188 const props = gen.var("props", (0, codegen_1._)`{}`); 1189 if (ps !== void 0) 1190 setEvaluated(gen, props, ps); 1191 return props; 1192 } 1193 exports.evaluatedPropsToName = evaluatedPropsToName; 1194 function setEvaluated(gen, props, ps) { 1195 Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`$props}${(0, codegen_1.getProperty)(p)}`, true)); 1196 } 1197 exports.setEvaluated = setEvaluated; 1198 var snippets = {}; 1199 function useFunc(gen, f) { 1200 return gen.scopeValue("func", { 1201 ref: f, 1202 code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)) 1203 }); 1204 } 1205 exports.useFunc = useFunc; 1206 var Type; 1207 (function(Type2) { 1208 Type2[Type2["Num"] = 0] = "Num"; 1209 Type2[Type2["Str"] = 1] = "Str"; 1210 })(Type || (exports.Type = Type = {})); 1211 function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { 1212 if (dataProp instanceof codegen_1.Name) { 1213 const isNumber = dataPropType === Type.Num; 1214 return jsPropertySyntax ? isNumber ? (0, codegen_1._)`"[" + $dataProp} + "]"` : (0, codegen_1._)`"['" + $dataProp} + "']"` : isNumber ? (0, codegen_1._)`"/" + $dataProp}` : (0, codegen_1._)`"/" + $dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; 1215 } 1216 return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); 1217 } 1218 exports.getErrorPath = getErrorPath; 1219 function checkStrictMode(it, msg, mode = it.opts.strictSchema) { 1220 if (!mode) 1221 return; 1222 msg = `strict mode: $msg}`; 1223 if (mode === true) 1224 throw new Error(msg); 1225 it.self.logger.warn(msg); 1226 } 1227 exports.checkStrictMode = checkStrictMode; 1228 } 1229 }); 1230 1231 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/names.js 1232 var require_names = __commonJS({ 1233 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/names.js"(exports) { 1234 "use strict"; 1235 Object.defineProperty(exports, "__esModule", { value: true }); 1236 var codegen_1 = require_codegen(); 1237 var names = { 1238 // validation function arguments 1239 data: new codegen_1.Name("data"), 1240 // data passed to validation function 1241 // args passed from referencing schema 1242 valCxt: new codegen_1.Name("valCxt"), 1243 // validation/data context - should not be used directly, it is destructured to the names below 1244 instancePath: new codegen_1.Name("instancePath"), 1245 parentData: new codegen_1.Name("parentData"), 1246 parentDataProperty: new codegen_1.Name("parentDataProperty"), 1247 rootData: new codegen_1.Name("rootData"), 1248 // root data - same as the data passed to the first/top validation function 1249 dynamicAnchors: new codegen_1.Name("dynamicAnchors"), 1250 // used to support recursiveRef and dynamicRef 1251 // function scoped variables 1252 vErrors: new codegen_1.Name("vErrors"), 1253 // null or array of validation errors 1254 errors: new codegen_1.Name("errors"), 1255 // counter of validation errors 1256 this: new codegen_1.Name("this"), 1257 // "globals" 1258 self: new codegen_1.Name("self"), 1259 scope: new codegen_1.Name("scope"), 1260 // JTD serialize/parse name for JSON string and position 1261 json: new codegen_1.Name("json"), 1262 jsonPos: new codegen_1.Name("jsonPos"), 1263 jsonLen: new codegen_1.Name("jsonLen"), 1264 jsonPart: new codegen_1.Name("jsonPart") 1265 }; 1266 exports.default = names; 1267 } 1268 }); 1269 1270 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/errors.js 1271 var require_errors = __commonJS({ 1272 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/errors.js"(exports) { 1273 "use strict"; 1274 Object.defineProperty(exports, "__esModule", { value: true }); 1275 exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; 1276 var codegen_1 = require_codegen(); 1277 var util_1 = require_util(); 1278 var names_1 = require_names(); 1279 exports.keywordError = { 1280 message: ({ keyword }) => (0, codegen_1.str)`must pass "$keyword}" keyword validation` 1281 }; 1282 exports.keyword$DataError = { 1283 message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"$keyword}" keyword must be $schemaType} ($data)` : (0, codegen_1.str)`"$keyword}" keyword is invalid ($data)` 1284 }; 1285 function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) { 1286 const { it } = cxt; 1287 const { gen, compositeRule, allErrors } = it; 1288 const errObj = errorObjectCode(cxt, error, errorPaths); 1289 if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) { 1290 addError(gen, errObj); 1291 } else { 1292 returnErrors(it, (0, codegen_1._)`[$errObj}]`); 1293 } 1294 } 1295 exports.reportError = reportError; 1296 function reportExtraError(cxt, error = exports.keywordError, errorPaths) { 1297 const { it } = cxt; 1298 const { gen, compositeRule, allErrors } = it; 1299 const errObj = errorObjectCode(cxt, error, errorPaths); 1300 addError(gen, errObj); 1301 if (!(compositeRule || allErrors)) { 1302 returnErrors(it, names_1.default.vErrors); 1303 } 1304 } 1305 exports.reportExtraError = reportExtraError; 1306 function resetErrorsCount(gen, errsCount) { 1307 gen.assign(names_1.default.errors, errsCount); 1308 gen.if((0, codegen_1._)`$names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`$names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); 1309 } 1310 exports.resetErrorsCount = resetErrorsCount; 1311 function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) { 1312 if (errsCount === void 0) 1313 throw new Error("ajv implementation error"); 1314 const err = gen.name("err"); 1315 gen.forRange("i", errsCount, names_1.default.errors, (i) => { 1316 gen.const(err, (0, codegen_1._)`$names_1.default.vErrors}[$i}]`); 1317 gen.if((0, codegen_1._)`$err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`$err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); 1318 gen.assign((0, codegen_1._)`$err}.schemaPath`, (0, codegen_1.str)`$it.errSchemaPath}/$keyword}`); 1319 if (it.opts.verbose) { 1320 gen.assign((0, codegen_1._)`$err}.schema`, schemaValue); 1321 gen.assign((0, codegen_1._)`$err}.data`, data); 1322 } 1323 }); 1324 } 1325 exports.extendErrors = extendErrors; 1326 function addError(gen, errObj) { 1327 const err = gen.const("err", errObj); 1328 gen.if((0, codegen_1._)`$names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[$err}]`), (0, codegen_1._)`$names_1.default.vErrors}.push($err})`); 1329 gen.code((0, codegen_1._)`$names_1.default.errors}++`); 1330 } 1331 function returnErrors(it, errs) { 1332 const { gen, validateName, schemaEnv } = it; 1333 if (schemaEnv.$async) { 1334 gen.throw((0, codegen_1._)`new $it.ValidationError}($errs})`); 1335 } else { 1336 gen.assign((0, codegen_1._)`$validateName}.errors`, errs); 1337 gen.return(false); 1338 } 1339 } 1340 var E = { 1341 keyword: new codegen_1.Name("keyword"), 1342 schemaPath: new codegen_1.Name("schemaPath"), 1343 // also used in JTD errors 1344 params: new codegen_1.Name("params"), 1345 propertyName: new codegen_1.Name("propertyName"), 1346 message: new codegen_1.Name("message"), 1347 schema: new codegen_1.Name("schema"), 1348 parentSchema: new codegen_1.Name("parentSchema") 1349 }; 1350 function errorObjectCode(cxt, error, errorPaths) { 1351 const { createErrors } = cxt.it; 1352 if (createErrors === false) 1353 return (0, codegen_1._)`{}`; 1354 return errorObject(cxt, error, errorPaths); 1355 } 1356 function errorObject(cxt, error, errorPaths = {}) { 1357 const { gen, it } = cxt; 1358 const keyValues = [ 1359 errorInstancePath(it, errorPaths), 1360 errorSchemaPath(cxt, errorPaths) 1361 ]; 1362 extraErrorProps(cxt, error, keyValues); 1363 return gen.object(...keyValues); 1364 } 1365 function errorInstancePath({ errorPath }, { instancePath }) { 1366 const instPath = instancePath ? (0, codegen_1.str)`$errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath; 1367 return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; 1368 } 1369 function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { 1370 let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`$errSchemaPath}/$keyword}`; 1371 if (schemaPath) { 1372 schPath = (0, codegen_1.str)`$schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; 1373 } 1374 return [E.schemaPath, schPath]; 1375 } 1376 function extraErrorProps(cxt, { params, message }, keyValues) { 1377 const { keyword, data, schemaValue, it } = cxt; 1378 const { opts, propertyName, topSchemaRef, schemaPath } = it; 1379 keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]); 1380 if (opts.messages) { 1381 keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); 1382 } 1383 if (opts.verbose) { 1384 keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`$topSchemaRef}$schemaPath}`], [names_1.default.data, data]); 1385 } 1386 if (propertyName) 1387 keyValues.push([E.propertyName, propertyName]); 1388 } 1389 } 1390 }); 1391 1392 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/boolSchema.js 1393 var require_boolSchema = __commonJS({ 1394 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) { 1395 "use strict"; 1396 Object.defineProperty(exports, "__esModule", { value: true }); 1397 exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; 1398 var errors_1 = require_errors(); 1399 var codegen_1 = require_codegen(); 1400 var names_1 = require_names(); 1401 var boolError = { 1402 message: "boolean schema is false" 1403 }; 1404 function topBoolOrEmptySchema(it) { 1405 const { gen, schema, validateName } = it; 1406 if (schema === false) { 1407 falseSchemaError(it, false); 1408 } else if (typeof schema == "object" && schema.$async === true) { 1409 gen.return(names_1.default.data); 1410 } else { 1411 gen.assign((0, codegen_1._)`$validateName}.errors`, null); 1412 gen.return(true); 1413 } 1414 } 1415 exports.topBoolOrEmptySchema = topBoolOrEmptySchema; 1416 function boolOrEmptySchema(it, valid) { 1417 const { gen, schema } = it; 1418 if (schema === false) { 1419 gen.var(valid, false); 1420 falseSchemaError(it); 1421 } else { 1422 gen.var(valid, true); 1423 } 1424 } 1425 exports.boolOrEmptySchema = boolOrEmptySchema; 1426 function falseSchemaError(it, overrideAllErrors) { 1427 const { gen, data } = it; 1428 const cxt = { 1429 gen, 1430 keyword: "false schema", 1431 data, 1432 schema: false, 1433 schemaCode: false, 1434 schemaValue: false, 1435 params: {}, 1436 it 1437 }; 1438 (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors); 1439 } 1440 } 1441 }); 1442 1443 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/rules.js 1444 var require_rules = __commonJS({ 1445 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/rules.js"(exports) { 1446 "use strict"; 1447 Object.defineProperty(exports, "__esModule", { value: true }); 1448 exports.getRules = exports.isJSONType = void 0; 1449 var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; 1450 var jsonTypes = new Set(_jsonTypes); 1451 function isJSONType(x) { 1452 return typeof x == "string" && jsonTypes.has(x); 1453 } 1454 exports.isJSONType = isJSONType; 1455 function getRules() { 1456 const groups = { 1457 number: { type: "number", rules: [] }, 1458 string: { type: "string", rules: [] }, 1459 array: { type: "array", rules: [] }, 1460 object: { type: "object", rules: [] } 1461 }; 1462 return { 1463 types: { ...groups, integer: true, boolean: true, null: true }, 1464 rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], 1465 post: { rules: [] }, 1466 all: {}, 1467 keywords: {} 1468 }; 1469 } 1470 exports.getRules = getRules; 1471 } 1472 }); 1473 1474 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/applicability.js 1475 var require_applicability = __commonJS({ 1476 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/applicability.js"(exports) { 1477 "use strict"; 1478 Object.defineProperty(exports, "__esModule", { value: true }); 1479 exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; 1480 function schemaHasRulesForType({ schema, self }, type) { 1481 const group = self.RULES.types[type]; 1482 return group && group !== true && shouldUseGroup(schema, group); 1483 } 1484 exports.schemaHasRulesForType = schemaHasRulesForType; 1485 function shouldUseGroup(schema, group) { 1486 return group.rules.some((rule) => shouldUseRule(schema, rule)); 1487 } 1488 exports.shouldUseGroup = shouldUseGroup; 1489 function shouldUseRule(schema, rule) { 1490 var _a; 1491 return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0)); 1492 } 1493 exports.shouldUseRule = shouldUseRule; 1494 } 1495 }); 1496 1497 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/dataType.js 1498 var require_dataType = __commonJS({ 1499 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/dataType.js"(exports) { 1500 "use strict"; 1501 Object.defineProperty(exports, "__esModule", { value: true }); 1502 exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; 1503 var rules_1 = require_rules(); 1504 var applicability_1 = require_applicability(); 1505 var errors_1 = require_errors(); 1506 var codegen_1 = require_codegen(); 1507 var util_1 = require_util(); 1508 var DataType; 1509 (function(DataType2) { 1510 DataType2[DataType2["Correct"] = 0] = "Correct"; 1511 DataType2[DataType2["Wrong"] = 1] = "Wrong"; 1512 })(DataType || (exports.DataType = DataType = {})); 1513 function getSchemaTypes(schema) { 1514 const types = getJSONTypes(schema.type); 1515 const hasNull = types.includes("null"); 1516 if (hasNull) { 1517 if (schema.nullable === false) 1518 throw new Error("type: null contradicts nullable: false"); 1519 } else { 1520 if (!types.length && schema.nullable !== void 0) { 1521 throw new Error('"nullable" cannot be used without "type"'); 1522 } 1523 if (schema.nullable === true) 1524 types.push("null"); 1525 } 1526 return types; 1527 } 1528 exports.getSchemaTypes = getSchemaTypes; 1529 function getJSONTypes(ts) { 1530 const types = Array.isArray(ts) ? ts : ts ? [ts] : []; 1531 if (types.every(rules_1.isJSONType)) 1532 return types; 1533 throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); 1534 } 1535 exports.getJSONTypes = getJSONTypes; 1536 function coerceAndCheckDataType(it, types) { 1537 const { gen, data, opts } = it; 1538 const coerceTo = coerceToTypes(types, opts.coerceTypes); 1539 const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); 1540 if (checkTypes) { 1541 const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); 1542 gen.if(wrongType, () => { 1543 if (coerceTo.length) 1544 coerceData(it, types, coerceTo); 1545 else 1546 reportTypeError(it); 1547 }); 1548 } 1549 return checkTypes; 1550 } 1551 exports.coerceAndCheckDataType = coerceAndCheckDataType; 1552 var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); 1553 function coerceToTypes(types, coerceTypes) { 1554 return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : []; 1555 } 1556 function coerceData(it, types, coerceTo) { 1557 const { gen, data, opts } = it; 1558 const dataType = gen.let("dataType", (0, codegen_1._)`typeof $data}`); 1559 const coerced = gen.let("coerced", (0, codegen_1._)`undefined`); 1560 if (opts.coerceTypes === "array") { 1561 gen.if((0, codegen_1._)`$dataType} == 'object' && Array.isArray($data}) && $data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`$data}[0]`).assign(dataType, (0, codegen_1._)`typeof $data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); 1562 } 1563 gen.if((0, codegen_1._)`$coerced} !== undefined`); 1564 for (const t of coerceTo) { 1565 if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") { 1566 coerceSpecificType(t); 1567 } 1568 } 1569 gen.else(); 1570 reportTypeError(it); 1571 gen.endIf(); 1572 gen.if((0, codegen_1._)`$coerced} !== undefined`, () => { 1573 gen.assign(data, coerced); 1574 assignParentData(it, coerced); 1575 }); 1576 function coerceSpecificType(t) { 1577 switch (t) { 1578 case "string": 1579 gen.elseIf((0, codegen_1._)`$dataType} == "number" || $dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + $data}`).elseIf((0, codegen_1._)`$data} === null`).assign(coerced, (0, codegen_1._)`""`); 1580 return; 1581 case "number": 1582 gen.elseIf((0, codegen_1._)`$dataType} == "boolean" || $data} === null 1583 || ($dataType} == "string" && $data} && $data} == +$data})`).assign(coerced, (0, codegen_1._)`+$data}`); 1584 return; 1585 case "integer": 1586 gen.elseIf((0, codegen_1._)`$dataType} === "boolean" || $data} === null 1587 || ($dataType} === "string" && $data} && $data} == +$data} && !($data} % 1))`).assign(coerced, (0, codegen_1._)`+$data}`); 1588 return; 1589 case "boolean": 1590 gen.elseIf((0, codegen_1._)`$data} === "false" || $data} === 0 || $data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`$data} === "true" || $data} === 1`).assign(coerced, true); 1591 return; 1592 case "null": 1593 gen.elseIf((0, codegen_1._)`$data} === "" || $data} === 0 || $data} === false`); 1594 gen.assign(coerced, null); 1595 return; 1596 case "array": 1597 gen.elseIf((0, codegen_1._)`$dataType} === "string" || $dataType} === "number" 1598 || $dataType} === "boolean" || $data} === null`).assign(coerced, (0, codegen_1._)`[$data}]`); 1599 } 1600 } 1601 } 1602 function assignParentData({ gen, parentData, parentDataProperty }, expr) { 1603 gen.if((0, codegen_1._)`$parentData} !== undefined`, () => gen.assign((0, codegen_1._)`$parentData}[$parentDataProperty}]`, expr)); 1604 } 1605 function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { 1606 const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; 1607 let cond; 1608 switch (dataType) { 1609 case "null": 1610 return (0, codegen_1._)`$data} $EQ} null`; 1611 case "array": 1612 cond = (0, codegen_1._)`Array.isArray($data})`; 1613 break; 1614 case "object": 1615 cond = (0, codegen_1._)`$data} && typeof $data} == "object" && !Array.isArray($data})`; 1616 break; 1617 case "integer": 1618 cond = numCond((0, codegen_1._)`!($data} % 1) && !isNaN($data})`); 1619 break; 1620 case "number": 1621 cond = numCond(); 1622 break; 1623 default: 1624 return (0, codegen_1._)`typeof $data} $EQ} $dataType}`; 1625 } 1626 return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); 1627 function numCond(_cond = codegen_1.nil) { 1628 return (0, codegen_1.and)((0, codegen_1._)`typeof $data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite($data})` : codegen_1.nil); 1629 } 1630 } 1631 exports.checkDataType = checkDataType; 1632 function checkDataTypes(dataTypes, data, strictNums, correct) { 1633 if (dataTypes.length === 1) { 1634 return checkDataType(dataTypes[0], data, strictNums, correct); 1635 } 1636 let cond; 1637 const types = (0, util_1.toHash)(dataTypes); 1638 if (types.array && types.object) { 1639 const notObj = (0, codegen_1._)`typeof $data} != "object"`; 1640 cond = types.null ? notObj : (0, codegen_1._)`!$data} || $notObj}`; 1641 delete types.null; 1642 delete types.array; 1643 delete types.object; 1644 } else { 1645 cond = codegen_1.nil; 1646 } 1647 if (types.number) 1648 delete types.integer; 1649 for (const t in types) 1650 cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); 1651 return cond; 1652 } 1653 exports.checkDataTypes = checkDataTypes; 1654 var typeError = { 1655 message: ({ schema }) => `must be $schema}`, 1656 params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: $schema}}` : (0, codegen_1._)`{type: $schemaValue}}` 1657 }; 1658 function reportTypeError(it) { 1659 const cxt = getTypeErrorContext(it); 1660 (0, errors_1.reportError)(cxt, typeError); 1661 } 1662 exports.reportTypeError = reportTypeError; 1663 function getTypeErrorContext(it) { 1664 const { gen, data, schema } = it; 1665 const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type"); 1666 return { 1667 gen, 1668 keyword: "type", 1669 data, 1670 schema: schema.type, 1671 schemaCode, 1672 schemaValue: schemaCode, 1673 parentSchema: schema, 1674 params: {}, 1675 it 1676 }; 1677 } 1678 } 1679 }); 1680 1681 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/defaults.js 1682 var require_defaults = __commonJS({ 1683 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/defaults.js"(exports) { 1684 "use strict"; 1685 Object.defineProperty(exports, "__esModule", { value: true }); 1686 exports.assignDefaults = void 0; 1687 var codegen_1 = require_codegen(); 1688 var util_1 = require_util(); 1689 function assignDefaults(it, ty) { 1690 const { properties, items } = it.schema; 1691 if (ty === "object" && properties) { 1692 for (const key in properties) { 1693 assignDefault(it, key, properties[key].default); 1694 } 1695 } else if (ty === "array" && Array.isArray(items)) { 1696 items.forEach((sch, i) => assignDefault(it, i, sch.default)); 1697 } 1698 } 1699 exports.assignDefaults = assignDefaults; 1700 function assignDefault(it, prop, defaultValue) { 1701 const { gen, compositeRule, data, opts } = it; 1702 if (defaultValue === void 0) 1703 return; 1704 const childData = (0, codegen_1._)`$data}${(0, codegen_1.getProperty)(prop)}`; 1705 if (compositeRule) { 1706 (0, util_1.checkStrictMode)(it, `default is ignored for: $childData}`); 1707 return; 1708 } 1709 let condition = (0, codegen_1._)`$childData} === undefined`; 1710 if (opts.useDefaults === "empty") { 1711 condition = (0, codegen_1._)`$condition} || $childData} === null || $childData} === ""`; 1712 } 1713 gen.if(condition, (0, codegen_1._)`$childData} = ${(0, codegen_1.stringify)(defaultValue)}`); 1714 } 1715 } 1716 }); 1717 1718 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/code.js 1719 var require_code2 = __commonJS({ 1720 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/code.js"(exports) { 1721 "use strict"; 1722 Object.defineProperty(exports, "__esModule", { value: true }); 1723 exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; 1724 var codegen_1 = require_codegen(); 1725 var util_1 = require_util(); 1726 var names_1 = require_names(); 1727 var util_2 = require_util(); 1728 function checkReportMissingProp(cxt, prop) { 1729 const { gen, data, it } = cxt; 1730 gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { 1731 cxt.setParams({ missingProperty: (0, codegen_1._)`$prop}` }, true); 1732 cxt.error(); 1733 }); 1734 } 1735 exports.checkReportMissingProp = checkReportMissingProp; 1736 function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { 1737 return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`$missing} = $prop}`))); 1738 } 1739 exports.checkMissingProp = checkMissingProp; 1740 function reportMissingProp(cxt, missing) { 1741 cxt.setParams({ missingProperty: missing }, true); 1742 cxt.error(); 1743 } 1744 exports.reportMissingProp = reportMissingProp; 1745 function hasPropFunc(gen) { 1746 return gen.scopeValue("func", { 1747 // eslint-disable-next-line @typescript-eslint/unbound-method 1748 ref: Object.prototype.hasOwnProperty, 1749 code: (0, codegen_1._)`Object.prototype.hasOwnProperty` 1750 }); 1751 } 1752 exports.hasPropFunc = hasPropFunc; 1753 function isOwnProperty(gen, data, property) { 1754 return (0, codegen_1._)`$hasPropFunc(gen)}.call($data}, $property})`; 1755 } 1756 exports.isOwnProperty = isOwnProperty; 1757 function propertyInData(gen, data, property, ownProperties) { 1758 const cond = (0, codegen_1._)`$data}${(0, codegen_1.getProperty)(property)} !== undefined`; 1759 return ownProperties ? (0, codegen_1._)`$cond} && $isOwnProperty(gen, data, property)}` : cond; 1760 } 1761 exports.propertyInData = propertyInData; 1762 function noPropertyInData(gen, data, property, ownProperties) { 1763 const cond = (0, codegen_1._)`$data}${(0, codegen_1.getProperty)(property)} === undefined`; 1764 return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond; 1765 } 1766 exports.noPropertyInData = noPropertyInData; 1767 function allSchemaProperties(schemaMap) { 1768 return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; 1769 } 1770 exports.allSchemaProperties = allSchemaProperties; 1771 function schemaProperties(it, schemaMap) { 1772 return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); 1773 } 1774 exports.schemaProperties = schemaProperties; 1775 function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { 1776 const dataAndSchema = passSchema ? (0, codegen_1._)`$schemaCode}, $data}, $topSchemaRef}$schemaPath}` : data; 1777 const valCxt = [ 1778 [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], 1779 [names_1.default.parentData, it.parentData], 1780 [names_1.default.parentDataProperty, it.parentDataProperty], 1781 [names_1.default.rootData, names_1.default.rootData] 1782 ]; 1783 if (it.opts.dynamicRef) 1784 valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); 1785 const args = (0, codegen_1._)`$dataAndSchema}, $gen.object(...valCxt)}`; 1786 return context !== codegen_1.nil ? (0, codegen_1._)`$func}.call($context}, $args})` : (0, codegen_1._)`$func}($args})`; 1787 } 1788 exports.callValidateCode = callValidateCode; 1789 var newRegExp = (0, codegen_1._)`new RegExp`; 1790 function usePattern({ gen, it: { opts } }, pattern) { 1791 const u = opts.unicodeRegExp ? "u" : ""; 1792 const { regExp } = opts.code; 1793 const rx = regExp(pattern, u); 1794 return gen.scopeValue("pattern", { 1795 key: rx.toString(), 1796 ref: rx, 1797 code: (0, codegen_1._)`$regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}($pattern}, $u})` 1798 }); 1799 } 1800 exports.usePattern = usePattern; 1801 function validateArray(cxt) { 1802 const { gen, data, keyword, it } = cxt; 1803 const valid = gen.name("valid"); 1804 if (it.allErrors) { 1805 const validArr = gen.let("valid", true); 1806 validateItems(() => gen.assign(validArr, false)); 1807 return validArr; 1808 } 1809 gen.var(valid, true); 1810 validateItems(() => gen.break()); 1811 return valid; 1812 function validateItems(notValid) { 1813 const len = gen.const("len", (0, codegen_1._)`$data}.length`); 1814 gen.forRange("i", 0, len, (i) => { 1815 cxt.subschema({ 1816 keyword, 1817 dataProp: i, 1818 dataPropType: util_1.Type.Num 1819 }, valid); 1820 gen.if((0, codegen_1.not)(valid), notValid); 1821 }); 1822 } 1823 } 1824 exports.validateArray = validateArray; 1825 function validateUnion(cxt) { 1826 const { gen, schema, keyword, it } = cxt; 1827 if (!Array.isArray(schema)) 1828 throw new Error("ajv implementation error"); 1829 const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)); 1830 if (alwaysValid && !it.opts.unevaluated) 1831 return; 1832 const valid = gen.let("valid", false); 1833 const schValid = gen.name("_valid"); 1834 gen.block(() => schema.forEach((_sch, i) => { 1835 const schCxt = cxt.subschema({ 1836 keyword, 1837 schemaProp: i, 1838 compositeRule: true 1839 }, schValid); 1840 gen.assign(valid, (0, codegen_1._)`$valid} || $schValid}`); 1841 const merged = cxt.mergeValidEvaluated(schCxt, schValid); 1842 if (!merged) 1843 gen.if((0, codegen_1.not)(valid)); 1844 })); 1845 cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); 1846 } 1847 exports.validateUnion = validateUnion; 1848 } 1849 }); 1850 1851 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/keyword.js 1852 var require_keyword = __commonJS({ 1853 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/keyword.js"(exports) { 1854 "use strict"; 1855 Object.defineProperty(exports, "__esModule", { value: true }); 1856 exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; 1857 var codegen_1 = require_codegen(); 1858 var names_1 = require_names(); 1859 var code_1 = require_code2(); 1860 var errors_1 = require_errors(); 1861 function macroKeywordCode(cxt, def) { 1862 const { gen, keyword, schema, parentSchema, it } = cxt; 1863 const macroSchema = def.macro.call(it.self, schema, parentSchema, it); 1864 const schemaRef = useKeyword(gen, keyword, macroSchema); 1865 if (it.opts.validateSchema !== false) 1866 it.self.validateSchema(macroSchema, true); 1867 const valid = gen.name("valid"); 1868 cxt.subschema({ 1869 schema: macroSchema, 1870 schemaPath: codegen_1.nil, 1871 errSchemaPath: `$it.errSchemaPath}/$keyword}`, 1872 topSchemaRef: schemaRef, 1873 compositeRule: true 1874 }, valid); 1875 cxt.pass(valid, () => cxt.error(true)); 1876 } 1877 exports.macroKeywordCode = macroKeywordCode; 1878 function funcKeywordCode(cxt, def) { 1879 var _a; 1880 const { gen, keyword, schema, parentSchema, $data, it } = cxt; 1881 checkAsyncKeyword(it, def); 1882 const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; 1883 const validateRef = useKeyword(gen, keyword, validate); 1884 const valid = gen.let("valid"); 1885 cxt.block$data(valid, validateKeyword); 1886 cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); 1887 function validateKeyword() { 1888 if (def.errors === false) { 1889 assignValid(); 1890 if (def.modifying) 1891 modifyData(cxt); 1892 reportErrs(() => cxt.error()); 1893 } else { 1894 const ruleErrs = def.async ? validateAsync() : validateSync(); 1895 if (def.modifying) 1896 modifyData(cxt); 1897 reportErrs(() => addErrs(cxt, ruleErrs)); 1898 } 1899 } 1900 function validateAsync() { 1901 const ruleErrs = gen.let("ruleErrs", null); 1902 gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`$e} instanceof $it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`$e}.errors`), () => gen.throw(e))); 1903 return ruleErrs; 1904 } 1905 function validateSync() { 1906 const validateErrs = (0, codegen_1._)`$validateRef}.errors`; 1907 gen.assign(validateErrs, null); 1908 assignValid(codegen_1.nil); 1909 return validateErrs; 1910 } 1911 function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) { 1912 const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; 1913 const passSchema = !("compile" in def && !$data || def.schema === false); 1914 gen.assign(valid, (0, codegen_1._)`$_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); 1915 } 1916 function reportErrs(errors) { 1917 var _a2; 1918 gen.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors); 1919 } 1920 } 1921 exports.funcKeywordCode = funcKeywordCode; 1922 function modifyData(cxt) { 1923 const { gen, data, it } = cxt; 1924 gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`$it.parentData}[$it.parentDataProperty}]`)); 1925 } 1926 function addErrs(cxt, errs) { 1927 const { gen } = cxt; 1928 gen.if((0, codegen_1._)`Array.isArray($errs})`, () => { 1929 gen.assign(names_1.default.vErrors, (0, codegen_1._)`$names_1.default.vErrors} === null ? $errs} : $names_1.default.vErrors}.concat($errs})`).assign(names_1.default.errors, (0, codegen_1._)`$names_1.default.vErrors}.length`); 1930 (0, errors_1.extendErrors)(cxt); 1931 }, () => cxt.error()); 1932 } 1933 function checkAsyncKeyword({ schemaEnv }, def) { 1934 if (def.async && !schemaEnv.$async) 1935 throw new Error("async keyword in sync schema"); 1936 } 1937 function useKeyword(gen, keyword, result) { 1938 if (result === void 0) 1939 throw new Error(`keyword "$keyword}" failed to compile`); 1940 return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); 1941 } 1942 function validSchemaType(schema, schemaType, allowUndefined = false) { 1943 return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined"); 1944 } 1945 exports.validSchemaType = validSchemaType; 1946 function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) { 1947 if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { 1948 throw new Error("ajv implementation error"); 1949 } 1950 const deps = def.dependencies; 1951 if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { 1952 throw new Error(`parent schema must have dependencies of $keyword}: $deps.join(",")}`); 1953 } 1954 if (def.validateSchema) { 1955 const valid = def.validateSchema(schema[keyword]); 1956 if (!valid) { 1957 const msg = `keyword "$keyword}" value is invalid at path "$errSchemaPath}": ` + self.errorsText(def.validateSchema.errors); 1958 if (opts.validateSchema === "log") 1959 self.logger.error(msg); 1960 else 1961 throw new Error(msg); 1962 } 1963 } 1964 } 1965 exports.validateKeywordUsage = validateKeywordUsage; 1966 } 1967 }); 1968 1969 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/subschema.js 1970 var require_subschema = __commonJS({ 1971 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/subschema.js"(exports) { 1972 "use strict"; 1973 Object.defineProperty(exports, "__esModule", { value: true }); 1974 exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; 1975 var codegen_1 = require_codegen(); 1976 var util_1 = require_util(); 1977 function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { 1978 if (keyword !== void 0 && schema !== void 0) { 1979 throw new Error('both "keyword" and "schema" passed, only one allowed'); 1980 } 1981 if (keyword !== void 0) { 1982 const sch = it.schema[keyword]; 1983 return schemaProp === void 0 ? { 1984 schema: sch, 1985 schemaPath: (0, codegen_1._)`$it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, 1986 errSchemaPath: `$it.errSchemaPath}/$keyword}` 1987 } : { 1988 schema: sch[schemaProp], 1989 schemaPath: (0, codegen_1._)`$it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, 1990 errSchemaPath: `$it.errSchemaPath}/$keyword}/${(0, util_1.escapeFragment)(schemaProp)}` 1991 }; 1992 } 1993 if (schema !== void 0) { 1994 if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) { 1995 throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); 1996 } 1997 return { 1998 schema, 1999 schemaPath, 2000 topSchemaRef, 2001 errSchemaPath 2002 }; 2003 } 2004 throw new Error('either "keyword" or "schema" must be passed'); 2005 } 2006 exports.getSubschema = getSubschema; 2007 function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { 2008 if (data !== void 0 && dataProp !== void 0) { 2009 throw new Error('both "data" and "dataProp" passed, only one allowed'); 2010 } 2011 const { gen } = it; 2012 if (dataProp !== void 0) { 2013 const { errorPath, dataPathArr, opts } = it; 2014 const nextData = gen.let("data", (0, codegen_1._)`$it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); 2015 dataContextProps(nextData); 2016 subschema.errorPath = (0, codegen_1.str)`$errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; 2017 subschema.parentDataProperty = (0, codegen_1._)`$dataProp}`; 2018 subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; 2019 } 2020 if (data !== void 0) { 2021 const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); 2022 dataContextProps(nextData); 2023 if (propertyName !== void 0) 2024 subschema.propertyName = propertyName; 2025 } 2026 if (dataTypes) 2027 subschema.dataTypes = dataTypes; 2028 function dataContextProps(_nextData) { 2029 subschema.data = _nextData; 2030 subschema.dataLevel = it.dataLevel + 1; 2031 subschema.dataTypes = []; 2032 it.definedProperties = /* @__PURE__ */ new Set(); 2033 subschema.parentData = it.data; 2034 subschema.dataNames = [...it.dataNames, _nextData]; 2035 } 2036 } 2037 exports.extendSubschemaData = extendSubschemaData; 2038 function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { 2039 if (compositeRule !== void 0) 2040 subschema.compositeRule = compositeRule; 2041 if (createErrors !== void 0) 2042 subschema.createErrors = createErrors; 2043 if (allErrors !== void 0) 2044 subschema.allErrors = allErrors; 2045 subschema.jtdDiscriminator = jtdDiscriminator; 2046 subschema.jtdMetadata = jtdMetadata; 2047 } 2048 exports.extendSubschemaMode = extendSubschemaMode; 2049 } 2050 }); 2051 2052 // node_modules/.store/fast-deep-equal@3.1.3-Dk0kpzcWCOUHE1bkOO2LLA/node_modules/fast-deep-equal/index.js 2053 var require_fast_deep_equal = __commonJS({ 2054 "node_modules/.store/fast-deep-equal@3.1.3-Dk0kpzcWCOUHE1bkOO2LLA/node_modules/fast-deep-equal/index.js"(exports, module) { 2055 "use strict"; 2056 module.exports = function equal(a, b) { 2057 if (a === b) return true; 2058 if (a && b && typeof a == "object" && typeof b == "object") { 2059 if (a.constructor !== b.constructor) return false; 2060 var length, i, keys; 2061 if (Array.isArray(a)) { 2062 length = a.length; 2063 if (length != b.length) return false; 2064 for (i = length; i-- !== 0; ) 2065 if (!equal(a[i], b[i])) return false; 2066 return true; 2067 } 2068 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 2069 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 2070 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 2071 keys = Object.keys(a); 2072 length = keys.length; 2073 if (length !== Object.keys(b).length) return false; 2074 for (i = length; i-- !== 0; ) 2075 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 2076 for (i = length; i-- !== 0; ) { 2077 var key = keys[i]; 2078 if (!equal(a[key], b[key])) return false; 2079 } 2080 return true; 2081 } 2082 return a !== a && b !== b; 2083 }; 2084 } 2085 }); 2086 2087 // node_modules/.store/json-schema-traverse@1.0.0-AJeHsNouz1HT5XgS_tBQIA/node_modules/json-schema-traverse/index.js 2088 var require_json_schema_traverse = __commonJS({ 2089 "node_modules/.store/json-schema-traverse@1.0.0-AJeHsNouz1HT5XgS_tBQIA/node_modules/json-schema-traverse/index.js"(exports, module) { 2090 "use strict"; 2091 var traverse = module.exports = function(schema, opts, cb) { 2092 if (typeof opts == "function") { 2093 cb = opts; 2094 opts = {}; 2095 } 2096 cb = opts.cb || cb; 2097 var pre = typeof cb == "function" ? cb : cb.pre || function() { 2098 }; 2099 var post = cb.post || function() { 2100 }; 2101 _traverse(opts, pre, post, schema, "", schema); 2102 }; 2103 traverse.keywords = { 2104 additionalItems: true, 2105 items: true, 2106 contains: true, 2107 additionalProperties: true, 2108 propertyNames: true, 2109 not: true, 2110 if: true, 2111 then: true, 2112 else: true 2113 }; 2114 traverse.arrayKeywords = { 2115 items: true, 2116 allOf: true, 2117 anyOf: true, 2118 oneOf: true 2119 }; 2120 traverse.propsKeywords = { 2121 $defs: true, 2122 definitions: true, 2123 properties: true, 2124 patternProperties: true, 2125 dependencies: true 2126 }; 2127 traverse.skipKeywords = { 2128 default: true, 2129 enum: true, 2130 const: true, 2131 required: true, 2132 maximum: true, 2133 minimum: true, 2134 exclusiveMaximum: true, 2135 exclusiveMinimum: true, 2136 multipleOf: true, 2137 maxLength: true, 2138 minLength: true, 2139 pattern: true, 2140 format: true, 2141 maxItems: true, 2142 minItems: true, 2143 uniqueItems: true, 2144 maxProperties: true, 2145 minProperties: true 2146 }; 2147 function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { 2148 if (schema && typeof schema == "object" && !Array.isArray(schema)) { 2149 pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); 2150 for (var key in schema) { 2151 var sch = schema[key]; 2152 if (Array.isArray(sch)) { 2153 if (key in traverse.arrayKeywords) { 2154 for (var i = 0; i < sch.length; i++) 2155 _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i); 2156 } 2157 } else if (key in traverse.propsKeywords) { 2158 if (sch && typeof sch == "object") { 2159 for (var prop in sch) 2160 _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop); 2161 } 2162 } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) { 2163 _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema); 2164 } 2165 } 2166 post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); 2167 } 2168 } 2169 function escapeJsonPtr(str) { 2170 return str.replace(/~/g, "~0").replace(/\//g, "~1"); 2171 } 2172 } 2173 }); 2174 2175 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/resolve.js 2176 var require_resolve = __commonJS({ 2177 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/resolve.js"(exports) { 2178 "use strict"; 2179 Object.defineProperty(exports, "__esModule", { value: true }); 2180 exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; 2181 var util_1 = require_util(); 2182 var equal = require_fast_deep_equal(); 2183 var traverse = require_json_schema_traverse(); 2184 var SIMPLE_INLINED = /* @__PURE__ */ new Set([ 2185 "type", 2186 "format", 2187 "pattern", 2188 "maxLength", 2189 "minLength", 2190 "maxProperties", 2191 "minProperties", 2192 "maxItems", 2193 "minItems", 2194 "maximum", 2195 "minimum", 2196 "uniqueItems", 2197 "multipleOf", 2198 "required", 2199 "enum", 2200 "const" 2201 ]); 2202 function inlineRef(schema, limit = true) { 2203 if (typeof schema == "boolean") 2204 return true; 2205 if (limit === true) 2206 return !hasRef(schema); 2207 if (!limit) 2208 return false; 2209 return countKeys(schema) <= limit; 2210 } 2211 exports.inlineRef = inlineRef; 2212 var REF_KEYWORDS = /* @__PURE__ */ new Set([ 2213 "$ref", 2214 "$recursiveRef", 2215 "$recursiveAnchor", 2216 "$dynamicRef", 2217 "$dynamicAnchor" 2218 ]); 2219 function hasRef(schema) { 2220 for (const key in schema) { 2221 if (REF_KEYWORDS.has(key)) 2222 return true; 2223 const sch = schema[key]; 2224 if (Array.isArray(sch) && sch.some(hasRef)) 2225 return true; 2226 if (typeof sch == "object" && hasRef(sch)) 2227 return true; 2228 } 2229 return false; 2230 } 2231 function countKeys(schema) { 2232 let count = 0; 2233 for (const key in schema) { 2234 if (key === "$ref") 2235 return Infinity; 2236 count++; 2237 if (SIMPLE_INLINED.has(key)) 2238 continue; 2239 if (typeof schema[key] == "object") { 2240 (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch)); 2241 } 2242 if (count === Infinity) 2243 return Infinity; 2244 } 2245 return count; 2246 } 2247 function getFullPath(resolver, id = "", normalize) { 2248 if (normalize !== false) 2249 id = normalizeId(id); 2250 const p = resolver.parse(id); 2251 return _getFullPath(resolver, p); 2252 } 2253 exports.getFullPath = getFullPath; 2254 function _getFullPath(resolver, p) { 2255 const serialized = resolver.serialize(p); 2256 return serialized.split("#")[0] + "#"; 2257 } 2258 exports._getFullPath = _getFullPath; 2259 var TRAILING_SLASH_HASH = /#\/?$/; 2260 function normalizeId(id) { 2261 return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; 2262 } 2263 exports.normalizeId = normalizeId; 2264 function resolveUrl(resolver, baseId, id) { 2265 id = normalizeId(id); 2266 return resolver.resolve(baseId, id); 2267 } 2268 exports.resolveUrl = resolveUrl; 2269 var ANCHOR = /^[a-z_][-a-z0-9._]*$/i; 2270 function getSchemaRefs(schema, baseId) { 2271 if (typeof schema == "boolean") 2272 return {}; 2273 const { schemaId, uriResolver } = this.opts; 2274 const schId = normalizeId(schema[schemaId] || baseId); 2275 const baseIds = { "": schId }; 2276 const pathPrefix = getFullPath(uriResolver, schId, false); 2277 const localRefs = {}; 2278 const schemaRefs = /* @__PURE__ */ new Set(); 2279 traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { 2280 if (parentJsonPtr === void 0) 2281 return; 2282 const fullPath = pathPrefix + jsonPtr; 2283 let innerBaseId = baseIds[parentJsonPtr]; 2284 if (typeof sch[schemaId] == "string") 2285 innerBaseId = addRef.call(this, sch[schemaId]); 2286 addAnchor.call(this, sch.$anchor); 2287 addAnchor.call(this, sch.$dynamicAnchor); 2288 baseIds[jsonPtr] = innerBaseId; 2289 function addRef(ref) { 2290 const _resolve = this.opts.uriResolver.resolve; 2291 ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref); 2292 if (schemaRefs.has(ref)) 2293 throw ambiguos(ref); 2294 schemaRefs.add(ref); 2295 let schOrRef = this.refs[ref]; 2296 if (typeof schOrRef == "string") 2297 schOrRef = this.refs[schOrRef]; 2298 if (typeof schOrRef == "object") { 2299 checkAmbiguosRef(sch, schOrRef.schema, ref); 2300 } else if (ref !== normalizeId(fullPath)) { 2301 if (ref[0] === "#") { 2302 checkAmbiguosRef(sch, localRefs[ref], ref); 2303 localRefs[ref] = sch; 2304 } else { 2305 this.refs[ref] = fullPath; 2306 } 2307 } 2308 return ref; 2309 } 2310 function addAnchor(anchor) { 2311 if (typeof anchor == "string") { 2312 if (!ANCHOR.test(anchor)) 2313 throw new Error(`invalid anchor "$anchor}"`); 2314 addRef.call(this, `#$anchor}`); 2315 } 2316 } 2317 }); 2318 return localRefs; 2319 function checkAmbiguosRef(sch1, sch2, ref) { 2320 if (sch2 !== void 0 && !equal(sch1, sch2)) 2321 throw ambiguos(ref); 2322 } 2323 function ambiguos(ref) { 2324 return new Error(`reference "$ref}" resolves to more than one schema`); 2325 } 2326 } 2327 exports.getSchemaRefs = getSchemaRefs; 2328 } 2329 }); 2330 2331 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/index.js 2332 var require_validate = __commonJS({ 2333 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/validate/index.js"(exports) { 2334 "use strict"; 2335 Object.defineProperty(exports, "__esModule", { value: true }); 2336 exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; 2337 var boolSchema_1 = require_boolSchema(); 2338 var dataType_1 = require_dataType(); 2339 var applicability_1 = require_applicability(); 2340 var dataType_2 = require_dataType(); 2341 var defaults_1 = require_defaults(); 2342 var keyword_1 = require_keyword(); 2343 var subschema_1 = require_subschema(); 2344 var codegen_1 = require_codegen(); 2345 var names_1 = require_names(); 2346 var resolve_1 = require_resolve(); 2347 var util_1 = require_util(); 2348 var errors_1 = require_errors(); 2349 function validateFunctionCode(it) { 2350 if (isSchemaObj(it)) { 2351 checkKeywords(it); 2352 if (schemaCxtHasRules(it)) { 2353 topSchemaObjCode(it); 2354 return; 2355 } 2356 } 2357 validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); 2358 } 2359 exports.validateFunctionCode = validateFunctionCode; 2360 function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { 2361 if (opts.code.es5) { 2362 gen.func(validateName, (0, codegen_1._)`$names_1.default.data}, $names_1.default.valCxt}`, schemaEnv.$async, () => { 2363 gen.code((0, codegen_1._)`"use strict"; $funcSourceUrl(schema, opts)}`); 2364 destructureValCxtES5(gen, opts); 2365 gen.code(body); 2366 }); 2367 } else { 2368 gen.func(validateName, (0, codegen_1._)`$names_1.default.data}, $destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); 2369 } 2370 } 2371 function destructureValCxt(opts) { 2372 return (0, codegen_1._)`{$names_1.default.instancePath}="", $names_1.default.parentData}, $names_1.default.parentDataProperty}, $names_1.default.rootData}=$names_1.default.data}$opts.dynamicRef ? (0, codegen_1._)`, $names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; 2373 } 2374 function destructureValCxtES5(gen, opts) { 2375 gen.if(names_1.default.valCxt, () => { 2376 gen.var(names_1.default.instancePath, (0, codegen_1._)`$names_1.default.valCxt}.$names_1.default.instancePath}`); 2377 gen.var(names_1.default.parentData, (0, codegen_1._)`$names_1.default.valCxt}.$names_1.default.parentData}`); 2378 gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`$names_1.default.valCxt}.$names_1.default.parentDataProperty}`); 2379 gen.var(names_1.default.rootData, (0, codegen_1._)`$names_1.default.valCxt}.$names_1.default.rootData}`); 2380 if (opts.dynamicRef) 2381 gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`$names_1.default.valCxt}.$names_1.default.dynamicAnchors}`); 2382 }, () => { 2383 gen.var(names_1.default.instancePath, (0, codegen_1._)`""`); 2384 gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`); 2385 gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`); 2386 gen.var(names_1.default.rootData, names_1.default.data); 2387 if (opts.dynamicRef) 2388 gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`); 2389 }); 2390 } 2391 function topSchemaObjCode(it) { 2392 const { schema, opts, gen } = it; 2393 validateFunction(it, () => { 2394 if (opts.$comment && schema.$comment) 2395 commentKeyword(it); 2396 checkNoDefault(it); 2397 gen.let(names_1.default.vErrors, null); 2398 gen.let(names_1.default.errors, 0); 2399 if (opts.unevaluated) 2400 resetEvaluated(it); 2401 typeAndKeywords(it); 2402 returnResults(it); 2403 }); 2404 return; 2405 } 2406 function resetEvaluated(it) { 2407 const { gen, validateName } = it; 2408 it.evaluated = gen.const("evaluated", (0, codegen_1._)`$validateName}.evaluated`); 2409 gen.if((0, codegen_1._)`$it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`$it.evaluated}.props`, (0, codegen_1._)`undefined`)); 2410 gen.if((0, codegen_1._)`$it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`$it.evaluated}.items`, (0, codegen_1._)`undefined`)); 2411 } 2412 function funcSourceUrl(schema, opts) { 2413 const schId = typeof schema == "object" && schema[opts.schemaId]; 2414 return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil; 2415 } 2416 function subschemaCode(it, valid) { 2417 if (isSchemaObj(it)) { 2418 checkKeywords(it); 2419 if (schemaCxtHasRules(it)) { 2420 subSchemaObjCode(it, valid); 2421 return; 2422 } 2423 } 2424 (0, boolSchema_1.boolOrEmptySchema)(it, valid); 2425 } 2426 function schemaCxtHasRules({ schema, self }) { 2427 if (typeof schema == "boolean") 2428 return !schema; 2429 for (const key in schema) 2430 if (self.RULES.all[key]) 2431 return true; 2432 return false; 2433 } 2434 function isSchemaObj(it) { 2435 return typeof it.schema != "boolean"; 2436 } 2437 function subSchemaObjCode(it, valid) { 2438 const { schema, gen, opts } = it; 2439 if (opts.$comment && schema.$comment) 2440 commentKeyword(it); 2441 updateContext(it); 2442 checkAsyncSchema(it); 2443 const errsCount = gen.const("_errs", names_1.default.errors); 2444 typeAndKeywords(it, errsCount); 2445 gen.var(valid, (0, codegen_1._)`$errsCount} === $names_1.default.errors}`); 2446 } 2447 function checkKeywords(it) { 2448 (0, util_1.checkUnknownRules)(it); 2449 checkRefsAndKeywords(it); 2450 } 2451 function typeAndKeywords(it, errsCount) { 2452 if (it.opts.jtd) 2453 return schemaKeywords(it, [], false, errsCount); 2454 const types = (0, dataType_1.getSchemaTypes)(it.schema); 2455 const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); 2456 schemaKeywords(it, types, !checkedTypes, errsCount); 2457 } 2458 function checkRefsAndKeywords(it) { 2459 const { schema, errSchemaPath, opts, self } = it; 2460 if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) { 2461 self.logger.warn(`$ref: keywords ignored in schema at path "$errSchemaPath}"`); 2462 } 2463 } 2464 function checkNoDefault(it) { 2465 const { schema, opts } = it; 2466 if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) { 2467 (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); 2468 } 2469 } 2470 function updateContext(it) { 2471 const schId = it.schema[it.opts.schemaId]; 2472 if (schId) 2473 it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); 2474 } 2475 function checkAsyncSchema(it) { 2476 if (it.schema.$async && !it.schemaEnv.$async) 2477 throw new Error("async schema in sync schema"); 2478 } 2479 function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { 2480 const msg = schema.$comment; 2481 if (opts.$comment === true) { 2482 gen.code((0, codegen_1._)`$names_1.default.self}.logger.log($msg})`); 2483 } else if (typeof opts.$comment == "function") { 2484 const schemaPath = (0, codegen_1.str)`$errSchemaPath}/$comment`; 2485 const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); 2486 gen.code((0, codegen_1._)`$names_1.default.self}.opts.$comment($msg}, $schemaPath}, $rootName}.schema)`); 2487 } 2488 } 2489 function returnResults(it) { 2490 const { gen, schemaEnv, validateName, ValidationError, opts } = it; 2491 if (schemaEnv.$async) { 2492 gen.if((0, codegen_1._)`$names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new $ValidationError}($names_1.default.vErrors})`)); 2493 } else { 2494 gen.assign((0, codegen_1._)`$validateName}.errors`, names_1.default.vErrors); 2495 if (opts.unevaluated) 2496 assignEvaluated(it); 2497 gen.return((0, codegen_1._)`$names_1.default.errors} === 0`); 2498 } 2499 } 2500 function assignEvaluated({ gen, evaluated, props, items }) { 2501 if (props instanceof codegen_1.Name) 2502 gen.assign((0, codegen_1._)`$evaluated}.props`, props); 2503 if (items instanceof codegen_1.Name) 2504 gen.assign((0, codegen_1._)`$evaluated}.items`, items); 2505 } 2506 function schemaKeywords(it, types, typeErrors, errsCount) { 2507 const { gen, schema, data, allErrors, opts, self } = it; 2508 const { RULES } = self; 2509 if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { 2510 gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); 2511 return; 2512 } 2513 if (!opts.jtd) 2514 checkStrictTypes(it, types); 2515 gen.block(() => { 2516 for (const group of RULES.rules) 2517 groupKeywords(group); 2518 groupKeywords(RULES.post); 2519 }); 2520 function groupKeywords(group) { 2521 if (!(0, applicability_1.shouldUseGroup)(schema, group)) 2522 return; 2523 if (group.type) { 2524 gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); 2525 iterateKeywords(it, group); 2526 if (types.length === 1 && types[0] === group.type && typeErrors) { 2527 gen.else(); 2528 (0, dataType_2.reportTypeError)(it); 2529 } 2530 gen.endIf(); 2531 } else { 2532 iterateKeywords(it, group); 2533 } 2534 if (!allErrors) 2535 gen.if((0, codegen_1._)`$names_1.default.errors} === $errsCount || 0}`); 2536 } 2537 } 2538 function iterateKeywords(it, group) { 2539 const { gen, schema, opts: { useDefaults } } = it; 2540 if (useDefaults) 2541 (0, defaults_1.assignDefaults)(it, group.type); 2542 gen.block(() => { 2543 for (const rule of group.rules) { 2544 if ((0, applicability_1.shouldUseRule)(schema, rule)) { 2545 keywordCode(it, rule.keyword, rule.definition, group.type); 2546 } 2547 } 2548 }); 2549 } 2550 function checkStrictTypes(it, types) { 2551 if (it.schemaEnv.meta || !it.opts.strictTypes) 2552 return; 2553 checkContextTypes(it, types); 2554 if (!it.opts.allowUnionTypes) 2555 checkMultipleTypes(it, types); 2556 checkKeywordTypes(it, it.dataTypes); 2557 } 2558 function checkContextTypes(it, types) { 2559 if (!types.length) 2560 return; 2561 if (!it.dataTypes.length) { 2562 it.dataTypes = types; 2563 return; 2564 } 2565 types.forEach((t) => { 2566 if (!includesType(it.dataTypes, t)) { 2567 strictTypesError(it, `type "$t}" not allowed by context "$it.dataTypes.join(",")}"`); 2568 } 2569 }); 2570 narrowSchemaTypes(it, types); 2571 } 2572 function checkMultipleTypes(it, ts) { 2573 if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { 2574 strictTypesError(it, "use allowUnionTypes to allow union type keyword"); 2575 } 2576 } 2577 function checkKeywordTypes(it, ts) { 2578 const rules = it.self.RULES.all; 2579 for (const keyword in rules) { 2580 const rule = rules[keyword]; 2581 if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { 2582 const { type } = rule.definition; 2583 if (type.length && !type.some((t) => hasApplicableType(ts, t))) { 2584 strictTypesError(it, `missing type "$type.join(",")}" for keyword "$keyword}"`); 2585 } 2586 } 2587 } 2588 } 2589 function hasApplicableType(schTs, kwdT) { 2590 return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer"); 2591 } 2592 function includesType(ts, t) { 2593 return ts.includes(t) || t === "integer" && ts.includes("number"); 2594 } 2595 function narrowSchemaTypes(it, withTypes) { 2596 const ts = []; 2597 for (const t of it.dataTypes) { 2598 if (includesType(withTypes, t)) 2599 ts.push(t); 2600 else if (withTypes.includes("integer") && t === "number") 2601 ts.push("integer"); 2602 } 2603 it.dataTypes = ts; 2604 } 2605 function strictTypesError(it, msg) { 2606 const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; 2607 msg += ` at "$schemaPath}" (strictTypes)`; 2608 (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); 2609 } 2610 var KeywordCxt = class { 2611 constructor(it, def, keyword) { 2612 (0, keyword_1.validateKeywordUsage)(it, def, keyword); 2613 this.gen = it.gen; 2614 this.allErrors = it.allErrors; 2615 this.keyword = keyword; 2616 this.data = it.data; 2617 this.schema = it.schema[keyword]; 2618 this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; 2619 this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); 2620 this.schemaType = def.schemaType; 2621 this.parentSchema = it.schema; 2622 this.params = {}; 2623 this.it = it; 2624 this.def = def; 2625 if (this.$data) { 2626 this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); 2627 } else { 2628 this.schemaCode = this.schemaValue; 2629 if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { 2630 throw new Error(`$keyword} value must be $JSON.stringify(def.schemaType)}`); 2631 } 2632 } 2633 if ("code" in def ? def.trackErrors : def.errors !== false) { 2634 this.errsCount = it.gen.const("_errs", names_1.default.errors); 2635 } 2636 } 2637 result(condition, successAction, failAction) { 2638 this.failResult((0, codegen_1.not)(condition), successAction, failAction); 2639 } 2640 failResult(condition, successAction, failAction) { 2641 this.gen.if(condition); 2642 if (failAction) 2643 failAction(); 2644 else 2645 this.error(); 2646 if (successAction) { 2647 this.gen.else(); 2648 successAction(); 2649 if (this.allErrors) 2650 this.gen.endIf(); 2651 } else { 2652 if (this.allErrors) 2653 this.gen.endIf(); 2654 else 2655 this.gen.else(); 2656 } 2657 } 2658 pass(condition, failAction) { 2659 this.failResult((0, codegen_1.not)(condition), void 0, failAction); 2660 } 2661 fail(condition) { 2662 if (condition === void 0) { 2663 this.error(); 2664 if (!this.allErrors) 2665 this.gen.if(false); 2666 return; 2667 } 2668 this.gen.if(condition); 2669 this.error(); 2670 if (this.allErrors) 2671 this.gen.endIf(); 2672 else 2673 this.gen.else(); 2674 } 2675 fail$data(condition) { 2676 if (!this.$data) 2677 return this.fail(condition); 2678 const { schemaCode } = this; 2679 this.fail((0, codegen_1._)`$schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); 2680 } 2681 error(append, errorParams, errorPaths) { 2682 if (errorParams) { 2683 this.setParams(errorParams); 2684 this._error(append, errorPaths); 2685 this.setParams({}); 2686 return; 2687 } 2688 this._error(append, errorPaths); 2689 } 2690 _error(append, errorPaths) { 2691 ; 2692 (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); 2693 } 2694 $dataError() { 2695 (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); 2696 } 2697 reset() { 2698 if (this.errsCount === void 0) 2699 throw new Error('add "trackErrors" to keyword definition'); 2700 (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); 2701 } 2702 ok(cond) { 2703 if (!this.allErrors) 2704 this.gen.if(cond); 2705 } 2706 setParams(obj, assign) { 2707 if (assign) 2708 Object.assign(this.params, obj); 2709 else 2710 this.params = obj; 2711 } 2712 block$data(valid, codeBlock, $dataValid = codegen_1.nil) { 2713 this.gen.block(() => { 2714 this.check$data(valid, $dataValid); 2715 codeBlock(); 2716 }); 2717 } 2718 check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { 2719 if (!this.$data) 2720 return; 2721 const { gen, schemaCode, schemaType, def } = this; 2722 gen.if((0, codegen_1.or)((0, codegen_1._)`$schemaCode} === undefined`, $dataValid)); 2723 if (valid !== codegen_1.nil) 2724 gen.assign(valid, true); 2725 if (schemaType.length || def.validateSchema) { 2726 gen.elseIf(this.invalid$data()); 2727 this.$dataError(); 2728 if (valid !== codegen_1.nil) 2729 gen.assign(valid, false); 2730 } 2731 gen.else(); 2732 } 2733 invalid$data() { 2734 const { gen, schemaCode, schemaType, def, it } = this; 2735 return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); 2736 function wrong$DataType() { 2737 if (schemaType.length) { 2738 if (!(schemaCode instanceof codegen_1.Name)) 2739 throw new Error("ajv implementation error"); 2740 const st = Array.isArray(schemaType) ? schemaType : [schemaType]; 2741 return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; 2742 } 2743 return codegen_1.nil; 2744 } 2745 function invalid$DataSchema() { 2746 if (def.validateSchema) { 2747 const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); 2748 return (0, codegen_1._)`!$validateSchemaRef}($schemaCode})`; 2749 } 2750 return codegen_1.nil; 2751 } 2752 } 2753 subschema(appl, valid) { 2754 const subschema = (0, subschema_1.getSubschema)(this.it, appl); 2755 (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); 2756 (0, subschema_1.extendSubschemaMode)(subschema, appl); 2757 const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 }; 2758 subschemaCode(nextContext, valid); 2759 return nextContext; 2760 } 2761 mergeEvaluated(schemaCxt, toName) { 2762 const { it, gen } = this; 2763 if (!it.opts.unevaluated) 2764 return; 2765 if (it.props !== true && schemaCxt.props !== void 0) { 2766 it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); 2767 } 2768 if (it.items !== true && schemaCxt.items !== void 0) { 2769 it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); 2770 } 2771 } 2772 mergeValidEvaluated(schemaCxt, valid) { 2773 const { it, gen } = this; 2774 if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { 2775 gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); 2776 return true; 2777 } 2778 } 2779 }; 2780 exports.KeywordCxt = KeywordCxt; 2781 function keywordCode(it, keyword, def, ruleType) { 2782 const cxt = new KeywordCxt(it, def, keyword); 2783 if ("code" in def) { 2784 def.code(cxt, ruleType); 2785 } else if (cxt.$data && def.validate) { 2786 (0, keyword_1.funcKeywordCode)(cxt, def); 2787 } else if ("macro" in def) { 2788 (0, keyword_1.macroKeywordCode)(cxt, def); 2789 } else if (def.compile || def.validate) { 2790 (0, keyword_1.funcKeywordCode)(cxt, def); 2791 } 2792 } 2793 var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; 2794 var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; 2795 function getData($data, { dataLevel, dataNames, dataPathArr }) { 2796 let jsonPointer; 2797 let data; 2798 if ($data === "") 2799 return names_1.default.rootData; 2800 if ($data[0] === "/") { 2801 if (!JSON_POINTER.test($data)) 2802 throw new Error(`Invalid JSON-pointer: ${$data}`); 2803 jsonPointer = $data; 2804 data = names_1.default.rootData; 2805 } else { 2806 const matches = RELATIVE_JSON_POINTER.exec($data); 2807 if (!matches) 2808 throw new Error(`Invalid JSON-pointer: ${$data}`); 2809 const up = +matches[1]; 2810 jsonPointer = matches[2]; 2811 if (jsonPointer === "#") { 2812 if (up >= dataLevel) 2813 throw new Error(errorMsg("property/index", up)); 2814 return dataPathArr[dataLevel - up]; 2815 } 2816 if (up > dataLevel) 2817 throw new Error(errorMsg("data", up)); 2818 data = dataNames[dataLevel - up]; 2819 if (!jsonPointer) 2820 return data; 2821 } 2822 let expr = data; 2823 const segments = jsonPointer.split("/"); 2824 for (const segment of segments) { 2825 if (segment) { 2826 data = (0, codegen_1._)`$data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; 2827 expr = (0, codegen_1._)`$expr} && $data}`; 2828 } 2829 } 2830 return expr; 2831 function errorMsg(pointerType, up) { 2832 return `Cannot access $pointerType} $up} levels up, current level is $dataLevel}`; 2833 } 2834 } 2835 exports.getData = getData; 2836 } 2837 }); 2838 2839 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/validation_error.js 2840 var require_validation_error = __commonJS({ 2841 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/validation_error.js"(exports) { 2842 "use strict"; 2843 Object.defineProperty(exports, "__esModule", { value: true }); 2844 var ValidationError = class extends Error { 2845 constructor(errors) { 2846 super("validation failed"); 2847 this.errors = errors; 2848 this.ajv = this.validation = true; 2849 } 2850 }; 2851 exports.default = ValidationError; 2852 } 2853 }); 2854 2855 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/ref_error.js 2856 var require_ref_error = __commonJS({ 2857 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/ref_error.js"(exports) { 2858 "use strict"; 2859 Object.defineProperty(exports, "__esModule", { value: true }); 2860 var resolve_1 = require_resolve(); 2861 var MissingRefError = class extends Error { 2862 constructor(resolver, baseId, ref, msg) { 2863 super(msg || `can't resolve reference $ref} from id $baseId}`); 2864 this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); 2865 this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); 2866 } 2867 }; 2868 exports.default = MissingRefError; 2869 } 2870 }); 2871 2872 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/index.js 2873 var require_compile = __commonJS({ 2874 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/compile/index.js"(exports) { 2875 "use strict"; 2876 Object.defineProperty(exports, "__esModule", { value: true }); 2877 exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; 2878 var codegen_1 = require_codegen(); 2879 var validation_error_1 = require_validation_error(); 2880 var names_1 = require_names(); 2881 var resolve_1 = require_resolve(); 2882 var util_1 = require_util(); 2883 var validate_1 = require_validate(); 2884 var SchemaEnv = class { 2885 constructor(env) { 2886 var _a; 2887 this.refs = {}; 2888 this.dynamicAnchors = {}; 2889 let schema; 2890 if (typeof env.schema == "object") 2891 schema = env.schema; 2892 this.schema = env.schema; 2893 this.schemaId = env.schemaId; 2894 this.root = env.root || this; 2895 this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); 2896 this.schemaPath = env.schemaPath; 2897 this.localRefs = env.localRefs; 2898 this.meta = env.meta; 2899 this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; 2900 this.refs = {}; 2901 } 2902 }; 2903 exports.SchemaEnv = SchemaEnv; 2904 function compileSchema(sch) { 2905 const _sch = getCompilingSchema.call(this, sch); 2906 if (_sch) 2907 return _sch; 2908 const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); 2909 const { es5, lines } = this.opts.code; 2910 const { ownProperties } = this.opts; 2911 const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); 2912 let _ValidationError; 2913 if (sch.$async) { 2914 _ValidationError = gen.scopeValue("Error", { 2915 ref: validation_error_1.default, 2916 code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default` 2917 }); 2918 } 2919 const validateName = gen.scopeName("validate"); 2920 sch.validateName = validateName; 2921 const schemaCxt = { 2922 gen, 2923 allErrors: this.opts.allErrors, 2924 data: names_1.default.data, 2925 parentData: names_1.default.parentData, 2926 parentDataProperty: names_1.default.parentDataProperty, 2927 dataNames: [names_1.default.data], 2928 dataPathArr: [codegen_1.nil], 2929 // TODO can its length be used as dataLevel if nil is removed? 2930 dataLevel: 0, 2931 dataTypes: [], 2932 definedProperties: /* @__PURE__ */ new Set(), 2933 topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }), 2934 validateName, 2935 ValidationError: _ValidationError, 2936 schema: sch.schema, 2937 schemaEnv: sch, 2938 rootId, 2939 baseId: sch.baseId || rootId, 2940 schemaPath: codegen_1.nil, 2941 errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), 2942 errorPath: (0, codegen_1._)`""`, 2943 opts: this.opts, 2944 self: this 2945 }; 2946 let sourceCode; 2947 try { 2948 this._compilations.add(sch); 2949 (0, validate_1.validateFunctionCode)(schemaCxt); 2950 gen.optimize(this.opts.code.optimize); 2951 const validateCode = gen.toString(); 2952 sourceCode = `$gen.scopeRefs(names_1.default.scope)}return $validateCode}`; 2953 if (this.opts.code.process) 2954 sourceCode = this.opts.code.process(sourceCode, sch); 2955 const makeValidate = new Function(`$names_1.default.self}`, `$names_1.default.scope}`, sourceCode); 2956 const validate = makeValidate(this, this.scope.get()); 2957 this.scope.value(validateName, { ref: validate }); 2958 validate.errors = null; 2959 validate.schema = sch.schema; 2960 validate.schemaEnv = sch; 2961 if (sch.$async) 2962 validate.$async = true; 2963 if (this.opts.code.source === true) { 2964 validate.source = { validateName, validateCode, scopeValues: gen._values }; 2965 } 2966 if (this.opts.unevaluated) { 2967 const { props, items } = schemaCxt; 2968 validate.evaluated = { 2969 props: props instanceof codegen_1.Name ? void 0 : props, 2970 items: items instanceof codegen_1.Name ? void 0 : items, 2971 dynamicProps: props instanceof codegen_1.Name, 2972 dynamicItems: items instanceof codegen_1.Name 2973 }; 2974 if (validate.source) 2975 validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated); 2976 } 2977 sch.validate = validate; 2978 return sch; 2979 } catch (e) { 2980 delete sch.validate; 2981 delete sch.validateName; 2982 if (sourceCode) 2983 this.logger.error("Error compiling schema, function code:", sourceCode); 2984 throw e; 2985 } finally { 2986 this._compilations.delete(sch); 2987 } 2988 } 2989 exports.compileSchema = compileSchema; 2990 function resolveRef(root, baseId, ref) { 2991 var _a; 2992 ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); 2993 const schOrFunc = root.refs[ref]; 2994 if (schOrFunc) 2995 return schOrFunc; 2996 let _sch = resolve.call(this, root, ref); 2997 if (_sch === void 0) { 2998 const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; 2999 const { schemaId } = this.opts; 3000 if (schema) 3001 _sch = new SchemaEnv({ schema, schemaId, root, baseId }); 3002 } 3003 if (_sch === void 0) 3004 return; 3005 return root.refs[ref] = inlineOrCompile.call(this, _sch); 3006 } 3007 exports.resolveRef = resolveRef; 3008 function inlineOrCompile(sch) { 3009 if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) 3010 return sch.schema; 3011 return sch.validate ? sch : compileSchema.call(this, sch); 3012 } 3013 function getCompilingSchema(schEnv) { 3014 for (const sch of this._compilations) { 3015 if (sameSchemaEnv(sch, schEnv)) 3016 return sch; 3017 } 3018 } 3019 exports.getCompilingSchema = getCompilingSchema; 3020 function sameSchemaEnv(s1, s2) { 3021 return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; 3022 } 3023 function resolve(root, ref) { 3024 let sch; 3025 while (typeof (sch = this.refs[ref]) == "string") 3026 ref = sch; 3027 return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); 3028 } 3029 function resolveSchema(root, ref) { 3030 const p = this.opts.uriResolver.parse(ref); 3031 const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); 3032 let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0); 3033 if (Object.keys(root.schema).length > 0 && refPath === baseId) { 3034 return getJsonPointer.call(this, p, root); 3035 } 3036 const id = (0, resolve_1.normalizeId)(refPath); 3037 const schOrRef = this.refs[id] || this.schemas[id]; 3038 if (typeof schOrRef == "string") { 3039 const sch = resolveSchema.call(this, root, schOrRef); 3040 if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") 3041 return; 3042 return getJsonPointer.call(this, p, sch); 3043 } 3044 if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") 3045 return; 3046 if (!schOrRef.validate) 3047 compileSchema.call(this, schOrRef); 3048 if (id === (0, resolve_1.normalizeId)(ref)) { 3049 const { schema } = schOrRef; 3050 const { schemaId } = this.opts; 3051 const schId = schema[schemaId]; 3052 if (schId) 3053 baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); 3054 return new SchemaEnv({ schema, schemaId, root, baseId }); 3055 } 3056 return getJsonPointer.call(this, p, schOrRef); 3057 } 3058 exports.resolveSchema = resolveSchema; 3059 var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([ 3060 "properties", 3061 "patternProperties", 3062 "enum", 3063 "dependencies", 3064 "definitions" 3065 ]); 3066 function getJsonPointer(parsedRef, { baseId, schema, root }) { 3067 var _a; 3068 if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") 3069 return; 3070 for (const part of parsedRef.fragment.slice(1).split("/")) { 3071 if (typeof schema === "boolean") 3072 return; 3073 const partSchema = schema[(0, util_1.unescapeFragment)(part)]; 3074 if (partSchema === void 0) 3075 return; 3076 schema = partSchema; 3077 const schId = typeof schema === "object" && schema[this.opts.schemaId]; 3078 if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { 3079 baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); 3080 } 3081 } 3082 let env; 3083 if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { 3084 const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); 3085 env = resolveSchema.call(this, root, $ref); 3086 } 3087 const { schemaId } = this.opts; 3088 env = env || new SchemaEnv({ schema, schemaId, root, baseId }); 3089 if (env.schema !== env.root.schema) 3090 return env; 3091 return void 0; 3092 } 3093 } 3094 }); 3095 3096 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/refs/data.json 3097 var require_data2 = __commonJS({ 3098 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/refs/data.json"(exports, module) { 3099 module.exports = { 3100 $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", 3101 description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", 3102 type: "object", 3103 required: ["$data"], 3104 properties: { 3105 $data: { 3106 type: "string", 3107 anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] 3108 } 3109 }, 3110 additionalProperties: false 3111 }; 3112 } 3113 }); 3114 3115 // node_modules/.store/fast-uri@3.1.8-k4kV3WU9z96SB2M9Sm_viQ/node_modules/fast-uri/lib/utils.js 3116 var require_utils = __commonJS({ 3117 "node_modules/.store/fast-uri@3.1.8-k4kV3WU9z96SB2M9Sm_viQ/node_modules/fast-uri/lib/utils.js"(exports, module) { 3118 "use strict"; 3119 var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu); 3120 var isIPv4 = 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); 3121 var isPort = RegExp.prototype.test.bind(/^\d*$/u); 3122 var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu); 3123 var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu); 3124 var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u); 3125 var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u); 3126 var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u); 3127 var BYTE_HEX = new Array(256); 3128 { 3129 const HEX_DIGITS = "0123456789ABCDEF"; 3130 for (let i = 0; i < 256; i++) { 3131 BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15]; 3132 } 3133 } 3134 function percentEncodeNonAscii(cp) { 3135 if (cp < 2048) { 3136 return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63]; 3137 } 3138 if (cp < 65536) { 3139 return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63]; 3140 } 3141 return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63]; 3142 } 3143 function stringArrayToHexStripped(input) { 3144 let acc = ""; 3145 let code = 0; 3146 let i = 0; 3147 for (i = 0; i < input.length; i++) { 3148 code = input[i].charCodeAt(0); 3149 if (code === 48) { 3150 continue; 3151 } 3152 if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { 3153 return ""; 3154 } 3155 acc += input[i]; 3156 break; 3157 } 3158 for (i += 1; i < input.length; i++) { 3159 code = input[i].charCodeAt(0); 3160 if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { 3161 return ""; 3162 } 3163 acc += input[i]; 3164 } 3165 return acc; 3166 } 3167 var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/); 3168 var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/); 3169 var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/); 3170 var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u); 3171 function isZoneIdentifier(zone) { 3172 if (zone.length === 0) return false; 3173 for (let i = 0; i < zone.length; i++) { 3174 if (isZoneCharacter(zone[i])) continue; 3175 if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) { 3176 i += 2; 3177 continue; 3178 } 3179 return false; 3180 } 3181 return true; 3182 } 3183 function compressIPv6ZeroRun(hextets) { 3184 let bestStart = -1; 3185 let bestLength = 0; 3186 let runStart = -1; 3187 let runLength = 0; 3188 for (let i = 0; i < hextets.length; i++) { 3189 if (hextets[i] === "0") { 3190 if (runStart === -1) runStart = i; 3191 runLength++; 3192 if (runLength > bestLength) { 3193 bestLength = runLength; 3194 bestStart = runStart; 3195 } 3196 } else { 3197 runStart = -1; 3198 runLength = 0; 3199 } 3200 } 3201 if (bestLength < 2) return hextets.join(":"); 3202 const head = hextets.slice(0, bestStart).join(":"); 3203 const tail = hextets.slice(bestStart + bestLength).join(":"); 3204 return head + "::" + tail; 3205 } 3206 function normalizeIPv6Address(input) { 3207 const compression = input.indexOf("::"); 3208 if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0; 3209 const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":"); 3210 const right = compression === -1 ? [] : input.slice(compression + 2).split(":"); 3211 if (compression !== -1) { 3212 if (left.length === 1 && left[0] === "") left.length = 0; 3213 if (right.length === 1 && right[0] === "") right.length = 0; 3214 } 3215 const parts = left.concat(right); 3216 let hextetCount = 0; 3217 for (let i = 0; i < parts.length; i++) { 3218 const part = parts[i]; 3219 if (part === "") return void 0; 3220 if (part.indexOf(".") !== -1) { 3221 if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0; 3222 hextetCount += 2; 3223 continue; 3224 } 3225 if (!isHextet(part)) return void 0; 3226 parts[i] = parseInt(part, 16).toString(16); 3227 hextetCount++; 3228 } 3229 if (compression === -1) { 3230 if (hextetCount !== 8) return void 0; 3231 return compressIPv6ZeroRun(parts); 3232 } 3233 if (hextetCount >= 8) return void 0; 3234 const expanded = parts.slice(0, left.length); 3235 for (let i = hextetCount; i < 8; i++) expanded.push("0"); 3236 for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]); 3237 return compressIPv6ZeroRun(expanded); 3238 } 3239 function normalizeIPv6(host) { 3240 const bracketed = host[0] === "[" && host[host.length - 1] === "]"; 3241 const hasBracket = host[0] === "[" || host[host.length - 1] === "]"; 3242 if (hasBracket && !bracketed) return { host, isIPV6: false, error: true }; 3243 let input = bracketed ? host.slice(1, -1) : host; 3244 if (bracketed && isIPvFuture(input)) { 3245 input = input.toLowerCase(); 3246 return { host: `[$input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true }; 3247 } 3248 if (findToken(input, ":") < 2) { 3249 return { host, isIPV6: false, error: bracketed }; 3250 } 3251 let zoneIdentifier = ""; 3252 const zoneSeparator = input.indexOf("%"); 3253 if (zoneSeparator !== -1) { 3254 const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1; 3255 zoneIdentifier = input.slice(zoneSeparator + separatorLength); 3256 if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true }; 3257 input = input.slice(0, zoneSeparator); 3258 } 3259 const address = normalizeIPv6Address(input); 3260 if (address === void 0) return { host, isIPV6: false, error: true }; 3261 return { 3262 host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""), 3263 escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""), 3264 isIPV6: true 3265 }; 3266 } 3267 function findToken(str, token) { 3268 let ind = 0; 3269 for (let i = 0; i < str.length; i++) { 3270 if (str[i] === token) ind++; 3271 } 3272 return ind; 3273 } 3274 function removeDotSegments(path) { 3275 let input = path; 3276 const output = []; 3277 let nextSlash = -1; 3278 let len = 0; 3279 while (len = input.length) { 3280 if (len === 1) { 3281 if (input === ".") { 3282 break; 3283 } else if (input === "/") { 3284 output.push("/"); 3285 break; 3286 } else { 3287 output.push(input); 3288 break; 3289 } 3290 } else if (len === 2) { 3291 if (input[0] === ".") { 3292 if (input[1] === ".") { 3293 break; 3294 } else if (input[1] === "/") { 3295 input = input.slice(2); 3296 continue; 3297 } 3298 } else if (input[0] === "/") { 3299 if (input[1] === "." || input[1] === "/") { 3300 output.push("/"); 3301 break; 3302 } 3303 } 3304 } else if (len === 3) { 3305 if (input === "/..") { 3306 if (output.length !== 0) { 3307 output.pop(); 3308 } 3309 output.push("/"); 3310 break; 3311 } 3312 } 3313 if (input[0] === ".") { 3314 if (input[1] === ".") { 3315 if (input[2] === "/") { 3316 input = input.slice(3); 3317 continue; 3318 } 3319 } else if (input[1] === "/") { 3320 input = input.slice(2); 3321 continue; 3322 } 3323 } else if (input[0] === "/") { 3324 if (input[1] === ".") { 3325 if (input[2] === "/") { 3326 input = input.slice(2); 3327 continue; 3328 } else if (input[2] === ".") { 3329 if (input[3] === "/") { 3330 input = input.slice(3); 3331 if (output.length !== 0) { 3332 output.pop(); 3333 } 3334 continue; 3335 } 3336 } 3337 } 3338 } 3339 if ((nextSlash = input.indexOf("/", 1)) === -1) { 3340 output.push(input); 3341 break; 3342 } else { 3343 output.push(input.slice(0, nextSlash)); 3344 input = input.slice(nextSlash); 3345 } 3346 } 3347 return output.join(""); 3348 } 3349 var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" }; 3350 var HOST_DELIM_RE = /[@/?#:]/g; 3351 var HOST_DELIM_NO_COLON_RE = /[@/?#]/g; 3352 function reescapeHostDelimiters(host, isIP) { 3353 const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE; 3354 re.lastIndex = 0; 3355 return host.replace(re, (ch) => HOST_DELIMS[ch]); 3356 } 3357 function normalizePercentEncoding(input, decodeUnreserved = false) { 3358 if (input.indexOf("%") === -1) { 3359 return input; 3360 } 3361 let output = ""; 3362 for (let i = 0; i < input.length; i++) { 3363 if (input[i] === "%" && i + 2 < input.length) { 3364 const hex = input.slice(i + 1, i + 3); 3365 if (isHexPair(hex)) { 3366 const normalizedHex = hex.toUpperCase(); 3367 const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); 3368 if (decodeUnreserved && isUnreserved(decoded)) { 3369 output += decoded; 3370 } else { 3371 output += "%" + normalizedHex; 3372 } 3373 i += 2; 3374 continue; 3375 } 3376 } 3377 output += input[i]; 3378 } 3379 return output; 3380 } 3381 function normalizePathEncoding(input) { 3382 let output = ""; 3383 for (let i = 0; i < input.length; i++) { 3384 const ch = input[i]; 3385 if (ch === "%" && i + 2 < input.length) { 3386 const hex = input.slice(i + 1, i + 3); 3387 if (isHexPair(hex)) { 3388 const normalizedHex = hex.toUpperCase(); 3389 const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); 3390 if (decoded !== "." && isUnreserved(decoded)) { 3391 output += decoded; 3392 } else { 3393 output += "%" + normalizedHex; 3394 } 3395 i += 2; 3396 continue; 3397 } 3398 } 3399 if (isPathCharacter(ch)) { 3400 output += ch; 3401 } else { 3402 const code = input.charCodeAt(i); 3403 if (code < 128) { 3404 output += isEscapeSafe(code) ? ch : BYTE_HEX[code]; 3405 } else if (code < 55296 || code > 57343) { 3406 output += percentEncodeNonAscii(code); 3407 } else if (code <= 56319 && i + 1 < input.length) { 3408 const low = input.charCodeAt(i + 1); 3409 if (low >= 56320 && low <= 57343) { 3410 output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); 3411 i++; 3412 } else { 3413 output += percentEncodeNonAscii(65533); 3414 } 3415 } else { 3416 output += percentEncodeNonAscii(65533); 3417 } 3418 } 3419 } 3420 return output; 3421 } 3422 function serializePathEncoding(input, pathNoScheme = false) { 3423 let output = ""; 3424 let firstSegment = pathNoScheme && input[0] !== "/"; 3425 for (let i = 0; i < input.length; i++) { 3426 const ch = input[i]; 3427 if (ch === "%" && i + 2 < input.length) { 3428 const hex = input.slice(i + 1, i + 3); 3429 if (isHexPair(hex)) { 3430 output += "%" + hex.toUpperCase(); 3431 i += 2; 3432 continue; 3433 } 3434 } 3435 if (ch === "/") { 3436 firstSegment = false; 3437 } 3438 if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) { 3439 output += ch; 3440 } else { 3441 const code = input.charCodeAt(i); 3442 if (code < 128) { 3443 output += BYTE_HEX[code]; 3444 } else if (code < 55296 || code > 57343) { 3445 output += percentEncodeNonAscii(code); 3446 } else if (code <= 56319 && i + 1 < input.length) { 3447 const low = input.charCodeAt(i + 1); 3448 if (low >= 56320 && low <= 57343) { 3449 output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); 3450 i++; 3451 } else { 3452 output += percentEncodeNonAscii(65533); 3453 } 3454 } else { 3455 output += percentEncodeNonAscii(65533); 3456 } 3457 } 3458 } 3459 return output; 3460 } 3461 function encodeComponent(input, isAllowed) { 3462 let output = ""; 3463 for (let i = 0; i < input.length; i++) { 3464 const ch = input[i]; 3465 if (ch === "%" && i + 2 < input.length) { 3466 const hex = input.slice(i + 1, i + 3); 3467 if (isHexPair(hex)) { 3468 output += "%" + hex.toUpperCase(); 3469 i += 2; 3470 continue; 3471 } 3472 } 3473 if (isAllowed(ch)) { 3474 output += ch; 3475 } else { 3476 const code = input.charCodeAt(i); 3477 if (code < 128) { 3478 output += BYTE_HEX[code]; 3479 } else if (code < 55296 || code > 57343) { 3480 output += percentEncodeNonAscii(code); 3481 } else if (code <= 56319 && i + 1 < input.length) { 3482 const low = input.charCodeAt(i + 1); 3483 if (low >= 56320 && low <= 57343) { 3484 output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); 3485 i++; 3486 } else { 3487 output += percentEncodeNonAscii(65533); 3488 } 3489 } else { 3490 output += percentEncodeNonAscii(65533); 3491 } 3492 } 3493 } 3494 return output; 3495 } 3496 function encodeUserinfo(input) { 3497 return encodeComponent(input, isUserinfoCharacter); 3498 } 3499 function encodeQuery(input) { 3500 return encodeComponent(input, isQueryFragmentCharacter); 3501 } 3502 function encodeFragment(input) { 3503 return encodeComponent(input, isQueryFragmentCharacter); 3504 } 3505 function isEscapeSafe(cp) { 3506 return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95; 3507 } 3508 function normalizeQueryFragmentEncoding(input) { 3509 let output = ""; 3510 for (let i = 0; i < input.length; i++) { 3511 const ch = input[i]; 3512 if (ch === "%" && i + 2 < input.length) { 3513 const hex = input.slice(i + 1, i + 3); 3514 if (isHexPair(hex)) { 3515 const normalizedHex = hex.toUpperCase(); 3516 const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); 3517 if (isUnreserved(decoded)) { 3518 output += decoded; 3519 } else { 3520 output += "%" + normalizedHex; 3521 } 3522 i += 2; 3523 continue; 3524 } 3525 } 3526 if (isQueryFragmentCharacter(ch)) { 3527 output += ch; 3528 } else { 3529 const code = input.charCodeAt(i); 3530 if (code < 128) { 3531 output += isEscapeSafe(code) ? ch : BYTE_HEX[code]; 3532 } else if (code < 55296 || code > 57343) { 3533 output += percentEncodeNonAscii(code); 3534 } else if (code <= 56319 && i + 1 < input.length) { 3535 const low = input.charCodeAt(i + 1); 3536 if (low >= 56320 && low <= 57343) { 3537 output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); 3538 i++; 3539 } else { 3540 output += percentEncodeNonAscii(65533); 3541 } 3542 } else { 3543 output += percentEncodeNonAscii(65533); 3544 } 3545 } 3546 } 3547 return output; 3548 } 3549 function escapePreservingEscapes(input) { 3550 let output = ""; 3551 for (let i = 0; i < input.length; i++) { 3552 if (input[i] === "%" && i + 2 < input.length) { 3553 const hex = input.slice(i + 1, i + 3); 3554 if (isHexPair(hex)) { 3555 output += "%" + hex.toUpperCase(); 3556 i += 2; 3557 continue; 3558 } 3559 } 3560 output += escape(input[i]); 3561 } 3562 return output; 3563 } 3564 function recomposeAuthority(component) { 3565 const uriTokens = []; 3566 if (component.userinfo !== void 0) { 3567 uriTokens.push(encodeUserinfo(component.userinfo)); 3568 uriTokens.push("@"); 3569 } 3570 if (component.host !== void 0) { 3571 let host = component.host; 3572 if (!isIPv4(host)) { 3573 let ipV6res = normalizeIPv6(host); 3574 if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) { 3575 host = normalizePercentEncoding(host, true); 3576 ipV6res = normalizeIPv6(host); 3577 } 3578 if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) { 3579 host = `[$ipV6res.escapedHost}]`; 3580 } else { 3581 host = reescapeHostDelimiters(host, false); 3582 } 3583 } 3584 uriTokens.push(host); 3585 } 3586 if (typeof component.port === "number" || typeof component.port === "string") { 3587 const port = String(component.port); 3588 if (!isPort(port)) { 3589 throw new TypeError("URI port is malformed."); 3590 } 3591 uriTokens.push(":"); 3592 uriTokens.push(port); 3593 } 3594 return uriTokens.length ? uriTokens.join("") : void 0; 3595 } 3596 module.exports = { 3597 nonSimpleDomain, 3598 recomposeAuthority, 3599 reescapeHostDelimiters, 3600 normalizePercentEncoding, 3601 normalizePathEncoding, 3602 serializePathEncoding, 3603 normalizeQueryFragmentEncoding, 3604 encodeUserinfo, 3605 encodeQuery, 3606 encodeFragment, 3607 escapePreservingEscapes, 3608 removeDotSegments, 3609 isIPv4, 3610 isUUID, 3611 normalizeIPv6, 3612 stringArrayToHexStripped 3613 }; 3614 } 3615 }); 3616 3617 // node_modules/.store/fast-uri@3.1.8-k4kV3WU9z96SB2M9Sm_viQ/node_modules/fast-uri/lib/schemes.js 3618 var require_schemes = __commonJS({ 3619 "node_modules/.store/fast-uri@3.1.8-k4kV3WU9z96SB2M9Sm_viQ/node_modules/fast-uri/lib/schemes.js"(exports, module) { 3620 "use strict"; 3621 var { isUUID } = require_utils(); 3622 var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu; 3623 var supportedSchemeNames = ( 3624 /** @type {const} */ 3625 [ 3626 "http", 3627 "https", 3628 "ws", 3629 "wss", 3630 "urn", 3631 "urn:uuid" 3632 ] 3633 ); 3634 function isValidSchemeName(name) { 3635 return supportedSchemeNames.indexOf( 3636 /** @type {*} */ 3637 name 3638 ) !== -1; 3639 } 3640 function wsIsSecure(wsComponent) { 3641 if (wsComponent.secure === true) { 3642 return true; 3643 } else if (wsComponent.secure === false) { 3644 return false; 3645 } else if (wsComponent.scheme) { 3646 return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S"); 3647 } else { 3648 return false; 3649 } 3650 } 3651 function httpParse(component) { 3652 if (!component.host) { 3653 component.error = component.error || "HTTP URIs must have a host."; 3654 } 3655 return component; 3656 } 3657 function httpSerialize(component) { 3658 const secure = String(component.scheme).toLowerCase() === "https"; 3659 if (component.port === (secure ? 443 : 80) || component.port === "") { 3660 component.port = void 0; 3661 } 3662 if (!component.path) { 3663 component.path = "/"; 3664 } 3665 return component; 3666 } 3667 function wsParse(wsComponent) { 3668 wsComponent.secure = wsIsSecure(wsComponent); 3669 wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : ""); 3670 wsComponent.path = void 0; 3671 wsComponent.query = void 0; 3672 return wsComponent; 3673 } 3674 function wsSerialize(wsComponent) { 3675 if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") { 3676 wsComponent.port = void 0; 3677 } 3678 if (typeof wsComponent.secure === "boolean") { 3679 wsComponent.scheme = wsComponent.secure ? "wss" : "ws"; 3680 wsComponent.secure = void 0; 3681 } 3682 if (wsComponent.resourceName) { 3683 const queryIndex = wsComponent.resourceName.indexOf("?"); 3684 const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex); 3685 wsComponent.path = path && path !== "/" ? path : void 0; 3686 wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1); 3687 wsComponent.resourceName = void 0; 3688 } 3689 wsComponent.fragment = void 0; 3690 return wsComponent; 3691 } 3692 function urnParse(urnComponent, options) { 3693 if (!urnComponent.path) { 3694 urnComponent.error = "URN can not be parsed"; 3695 return urnComponent; 3696 } 3697 const matches = urnComponent.path.match(URN_REG); 3698 if (matches && matches[0] === urnComponent.path) { 3699 const scheme = options.scheme || urnComponent.scheme || "urn"; 3700 urnComponent.nid = matches[1].toLowerCase(); 3701 urnComponent.nss = matches[2]; 3702 const urnScheme = `$scheme}:$options.nid || urnComponent.nid}`; 3703 const schemeHandler = getSchemeHandler(urnScheme); 3704 urnComponent.path = void 0; 3705 if (schemeHandler) { 3706 urnComponent = schemeHandler.parse(urnComponent, options); 3707 } 3708 } else { 3709 urnComponent.error = urnComponent.error || "URN can not be parsed."; 3710 } 3711 return urnComponent; 3712 } 3713 function urnSerialize(urnComponent, options) { 3714 if (urnComponent.nid === void 0) { 3715 throw new Error("URN without nid cannot be serialized"); 3716 } 3717 const scheme = options.scheme || urnComponent.scheme || "urn"; 3718 const nid = urnComponent.nid.toLowerCase(); 3719 const urnScheme = `$scheme}:$options.nid || nid}`; 3720 const schemeHandler = getSchemeHandler(urnScheme); 3721 if (schemeHandler) { 3722 urnComponent = schemeHandler.serialize(urnComponent, options); 3723 } 3724 const uriComponent = urnComponent; 3725 const nss = urnComponent.nss; 3726 uriComponent.path = `$nid || options.nid}:$nss}`; 3727 options.skipEscape = true; 3728 return uriComponent; 3729 } 3730 function urnuuidParse(urnComponent, options) { 3731 const uuidComponent = urnComponent; 3732 uuidComponent.uuid = uuidComponent.nss; 3733 uuidComponent.nss = void 0; 3734 if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) { 3735 uuidComponent.error = uuidComponent.error || "UUID is not valid."; 3736 } 3737 return uuidComponent; 3738 } 3739 function urnuuidSerialize(uuidComponent) { 3740 const urnComponent = uuidComponent; 3741 urnComponent.nss = (uuidComponent.uuid || "").toLowerCase(); 3742 return urnComponent; 3743 } 3744 var http = ( 3745 /** @type {SchemeHandler} */ 3746 { 3747 scheme: "http", 3748 domainHost: true, 3749 parse: httpParse, 3750 serialize: httpSerialize 3751 } 3752 ); 3753 var https = ( 3754 /** @type {SchemeHandler} */ 3755 { 3756 scheme: "https", 3757 domainHost: http.domainHost, 3758 parse: httpParse, 3759 serialize: httpSerialize 3760 } 3761 ); 3762 var ws = ( 3763 /** @type {SchemeHandler} */ 3764 { 3765 scheme: "ws", 3766 domainHost: true, 3767 parse: wsParse, 3768 serialize: wsSerialize 3769 } 3770 ); 3771 var wss = ( 3772 /** @type {SchemeHandler} */ 3773 { 3774 scheme: "wss", 3775 domainHost: ws.domainHost, 3776 parse: ws.parse, 3777 serialize: ws.serialize 3778 } 3779 ); 3780 var urn = ( 3781 /** @type {SchemeHandler} */ 3782 { 3783 scheme: "urn", 3784 parse: urnParse, 3785 serialize: urnSerialize, 3786 skipNormalize: true 3787 } 3788 ); 3789 var urnuuid = ( 3790 /** @type {SchemeHandler} */ 3791 { 3792 scheme: "urn:uuid", 3793 parse: urnuuidParse, 3794 serialize: urnuuidSerialize, 3795 skipNormalize: true 3796 } 3797 ); 3798 var SCHEMES = ( 3799 /** @type {Record<SchemeName, SchemeHandler>} */ 3800 { 3801 http, 3802 https, 3803 ws, 3804 wss, 3805 urn, 3806 "urn:uuid": urnuuid 3807 } 3808 ); 3809 Object.setPrototypeOf(SCHEMES, null); 3810 function getSchemeHandler(scheme) { 3811 return scheme && (SCHEMES[ 3812 /** @type {SchemeName} */ 3813 scheme 3814 ] || SCHEMES[ 3815 /** @type {SchemeName} */ 3816 scheme.toLowerCase() 3817 ]) || void 0; 3818 } 3819 module.exports = { 3820 wsIsSecure, 3821 SCHEMES, 3822 isValidSchemeName, 3823 getSchemeHandler 3824 }; 3825 } 3826 }); 3827 3828 // node_modules/.store/fast-uri@3.1.8-k4kV3WU9z96SB2M9Sm_viQ/node_modules/fast-uri/index.js 3829 var require_fast_uri = __commonJS({ 3830 "node_modules/.store/fast-uri@3.1.8-k4kV3WU9z96SB2M9Sm_viQ/node_modules/fast-uri/index.js"(exports, module) { 3831 "use strict"; 3832 var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils(); 3833 var { SCHEMES, getSchemeHandler } = require_schemes(); 3834 var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u; 3835 var MALFORMED_SCHEME_ERROR = "URI scheme is malformed."; 3836 function decodeValidScheme(scheme) { 3837 const decodedScheme = unescape(String(scheme)); 3838 if (!VALID_SCHEME.test(decodedScheme)) { 3839 throw new TypeError(MALFORMED_SCHEME_ERROR); 3840 } 3841 return decodedScheme; 3842 } 3843 function normalize(uri, options) { 3844 if (typeof uri === "string") { 3845 uri = /** @type {T} */ 3846 normalizeString(uri, options); 3847 } else if (typeof uri === "object") { 3848 uri = /** @type {T} */ 3849 parse(serialize(uri, options), options); 3850 } 3851 return uri; 3852 } 3853 function resolve(baseURI, relativeURI, options) { 3854 const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" }; 3855 const { 3856 parsed: baseParsed, 3857 malformedAuthorityOrPort: baseMalformed, 3858 malformedPercentEncoding: baseMalformedPercentEncoding, 3859 malformedSchemeSpecific: baseMalformedSchemeSpecific, 3860 malformedHost: baseMalformedHost, 3861 malformedScheme: baseMalformedScheme 3862 } = parseWithStatus(baseURI, schemelessOptions); 3863 const { 3864 parsed: relativeParsed, 3865 malformedAuthorityOrPort: relativeMalformed, 3866 malformedPercentEncoding: relativeMalformedPercentEncoding, 3867 malformedSchemeSpecific: relativeMalformedSchemeSpecific, 3868 malformedHost: relativeMalformedHost, 3869 malformedScheme: relativeMalformedScheme 3870 } = parseWithStatus(relativeURI, schemelessOptions); 3871 if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) { 3872 throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed."); 3873 } 3874 const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true); 3875 const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme); 3876 const resolvedHost = resolved.host; 3877 const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6); 3878 canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP); 3879 const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost); 3880 if (resolved.error && !encodedASCIIHost) { 3881 throw new Error(resolved.error); 3882 } 3883 schemelessOptions.skipEscape = true; 3884 return serialize(resolved, schemelessOptions); 3885 } 3886 function resolveComponent(base, relative, options, skipNormalization) { 3887 const target = {}; 3888 if (!skipNormalization) { 3889 base = parse(serialize(base, options), options); 3890 relative = parse(serialize(relative, options), options); 3891 } 3892 options = options || {}; 3893 if (!options.tolerant && relative.scheme) { 3894 target.scheme = relative.scheme; 3895 target.userinfo = relative.userinfo; 3896 target.host = relative.host; 3897 target.port = relative.port; 3898 target.path = removeDotSegments(relative.path || ""); 3899 target.query = relative.query; 3900 } else { 3901 if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) { 3902 target.userinfo = relative.userinfo; 3903 target.host = relative.host; 3904 target.port = relative.port; 3905 target.path = removeDotSegments(relative.path || ""); 3906 target.query = relative.query; 3907 } else { 3908 if (!relative.path) { 3909 target.path = base.path; 3910 if (relative.query !== void 0) { 3911 target.query = relative.query; 3912 } else { 3913 target.query = base.query; 3914 } 3915 } else { 3916 if (relative.path[0] === "/") { 3917 target.path = removeDotSegments(relative.path); 3918 } else { 3919 if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) { 3920 target.path = "/" + relative.path; 3921 } else if (!base.path) { 3922 target.path = relative.path; 3923 } else { 3924 target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; 3925 } 3926 target.path = removeDotSegments(target.path); 3927 } 3928 target.query = relative.query; 3929 } 3930 target.userinfo = base.userinfo; 3931 target.host = base.host; 3932 target.port = base.port; 3933 } 3934 target.scheme = base.scheme; 3935 } 3936 target.fragment = relative.fragment; 3937 return target; 3938 } 3939 function equal(uriA, uriB, options) { 3940 const normalizedA = normalizeComparableURI(uriA, options); 3941 const normalizedB = normalizeComparableURI(uriB, options); 3942 return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB; 3943 } 3944 function serialize(cmpts, opts) { 3945 const component = { 3946 host: cmpts.host, 3947 scheme: cmpts.scheme, 3948 userinfo: cmpts.userinfo, 3949 port: cmpts.port, 3950 path: cmpts.path, 3951 query: cmpts.query, 3952 nid: cmpts.nid, 3953 nss: cmpts.nss, 3954 uuid: cmpts.uuid, 3955 fragment: cmpts.fragment, 3956 reference: cmpts.reference, 3957 resourceName: cmpts.resourceName, 3958 secure: cmpts.secure, 3959 error: "" 3960 }; 3961 const options = Object.assign({}, opts); 3962 const uriTokens = []; 3963 if (component.scheme) { 3964 component.scheme = decodeValidScheme(component.scheme); 3965 } 3966 const schemeHandler = getSchemeHandler(options.scheme || component.scheme); 3967 if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options); 3968 const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0; 3969 const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority; 3970 if (component.path !== void 0) { 3971 if (!options.skipEscape) { 3972 component.path = serializePathEncoding(component.path, pathNoScheme); 3973 } else { 3974 component.path = normalizePercentEncoding(component.path); 3975 } 3976 } 3977 if (options.reference !== "suffix" && component.scheme) { 3978 component.scheme = decodeValidScheme(component.scheme); 3979 uriTokens.push(component.scheme, ":"); 3980 } 3981 const authority = recomposeAuthority(component); 3982 if (authority !== void 0) { 3983 if (options.reference !== "suffix") { 3984 uriTokens.push("//"); 3985 } 3986 uriTokens.push(authority); 3987 if (component.path && component.path[0] !== "/") { 3988 uriTokens.push("/"); 3989 } 3990 } 3991 if (component.path !== void 0) { 3992 let s = component.path; 3993 if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { 3994 s = removeDotSegments(s); 3995 } 3996 if (pathNoScheme) { 3997 s = serializePathEncoding(s, true); 3998 } 3999 if (authority === void 0 && s[0] === "/" && s[1] === "/") { 4000 s = "/%2F" + s.slice(2); 4001 } 4002 uriTokens.push(s); 4003 } 4004 if (component.query !== void 0) { 4005 uriTokens.push("?", encodeQuery(component.query)); 4006 } 4007 if (component.fragment !== void 0) { 4008 uriTokens.push("#", encodeFragment(component.fragment)); 4009 } 4010 return uriTokens.join(""); 4011 } 4012 var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; 4013 var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/; 4014 var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/; 4015 function getParseError(parsed, matches) { 4016 if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") { 4017 return 'URI path must start with "/" when authority is present.'; 4018 } 4019 if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) { 4020 return "URI port is malformed."; 4021 } 4022 return void 0; 4023 } 4024 function hasMalformedPercentEncoding(component) { 4025 if (component === void 0) return false; 4026 let percent = component.indexOf("%"); 4027 while (percent !== -1) { 4028 if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) { 4029 return true; 4030 } 4031 percent = component.indexOf("%", percent + 3); 4032 } 4033 return false; 4034 } 4035 function isIPLiteral(host) { 4036 return host[0] === "[" && host[host.length - 1] === "]"; 4037 } 4038 function hasMalformedComponentPercentEncoding(matches) { 4039 const host = matches[4]; 4040 return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]); 4041 } 4042 function canonicalizeHost(parsed, options, schemeHandler, isIP) { 4043 if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) { 4044 try { 4045 parsed.host = new URL("http://" + parsed.host).hostname; 4046 } catch (e) { 4047 parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e; 4048 return true; 4049 } 4050 } 4051 return false; 4052 } 4053 function parseWithStatus(uri, opts) { 4054 const options = Object.assign({}, opts); 4055 const parsed = { 4056 scheme: void 0, 4057 userinfo: void 0, 4058 host: "", 4059 port: void 0, 4060 path: "", 4061 query: void 0, 4062 fragment: void 0 4063 }; 4064 let malformedAuthorityOrPort = false; 4065 let malformedPercentEncoding = false; 4066 let malformedSchemeSpecific = false; 4067 let malformedHost = false; 4068 let malformedIPLiteral = false; 4069 let malformedScheme = false; 4070 let isIP = false; 4071 if (options.reference === "suffix") { 4072 if (options.scheme) { 4073 uri = options.scheme + ":" + uri; 4074 } else { 4075 uri = "//" + uri; 4076 } 4077 } 4078 const authorityMatch = uri.match(AUTHORITY_PREFIX); 4079 if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) { 4080 parsed.error = "URI authority must not contain a literal backslash."; 4081 malformedAuthorityOrPort = true; 4082 } 4083 const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION); 4084 if (introducerMatch !== null) { 4085 const region = introducerMatch[1]; 4086 const normalizedRegion = region.replace(/[\t\n\r]/g, ""); 4087 if (normalizedRegion.length >= 2) { 4088 if (normalizedRegion.slice(0, 2) !== "//") { 4089 parsed.error = parsed.error || "URI authority must not contain a literal backslash."; 4090 malformedAuthorityOrPort = true; 4091 } else if (region.length !== normalizedRegion.length) { 4092 parsed.error = parsed.error || "URI authority introducer must not contain whitespace."; 4093 malformedAuthorityOrPort = true; 4094 } 4095 } 4096 } 4097 const matches = uri.match(URI_PARSE); 4098 if (matches) { 4099 parsed.scheme = matches[1]; 4100 parsed.userinfo = matches[3]; 4101 parsed.host = matches[4]; 4102 parsed.port = parseInt(matches[5], 10); 4103 parsed.path = matches[6] || ""; 4104 parsed.query = matches[7]; 4105 parsed.fragment = matches[8]; 4106 if (parsed.scheme !== void 0) { 4107 const decodedScheme = unescape(parsed.scheme); 4108 if (VALID_SCHEME.test(decodedScheme)) { 4109 parsed.scheme = decodedScheme.toLowerCase(); 4110 } else { 4111 parsed.error = parsed.error || MALFORMED_SCHEME_ERROR; 4112 malformedScheme = true; 4113 } 4114 } 4115 malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches); 4116 if (malformedPercentEncoding) { 4117 parsed.error = parsed.error || "URI contains malformed percent-encoding."; 4118 } 4119 if (isNaN(parsed.port)) { 4120 parsed.port = matches[5]; 4121 } 4122 const parseError = getParseError(parsed, matches); 4123 if (parseError !== void 0) { 4124 parsed.error = parsed.error || parseError; 4125 malformedAuthorityOrPort = true; 4126 } 4127 if (parsed.host) { 4128 const ipv4result = isIPv4(parsed.host); 4129 if (ipv4result === false) { 4130 const bracketedIPLiteral = isIPLiteral(parsed.host); 4131 const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1; 4132 const ipv6result = normalizeIPv6(parsed.host); 4133 isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true; 4134 malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true); 4135 parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase(); 4136 if (malformedIPLiteral) { 4137 parsed.error = parsed.error || "URI host is malformed."; 4138 malformedAuthorityOrPort = true; 4139 } 4140 } else { 4141 isIP = true; 4142 } 4143 } 4144 if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) { 4145 parsed.reference = "same-document"; 4146 } else if (parsed.scheme === void 0) { 4147 parsed.reference = "relative"; 4148 } else if (parsed.fragment === void 0) { 4149 parsed.reference = "absolute"; 4150 } else { 4151 parsed.reference = "uri"; 4152 } 4153 if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) { 4154 parsed.error = parsed.error || "URI is not a " + options.reference + " reference."; 4155 } 4156 const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme); 4157 if (!malformedIPLiteral) { 4158 malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP); 4159 } 4160 if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) { 4161 let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true); 4162 if (!isIP) { 4163 host = normalizePercentEncoding(host.toLowerCase()); 4164 } 4165 parsed.host = reescapeHostDelimiters(host, isIP); 4166 } 4167 if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) { 4168 if (parsed.path) { 4169 parsed.path = normalizePathEncoding(parsed.path); 4170 } 4171 if (parsed.query) { 4172 parsed.query = normalizeQueryFragmentEncoding(parsed.query); 4173 } 4174 if (parsed.fragment) { 4175 parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment); 4176 } 4177 } 4178 if (schemeHandler && schemeHandler.parse) { 4179 schemeHandler.parse(parsed, options); 4180 if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) { 4181 malformedSchemeSpecific = true; 4182 } 4183 } 4184 } else { 4185 parsed.error = parsed.error || "URI can not be parsed."; 4186 } 4187 return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme }; 4188 } 4189 function parse(uri, opts) { 4190 return parseWithStatus(uri, opts).parsed; 4191 } 4192 function normalizeString(uri, opts) { 4193 return normalizeStringWithStatus(uri, opts).normalized; 4194 } 4195 function normalizeStringWithStatus(uri, opts) { 4196 const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts); 4197 return { 4198 normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts), 4199 malformedAuthorityOrPort, 4200 malformedPercentEncoding, 4201 malformedSchemeSpecific, 4202 malformedHost, 4203 malformedScheme 4204 }; 4205 } 4206 function normalizeComparableURI(uri, opts) { 4207 if (typeof uri !== "string" && typeof uri !== "object") { 4208 return void 0; 4209 } 4210 let value; 4211 try { 4212 value = typeof uri === "string" ? uri : serialize(uri, opts); 4213 } catch { 4214 return void 0; 4215 } 4216 const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts); 4217 return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized; 4218 } 4219 var fastUri = { 4220 SCHEMES, 4221 normalize, 4222 resolve, 4223 resolveComponent, 4224 equal, 4225 serialize, 4226 parse 4227 }; 4228 module.exports = fastUri; 4229 module.exports.default = fastUri; 4230 module.exports.fastUri = fastUri; 4231 } 4232 }); 4233 4234 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/uri.js 4235 var require_uri = __commonJS({ 4236 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/uri.js"(exports) { 4237 "use strict"; 4238 Object.defineProperty(exports, "__esModule", { value: true }); 4239 var uri = require_fast_uri(); 4240 uri.code = 'require("ajv/dist/runtime/uri").default'; 4241 exports.default = uri; 4242 } 4243 }); 4244 4245 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/core.js 4246 var require_core = __commonJS({ 4247 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/core.js"(exports) { 4248 "use strict"; 4249 Object.defineProperty(exports, "__esModule", { value: true }); 4250 exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; 4251 var validate_1 = require_validate(); 4252 Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { 4253 return validate_1.KeywordCxt; 4254 } }); 4255 var codegen_1 = require_codegen(); 4256 Object.defineProperty(exports, "_", { enumerable: true, get: function() { 4257 return codegen_1._; 4258 } }); 4259 Object.defineProperty(exports, "str", { enumerable: true, get: function() { 4260 return codegen_1.str; 4261 } }); 4262 Object.defineProperty(exports, "stringify", { enumerable: true, get: function() { 4263 return codegen_1.stringify; 4264 } }); 4265 Object.defineProperty(exports, "nil", { enumerable: true, get: function() { 4266 return codegen_1.nil; 4267 } }); 4268 Object.defineProperty(exports, "Name", { enumerable: true, get: function() { 4269 return codegen_1.Name; 4270 } }); 4271 Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() { 4272 return codegen_1.CodeGen; 4273 } }); 4274 var validation_error_1 = require_validation_error(); 4275 var ref_error_1 = require_ref_error(); 4276 var rules_1 = require_rules(); 4277 var compile_1 = require_compile(); 4278 var codegen_2 = require_codegen(); 4279 var resolve_1 = require_resolve(); 4280 var dataType_1 = require_dataType(); 4281 var util_1 = require_util(); 4282 var $dataRefSchema = require_data2(); 4283 var uri_1 = require_uri(); 4284 var defaultRegExp = (str, flags) => new RegExp(str, flags); 4285 defaultRegExp.code = "new RegExp"; 4286 var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; 4287 var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([ 4288 "validate", 4289 "serialize", 4290 "parse", 4291 "wrapper", 4292 "root", 4293 "schema", 4294 "keyword", 4295 "pattern", 4296 "formats", 4297 "validate$data", 4298 "func", 4299 "obj", 4300 "Error" 4301 ]); 4302 var removedOptions = { 4303 errorDataPath: "", 4304 format: "`validateFormats: false` can be used instead.", 4305 nullable: '"nullable" keyword is supported by default.', 4306 jsonPointers: "Deprecated jsPropertySyntax can be used instead.", 4307 extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", 4308 missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", 4309 processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", 4310 sourceCode: "Use option `code: {source: true}`", 4311 strictDefaults: "It is default now, see option `strict`.", 4312 strictKeywords: "It is default now, see option `strict`.", 4313 uniqueItems: '"uniqueItems" keyword is always validated.', 4314 unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", 4315 cache: "Map is used as cache, schema object as key.", 4316 serialize: "Map is used as cache, schema object as key.", 4317 ajvErrors: "It is default now." 4318 }; 4319 var deprecatedOptions = { 4320 ignoreKeywordsWithRef: "", 4321 jsPropertySyntax: "", 4322 unicode: '"minLength"/"maxLength" account for unicode characters by default.' 4323 }; 4324 var MAX_EXPRESSION = 200; 4325 function requiredOptions(o) { 4326 var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; 4327 const s = o.strict; 4328 const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; 4329 const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0; 4330 const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; 4331 const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; 4332 return { 4333 strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, 4334 strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, 4335 strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", 4336 strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", 4337 strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, 4338 code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, 4339 loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, 4340 loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, 4341 meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, 4342 messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, 4343 inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, 4344 schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", 4345 addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, 4346 validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, 4347 validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, 4348 unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, 4349 int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, 4350 uriResolver 4351 }; 4352 } 4353 var Ajv2 = class { 4354 constructor(opts = {}) { 4355 this.schemas = {}; 4356 this.refs = {}; 4357 this.formats = /* @__PURE__ */ Object.create(null); 4358 this._compilations = /* @__PURE__ */ new Set(); 4359 this._loading = {}; 4360 this._cache = /* @__PURE__ */ new Map(); 4361 opts = this.opts = { ...opts, ...requiredOptions(opts) }; 4362 const { es5, lines } = this.opts.code; 4363 this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); 4364 this.logger = getLogger(opts.logger); 4365 const formatOpt = opts.validateFormats; 4366 opts.validateFormats = false; 4367 this.RULES = (0, rules_1.getRules)(); 4368 checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); 4369 checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); 4370 this._metaOpts = getMetaSchemaOptions.call(this); 4371 if (opts.formats) 4372 addInitialFormats.call(this); 4373 this._addVocabularies(); 4374 this._addDefaultMetaSchema(); 4375 if (opts.keywords) 4376 addInitialKeywords.call(this, opts.keywords); 4377 if (typeof opts.meta == "object") 4378 this.addMetaSchema(opts.meta); 4379 addInitialSchemas.call(this); 4380 opts.validateFormats = formatOpt; 4381 } 4382 _addVocabularies() { 4383 this.addKeyword("$async"); 4384 } 4385 _addDefaultMetaSchema() { 4386 const { $data, meta, schemaId } = this.opts; 4387 let _dataRefSchema = $dataRefSchema; 4388 if (schemaId === "id") { 4389 _dataRefSchema = { ...$dataRefSchema }; 4390 _dataRefSchema.id = _dataRefSchema.$id; 4391 delete _dataRefSchema.$id; 4392 } 4393 if (meta && $data) 4394 this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); 4395 } 4396 defaultMeta() { 4397 const { meta, schemaId } = this.opts; 4398 return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : void 0; 4399 } 4400 validate(schemaKeyRef, data) { 4401 let v; 4402 if (typeof schemaKeyRef == "string") { 4403 v = this.getSchema(schemaKeyRef); 4404 if (!v) 4405 throw new Error(`no schema with key or ref "$schemaKeyRef}"`); 4406 } else { 4407 v = this.compile(schemaKeyRef); 4408 } 4409 const valid = v(data); 4410 if (!("$async" in v)) 4411 this.errors = v.errors; 4412 return valid; 4413 } 4414 compile(schema, _meta) { 4415 const sch = this._addSchema(schema, _meta); 4416 return sch.validate || this._compileSchemaEnv(sch); 4417 } 4418 compileAsync(schema, meta) { 4419 if (typeof this.opts.loadSchema != "function") { 4420 throw new Error("options.loadSchema should be a function"); 4421 } 4422 const { loadSchema } = this.opts; 4423 return runCompileAsync.call(this, schema, meta); 4424 async function runCompileAsync(_schema, _meta) { 4425 await loadMetaSchema.call(this, _schema.$schema); 4426 const sch = this._addSchema(_schema, _meta); 4427 return sch.validate || _compileAsync.call(this, sch); 4428 } 4429 async function loadMetaSchema($ref) { 4430 if ($ref && !this.getSchema($ref)) { 4431 await runCompileAsync.call(this, { $ref }, true); 4432 } 4433 } 4434 async function _compileAsync(sch) { 4435 try { 4436 return this._compileSchemaEnv(sch); 4437 } catch (e) { 4438 if (!(e instanceof ref_error_1.default)) 4439 throw e; 4440 checkLoaded.call(this, e); 4441 await loadMissingSchema.call(this, e.missingSchema); 4442 return _compileAsync.call(this, sch); 4443 } 4444 } 4445 function checkLoaded({ missingSchema: ref, missingRef }) { 4446 if (this.refs[ref]) { 4447 throw new Error(`AnySchema $ref} is loaded but $missingRef} cannot be resolved`); 4448 } 4449 } 4450 async function loadMissingSchema(ref) { 4451 const _schema = await _loadSchema.call(this, ref); 4452 if (!this.refs[ref]) 4453 await loadMetaSchema.call(this, _schema.$schema); 4454 if (!this.refs[ref]) 4455 this.addSchema(_schema, ref, meta); 4456 } 4457 async function _loadSchema(ref) { 4458 const p = this._loading[ref]; 4459 if (p) 4460 return p; 4461 try { 4462 return await (this._loading[ref] = loadSchema(ref)); 4463 } finally { 4464 delete this._loading[ref]; 4465 } 4466 } 4467 } 4468 // Adds schema to the instance 4469 addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) { 4470 if (Array.isArray(schema)) { 4471 for (const sch of schema) 4472 this.addSchema(sch, void 0, _meta, _validateSchema); 4473 return this; 4474 } 4475 let id; 4476 if (typeof schema === "object") { 4477 const { schemaId } = this.opts; 4478 id = schema[schemaId]; 4479 if (id !== void 0 && typeof id != "string") { 4480 throw new Error(`schema $schemaId} must be string`); 4481 } 4482 } 4483 key = (0, resolve_1.normalizeId)(key || id); 4484 this._checkUnique(key); 4485 this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true); 4486 return this; 4487 } 4488 // Add schema that will be used to validate other schemas 4489 // options in META_IGNORE_OPTIONS are alway set to false 4490 addMetaSchema(schema, key, _validateSchema = this.opts.validateSchema) { 4491 this.addSchema(schema, key, true, _validateSchema); 4492 return this; 4493 } 4494 // Validate schema against its meta-schema 4495 validateSchema(schema, throwOrLogError) { 4496 if (typeof schema == "boolean") 4497 return true; 4498 let $schema; 4499 $schema = schema.$schema; 4500 if ($schema !== void 0 && typeof $schema != "string") { 4501 throw new Error("$schema must be a string"); 4502 } 4503 $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); 4504 if (!$schema) { 4505 this.logger.warn("meta-schema not available"); 4506 this.errors = null; 4507 return true; 4508 } 4509 const valid = this.validate($schema, schema); 4510 if (!valid && throwOrLogError) { 4511 const message = "schema is invalid: " + this.errorsText(); 4512 if (this.opts.validateSchema === "log") 4513 this.logger.error(message); 4514 else 4515 throw new Error(message); 4516 } 4517 return valid; 4518 } 4519 // Get compiled schema by `key` or `ref`. 4520 // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) 4521 getSchema(keyRef) { 4522 let sch; 4523 while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") 4524 keyRef = sch; 4525 if (sch === void 0) { 4526 const { schemaId } = this.opts; 4527 const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); 4528 sch = compile_1.resolveSchema.call(this, root, keyRef); 4529 if (!sch) 4530 return; 4531 this.refs[keyRef] = sch; 4532 } 4533 return sch.validate || this._compileSchemaEnv(sch); 4534 } 4535 // Remove cached schema(s). 4536 // If no parameter is passed all schemas but meta-schemas are removed. 4537 // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. 4538 // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. 4539 removeSchema(schemaKeyRef) { 4540 if (schemaKeyRef instanceof RegExp) { 4541 this._removeAllSchemas(this.schemas, schemaKeyRef); 4542 this._removeAllSchemas(this.refs, schemaKeyRef); 4543 return this; 4544 } 4545 switch (typeof schemaKeyRef) { 4546 case "undefined": 4547 this._removeAllSchemas(this.schemas); 4548 this._removeAllSchemas(this.refs); 4549 this._cache.clear(); 4550 return this; 4551 case "string": { 4552 const sch = getSchEnv.call(this, schemaKeyRef); 4553 if (typeof sch == "object") 4554 this._cache.delete(sch.schema); 4555 delete this.schemas[schemaKeyRef]; 4556 delete this.refs[schemaKeyRef]; 4557 return this; 4558 } 4559 case "object": { 4560 const cacheKey = schemaKeyRef; 4561 this._cache.delete(cacheKey); 4562 let id = schemaKeyRef[this.opts.schemaId]; 4563 if (id) { 4564 id = (0, resolve_1.normalizeId)(id); 4565 delete this.schemas[id]; 4566 delete this.refs[id]; 4567 } 4568 return this; 4569 } 4570 default: 4571 throw new Error("ajv.removeSchema: invalid parameter"); 4572 } 4573 } 4574 // add "vocabulary" - a collection of keywords 4575 addVocabulary(definitions) { 4576 for (const def of definitions) 4577 this.addKeyword(def); 4578 return this; 4579 } 4580 addKeyword(kwdOrDef, def) { 4581 let keyword; 4582 if (typeof kwdOrDef == "string") { 4583 keyword = kwdOrDef; 4584 if (typeof def == "object") { 4585 this.logger.warn("these parameters are deprecated, see docs for addKeyword"); 4586 def.keyword = keyword; 4587 } 4588 } else if (typeof kwdOrDef == "object" && def === void 0) { 4589 def = kwdOrDef; 4590 keyword = def.keyword; 4591 if (Array.isArray(keyword) && !keyword.length) { 4592 throw new Error("addKeywords: keyword must be string or non-empty array"); 4593 } 4594 } else { 4595 throw new Error("invalid addKeywords parameters"); 4596 } 4597 checkKeyword.call(this, keyword, def); 4598 if (!def) { 4599 (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); 4600 return this; 4601 } 4602 keywordMetaschema.call(this, def); 4603 const definition = { 4604 ...def, 4605 type: (0, dataType_1.getJSONTypes)(def.type), 4606 schemaType: (0, dataType_1.getJSONTypes)(def.schemaType) 4607 }; 4608 (0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); 4609 return this; 4610 } 4611 getKeyword(keyword) { 4612 const rule = this.RULES.all[keyword]; 4613 return typeof rule == "object" ? rule.definition : !!rule; 4614 } 4615 // Remove keyword 4616 removeKeyword(keyword) { 4617 const { RULES } = this; 4618 delete RULES.keywords[keyword]; 4619 delete RULES.all[keyword]; 4620 for (const group of RULES.rules) { 4621 const i = group.rules.findIndex((rule) => rule.keyword === keyword); 4622 if (i >= 0) 4623 group.rules.splice(i, 1); 4624 } 4625 return this; 4626 } 4627 // Add format 4628 addFormat(name, format) { 4629 if (typeof format == "string") 4630 format = new RegExp(format); 4631 this.formats[name] = format; 4632 return this; 4633 } 4634 errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) { 4635 if (!errors || errors.length === 0) 4636 return "No errors"; 4637 return errors.map((e) => `$dataVar}$e.instancePath} $e.message}`).reduce((text, msg) => text + separator + msg); 4638 } 4639 $dataMetaSchema(metaSchema, keywordsJsonPointers) { 4640 const rules = this.RULES.all; 4641 metaSchema = JSON.parse(JSON.stringify(metaSchema)); 4642 for (const jsonPointer of keywordsJsonPointers) { 4643 const segments = jsonPointer.split("/").slice(1); 4644 let keywords = metaSchema; 4645 for (const seg of segments) 4646 keywords = keywords[seg]; 4647 for (const key in rules) { 4648 const rule = rules[key]; 4649 if (typeof rule != "object") 4650 continue; 4651 const { $data } = rule.definition; 4652 const schema = keywords[key]; 4653 if ($data && schema) 4654 keywords[key] = schemaOrData(schema); 4655 } 4656 } 4657 return metaSchema; 4658 } 4659 _removeAllSchemas(schemas, regex) { 4660 for (const keyRef in schemas) { 4661 const sch = schemas[keyRef]; 4662 if (!regex || regex.test(keyRef)) { 4663 if (typeof sch == "string") { 4664 delete schemas[keyRef]; 4665 } else if (sch && !sch.meta) { 4666 this._cache.delete(sch.schema); 4667 delete schemas[keyRef]; 4668 } 4669 } 4670 } 4671 } 4672 _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { 4673 let id; 4674 const { schemaId } = this.opts; 4675 if (typeof schema == "object") { 4676 id = schema[schemaId]; 4677 } else { 4678 if (this.opts.jtd) 4679 throw new Error("schema must be object"); 4680 else if (typeof schema != "boolean") 4681 throw new Error("schema must be object or boolean"); 4682 } 4683 let sch = this._cache.get(schema); 4684 if (sch !== void 0) 4685 return sch; 4686 baseId = (0, resolve_1.normalizeId)(id || baseId); 4687 const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); 4688 sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); 4689 this._cache.set(sch.schema, sch); 4690 if (addSchema && !baseId.startsWith("#")) { 4691 if (baseId) 4692 this._checkUnique(baseId); 4693 this.refs[baseId] = sch; 4694 } 4695 if (validateSchema) 4696 this.validateSchema(schema, true); 4697 return sch; 4698 } 4699 _checkUnique(id) { 4700 if (this.schemas[id] || this.refs[id]) { 4701 throw new Error(`schema with key or id "$id}" already exists`); 4702 } 4703 } 4704 _compileSchemaEnv(sch) { 4705 if (sch.meta) 4706 this._compileMetaSchema(sch); 4707 else 4708 compile_1.compileSchema.call(this, sch); 4709 if (!sch.validate) 4710 throw new Error("ajv implementation error"); 4711 return sch.validate; 4712 } 4713 _compileMetaSchema(sch) { 4714 const currentOpts = this.opts; 4715 this.opts = this._metaOpts; 4716 try { 4717 compile_1.compileSchema.call(this, sch); 4718 } finally { 4719 this.opts = currentOpts; 4720 } 4721 } 4722 }; 4723 Ajv2.ValidationError = validation_error_1.default; 4724 Ajv2.MissingRefError = ref_error_1.default; 4725 exports.default = Ajv2; 4726 function checkOptions(checkOpts, options, msg, log = "error") { 4727 for (const key in checkOpts) { 4728 const opt = key; 4729 if (opt in options) 4730 this.logger[log](`$msg}: option $key}. $checkOpts[opt]}`); 4731 } 4732 } 4733 function getSchEnv(keyRef) { 4734 keyRef = (0, resolve_1.normalizeId)(keyRef); 4735 return this.schemas[keyRef] || this.refs[keyRef]; 4736 } 4737 function addInitialSchemas() { 4738 const optsSchemas = this.opts.schemas; 4739 if (!optsSchemas) 4740 return; 4741 if (Array.isArray(optsSchemas)) 4742 this.addSchema(optsSchemas); 4743 else 4744 for (const key in optsSchemas) 4745 this.addSchema(optsSchemas[key], key); 4746 } 4747 function addInitialFormats() { 4748 for (const name in this.opts.formats) { 4749 const format = this.opts.formats[name]; 4750 if (format) 4751 this.addFormat(name, format); 4752 } 4753 } 4754 function addInitialKeywords(defs) { 4755 if (Array.isArray(defs)) { 4756 this.addVocabulary(defs); 4757 return; 4758 } 4759 this.logger.warn("keywords option as map is deprecated, pass array"); 4760 for (const keyword in defs) { 4761 const def = defs[keyword]; 4762 if (!def.keyword) 4763 def.keyword = keyword; 4764 this.addKeyword(def); 4765 } 4766 } 4767 function getMetaSchemaOptions() { 4768 const metaOpts = { ...this.opts }; 4769 for (const opt of META_IGNORE_OPTIONS) 4770 delete metaOpts[opt]; 4771 return metaOpts; 4772 } 4773 var noLogs = { log() { 4774 }, warn() { 4775 }, error() { 4776 } }; 4777 function getLogger(logger) { 4778 if (logger === false) 4779 return noLogs; 4780 if (logger === void 0) 4781 return console; 4782 if (logger.log && logger.warn && logger.error) 4783 return logger; 4784 throw new Error("logger must implement log, warn and error methods"); 4785 } 4786 var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; 4787 function checkKeyword(keyword, def) { 4788 const { RULES } = this; 4789 (0, util_1.eachItem)(keyword, (kwd) => { 4790 if (RULES.keywords[kwd]) 4791 throw new Error(`Keyword $kwd} is already defined`); 4792 if (!KEYWORD_NAME.test(kwd)) 4793 throw new Error(`Keyword $kwd} has invalid name`); 4794 }); 4795 if (!def) 4796 return; 4797 if (def.$data && !("code" in def || "validate" in def)) { 4798 throw new Error('$data keyword must have "code" or "validate" function'); 4799 } 4800 } 4801 function addRule(keyword, definition, dataType) { 4802 var _a; 4803 const post = definition === null || definition === void 0 ? void 0 : definition.post; 4804 if (dataType && post) 4805 throw new Error('keyword with "post" flag cannot have "type"'); 4806 const { RULES } = this; 4807 let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); 4808 if (!ruleGroup) { 4809 ruleGroup = { type: dataType, rules: [] }; 4810 RULES.rules.push(ruleGroup); 4811 } 4812 RULES.keywords[keyword] = true; 4813 if (!definition) 4814 return; 4815 const rule = { 4816 keyword, 4817 definition: { 4818 ...definition, 4819 type: (0, dataType_1.getJSONTypes)(definition.type), 4820 schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType) 4821 } 4822 }; 4823 if (definition.before) 4824 addBeforeRule.call(this, ruleGroup, rule, definition.before); 4825 else 4826 ruleGroup.rules.push(rule); 4827 RULES.all[keyword] = rule; 4828 (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd)); 4829 } 4830 function addBeforeRule(ruleGroup, rule, before) { 4831 const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); 4832 if (i >= 0) { 4833 ruleGroup.rules.splice(i, 0, rule); 4834 } else { 4835 ruleGroup.rules.push(rule); 4836 this.logger.warn(`rule $before} is not defined`); 4837 } 4838 } 4839 function keywordMetaschema(def) { 4840 let { metaSchema } = def; 4841 if (metaSchema === void 0) 4842 return; 4843 if (def.$data && this.opts.$data) 4844 metaSchema = schemaOrData(metaSchema); 4845 def.validateSchema = this.compile(metaSchema, true); 4846 } 4847 var $dataRef = { 4848 $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" 4849 }; 4850 function schemaOrData(schema) { 4851 return { anyOf: [schema, $dataRef] }; 4852 } 4853 } 4854 }); 4855 4856 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/core/ref.js 4857 var require_ref = __commonJS({ 4858 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) { 4859 "use strict"; 4860 Object.defineProperty(exports, "__esModule", { value: true }); 4861 exports.callRef = exports.getValidate = void 0; 4862 var ref_error_1 = require_ref_error(); 4863 var code_1 = require_code2(); 4864 var codegen_1 = require_codegen(); 4865 var names_1 = require_names(); 4866 var compile_1 = require_compile(); 4867 var util_1 = require_util(); 4868 var def = { 4869 keyword: "$ref", 4870 schemaType: "string", 4871 code(cxt) { 4872 const { gen, schema: $ref, it } = cxt; 4873 const { baseId, schemaEnv: env, validateName, opts, self } = it; 4874 const { root } = env; 4875 if (($ref === "#" || $ref === "#/") && baseId === root.baseId) 4876 return callRootRef(); 4877 const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref); 4878 if (schOrEnv === void 0) 4879 throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); 4880 if (schOrEnv instanceof compile_1.SchemaEnv) 4881 return callValidate(schOrEnv); 4882 return inlineRefSchema(schOrEnv); 4883 function callRootRef() { 4884 if (env === root) 4885 return callRef(cxt, validateName, env, env.$async); 4886 const rootName = gen.scopeValue("root", { ref: root }); 4887 return callRef(cxt, (0, codegen_1._)`$rootName}.validate`, root, root.$async); 4888 } 4889 function callValidate(sch) { 4890 const v = getValidate(cxt, sch); 4891 callRef(cxt, v, sch, sch.$async); 4892 } 4893 function inlineRefSchema(sch) { 4894 const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); 4895 const valid = gen.name("valid"); 4896 const schCxt = cxt.subschema({ 4897 schema: sch, 4898 dataTypes: [], 4899 schemaPath: codegen_1.nil, 4900 topSchemaRef: schName, 4901 errSchemaPath: $ref 4902 }, valid); 4903 cxt.mergeEvaluated(schCxt); 4904 cxt.ok(valid); 4905 } 4906 } 4907 }; 4908 function getValidate(cxt, sch) { 4909 const { gen } = cxt; 4910 return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`$gen.scopeValue("wrapper", { ref: sch })}.validate`; 4911 } 4912 exports.getValidate = getValidate; 4913 function callRef(cxt, v, sch, $async) { 4914 const { gen, it } = cxt; 4915 const { allErrors, schemaEnv: env, opts } = it; 4916 const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; 4917 if ($async) 4918 callAsyncRef(); 4919 else 4920 callSyncRef(); 4921 function callAsyncRef() { 4922 if (!env.$async) 4923 throw new Error("async schema referenced by sync schema"); 4924 const valid = gen.let("valid"); 4925 gen.try(() => { 4926 gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); 4927 addEvaluatedFrom(v); 4928 if (!allErrors) 4929 gen.assign(valid, true); 4930 }, (e) => { 4931 gen.if((0, codegen_1._)`!($e} instanceof $it.ValidationError})`, () => gen.throw(e)); 4932 addErrorsFrom(e); 4933 if (!allErrors) 4934 gen.assign(valid, false); 4935 }); 4936 cxt.ok(valid); 4937 } 4938 function callSyncRef() { 4939 cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); 4940 } 4941 function addErrorsFrom(source) { 4942 const errs = (0, codegen_1._)`$source}.errors`; 4943 gen.assign(names_1.default.vErrors, (0, codegen_1._)`$names_1.default.vErrors} === null ? $errs} : $names_1.default.vErrors}.concat($errs})`); 4944 gen.assign(names_1.default.errors, (0, codegen_1._)`$names_1.default.vErrors}.length`); 4945 } 4946 function addEvaluatedFrom(source) { 4947 var _a; 4948 if (!it.opts.unevaluated) 4949 return; 4950 const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; 4951 if (it.props !== true) { 4952 if (schEvaluated && !schEvaluated.dynamicProps) { 4953 if (schEvaluated.props !== void 0) { 4954 it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); 4955 } 4956 } else { 4957 const props = gen.var("props", (0, codegen_1._)`$source}.evaluated.props`); 4958 it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); 4959 } 4960 } 4961 if (it.items !== true) { 4962 if (schEvaluated && !schEvaluated.dynamicItems) { 4963 if (schEvaluated.items !== void 0) { 4964 it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); 4965 } 4966 } else { 4967 const items = gen.var("items", (0, codegen_1._)`$source}.evaluated.items`); 4968 it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); 4969 } 4970 } 4971 } 4972 } 4973 exports.callRef = callRef; 4974 exports.default = def; 4975 } 4976 }); 4977 4978 // node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/core.js 4979 var require_core2 = __commonJS({ 4980 "node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/core.js"(exports) { 4981 "use strict"; 4982 Object.defineProperty(exports, "__esModule", { value: true }); 4983 var ref_1 = require_ref(); 4984 var core = [ 4985 "$schema", 4986 "id", 4987 "$defs", 4988 { keyword: "$comment" }, 4989 "definitions", 4990 ref_1.default 4991 ]; 4992 exports.default = core; 4993 } 4994 }); 4995 4996 // node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js 4997 var require_limitNumber = __commonJS({ 4998 "node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js"(exports) { 4999 "use strict"; 5000 Object.defineProperty(exports, "__esModule", { value: true }); 5001 var core_1 = require_core(); 5002 var codegen_1 = require_codegen(); 5003 var ops = codegen_1.operators; 5004 var KWDs = { 5005 maximum: { 5006 exclusive: "exclusiveMaximum", 5007 ops: [ 5008 { okStr: "<=", ok: ops.LTE, fail: ops.GT }, 5009 { okStr: "<", ok: ops.LT, fail: ops.GTE } 5010 ] 5011 }, 5012 minimum: { 5013 exclusive: "exclusiveMinimum", 5014 ops: [ 5015 { okStr: ">=", ok: ops.GTE, fail: ops.LT }, 5016 { okStr: ">", ok: ops.GT, fail: ops.LTE } 5017 ] 5018 } 5019 }; 5020 var error = { 5021 message: (cxt) => core_1.str`must be $kwdOp(cxt).okStr} $cxt.schemaCode}`, 5022 params: (cxt) => core_1._`{comparison: $kwdOp(cxt).okStr}, limit: $cxt.schemaCode}}` 5023 }; 5024 var def = { 5025 keyword: Object.keys(KWDs), 5026 type: "number", 5027 schemaType: "number", 5028 $data: true, 5029 error, 5030 code(cxt) { 5031 const { data, schemaCode } = cxt; 5032 cxt.fail$data(core_1._`$data} $kwdOp(cxt).fail} $schemaCode} || isNaN($data})`); 5033 } 5034 }; 5035 function kwdOp(cxt) { 5036 var _a; 5037 const keyword = cxt.keyword; 5038 const opsIdx = ((_a = cxt.parentSchema) === null || _a === void 0 ? void 0 : _a[KWDs[keyword].exclusive]) ? 1 : 0; 5039 return KWDs[keyword].ops[opsIdx]; 5040 } 5041 exports.default = def; 5042 } 5043 }); 5044 5045 // node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js 5046 var require_limitNumberExclusive = __commonJS({ 5047 "node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js"(exports) { 5048 "use strict"; 5049 Object.defineProperty(exports, "__esModule", { value: true }); 5050 var KWDs = { 5051 exclusiveMaximum: "maximum", 5052 exclusiveMinimum: "minimum" 5053 }; 5054 var def = { 5055 keyword: Object.keys(KWDs), 5056 type: "number", 5057 schemaType: "boolean", 5058 code({ keyword, parentSchema }) { 5059 const limitKwd = KWDs[keyword]; 5060 if (parentSchema[limitKwd] === void 0) { 5061 throw new Error(`$keyword} can only be used with $limitKwd}`); 5062 } 5063 } 5064 }; 5065 exports.default = def; 5066 } 5067 }); 5068 5069 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/multipleOf.js 5070 var require_multipleOf = __commonJS({ 5071 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) { 5072 "use strict"; 5073 Object.defineProperty(exports, "__esModule", { value: true }); 5074 var codegen_1 = require_codegen(); 5075 var error = { 5076 message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of $schemaCode}`, 5077 params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: $schemaCode}}` 5078 }; 5079 var def = { 5080 keyword: "multipleOf", 5081 type: "number", 5082 schemaType: "number", 5083 $data: true, 5084 error, 5085 code(cxt) { 5086 const { gen, data, schemaCode, it } = cxt; 5087 const prec = it.opts.multipleOfPrecision; 5088 const res = gen.let("res"); 5089 const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round($res}) - $res}) > 1e-$prec}` : (0, codegen_1._)`$res} !== parseInt($res})`; 5090 cxt.fail$data((0, codegen_1._)`($schemaCode} === 0 || ($res} = $data}/$schemaCode}, $invalid}))`); 5091 } 5092 }; 5093 exports.default = def; 5094 } 5095 }); 5096 5097 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/ucs2length.js 5098 var require_ucs2length = __commonJS({ 5099 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/ucs2length.js"(exports) { 5100 "use strict"; 5101 Object.defineProperty(exports, "__esModule", { value: true }); 5102 function ucs2length(str) { 5103 const len = str.length; 5104 let length = 0; 5105 let pos = 0; 5106 let value; 5107 while (pos < len) { 5108 length++; 5109 value = str.charCodeAt(pos++); 5110 if (value >= 55296 && value <= 56319 && pos < len) { 5111 value = str.charCodeAt(pos); 5112 if ((value & 64512) === 56320) 5113 pos++; 5114 } 5115 } 5116 return length; 5117 } 5118 exports.default = ucs2length; 5119 ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; 5120 } 5121 }); 5122 5123 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitLength.js 5124 var require_limitLength = __commonJS({ 5125 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) { 5126 "use strict"; 5127 Object.defineProperty(exports, "__esModule", { value: true }); 5128 var codegen_1 = require_codegen(); 5129 var util_1 = require_util(); 5130 var ucs2length_1 = require_ucs2length(); 5131 var error = { 5132 message({ keyword, schemaCode }) { 5133 const comp = keyword === "maxLength" ? "more" : "fewer"; 5134 return (0, codegen_1.str)`must NOT have $comp} than $schemaCode} characters`; 5135 }, 5136 params: ({ schemaCode }) => (0, codegen_1._)`{limit: $schemaCode}}` 5137 }; 5138 var def = { 5139 keyword: ["maxLength", "minLength"], 5140 type: "string", 5141 schemaType: "number", 5142 $data: true, 5143 error, 5144 code(cxt) { 5145 const { keyword, data, schemaCode, it } = cxt; 5146 const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; 5147 const len = it.opts.unicode === false ? (0, codegen_1._)`$data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}($data})`; 5148 cxt.fail$data((0, codegen_1._)`$len} $op} $schemaCode}`); 5149 } 5150 }; 5151 exports.default = def; 5152 } 5153 }); 5154 5155 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/pattern.js 5156 var require_pattern = __commonJS({ 5157 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) { 5158 "use strict"; 5159 Object.defineProperty(exports, "__esModule", { value: true }); 5160 var code_1 = require_code2(); 5161 var util_1 = require_util(); 5162 var codegen_1 = require_codegen(); 5163 var error = { 5164 message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "$schemaCode}"`, 5165 params: ({ schemaCode }) => (0, codegen_1._)`{pattern: $schemaCode}}` 5166 }; 5167 var def = { 5168 keyword: "pattern", 5169 type: "string", 5170 schemaType: "string", 5171 $data: true, 5172 error, 5173 code(cxt) { 5174 const { gen, data, $data, schema, schemaCode, it } = cxt; 5175 const u = it.opts.unicodeRegExp ? "u" : ""; 5176 if ($data) { 5177 const { regExp } = it.opts.code; 5178 const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp); 5179 const valid = gen.let("valid"); 5180 gen.try(() => gen.assign(valid, (0, codegen_1._)`$regExpCode}($schemaCode}, $u}).test($data})`), () => gen.assign(valid, false)); 5181 cxt.fail$data((0, codegen_1._)`!$valid}`); 5182 } else { 5183 const regExp = (0, code_1.usePattern)(cxt, schema); 5184 cxt.fail$data((0, codegen_1._)`!$regExp}.test($data})`); 5185 } 5186 } 5187 }; 5188 exports.default = def; 5189 } 5190 }); 5191 5192 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitProperties.js 5193 var require_limitProperties = __commonJS({ 5194 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) { 5195 "use strict"; 5196 Object.defineProperty(exports, "__esModule", { value: true }); 5197 var codegen_1 = require_codegen(); 5198 var error = { 5199 message({ keyword, schemaCode }) { 5200 const comp = keyword === "maxProperties" ? "more" : "fewer"; 5201 return (0, codegen_1.str)`must NOT have $comp} than $schemaCode} properties`; 5202 }, 5203 params: ({ schemaCode }) => (0, codegen_1._)`{limit: $schemaCode}}` 5204 }; 5205 var def = { 5206 keyword: ["maxProperties", "minProperties"], 5207 type: "object", 5208 schemaType: "number", 5209 $data: true, 5210 error, 5211 code(cxt) { 5212 const { keyword, data, schemaCode } = cxt; 5213 const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; 5214 cxt.fail$data((0, codegen_1._)`Object.keys($data}).length $op} $schemaCode}`); 5215 } 5216 }; 5217 exports.default = def; 5218 } 5219 }); 5220 5221 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/required.js 5222 var require_required = __commonJS({ 5223 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) { 5224 "use strict"; 5225 Object.defineProperty(exports, "__esModule", { value: true }); 5226 var code_1 = require_code2(); 5227 var codegen_1 = require_codegen(); 5228 var util_1 = require_util(); 5229 var error = { 5230 message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '$missingProperty}'`, 5231 params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: $missingProperty}}` 5232 }; 5233 var def = { 5234 keyword: "required", 5235 type: "object", 5236 schemaType: "array", 5237 $data: true, 5238 error, 5239 code(cxt) { 5240 const { gen, schema, schemaCode, data, $data, it } = cxt; 5241 const { opts } = it; 5242 if (!$data && schema.length === 0) 5243 return; 5244 const useLoop = schema.length >= opts.loopRequired; 5245 if (it.allErrors) 5246 allErrorsMode(); 5247 else 5248 exitOnErrorMode(); 5249 if (opts.strictRequired) { 5250 const props = cxt.parentSchema.properties; 5251 const { definedProperties } = cxt.it; 5252 for (const requiredKey of schema) { 5253 if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) { 5254 const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; 5255 const msg = `required property "$requiredKey}" is not defined at "$schemaPath}" (strictRequired)`; 5256 (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); 5257 } 5258 } 5259 } 5260 function allErrorsMode() { 5261 if (useLoop || $data) { 5262 cxt.block$data(codegen_1.nil, loopAllRequired); 5263 } else { 5264 for (const prop of schema) { 5265 (0, code_1.checkReportMissingProp)(cxt, prop); 5266 } 5267 } 5268 } 5269 function exitOnErrorMode() { 5270 const missing = gen.let("missing"); 5271 if (useLoop || $data) { 5272 const valid = gen.let("valid", true); 5273 cxt.block$data(valid, () => loopUntilMissing(missing, valid)); 5274 cxt.ok(valid); 5275 } else { 5276 gen.if((0, code_1.checkMissingProp)(cxt, schema, missing)); 5277 (0, code_1.reportMissingProp)(cxt, missing); 5278 gen.else(); 5279 } 5280 } 5281 function loopAllRequired() { 5282 gen.forOf("prop", schemaCode, (prop) => { 5283 cxt.setParams({ missingProperty: prop }); 5284 gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); 5285 }); 5286 } 5287 function loopUntilMissing(missing, valid) { 5288 cxt.setParams({ missingProperty: missing }); 5289 gen.forOf(missing, schemaCode, () => { 5290 gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); 5291 gen.if((0, codegen_1.not)(valid), () => { 5292 cxt.error(); 5293 gen.break(); 5294 }); 5295 }, codegen_1.nil); 5296 } 5297 } 5298 }; 5299 exports.default = def; 5300 } 5301 }); 5302 5303 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitItems.js 5304 var require_limitItems = __commonJS({ 5305 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) { 5306 "use strict"; 5307 Object.defineProperty(exports, "__esModule", { value: true }); 5308 var codegen_1 = require_codegen(); 5309 var error = { 5310 message({ keyword, schemaCode }) { 5311 const comp = keyword === "maxItems" ? "more" : "fewer"; 5312 return (0, codegen_1.str)`must NOT have $comp} than $schemaCode} items`; 5313 }, 5314 params: ({ schemaCode }) => (0, codegen_1._)`{limit: $schemaCode}}` 5315 }; 5316 var def = { 5317 keyword: ["maxItems", "minItems"], 5318 type: "array", 5319 schemaType: "number", 5320 $data: true, 5321 error, 5322 code(cxt) { 5323 const { keyword, data, schemaCode } = cxt; 5324 const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; 5325 cxt.fail$data((0, codegen_1._)`$data}.length $op} $schemaCode}`); 5326 } 5327 }; 5328 exports.default = def; 5329 } 5330 }); 5331 5332 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/equal.js 5333 var require_equal = __commonJS({ 5334 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/runtime/equal.js"(exports) { 5335 "use strict"; 5336 Object.defineProperty(exports, "__esModule", { value: true }); 5337 var equal = require_fast_deep_equal(); 5338 equal.code = 'require("ajv/dist/runtime/equal").default'; 5339 exports.default = equal; 5340 } 5341 }); 5342 5343 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js 5344 var require_uniqueItems = __commonJS({ 5345 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) { 5346 "use strict"; 5347 Object.defineProperty(exports, "__esModule", { value: true }); 5348 var dataType_1 = require_dataType(); 5349 var codegen_1 = require_codegen(); 5350 var util_1 = require_util(); 5351 var equal_1 = require_equal(); 5352 var error = { 5353 message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## $j} and $i} are identical)`, 5354 params: ({ params: { i, j } }) => (0, codegen_1._)`{i: $i}, j: $j}}` 5355 }; 5356 var def = { 5357 keyword: "uniqueItems", 5358 type: "array", 5359 schemaType: "boolean", 5360 $data: true, 5361 error, 5362 code(cxt) { 5363 const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; 5364 if (!$data && !schema) 5365 return; 5366 const valid = gen.let("valid"); 5367 const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; 5368 cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`$schemaCode} === false`); 5369 cxt.ok(valid); 5370 function validateUniqueItems() { 5371 const i = gen.let("i", (0, codegen_1._)`$data}.length`); 5372 const j = gen.let("j"); 5373 cxt.setParams({ i, j }); 5374 gen.assign(valid, true); 5375 gen.if((0, codegen_1._)`$i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); 5376 } 5377 function canOptimize() { 5378 return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); 5379 } 5380 function loopN(i, j) { 5381 const item = gen.name("item"); 5382 const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); 5383 const indices = gen.const("indices", (0, codegen_1._)`{}`); 5384 gen.for((0, codegen_1._)`;$i}--;`, () => { 5385 gen.let(item, (0, codegen_1._)`$data}[$i}]`); 5386 gen.if(wrongType, (0, codegen_1._)`continue`); 5387 if (itemTypes.length > 1) 5388 gen.if((0, codegen_1._)`typeof $item} == "string"`, (0, codegen_1._)`$item} += "_"`); 5389 gen.if((0, codegen_1._)`typeof $indices}[$item}] == "number"`, () => { 5390 gen.assign(j, (0, codegen_1._)`$indices}[$item}]`); 5391 cxt.error(); 5392 gen.assign(valid, false).break(); 5393 }).code((0, codegen_1._)`$indices}[$item}] = $i}`); 5394 }); 5395 } 5396 function loopN2(i, j) { 5397 const eql = (0, util_1.useFunc)(gen, equal_1.default); 5398 const outer = gen.name("outer"); 5399 gen.label(outer).for((0, codegen_1._)`;$i}--;`, () => gen.for((0, codegen_1._)`$j} = $i}; $j}--;`, () => gen.if((0, codegen_1._)`$eql}($data}[$i}], $data}[$j}])`, () => { 5400 cxt.error(); 5401 gen.assign(valid, false).break(outer); 5402 }))); 5403 } 5404 } 5405 }; 5406 exports.default = def; 5407 } 5408 }); 5409 5410 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/const.js 5411 var require_const = __commonJS({ 5412 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) { 5413 "use strict"; 5414 Object.defineProperty(exports, "__esModule", { value: true }); 5415 var codegen_1 = require_codegen(); 5416 var util_1 = require_util(); 5417 var equal_1 = require_equal(); 5418 var error = { 5419 message: "must be equal to constant", 5420 params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: $schemaCode}}` 5421 }; 5422 var def = { 5423 keyword: "const", 5424 $data: true, 5425 error, 5426 code(cxt) { 5427 const { gen, data, $data, schemaCode, schema } = cxt; 5428 if ($data || schema && typeof schema == "object") { 5429 cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}($data}, $schemaCode})`); 5430 } else { 5431 cxt.fail((0, codegen_1._)`$schema} !== $data}`); 5432 } 5433 } 5434 }; 5435 exports.default = def; 5436 } 5437 }); 5438 5439 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/enum.js 5440 var require_enum = __commonJS({ 5441 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) { 5442 "use strict"; 5443 Object.defineProperty(exports, "__esModule", { value: true }); 5444 var codegen_1 = require_codegen(); 5445 var util_1 = require_util(); 5446 var equal_1 = require_equal(); 5447 var error = { 5448 message: "must be equal to one of the allowed values", 5449 params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: $schemaCode}}` 5450 }; 5451 var def = { 5452 keyword: "enum", 5453 schemaType: "array", 5454 $data: true, 5455 error, 5456 code(cxt) { 5457 const { gen, data, $data, schema, schemaCode, it } = cxt; 5458 if (!$data && schema.length === 0) 5459 throw new Error("enum must have non-empty array"); 5460 const useLoop = schema.length >= it.opts.loopEnum; 5461 let eql; 5462 const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default); 5463 let valid; 5464 if (useLoop || $data) { 5465 valid = gen.let("valid"); 5466 cxt.block$data(valid, loopEnum); 5467 } else { 5468 if (!Array.isArray(schema)) 5469 throw new Error("ajv implementation error"); 5470 const vSchema = gen.const("vSchema", schemaCode); 5471 valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i))); 5472 } 5473 cxt.pass(valid); 5474 function loopEnum() { 5475 gen.assign(valid, false); 5476 gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`$getEql()}($data}, $v})`, () => gen.assign(valid, true).break())); 5477 } 5478 function equalCode(vSchema, i) { 5479 const sch = schema[i]; 5480 return typeof sch === "object" && sch !== null ? (0, codegen_1._)`$getEql()}($data}, $vSchema}[$i}])` : (0, codegen_1._)`$data} === $sch}`; 5481 } 5482 } 5483 }; 5484 exports.default = def; 5485 } 5486 }); 5487 5488 // node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/validation/index.js 5489 var require_validation = __commonJS({ 5490 "node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/validation/index.js"(exports) { 5491 "use strict"; 5492 Object.defineProperty(exports, "__esModule", { value: true }); 5493 var limitNumber_1 = require_limitNumber(); 5494 var limitNumberExclusive_1 = require_limitNumberExclusive(); 5495 var multipleOf_1 = require_multipleOf(); 5496 var limitLength_1 = require_limitLength(); 5497 var pattern_1 = require_pattern(); 5498 var limitProperties_1 = require_limitProperties(); 5499 var required_1 = require_required(); 5500 var limitItems_1 = require_limitItems(); 5501 var uniqueItems_1 = require_uniqueItems(); 5502 var const_1 = require_const(); 5503 var enum_1 = require_enum(); 5504 var validation = [ 5505 // number 5506 limitNumber_1.default, 5507 limitNumberExclusive_1.default, 5508 multipleOf_1.default, 5509 // string 5510 limitLength_1.default, 5511 pattern_1.default, 5512 // object 5513 limitProperties_1.default, 5514 required_1.default, 5515 // array 5516 limitItems_1.default, 5517 uniqueItems_1.default, 5518 // any 5519 { keyword: "type", schemaType: ["string", "array"] }, 5520 { keyword: "nullable", schemaType: "boolean" }, 5521 const_1.default, 5522 enum_1.default 5523 ]; 5524 exports.default = validation; 5525 } 5526 }); 5527 5528 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js 5529 var require_additionalItems = __commonJS({ 5530 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) { 5531 "use strict"; 5532 Object.defineProperty(exports, "__esModule", { value: true }); 5533 exports.validateAdditionalItems = void 0; 5534 var codegen_1 = require_codegen(); 5535 var util_1 = require_util(); 5536 var error = { 5537 message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than $len} items`, 5538 params: ({ params: { len } }) => (0, codegen_1._)`{limit: $len}}` 5539 }; 5540 var def = { 5541 keyword: "additionalItems", 5542 type: "array", 5543 schemaType: ["boolean", "object"], 5544 before: "uniqueItems", 5545 error, 5546 code(cxt) { 5547 const { parentSchema, it } = cxt; 5548 const { items } = parentSchema; 5549 if (!Array.isArray(items)) { 5550 (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); 5551 return; 5552 } 5553 validateAdditionalItems(cxt, items); 5554 } 5555 }; 5556 function validateAdditionalItems(cxt, items) { 5557 const { gen, schema, data, keyword, it } = cxt; 5558 it.items = true; 5559 const len = gen.const("len", (0, codegen_1._)`$data}.length`); 5560 if (schema === false) { 5561 cxt.setParams({ len: items.length }); 5562 cxt.pass((0, codegen_1._)`$len} <= $items.length}`); 5563 } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { 5564 const valid = gen.var("valid", (0, codegen_1._)`$len} <= $items.length}`); 5565 gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); 5566 cxt.ok(valid); 5567 } 5568 function validateItems(valid) { 5569 gen.forRange("i", items.length, len, (i) => { 5570 cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); 5571 if (!it.allErrors) 5572 gen.if((0, codegen_1.not)(valid), () => gen.break()); 5573 }); 5574 } 5575 } 5576 exports.validateAdditionalItems = validateAdditionalItems; 5577 exports.default = def; 5578 } 5579 }); 5580 5581 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/items.js 5582 var require_items = __commonJS({ 5583 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) { 5584 "use strict"; 5585 Object.defineProperty(exports, "__esModule", { value: true }); 5586 exports.validateTuple = void 0; 5587 var codegen_1 = require_codegen(); 5588 var util_1 = require_util(); 5589 var code_1 = require_code2(); 5590 var def = { 5591 keyword: "items", 5592 type: "array", 5593 schemaType: ["object", "array", "boolean"], 5594 before: "uniqueItems", 5595 code(cxt) { 5596 const { schema, it } = cxt; 5597 if (Array.isArray(schema)) 5598 return validateTuple(cxt, "additionalItems", schema); 5599 it.items = true; 5600 if ((0, util_1.alwaysValidSchema)(it, schema)) 5601 return; 5602 cxt.ok((0, code_1.validateArray)(cxt)); 5603 } 5604 }; 5605 function validateTuple(cxt, extraItems, schArr = cxt.schema) { 5606 const { gen, parentSchema, data, keyword, it } = cxt; 5607 checkStrictTuple(parentSchema); 5608 if (it.opts.unevaluated && schArr.length && it.items !== true) { 5609 it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); 5610 } 5611 const valid = gen.name("valid"); 5612 const len = gen.const("len", (0, codegen_1._)`$data}.length`); 5613 schArr.forEach((sch, i) => { 5614 if ((0, util_1.alwaysValidSchema)(it, sch)) 5615 return; 5616 gen.if((0, codegen_1._)`$len} > $i}`, () => cxt.subschema({ 5617 keyword, 5618 schemaProp: i, 5619 dataProp: i 5620 }, valid)); 5621 cxt.ok(valid); 5622 }); 5623 function checkStrictTuple(sch) { 5624 const { opts, errSchemaPath } = it; 5625 const l = schArr.length; 5626 const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); 5627 if (opts.strictTuples && !fullTuple) { 5628 const msg = `"$keyword}" is $l}-tuple, but minItems or maxItems/$extraItems} are not specified or different at path "$errSchemaPath}"`; 5629 (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); 5630 } 5631 } 5632 } 5633 exports.validateTuple = validateTuple; 5634 exports.default = def; 5635 } 5636 }); 5637 5638 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js 5639 var require_prefixItems = __commonJS({ 5640 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) { 5641 "use strict"; 5642 Object.defineProperty(exports, "__esModule", { value: true }); 5643 var items_1 = require_items(); 5644 var def = { 5645 keyword: "prefixItems", 5646 type: "array", 5647 schemaType: ["array"], 5648 before: "uniqueItems", 5649 code: (cxt) => (0, items_1.validateTuple)(cxt, "items") 5650 }; 5651 exports.default = def; 5652 } 5653 }); 5654 5655 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/items2020.js 5656 var require_items2020 = __commonJS({ 5657 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) { 5658 "use strict"; 5659 Object.defineProperty(exports, "__esModule", { value: true }); 5660 var codegen_1 = require_codegen(); 5661 var util_1 = require_util(); 5662 var code_1 = require_code2(); 5663 var additionalItems_1 = require_additionalItems(); 5664 var error = { 5665 message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than $len} items`, 5666 params: ({ params: { len } }) => (0, codegen_1._)`{limit: $len}}` 5667 }; 5668 var def = { 5669 keyword: "items", 5670 type: "array", 5671 schemaType: ["object", "boolean"], 5672 before: "uniqueItems", 5673 error, 5674 code(cxt) { 5675 const { schema, parentSchema, it } = cxt; 5676 const { prefixItems } = parentSchema; 5677 it.items = true; 5678 if ((0, util_1.alwaysValidSchema)(it, schema)) 5679 return; 5680 if (prefixItems) 5681 (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); 5682 else 5683 cxt.ok((0, code_1.validateArray)(cxt)); 5684 } 5685 }; 5686 exports.default = def; 5687 } 5688 }); 5689 5690 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/contains.js 5691 var require_contains = __commonJS({ 5692 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) { 5693 "use strict"; 5694 Object.defineProperty(exports, "__esModule", { value: true }); 5695 var codegen_1 = require_codegen(); 5696 var util_1 = require_util(); 5697 var error = { 5698 message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least $min} valid item(s)` : (0, codegen_1.str)`must contain at least $min} and no more than $max} valid item(s)`, 5699 params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: $min}}` : (0, codegen_1._)`{minContains: $min}, maxContains: $max}}` 5700 }; 5701 var def = { 5702 keyword: "contains", 5703 type: "array", 5704 schemaType: ["object", "boolean"], 5705 before: "uniqueItems", 5706 trackErrors: true, 5707 error, 5708 code(cxt) { 5709 const { gen, schema, parentSchema, data, it } = cxt; 5710 let min; 5711 let max; 5712 const { minContains, maxContains } = parentSchema; 5713 if (it.opts.next) { 5714 min = minContains === void 0 ? 1 : minContains; 5715 max = maxContains; 5716 } else { 5717 min = 1; 5718 } 5719 const len = gen.const("len", (0, codegen_1._)`$data}.length`); 5720 cxt.setParams({ min, max }); 5721 if (max === void 0 && min === 0) { 5722 (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); 5723 return; 5724 } 5725 if (max !== void 0 && min > max) { 5726 (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); 5727 cxt.fail(); 5728 return; 5729 } 5730 if ((0, util_1.alwaysValidSchema)(it, schema)) { 5731 let cond = (0, codegen_1._)`$len} >= $min}`; 5732 if (max !== void 0) 5733 cond = (0, codegen_1._)`$cond} && $len} <= $max}`; 5734 cxt.pass(cond); 5735 return; 5736 } 5737 it.items = true; 5738 const valid = gen.name("valid"); 5739 if (max === void 0 && min === 1) { 5740 validateItems(valid, () => gen.if(valid, () => gen.break())); 5741 } else if (min === 0) { 5742 gen.let(valid, true); 5743 if (max !== void 0) 5744 gen.if((0, codegen_1._)`$data}.length > 0`, validateItemsWithCount); 5745 } else { 5746 gen.let(valid, false); 5747 validateItemsWithCount(); 5748 } 5749 cxt.result(valid, () => cxt.reset()); 5750 function validateItemsWithCount() { 5751 const schValid = gen.name("_valid"); 5752 const count = gen.let("count", 0); 5753 validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); 5754 } 5755 function validateItems(_valid, block) { 5756 gen.forRange("i", 0, len, (i) => { 5757 cxt.subschema({ 5758 keyword: "contains", 5759 dataProp: i, 5760 dataPropType: util_1.Type.Num, 5761 compositeRule: true 5762 }, _valid); 5763 block(); 5764 }); 5765 } 5766 function checkLimits(count) { 5767 gen.code((0, codegen_1._)`$count}++`); 5768 if (max === void 0) { 5769 gen.if((0, codegen_1._)`$count} >= $min}`, () => gen.assign(valid, true).break()); 5770 } else { 5771 gen.if((0, codegen_1._)`$count} > $max}`, () => gen.assign(valid, false).break()); 5772 if (min === 1) 5773 gen.assign(valid, true); 5774 else 5775 gen.if((0, codegen_1._)`$count} >= $min}`, () => gen.assign(valid, true)); 5776 } 5777 } 5778 } 5779 }; 5780 exports.default = def; 5781 } 5782 }); 5783 5784 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/dependencies.js 5785 var require_dependencies = __commonJS({ 5786 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) { 5787 "use strict"; 5788 Object.defineProperty(exports, "__esModule", { value: true }); 5789 exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; 5790 var codegen_1 = require_codegen(); 5791 var util_1 = require_util(); 5792 var code_1 = require_code2(); 5793 exports.error = { 5794 message: ({ params: { property, depsCount, deps } }) => { 5795 const property_ies = depsCount === 1 ? "property" : "properties"; 5796 return (0, codegen_1.str)`must have $property_ies} $deps} when property $property} is present`; 5797 }, 5798 params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: $property}, 5799 missingProperty: $missingProperty}, 5800 depsCount: $depsCount}, 5801 deps: $deps}}` 5802 // TODO change to reference 5803 }; 5804 var def = { 5805 keyword: "dependencies", 5806 type: "object", 5807 schemaType: "object", 5808 error: exports.error, 5809 code(cxt) { 5810 const [propDeps, schDeps] = splitDependencies(cxt); 5811 validatePropertyDeps(cxt, propDeps); 5812 validateSchemaDeps(cxt, schDeps); 5813 } 5814 }; 5815 function splitDependencies({ schema }) { 5816 const propertyDeps = {}; 5817 const schemaDeps = {}; 5818 for (const key in schema) { 5819 if (key === "__proto__") 5820 continue; 5821 const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; 5822 deps[key] = schema[key]; 5823 } 5824 return [propertyDeps, schemaDeps]; 5825 } 5826 function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { 5827 const { gen, data, it } = cxt; 5828 if (Object.keys(propertyDeps).length === 0) 5829 return; 5830 const missing = gen.let("missing"); 5831 for (const prop in propertyDeps) { 5832 const deps = propertyDeps[prop]; 5833 if (deps.length === 0) 5834 continue; 5835 const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties); 5836 cxt.setParams({ 5837 property: prop, 5838 depsCount: deps.length, 5839 deps: deps.join(", ") 5840 }); 5841 if (it.allErrors) { 5842 gen.if(hasProperty, () => { 5843 for (const depProp of deps) { 5844 (0, code_1.checkReportMissingProp)(cxt, depProp); 5845 } 5846 }); 5847 } else { 5848 gen.if((0, codegen_1._)`$hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); 5849 (0, code_1.reportMissingProp)(cxt, missing); 5850 gen.else(); 5851 } 5852 } 5853 } 5854 exports.validatePropertyDeps = validatePropertyDeps; 5855 function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { 5856 const { gen, data, keyword, it } = cxt; 5857 const valid = gen.name("valid"); 5858 for (const prop in schemaDeps) { 5859 if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) 5860 continue; 5861 gen.if( 5862 (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), 5863 () => { 5864 const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); 5865 cxt.mergeValidEvaluated(schCxt, valid); 5866 }, 5867 () => gen.var(valid, true) 5868 // TODO var 5869 ); 5870 cxt.ok(valid); 5871 } 5872 } 5873 exports.validateSchemaDeps = validateSchemaDeps; 5874 exports.default = def; 5875 } 5876 }); 5877 5878 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js 5879 var require_propertyNames = __commonJS({ 5880 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) { 5881 "use strict"; 5882 Object.defineProperty(exports, "__esModule", { value: true }); 5883 var codegen_1 = require_codegen(); 5884 var util_1 = require_util(); 5885 var error = { 5886 message: "property name must be valid", 5887 params: ({ params }) => (0, codegen_1._)`{propertyName: $params.propertyName}}` 5888 }; 5889 var def = { 5890 keyword: "propertyNames", 5891 type: "object", 5892 schemaType: ["object", "boolean"], 5893 error, 5894 code(cxt) { 5895 const { gen, schema, data, it } = cxt; 5896 if ((0, util_1.alwaysValidSchema)(it, schema)) 5897 return; 5898 const valid = gen.name("valid"); 5899 gen.forIn("key", data, (key) => { 5900 cxt.setParams({ propertyName: key }); 5901 cxt.subschema({ 5902 keyword: "propertyNames", 5903 data: key, 5904 dataTypes: ["string"], 5905 propertyName: key, 5906 compositeRule: true 5907 }, valid); 5908 gen.if((0, codegen_1.not)(valid), () => { 5909 cxt.error(true); 5910 if (!it.allErrors) 5911 gen.break(); 5912 }); 5913 }); 5914 cxt.ok(valid); 5915 } 5916 }; 5917 exports.default = def; 5918 } 5919 }); 5920 5921 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js 5922 var require_additionalProperties = __commonJS({ 5923 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) { 5924 "use strict"; 5925 Object.defineProperty(exports, "__esModule", { value: true }); 5926 var code_1 = require_code2(); 5927 var codegen_1 = require_codegen(); 5928 var names_1 = require_names(); 5929 var util_1 = require_util(); 5930 var error = { 5931 message: "must NOT have additional properties", 5932 params: ({ params }) => (0, codegen_1._)`{additionalProperty: $params.additionalProperty}}` 5933 }; 5934 var def = { 5935 keyword: "additionalProperties", 5936 type: ["object"], 5937 schemaType: ["boolean", "object"], 5938 allowUndefined: true, 5939 trackErrors: true, 5940 error, 5941 code(cxt) { 5942 const { gen, schema, parentSchema, data, errsCount, it } = cxt; 5943 if (!errsCount) 5944 throw new Error("ajv implementation error"); 5945 const { allErrors, opts } = it; 5946 it.props = true; 5947 if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema)) 5948 return; 5949 const props = (0, code_1.allSchemaProperties)(parentSchema.properties); 5950 const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); 5951 checkAdditionalProperties(); 5952 cxt.ok((0, codegen_1._)`$errsCount} === $names_1.default.errors}`); 5953 function checkAdditionalProperties() { 5954 gen.forIn("key", data, (key) => { 5955 if (!props.length && !patProps.length) 5956 additionalPropertyCode(key); 5957 else 5958 gen.if(isAdditional(key), () => additionalPropertyCode(key)); 5959 }); 5960 } 5961 function isAdditional(key) { 5962 let definedProp; 5963 if (props.length > 8) { 5964 const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); 5965 definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); 5966 } else if (props.length) { 5967 definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`$key} === $p}`)); 5968 } else { 5969 definedProp = codegen_1.nil; 5970 } 5971 if (patProps.length) { 5972 definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test($key})`)); 5973 } 5974 return (0, codegen_1.not)(definedProp); 5975 } 5976 function deleteAdditional(key) { 5977 gen.code((0, codegen_1._)`delete $data}[$key}]`); 5978 } 5979 function additionalPropertyCode(key) { 5980 if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) { 5981 deleteAdditional(key); 5982 return; 5983 } 5984 if (schema === false) { 5985 cxt.setParams({ additionalProperty: key }); 5986 cxt.error(); 5987 if (!allErrors) 5988 gen.break(); 5989 return; 5990 } 5991 if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { 5992 const valid = gen.name("valid"); 5993 if (opts.removeAdditional === "failing") { 5994 applyAdditionalSchema(key, valid, false); 5995 gen.if((0, codegen_1.not)(valid), () => { 5996 cxt.reset(); 5997 deleteAdditional(key); 5998 }); 5999 } else { 6000 applyAdditionalSchema(key, valid); 6001 if (!allErrors) 6002 gen.if((0, codegen_1.not)(valid), () => gen.break()); 6003 } 6004 } 6005 } 6006 function applyAdditionalSchema(key, valid, errors) { 6007 const subschema = { 6008 keyword: "additionalProperties", 6009 dataProp: key, 6010 dataPropType: util_1.Type.Str 6011 }; 6012 if (errors === false) { 6013 Object.assign(subschema, { 6014 compositeRule: true, 6015 createErrors: false, 6016 allErrors: false 6017 }); 6018 } 6019 cxt.subschema(subschema, valid); 6020 } 6021 } 6022 }; 6023 exports.default = def; 6024 } 6025 }); 6026 6027 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/properties.js 6028 var require_properties = __commonJS({ 6029 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) { 6030 "use strict"; 6031 Object.defineProperty(exports, "__esModule", { value: true }); 6032 var validate_1 = require_validate(); 6033 var code_1 = require_code2(); 6034 var util_1 = require_util(); 6035 var additionalProperties_1 = require_additionalProperties(); 6036 var def = { 6037 keyword: "properties", 6038 type: "object", 6039 schemaType: "object", 6040 code(cxt) { 6041 const { gen, schema, parentSchema, data, it } = cxt; 6042 if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) { 6043 additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); 6044 } 6045 const allProps = (0, code_1.allSchemaProperties)(schema); 6046 for (const prop of allProps) { 6047 it.definedProperties.add(prop); 6048 } 6049 if (it.opts.unevaluated && allProps.length && it.props !== true) { 6050 it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props); 6051 } 6052 const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); 6053 if (properties.length === 0) 6054 return; 6055 const valid = gen.name("valid"); 6056 for (const prop of properties) { 6057 if (hasDefault(prop)) { 6058 applyPropertySchema(prop); 6059 } else { 6060 gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties)); 6061 applyPropertySchema(prop); 6062 if (!it.allErrors) 6063 gen.else().var(valid, true); 6064 gen.endIf(); 6065 } 6066 cxt.it.definedProperties.add(prop); 6067 cxt.ok(valid); 6068 } 6069 function hasDefault(prop) { 6070 return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0; 6071 } 6072 function applyPropertySchema(prop) { 6073 cxt.subschema({ 6074 keyword: "properties", 6075 schemaProp: prop, 6076 dataProp: prop 6077 }, valid); 6078 } 6079 } 6080 }; 6081 exports.default = def; 6082 } 6083 }); 6084 6085 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js 6086 var require_patternProperties = __commonJS({ 6087 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) { 6088 "use strict"; 6089 Object.defineProperty(exports, "__esModule", { value: true }); 6090 var code_1 = require_code2(); 6091 var codegen_1 = require_codegen(); 6092 var util_1 = require_util(); 6093 var util_2 = require_util(); 6094 var def = { 6095 keyword: "patternProperties", 6096 type: "object", 6097 schemaType: "object", 6098 code(cxt) { 6099 const { gen, schema, data, parentSchema, it } = cxt; 6100 const { opts } = it; 6101 const patterns = (0, code_1.allSchemaProperties)(schema); 6102 const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p])); 6103 if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) { 6104 return; 6105 } 6106 const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; 6107 const valid = gen.name("valid"); 6108 if (it.props !== true && !(it.props instanceof codegen_1.Name)) { 6109 it.props = (0, util_2.evaluatedPropsToName)(gen, it.props); 6110 } 6111 const { props } = it; 6112 validatePatternProperties(); 6113 function validatePatternProperties() { 6114 for (const pat of patterns) { 6115 if (checkProperties) 6116 checkMatchingProperties(pat); 6117 if (it.allErrors) { 6118 validateProperties(pat); 6119 } else { 6120 gen.var(valid, true); 6121 validateProperties(pat); 6122 gen.if(valid); 6123 } 6124 } 6125 } 6126 function checkMatchingProperties(pat) { 6127 for (const prop in checkProperties) { 6128 if (new RegExp(pat).test(prop)) { 6129 (0, util_1.checkStrictMode)(it, `property $prop} matches pattern $pat} (use allowMatchingProperties)`); 6130 } 6131 } 6132 } 6133 function validateProperties(pat) { 6134 gen.forIn("key", data, (key) => { 6135 gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test($key})`, () => { 6136 const alwaysValid = alwaysValidPatterns.includes(pat); 6137 if (!alwaysValid) { 6138 cxt.subschema({ 6139 keyword: "patternProperties", 6140 schemaProp: pat, 6141 dataProp: key, 6142 dataPropType: util_2.Type.Str 6143 }, valid); 6144 } 6145 if (it.opts.unevaluated && props !== true) { 6146 gen.assign((0, codegen_1._)`$props}[$key}]`, true); 6147 } else if (!alwaysValid && !it.allErrors) { 6148 gen.if((0, codegen_1.not)(valid), () => gen.break()); 6149 } 6150 }); 6151 }); 6152 } 6153 } 6154 }; 6155 exports.default = def; 6156 } 6157 }); 6158 6159 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/not.js 6160 var require_not = __commonJS({ 6161 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) { 6162 "use strict"; 6163 Object.defineProperty(exports, "__esModule", { value: true }); 6164 var util_1 = require_util(); 6165 var def = { 6166 keyword: "not", 6167 schemaType: ["object", "boolean"], 6168 trackErrors: true, 6169 code(cxt) { 6170 const { gen, schema, it } = cxt; 6171 if ((0, util_1.alwaysValidSchema)(it, schema)) { 6172 cxt.fail(); 6173 return; 6174 } 6175 const valid = gen.name("valid"); 6176 cxt.subschema({ 6177 keyword: "not", 6178 compositeRule: true, 6179 createErrors: false, 6180 allErrors: false 6181 }, valid); 6182 cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); 6183 }, 6184 error: { message: "must NOT be valid" } 6185 }; 6186 exports.default = def; 6187 } 6188 }); 6189 6190 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/anyOf.js 6191 var require_anyOf = __commonJS({ 6192 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) { 6193 "use strict"; 6194 Object.defineProperty(exports, "__esModule", { value: true }); 6195 var code_1 = require_code2(); 6196 var def = { 6197 keyword: "anyOf", 6198 schemaType: "array", 6199 trackErrors: true, 6200 code: code_1.validateUnion, 6201 error: { message: "must match a schema in anyOf" } 6202 }; 6203 exports.default = def; 6204 } 6205 }); 6206 6207 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/oneOf.js 6208 var require_oneOf = __commonJS({ 6209 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) { 6210 "use strict"; 6211 Object.defineProperty(exports, "__esModule", { value: true }); 6212 var codegen_1 = require_codegen(); 6213 var util_1 = require_util(); 6214 var error = { 6215 message: "must match exactly one schema in oneOf", 6216 params: ({ params }) => (0, codegen_1._)`{passingSchemas: $params.passing}}` 6217 }; 6218 var def = { 6219 keyword: "oneOf", 6220 schemaType: "array", 6221 trackErrors: true, 6222 error, 6223 code(cxt) { 6224 const { gen, schema, parentSchema, it } = cxt; 6225 if (!Array.isArray(schema)) 6226 throw new Error("ajv implementation error"); 6227 if (it.opts.discriminator && parentSchema.discriminator) 6228 return; 6229 const schArr = schema; 6230 const valid = gen.let("valid", false); 6231 const passing = gen.let("passing", null); 6232 const schValid = gen.name("_valid"); 6233 cxt.setParams({ passing }); 6234 gen.block(validateOneOf); 6235 cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); 6236 function validateOneOf() { 6237 schArr.forEach((sch, i) => { 6238 let schCxt; 6239 if ((0, util_1.alwaysValidSchema)(it, sch)) { 6240 gen.var(schValid, true); 6241 } else { 6242 schCxt = cxt.subschema({ 6243 keyword: "oneOf", 6244 schemaProp: i, 6245 compositeRule: true 6246 }, schValid); 6247 } 6248 if (i > 0) { 6249 gen.if((0, codegen_1._)`$schValid} && $valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[$passing}, $i}]`).else(); 6250 } 6251 gen.if(schValid, () => { 6252 gen.assign(valid, true); 6253 gen.assign(passing, i); 6254 if (schCxt) 6255 cxt.mergeEvaluated(schCxt, codegen_1.Name); 6256 }); 6257 }); 6258 } 6259 } 6260 }; 6261 exports.default = def; 6262 } 6263 }); 6264 6265 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/allOf.js 6266 var require_allOf = __commonJS({ 6267 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) { 6268 "use strict"; 6269 Object.defineProperty(exports, "__esModule", { value: true }); 6270 var util_1 = require_util(); 6271 var def = { 6272 keyword: "allOf", 6273 schemaType: "array", 6274 code(cxt) { 6275 const { gen, schema, it } = cxt; 6276 if (!Array.isArray(schema)) 6277 throw new Error("ajv implementation error"); 6278 const valid = gen.name("valid"); 6279 schema.forEach((sch, i) => { 6280 if ((0, util_1.alwaysValidSchema)(it, sch)) 6281 return; 6282 const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); 6283 cxt.ok(valid); 6284 cxt.mergeEvaluated(schCxt); 6285 }); 6286 } 6287 }; 6288 exports.default = def; 6289 } 6290 }); 6291 6292 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/if.js 6293 var require_if = __commonJS({ 6294 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) { 6295 "use strict"; 6296 Object.defineProperty(exports, "__esModule", { value: true }); 6297 var codegen_1 = require_codegen(); 6298 var util_1 = require_util(); 6299 var error = { 6300 message: ({ params }) => (0, codegen_1.str)`must match "$params.ifClause}" schema`, 6301 params: ({ params }) => (0, codegen_1._)`{failingKeyword: $params.ifClause}}` 6302 }; 6303 var def = { 6304 keyword: "if", 6305 schemaType: ["object", "boolean"], 6306 trackErrors: true, 6307 error, 6308 code(cxt) { 6309 const { gen, parentSchema, it } = cxt; 6310 if (parentSchema.then === void 0 && parentSchema.else === void 0) { 6311 (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); 6312 } 6313 const hasThen = hasSchema(it, "then"); 6314 const hasElse = hasSchema(it, "else"); 6315 if (!hasThen && !hasElse) 6316 return; 6317 const valid = gen.let("valid", true); 6318 const schValid = gen.name("_valid"); 6319 validateIf(); 6320 cxt.reset(); 6321 if (hasThen && hasElse) { 6322 const ifClause = gen.let("ifClause"); 6323 cxt.setParams({ ifClause }); 6324 gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); 6325 } else if (hasThen) { 6326 gen.if(schValid, validateClause("then")); 6327 } else { 6328 gen.if((0, codegen_1.not)(schValid), validateClause("else")); 6329 } 6330 cxt.pass(valid, () => cxt.error(true)); 6331 function validateIf() { 6332 const schCxt = cxt.subschema({ 6333 keyword: "if", 6334 compositeRule: true, 6335 createErrors: false, 6336 allErrors: false 6337 }, schValid); 6338 cxt.mergeEvaluated(schCxt); 6339 } 6340 function validateClause(keyword, ifClause) { 6341 return () => { 6342 const schCxt = cxt.subschema({ keyword }, schValid); 6343 gen.assign(valid, schValid); 6344 cxt.mergeValidEvaluated(schCxt, valid); 6345 if (ifClause) 6346 gen.assign(ifClause, (0, codegen_1._)`$keyword}`); 6347 else 6348 cxt.setParams({ ifClause: keyword }); 6349 }; 6350 } 6351 } 6352 }; 6353 function hasSchema(it, keyword) { 6354 const schema = it.schema[keyword]; 6355 return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema); 6356 } 6357 exports.default = def; 6358 } 6359 }); 6360 6361 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/thenElse.js 6362 var require_thenElse = __commonJS({ 6363 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) { 6364 "use strict"; 6365 Object.defineProperty(exports, "__esModule", { value: true }); 6366 var util_1 = require_util(); 6367 var def = { 6368 keyword: ["then", "else"], 6369 schemaType: ["object", "boolean"], 6370 code({ keyword, parentSchema, it }) { 6371 if (parentSchema.if === void 0) 6372 (0, util_1.checkStrictMode)(it, `"$keyword}" without "if" is ignored`); 6373 } 6374 }; 6375 exports.default = def; 6376 } 6377 }); 6378 6379 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/index.js 6380 var require_applicator = __commonJS({ 6381 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) { 6382 "use strict"; 6383 Object.defineProperty(exports, "__esModule", { value: true }); 6384 var additionalItems_1 = require_additionalItems(); 6385 var prefixItems_1 = require_prefixItems(); 6386 var items_1 = require_items(); 6387 var items2020_1 = require_items2020(); 6388 var contains_1 = require_contains(); 6389 var dependencies_1 = require_dependencies(); 6390 var propertyNames_1 = require_propertyNames(); 6391 var additionalProperties_1 = require_additionalProperties(); 6392 var properties_1 = require_properties(); 6393 var patternProperties_1 = require_patternProperties(); 6394 var not_1 = require_not(); 6395 var anyOf_1 = require_anyOf(); 6396 var oneOf_1 = require_oneOf(); 6397 var allOf_1 = require_allOf(); 6398 var if_1 = require_if(); 6399 var thenElse_1 = require_thenElse(); 6400 function getApplicator(draft2020 = false) { 6401 const applicator = [ 6402 // any 6403 not_1.default, 6404 anyOf_1.default, 6405 oneOf_1.default, 6406 allOf_1.default, 6407 if_1.default, 6408 thenElse_1.default, 6409 // object 6410 propertyNames_1.default, 6411 additionalProperties_1.default, 6412 dependencies_1.default, 6413 properties_1.default, 6414 patternProperties_1.default 6415 ]; 6416 if (draft2020) 6417 applicator.push(prefixItems_1.default, items2020_1.default); 6418 else 6419 applicator.push(additionalItems_1.default, items_1.default); 6420 applicator.push(contains_1.default); 6421 return applicator; 6422 } 6423 exports.default = getApplicator; 6424 } 6425 }); 6426 6427 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/format/format.js 6428 var require_format = __commonJS({ 6429 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/format/format.js"(exports) { 6430 "use strict"; 6431 Object.defineProperty(exports, "__esModule", { value: true }); 6432 var codegen_1 = require_codegen(); 6433 var error = { 6434 message: ({ schemaCode }) => (0, codegen_1.str)`must match format "$schemaCode}"`, 6435 params: ({ schemaCode }) => (0, codegen_1._)`{format: $schemaCode}}` 6436 }; 6437 var def = { 6438 keyword: "format", 6439 type: ["number", "string"], 6440 schemaType: "string", 6441 $data: true, 6442 error, 6443 code(cxt, ruleType) { 6444 const { gen, data, $data, schema, schemaCode, it } = cxt; 6445 const { opts, errSchemaPath, schemaEnv, self } = it; 6446 if (!opts.validateFormats) 6447 return; 6448 if ($data) 6449 validate$DataFormat(); 6450 else 6451 validateFormat(); 6452 function validate$DataFormat() { 6453 const fmts = gen.scopeValue("formats", { 6454 ref: self.formats, 6455 code: opts.code.formats 6456 }); 6457 const fDef = gen.const("fDef", (0, codegen_1._)`$fmts}[$schemaCode}]`); 6458 const fType = gen.let("fType"); 6459 const format = gen.let("format"); 6460 gen.if((0, codegen_1._)`typeof $fDef} == "object" && !($fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`$fDef}.type || "string"`).assign(format, (0, codegen_1._)`$fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef)); 6461 cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); 6462 function unknownFmt() { 6463 if (opts.strictSchema === false) 6464 return codegen_1.nil; 6465 return (0, codegen_1._)`$schemaCode} && !$format}`; 6466 } 6467 function invalidFmt() { 6468 const callFormat = schemaEnv.$async ? (0, codegen_1._)`($fDef}.async ? await $format}($data}) : $format}($data}))` : (0, codegen_1._)`$format}($data})`; 6469 const validData = (0, codegen_1._)`(typeof $format} == "function" ? $callFormat} : $format}.test($data}))`; 6470 return (0, codegen_1._)`$format} && $format} !== true && $fType} === $ruleType} && !$validData}`; 6471 } 6472 } 6473 function validateFormat() { 6474 const formatDef = self.formats[schema]; 6475 if (!formatDef) { 6476 unknownFormat(); 6477 return; 6478 } 6479 if (formatDef === true) 6480 return; 6481 const [fmtType, format, fmtRef] = getFormat(formatDef); 6482 if (fmtType === ruleType) 6483 cxt.pass(validCondition()); 6484 function unknownFormat() { 6485 if (opts.strictSchema === false) { 6486 self.logger.warn(unknownMsg()); 6487 return; 6488 } 6489 throw new Error(unknownMsg()); 6490 function unknownMsg() { 6491 return `unknown format "$schema}" ignored in schema at path "$errSchemaPath}"`; 6492 } 6493 } 6494 function getFormat(fmtDef) { 6495 const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`$opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0; 6496 const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); 6497 if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { 6498 return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`$fmt}.validate`]; 6499 } 6500 return ["string", fmtDef, fmt]; 6501 } 6502 function validCondition() { 6503 if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { 6504 if (!schemaEnv.$async) 6505 throw new Error("async format in sync schema"); 6506 return (0, codegen_1._)`await $fmtRef}($data})`; 6507 } 6508 return typeof format == "function" ? (0, codegen_1._)`$fmtRef}($data})` : (0, codegen_1._)`$fmtRef}.test($data})`; 6509 } 6510 } 6511 } 6512 }; 6513 exports.default = def; 6514 } 6515 }); 6516 6517 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/format/index.js 6518 var require_format2 = __commonJS({ 6519 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/format/index.js"(exports) { 6520 "use strict"; 6521 Object.defineProperty(exports, "__esModule", { value: true }); 6522 var format_1 = require_format(); 6523 var format = [format_1.default]; 6524 exports.default = format; 6525 } 6526 }); 6527 6528 // node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/draft4.js 6529 var require_draft4 = __commonJS({ 6530 "node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/vocabulary/draft4.js"(exports) { 6531 "use strict"; 6532 Object.defineProperty(exports, "__esModule", { value: true }); 6533 var core_1 = require_core2(); 6534 var validation_1 = require_validation(); 6535 var applicator_1 = require_applicator(); 6536 var format_1 = require_format2(); 6537 var metadataVocabulary = ["title", "description", "default"]; 6538 var draft4Vocabularies = [ 6539 core_1.default, 6540 validation_1.default, 6541 applicator_1.default(), 6542 format_1.default, 6543 metadataVocabulary 6544 ]; 6545 exports.default = draft4Vocabularies; 6546 } 6547 }); 6548 6549 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/discriminator/types.js 6550 var require_types = __commonJS({ 6551 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) { 6552 "use strict"; 6553 Object.defineProperty(exports, "__esModule", { value: true }); 6554 exports.DiscrError = void 0; 6555 var DiscrError; 6556 (function(DiscrError2) { 6557 DiscrError2["Tag"] = "tag"; 6558 DiscrError2["Mapping"] = "mapping"; 6559 })(DiscrError || (exports.DiscrError = DiscrError = {})); 6560 } 6561 }); 6562 6563 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/discriminator/index.js 6564 var require_discriminator = __commonJS({ 6565 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) { 6566 "use strict"; 6567 Object.defineProperty(exports, "__esModule", { value: true }); 6568 var codegen_1 = require_codegen(); 6569 var types_1 = require_types(); 6570 var compile_1 = require_compile(); 6571 var ref_error_1 = require_ref_error(); 6572 var util_1 = require_util(); 6573 var error = { 6574 message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "$tagName}" must be string` : `value of tag "$tagName}" must be in oneOf`, 6575 params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: $discrError}, tag: $tagName}, tagValue: $tag}}` 6576 }; 6577 var def = { 6578 keyword: "discriminator", 6579 type: "object", 6580 schemaType: "object", 6581 error, 6582 code(cxt) { 6583 const { gen, data, schema, parentSchema, it } = cxt; 6584 const { oneOf } = parentSchema; 6585 if (!it.opts.discriminator) { 6586 throw new Error("discriminator: requires discriminator option"); 6587 } 6588 const tagName = schema.propertyName; 6589 if (typeof tagName != "string") 6590 throw new Error("discriminator: requires propertyName"); 6591 if (schema.mapping) 6592 throw new Error("discriminator: mapping is not supported"); 6593 if (!oneOf) 6594 throw new Error("discriminator: requires oneOf keyword"); 6595 const valid = gen.let("valid", false); 6596 const tag = gen.const("tag", (0, codegen_1._)`$data}${(0, codegen_1.getProperty)(tagName)}`); 6597 gen.if((0, codegen_1._)`typeof $tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); 6598 cxt.ok(valid); 6599 function validateMapping() { 6600 const mapping = getMapping(); 6601 gen.if(false); 6602 for (const tagValue in mapping) { 6603 gen.elseIf((0, codegen_1._)`$tag} === $tagValue}`); 6604 gen.assign(valid, applyTagSchema(mapping[tagValue])); 6605 } 6606 gen.else(); 6607 cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); 6608 gen.endIf(); 6609 } 6610 function applyTagSchema(schemaProp) { 6611 const _valid = gen.name("valid"); 6612 const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); 6613 cxt.mergeEvaluated(schCxt, codegen_1.Name); 6614 return _valid; 6615 } 6616 function getMapping() { 6617 var _a; 6618 const oneOfMapping = {}; 6619 const topRequired = hasRequired(parentSchema); 6620 let tagRequired = true; 6621 for (let i = 0; i < oneOf.length; i++) { 6622 let sch = oneOf[i]; 6623 if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { 6624 const ref = sch.$ref; 6625 sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); 6626 if (sch instanceof compile_1.SchemaEnv) 6627 sch = sch.schema; 6628 if (sch === void 0) 6629 throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); 6630 } 6631 const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; 6632 if (typeof propSch != "object") { 6633 throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/$tagName}"`); 6634 } 6635 tagRequired = tagRequired && (topRequired || hasRequired(sch)); 6636 addMappings(propSch, i); 6637 } 6638 if (!tagRequired) 6639 throw new Error(`discriminator: "$tagName}" must be required`); 6640 return oneOfMapping; 6641 function hasRequired({ required }) { 6642 return Array.isArray(required) && required.includes(tagName); 6643 } 6644 function addMappings(sch, i) { 6645 if (sch.const) { 6646 addMapping(sch.const, i); 6647 } else if (sch.enum) { 6648 for (const tagValue of sch.enum) { 6649 addMapping(tagValue, i); 6650 } 6651 } else { 6652 throw new Error(`discriminator: "properties/$tagName}" must have "const" or "enum"`); 6653 } 6654 } 6655 function addMapping(tagValue, i) { 6656 if (typeof tagValue != "string" || tagValue in oneOfMapping) { 6657 throw new Error(`discriminator: "$tagName}" values must be unique strings`); 6658 } 6659 oneOfMapping[tagValue] = i; 6660 } 6661 } 6662 } 6663 }; 6664 exports.default = def; 6665 } 6666 }); 6667 6668 // node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json 6669 var require_json_schema_draft_04 = __commonJS({ 6670 "node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json"(exports, module) { 6671 module.exports = { 6672 id: "http://json-schema.org/draft-04/schema#", 6673 $schema: "http://json-schema.org/draft-04/schema#", 6674 description: "Core schema meta-schema", 6675 definitions: { 6676 schemaArray: { 6677 type: "array", 6678 minItems: 1, 6679 items: { $ref: "#" } 6680 }, 6681 positiveInteger: { 6682 type: "integer", 6683 minimum: 0 6684 }, 6685 positiveIntegerDefault0: { 6686 allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] 6687 }, 6688 simpleTypes: { 6689 enum: ["array", "boolean", "integer", "null", "number", "object", "string"] 6690 }, 6691 stringArray: { 6692 type: "array", 6693 items: { type: "string" }, 6694 minItems: 1, 6695 uniqueItems: true 6696 } 6697 }, 6698 type: "object", 6699 properties: { 6700 id: { 6701 type: "string", 6702 format: "uri" 6703 }, 6704 $schema: { 6705 type: "string", 6706 format: "uri" 6707 }, 6708 title: { 6709 type: "string" 6710 }, 6711 description: { 6712 type: "string" 6713 }, 6714 default: {}, 6715 multipleOf: { 6716 type: "number", 6717 minimum: 0, 6718 exclusiveMinimum: true 6719 }, 6720 maximum: { 6721 type: "number" 6722 }, 6723 exclusiveMaximum: { 6724 type: "boolean", 6725 default: false 6726 }, 6727 minimum: { 6728 type: "number" 6729 }, 6730 exclusiveMinimum: { 6731 type: "boolean", 6732 default: false 6733 }, 6734 maxLength: { $ref: "#/definitions/positiveInteger" }, 6735 minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, 6736 pattern: { 6737 type: "string", 6738 format: "regex" 6739 }, 6740 additionalItems: { 6741 anyOf: [{ type: "boolean" }, { $ref: "#" }], 6742 default: {} 6743 }, 6744 items: { 6745 anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], 6746 default: {} 6747 }, 6748 maxItems: { $ref: "#/definitions/positiveInteger" }, 6749 minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, 6750 uniqueItems: { 6751 type: "boolean", 6752 default: false 6753 }, 6754 maxProperties: { $ref: "#/definitions/positiveInteger" }, 6755 minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, 6756 required: { $ref: "#/definitions/stringArray" }, 6757 additionalProperties: { 6758 anyOf: [{ type: "boolean" }, { $ref: "#" }], 6759 default: {} 6760 }, 6761 definitions: { 6762 type: "object", 6763 additionalProperties: { $ref: "#" }, 6764 default: {} 6765 }, 6766 properties: { 6767 type: "object", 6768 additionalProperties: { $ref: "#" }, 6769 default: {} 6770 }, 6771 patternProperties: { 6772 type: "object", 6773 additionalProperties: { $ref: "#" }, 6774 default: {} 6775 }, 6776 dependencies: { 6777 type: "object", 6778 additionalProperties: { 6779 anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] 6780 } 6781 }, 6782 enum: { 6783 type: "array", 6784 minItems: 1, 6785 uniqueItems: true 6786 }, 6787 type: { 6788 anyOf: [ 6789 { $ref: "#/definitions/simpleTypes" }, 6790 { 6791 type: "array", 6792 items: { $ref: "#/definitions/simpleTypes" }, 6793 minItems: 1, 6794 uniqueItems: true 6795 } 6796 ] 6797 }, 6798 allOf: { $ref: "#/definitions/schemaArray" }, 6799 anyOf: { $ref: "#/definitions/schemaArray" }, 6800 oneOf: { $ref: "#/definitions/schemaArray" }, 6801 not: { $ref: "#" } 6802 }, 6803 dependencies: { 6804 exclusiveMaximum: ["maximum"], 6805 exclusiveMinimum: ["minimum"] 6806 }, 6807 default: {} 6808 }; 6809 } 6810 }); 6811 6812 // node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/index.js 6813 var require_dist = __commonJS({ 6814 "node_modules/.store/ajv-draft-04@1.0.0-joyYjBSTrz9gMnM5GaNOrg/node_modules/ajv-draft-04/dist/index.js"(exports, module) { 6815 "use strict"; 6816 Object.defineProperty(exports, "__esModule", { value: true }); 6817 exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; 6818 var core_1 = require_core(); 6819 var draft4_1 = require_draft4(); 6820 var discriminator_1 = require_discriminator(); 6821 var draft4MetaSchema = require_json_schema_draft_04(); 6822 var META_SUPPORT_DATA = ["/properties"]; 6823 var META_SCHEMA_ID = "http://json-schema.org/draft-04/schema"; 6824 var Ajv2 = class extends core_1.default { 6825 constructor(opts = {}) { 6826 super({ 6827 ...opts, 6828 schemaId: "id" 6829 }); 6830 } 6831 _addVocabularies() { 6832 super._addVocabularies(); 6833 draft4_1.default.forEach((v) => this.addVocabulary(v)); 6834 if (this.opts.discriminator) 6835 this.addKeyword(discriminator_1.default); 6836 } 6837 _addDefaultMetaSchema() { 6838 super._addDefaultMetaSchema(); 6839 if (!this.opts.meta) 6840 return; 6841 const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft4MetaSchema, META_SUPPORT_DATA) : draft4MetaSchema; 6842 this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); 6843 this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; 6844 } 6845 defaultMeta() { 6846 return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); 6847 } 6848 }; 6849 module.exports = exports = Ajv2; 6850 Object.defineProperty(exports, "__esModule", { value: true }); 6851 exports.default = Ajv2; 6852 var core_2 = require_core(); 6853 Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { 6854 return core_2.KeywordCxt; 6855 } }); 6856 var core_3 = require_core(); 6857 Object.defineProperty(exports, "_", { enumerable: true, get: function() { 6858 return core_3._; 6859 } }); 6860 Object.defineProperty(exports, "str", { enumerable: true, get: function() { 6861 return core_3.str; 6862 } }); 6863 Object.defineProperty(exports, "stringify", { enumerable: true, get: function() { 6864 return core_3.stringify; 6865 } }); 6866 Object.defineProperty(exports, "nil", { enumerable: true, get: function() { 6867 return core_3.nil; 6868 } }); 6869 Object.defineProperty(exports, "Name", { enumerable: true, get: function() { 6870 return core_3.Name; 6871 } }); 6872 Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() { 6873 return core_3.CodeGen; 6874 } }); 6875 } 6876 }); 6877 6878 // node_modules/.store/ajv-formats@3.0.1-bzwSgpJXIxM-cV51Zu75YA/node_modules/ajv-formats/dist/formats.js 6879 var require_formats = __commonJS({ 6880 "node_modules/.store/ajv-formats@3.0.1-bzwSgpJXIxM-cV51Zu75YA/node_modules/ajv-formats/dist/formats.js"(exports) { 6881 "use strict"; 6882 Object.defineProperty(exports, "__esModule", { value: true }); 6883 exports.formatNames = exports.fastFormats = exports.fullFormats = void 0; 6884 function fmtDef(validate, compare) { 6885 return { validate, compare }; 6886 } 6887 exports.fullFormats = { 6888 // date: http://tools.ietf.org/html/rfc3339#section-5.6 6889 date: fmtDef(date, compareDate), 6890 // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 6891 time: fmtDef(getTime(true), compareTime), 6892 "date-time": fmtDef(getDateTime(true), compareDateTime), 6893 "iso-time": fmtDef(getTime(), compareIsoTime), 6894 "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime), 6895 // duration: https://tools.ietf.org/html/rfc3339#appendix-A 6896 duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, 6897 uri, 6898 "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, 6899 // uri-template: https://tools.ietf.org/html/rfc6570 6900 "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, 6901 // For the source: https://gist.github.com/dperini/729294 6902 // For test cases: https://mathiasbynens.be/demo/url-regex 6903 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, 6904 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, 6905 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, 6906 // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html 6907 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)$/, 6908 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, 6909 regex, 6910 // uuid: http://tools.ietf.org/html/rfc4122 6911 uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, 6912 // JSON-pointer: https://tools.ietf.org/html/rfc6901 6913 // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A 6914 "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, 6915 "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, 6916 // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 6917 "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, 6918 // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types 6919 // byte: https://github.com/miguelmota/is-base64 6920 byte, 6921 // signed 32 bit integer 6922 int32: { type: "number", validate: validateInt32 }, 6923 // signed 64 bit integer 6924 int64: { type: "number", validate: validateInt64 }, 6925 // C-type float 6926 float: { type: "number", validate: validateNumber }, 6927 // C-type double 6928 double: { type: "number", validate: validateNumber }, 6929 // hint to the UI to hide input strings 6930 password: true, 6931 // unchecked string payload 6932 binary: true 6933 }; 6934 exports.fastFormats = { 6935 ...exports.fullFormats, 6936 date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate), 6937 time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime), 6938 "date-time": fmtDef(/^\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, compareDateTime), 6939 "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime), 6940 "iso-date-time": fmtDef(/^\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, compareIsoDateTime), 6941 // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js 6942 uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, 6943 "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, 6944 // email (sources from jsen validator): 6945 // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 6946 // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation') 6947 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 6948 }; 6949 exports.formatNames = Object.keys(exports.fullFormats); 6950 function isLeapYear(year) { 6951 return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); 6952 } 6953 var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; 6954 var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 6955 function date(str) { 6956 const matches = DATE.exec(str); 6957 if (!matches) 6958 return false; 6959 const year = +matches[1]; 6960 const month = +matches[2]; 6961 const day = +matches[3]; 6962 return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]); 6963 } 6964 function compareDate(d1, d2) { 6965 if (!(d1 && d2)) 6966 return void 0; 6967 if (d1 > d2) 6968 return 1; 6969 if (d1 < d2) 6970 return -1; 6971 return 0; 6972 } 6973 var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i; 6974 function getTime(strictTimeZone) { 6975 return function time(str) { 6976 const matches = TIME.exec(str); 6977 if (!matches) 6978 return false; 6979 const hr = +matches[1]; 6980 const min = +matches[2]; 6981 const sec = +matches[3]; 6982 const tz = matches[4]; 6983 const tzSign = matches[5] === "-" ? -1 : 1; 6984 const tzH = +(matches[6] || 0); 6985 const tzM = +(matches[7] || 0); 6986 if (tzH > 23 || tzM > 59 || strictTimeZone && !tz) 6987 return false; 6988 if (hr <= 23 && min <= 59 && sec < 60) 6989 return true; 6990 const utcMin = min - tzM * tzSign; 6991 const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0); 6992 return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61; 6993 }; 6994 } 6995 function compareTime(s1, s2) { 6996 if (!(s1 && s2)) 6997 return void 0; 6998 const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf(); 6999 const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf(); 7000 if (!(t1 && t2)) 7001 return void 0; 7002 return t1 - t2; 7003 } 7004 function compareIsoTime(t1, t2) { 7005 if (!(t1 && t2)) 7006 return void 0; 7007 const a1 = TIME.exec(t1); 7008 const a2 = TIME.exec(t2); 7009 if (!(a1 && a2)) 7010 return void 0; 7011 t1 = a1[1] + a1[2] + a1[3]; 7012 t2 = a2[1] + a2[2] + a2[3]; 7013 if (t1 > t2) 7014 return 1; 7015 if (t1 < t2) 7016 return -1; 7017 return 0; 7018 } 7019 var DATE_TIME_SEPARATOR = /t|\s/i; 7020 function getDateTime(strictTimeZone) { 7021 const time = getTime(strictTimeZone); 7022 return function date_time(str) { 7023 const dateTime = str.split(DATE_TIME_SEPARATOR); 7024 return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]); 7025 }; 7026 } 7027 function compareDateTime(dt1, dt2) { 7028 if (!(dt1 && dt2)) 7029 return void 0; 7030 const d1 = new Date(dt1).valueOf(); 7031 const d2 = new Date(dt2).valueOf(); 7032 if (!(d1 && d2)) 7033 return void 0; 7034 return d1 - d2; 7035 } 7036 function compareIsoDateTime(dt1, dt2) { 7037 if (!(dt1 && dt2)) 7038 return void 0; 7039 const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR); 7040 const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR); 7041 const res = compareDate(d1, d2); 7042 if (res === void 0) 7043 return void 0; 7044 return res || compareTime(t1, t2); 7045 } 7046 var NOT_URI_FRAGMENT = /\/|:/; 7047 var URI = /^(?:[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; 7048 function uri(str) { 7049 return NOT_URI_FRAGMENT.test(str) && URI.test(str); 7050 } 7051 var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm; 7052 function byte(str) { 7053 BYTE.lastIndex = 0; 7054 return BYTE.test(str); 7055 } 7056 var MIN_INT32 = -(2 ** 31); 7057 var MAX_INT32 = 2 ** 31 - 1; 7058 function validateInt32(value) { 7059 return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32; 7060 } 7061 function validateInt64(value) { 7062 return Number.isInteger(value); 7063 } 7064 function validateNumber() { 7065 return true; 7066 } 7067 var Z_ANCHOR = /[^\\]\\Z/; 7068 function regex(str) { 7069 if (Z_ANCHOR.test(str)) 7070 return false; 7071 try { 7072 new RegExp(str); 7073 return true; 7074 } catch (e) { 7075 return false; 7076 } 7077 } 7078 } 7079 }); 7080 7081 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/core/id.js 7082 var require_id = __commonJS({ 7083 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/core/id.js"(exports) { 7084 "use strict"; 7085 Object.defineProperty(exports, "__esModule", { value: true }); 7086 var def = { 7087 keyword: "id", 7088 code() { 7089 throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); 7090 } 7091 }; 7092 exports.default = def; 7093 } 7094 }); 7095 7096 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/core/index.js 7097 var require_core3 = __commonJS({ 7098 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/core/index.js"(exports) { 7099 "use strict"; 7100 Object.defineProperty(exports, "__esModule", { value: true }); 7101 var id_1 = require_id(); 7102 var ref_1 = require_ref(); 7103 var core = [ 7104 "$schema", 7105 "$id", 7106 "$defs", 7107 "$vocabulary", 7108 { keyword: "$comment" }, 7109 "definitions", 7110 id_1.default, 7111 ref_1.default 7112 ]; 7113 exports.default = core; 7114 } 7115 }); 7116 7117 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitNumber.js 7118 var require_limitNumber2 = __commonJS({ 7119 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) { 7120 "use strict"; 7121 Object.defineProperty(exports, "__esModule", { value: true }); 7122 var codegen_1 = require_codegen(); 7123 var ops = codegen_1.operators; 7124 var KWDs = { 7125 maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, 7126 minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, 7127 exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, 7128 exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } 7129 }; 7130 var error = { 7131 message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be $KWDs[keyword].okStr} $schemaCode}`, 7132 params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: $KWDs[keyword].okStr}, limit: $schemaCode}}` 7133 }; 7134 var def = { 7135 keyword: Object.keys(KWDs), 7136 type: "number", 7137 schemaType: "number", 7138 $data: true, 7139 error, 7140 code(cxt) { 7141 const { keyword, data, schemaCode } = cxt; 7142 cxt.fail$data((0, codegen_1._)`$data} $KWDs[keyword].fail} $schemaCode} || isNaN($data})`); 7143 } 7144 }; 7145 exports.default = def; 7146 } 7147 }); 7148 7149 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/index.js 7150 var require_validation2 = __commonJS({ 7151 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) { 7152 "use strict"; 7153 Object.defineProperty(exports, "__esModule", { value: true }); 7154 var limitNumber_1 = require_limitNumber2(); 7155 var multipleOf_1 = require_multipleOf(); 7156 var limitLength_1 = require_limitLength(); 7157 var pattern_1 = require_pattern(); 7158 var limitProperties_1 = require_limitProperties(); 7159 var required_1 = require_required(); 7160 var limitItems_1 = require_limitItems(); 7161 var uniqueItems_1 = require_uniqueItems(); 7162 var const_1 = require_const(); 7163 var enum_1 = require_enum(); 7164 var validation = [ 7165 // number 7166 limitNumber_1.default, 7167 multipleOf_1.default, 7168 // string 7169 limitLength_1.default, 7170 pattern_1.default, 7171 // object 7172 limitProperties_1.default, 7173 required_1.default, 7174 // array 7175 limitItems_1.default, 7176 uniqueItems_1.default, 7177 // any 7178 { keyword: "type", schemaType: ["string", "array"] }, 7179 { keyword: "nullable", schemaType: "boolean" }, 7180 const_1.default, 7181 enum_1.default 7182 ]; 7183 exports.default = validation; 7184 } 7185 }); 7186 7187 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/metadata.js 7188 var require_metadata = __commonJS({ 7189 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/metadata.js"(exports) { 7190 "use strict"; 7191 Object.defineProperty(exports, "__esModule", { value: true }); 7192 exports.contentVocabulary = exports.metadataVocabulary = void 0; 7193 exports.metadataVocabulary = [ 7194 "title", 7195 "description", 7196 "default", 7197 "deprecated", 7198 "readOnly", 7199 "writeOnly", 7200 "examples" 7201 ]; 7202 exports.contentVocabulary = [ 7203 "contentMediaType", 7204 "contentEncoding", 7205 "contentSchema" 7206 ]; 7207 } 7208 }); 7209 7210 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/draft7.js 7211 var require_draft7 = __commonJS({ 7212 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/vocabularies/draft7.js"(exports) { 7213 "use strict"; 7214 Object.defineProperty(exports, "__esModule", { value: true }); 7215 var core_1 = require_core3(); 7216 var validation_1 = require_validation2(); 7217 var applicator_1 = require_applicator(); 7218 var format_1 = require_format2(); 7219 var metadata_1 = require_metadata(); 7220 var draft7Vocabularies = [ 7221 core_1.default, 7222 validation_1.default, 7223 (0, applicator_1.default)(), 7224 format_1.default, 7225 metadata_1.metadataVocabulary, 7226 metadata_1.contentVocabulary 7227 ]; 7228 exports.default = draft7Vocabularies; 7229 } 7230 }); 7231 7232 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/refs/json-schema-draft-07.json 7233 var require_json_schema_draft_07 = __commonJS({ 7234 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports, module) { 7235 module.exports = { 7236 $schema: "http://json-schema.org/draft-07/schema#", 7237 $id: "http://json-schema.org/draft-07/schema#", 7238 title: "Core schema meta-schema", 7239 definitions: { 7240 schemaArray: { 7241 type: "array", 7242 minItems: 1, 7243 items: { $ref: "#" } 7244 }, 7245 nonNegativeInteger: { 7246 type: "integer", 7247 minimum: 0 7248 }, 7249 nonNegativeIntegerDefault0: { 7250 allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] 7251 }, 7252 simpleTypes: { 7253 enum: ["array", "boolean", "integer", "null", "number", "object", "string"] 7254 }, 7255 stringArray: { 7256 type: "array", 7257 items: { type: "string" }, 7258 uniqueItems: true, 7259 default: [] 7260 } 7261 }, 7262 type: ["object", "boolean"], 7263 properties: { 7264 $id: { 7265 type: "string", 7266 format: "uri-reference" 7267 }, 7268 $schema: { 7269 type: "string", 7270 format: "uri" 7271 }, 7272 $ref: { 7273 type: "string", 7274 format: "uri-reference" 7275 }, 7276 $comment: { 7277 type: "string" 7278 }, 7279 title: { 7280 type: "string" 7281 }, 7282 description: { 7283 type: "string" 7284 }, 7285 default: true, 7286 readOnly: { 7287 type: "boolean", 7288 default: false 7289 }, 7290 examples: { 7291 type: "array", 7292 items: true 7293 }, 7294 multipleOf: { 7295 type: "number", 7296 exclusiveMinimum: 0 7297 }, 7298 maximum: { 7299 type: "number" 7300 }, 7301 exclusiveMaximum: { 7302 type: "number" 7303 }, 7304 minimum: { 7305 type: "number" 7306 }, 7307 exclusiveMinimum: { 7308 type: "number" 7309 }, 7310 maxLength: { $ref: "#/definitions/nonNegativeInteger" }, 7311 minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, 7312 pattern: { 7313 type: "string", 7314 format: "regex" 7315 }, 7316 additionalItems: { $ref: "#" }, 7317 items: { 7318 anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], 7319 default: true 7320 }, 7321 maxItems: { $ref: "#/definitions/nonNegativeInteger" }, 7322 minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, 7323 uniqueItems: { 7324 type: "boolean", 7325 default: false 7326 }, 7327 contains: { $ref: "#" }, 7328 maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, 7329 minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, 7330 required: { $ref: "#/definitions/stringArray" }, 7331 additionalProperties: { $ref: "#" }, 7332 definitions: { 7333 type: "object", 7334 additionalProperties: { $ref: "#" }, 7335 default: {} 7336 }, 7337 properties: { 7338 type: "object", 7339 additionalProperties: { $ref: "#" }, 7340 default: {} 7341 }, 7342 patternProperties: { 7343 type: "object", 7344 additionalProperties: { $ref: "#" }, 7345 propertyNames: { format: "regex" }, 7346 default: {} 7347 }, 7348 dependencies: { 7349 type: "object", 7350 additionalProperties: { 7351 anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] 7352 } 7353 }, 7354 propertyNames: { $ref: "#" }, 7355 const: true, 7356 enum: { 7357 type: "array", 7358 items: true, 7359 minItems: 1, 7360 uniqueItems: true 7361 }, 7362 type: { 7363 anyOf: [ 7364 { $ref: "#/definitions/simpleTypes" }, 7365 { 7366 type: "array", 7367 items: { $ref: "#/definitions/simpleTypes" }, 7368 minItems: 1, 7369 uniqueItems: true 7370 } 7371 ] 7372 }, 7373 format: { type: "string" }, 7374 contentMediaType: { type: "string" }, 7375 contentEncoding: { type: "string" }, 7376 if: { $ref: "#" }, 7377 then: { $ref: "#" }, 7378 else: { $ref: "#" }, 7379 allOf: { $ref: "#/definitions/schemaArray" }, 7380 anyOf: { $ref: "#/definitions/schemaArray" }, 7381 oneOf: { $ref: "#/definitions/schemaArray" }, 7382 not: { $ref: "#" } 7383 }, 7384 default: true 7385 }; 7386 } 7387 }); 7388 7389 // node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/ajv.js 7390 var require_ajv = __commonJS({ 7391 "node_modules/.store/ajv@8.20.0-Sm_HdGBII0pAI32gPogjeQ/node_modules/ajv/dist/ajv.js"(exports, module) { 7392 "use strict"; 7393 Object.defineProperty(exports, "__esModule", { value: true }); 7394 exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; 7395 var core_1 = require_core(); 7396 var draft7_1 = require_draft7(); 7397 var discriminator_1 = require_discriminator(); 7398 var draft7MetaSchema = require_json_schema_draft_07(); 7399 var META_SUPPORT_DATA = ["/properties"]; 7400 var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; 7401 var Ajv2 = class extends core_1.default { 7402 _addVocabularies() { 7403 super._addVocabularies(); 7404 draft7_1.default.forEach((v) => this.addVocabulary(v)); 7405 if (this.opts.discriminator) 7406 this.addKeyword(discriminator_1.default); 7407 } 7408 _addDefaultMetaSchema() { 7409 super._addDefaultMetaSchema(); 7410 if (!this.opts.meta) 7411 return; 7412 const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema; 7413 this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); 7414 this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; 7415 } 7416 defaultMeta() { 7417 return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); 7418 } 7419 }; 7420 exports.Ajv = Ajv2; 7421 module.exports = exports = Ajv2; 7422 module.exports.Ajv = Ajv2; 7423 Object.defineProperty(exports, "__esModule", { value: true }); 7424 exports.default = Ajv2; 7425 var validate_1 = require_validate(); 7426 Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { 7427 return validate_1.KeywordCxt; 7428 } }); 7429 var codegen_1 = require_codegen(); 7430 Object.defineProperty(exports, "_", { enumerable: true, get: function() { 7431 return codegen_1._; 7432 } }); 7433 Object.defineProperty(exports, "str", { enumerable: true, get: function() { 7434 return codegen_1.str; 7435 } }); 7436 Object.defineProperty(exports, "stringify", { enumerable: true, get: function() { 7437 return codegen_1.stringify; 7438 } }); 7439 Object.defineProperty(exports, "nil", { enumerable: true, get: function() { 7440 return codegen_1.nil; 7441 } }); 7442 Object.defineProperty(exports, "Name", { enumerable: true, get: function() { 7443 return codegen_1.Name; 7444 } }); 7445 Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() { 7446 return codegen_1.CodeGen; 7447 } }); 7448 var validation_error_1 = require_validation_error(); 7449 Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() { 7450 return validation_error_1.default; 7451 } }); 7452 var ref_error_1 = require_ref_error(); 7453 Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() { 7454 return ref_error_1.default; 7455 } }); 7456 } 7457 }); 7458 7459 // node_modules/.store/ajv-formats@3.0.1-bzwSgpJXIxM-cV51Zu75YA/node_modules/ajv-formats/dist/limit.js 7460 var require_limit = __commonJS({ 7461 "node_modules/.store/ajv-formats@3.0.1-bzwSgpJXIxM-cV51Zu75YA/node_modules/ajv-formats/dist/limit.js"(exports) { 7462 "use strict"; 7463 Object.defineProperty(exports, "__esModule", { value: true }); 7464 exports.formatLimitDefinition = void 0; 7465 var ajv_1 = require_ajv(); 7466 var codegen_1 = require_codegen(); 7467 var ops = codegen_1.operators; 7468 var KWDs = { 7469 formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, 7470 formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, 7471 formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, 7472 formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } 7473 }; 7474 var error = { 7475 message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be $KWDs[keyword].okStr} $schemaCode}`, 7476 params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: $KWDs[keyword].okStr}, limit: $schemaCode}}` 7477 }; 7478 exports.formatLimitDefinition = { 7479 keyword: Object.keys(KWDs), 7480 type: "string", 7481 schemaType: "string", 7482 $data: true, 7483 error, 7484 code(cxt) { 7485 const { gen, data, schemaCode, keyword, it } = cxt; 7486 const { opts, self } = it; 7487 if (!opts.validateFormats) 7488 return; 7489 const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, "format"); 7490 if (fCxt.$data) 7491 validate$DataFormat(); 7492 else 7493 validateFormat(); 7494 function validate$DataFormat() { 7495 const fmts = gen.scopeValue("formats", { 7496 ref: self.formats, 7497 code: opts.code.formats 7498 }); 7499 const fmt = gen.const("fmt", (0, codegen_1._)`$fmts}[$fCxt.schemaCode}]`); 7500 cxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof $fmt} != "object"`, (0, codegen_1._)`$fmt} instanceof RegExp`, (0, codegen_1._)`typeof $fmt}.compare != "function"`, compareCode(fmt))); 7501 } 7502 function validateFormat() { 7503 const format = fCxt.schema; 7504 const fmtDef = self.formats[format]; 7505 if (!fmtDef || fmtDef === true) 7506 return; 7507 if (typeof fmtDef != "object" || fmtDef instanceof RegExp || typeof fmtDef.compare != "function") { 7508 throw new Error(`"$keyword}": format "$format}" does not define "compare" function`); 7509 } 7510 const fmt = gen.scopeValue("formats", { 7511 key: format, 7512 ref: fmtDef, 7513 code: opts.code.formats ? (0, codegen_1._)`$opts.code.formats}${(0, codegen_1.getProperty)(format)}` : void 0 7514 }); 7515 cxt.fail$data(compareCode(fmt)); 7516 } 7517 function compareCode(fmt) { 7518 return (0, codegen_1._)`$fmt}.compare($data}, $schemaCode}) $KWDs[keyword].fail} 0`; 7519 } 7520 }, 7521 dependencies: ["format"] 7522 }; 7523 var formatLimitPlugin = (ajv2) => { 7524 ajv2.addKeyword(exports.formatLimitDefinition); 7525 return ajv2; 7526 }; 7527 exports.default = formatLimitPlugin; 7528 } 7529 }); 7530 7531 // node_modules/.store/ajv-formats@3.0.1-bzwSgpJXIxM-cV51Zu75YA/node_modules/ajv-formats/dist/index.js 7532 var require_dist2 = __commonJS({ 7533 "node_modules/.store/ajv-formats@3.0.1-bzwSgpJXIxM-cV51Zu75YA/node_modules/ajv-formats/dist/index.js"(exports, module) { 7534 "use strict"; 7535 Object.defineProperty(exports, "__esModule", { value: true }); 7536 var formats_1 = require_formats(); 7537 var limit_1 = require_limit(); 7538 var codegen_1 = require_codegen(); 7539 var fullName = new codegen_1.Name("fullFormats"); 7540 var fastName = new codegen_1.Name("fastFormats"); 7541 var formatsPlugin = (ajv2, opts = { keywords: true }) => { 7542 if (Array.isArray(opts)) { 7543 addFormats2(ajv2, opts, formats_1.fullFormats, fullName); 7544 return ajv2; 7545 } 7546 const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName]; 7547 const list = opts.formats || formats_1.formatNames; 7548 addFormats2(ajv2, list, formats, exportName); 7549 if (opts.keywords) 7550 (0, limit_1.default)(ajv2); 7551 return ajv2; 7552 }; 7553 formatsPlugin.get = (name, mode = "full") => { 7554 const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats; 7555 const f = formats[name]; 7556 if (!f) 7557 throw new Error(`Unknown format "$name}"`); 7558 return f; 7559 }; 7560 function addFormats2(ajv2, list, fs, exportName) { 7561 var _a; 7562 var _b; 7563 (_a = (_b = ajv2.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").$exportName}`; 7564 for (const f of list) 7565 ajv2.addFormat(f, fs[f]); 7566 } 7567 module.exports = exports = formatsPlugin; 7568 Object.defineProperty(exports, "__esModule", { value: true }); 7569 exports.default = formatsPlugin; 7570 } 7571 }); 7572 7573 // packages/abilities/build-module/api.mjs 7574 var import_data4 = __toESM(require_data(), 1); 7575 var import_i18n2 = __toESM(require_i18n(), 1); 7576 7577 // packages/abilities/build-module/store/index.mjs 7578 var import_data3 = __toESM(require_data(), 1); 7579 7580 // packages/abilities/build-module/store/reducer.mjs 7581 var import_data = __toESM(require_data(), 1); 7582 7583 // packages/abilities/build-module/store/constants.mjs 7584 var STORE_NAME = "core/abilities"; 7585 var ABILITY_NAME_PATTERN = /^[a-z0-9-]+(?:\/[a-z0-9-]+){1,3}$/; 7586 var CATEGORY_SLUG_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/; 7587 var REGISTER_ABILITY = "REGISTER_ABILITY"; 7588 var UNREGISTER_ABILITY = "UNREGISTER_ABILITY"; 7589 var REGISTER_ABILITY_CATEGORY = "REGISTER_ABILITY_CATEGORY"; 7590 var UNREGISTER_ABILITY_CATEGORY = "UNREGISTER_ABILITY_CATEGORY"; 7591 7592 // packages/abilities/build-module/store/reducer.mjs 7593 var ABILITY_KEYS = [ 7594 "name", 7595 "label", 7596 "description", 7597 "category", 7598 "input_schema", 7599 "output_schema", 7600 "meta", 7601 "callback", 7602 "permissionCallback" 7603 ]; 7604 var CATEGORY_KEYS = ["slug", "label", "description", "meta"]; 7605 function sanitizeAbility(ability) { 7606 return Object.keys(ability).filter( 7607 (key) => ABILITY_KEYS.includes(key) && ability[key] !== void 0 7608 ).reduce( 7609 (obj, key) => ({ ...obj, [key]: ability[key] }), 7610 {} 7611 ); 7612 } 7613 function sanitizeCategory(category) { 7614 return Object.keys(category).filter( 7615 (key) => CATEGORY_KEYS.includes(key) && category[key] !== void 0 7616 ).reduce( 7617 (obj, key) => ({ ...obj, [key]: category[key] }), 7618 {} 7619 ); 7620 } 7621 var DEFAULT_STATE = {}; 7622 function abilitiesByName(state = DEFAULT_STATE, action) { 7623 switch (action.type) { 7624 case REGISTER_ABILITY: { 7625 if (!action.ability) { 7626 return state; 7627 } 7628 return { 7629 ...state, 7630 [action.ability.name]: sanitizeAbility(action.ability) 7631 }; 7632 } 7633 case UNREGISTER_ABILITY: { 7634 if (!state[action.name]) { 7635 return state; 7636 } 7637 const { [action.name]: _, ...newState } = state; 7638 return newState; 7639 } 7640 default: 7641 return state; 7642 } 7643 } 7644 var DEFAULT_CATEGORIES_STATE = {}; 7645 function categoriesBySlug(state = DEFAULT_CATEGORIES_STATE, action) { 7646 switch (action.type) { 7647 case REGISTER_ABILITY_CATEGORY: { 7648 if (!action.category) { 7649 return state; 7650 } 7651 return { 7652 ...state, 7653 [action.category.slug]: sanitizeCategory(action.category) 7654 }; 7655 } 7656 case UNREGISTER_ABILITY_CATEGORY: { 7657 if (!state[action.slug]) { 7658 return state; 7659 } 7660 const { [action.slug]: _, ...newState } = state; 7661 return newState; 7662 } 7663 default: 7664 return state; 7665 } 7666 } 7667 var reducer_default = (0, import_data.combineReducers)({ 7668 abilitiesByName, 7669 categoriesBySlug 7670 }); 7671 7672 // packages/abilities/build-module/store/actions.mjs 7673 var actions_exports = {}; 7674 __export(actions_exports, { 7675 registerAbility: () => registerAbility, 7676 registerAbilityCategory: () => registerAbilityCategory, 7677 unregisterAbility: () => unregisterAbility, 7678 unregisterAbilityCategory: () => unregisterAbilityCategory 7679 }); 7680 var import_i18n = __toESM(require_i18n(), 1); 7681 function filterAnnotations(sourceAnnotations, allowedKeys) { 7682 const annotations = {}; 7683 if (sourceAnnotations) { 7684 for (const key of allowedKeys) { 7685 if (sourceAnnotations[key] !== void 0) { 7686 annotations[key] = sourceAnnotations[key]; 7687 } 7688 } 7689 } 7690 return annotations; 7691 } 7692 function registerAbility(ability) { 7693 return ({ select: select2, dispatch: dispatch2 }) => { 7694 if (!ability.name) { 7695 throw new Error("Ability name is required"); 7696 } 7697 if (!ABILITY_NAME_PATTERN.test(ability.name)) { 7698 throw new Error( 7699 'Ability name must be a string containing a namespace prefix with 2-4 segments, e.g. "my-plugin/my-ability" or "core/posts/find". It can only contain lowercase alphanumeric characters, dashes and the forward slash.' 7700 ); 7701 } 7702 if (!ability.label) { 7703 throw new Error( 7704 (0, import_i18n.sprintf)('Ability "%s" must have a label', ability.name) 7705 ); 7706 } 7707 if (!ability.description) { 7708 throw new Error( 7709 (0, import_i18n.sprintf)('Ability "%s" must have a description', ability.name) 7710 ); 7711 } 7712 if (!ability.category) { 7713 throw new Error( 7714 (0, import_i18n.sprintf)('Ability "%s" must have a category', ability.name) 7715 ); 7716 } 7717 if (!CATEGORY_SLUG_PATTERN.test(ability.category)) { 7718 throw new Error( 7719 (0, import_i18n.sprintf)( 7720 'Ability "%1$s" has an invalid category. Category must be lowercase alphanumeric with dashes only. Got: "%2$s"', 7721 ability.name, 7722 ability.category 7723 ) 7724 ); 7725 } 7726 const categories = select2.getAbilityCategories(); 7727 const existingCategory = categories.find( 7728 (cat) => cat.slug === ability.category 7729 ); 7730 if (!existingCategory) { 7731 throw new Error( 7732 (0, import_i18n.sprintf)( 7733 'Ability "%1$s" references non-existent category "%2$s". Please register the category first.', 7734 ability.name, 7735 ability.category 7736 ) 7737 ); 7738 } 7739 if (ability.callback && typeof ability.callback !== "function") { 7740 throw new Error( 7741 (0, import_i18n.sprintf)( 7742 'Ability "%s" has an invalid callback. Callback must be a function', 7743 ability.name 7744 ) 7745 ); 7746 } 7747 const existingAbility = select2.getAbility(ability.name); 7748 if (existingAbility) { 7749 throw new Error( 7750 (0, import_i18n.sprintf)('Ability "%s" is already registered', ability.name) 7751 ); 7752 } 7753 const annotations = filterAnnotations(ability.meta?.annotations, [ 7754 "readonly", 7755 "destructive", 7756 "idempotent", 7757 "serverRegistered", 7758 "clientRegistered" 7759 ]); 7760 if (!annotations.serverRegistered) { 7761 annotations.clientRegistered = true; 7762 } 7763 const meta = { 7764 ...ability.meta || {}, 7765 annotations 7766 }; 7767 dispatch2({ 7768 type: REGISTER_ABILITY, 7769 ability: { 7770 ...ability, 7771 meta 7772 } 7773 }); 7774 }; 7775 } 7776 function unregisterAbility(name) { 7777 return { 7778 type: UNREGISTER_ABILITY, 7779 name 7780 }; 7781 } 7782 function registerAbilityCategory(slug, args) { 7783 return ({ select: select2, dispatch: dispatch2 }) => { 7784 if (!slug) { 7785 throw new Error("Category slug is required"); 7786 } 7787 if (!CATEGORY_SLUG_PATTERN.test(slug)) { 7788 throw new Error( 7789 "Category slug must contain only lowercase alphanumeric characters and dashes." 7790 ); 7791 } 7792 const existingCategory = select2.getAbilityCategory(slug); 7793 if (existingCategory) { 7794 throw new Error( 7795 (0, import_i18n.sprintf)('Category "%s" is already registered.', slug) 7796 ); 7797 } 7798 if (!args.label || typeof args.label !== "string") { 7799 throw new Error( 7800 "The category properties must contain a `label` string." 7801 ); 7802 } 7803 if (!args.description || typeof args.description !== "string") { 7804 throw new Error( 7805 "The category properties must contain a `description` string." 7806 ); 7807 } 7808 if (args.meta !== void 0 && (typeof args.meta !== "object" || Array.isArray(args.meta))) { 7809 throw new Error( 7810 "The category properties should provide a valid `meta` object." 7811 ); 7812 } 7813 const annotations = filterAnnotations(args.meta?.annotations, [ 7814 "serverRegistered", 7815 "clientRegistered" 7816 ]); 7817 if (!annotations.serverRegistered) { 7818 annotations.clientRegistered = true; 7819 } 7820 const meta = { 7821 ...args.meta || {}, 7822 annotations 7823 }; 7824 const category = { 7825 slug, 7826 label: args.label, 7827 description: args.description, 7828 meta 7829 }; 7830 dispatch2({ 7831 type: REGISTER_ABILITY_CATEGORY, 7832 category 7833 }); 7834 }; 7835 } 7836 function unregisterAbilityCategory(slug) { 7837 return { 7838 type: UNREGISTER_ABILITY_CATEGORY, 7839 slug 7840 }; 7841 } 7842 7843 // packages/abilities/build-module/store/selectors.mjs 7844 var selectors_exports = {}; 7845 __export(selectors_exports, { 7846 getAbilities: () => getAbilities, 7847 getAbility: () => getAbility, 7848 getAbilityCategories: () => getAbilityCategories, 7849 getAbilityCategory: () => getAbilityCategory 7850 }); 7851 var import_data2 = __toESM(require_data(), 1); 7852 var getAbilities = (0, import_data2.createSelector)( 7853 (state, { category } = {}) => { 7854 const abilities = Object.values(state.abilitiesByName); 7855 if (category) { 7856 return abilities.filter( 7857 (ability) => ability.category === category 7858 ); 7859 } 7860 return abilities; 7861 }, 7862 (state, { category } = {}) => [ 7863 state.abilitiesByName, 7864 category 7865 ] 7866 ); 7867 function getAbility(state, name) { 7868 return state.abilitiesByName[name]; 7869 } 7870 var getAbilityCategories = (0, import_data2.createSelector)( 7871 (state) => { 7872 return Object.values(state.categoriesBySlug); 7873 }, 7874 (state) => [state.categoriesBySlug] 7875 ); 7876 function getAbilityCategory(state, slug) { 7877 return state.categoriesBySlug[slug]; 7878 } 7879 7880 // packages/abilities/build-module/store/index.mjs 7881 var store = (0, import_data3.createReduxStore)(STORE_NAME, { 7882 reducer: reducer_default, 7883 actions: actions_exports, 7884 selectors: selectors_exports 7885 }); 7886 (0, import_data3.register)(store); 7887 7888 // packages/abilities/build-module/validation.mjs 7889 var import_ajv_draft_04 = __toESM(require_dist(), 1); 7890 var import_ajv_formats = __toESM(require_dist2(), 1); 7891 var ajv = new import_ajv_draft_04.default({ 7892 coerceTypes: false, 7893 // No type coercion - AI should send proper JSON 7894 useDefaults: true, 7895 removeAdditional: false, 7896 // Keep additional properties 7897 allErrors: true, 7898 verbose: true, 7899 allowUnionTypes: true 7900 // Allow anyOf without explicit type 7901 }); 7902 (0, import_ajv_formats.default)(ajv, [ 7903 "date-time", 7904 "email", 7905 "hostname", 7906 "ipv4", 7907 "ipv6", 7908 "uri", 7909 "uuid" 7910 ]); 7911 function formatAjvError(ajvError, param) { 7912 const instancePath = ajvError.instancePath ? ajvError.instancePath.replace(/\//g, "][").replace(/^\]\[/, "[") + "]" : ""; 7913 const fullParam = param + instancePath; 7914 switch (ajvError.keyword) { 7915 case "type": 7916 return `$fullParam} is not of type $ajvError.params.type}.`; 7917 case "required": 7918 return `$ajvError.params.missingProperty} is a required property of $fullParam}.`; 7919 case "additionalProperties": 7920 return `$ajvError.params.additionalProperty} is not a valid property of Object.`; 7921 case "enum": 7922 const enumValues = ajvError.params.allowedValues.map( 7923 (v) => typeof v === "string" ? v : JSON.stringify(v) 7924 ).join(", "); 7925 return ajvError.params.allowedValues.length === 1 ? `$fullParam} is not $enumValues}.` : `$fullParam} is not one of $enumValues}.`; 7926 case "pattern": 7927 return `$fullParam} does not match pattern $ajvError.params.pattern}.`; 7928 case "format": 7929 const format = ajvError.params.format; 7930 const formatMessages = { 7931 email: "Invalid email address.", 7932 "date-time": "Invalid date.", 7933 uuid: `$fullParam} is not a valid UUID.`, 7934 ipv4: `$fullParam} is not a valid IP address.`, 7935 ipv6: `$fullParam} is not a valid IP address.`, 7936 hostname: `$fullParam} is not a valid hostname.`, 7937 uri: `$fullParam} is not a valid URI.` 7938 }; 7939 return formatMessages[format] || `Invalid $format}.`; 7940 case "minimum": 7941 case "exclusiveMinimum": 7942 return ajvError.keyword === "exclusiveMinimum" ? `$fullParam} must be greater than $ajvError.params.limit}` : `$fullParam} must be greater than or equal to $ajvError.params.limit}`; 7943 case "maximum": 7944 case "exclusiveMaximum": 7945 return ajvError.keyword === "exclusiveMaximum" ? `$fullParam} must be less than $ajvError.params.limit}` : `$fullParam} must be less than or equal to $ajvError.params.limit}`; 7946 case "multipleOf": 7947 return `$fullParam} must be a multiple of $ajvError.params.multipleOf}.`; 7948 case "anyOf": 7949 case "oneOf": 7950 return `$fullParam} is invalid (failed $ajvError.keyword} validation).`; 7951 case "minLength": 7952 return `$fullParam} must be at least $ajvError.params.limit} character$ajvError.params.limit === 1 ? "" : "s"} long.`; 7953 case "maxLength": 7954 return `$fullParam} must be at most $ajvError.params.limit} character$ajvError.params.limit === 1 ? "" : "s"} long.`; 7955 case "minItems": 7956 return `$fullParam} must contain at least $ajvError.params.limit} item$ajvError.params.limit === 1 ? "" : "s"}.`; 7957 case "maxItems": 7958 return `$fullParam} must contain at most $ajvError.params.limit} item$ajvError.params.limit === 1 ? "" : "s"}.`; 7959 case "uniqueItems": 7960 return `$fullParam} has duplicate items.`; 7961 case "minProperties": 7962 return `$fullParam} must contain at least $ajvError.params.limit} propert$ajvError.params.limit === 1 ? "y" : "ies"}.`; 7963 case "maxProperties": 7964 return `$fullParam} must contain at most $ajvError.params.limit} propert$ajvError.params.limit === 1 ? "y" : "ies"}.`; 7965 default: 7966 return ajvError.message || `$fullParam} is invalid (failed $ajvError.keyword} validation).`; 7967 } 7968 } 7969 function validateValueFromSchema(value, args, param = "") { 7970 if (!args || typeof args !== "object") { 7971 console.warn(`Schema must be an object. Received $typeof args}.`); 7972 return true; 7973 } 7974 if (!args.type && !args.anyOf && !args.oneOf) { 7975 console.warn( 7976 `The "type" schema keyword for $param || "value"} is required.` 7977 ); 7978 return true; 7979 } 7980 try { 7981 const { default: defaultValue, ...schemaWithoutDefault } = args; 7982 const validate = ajv.compile(schemaWithoutDefault); 7983 const valid = validate(value === void 0 ? defaultValue : value); 7984 if (valid) { 7985 return true; 7986 } 7987 if (validate.errors && validate.errors.length > 0) { 7988 const anyOfError = validate.errors.find( 7989 (e) => e.keyword === "anyOf" || e.keyword === "oneOf" 7990 ); 7991 if (anyOfError) { 7992 return formatAjvError(anyOfError, param); 7993 } 7994 return formatAjvError(validate.errors[0], param); 7995 } 7996 return `$param} is invalid.`; 7997 } catch (error) { 7998 console.error("Schema compilation error:", error); 7999 return "Invalid schema provided for validation."; 8000 } 8001 } 8002 8003 // packages/abilities/build-module/api.mjs 8004 function getAbilities2(args = {}) { 8005 return (0, import_data4.select)(store).getAbilities(args); 8006 } 8007 function getAbility2(name) { 8008 return (0, import_data4.select)(store).getAbility(name); 8009 } 8010 function getAbilityCategories2() { 8011 return (0, import_data4.select)(store).getAbilityCategories(); 8012 } 8013 function getAbilityCategory2(slug) { 8014 return (0, import_data4.select)(store).getAbilityCategory(slug); 8015 } 8016 function registerAbility2(ability) { 8017 (0, import_data4.dispatch)(store).registerAbility(ability); 8018 } 8019 function unregisterAbility2(name) { 8020 (0, import_data4.dispatch)(store).unregisterAbility(name); 8021 } 8022 function registerAbilityCategory2(slug, args) { 8023 (0, import_data4.dispatch)(store).registerAbilityCategory(slug, args); 8024 } 8025 function unregisterAbilityCategory2(slug) { 8026 (0, import_data4.dispatch)(store).unregisterAbilityCategory(slug); 8027 } 8028 async function executeAbility(name, input) { 8029 const ability = getAbility2(name); 8030 if (!ability) { 8031 throw new Error((0, import_i18n2.sprintf)("Ability not found: %s", name)); 8032 } 8033 if (!ability.callback) { 8034 throw new Error( 8035 (0, import_i18n2.sprintf)( 8036 'Ability "%s" is missing callback. Please ensure the ability is properly registered.', 8037 ability.name 8038 ) 8039 ); 8040 } 8041 if (ability.permissionCallback) { 8042 const hasPermission = await ability.permissionCallback(input); 8043 if (!hasPermission) { 8044 const error = new Error( 8045 (0, import_i18n2.sprintf)("Permission denied for ability: %s", ability.name) 8046 ); 8047 error.code = "ability_permission_denied"; 8048 throw error; 8049 } 8050 } 8051 if (ability.input_schema) { 8052 const inputValidation = validateValueFromSchema( 8053 input, 8054 ability.input_schema, 8055 "input" 8056 ); 8057 if (inputValidation !== true) { 8058 const error = new Error( 8059 (0, import_i18n2.sprintf)( 8060 'Ability "%1$s" has invalid input. Reason: %2$s', 8061 ability.name, 8062 inputValidation 8063 ) 8064 ); 8065 error.code = "ability_invalid_input"; 8066 throw error; 8067 } 8068 } 8069 let result; 8070 try { 8071 result = await ability.callback(input); 8072 } catch (error) { 8073 console.error(`Error executing ability $ability.name}:`, error); 8074 throw error; 8075 } 8076 if (ability.output_schema) { 8077 const outputValidation = validateValueFromSchema( 8078 result, 8079 ability.output_schema, 8080 "output" 8081 ); 8082 if (outputValidation !== true) { 8083 const error = new Error( 8084 (0, import_i18n2.sprintf)( 8085 'Ability "%1$s" has invalid output. Reason: %2$s', 8086 ability.name, 8087 outputValidation 8088 ) 8089 ); 8090 error.code = "ability_invalid_output"; 8091 throw error; 8092 } 8093 } 8094 return result; 8095 } 8096 export { 8097 executeAbility, 8098 getAbilities2 as getAbilities, 8099 getAbility2 as getAbility, 8100 getAbilityCategories2 as getAbilityCategories, 8101 getAbilityCategory2 as getAbilityCategory, 8102 registerAbility2 as registerAbility, 8103 registerAbilityCategory2 as registerAbilityCategory, 8104 store, 8105 unregisterAbility2 as unregisterAbility, 8106 unregisterAbilityCategory2 as unregisterAbilityCategory, 8107 validateValueFromSchema 8108 };
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Tue Nov 3 08:20:36 2026 | Cross-referenced by PHPXref |