@wp-playground/client 0.6.13 → 0.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.cjs +16 -16
  2. package/index.d.ts +27 -11
  3. package/index.js +830 -810
  4. package/package.json +3 -3
package/index.js CHANGED
@@ -777,8 +777,8 @@ const enableMultisite = async (e) => {
777
777
  });
778
778
  const t = new URL(await e.absoluteUrl);
779
779
  if (t.port !== "") {
780
- let O = `The current host is ${t.host}, but WordPress multisites do not support custom ports.`;
781
- throw t.hostname === "localhost" && (O += " For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."), new Error(O);
780
+ let C = `The current host is ${t.host}, but WordPress multisites do not support custom ports.`;
781
+ throw t.hostname === "localhost" && (C += " For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."), new Error(C);
782
782
  }
783
783
  const r = t.pathname.replace(/\/$/, "") + "/", n = `${t.protocol}//${t.hostname}${r}`;
784
784
  await setSiteOptions(e, {
@@ -858,23 +858,23 @@ echo json_encode($deactivated_plugins);
858
858
  PATH_CURRENT_SITE: r
859
859
  }
860
860
  });
861
- const p = new URL(await e.absoluteUrl), g = isURLScoped(p) ? "scope:" + getURLScope(p) : null;
861
+ const p = new URL(await e.absoluteUrl), _ = isURLScoped(p) ? "scope:" + getURLScope(p) : null;
862
862
  await e.writeFile(
863
863
  joinPaths(s, "/wp-content/sunrise.php"),
864
864
  `<?php
865
865
  if ( !defined( 'BLOG_ID_CURRENT_SITE' ) ) {
866
866
  define( 'BLOG_ID_CURRENT_SITE', 1 );
867
867
  }
868
- $folder = ${phpVar(g)};
868
+ $folder = ${phpVar(_)};
869
869
  if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
870
870
  $_SERVER['HTTP_HOST'] = ${phpVar(p.hostname)};
871
871
  $_SERVER['REQUEST_URI'] = "/$folder/" . ltrim($_SERVER['REQUEST_URI'], '/');
872
872
  }
873
873
  `
874
874
  ), await login(e, {});
875
- for (const O of o)
875
+ for (const C of o)
876
876
  await activatePlugin(e, {
877
- pluginPath: O
877
+ pluginPath: C
878
878
  });
879
879
  };
880
880
  function jsonToUrlEncoded(e) {
@@ -1050,13 +1050,13 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
1050
1050
  }), s = joinPaths(s, r);
1051
1051
  const i = joinPaths(s, "wp-content"), o = joinPaths(n, "wp-content");
1052
1052
  for (const p of wpContentFilesExcludedFromExport) {
1053
- const g = joinPaths(
1053
+ const _ = joinPaths(
1054
1054
  i,
1055
1055
  p
1056
1056
  );
1057
- await removePath(e, g);
1057
+ await removePath(e, _);
1058
1058
  const T = joinPaths(o, p);
1059
- await e.fileExists(T) && (await e.mkdir(dirname(g)), await e.mv(T, g));
1059
+ await e.fileExists(T) && (await e.mkdir(dirname(_)), await e.mv(T, _));
1060
1060
  }
1061
1061
  const c = joinPaths(
1062
1062
  s,
@@ -1095,30 +1095,54 @@ async function exportWXR(e) {
1095
1095
  });
1096
1096
  return new File([t.bytes], "export.xml");
1097
1097
  }
1098
- async function installAsset(e, { targetPath: t, zipFile: r }) {
1099
- const s = r.name.replace(/\.zip$/, ""), i = joinPaths(await e.documentRoot, "wp-content"), o = joinPaths(i, randomString()), c = joinPaths(o, "assets", s);
1100
- await e.fileExists(c) && await e.rmdir(o, {
1098
+ async function installAsset(e, {
1099
+ targetPath: t,
1100
+ zipFile: r,
1101
+ ifAlreadyInstalled: n = "overwrite"
1102
+ }) {
1103
+ const i = r.name.replace(/\.zip$/, ""), o = joinPaths(await e.documentRoot, "wp-content"), c = joinPaths(o, randomString()), d = joinPaths(c, "assets", i);
1104
+ await e.fileExists(d) && await e.rmdir(c, {
1101
1105
  recursive: !0
1102
- }), await e.mkdir(o);
1106
+ }), await e.mkdir(c);
1103
1107
  try {
1104
1108
  await unzip(e, {
1105
1109
  zipFile: r,
1106
- extractToPath: c
1110
+ extractToPath: d
1107
1111
  });
1108
- let d = await e.listFiles(c, {
1112
+ let u = await e.listFiles(d, {
1109
1113
  prependPath: !0
1110
1114
  });
1111
- d = d.filter((O) => !O.endsWith("/__MACOSX"));
1112
- const u = d.length === 1 && await e.isDir(d[0]);
1113
- let p, g = "";
1114
- u ? (g = d[0], p = d[0].split("/").pop()) : (g = c, p = s);
1115
- const T = `${t}/${p}`;
1116
- return await e.mv(g, T), {
1117
- assetFolderPath: T,
1118
- assetFolderName: p
1115
+ u = u.filter((S) => !S.endsWith("/__MACOSX"));
1116
+ const p = u.length === 1 && await e.isDir(u[0]);
1117
+ let _, T = "";
1118
+ p ? (T = u[0], _ = u[0].split("/").pop()) : (T = d, _ = i);
1119
+ const C = `${t}/${_}`;
1120
+ if (await e.fileExists(C)) {
1121
+ if (!await e.isDir(C))
1122
+ throw new Error(
1123
+ `Cannot install asset ${_} to ${C} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`
1124
+ );
1125
+ if (n === "overwrite")
1126
+ await e.rmdir(C, {
1127
+ recursive: !0
1128
+ });
1129
+ else {
1130
+ if (n === "skip")
1131
+ return {
1132
+ assetFolderPath: C,
1133
+ assetFolderName: _
1134
+ };
1135
+ throw new Error(
1136
+ `Cannot install asset ${_} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`
1137
+ );
1138
+ }
1139
+ }
1140
+ return await e.mv(T, C), {
1141
+ assetFolderPath: C,
1142
+ assetFolderName: _
1119
1143
  };
1120
1144
  } finally {
1121
- await e.rmdir(o, {
1145
+ await e.rmdir(c, {
1122
1146
  recursive: !0
1123
1147
  });
1124
1148
  }
@@ -1127,34 +1151,36 @@ function zipNameToHumanName(e) {
1127
1151
  const t = e.split(".").shift().replace(/-/g, " ");
1128
1152
  return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
1129
1153
  }
1130
- const installPlugin = async (e, { pluginZipFile: t, options: r = {} }, n) => {
1131
- const s = t.name.split("/").pop() || "plugin.zip", i = zipNameToHumanName(s);
1132
- n == null || n.tracker.setCaption(`Installing the ${i} plugin`);
1133
- const { assetFolderPath: o } = await installAsset(e, {
1154
+ const installPlugin = async (e, { pluginZipFile: t, ifAlreadyInstalled: r, options: n = {} }, s) => {
1155
+ const i = t.name.split("/").pop() || "plugin.zip", o = zipNameToHumanName(i);
1156
+ s == null || s.tracker.setCaption(`Installing the ${o} plugin`);
1157
+ const { assetFolderPath: c } = await installAsset(e, {
1158
+ ifAlreadyInstalled: r,
1134
1159
  zipFile: t,
1135
1160
  targetPath: `${await e.documentRoot}/wp-content/plugins`
1136
1161
  });
1137
- ("activate" in r ? r.activate : !0) && await activatePlugin(
1162
+ ("activate" in n ? n.activate : !0) && await activatePlugin(
1138
1163
  e,
1139
1164
  {
1140
- pluginPath: o,
1141
- pluginName: i
1165
+ pluginPath: c,
1166
+ pluginName: o
1142
1167
  },
1143
- n
1168
+ s
1144
1169
  );
1145
- }, installTheme = async (e, { themeZipFile: t, options: r = {} }, n) => {
1146
- const s = zipNameToHumanName(t.name);
1147
- n == null || n.tracker.setCaption(`Installing the ${s} theme`);
1148
- const { assetFolderName: i } = await installAsset(e, {
1170
+ }, installTheme = async (e, { themeZipFile: t, ifAlreadyInstalled: r, options: n = {} }, s) => {
1171
+ const i = zipNameToHumanName(t.name);
1172
+ s == null || s.tracker.setCaption(`Installing the ${i} theme`);
1173
+ const { assetFolderName: o } = await installAsset(e, {
1174
+ ifAlreadyInstalled: r,
1149
1175
  zipFile: t,
1150
1176
  targetPath: `${await e.documentRoot}/wp-content/themes`
1151
1177
  });
1152
- ("activate" in r ? r.activate : !0) && await activateTheme(
1178
+ ("activate" in n ? n.activate : !0) && await activateTheme(
1153
1179
  e,
1154
1180
  {
1155
- themeFolderName: i
1181
+ themeFolderName: o
1156
1182
  },
1157
- n
1183
+ s
1158
1184
  );
1159
1185
  }, runWpInstallationWizard = async (e, { options: t }) => {
1160
1186
  await e.request({
@@ -1918,9 +1944,12 @@ class PHPRequestHandler {
1918
1944
  t.url.split("#")[0],
1919
1945
  r ? void 0 : DEFAULT_BASE_URL
1920
1946
  ), s = applyRewriteRules(
1921
- removePathPrefix(n.pathname, H(this, ve)),
1947
+ removePathPrefix(
1948
+ decodeURIComponent(n.pathname),
1949
+ H(this, ve)
1950
+ ),
1922
1951
  this.rewriteRules
1923
- ), i = `${H(this, Pe)}${s}`;
1952
+ ), i = joinPaths(H(this, Pe), s);
1924
1953
  return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, _t, Wt).call(this, t, n) : ce(this, mt, zt).call(this, i);
1925
1954
  }
1926
1955
  }
@@ -1978,7 +2007,7 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
1978
2007
  }
1979
2008
  let d;
1980
2009
  try {
1981
- d = ce(this, gt, Bt).call(this, r.pathname);
2010
+ d = ce(this, gt, Bt).call(this, decodeURIComponent(r.pathname));
1982
2011
  } catch {
1983
2012
  return new PHPResponse(
1984
2013
  404,
@@ -2156,8 +2185,8 @@ function rethrowFileSystemError(e = "") {
2156
2185
  } catch (c) {
2157
2186
  const d = typeof c == "object" ? c == null ? void 0 : c.errno : null;
2158
2187
  if (d in FileErrorCodes) {
2159
- const u = FileErrorCodes[d], p = typeof o[0] == "string" ? o[0] : null, g = p !== null ? e.replaceAll("{path}", p) : e;
2160
- throw new Error(`${g}: ${u}`, {
2188
+ const u = FileErrorCodes[d], p = typeof o[0] == "string" ? o[0] : null, _ = p !== null ? e.replaceAll("{path}", p) : e;
2189
+ throw new Error(`${_}: ${u}`, {
2161
2190
  cause: c
2162
2191
  });
2163
2192
  }
@@ -2180,7 +2209,7 @@ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyD
2180
2209
  return n && s && __defProp(t, r, s), s;
2181
2210
  };
2182
2211
  const STRING = "string", NUMBER = "number", __private__dont__use = Symbol("__private__dont__use");
2183
- var Me, Ze, Ye, be, Re, Te, Ee, Xe, yt, Gt, $t, Kt, vt, Jt, wt, Qt, Pt, Zt, bt, Yt, Et, Xt, St, er, Rt, tr, Tt, rr, kt, nr, Ct, sr;
2212
+ var Me, Ze, Ye, Ee, Re, Te, be, Xe, yt, Gt, $t, Kt, vt, Jt, wt, Qt, Pt, Zt, Et, Yt, bt, Xt, St, er, Rt, tr, Tt, rr, kt, nr, Ct, sr;
2184
2213
  class BasePHP {
2185
2214
  /**
2186
2215
  * Initializes a PHP runtime.
@@ -2195,8 +2224,8 @@ class BasePHP {
2195
2224
  Q(this, vt);
2196
2225
  Q(this, wt);
2197
2226
  Q(this, Pt);
2198
- Q(this, bt);
2199
2227
  Q(this, Et);
2228
+ Q(this, bt);
2200
2229
  Q(this, St);
2201
2230
  Q(this, Rt);
2202
2231
  Q(this, Tt);
@@ -2205,24 +2234,24 @@ class BasePHP {
2205
2234
  Q(this, Me, void 0);
2206
2235
  Q(this, Ze, void 0);
2207
2236
  Q(this, Ye, void 0);
2208
- Q(this, be, void 0);
2237
+ Q(this, Ee, void 0);
2209
2238
  Q(this, Re, void 0);
2210
2239
  Q(this, Te, void 0);
2211
- Q(this, Ee, void 0);
2240
+ Q(this, be, void 0);
2212
2241
  Q(this, Xe, void 0);
2213
- te(this, Me, []), te(this, be, !1), te(this, Re, null), te(this, Te, {}), te(this, Ee, /* @__PURE__ */ new Map()), te(this, Xe, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPBrowser(
2242
+ te(this, Me, []), te(this, Ee, !1), te(this, Re, null), te(this, Te, {}), te(this, be, /* @__PURE__ */ new Map()), te(this, Xe, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPBrowser(
2214
2243
  new PHPRequestHandler(this, t)
2215
2244
  ));
2216
2245
  }
2217
2246
  addEventListener(e, t) {
2218
- H(this, Ee).has(e) || H(this, Ee).set(e, /* @__PURE__ */ new Set()), H(this, Ee).get(e).add(t);
2247
+ H(this, be).has(e) || H(this, be).set(e, /* @__PURE__ */ new Set()), H(this, be).get(e).add(t);
2219
2248
  }
2220
2249
  removeEventListener(e, t) {
2221
2250
  var r;
2222
- (r = H(this, Ee).get(e)) == null || r.delete(t);
2251
+ (r = H(this, be).get(e)) == null || r.delete(t);
2223
2252
  }
2224
2253
  dispatchEvent(e) {
2225
- const t = H(this, Ee).get(e.type);
2254
+ const t = H(this, be).get(e.type);
2226
2255
  if (t)
2227
2256
  for (const r of t)
2228
2257
  r(e);
@@ -2285,7 +2314,7 @@ class BasePHP {
2285
2314
  }
2286
2315
  /** @inheritDoc */
2287
2316
  setPhpIniPath(e) {
2288
- if (H(this, be))
2317
+ if (H(this, Ee))
2289
2318
  throw new Error("Cannot set PHP ini path after calling run().");
2290
2319
  te(this, Ze, e), this[__private__dont__use].ccall(
2291
2320
  "wasm_set_phpini_path",
@@ -2296,7 +2325,7 @@ class BasePHP {
2296
2325
  }
2297
2326
  /** @inheritDoc */
2298
2327
  setPhpIniEntry(e, t) {
2299
- if (H(this, be))
2328
+ if (H(this, Ee))
2300
2329
  throw new Error("Cannot set PHP ini entries after calling run().");
2301
2330
  H(this, Me).push([e, t]);
2302
2331
  }
@@ -2315,27 +2344,23 @@ class BasePHP {
2315
2344
  const t = await this.semaphore.acquire();
2316
2345
  let r;
2317
2346
  try {
2318
- if (H(this, be) || (ce(this, yt, Gt).call(this), te(this, be, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
2347
+ if (H(this, Ee) || (ce(this, yt, Gt).call(this), te(this, Ee, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
2319
2348
  throw new Error(
2320
2349
  `The script path "${e.scriptPath}" does not exist.`
2321
2350
  );
2322
2351
  ce(this, St, er).call(this, e.scriptPath || ""), ce(this, vt, Jt).call(this, e.relativeUri || ""), ce(this, Pt, Zt).call(this, e.method || "GET");
2323
2352
  const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443";
2324
- ce(this, wt, Qt).call(this, s, e.protocol || "http"), ce(this, bt, Yt).call(this, n), e.body && (r = ce(this, Et, Xt).call(this, e.body)), typeof e.code == "string" && ce(this, kt, nr).call(this, " ?>" + e.code), ce(this, Rt, tr).call(this);
2353
+ ce(this, wt, Qt).call(this, s, e.protocol || "http"), ce(this, Et, Yt).call(this, n), e.body && (r = ce(this, bt, Xt).call(this, e.body)), typeof e.code == "string" && ce(this, kt, nr).call(this, " ?>" + e.code), ce(this, Rt, tr).call(this);
2325
2354
  const i = e.env || {};
2326
2355
  for (const c in i)
2327
2356
  ce(this, Tt, rr).call(this, c, i[c]);
2328
2357
  const o = await ce(this, Ct, sr).call(this);
2329
2358
  if (o.exitCode !== 0) {
2330
- const c = {
2331
- stdout: o.text,
2332
- stderr: o.errors
2333
- };
2334
- console.warn("PHP.run() output was:", c);
2335
- const d = new Error(
2359
+ console.warn("PHP.run() output was:", o.text);
2360
+ const c = new Error(
2336
2361
  `PHP.run() failed with exit code ${o.exitCode} and the following output: ` + o.errors
2337
2362
  );
2338
- throw d.output = c, d.source = "request", console.error(d), d;
2363
+ throw c.response = o, c.source = "request", console.error(c), c;
2339
2364
  }
2340
2365
  return o;
2341
2366
  } catch (n) {
@@ -2465,10 +2490,10 @@ class BasePHP {
2465
2490
  this[__private__dont__use]._exit(e);
2466
2491
  } catch {
2467
2492
  }
2468
- te(this, be, !1), te(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
2493
+ te(this, Ee, !1), te(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
2469
2494
  }
2470
2495
  }
2471
- Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), Ee = new WeakMap(), Xe = new WeakMap(), yt = new WeakSet(), Gt = function() {
2496
+ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), Ee = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), be = new WeakMap(), Xe = new WeakMap(), yt = new WeakSet(), Gt = function() {
2472
2497
  if (this.setPhpIniEntry("auto_prepend_file", "/internal/consts.php"), this.fileExists("/internal/consts.php") || this.writeFile(
2473
2498
  "/internal/consts.php",
2474
2499
  `<?php
@@ -2550,7 +2575,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2550
2575
  [STRING],
2551
2576
  [e]
2552
2577
  );
2553
- }, bt = new WeakSet(), Yt = function(e) {
2578
+ }, Et = new WeakSet(), Yt = function(e) {
2554
2579
  e.cookie && this[__private__dont__use].ccall(
2555
2580
  "wasm_set_cookies",
2556
2581
  null,
@@ -2574,7 +2599,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2574
2599
  e[t]
2575
2600
  );
2576
2601
  }
2577
- }, Et = new WeakSet(), Xt = function(e) {
2602
+ }, bt = new WeakSet(), Xt = function(e) {
2578
2603
  let t, r;
2579
2604
  typeof e == "string" ? (console.warn(
2580
2605
  "Passing a string as the request body is deprecated. Please use a Uint8Array instead. See https://github.com/WordPress/wordpress-playground/issues/997 for more details"
@@ -2998,78 +3023,78 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
2998
3023
  }
2999
3024
  }
3000
3025
  e._Code = n, e.nil = new n("");
3001
- function s(_, ...y) {
3002
- const P = [_[0]];
3026
+ function s(g, ...y) {
3027
+ const P = [g[0]];
3003
3028
  let I = 0;
3004
3029
  for (; I < y.length; )
3005
- c(P, y[I]), P.push(_[++I]);
3030
+ c(P, y[I]), P.push(g[++I]);
3006
3031
  return new n(P);
3007
3032
  }
3008
3033
  e._ = s;
3009
3034
  const i = new n("+");
3010
- function o(_, ...y) {
3011
- const P = [O(_[0])];
3035
+ function o(g, ...y) {
3036
+ const P = [C(g[0])];
3012
3037
  let I = 0;
3013
3038
  for (; I < y.length; )
3014
- P.push(i), c(P, y[I]), P.push(i, O(_[++I]));
3039
+ P.push(i), c(P, y[I]), P.push(i, C(g[++I]));
3015
3040
  return d(P), new n(P);
3016
3041
  }
3017
3042
  e.str = o;
3018
- function c(_, y) {
3019
- y instanceof n ? _.push(...y._items) : y instanceof r ? _.push(y) : _.push(g(y));
3043
+ function c(g, y) {
3044
+ y instanceof n ? g.push(...y._items) : y instanceof r ? g.push(y) : g.push(_(y));
3020
3045
  }
3021
3046
  e.addCodeArg = c;
3022
- function d(_) {
3047
+ function d(g) {
3023
3048
  let y = 1;
3024
- for (; y < _.length - 1; ) {
3025
- if (_[y] === i) {
3026
- const P = u(_[y - 1], _[y + 1]);
3049
+ for (; y < g.length - 1; ) {
3050
+ if (g[y] === i) {
3051
+ const P = u(g[y - 1], g[y + 1]);
3027
3052
  if (P !== void 0) {
3028
- _.splice(y - 1, 3, P);
3053
+ g.splice(y - 1, 3, P);
3029
3054
  continue;
3030
3055
  }
3031
- _[y++] = "+";
3056
+ g[y++] = "+";
3032
3057
  }
3033
3058
  y++;
3034
3059
  }
3035
3060
  }
3036
- function u(_, y) {
3061
+ function u(g, y) {
3037
3062
  if (y === '""')
3038
- return _;
3039
- if (_ === '""')
3063
+ return g;
3064
+ if (g === '""')
3040
3065
  return y;
3041
- if (typeof _ == "string")
3042
- return y instanceof r || _[_.length - 1] !== '"' ? void 0 : typeof y != "string" ? `${_.slice(0, -1)}${y}"` : y[0] === '"' ? _.slice(0, -1) + y.slice(1) : void 0;
3043
- if (typeof y == "string" && y[0] === '"' && !(_ instanceof r))
3044
- return `"${_}${y.slice(1)}`;
3066
+ if (typeof g == "string")
3067
+ return y instanceof r || g[g.length - 1] !== '"' ? void 0 : typeof y != "string" ? `${g.slice(0, -1)}${y}"` : y[0] === '"' ? g.slice(0, -1) + y.slice(1) : void 0;
3068
+ if (typeof y == "string" && y[0] === '"' && !(g instanceof r))
3069
+ return `"${g}${y.slice(1)}`;
3045
3070
  }
3046
- function p(_, y) {
3047
- return y.emptyStr() ? _ : _.emptyStr() ? y : o`${_}${y}`;
3071
+ function p(g, y) {
3072
+ return y.emptyStr() ? g : g.emptyStr() ? y : o`${g}${y}`;
3048
3073
  }
3049
3074
  e.strConcat = p;
3050
- function g(_) {
3051
- return typeof _ == "number" || typeof _ == "boolean" || _ === null ? _ : O(Array.isArray(_) ? _.join(",") : _);
3075
+ function _(g) {
3076
+ return typeof g == "number" || typeof g == "boolean" || g === null ? g : C(Array.isArray(g) ? g.join(",") : g);
3052
3077
  }
3053
- function T(_) {
3054
- return new n(O(_));
3078
+ function T(g) {
3079
+ return new n(C(g));
3055
3080
  }
3056
3081
  e.stringify = T;
3057
- function O(_) {
3058
- return JSON.stringify(_).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
3082
+ function C(g) {
3083
+ return JSON.stringify(g).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
3059
3084
  }
3060
- e.safeStringify = O;
3061
- function R(_) {
3062
- return typeof _ == "string" && e.IDENTIFIER.test(_) ? new n(`.${_}`) : s`[${_}]`;
3085
+ e.safeStringify = C;
3086
+ function S(g) {
3087
+ return typeof g == "string" && e.IDENTIFIER.test(g) ? new n(`.${g}`) : s`[${g}]`;
3063
3088
  }
3064
- e.getProperty = R;
3065
- function k(_) {
3066
- if (typeof _ == "string" && e.IDENTIFIER.test(_))
3067
- return new n(`${_}`);
3068
- throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`);
3089
+ e.getProperty = S;
3090
+ function k(g) {
3091
+ if (typeof g == "string" && e.IDENTIFIER.test(g))
3092
+ return new n(`${g}`);
3093
+ throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`);
3069
3094
  }
3070
3095
  e.getEsmExportName = k;
3071
- function $(_) {
3072
- return new n(_.toString());
3096
+ function $(g) {
3097
+ return new n(g.toString());
3073
3098
  }
3074
3099
  e.regexpCode = $;
3075
3100
  })(code$1);
@@ -3105,8 +3130,8 @@ var scope = {};
3105
3130
  return `${u}${p.index++}`;
3106
3131
  }
3107
3132
  _nameGroup(u) {
3108
- var p, g;
3109
- if (!((g = (p = this._parent) === null || p === void 0 ? void 0 : p._prefixes) === null || g === void 0) && g.has(u) || this._prefixes && !this._prefixes.has(u))
3133
+ var p, _;
3134
+ if (!((_ = (p = this._parent) === null || p === void 0 ? void 0 : p._prefixes) === null || _ === void 0) && _.has(u) || this._prefixes && !this._prefixes.has(u))
3110
3135
  throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);
3111
3136
  return this._names[u] = { prefix: u, index: 0 };
3112
3137
  }
@@ -3116,8 +3141,8 @@ var scope = {};
3116
3141
  constructor(u, p) {
3117
3142
  super(p), this.prefix = u;
3118
3143
  }
3119
- setValue(u, { property: p, itemIndex: g }) {
3120
- this.value = u, this.scopePath = (0, t._)`.${new t.Name(p)}[${g}]`;
3144
+ setValue(u, { property: p, itemIndex: _ }) {
3145
+ this.value = u, this.scopePath = (0, t._)`.${new t.Name(p)}[${_}]`;
3121
3146
  }
3122
3147
  }
3123
3148
  e.ValueScopeName = i;
@@ -3133,63 +3158,63 @@ var scope = {};
3133
3158
  return new i(u, this._newName(u));
3134
3159
  }
3135
3160
  value(u, p) {
3136
- var g;
3161
+ var _;
3137
3162
  if (p.ref === void 0)
3138
3163
  throw new Error("CodeGen: ref must be passed in value");
3139
- const T = this.toName(u), { prefix: O } = T, R = (g = p.key) !== null && g !== void 0 ? g : p.ref;
3140
- let k = this._values[O];
3164
+ const T = this.toName(u), { prefix: C } = T, S = (_ = p.key) !== null && _ !== void 0 ? _ : p.ref;
3165
+ let k = this._values[C];
3141
3166
  if (k) {
3142
- const y = k.get(R);
3167
+ const y = k.get(S);
3143
3168
  if (y)
3144
3169
  return y;
3145
3170
  } else
3146
- k = this._values[O] = /* @__PURE__ */ new Map();
3147
- k.set(R, T);
3148
- const $ = this._scope[O] || (this._scope[O] = []), _ = $.length;
3149
- return $[_] = p.ref, T.setValue(p, { property: O, itemIndex: _ }), T;
3171
+ k = this._values[C] = /* @__PURE__ */ new Map();
3172
+ k.set(S, T);
3173
+ const $ = this._scope[C] || (this._scope[C] = []), g = $.length;
3174
+ return $[g] = p.ref, T.setValue(p, { property: C, itemIndex: g }), T;
3150
3175
  }
3151
3176
  getValue(u, p) {
3152
- const g = this._values[u];
3153
- if (g)
3154
- return g.get(p);
3177
+ const _ = this._values[u];
3178
+ if (_)
3179
+ return _.get(p);
3155
3180
  }
3156
3181
  scopeRefs(u, p = this._values) {
3157
- return this._reduceValues(p, (g) => {
3158
- if (g.scopePath === void 0)
3159
- throw new Error(`CodeGen: name "${g}" has no value`);
3160
- return (0, t._)`${u}${g.scopePath}`;
3182
+ return this._reduceValues(p, (_) => {
3183
+ if (_.scopePath === void 0)
3184
+ throw new Error(`CodeGen: name "${_}" has no value`);
3185
+ return (0, t._)`${u}${_.scopePath}`;
3161
3186
  });
3162
3187
  }
3163
- scopeCode(u = this._values, p, g) {
3188
+ scopeCode(u = this._values, p, _) {
3164
3189
  return this._reduceValues(u, (T) => {
3165
3190
  if (T.value === void 0)
3166
3191
  throw new Error(`CodeGen: name "${T}" has no value`);
3167
3192
  return T.value.code;
3168
- }, p, g);
3193
+ }, p, _);
3169
3194
  }
3170
- _reduceValues(u, p, g = {}, T) {
3171
- let O = t.nil;
3172
- for (const R in u) {
3173
- const k = u[R];
3195
+ _reduceValues(u, p, _ = {}, T) {
3196
+ let C = t.nil;
3197
+ for (const S in u) {
3198
+ const k = u[S];
3174
3199
  if (!k)
3175
3200
  continue;
3176
- const $ = g[R] = g[R] || /* @__PURE__ */ new Map();
3177
- k.forEach((_) => {
3178
- if ($.has(_))
3201
+ const $ = _[S] = _[S] || /* @__PURE__ */ new Map();
3202
+ k.forEach((g) => {
3203
+ if ($.has(g))
3179
3204
  return;
3180
- $.set(_, n.Started);
3181
- let y = p(_);
3205
+ $.set(g, n.Started);
3206
+ let y = p(g);
3182
3207
  if (y) {
3183
3208
  const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
3184
- O = (0, t._)`${O}${P} ${_} = ${y};${this.opts._n}`;
3185
- } else if (y = T == null ? void 0 : T(_))
3186
- O = (0, t._)`${O}${y}${this.opts._n}`;
3209
+ C = (0, t._)`${C}${P} ${g} = ${y};${this.opts._n}`;
3210
+ } else if (y = T == null ? void 0 : T(g))
3211
+ C = (0, t._)`${C}${y}${this.opts._n}`;
3187
3212
  else
3188
- throw new r(_);
3189
- $.set(_, n.Completed);
3213
+ throw new r(g);
3214
+ $.set(g, n.Completed);
3190
3215
  });
3191
3216
  }
3192
- return O;
3217
+ return C;
3193
3218
  }
3194
3219
  }
3195
3220
  e.ValueScope = c;
@@ -3300,7 +3325,7 @@ var scope = {};
3300
3325
  return `break${this.label ? ` ${this.label}` : ""};` + a;
3301
3326
  }
3302
3327
  }
3303
- class g extends i {
3328
+ class _ extends i {
3304
3329
  constructor(a) {
3305
3330
  super(), this.error = a;
3306
3331
  }
@@ -3328,7 +3353,7 @@ var scope = {};
3328
3353
  return this.code instanceof t._CodeOrName ? this.code.names : {};
3329
3354
  }
3330
3355
  }
3331
- class O extends i {
3356
+ class C extends i {
3332
3357
  constructor(a = []) {
3333
3358
  super(), this.nodes = a;
3334
3359
  }
@@ -3357,17 +3382,17 @@ var scope = {};
3357
3382
  return this.nodes.reduce((a, h) => K(a, h.names), {});
3358
3383
  }
3359
3384
  }
3360
- class R extends O {
3385
+ class S extends C {
3361
3386
  render(a) {
3362
3387
  return "{" + a._n + super.render(a) + "}" + a._n;
3363
3388
  }
3364
3389
  }
3365
- class k extends O {
3390
+ class k extends C {
3366
3391
  }
3367
- class $ extends R {
3392
+ class $ extends S {
3368
3393
  }
3369
3394
  $.kind = "else";
3370
- class _ extends R {
3395
+ class g extends S {
3371
3396
  constructor(a, h) {
3372
3397
  super(h), this.condition = a;
3373
3398
  }
@@ -3386,7 +3411,7 @@ var scope = {};
3386
3411
  h = this.else = Array.isArray(N) ? new $(N) : N;
3387
3412
  }
3388
3413
  if (h)
3389
- return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(Ce(a), h instanceof _ ? [h] : h.nodes);
3414
+ return a === !1 ? h instanceof g ? h : h.nodes : this.nodes.length ? this : new g(Ce(a), h instanceof g ? [h] : h.nodes);
3390
3415
  if (!(a === !1 || !this.nodes.length))
3391
3416
  return this;
3392
3417
  }
@@ -3400,8 +3425,8 @@ var scope = {};
3400
3425
  return ue(a, this.condition), this.else && K(a, this.else.names), a;
3401
3426
  }
3402
3427
  }
3403
- _.kind = "if";
3404
- class y extends R {
3428
+ g.kind = "if";
3429
+ class y extends S {
3405
3430
  }
3406
3431
  y.kind = "for";
3407
3432
  class P extends y {
@@ -3447,7 +3472,7 @@ var scope = {};
3447
3472
  return K(super.names, this.iterable.names);
3448
3473
  }
3449
3474
  }
3450
- class w extends R {
3475
+ class w extends S {
3451
3476
  constructor(a, h, N) {
3452
3477
  super(), this.name = a, this.args = h, this.async = N;
3453
3478
  }
@@ -3456,13 +3481,13 @@ var scope = {};
3456
3481
  }
3457
3482
  }
3458
3483
  w.kind = "func";
3459
- class C extends O {
3484
+ class O extends C {
3460
3485
  render(a) {
3461
3486
  return "return " + super.render(a);
3462
3487
  }
3463
3488
  }
3464
- C.kind = "return";
3465
- class A extends R {
3489
+ O.kind = "return";
3490
+ class A extends S {
3466
3491
  render(a) {
3467
3492
  let h = "try" + super.render(a);
3468
3493
  return this.catch && (h += this.catch.render(a)), this.finally && (h += this.finally.render(a)), h;
@@ -3480,7 +3505,7 @@ var scope = {};
3480
3505
  return this.catch && K(a, this.catch.names), this.finally && K(a, this.finally.names), a;
3481
3506
  }
3482
3507
  }
3483
- class x extends R {
3508
+ class x extends S {
3484
3509
  constructor(a) {
3485
3510
  super(), this.error = a;
3486
3511
  }
@@ -3489,7 +3514,7 @@ var scope = {};
3489
3514
  }
3490
3515
  }
3491
3516
  x.kind = "catch";
3492
- class z extends R {
3517
+ class z extends S {
3493
3518
  render(a) {
3494
3519
  return "finally" + super.render(a);
3495
3520
  }
@@ -3564,7 +3589,7 @@ var scope = {};
3564
3589
  }
3565
3590
  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
3566
3591
  if(a, h, N) {
3567
- if (this._blockNode(new _(a)), h && N)
3592
+ if (this._blockNode(new g(a)), h && N)
3568
3593
  this.code(h).else().code(N).endIf();
3569
3594
  else if (h)
3570
3595
  this.code(h).endIf();
@@ -3574,7 +3599,7 @@ var scope = {};
3574
3599
  }
3575
3600
  // `else if` clause - invalid without `if` or after `else` clauses
3576
3601
  elseIf(a) {
3577
- return this._elseNode(new _(a));
3602
+ return this._elseNode(new g(a));
3578
3603
  }
3579
3604
  // `else` clause - only valid after `if` or `else if` clauses
3580
3605
  else() {
@@ -3582,7 +3607,7 @@ var scope = {};
3582
3607
  }
3583
3608
  // end `if` statement (needed if gen.if was used only with condition)
3584
3609
  endIf() {
3585
- return this._endBlockNode(_, $);
3610
+ return this._endBlockNode(g, $);
3586
3611
  }
3587
3612
  _for(a, h) {
3588
3613
  return this._blockNode(a), h && this.code(h).endFor(), this;
@@ -3629,10 +3654,10 @@ var scope = {};
3629
3654
  }
3630
3655
  // `return` statement
3631
3656
  return(a) {
3632
- const h = new C();
3657
+ const h = new O();
3633
3658
  if (this._blockNode(h), this.code(a), h.nodes.length !== 1)
3634
3659
  throw new Error('CodeGen: "return" should have one node');
3635
- return this._endBlockNode(C);
3660
+ return this._endBlockNode(O);
3636
3661
  }
3637
3662
  // `try` statement
3638
3663
  try(a, h, N) {
@@ -3647,7 +3672,7 @@ var scope = {};
3647
3672
  }
3648
3673
  // `throw` statement
3649
3674
  throw(a) {
3650
- return this._leafNode(new g(a));
3675
+ return this._leafNode(new _(a));
3651
3676
  }
3652
3677
  // start self-balancing block
3653
3678
  block(a, h) {
@@ -3689,7 +3714,7 @@ var scope = {};
3689
3714
  }
3690
3715
  _elseNode(a) {
3691
3716
  const h = this._currNode;
3692
- if (!(h instanceof _))
3717
+ if (!(h instanceof g))
3693
3718
  throw new Error('CodeGen: "else" without "if"');
3694
3719
  return this._currNode = h.else = a, this;
3695
3720
  }
@@ -3706,20 +3731,20 @@ var scope = {};
3706
3731
  }
3707
3732
  }
3708
3733
  e.CodeGen = re;
3709
- function K(b, a) {
3734
+ function K(E, a) {
3710
3735
  for (const h in a)
3711
- b[h] = (b[h] || 0) + (a[h] || 0);
3712
- return b;
3713
- }
3714
- function ue(b, a) {
3715
- return a instanceof t._CodeOrName ? K(b, a.names) : b;
3716
- }
3717
- function oe(b, a, h) {
3718
- if (b instanceof t.Name)
3719
- return N(b);
3720
- if (!M(b))
3721
- return b;
3722
- return new t._Code(b._items.reduce((L, W) => (W instanceof t.Name && (W = N(W)), W instanceof t._Code ? L.push(...W._items) : L.push(W), L), []));
3736
+ E[h] = (E[h] || 0) + (a[h] || 0);
3737
+ return E;
3738
+ }
3739
+ function ue(E, a) {
3740
+ return a instanceof t._CodeOrName ? K(E, a.names) : E;
3741
+ }
3742
+ function oe(E, a, h) {
3743
+ if (E instanceof t.Name)
3744
+ return N(E);
3745
+ if (!M(E))
3746
+ return E;
3747
+ return new t._Code(E._items.reduce((L, W) => (W instanceof t.Name && (W = N(W)), W instanceof t._Code ? L.push(...W._items) : L.push(W), L), []));
3723
3748
  function N(L) {
3724
3749
  const W = h[L.str];
3725
3750
  return W === void 0 || a[L.str] !== 1 ? L : (delete a[L.str], W);
@@ -3728,29 +3753,29 @@ var scope = {};
3728
3753
  return L instanceof t._Code && L._items.some((W) => W instanceof t.Name && a[W.str] === 1 && h[W.str] !== void 0);
3729
3754
  }
3730
3755
  }
3731
- function ke(b, a) {
3756
+ function ke(E, a) {
3732
3757
  for (const h in a)
3733
- b[h] = (b[h] || 0) - (a[h] || 0);
3758
+ E[h] = (E[h] || 0) - (a[h] || 0);
3734
3759
  }
3735
- function Ce(b) {
3736
- return typeof b == "boolean" || typeof b == "number" || b === null ? !b : (0, t._)`!${j(b)}`;
3760
+ function Ce(E) {
3761
+ return typeof E == "boolean" || typeof E == "number" || E === null ? !E : (0, t._)`!${j(E)}`;
3737
3762
  }
3738
3763
  e.not = Ce;
3739
3764
  const Le = v(e.operators.AND);
3740
- function et(...b) {
3741
- return b.reduce(Le);
3765
+ function et(...E) {
3766
+ return E.reduce(Le);
3742
3767
  }
3743
3768
  e.and = et;
3744
3769
  const qe = v(e.operators.OR);
3745
- function F(...b) {
3746
- return b.reduce(qe);
3770
+ function F(...E) {
3771
+ return E.reduce(qe);
3747
3772
  }
3748
3773
  e.or = F;
3749
- function v(b) {
3750
- return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${b} ${j(h)}`;
3774
+ function v(E) {
3775
+ return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${E} ${j(h)}`;
3751
3776
  }
3752
- function j(b) {
3753
- return b instanceof t.Name ? b : (0, t._)`(${b})`;
3777
+ function j(E) {
3778
+ return E instanceof t.Name ? E : (0, t._)`(${E})`;
3754
3779
  }
3755
3780
  })(codegen);
3756
3781
  var util = {};
@@ -3758,51 +3783,51 @@ var util = {};
3758
3783
  Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0;
3759
3784
  const t = codegen, r = code$1;
3760
3785
  function n(w) {
3761
- const C = {};
3786
+ const O = {};
3762
3787
  for (const A of w)
3763
- C[A] = !0;
3764
- return C;
3788
+ O[A] = !0;
3789
+ return O;
3765
3790
  }
3766
3791
  e.toHash = n;
3767
- function s(w, C) {
3768
- return typeof C == "boolean" ? C : Object.keys(C).length === 0 ? !0 : (i(w, C), !o(C, w.self.RULES.all));
3792
+ function s(w, O) {
3793
+ return typeof O == "boolean" ? O : Object.keys(O).length === 0 ? !0 : (i(w, O), !o(O, w.self.RULES.all));
3769
3794
  }
3770
3795
  e.alwaysValidSchema = s;
3771
- function i(w, C = w.schema) {
3796
+ function i(w, O = w.schema) {
3772
3797
  const { opts: A, self: x } = w;
3773
- if (!A.strictSchema || typeof C == "boolean")
3798
+ if (!A.strictSchema || typeof O == "boolean")
3774
3799
  return;
3775
3800
  const z = x.RULES.keywords;
3776
- for (const re in C)
3801
+ for (const re in O)
3777
3802
  z[re] || D(w, `unknown keyword: "${re}"`);
3778
3803
  }
3779
3804
  e.checkUnknownRules = i;
3780
- function o(w, C) {
3805
+ function o(w, O) {
3781
3806
  if (typeof w == "boolean")
3782
3807
  return !w;
3783
3808
  for (const A in w)
3784
- if (C[A])
3809
+ if (O[A])
3785
3810
  return !0;
3786
3811
  return !1;
3787
3812
  }
3788
3813
  e.schemaHasRules = o;
3789
- function c(w, C) {
3814
+ function c(w, O) {
3790
3815
  if (typeof w == "boolean")
3791
3816
  return !w;
3792
3817
  for (const A in w)
3793
- if (A !== "$ref" && C.all[A])
3818
+ if (A !== "$ref" && O.all[A])
3794
3819
  return !0;
3795
3820
  return !1;
3796
3821
  }
3797
3822
  e.schemaHasRulesButRef = c;
3798
- function d({ topSchemaRef: w, schemaPath: C }, A, x, z) {
3823
+ function d({ topSchemaRef: w, schemaPath: O }, A, x, z) {
3799
3824
  if (!z) {
3800
3825
  if (typeof A == "number" || typeof A == "boolean")
3801
3826
  return A;
3802
3827
  if (typeof A == "string")
3803
3828
  return (0, t._)`${A}`;
3804
3829
  }
3805
- return (0, t._)`${w}${C}${(0, t.getProperty)(x)}`;
3830
+ return (0, t._)`${w}${O}${(0, t.getProperty)(x)}`;
3806
3831
  }
3807
3832
  e.schemaRefOrVal = d;
3808
3833
  function u(w) {
@@ -3810,65 +3835,65 @@ var util = {};
3810
3835
  }
3811
3836
  e.unescapeFragment = u;
3812
3837
  function p(w) {
3813
- return encodeURIComponent(g(w));
3838
+ return encodeURIComponent(_(w));
3814
3839
  }
3815
3840
  e.escapeFragment = p;
3816
- function g(w) {
3841
+ function _(w) {
3817
3842
  return typeof w == "number" ? `${w}` : w.replace(/~/g, "~0").replace(/\//g, "~1");
3818
3843
  }
3819
- e.escapeJsonPointer = g;
3844
+ e.escapeJsonPointer = _;
3820
3845
  function T(w) {
3821
3846
  return w.replace(/~1/g, "/").replace(/~0/g, "~");
3822
3847
  }
3823
3848
  e.unescapeJsonPointer = T;
3824
- function O(w, C) {
3849
+ function C(w, O) {
3825
3850
  if (Array.isArray(w))
3826
3851
  for (const A of w)
3827
- C(A);
3852
+ O(A);
3828
3853
  else
3829
- C(w);
3854
+ O(w);
3830
3855
  }
3831
- e.eachItem = O;
3832
- function R({ mergeNames: w, mergeToName: C, mergeValues: A, resultToName: x }) {
3856
+ e.eachItem = C;
3857
+ function S({ mergeNames: w, mergeToName: O, mergeValues: A, resultToName: x }) {
3833
3858
  return (z, re, K, ue) => {
3834
- const oe = K === void 0 ? re : K instanceof t.Name ? (re instanceof t.Name ? w(z, re, K) : C(z, re, K), K) : re instanceof t.Name ? (C(z, K, re), re) : A(re, K);
3859
+ const oe = K === void 0 ? re : K instanceof t.Name ? (re instanceof t.Name ? w(z, re, K) : O(z, re, K), K) : re instanceof t.Name ? (O(z, K, re), re) : A(re, K);
3835
3860
  return ue === t.Name && !(oe instanceof t.Name) ? x(z, oe) : oe;
3836
3861
  };
3837
3862
  }
3838
3863
  e.mergeEvaluated = {
3839
- props: R({
3840
- mergeNames: (w, C, A) => w.if((0, t._)`${A} !== true && ${C} !== undefined`, () => {
3841
- w.if((0, t._)`${C} === true`, () => w.assign(A, !0), () => w.assign(A, (0, t._)`${A} || {}`).code((0, t._)`Object.assign(${A}, ${C})`));
3864
+ props: S({
3865
+ mergeNames: (w, O, A) => w.if((0, t._)`${A} !== true && ${O} !== undefined`, () => {
3866
+ w.if((0, t._)`${O} === true`, () => w.assign(A, !0), () => w.assign(A, (0, t._)`${A} || {}`).code((0, t._)`Object.assign(${A}, ${O})`));
3842
3867
  }),
3843
- mergeToName: (w, C, A) => w.if((0, t._)`${A} !== true`, () => {
3844
- C === !0 ? w.assign(A, !0) : (w.assign(A, (0, t._)`${A} || {}`), $(w, A, C));
3868
+ mergeToName: (w, O, A) => w.if((0, t._)`${A} !== true`, () => {
3869
+ O === !0 ? w.assign(A, !0) : (w.assign(A, (0, t._)`${A} || {}`), $(w, A, O));
3845
3870
  }),
3846
- mergeValues: (w, C) => w === !0 ? !0 : { ...w, ...C },
3871
+ mergeValues: (w, O) => w === !0 ? !0 : { ...w, ...O },
3847
3872
  resultToName: k
3848
3873
  }),
3849
- items: R({
3850
- mergeNames: (w, C, A) => w.if((0, t._)`${A} !== true && ${C} !== undefined`, () => w.assign(A, (0, t._)`${C} === true ? true : ${A} > ${C} ? ${A} : ${C}`)),
3851
- mergeToName: (w, C, A) => w.if((0, t._)`${A} !== true`, () => w.assign(A, C === !0 ? !0 : (0, t._)`${A} > ${C} ? ${A} : ${C}`)),
3852
- mergeValues: (w, C) => w === !0 ? !0 : Math.max(w, C),
3853
- resultToName: (w, C) => w.var("items", C)
3874
+ items: S({
3875
+ mergeNames: (w, O, A) => w.if((0, t._)`${A} !== true && ${O} !== undefined`, () => w.assign(A, (0, t._)`${O} === true ? true : ${A} > ${O} ? ${A} : ${O}`)),
3876
+ mergeToName: (w, O, A) => w.if((0, t._)`${A} !== true`, () => w.assign(A, O === !0 ? !0 : (0, t._)`${A} > ${O} ? ${A} : ${O}`)),
3877
+ mergeValues: (w, O) => w === !0 ? !0 : Math.max(w, O),
3878
+ resultToName: (w, O) => w.var("items", O)
3854
3879
  })
3855
3880
  };
3856
- function k(w, C) {
3857
- if (C === !0)
3881
+ function k(w, O) {
3882
+ if (O === !0)
3858
3883
  return w.var("props", !0);
3859
3884
  const A = w.var("props", (0, t._)`{}`);
3860
- return C !== void 0 && $(w, A, C), A;
3885
+ return O !== void 0 && $(w, A, O), A;
3861
3886
  }
3862
3887
  e.evaluatedPropsToName = k;
3863
- function $(w, C, A) {
3864
- Object.keys(A).forEach((x) => w.assign((0, t._)`${C}${(0, t.getProperty)(x)}`, !0));
3888
+ function $(w, O, A) {
3889
+ Object.keys(A).forEach((x) => w.assign((0, t._)`${O}${(0, t.getProperty)(x)}`, !0));
3865
3890
  }
3866
3891
  e.setEvaluated = $;
3867
- const _ = {};
3868
- function y(w, C) {
3892
+ const g = {};
3893
+ function y(w, O) {
3869
3894
  return w.scopeValue("func", {
3870
- ref: C,
3871
- code: _[C.code] || (_[C.code] = new r._Code(C.code))
3895
+ ref: O,
3896
+ code: g[O.code] || (g[O.code] = new r._Code(O.code))
3872
3897
  });
3873
3898
  }
3874
3899
  e.useFunc = y;
@@ -3876,19 +3901,19 @@ var util = {};
3876
3901
  (function(w) {
3877
3902
  w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
3878
3903
  })(P = e.Type || (e.Type = {}));
3879
- function I(w, C, A) {
3904
+ function I(w, O, A) {
3880
3905
  if (w instanceof t.Name) {
3881
- const x = C === P.Num;
3906
+ const x = O === P.Num;
3882
3907
  return A ? x ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : x ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
3883
3908
  }
3884
- return A ? (0, t.getProperty)(w).toString() : "/" + g(w);
3909
+ return A ? (0, t.getProperty)(w).toString() : "/" + _(w);
3885
3910
  }
3886
3911
  e.getErrorPath = I;
3887
- function D(w, C, A = w.opts.strictSchema) {
3912
+ function D(w, O, A = w.opts.strictSchema) {
3888
3913
  if (A) {
3889
- if (C = `strict mode: ${C}`, A === !0)
3890
- throw new Error(C);
3891
- w.self.logger.warn(C);
3914
+ if (O = `strict mode: ${O}`, A === !0)
3915
+ throw new Error(O);
3916
+ w.self.logger.warn(O);
3892
3917
  }
3893
3918
  }
3894
3919
  e.checkStrictMode = D;
@@ -3925,38 +3950,38 @@ names$1.default = names;
3925
3950
  e.keywordError = {
3926
3951
  message: ({ keyword: $ }) => (0, t.str)`must pass "${$}" keyword validation`
3927
3952
  }, e.keyword$DataError = {
3928
- message: ({ keyword: $, schemaType: _ }) => _ ? (0, t.str)`"${$}" keyword must be ${_} ($data)` : (0, t.str)`"${$}" keyword is invalid ($data)`
3953
+ message: ({ keyword: $, schemaType: g }) => g ? (0, t.str)`"${$}" keyword must be ${g} ($data)` : (0, t.str)`"${$}" keyword is invalid ($data)`
3929
3954
  };
3930
- function s($, _ = e.keywordError, y, P) {
3931
- const { it: I } = $, { gen: D, compositeRule: w, allErrors: C } = I, A = g($, _, y);
3932
- P ?? (w || C) ? d(D, A) : u(I, (0, t._)`[${A}]`);
3955
+ function s($, g = e.keywordError, y, P) {
3956
+ const { it: I } = $, { gen: D, compositeRule: w, allErrors: O } = I, A = _($, g, y);
3957
+ P ?? (w || O) ? d(D, A) : u(I, (0, t._)`[${A}]`);
3933
3958
  }
3934
3959
  e.reportError = s;
3935
- function i($, _ = e.keywordError, y) {
3936
- const { it: P } = $, { gen: I, compositeRule: D, allErrors: w } = P, C = g($, _, y);
3937
- d(I, C), D || w || u(P, n.default.vErrors);
3960
+ function i($, g = e.keywordError, y) {
3961
+ const { it: P } = $, { gen: I, compositeRule: D, allErrors: w } = P, O = _($, g, y);
3962
+ d(I, O), D || w || u(P, n.default.vErrors);
3938
3963
  }
3939
3964
  e.reportExtraError = i;
3940
- function o($, _) {
3941
- $.assign(n.default.errors, _), $.if((0, t._)`${n.default.vErrors} !== null`, () => $.if(_, () => $.assign((0, t._)`${n.default.vErrors}.length`, _), () => $.assign(n.default.vErrors, null)));
3965
+ function o($, g) {
3966
+ $.assign(n.default.errors, g), $.if((0, t._)`${n.default.vErrors} !== null`, () => $.if(g, () => $.assign((0, t._)`${n.default.vErrors}.length`, g), () => $.assign(n.default.vErrors, null)));
3942
3967
  }
3943
3968
  e.resetErrorsCount = o;
3944
- function c({ gen: $, keyword: _, schemaValue: y, data: P, errsCount: I, it: D }) {
3969
+ function c({ gen: $, keyword: g, schemaValue: y, data: P, errsCount: I, it: D }) {
3945
3970
  if (I === void 0)
3946
3971
  throw new Error("ajv implementation error");
3947
3972
  const w = $.name("err");
3948
- $.forRange("i", I, n.default.errors, (C) => {
3949
- $.const(w, (0, t._)`${n.default.vErrors}[${C}]`), $.if((0, t._)`${w}.instancePath === undefined`, () => $.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), $.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${_}`), D.opts.verbose && ($.assign((0, t._)`${w}.schema`, y), $.assign((0, t._)`${w}.data`, P));
3973
+ $.forRange("i", I, n.default.errors, (O) => {
3974
+ $.const(w, (0, t._)`${n.default.vErrors}[${O}]`), $.if((0, t._)`${w}.instancePath === undefined`, () => $.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), $.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${g}`), D.opts.verbose && ($.assign((0, t._)`${w}.schema`, y), $.assign((0, t._)`${w}.data`, P));
3950
3975
  });
3951
3976
  }
3952
3977
  e.extendErrors = c;
3953
- function d($, _) {
3954
- const y = $.const("err", _);
3978
+ function d($, g) {
3979
+ const y = $.const("err", g);
3955
3980
  $.if((0, t._)`${n.default.vErrors} === null`, () => $.assign(n.default.vErrors, (0, t._)`[${y}]`), (0, t._)`${n.default.vErrors}.push(${y})`), $.code((0, t._)`${n.default.errors}++`);
3956
3981
  }
3957
- function u($, _) {
3982
+ function u($, g) {
3958
3983
  const { gen: y, validateName: P, schemaEnv: I } = $;
3959
- I.$async ? y.throw((0, t._)`new ${$.ValidationError}(${_})`) : (y.assign((0, t._)`${P}.errors`, _), y.return(!1));
3984
+ I.$async ? y.throw((0, t._)`new ${$.ValidationError}(${g})`) : (y.assign((0, t._)`${P}.errors`, g), y.return(!1));
3960
3985
  }
3961
3986
  const p = {
3962
3987
  keyword: new t.Name("keyword"),
@@ -3967,28 +3992,28 @@ names$1.default = names;
3967
3992
  schema: new t.Name("schema"),
3968
3993
  parentSchema: new t.Name("parentSchema")
3969
3994
  };
3970
- function g($, _, y) {
3995
+ function _($, g, y) {
3971
3996
  const { createErrors: P } = $.it;
3972
- return P === !1 ? (0, t._)`{}` : T($, _, y);
3997
+ return P === !1 ? (0, t._)`{}` : T($, g, y);
3973
3998
  }
3974
- function T($, _, y = {}) {
3999
+ function T($, g, y = {}) {
3975
4000
  const { gen: P, it: I } = $, D = [
3976
- O(I, y),
3977
- R($, y)
4001
+ C(I, y),
4002
+ S($, y)
3978
4003
  ];
3979
- return k($, _, D), P.object(...D);
4004
+ return k($, g, D), P.object(...D);
3980
4005
  }
3981
- function O({ errorPath: $ }, { instancePath: _ }) {
3982
- const y = _ ? (0, t.str)`${$}${(0, r.getErrorPath)(_, r.Type.Str)}` : $;
4006
+ function C({ errorPath: $ }, { instancePath: g }) {
4007
+ const y = g ? (0, t.str)`${$}${(0, r.getErrorPath)(g, r.Type.Str)}` : $;
3983
4008
  return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, y)];
3984
4009
  }
3985
- function R({ keyword: $, it: { errSchemaPath: _ } }, { schemaPath: y, parentSchema: P }) {
3986
- let I = P ? _ : (0, t.str)`${_}/${$}`;
4010
+ function S({ keyword: $, it: { errSchemaPath: g } }, { schemaPath: y, parentSchema: P }) {
4011
+ let I = P ? g : (0, t.str)`${g}/${$}`;
3987
4012
  return y && (I = (0, t.str)`${I}${(0, r.getErrorPath)(y, r.Type.Str)}`), [p.schemaPath, I];
3988
4013
  }
3989
- function k($, { params: _, message: y }, P) {
3990
- const { keyword: I, data: D, schemaValue: w, it: C } = $, { opts: A, propertyName: x, topSchemaRef: z, schemaPath: re } = C;
3991
- P.push([p.keyword, I], [p.params, typeof _ == "function" ? _($) : _ || (0, t._)`{}`]), A.messages && P.push([p.message, typeof y == "function" ? y($) : y]), A.verbose && P.push([p.schema, w], [p.parentSchema, (0, t._)`${z}${re}`], [n.default.data, D]), x && P.push([p.propertyName, x]);
4014
+ function k($, { params: g, message: y }, P) {
4015
+ const { keyword: I, data: D, schemaValue: w, it: O } = $, { opts: A, propertyName: x, topSchemaRef: z, schemaPath: re } = O;
4016
+ P.push([p.keyword, I], [p.params, typeof g == "function" ? g($) : g || (0, t._)`{}`]), A.messages && P.push([p.message, typeof y == "function" ? y($) : y]), A.verbose && P.push([p.schema, w], [p.parentSchema, (0, t._)`${z}${re}`], [n.default.data, D]), x && P.push([p.propertyName, x]);
3992
4017
  }
3993
4018
  })(errors);
3994
4019
  Object.defineProperty(boolSchema, "__esModule", { value: !0 });
@@ -4088,62 +4113,62 @@ applicability.shouldUseRule = shouldUseRule;
4088
4113
  }
4089
4114
  e.getJSONTypes = d;
4090
4115
  function u(P, I) {
4091
- const { gen: D, data: w, opts: C } = P, A = g(I, C.coerceTypes), x = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
4116
+ const { gen: D, data: w, opts: O } = P, A = _(I, O.coerceTypes), x = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
4092
4117
  if (x) {
4093
- const z = k(I, w, C.strictNumbers, o.Wrong);
4118
+ const z = k(I, w, O.strictNumbers, o.Wrong);
4094
4119
  D.if(z, () => {
4095
- A.length ? T(P, I, A) : _(P);
4120
+ A.length ? T(P, I, A) : g(P);
4096
4121
  });
4097
4122
  }
4098
4123
  return x;
4099
4124
  }
4100
4125
  e.coerceAndCheckDataType = u;
4101
4126
  const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
4102
- function g(P, I) {
4127
+ function _(P, I) {
4103
4128
  return I ? P.filter((D) => p.has(D) || I === "array" && D === "array") : [];
4104
4129
  }
4105
4130
  function T(P, I, D) {
4106
- const { gen: w, data: C, opts: A } = P, x = w.let("dataType", (0, s._)`typeof ${C}`), z = w.let("coerced", (0, s._)`undefined`);
4107
- A.coerceTypes === "array" && w.if((0, s._)`${x} == 'object' && Array.isArray(${C}) && ${C}.length == 1`, () => w.assign(C, (0, s._)`${C}[0]`).assign(x, (0, s._)`typeof ${C}`).if(k(I, C, A.strictNumbers), () => w.assign(z, C))), w.if((0, s._)`${z} !== undefined`);
4131
+ const { gen: w, data: O, opts: A } = P, x = w.let("dataType", (0, s._)`typeof ${O}`), z = w.let("coerced", (0, s._)`undefined`);
4132
+ A.coerceTypes === "array" && w.if((0, s._)`${x} == 'object' && Array.isArray(${O}) && ${O}.length == 1`, () => w.assign(O, (0, s._)`${O}[0]`).assign(x, (0, s._)`typeof ${O}`).if(k(I, O, A.strictNumbers), () => w.assign(z, O))), w.if((0, s._)`${z} !== undefined`);
4108
4133
  for (const K of D)
4109
4134
  (p.has(K) || K === "array" && A.coerceTypes === "array") && re(K);
4110
- w.else(), _(P), w.endIf(), w.if((0, s._)`${z} !== undefined`, () => {
4111
- w.assign(C, z), O(P, z);
4135
+ w.else(), g(P), w.endIf(), w.if((0, s._)`${z} !== undefined`, () => {
4136
+ w.assign(O, z), C(P, z);
4112
4137
  });
4113
4138
  function re(K) {
4114
4139
  switch (K) {
4115
4140
  case "string":
4116
- w.elseIf((0, s._)`${x} == "number" || ${x} == "boolean"`).assign(z, (0, s._)`"" + ${C}`).elseIf((0, s._)`${C} === null`).assign(z, (0, s._)`""`);
4141
+ w.elseIf((0, s._)`${x} == "number" || ${x} == "boolean"`).assign(z, (0, s._)`"" + ${O}`).elseIf((0, s._)`${O} === null`).assign(z, (0, s._)`""`);
4117
4142
  return;
4118
4143
  case "number":
4119
- w.elseIf((0, s._)`${x} == "boolean" || ${C} === null
4120
- || (${x} == "string" && ${C} && ${C} == +${C})`).assign(z, (0, s._)`+${C}`);
4144
+ w.elseIf((0, s._)`${x} == "boolean" || ${O} === null
4145
+ || (${x} == "string" && ${O} && ${O} == +${O})`).assign(z, (0, s._)`+${O}`);
4121
4146
  return;
4122
4147
  case "integer":
4123
- w.elseIf((0, s._)`${x} === "boolean" || ${C} === null
4124
- || (${x} === "string" && ${C} && ${C} == +${C} && !(${C} % 1))`).assign(z, (0, s._)`+${C}`);
4148
+ w.elseIf((0, s._)`${x} === "boolean" || ${O} === null
4149
+ || (${x} === "string" && ${O} && ${O} == +${O} && !(${O} % 1))`).assign(z, (0, s._)`+${O}`);
4125
4150
  return;
4126
4151
  case "boolean":
4127
- w.elseIf((0, s._)`${C} === "false" || ${C} === 0 || ${C} === null`).assign(z, !1).elseIf((0, s._)`${C} === "true" || ${C} === 1`).assign(z, !0);
4152
+ w.elseIf((0, s._)`${O} === "false" || ${O} === 0 || ${O} === null`).assign(z, !1).elseIf((0, s._)`${O} === "true" || ${O} === 1`).assign(z, !0);
4128
4153
  return;
4129
4154
  case "null":
4130
- w.elseIf((0, s._)`${C} === "" || ${C} === 0 || ${C} === false`), w.assign(z, null);
4155
+ w.elseIf((0, s._)`${O} === "" || ${O} === 0 || ${O} === false`), w.assign(z, null);
4131
4156
  return;
4132
4157
  case "array":
4133
4158
  w.elseIf((0, s._)`${x} === "string" || ${x} === "number"
4134
- || ${x} === "boolean" || ${C} === null`).assign(z, (0, s._)`[${C}]`);
4159
+ || ${x} === "boolean" || ${O} === null`).assign(z, (0, s._)`[${O}]`);
4135
4160
  }
4136
4161
  }
4137
4162
  }
4138
- function O({ gen: P, parentData: I, parentDataProperty: D }, w) {
4163
+ function C({ gen: P, parentData: I, parentDataProperty: D }, w) {
4139
4164
  P.if((0, s._)`${I} !== undefined`, () => P.assign((0, s._)`${I}[${D}]`, w));
4140
4165
  }
4141
- function R(P, I, D, w = o.Correct) {
4142
- const C = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
4166
+ function S(P, I, D, w = o.Correct) {
4167
+ const O = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
4143
4168
  let A;
4144
4169
  switch (P) {
4145
4170
  case "null":
4146
- return (0, s._)`${I} ${C} null`;
4171
+ return (0, s._)`${I} ${O} null`;
4147
4172
  case "array":
4148
4173
  A = (0, s._)`Array.isArray(${I})`;
4149
4174
  break;
@@ -4157,48 +4182,48 @@ applicability.shouldUseRule = shouldUseRule;
4157
4182
  A = x();
4158
4183
  break;
4159
4184
  default:
4160
- return (0, s._)`typeof ${I} ${C} ${P}`;
4185
+ return (0, s._)`typeof ${I} ${O} ${P}`;
4161
4186
  }
4162
4187
  return w === o.Correct ? A : (0, s.not)(A);
4163
4188
  function x(z = s.nil) {
4164
4189
  return (0, s.and)((0, s._)`typeof ${I} == "number"`, z, D ? (0, s._)`isFinite(${I})` : s.nil);
4165
4190
  }
4166
4191
  }
4167
- e.checkDataType = R;
4192
+ e.checkDataType = S;
4168
4193
  function k(P, I, D, w) {
4169
4194
  if (P.length === 1)
4170
- return R(P[0], I, D, w);
4171
- let C;
4195
+ return S(P[0], I, D, w);
4196
+ let O;
4172
4197
  const A = (0, i.toHash)(P);
4173
4198
  if (A.array && A.object) {
4174
4199
  const x = (0, s._)`typeof ${I} != "object"`;
4175
- C = A.null ? x : (0, s._)`!${I} || ${x}`, delete A.null, delete A.array, delete A.object;
4200
+ O = A.null ? x : (0, s._)`!${I} || ${x}`, delete A.null, delete A.array, delete A.object;
4176
4201
  } else
4177
- C = s.nil;
4202
+ O = s.nil;
4178
4203
  A.number && delete A.integer;
4179
4204
  for (const x in A)
4180
- C = (0, s.and)(C, R(x, I, D, w));
4181
- return C;
4205
+ O = (0, s.and)(O, S(x, I, D, w));
4206
+ return O;
4182
4207
  }
4183
4208
  e.checkDataTypes = k;
4184
4209
  const $ = {
4185
4210
  message: ({ schema: P }) => `must be ${P}`,
4186
4211
  params: ({ schema: P, schemaValue: I }) => typeof P == "string" ? (0, s._)`{type: ${P}}` : (0, s._)`{type: ${I}}`
4187
4212
  };
4188
- function _(P) {
4213
+ function g(P) {
4189
4214
  const I = y(P);
4190
4215
  (0, n.reportError)(I, $);
4191
4216
  }
4192
- e.reportTypeError = _;
4217
+ e.reportTypeError = g;
4193
4218
  function y(P) {
4194
- const { gen: I, data: D, schema: w } = P, C = (0, i.schemaRefOrVal)(P, w, "type");
4219
+ const { gen: I, data: D, schema: w } = P, O = (0, i.schemaRefOrVal)(P, w, "type");
4195
4220
  return {
4196
4221
  gen: I,
4197
4222
  keyword: "type",
4198
4223
  data: D,
4199
4224
  schema: w.type,
4200
- schemaCode: C,
4201
- schemaValue: C,
4225
+ schemaCode: O,
4226
+ schemaValue: O,
4202
4227
  parentSchema: w,
4203
4228
  params: {},
4204
4229
  it: P
@@ -4280,14 +4305,14 @@ function schemaProperties(e, t) {
4280
4305
  }
4281
4306
  code.schemaProperties = schemaProperties;
4282
4307
  function callValidateCode({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath: s, errorPath: i }, it: o }, c, d, u) {
4283
- const p = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, g = [
4308
+ const p = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, _ = [
4284
4309
  [names_1$5.default.instancePath, (0, codegen_1$q.strConcat)(names_1$5.default.instancePath, i)],
4285
4310
  [names_1$5.default.parentData, o.parentData],
4286
4311
  [names_1$5.default.parentDataProperty, o.parentDataProperty],
4287
4312
  [names_1$5.default.rootData, names_1$5.default.rootData]
4288
4313
  ];
4289
- o.opts.dynamicRef && g.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
4290
- const T = (0, codegen_1$q._)`${p}, ${r.object(...g)}`;
4314
+ o.opts.dynamicRef && _.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
4315
+ const T = (0, codegen_1$q._)`${p}, ${r.object(..._)}`;
4291
4316
  return d !== codegen_1$q.nil ? (0, codegen_1$q._)`${c}.call(${d}, ${T})` : (0, codegen_1$q._)`${c}(${T})`;
4292
4317
  }
4293
4318
  code.callValidateCode = callValidateCode;
@@ -4357,31 +4382,31 @@ function funcKeywordCode(e, t) {
4357
4382
  var r;
4358
4383
  const { gen: n, keyword: s, schema: i, parentSchema: o, $data: c, it: d } = e;
4359
4384
  checkAsyncKeyword(d, t);
4360
- const u = !c && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = useKeyword(n, s, u), g = n.let("valid");
4361
- e.block$data(g, T), e.ok((r = t.valid) !== null && r !== void 0 ? r : g);
4385
+ const u = !c && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = useKeyword(n, s, u), _ = n.let("valid");
4386
+ e.block$data(_, T), e.ok((r = t.valid) !== null && r !== void 0 ? r : _);
4362
4387
  function T() {
4363
4388
  if (t.errors === !1)
4364
4389
  k(), t.modifying && modifyData(e), $(() => e.error());
4365
4390
  else {
4366
- const _ = t.async ? O() : R();
4367
- t.modifying && modifyData(e), $(() => addErrs(e, _));
4391
+ const g = t.async ? C() : S();
4392
+ t.modifying && modifyData(e), $(() => addErrs(e, g));
4368
4393
  }
4369
4394
  }
4370
- function O() {
4371
- const _ = n.let("ruleErrs", null);
4372
- return n.try(() => k((0, codegen_1$p._)`await `), (y) => n.assign(g, !1).if((0, codegen_1$p._)`${y} instanceof ${d.ValidationError}`, () => n.assign(_, (0, codegen_1$p._)`${y}.errors`), () => n.throw(y))), _;
4395
+ function C() {
4396
+ const g = n.let("ruleErrs", null);
4397
+ return n.try(() => k((0, codegen_1$p._)`await `), (y) => n.assign(_, !1).if((0, codegen_1$p._)`${y} instanceof ${d.ValidationError}`, () => n.assign(g, (0, codegen_1$p._)`${y}.errors`), () => n.throw(y))), g;
4373
4398
  }
4374
- function R() {
4375
- const _ = (0, codegen_1$p._)`${p}.errors`;
4376
- return n.assign(_, null), k(codegen_1$p.nil), _;
4399
+ function S() {
4400
+ const g = (0, codegen_1$p._)`${p}.errors`;
4401
+ return n.assign(g, null), k(codegen_1$p.nil), g;
4377
4402
  }
4378
- function k(_ = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
4403
+ function k(g = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
4379
4404
  const y = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, P = !("compile" in t && !c || t.schema === !1);
4380
- n.assign(g, (0, codegen_1$p._)`${_}${(0, code_1$9.callValidateCode)(e, p, y, P)}`, t.modifying);
4405
+ n.assign(_, (0, codegen_1$p._)`${g}${(0, code_1$9.callValidateCode)(e, p, y, P)}`, t.modifying);
4381
4406
  }
4382
- function $(_) {
4407
+ function $(g) {
4383
4408
  var y;
4384
- n.if((0, codegen_1$p.not)((y = t.valid) !== null && y !== void 0 ? y : g), _);
4409
+ n.if((0, codegen_1$p.not)((y = t.valid) !== null && y !== void 0 ? y : _), g);
4385
4410
  }
4386
4411
  }
4387
4412
  keyword.funcKeywordCode = funcKeywordCode;
@@ -4460,8 +4485,8 @@ function extendSubschemaData(e, t, { dataProp: r, dataPropType: n, data: s, data
4460
4485
  throw new Error('both "data" and "dataProp" passed, only one allowed');
4461
4486
  const { gen: c } = t;
4462
4487
  if (r !== void 0) {
4463
- const { errorPath: u, dataPathArr: p, opts: g } = t, T = c.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
4464
- d(T), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, g.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...p, e.parentDataProperty];
4488
+ const { errorPath: u, dataPathArr: p, opts: _ } = t, T = c.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
4489
+ d(T), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, _.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...p, e.parentDataProperty];
4465
4490
  }
4466
4491
  if (s !== void 0) {
4467
4492
  const u = s instanceof codegen_1$o.Name ? s : c.let("data", s, !0);
@@ -4566,17 +4591,17 @@ function _traverse(e, t, r, n, s, i, o, c, d, u) {
4566
4591
  if (n && typeof n == "object" && !Array.isArray(n)) {
4567
4592
  t(n, s, i, o, c, d, u);
4568
4593
  for (var p in n) {
4569
- var g = n[p];
4570
- if (Array.isArray(g)) {
4594
+ var _ = n[p];
4595
+ if (Array.isArray(_)) {
4571
4596
  if (p in traverse$1.arrayKeywords)
4572
- for (var T = 0; T < g.length; T++)
4573
- _traverse(e, t, r, g[T], s + "/" + p + "/" + T, i, s, p, n, T);
4597
+ for (var T = 0; T < _.length; T++)
4598
+ _traverse(e, t, r, _[T], s + "/" + p + "/" + T, i, s, p, n, T);
4574
4599
  } else if (p in traverse$1.propsKeywords) {
4575
- if (g && typeof g == "object")
4576
- for (var O in g)
4577
- _traverse(e, t, r, g[O], s + "/" + p + "/" + escapeJsonPtr(O), i, s, p, n, O);
4600
+ if (_ && typeof _ == "object")
4601
+ for (var C in _)
4602
+ _traverse(e, t, r, _[C], s + "/" + p + "/" + escapeJsonPtr(C), i, s, p, n, C);
4578
4603
  } else
4579
- (p in traverse$1.keywords || e.allKeys && !(p in traverse$1.skipKeywords)) && _traverse(e, t, r, g, s + "/" + p, i, s, p, n);
4604
+ (p in traverse$1.keywords || e.allKeys && !(p in traverse$1.skipKeywords)) && _traverse(e, t, r, _, s + "/" + p, i, s, p, n);
4580
4605
  }
4581
4606
  r(n, s, i, o, c, d, u);
4582
4607
  }
@@ -4660,34 +4685,34 @@ function getSchemaRefs(e, t) {
4660
4685
  if (typeof e == "boolean")
4661
4686
  return {};
4662
4687
  const { schemaId: r, uriResolver: n } = this.opts, s = normalizeId(e[r] || t), i = { "": s }, o = getFullPath(n, s, !1), c = {}, d = /* @__PURE__ */ new Set();
4663
- return traverse(e, { allKeys: !0 }, (g, T, O, R) => {
4664
- if (R === void 0)
4688
+ return traverse(e, { allKeys: !0 }, (_, T, C, S) => {
4689
+ if (S === void 0)
4665
4690
  return;
4666
4691
  const k = o + T;
4667
- let $ = i[R];
4668
- typeof g[r] == "string" && ($ = _.call(this, g[r])), y.call(this, g.$anchor), y.call(this, g.$dynamicAnchor), i[T] = $;
4669
- function _(P) {
4692
+ let $ = i[S];
4693
+ typeof _[r] == "string" && ($ = g.call(this, _[r])), y.call(this, _.$anchor), y.call(this, _.$dynamicAnchor), i[T] = $;
4694
+ function g(P) {
4670
4695
  const I = this.opts.uriResolver.resolve;
4671
4696
  if (P = normalizeId($ ? I($, P) : P), d.has(P))
4672
4697
  throw p(P);
4673
4698
  d.add(P);
4674
4699
  let D = this.refs[P];
4675
- return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(g, D.schema, P) : P !== normalizeId(k) && (P[0] === "#" ? (u(g, c[P], P), c[P] = g) : this.refs[P] = k), P;
4700
+ return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(_, D.schema, P) : P !== normalizeId(k) && (P[0] === "#" ? (u(_, c[P], P), c[P] = _) : this.refs[P] = k), P;
4676
4701
  }
4677
4702
  function y(P) {
4678
4703
  if (typeof P == "string") {
4679
4704
  if (!ANCHOR.test(P))
4680
4705
  throw new Error(`invalid anchor "${P}"`);
4681
- _.call(this, `#${P}`);
4706
+ g.call(this, `#${P}`);
4682
4707
  }
4683
4708
  }
4684
4709
  }), c;
4685
- function u(g, T, O) {
4686
- if (T !== void 0 && !equal$2(g, T))
4687
- throw p(O);
4710
+ function u(_, T, C) {
4711
+ if (T !== void 0 && !equal$2(_, T))
4712
+ throw p(C);
4688
4713
  }
4689
- function p(g) {
4690
- return new Error(`reference "${g}" resolves to more than one schema`);
4714
+ function p(_) {
4715
+ return new Error(`reference "${_}" resolves to more than one schema`);
4691
4716
  }
4692
4717
  }
4693
4718
  resolve$1.getSchemaRefs = getSchemaRefs;
@@ -4804,10 +4829,10 @@ function schemaKeywords(e, t, r, n) {
4804
4829
  }
4805
4830
  d.jtd || checkStrictTypes(e, t), s.block(() => {
4806
4831
  for (const T of p.rules)
4807
- g(T);
4808
- g(p.post);
4832
+ _(T);
4833
+ _(p.post);
4809
4834
  });
4810
- function g(T) {
4835
+ function _(T) {
4811
4836
  (0, applicability_1.shouldUseGroup)(i, T) && (T.type ? (s.if((0, dataType_2.checkDataType)(T.type, o, d.strictNumbers)), iterateKeywords(e, T), t.length === 1 && t[0] === T.type && r && (s.else(), (0, dataType_2.reportTypeError)(e)), s.endIf()) : iterateKeywords(e, T), c || s.if((0, codegen_1$n._)`${names_1$3.default.errors} === ${n || 0}`));
4812
4837
  }
4813
4838
  }
@@ -5070,21 +5095,21 @@ function compileSchema(e) {
5070
5095
  let p;
5071
5096
  try {
5072
5097
  this._compilations.add(e), (0, validate_1$1.validateFunctionCode)(u), o.optimize(this.opts.code.optimize);
5073
- const g = o.toString();
5074
- p = `${o.scopeRefs(names_1$2.default.scope)}return ${g}`, this.opts.code.process && (p = this.opts.code.process(p, e));
5075
- const O = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
5076
- if (this.scope.value(d, { ref: O }), O.errors = null, O.schema = e.schema, O.schemaEnv = e, e.$async && (O.$async = !0), this.opts.code.source === !0 && (O.source = { validateName: d, validateCode: g, scopeValues: o._values }), this.opts.unevaluated) {
5077
- const { props: R, items: k } = u;
5078
- O.evaluated = {
5079
- props: R instanceof codegen_1$m.Name ? void 0 : R,
5098
+ const _ = o.toString();
5099
+ p = `${o.scopeRefs(names_1$2.default.scope)}return ${_}`, this.opts.code.process && (p = this.opts.code.process(p, e));
5100
+ const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
5101
+ if (this.scope.value(d, { ref: C }), C.errors = null, C.schema = e.schema, C.schemaEnv = e, e.$async && (C.$async = !0), this.opts.code.source === !0 && (C.source = { validateName: d, validateCode: _, scopeValues: o._values }), this.opts.unevaluated) {
5102
+ const { props: S, items: k } = u;
5103
+ C.evaluated = {
5104
+ props: S instanceof codegen_1$m.Name ? void 0 : S,
5080
5105
  items: k instanceof codegen_1$m.Name ? void 0 : k,
5081
- dynamicProps: R instanceof codegen_1$m.Name,
5106
+ dynamicProps: S instanceof codegen_1$m.Name,
5082
5107
  dynamicItems: k instanceof codegen_1$m.Name
5083
- }, O.source && (O.source.evaluated = (0, codegen_1$m.stringify)(O.evaluated));
5108
+ }, C.source && (C.source.evaluated = (0, codegen_1$m.stringify)(C.evaluated));
5084
5109
  }
5085
- return e.validate = O, e;
5086
- } catch (g) {
5087
- throw delete e.validate, delete e.validateName, p && this.logger.error("Error compiling schema, function code:", p), g;
5110
+ return e.validate = C, e;
5111
+ } catch (_) {
5112
+ throw delete e.validate, delete e.validateName, p && this.logger.error("Error compiling schema, function code:", p), _;
5088
5113
  } finally {
5089
5114
  this._compilations.delete(e);
5090
5115
  }
@@ -5205,9 +5230,9 @@ var uri$1 = {}, uri_all = { exports: {} };
5205
5230
  l[m] = arguments[m];
5206
5231
  if (l.length > 1) {
5207
5232
  l[0] = l[0].slice(0, -1);
5208
- for (var S = l.length - 1, E = 1; E < S; ++E)
5209
- l[E] = l[E].slice(1, -1);
5210
- return l[S] = l[S].slice(1), l.join("");
5233
+ for (var R = l.length - 1, b = 1; b < R; ++b)
5234
+ l[b] = l[b].slice(1, -1);
5235
+ return l[R] = l[R].slice(1), l.join("");
5211
5236
  } else
5212
5237
  return l[0];
5213
5238
  }
@@ -5226,17 +5251,17 @@ var uri$1 = {}, uri_all = { exports: {} };
5226
5251
  function d(f, l) {
5227
5252
  var m = f;
5228
5253
  if (l)
5229
- for (var S in l)
5230
- m[S] = l[S];
5254
+ for (var R in l)
5255
+ m[R] = l[R];
5231
5256
  return m;
5232
5257
  }
5233
5258
  function u(f) {
5234
- var l = "[A-Za-z]", m = "[0-9]", S = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + S + "%" + S + S + "%" + S + S) + "|" + s("%[89A-Fa-f]" + S + "%" + S + S) + "|" + s("%" + S + S)), q = "[\\:\\/\\?\\#\\[\\]\\@]", U = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", J = n(q, U), Y = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", se = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(l, m, "[\\-\\.\\_\\~]", Y);
5235
- s(l + n(l, m, "[\\+\\-\\.]") + "*"), s(s(E + "|" + n(B, U, "[\\:]")) + "*");
5236
- var Z = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), ie = s(Z + "\\." + Z + "\\." + Z + "\\." + Z), V = s(S + "{1,4}"), X = s(s(V + "\\:" + V) + "|" + ie), ae = s(s(V + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(V + "\\:") + "{5}" + X), Se = s(s(V) + "?\\:\\:" + s(V + "\\:") + "{4}" + X), ge = s(s(s(V + "\\:") + "{0,1}" + V) + "?\\:\\:" + s(V + "\\:") + "{3}" + X), ye = s(s(s(V + "\\:") + "{0,2}" + V) + "?\\:\\:" + s(V + "\\:") + "{2}" + X), Be = s(s(s(V + "\\:") + "{0,3}" + V) + "?\\:\\:" + V + "\\:" + X), Ie = s(s(s(V + "\\:") + "{0,4}" + V) + "?\\:\\:" + X), fe = s(s(s(V + "\\:") + "{0,5}" + V) + "?\\:\\:" + V), $e = s(s(s(V + "\\:") + "{0,6}" + V) + "?\\:\\:"), je = s([ae, ee, Se, ge, ye, Be, Ie, fe, $e].join("|")), we = s(s(B + "|" + E) + "+");
5237
- s("[vV]" + S + "+\\." + n(B, U, "[\\:]") + "+"), s(s(E + "|" + n(B, U)) + "*");
5238
- var ct = s(E + "|" + n(B, U, "[\\:\\@]"));
5239
- return s(s(E + "|" + n(B, U, "[\\@]")) + "+"), s(s(ct + "|" + n("[\\/\\?]", se)) + "*"), {
5259
+ var l = "[A-Za-z]", m = "[0-9]", R = n(m, "[A-Fa-f]"), b = s(s("%[EFef]" + R + "%" + R + R + "%" + R + R) + "|" + s("%[89A-Fa-f]" + R + "%" + R + R) + "|" + s("%" + R + R)), q = "[\\:\\/\\?\\#\\[\\]\\@]", U = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", J = n(q, U), Y = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", se = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(l, m, "[\\-\\.\\_\\~]", Y);
5260
+ s(l + n(l, m, "[\\+\\-\\.]") + "*"), s(s(b + "|" + n(B, U, "[\\:]")) + "*");
5261
+ var Z = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), ie = s(Z + "\\." + Z + "\\." + Z + "\\." + Z), V = s(R + "{1,4}"), X = s(s(V + "\\:" + V) + "|" + ie), ae = s(s(V + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(V + "\\:") + "{5}" + X), Se = s(s(V) + "?\\:\\:" + s(V + "\\:") + "{4}" + X), ge = s(s(s(V + "\\:") + "{0,1}" + V) + "?\\:\\:" + s(V + "\\:") + "{3}" + X), ye = s(s(s(V + "\\:") + "{0,2}" + V) + "?\\:\\:" + s(V + "\\:") + "{2}" + X), Be = s(s(s(V + "\\:") + "{0,3}" + V) + "?\\:\\:" + V + "\\:" + X), Ie = s(s(s(V + "\\:") + "{0,4}" + V) + "?\\:\\:" + X), fe = s(s(s(V + "\\:") + "{0,5}" + V) + "?\\:\\:" + V), $e = s(s(s(V + "\\:") + "{0,6}" + V) + "?\\:\\:"), je = s([ae, ee, Se, ge, ye, Be, Ie, fe, $e].join("|")), we = s(s(B + "|" + b) + "+");
5262
+ s("[vV]" + R + "+\\." + n(B, U, "[\\:]") + "+"), s(s(b + "|" + n(B, U)) + "*");
5263
+ var ct = s(b + "|" + n(B, U, "[\\:\\@]"));
5264
+ return s(s(b + "|" + n(B, U, "[\\@]")) + "+"), s(s(ct + "|" + n("[\\/\\?]", se)) + "*"), {
5240
5265
  NOT_SCHEME: new RegExp(n("[^]", l, m, "[\\+\\-\\.]"), "g"),
5241
5266
  NOT_USERINFO: new RegExp(n("[^\\%\\:]", B, U), "g"),
5242
5267
  NOT_HOST: new RegExp(n("[^\\%\\[\\]\\:]", B, U), "g"),
@@ -5247,29 +5272,29 @@ var uri$1 = {}, uri_all = { exports: {} };
5247
5272
  ESCAPE: new RegExp(n("[^]", B, U), "g"),
5248
5273
  UNRESERVED: new RegExp(B, "g"),
5249
5274
  OTHER_CHARS: new RegExp(n("[^\\%]", B, J), "g"),
5250
- PCT_ENCODED: new RegExp(E, "g"),
5275
+ PCT_ENCODED: new RegExp(b, "g"),
5251
5276
  IPV4ADDRESS: new RegExp("^(" + ie + ")$"),
5252
- IPV6ADDRESS: new RegExp("^\\[?(" + je + ")" + s(s("\\%25|\\%(?!" + S + "{2})") + "(" + we + ")") + "?\\]?$")
5277
+ IPV6ADDRESS: new RegExp("^\\[?(" + je + ")" + s(s("\\%25|\\%(?!" + R + "{2})") + "(" + we + ")") + "?\\]?$")
5253
5278
  //RFC 6874, with relaxed parsing rules
5254
5279
  };
5255
5280
  }
5256
- var p = u(!1), g = u(!0), T = function() {
5281
+ var p = u(!1), _ = u(!0), T = function() {
5257
5282
  function f(l, m) {
5258
- var S = [], E = !0, q = !1, U = void 0;
5283
+ var R = [], b = !0, q = !1, U = void 0;
5259
5284
  try {
5260
- for (var J = l[Symbol.iterator](), Y; !(E = (Y = J.next()).done) && (S.push(Y.value), !(m && S.length === m)); E = !0)
5285
+ for (var J = l[Symbol.iterator](), Y; !(b = (Y = J.next()).done) && (R.push(Y.value), !(m && R.length === m)); b = !0)
5261
5286
  ;
5262
5287
  } catch (se) {
5263
5288
  q = !0, U = se;
5264
5289
  } finally {
5265
5290
  try {
5266
- !E && J.return && J.return();
5291
+ !b && J.return && J.return();
5267
5292
  } finally {
5268
5293
  if (q)
5269
5294
  throw U;
5270
5295
  }
5271
5296
  }
5272
- return S;
5297
+ return R;
5273
5298
  }
5274
5299
  return function(l, m) {
5275
5300
  if (Array.isArray(l))
@@ -5278,14 +5303,14 @@ var uri$1 = {}, uri_all = { exports: {} };
5278
5303
  return f(l, m);
5279
5304
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
5280
5305
  };
5281
- }(), O = function(f) {
5306
+ }(), C = function(f) {
5282
5307
  if (Array.isArray(f)) {
5283
5308
  for (var l = 0, m = Array(f.length); l < f.length; l++)
5284
5309
  m[l] = f[l];
5285
5310
  return m;
5286
5311
  } else
5287
5312
  return Array.from(f);
5288
- }, R = 2147483647, k = 36, $ = 1, _ = 26, y = 38, P = 700, I = 72, D = 128, w = "-", C = /^xn--/, A = /[^\0-\x7E]/, x = /[\x2E\u3002\uFF0E\uFF61]/g, z = {
5313
+ }, S = 2147483647, k = 36, $ = 1, g = 26, y = 38, P = 700, I = 72, D = 128, w = "-", O = /^xn--/, A = /[^\0-\x7E]/, x = /[\x2E\u3002\uFF0E\uFF61]/g, z = {
5289
5314
  overflow: "Overflow: input needs wider integers to process",
5290
5315
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
5291
5316
  "invalid-input": "Invalid input"
@@ -5294,72 +5319,72 @@ var uri$1 = {}, uri_all = { exports: {} };
5294
5319
  throw new RangeError(z[f]);
5295
5320
  }
5296
5321
  function ke(f, l) {
5297
- for (var m = [], S = f.length; S--; )
5298
- m[S] = l(f[S]);
5322
+ for (var m = [], R = f.length; R--; )
5323
+ m[R] = l(f[R]);
5299
5324
  return m;
5300
5325
  }
5301
5326
  function Ce(f, l) {
5302
- var m = f.split("@"), S = "";
5303
- m.length > 1 && (S = m[0] + "@", f = m[1]), f = f.replace(x, ".");
5304
- var E = f.split("."), q = ke(E, l).join(".");
5305
- return S + q;
5327
+ var m = f.split("@"), R = "";
5328
+ m.length > 1 && (R = m[0] + "@", f = m[1]), f = f.replace(x, ".");
5329
+ var b = f.split("."), q = ke(b, l).join(".");
5330
+ return R + q;
5306
5331
  }
5307
5332
  function Le(f) {
5308
- for (var l = [], m = 0, S = f.length; m < S; ) {
5309
- var E = f.charCodeAt(m++);
5310
- if (E >= 55296 && E <= 56319 && m < S) {
5333
+ for (var l = [], m = 0, R = f.length; m < R; ) {
5334
+ var b = f.charCodeAt(m++);
5335
+ if (b >= 55296 && b <= 56319 && m < R) {
5311
5336
  var q = f.charCodeAt(m++);
5312
- (q & 64512) == 56320 ? l.push(((E & 1023) << 10) + (q & 1023) + 65536) : (l.push(E), m--);
5337
+ (q & 64512) == 56320 ? l.push(((b & 1023) << 10) + (q & 1023) + 65536) : (l.push(b), m--);
5313
5338
  } else
5314
- l.push(E);
5339
+ l.push(b);
5315
5340
  }
5316
5341
  return l;
5317
5342
  }
5318
5343
  var et = function(l) {
5319
- return String.fromCodePoint.apply(String, O(l));
5344
+ return String.fromCodePoint.apply(String, C(l));
5320
5345
  }, qe = function(l) {
5321
5346
  return l - 48 < 10 ? l - 22 : l - 65 < 26 ? l - 65 : l - 97 < 26 ? l - 97 : k;
5322
5347
  }, F = function(l, m) {
5323
5348
  return l + 22 + 75 * (l < 26) - ((m != 0) << 5);
5324
- }, v = function(l, m, S) {
5325
- var E = 0;
5349
+ }, v = function(l, m, R) {
5350
+ var b = 0;
5326
5351
  for (
5327
- l = S ? K(l / P) : l >> 1, l += K(l / m);
5352
+ l = R ? K(l / P) : l >> 1, l += K(l / m);
5328
5353
  /* no initialization */
5329
- l > re * _ >> 1;
5330
- E += k
5354
+ l > re * g >> 1;
5355
+ b += k
5331
5356
  )
5332
5357
  l = K(l / re);
5333
- return K(E + (re + 1) * l / (l + y));
5358
+ return K(b + (re + 1) * l / (l + y));
5334
5359
  }, j = function(l) {
5335
- var m = [], S = l.length, E = 0, q = D, U = I, J = l.lastIndexOf(w);
5360
+ var m = [], R = l.length, b = 0, q = D, U = I, J = l.lastIndexOf(w);
5336
5361
  J < 0 && (J = 0);
5337
5362
  for (var Y = 0; Y < J; ++Y)
5338
5363
  l.charCodeAt(Y) >= 128 && oe("not-basic"), m.push(l.charCodeAt(Y));
5339
- for (var se = J > 0 ? J + 1 : 0; se < S; ) {
5364
+ for (var se = J > 0 ? J + 1 : 0; se < R; ) {
5340
5365
  for (
5341
- var B = E, Z = 1, ie = k;
5366
+ var B = b, Z = 1, ie = k;
5342
5367
  ;
5343
5368
  /* no condition */
5344
5369
  ie += k
5345
5370
  ) {
5346
- se >= S && oe("invalid-input");
5371
+ se >= R && oe("invalid-input");
5347
5372
  var V = qe(l.charCodeAt(se++));
5348
- (V >= k || V > K((R - E) / Z)) && oe("overflow"), E += V * Z;
5349
- var X = ie <= U ? $ : ie >= U + _ ? _ : ie - U;
5373
+ (V >= k || V > K((S - b) / Z)) && oe("overflow"), b += V * Z;
5374
+ var X = ie <= U ? $ : ie >= U + g ? g : ie - U;
5350
5375
  if (V < X)
5351
5376
  break;
5352
5377
  var ae = k - X;
5353
- Z > K(R / ae) && oe("overflow"), Z *= ae;
5378
+ Z > K(S / ae) && oe("overflow"), Z *= ae;
5354
5379
  }
5355
5380
  var ee = m.length + 1;
5356
- U = v(E - B, ee, B == 0), K(E / ee) > R - q && oe("overflow"), q += K(E / ee), E %= ee, m.splice(E++, 0, q);
5381
+ U = v(b - B, ee, B == 0), K(b / ee) > S - q && oe("overflow"), q += K(b / ee), b %= ee, m.splice(b++, 0, q);
5357
5382
  }
5358
5383
  return String.fromCodePoint.apply(String, m);
5359
- }, b = function(l) {
5384
+ }, E = function(l) {
5360
5385
  var m = [];
5361
5386
  l = Le(l);
5362
- var S = l.length, E = D, q = 0, U = I, J = !0, Y = !1, se = void 0;
5387
+ var R = l.length, b = D, q = 0, U = I, J = !0, Y = !1, se = void 0;
5363
5388
  try {
5364
5389
  for (var B = l[Symbol.iterator](), Z; !(J = (Z = B.next()).done); J = !0) {
5365
5390
  var ie = Z.value;
@@ -5376,12 +5401,12 @@ var uri$1 = {}, uri_all = { exports: {} };
5376
5401
  }
5377
5402
  }
5378
5403
  var V = m.length, X = V;
5379
- for (V && m.push(w); X < S; ) {
5380
- var ae = R, ee = !0, Se = !1, ge = void 0;
5404
+ for (V && m.push(w); X < R; ) {
5405
+ var ae = S, ee = !0, Se = !1, ge = void 0;
5381
5406
  try {
5382
5407
  for (var ye = l[Symbol.iterator](), Be; !(ee = (Be = ye.next()).done); ee = !0) {
5383
5408
  var Ie = Be.value;
5384
- Ie >= E && Ie < ae && (ae = Ie);
5409
+ Ie >= b && Ie < ae && (ae = Ie);
5385
5410
  }
5386
5411
  } catch (lt) {
5387
5412
  Se = !0, ge = lt;
@@ -5394,19 +5419,19 @@ var uri$1 = {}, uri_all = { exports: {} };
5394
5419
  }
5395
5420
  }
5396
5421
  var fe = X + 1;
5397
- ae - E > K((R - q) / fe) && oe("overflow"), q += (ae - E) * fe, E = ae;
5422
+ ae - b > K((S - q) / fe) && oe("overflow"), q += (ae - b) * fe, b = ae;
5398
5423
  var $e = !0, je = !1, we = void 0;
5399
5424
  try {
5400
5425
  for (var ct = l[Symbol.iterator](), Ut; !($e = (Ut = ct.next()).done); $e = !0) {
5401
5426
  var Ht = Ut.value;
5402
- if (Ht < E && ++q > R && oe("overflow"), Ht == E) {
5427
+ if (Ht < b && ++q > S && oe("overflow"), Ht == b) {
5403
5428
  for (
5404
5429
  var pt = q, ft = k;
5405
5430
  ;
5406
5431
  /* no condition */
5407
5432
  ft += k
5408
5433
  ) {
5409
- var ht = ft <= U ? $ : ft >= U + _ ? _ : ft - U;
5434
+ var ht = ft <= U ? $ : ft >= U + g ? g : ft - U;
5410
5435
  if (pt < ht)
5411
5436
  break;
5412
5437
  var xt = pt - ht, Vt = k - ht;
@@ -5425,16 +5450,16 @@ var uri$1 = {}, uri_all = { exports: {} };
5425
5450
  throw we;
5426
5451
  }
5427
5452
  }
5428
- ++q, ++E;
5453
+ ++q, ++b;
5429
5454
  }
5430
5455
  return m.join("");
5431
5456
  }, a = function(l) {
5432
5457
  return Ce(l, function(m) {
5433
- return C.test(m) ? j(m.slice(4).toLowerCase()) : m;
5458
+ return O.test(m) ? j(m.slice(4).toLowerCase()) : m;
5434
5459
  });
5435
5460
  }, h = function(l) {
5436
5461
  return Ce(l, function(m) {
5437
- return A.test(m) ? "xn--" + b(m) : m;
5462
+ return A.test(m) ? "xn--" + E(m) : m;
5438
5463
  });
5439
5464
  }, N = {
5440
5465
  /**
@@ -5455,7 +5480,7 @@ var uri$1 = {}, uri_all = { exports: {} };
5455
5480
  encode: et
5456
5481
  },
5457
5482
  decode: j,
5458
- encode: b,
5483
+ encode: E,
5459
5484
  toASCII: h,
5460
5485
  toUnicode: a
5461
5486
  }, M = {};
@@ -5464,21 +5489,21 @@ var uri$1 = {}, uri_all = { exports: {} };
5464
5489
  return l < 16 ? m = "%0" + l.toString(16).toUpperCase() : l < 128 ? m = "%" + l.toString(16).toUpperCase() : l < 2048 ? m = "%" + (l >> 6 | 192).toString(16).toUpperCase() + "%" + (l & 63 | 128).toString(16).toUpperCase() : m = "%" + (l >> 12 | 224).toString(16).toUpperCase() + "%" + (l >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (l & 63 | 128).toString(16).toUpperCase(), m;
5465
5490
  }
5466
5491
  function W(f) {
5467
- for (var l = "", m = 0, S = f.length; m < S; ) {
5468
- var E = parseInt(f.substr(m + 1, 2), 16);
5469
- if (E < 128)
5470
- l += String.fromCharCode(E), m += 3;
5471
- else if (E >= 194 && E < 224) {
5472
- if (S - m >= 6) {
5492
+ for (var l = "", m = 0, R = f.length; m < R; ) {
5493
+ var b = parseInt(f.substr(m + 1, 2), 16);
5494
+ if (b < 128)
5495
+ l += String.fromCharCode(b), m += 3;
5496
+ else if (b >= 194 && b < 224) {
5497
+ if (R - m >= 6) {
5473
5498
  var q = parseInt(f.substr(m + 4, 2), 16);
5474
- l += String.fromCharCode((E & 31) << 6 | q & 63);
5499
+ l += String.fromCharCode((b & 31) << 6 | q & 63);
5475
5500
  } else
5476
5501
  l += f.substr(m, 6);
5477
5502
  m += 6;
5478
- } else if (E >= 224) {
5479
- if (S - m >= 9) {
5503
+ } else if (b >= 224) {
5504
+ if (R - m >= 9) {
5480
5505
  var U = parseInt(f.substr(m + 4, 2), 16), J = parseInt(f.substr(m + 7, 2), 16);
5481
- l += String.fromCharCode((E & 15) << 12 | (U & 63) << 6 | J & 63);
5506
+ l += String.fromCharCode((b & 15) << 12 | (U & 63) << 6 | J & 63);
5482
5507
  } else
5483
5508
  l += f.substr(m, 9);
5484
5509
  m += 9;
@@ -5488,9 +5513,9 @@ var uri$1 = {}, uri_all = { exports: {} };
5488
5513
  return l;
5489
5514
  }
5490
5515
  function G(f, l) {
5491
- function m(S) {
5492
- var E = W(S);
5493
- return E.match(l.UNRESERVED) ? E : S;
5516
+ function m(R) {
5517
+ var b = W(R);
5518
+ return b.match(l.UNRESERVED) ? b : R;
5494
5519
  }
5495
5520
  return f.scheme && (f.scheme = String(f.scheme).replace(l.PCT_ENCODED, m).toLowerCase().replace(l.NOT_SCHEME, "")), f.userinfo !== void 0 && (f.userinfo = String(f.userinfo).replace(l.PCT_ENCODED, m).replace(l.NOT_USERINFO, L).replace(l.PCT_ENCODED, o)), f.host !== void 0 && (f.host = String(f.host).replace(l.PCT_ENCODED, m).toLowerCase().replace(l.NOT_HOST, L).replace(l.PCT_ENCODED, o)), f.path !== void 0 && (f.path = String(f.path).replace(l.PCT_ENCODED, m).replace(f.scheme ? l.NOT_PATH : l.NOT_PATH_NOSCHEME, L).replace(l.PCT_ENCODED, o)), f.query !== void 0 && (f.query = String(f.query).replace(l.PCT_ENCODED, m).replace(l.NOT_QUERY, L).replace(l.PCT_ENCODED, o)), f.fragment !== void 0 && (f.fragment = String(f.fragment).replace(l.PCT_ENCODED, m).replace(l.NOT_FRAGMENT, L).replace(l.PCT_ENCODED, o)), f;
5496
5521
  }
@@ -5498,13 +5523,13 @@ var uri$1 = {}, uri_all = { exports: {} };
5498
5523
  return f.replace(/^0*(.*)/, "$1") || "0";
5499
5524
  }
5500
5525
  function he(f, l) {
5501
- var m = f.match(l.IPV4ADDRESS) || [], S = T(m, 2), E = S[1];
5502
- return E ? E.split(".").map(ne).join(".") : f;
5526
+ var m = f.match(l.IPV4ADDRESS) || [], R = T(m, 2), b = R[1];
5527
+ return b ? b.split(".").map(ne).join(".") : f;
5503
5528
  }
5504
5529
  function Ue(f, l) {
5505
- var m = f.match(l.IPV6ADDRESS) || [], S = T(m, 3), E = S[1], q = S[2];
5506
- if (E) {
5507
- for (var U = E.toLowerCase().split("::").reverse(), J = T(U, 2), Y = J[0], se = J[1], B = se ? se.split(":").map(ne) : [], Z = Y.split(":").map(ne), ie = l.IPV4ADDRESS.test(Z[Z.length - 1]), V = ie ? 7 : 8, X = Z.length - V, ae = Array(V), ee = 0; ee < V; ++ee)
5530
+ var m = f.match(l.IPV6ADDRESS) || [], R = T(m, 3), b = R[1], q = R[2];
5531
+ if (b) {
5532
+ for (var U = b.toLowerCase().split("::").reverse(), J = T(U, 2), Y = J[0], se = J[1], B = se ? se.split(":").map(ne) : [], Z = Y.split(":").map(ne), ie = l.IPV4ADDRESS.test(Z[Z.length - 1]), V = ie ? 7 : 8, X = Z.length - V, ae = Array(V), ee = 0; ee < V; ++ee)
5508
5533
  ae[ee] = B[ee] || Z[X + ee] || "";
5509
5534
  ie && (ae[V - 1] = he(ae[V - 1], l));
5510
5535
  var Se = ae.reduce(function(fe, $e, je) {
@@ -5527,32 +5552,32 @@ var uri$1 = {}, uri_all = { exports: {} };
5527
5552
  }
5528
5553
  var tt = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, rt = "".match(/(){0}/)[1] === void 0;
5529
5554
  function de(f) {
5530
- var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, S = l.iri !== !1 ? g : p;
5555
+ var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, R = l.iri !== !1 ? _ : p;
5531
5556
  l.reference === "suffix" && (f = (l.scheme ? l.scheme + ":" : "") + "//" + f);
5532
- var E = f.match(tt);
5533
- if (E) {
5534
- rt ? (m.scheme = E[1], m.userinfo = E[3], m.host = E[4], m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = E[7], m.fragment = E[8], isNaN(m.port) && (m.port = E[5])) : (m.scheme = E[1] || void 0, m.userinfo = f.indexOf("@") !== -1 ? E[3] : void 0, m.host = f.indexOf("//") !== -1 ? E[4] : void 0, m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = f.indexOf("?") !== -1 ? E[7] : void 0, m.fragment = f.indexOf("#") !== -1 ? E[8] : void 0, isNaN(m.port) && (m.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? E[4] : void 0)), m.host && (m.host = Ue(he(m.host, S), S)), m.scheme === void 0 && m.userinfo === void 0 && m.host === void 0 && m.port === void 0 && !m.path && m.query === void 0 ? m.reference = "same-document" : m.scheme === void 0 ? m.reference = "relative" : m.fragment === void 0 ? m.reference = "absolute" : m.reference = "uri", l.reference && l.reference !== "suffix" && l.reference !== m.reference && (m.error = m.error || "URI is not a " + l.reference + " reference.");
5557
+ var b = f.match(tt);
5558
+ if (b) {
5559
+ rt ? (m.scheme = b[1], m.userinfo = b[3], m.host = b[4], m.port = parseInt(b[5], 10), m.path = b[6] || "", m.query = b[7], m.fragment = b[8], isNaN(m.port) && (m.port = b[5])) : (m.scheme = b[1] || void 0, m.userinfo = f.indexOf("@") !== -1 ? b[3] : void 0, m.host = f.indexOf("//") !== -1 ? b[4] : void 0, m.port = parseInt(b[5], 10), m.path = b[6] || "", m.query = f.indexOf("?") !== -1 ? b[7] : void 0, m.fragment = f.indexOf("#") !== -1 ? b[8] : void 0, isNaN(m.port) && (m.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? b[4] : void 0)), m.host && (m.host = Ue(he(m.host, R), R)), m.scheme === void 0 && m.userinfo === void 0 && m.host === void 0 && m.port === void 0 && !m.path && m.query === void 0 ? m.reference = "same-document" : m.scheme === void 0 ? m.reference = "relative" : m.fragment === void 0 ? m.reference = "absolute" : m.reference = "uri", l.reference && l.reference !== "suffix" && l.reference !== m.reference && (m.error = m.error || "URI is not a " + l.reference + " reference.");
5535
5560
  var q = M[(l.scheme || m.scheme || "").toLowerCase()];
5536
5561
  if (!l.unicodeSupport && (!q || !q.unicodeSupport)) {
5537
5562
  if (m.host && (l.domainHost || q && q.domainHost))
5538
5563
  try {
5539
- m.host = N.toASCII(m.host.replace(S.PCT_ENCODED, W).toLowerCase());
5564
+ m.host = N.toASCII(m.host.replace(R.PCT_ENCODED, W).toLowerCase());
5540
5565
  } catch (U) {
5541
5566
  m.error = m.error || "Host's domain name can not be converted to ASCII via punycode: " + U;
5542
5567
  }
5543
5568
  G(m, p);
5544
5569
  } else
5545
- G(m, S);
5570
+ G(m, R);
5546
5571
  q && q.parse && q.parse(m, l);
5547
5572
  } else
5548
5573
  m.error = m.error || "URI can not be parsed.";
5549
5574
  return m;
5550
5575
  }
5551
5576
  function nt(f, l) {
5552
- var m = l.iri !== !1 ? g : p, S = [];
5553
- return f.userinfo !== void 0 && (S.push(f.userinfo), S.push("@")), f.host !== void 0 && S.push(Ue(he(String(f.host), m), m).replace(m.IPV6ADDRESS, function(E, q, U) {
5577
+ var m = l.iri !== !1 ? _ : p, R = [];
5578
+ return f.userinfo !== void 0 && (R.push(f.userinfo), R.push("@")), f.host !== void 0 && R.push(Ue(he(String(f.host), m), m).replace(m.IPV6ADDRESS, function(b, q, U) {
5554
5579
  return "[" + q + (U ? "%25" + U : "") + "]";
5555
- })), (typeof f.port == "number" || typeof f.port == "string") && (S.push(":"), S.push(String(f.port))), S.length ? S.join("") : void 0;
5580
+ })), (typeof f.port == "number" || typeof f.port == "string") && (R.push(":"), R.push(String(f.port))), R.length ? R.join("") : void 0;
5556
5581
  }
5557
5582
  var He = /^\.\.?\//, xe = /^\/\.(\/|$)/, Ve = /^\/\.\.(\/|$)/, st = /^\/?(?:.|\n)*?(?=\/|$)/;
5558
5583
  function me(f) {
@@ -5568,38 +5593,38 @@ var uri$1 = {}, uri_all = { exports: {} };
5568
5593
  else {
5569
5594
  var m = f.match(st);
5570
5595
  if (m) {
5571
- var S = m[0];
5572
- f = f.slice(S.length), l.push(S);
5596
+ var R = m[0];
5597
+ f = f.slice(R.length), l.push(R);
5573
5598
  } else
5574
5599
  throw new Error("Unexpected dot segment condition");
5575
5600
  }
5576
5601
  return l.join("");
5577
5602
  }
5578
5603
  function le(f) {
5579
- var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = l.iri ? g : p, S = [], E = M[(l.scheme || f.scheme || "").toLowerCase()];
5580
- if (E && E.serialize && E.serialize(f, l), f.host && !m.IPV6ADDRESS.test(f.host)) {
5581
- if (l.domainHost || E && E.domainHost)
5604
+ var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = l.iri ? _ : p, R = [], b = M[(l.scheme || f.scheme || "").toLowerCase()];
5605
+ if (b && b.serialize && b.serialize(f, l), f.host && !m.IPV6ADDRESS.test(f.host)) {
5606
+ if (l.domainHost || b && b.domainHost)
5582
5607
  try {
5583
5608
  f.host = l.iri ? N.toUnicode(f.host) : N.toASCII(f.host.replace(m.PCT_ENCODED, W).toLowerCase());
5584
5609
  } catch (J) {
5585
5610
  f.error = f.error || "Host's domain name can not be converted to " + (l.iri ? "Unicode" : "ASCII") + " via punycode: " + J;
5586
5611
  }
5587
5612
  }
5588
- G(f, m), l.reference !== "suffix" && f.scheme && (S.push(f.scheme), S.push(":"));
5613
+ G(f, m), l.reference !== "suffix" && f.scheme && (R.push(f.scheme), R.push(":"));
5589
5614
  var q = nt(f, l);
5590
- if (q !== void 0 && (l.reference !== "suffix" && S.push("//"), S.push(q), f.path && f.path.charAt(0) !== "/" && S.push("/")), f.path !== void 0) {
5615
+ if (q !== void 0 && (l.reference !== "suffix" && R.push("//"), R.push(q), f.path && f.path.charAt(0) !== "/" && R.push("/")), f.path !== void 0) {
5591
5616
  var U = f.path;
5592
- !l.absolutePath && (!E || !E.absolutePath) && (U = me(U)), q === void 0 && (U = U.replace(/^\/\//, "/%2F")), S.push(U);
5617
+ !l.absolutePath && (!b || !b.absolutePath) && (U = me(U)), q === void 0 && (U = U.replace(/^\/\//, "/%2F")), R.push(U);
5593
5618
  }
5594
- return f.query !== void 0 && (S.push("?"), S.push(f.query)), f.fragment !== void 0 && (S.push("#"), S.push(f.fragment)), S.join("");
5619
+ return f.query !== void 0 && (R.push("?"), R.push(f.query)), f.fragment !== void 0 && (R.push("#"), R.push(f.fragment)), R.join("");
5595
5620
  }
5596
5621
  function ze(f, l) {
5597
- var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, S = arguments[3], E = {};
5598
- return S || (f = de(le(f, m), m), l = de(le(l, m), m)), m = m || {}, !m.tolerant && l.scheme ? (E.scheme = l.scheme, E.userinfo = l.userinfo, E.host = l.host, E.port = l.port, E.path = me(l.path || ""), E.query = l.query) : (l.userinfo !== void 0 || l.host !== void 0 || l.port !== void 0 ? (E.userinfo = l.userinfo, E.host = l.host, E.port = l.port, E.path = me(l.path || ""), E.query = l.query) : (l.path ? (l.path.charAt(0) === "/" ? E.path = me(l.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? E.path = "/" + l.path : f.path ? E.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + l.path : E.path = l.path, E.path = me(E.path)), E.query = l.query) : (E.path = f.path, l.query !== void 0 ? E.query = l.query : E.query = f.query), E.userinfo = f.userinfo, E.host = f.host, E.port = f.port), E.scheme = f.scheme), E.fragment = l.fragment, E;
5622
+ var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, R = arguments[3], b = {};
5623
+ return R || (f = de(le(f, m), m), l = de(le(l, m), m)), m = m || {}, !m.tolerant && l.scheme ? (b.scheme = l.scheme, b.userinfo = l.userinfo, b.host = l.host, b.port = l.port, b.path = me(l.path || ""), b.query = l.query) : (l.userinfo !== void 0 || l.host !== void 0 || l.port !== void 0 ? (b.userinfo = l.userinfo, b.host = l.host, b.port = l.port, b.path = me(l.path || ""), b.query = l.query) : (l.path ? (l.path.charAt(0) === "/" ? b.path = me(l.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? b.path = "/" + l.path : f.path ? b.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + l.path : b.path = l.path, b.path = me(b.path)), b.query = l.query) : (b.path = f.path, l.query !== void 0 ? b.query = l.query : b.query = f.query), b.userinfo = f.userinfo, b.host = f.host, b.port = f.port), b.scheme = f.scheme), b.fragment = l.fragment, b;
5599
5624
  }
5600
5625
  function it(f, l, m) {
5601
- var S = d({ scheme: "null" }, m);
5602
- return le(ze(de(f, S), de(l, S), S, !0), S);
5626
+ var R = d({ scheme: "null" }, m);
5627
+ return le(ze(de(f, R), de(l, R), R, !0), R);
5603
5628
  }
5604
5629
  function Oe(f, l) {
5605
5630
  return typeof f == "string" ? f = le(de(f, l), l) : i(f) === "object" && (f = de(le(f, l), l)), f;
@@ -5608,10 +5633,10 @@ var uri$1 = {}, uri_all = { exports: {} };
5608
5633
  return typeof f == "string" ? f = le(de(f, m), m) : i(f) === "object" && (f = le(f, m)), typeof l == "string" ? l = le(de(l, m), m) : i(l) === "object" && (l = le(l, m)), f === l;
5609
5634
  }
5610
5635
  function ut(f, l) {
5611
- return f && f.toString().replace(!l || !l.iri ? p.ESCAPE : g.ESCAPE, L);
5636
+ return f && f.toString().replace(!l || !l.iri ? p.ESCAPE : _.ESCAPE, L);
5612
5637
  }
5613
5638
  function pe(f, l) {
5614
- return f && f.toString().replace(!l || !l.iri ? p.PCT_ENCODED : g.PCT_ENCODED, W);
5639
+ return f && f.toString().replace(!l || !l.iri ? p.PCT_ENCODED : _.PCT_ENCODED, W);
5615
5640
  }
5616
5641
  var Ne = {
5617
5642
  scheme: "http",
@@ -5620,8 +5645,8 @@ var uri$1 = {}, uri_all = { exports: {} };
5620
5645
  return l.host || (l.error = l.error || "HTTP URIs must have a host."), l;
5621
5646
  },
5622
5647
  serialize: function(l, m) {
5623
- var S = String(l.scheme).toLowerCase() === "https";
5624
- return (l.port === (S ? 443 : 80) || l.port === "") && (l.port = void 0), l.path || (l.path = "/"), l;
5648
+ var R = String(l.scheme).toLowerCase() === "https";
5649
+ return (l.port === (R ? 443 : 80) || l.port === "") && (l.port = void 0), l.path || (l.path = "/"), l;
5625
5650
  }
5626
5651
  }, It = {
5627
5652
  scheme: "https",
@@ -5636,12 +5661,12 @@ var uri$1 = {}, uri_all = { exports: {} };
5636
5661
  scheme: "ws",
5637
5662
  domainHost: !0,
5638
5663
  parse: function(l, m) {
5639
- var S = l;
5640
- return S.secure = jt(S), S.resourceName = (S.path || "/") + (S.query ? "?" + S.query : ""), S.path = void 0, S.query = void 0, S;
5664
+ var R = l;
5665
+ return R.secure = jt(R), R.resourceName = (R.path || "/") + (R.query ? "?" + R.query : ""), R.path = void 0, R.query = void 0, R;
5641
5666
  },
5642
5667
  serialize: function(l, m) {
5643
5668
  if ((l.port === (jt(l) ? 443 : 80) || l.port === "") && (l.port = void 0), typeof l.secure == "boolean" && (l.scheme = l.secure ? "wss" : "ws", l.secure = void 0), l.resourceName) {
5644
- var S = l.resourceName.split("?"), E = T(S, 2), q = E[0], U = E[1];
5669
+ var R = l.resourceName.split("?"), b = T(R, 2), q = b[0], U = b[1];
5645
5670
  l.path = q && q !== "/" ? q : void 0, l.query = U, l.resourceName = void 0;
5646
5671
  }
5647
5672
  return l.fragment = void 0, l;
@@ -5659,90 +5684,90 @@ var uri$1 = {}, uri_all = { exports: {} };
5659
5684
  var Mt = {
5660
5685
  scheme: "mailto",
5661
5686
  parse: function(l, m) {
5662
- var S = l, E = S.to = S.path ? S.path.split(",") : [];
5663
- if (S.path = void 0, S.query) {
5664
- for (var q = !1, U = {}, J = S.query.split("&"), Y = 0, se = J.length; Y < se; ++Y) {
5687
+ var R = l, b = R.to = R.path ? R.path.split(",") : [];
5688
+ if (R.path = void 0, R.query) {
5689
+ for (var q = !1, U = {}, J = R.query.split("&"), Y = 0, se = J.length; Y < se; ++Y) {
5665
5690
  var B = J[Y].split("=");
5666
5691
  switch (B[0]) {
5667
5692
  case "to":
5668
5693
  for (var Z = B[1].split(","), ie = 0, V = Z.length; ie < V; ++ie)
5669
- E.push(Z[ie]);
5694
+ b.push(Z[ie]);
5670
5695
  break;
5671
5696
  case "subject":
5672
- S.subject = pe(B[1], m);
5697
+ R.subject = pe(B[1], m);
5673
5698
  break;
5674
5699
  case "body":
5675
- S.body = pe(B[1], m);
5700
+ R.body = pe(B[1], m);
5676
5701
  break;
5677
5702
  default:
5678
5703
  q = !0, U[pe(B[0], m)] = pe(B[1], m);
5679
5704
  break;
5680
5705
  }
5681
5706
  }
5682
- q && (S.headers = U);
5707
+ q && (R.headers = U);
5683
5708
  }
5684
- S.query = void 0;
5685
- for (var X = 0, ae = E.length; X < ae; ++X) {
5686
- var ee = E[X].split("@");
5709
+ R.query = void 0;
5710
+ for (var X = 0, ae = b.length; X < ae; ++X) {
5711
+ var ee = b[X].split("@");
5687
5712
  if (ee[0] = pe(ee[0]), m.unicodeSupport)
5688
5713
  ee[1] = pe(ee[1], m).toLowerCase();
5689
5714
  else
5690
5715
  try {
5691
5716
  ee[1] = N.toASCII(pe(ee[1], m).toLowerCase());
5692
5717
  } catch (Se) {
5693
- S.error = S.error || "Email address's domain name can not be converted to ASCII via punycode: " + Se;
5718
+ R.error = R.error || "Email address's domain name can not be converted to ASCII via punycode: " + Se;
5694
5719
  }
5695
- E[X] = ee.join("@");
5720
+ b[X] = ee.join("@");
5696
5721
  }
5697
- return S;
5722
+ return R;
5698
5723
  },
5699
5724
  serialize: function(l, m) {
5700
- var S = l, E = c(l.to);
5701
- if (E) {
5702
- for (var q = 0, U = E.length; q < U; ++q) {
5703
- var J = String(E[q]), Y = J.lastIndexOf("@"), se = J.slice(0, Y).replace(We, Ot).replace(We, o).replace(pr, L), B = J.slice(Y + 1);
5725
+ var R = l, b = c(l.to);
5726
+ if (b) {
5727
+ for (var q = 0, U = b.length; q < U; ++q) {
5728
+ var J = String(b[q]), Y = J.lastIndexOf("@"), se = J.slice(0, Y).replace(We, Ot).replace(We, o).replace(pr, L), B = J.slice(Y + 1);
5704
5729
  try {
5705
5730
  B = m.iri ? N.toUnicode(B) : N.toASCII(pe(B, m).toLowerCase());
5706
5731
  } catch (X) {
5707
- S.error = S.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
5732
+ R.error = R.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
5708
5733
  }
5709
- E[q] = se + "@" + B;
5734
+ b[q] = se + "@" + B;
5710
5735
  }
5711
- S.path = E.join(",");
5736
+ R.path = b.join(",");
5712
5737
  }
5713
5738
  var Z = l.headers = l.headers || {};
5714
5739
  l.subject && (Z.subject = l.subject), l.body && (Z.body = l.body);
5715
5740
  var ie = [];
5716
5741
  for (var V in Z)
5717
5742
  Z[V] !== ir[V] && ie.push(V.replace(We, Ot).replace(We, o).replace(Ft, L) + "=" + Z[V].replace(We, Ot).replace(We, o).replace(fr, L));
5718
- return ie.length && (S.query = ie.join("&")), S;
5743
+ return ie.length && (R.query = ie.join("&")), R;
5719
5744
  }
5720
5745
  }, hr = /^([^\:]+)\:(.*)/, Lt = {
5721
5746
  scheme: "urn",
5722
5747
  parse: function(l, m) {
5723
- var S = l.path && l.path.match(hr), E = l;
5724
- if (S) {
5725
- var q = m.scheme || E.scheme || "urn", U = S[1].toLowerCase(), J = S[2], Y = q + ":" + (m.nid || U), se = M[Y];
5726
- E.nid = U, E.nss = J, E.path = void 0, se && (E = se.parse(E, m));
5748
+ var R = l.path && l.path.match(hr), b = l;
5749
+ if (R) {
5750
+ var q = m.scheme || b.scheme || "urn", U = R[1].toLowerCase(), J = R[2], Y = q + ":" + (m.nid || U), se = M[Y];
5751
+ b.nid = U, b.nss = J, b.path = void 0, se && (b = se.parse(b, m));
5727
5752
  } else
5728
- E.error = E.error || "URN can not be parsed.";
5729
- return E;
5753
+ b.error = b.error || "URN can not be parsed.";
5754
+ return b;
5730
5755
  },
5731
5756
  serialize: function(l, m) {
5732
- var S = m.scheme || l.scheme || "urn", E = l.nid, q = S + ":" + (m.nid || E), U = M[q];
5757
+ var R = m.scheme || l.scheme || "urn", b = l.nid, q = R + ":" + (m.nid || b), U = M[q];
5733
5758
  U && (l = U.serialize(l, m));
5734
5759
  var J = l, Y = l.nss;
5735
- return J.path = (E || m.nid) + ":" + Y, J;
5760
+ return J.path = (b || m.nid) + ":" + Y, J;
5736
5761
  }
5737
5762
  }, mr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, qt = {
5738
5763
  scheme: "urn:uuid",
5739
5764
  parse: function(l, m) {
5740
- var S = l;
5741
- return S.uuid = S.nss, S.nss = void 0, !m.tolerant && (!S.uuid || !S.uuid.match(mr)) && (S.error = S.error || "UUID is not valid."), S;
5765
+ var R = l;
5766
+ return R.uuid = R.nss, R.nss = void 0, !m.tolerant && (!R.uuid || !R.uuid.match(mr)) && (R.error = R.error || "UUID is not valid."), R;
5742
5767
  },
5743
5768
  serialize: function(l, m) {
5744
- var S = l;
5745
- return S.nss = (l.uuid || "").toLowerCase(), S;
5769
+ var R = l;
5770
+ return R.nss = (l.uuid || "").toLowerCase(), R;
5746
5771
  }
5747
5772
  };
5748
5773
  M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[At.scheme] = At, M[Mt.scheme] = Mt, M[Lt.scheme] = Lt, M[qt.scheme] = qt, r.SCHEMES = M, r.pctEncChar = L, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = ze, r.resolve = it, r.normalize = Oe, r.equal = ot, r.escapeComponent = ut, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
@@ -5773,9 +5798,9 @@ uri$1.default = uri;
5773
5798
  } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
5774
5799
  return r.CodeGen;
5775
5800
  } });
5776
- const n = validation_error, s = ref_error, i = rules, o = compile, c = codegen, d = resolve$1, u = dataType, p = util, g = require$$9, T = uri$1, O = (F, v) => new RegExp(F, v);
5777
- O.code = "new RegExp";
5778
- const R = ["removeAdditional", "useDefaults", "coerceTypes"], k = /* @__PURE__ */ new Set([
5801
+ const n = validation_error, s = ref_error, i = rules, o = compile, c = codegen, d = resolve$1, u = dataType, p = util, _ = require$$9, T = uri$1, C = (F, v) => new RegExp(F, v);
5802
+ C.code = "new RegExp";
5803
+ const S = ["removeAdditional", "useDefaults", "coerceTypes"], k = /* @__PURE__ */ new Set([
5779
5804
  "validate",
5780
5805
  "serialize",
5781
5806
  "parse",
@@ -5805,14 +5830,14 @@ uri$1.default = uri;
5805
5830
  cache: "Map is used as cache, schema object as key.",
5806
5831
  serialize: "Map is used as cache, schema object as key.",
5807
5832
  ajvErrors: "It is default now."
5808
- }, _ = {
5833
+ }, g = {
5809
5834
  ignoreKeywordsWithRef: "",
5810
5835
  jsPropertySyntax: "",
5811
5836
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
5812
5837
  }, y = 200;
5813
5838
  function P(F) {
5814
- var v, j, b, a, h, N, M, L, W, G, ne, he, Ue, tt, rt, de, nt, He, xe, Ve, st, me, le, ze, it;
5815
- const Oe = F.strict, ot = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (b = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && b !== void 0 ? b : O, Ne = (a = F.uriResolver) !== null && a !== void 0 ? a : T.default;
5839
+ var v, j, E, a, h, N, M, L, W, G, ne, he, Ue, tt, rt, de, nt, He, xe, Ve, st, me, le, ze, it;
5840
+ const Oe = F.strict, ot = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (E = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && E !== void 0 ? E : C, Ne = (a = F.uriResolver) !== null && a !== void 0 ? a : T.default;
5816
5841
  return {
5817
5842
  strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h : Oe) !== null && N !== void 0 ? N : !0,
5818
5843
  strictNumbers: (L = (M = F.strictNumbers) !== null && M !== void 0 ? M : Oe) !== null && L !== void 0 ? L : !0,
@@ -5837,41 +5862,41 @@ uri$1.default = uri;
5837
5862
  class I {
5838
5863
  constructor(v = {}) {
5839
5864
  this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), v = this.opts = { ...v, ...P(v) };
5840
- const { es5: j, lines: b } = this.opts.code;
5841
- this.scope = new c.ValueScope({ scope: {}, prefixes: k, es5: j, lines: b }), this.logger = K(v.logger);
5865
+ const { es5: j, lines: E } = this.opts.code;
5866
+ this.scope = new c.ValueScope({ scope: {}, prefixes: k, es5: j, lines: E }), this.logger = K(v.logger);
5842
5867
  const a = v.validateFormats;
5843
- v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, $, v, "NOT SUPPORTED"), D.call(this, _, v, "DEPRECATED", "warn"), this._metaOpts = z.call(this), v.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && x.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), C.call(this), v.validateFormats = a;
5868
+ v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, $, v, "NOT SUPPORTED"), D.call(this, g, v, "DEPRECATED", "warn"), this._metaOpts = z.call(this), v.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && x.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), O.call(this), v.validateFormats = a;
5844
5869
  }
5845
5870
  _addVocabularies() {
5846
5871
  this.addKeyword("$async");
5847
5872
  }
5848
5873
  _addDefaultMetaSchema() {
5849
- const { $data: v, meta: j, schemaId: b } = this.opts;
5850
- let a = g;
5851
- b === "id" && (a = { ...g }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[b], !1);
5874
+ const { $data: v, meta: j, schemaId: E } = this.opts;
5875
+ let a = _;
5876
+ E === "id" && (a = { ..._ }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[E], !1);
5852
5877
  }
5853
5878
  defaultMeta() {
5854
5879
  const { meta: v, schemaId: j } = this.opts;
5855
5880
  return this.opts.defaultMeta = typeof v == "object" ? v[j] || v : void 0;
5856
5881
  }
5857
5882
  validate(v, j) {
5858
- let b;
5883
+ let E;
5859
5884
  if (typeof v == "string") {
5860
- if (b = this.getSchema(v), !b)
5885
+ if (E = this.getSchema(v), !E)
5861
5886
  throw new Error(`no schema with key or ref "${v}"`);
5862
5887
  } else
5863
- b = this.compile(v);
5864
- const a = b(j);
5865
- return "$async" in b || (this.errors = b.errors), a;
5888
+ E = this.compile(v);
5889
+ const a = E(j);
5890
+ return "$async" in E || (this.errors = E.errors), a;
5866
5891
  }
5867
5892
  compile(v, j) {
5868
- const b = this._addSchema(v, j);
5869
- return b.validate || this._compileSchemaEnv(b);
5893
+ const E = this._addSchema(v, j);
5894
+ return E.validate || this._compileSchemaEnv(E);
5870
5895
  }
5871
5896
  compileAsync(v, j) {
5872
5897
  if (typeof this.opts.loadSchema != "function")
5873
5898
  throw new Error("options.loadSchema should be a function");
5874
- const { loadSchema: b } = this.opts;
5899
+ const { loadSchema: E } = this.opts;
5875
5900
  return a.call(this, v, j);
5876
5901
  async function a(G, ne) {
5877
5902
  await h.call(this, G.$schema);
@@ -5903,17 +5928,17 @@ uri$1.default = uri;
5903
5928
  if (ne)
5904
5929
  return ne;
5905
5930
  try {
5906
- return await (this._loading[G] = b(G));
5931
+ return await (this._loading[G] = E(G));
5907
5932
  } finally {
5908
5933
  delete this._loading[G];
5909
5934
  }
5910
5935
  }
5911
5936
  }
5912
5937
  // Adds schema to the instance
5913
- addSchema(v, j, b, a = this.opts.validateSchema) {
5938
+ addSchema(v, j, E, a = this.opts.validateSchema) {
5914
5939
  if (Array.isArray(v)) {
5915
5940
  for (const N of v)
5916
- this.addSchema(N, void 0, b, a);
5941
+ this.addSchema(N, void 0, E, a);
5917
5942
  return this;
5918
5943
  }
5919
5944
  let h;
@@ -5922,23 +5947,23 @@ uri$1.default = uri;
5922
5947
  if (h = v[N], h !== void 0 && typeof h != "string")
5923
5948
  throw new Error(`schema ${N} must be string`);
5924
5949
  }
5925
- return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(v, b, j, a, !0), this;
5950
+ return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(v, E, j, a, !0), this;
5926
5951
  }
5927
5952
  // Add schema that will be used to validate other schemas
5928
5953
  // options in META_IGNORE_OPTIONS are alway set to false
5929
- addMetaSchema(v, j, b = this.opts.validateSchema) {
5930
- return this.addSchema(v, j, !0, b), this;
5954
+ addMetaSchema(v, j, E = this.opts.validateSchema) {
5955
+ return this.addSchema(v, j, !0, E), this;
5931
5956
  }
5932
5957
  // Validate schema against its meta-schema
5933
5958
  validateSchema(v, j) {
5934
5959
  if (typeof v == "boolean")
5935
5960
  return !0;
5936
- let b;
5937
- if (b = v.$schema, b !== void 0 && typeof b != "string")
5961
+ let E;
5962
+ if (E = v.$schema, E !== void 0 && typeof E != "string")
5938
5963
  throw new Error("$schema must be a string");
5939
- if (b = b || this.opts.defaultMeta || this.defaultMeta(), !b)
5964
+ if (E = E || this.opts.defaultMeta || this.defaultMeta(), !E)
5940
5965
  return this.logger.warn("meta-schema not available"), this.errors = null, !0;
5941
- const a = this.validate(b, v);
5966
+ const a = this.validate(E, v);
5942
5967
  if (!a && j) {
5943
5968
  const h = "schema is invalid: " + this.errorsText();
5944
5969
  if (this.opts.validateSchema === "log")
@@ -5955,7 +5980,7 @@ uri$1.default = uri;
5955
5980
  for (; typeof (j = w.call(this, v)) == "string"; )
5956
5981
  v = j;
5957
5982
  if (j === void 0) {
5958
- const { schemaId: b } = this.opts, a = new o.SchemaEnv({ schema: {}, schemaId: b });
5983
+ const { schemaId: E } = this.opts, a = new o.SchemaEnv({ schema: {}, schemaId: E });
5959
5984
  if (j = o.resolveSchema.call(this, a, v), !j)
5960
5985
  return;
5961
5986
  this.refs[v] = j;
@@ -5979,8 +6004,8 @@ uri$1.default = uri;
5979
6004
  case "object": {
5980
6005
  const j = v;
5981
6006
  this._cache.delete(j);
5982
- let b = v[this.opts.schemaId];
5983
- return b && (b = (0, d.normalizeId)(b), delete this.schemas[b], delete this.refs[b]), this;
6007
+ let E = v[this.opts.schemaId];
6008
+ return E && (E = (0, d.normalizeId)(E), delete this.schemas[E], delete this.refs[E]), this;
5984
6009
  }
5985
6010
  default:
5986
6011
  throw new Error("ajv.removeSchema: invalid parameter");
@@ -5993,23 +6018,23 @@ uri$1.default = uri;
5993
6018
  return this;
5994
6019
  }
5995
6020
  addKeyword(v, j) {
5996
- let b;
6021
+ let E;
5997
6022
  if (typeof v == "string")
5998
- b = v, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = b);
6023
+ E = v, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = E);
5999
6024
  else if (typeof v == "object" && j === void 0) {
6000
- if (j = v, b = j.keyword, Array.isArray(b) && !b.length)
6025
+ if (j = v, E = j.keyword, Array.isArray(E) && !E.length)
6001
6026
  throw new Error("addKeywords: keyword must be string or non-empty array");
6002
6027
  } else
6003
6028
  throw new Error("invalid addKeywords parameters");
6004
- if (oe.call(this, b, j), !j)
6005
- return (0, p.eachItem)(b, (h) => ke.call(this, h)), this;
6029
+ if (oe.call(this, E, j), !j)
6030
+ return (0, p.eachItem)(E, (h) => ke.call(this, h)), this;
6006
6031
  Le.call(this, j);
6007
6032
  const a = {
6008
6033
  ...j,
6009
6034
  type: (0, u.getJSONTypes)(j.type),
6010
6035
  schemaType: (0, u.getJSONTypes)(j.schemaType)
6011
6036
  };
6012
- return (0, p.eachItem)(b, a.type.length === 0 ? (h) => ke.call(this, h, a) : (h) => a.type.forEach((N) => ke.call(this, h, a, N))), this;
6037
+ return (0, p.eachItem)(E, a.type.length === 0 ? (h) => ke.call(this, h, a) : (h) => a.type.forEach((N) => ke.call(this, h, a, N))), this;
6013
6038
  }
6014
6039
  getKeyword(v) {
6015
6040
  const j = this.RULES.all[v];
@@ -6019,9 +6044,9 @@ uri$1.default = uri;
6019
6044
  removeKeyword(v) {
6020
6045
  const { RULES: j } = this;
6021
6046
  delete j.keywords[v], delete j.all[v];
6022
- for (const b of j.rules) {
6023
- const a = b.rules.findIndex((h) => h.keyword === v);
6024
- a >= 0 && b.rules.splice(a, 1);
6047
+ for (const E of j.rules) {
6048
+ const a = E.rules.findIndex((h) => h.keyword === v);
6049
+ a >= 0 && E.rules.splice(a, 1);
6025
6050
  }
6026
6051
  return this;
6027
6052
  }
@@ -6029,19 +6054,19 @@ uri$1.default = uri;
6029
6054
  addFormat(v, j) {
6030
6055
  return typeof j == "string" && (j = new RegExp(j)), this.formats[v] = j, this;
6031
6056
  }
6032
- errorsText(v = this.errors, { separator: j = ", ", dataVar: b = "data" } = {}) {
6033
- return !v || v.length === 0 ? "No errors" : v.map((a) => `${b}${a.instancePath} ${a.message}`).reduce((a, h) => a + j + h);
6057
+ errorsText(v = this.errors, { separator: j = ", ", dataVar: E = "data" } = {}) {
6058
+ return !v || v.length === 0 ? "No errors" : v.map((a) => `${E}${a.instancePath} ${a.message}`).reduce((a, h) => a + j + h);
6034
6059
  }
6035
6060
  $dataMetaSchema(v, j) {
6036
- const b = this.RULES.all;
6061
+ const E = this.RULES.all;
6037
6062
  v = JSON.parse(JSON.stringify(v));
6038
6063
  for (const a of j) {
6039
6064
  const h = a.split("/").slice(1);
6040
6065
  let N = v;
6041
6066
  for (const M of h)
6042
6067
  N = N[M];
6043
- for (const M in b) {
6044
- const L = b[M];
6068
+ for (const M in E) {
6069
+ const L = E[M];
6045
6070
  if (typeof L != "object")
6046
6071
  continue;
6047
6072
  const { $data: W } = L.definition, G = N[M];
@@ -6051,12 +6076,12 @@ uri$1.default = uri;
6051
6076
  return v;
6052
6077
  }
6053
6078
  _removeAllSchemas(v, j) {
6054
- for (const b in v) {
6055
- const a = v[b];
6056
- (!j || j.test(b)) && (typeof a == "string" ? delete v[b] : a && !a.meta && (this._cache.delete(a.schema), delete v[b]));
6079
+ for (const E in v) {
6080
+ const a = v[E];
6081
+ (!j || j.test(E)) && (typeof a == "string" ? delete v[E] : a && !a.meta && (this._cache.delete(a.schema), delete v[E]));
6057
6082
  }
6058
6083
  }
6059
- _addSchema(v, j, b, a = this.opts.validateSchema, h = this.opts.addUsedSchema) {
6084
+ _addSchema(v, j, E, a = this.opts.validateSchema, h = this.opts.addUsedSchema) {
6060
6085
  let N;
6061
6086
  const { schemaId: M } = this.opts;
6062
6087
  if (typeof v == "object")
@@ -6070,9 +6095,9 @@ uri$1.default = uri;
6070
6095
  let L = this._cache.get(v);
6071
6096
  if (L !== void 0)
6072
6097
  return L;
6073
- b = (0, d.normalizeId)(N || b);
6074
- const W = d.getSchemaRefs.call(this, v, b);
6075
- return L = new o.SchemaEnv({ schema: v, schemaId: M, meta: j, baseId: b, localRefs: W }), this._cache.set(L.schema, L), h && !b.startsWith("#") && (b && this._checkUnique(b), this.refs[b] = L), a && this.validateSchema(v, !0), L;
6098
+ E = (0, d.normalizeId)(N || E);
6099
+ const W = d.getSchemaRefs.call(this, v, E);
6100
+ return L = new o.SchemaEnv({ schema: v, schemaId: M, meta: j, baseId: E, localRefs: W }), this._cache.set(L.schema, L), h && !E.startsWith("#") && (E && this._checkUnique(E), this.refs[E] = L), a && this.validateSchema(v, !0), L;
6076
6101
  }
6077
6102
  _checkUnique(v) {
6078
6103
  if (this.schemas[v] || this.refs[v])
@@ -6094,16 +6119,16 @@ uri$1.default = uri;
6094
6119
  }
6095
6120
  }
6096
6121
  e.default = I, I.ValidationError = n.default, I.MissingRefError = s.default;
6097
- function D(F, v, j, b = "error") {
6122
+ function D(F, v, j, E = "error") {
6098
6123
  for (const a in F) {
6099
6124
  const h = a;
6100
- h in v && this.logger[b](`${j}: option ${a}. ${F[h]}`);
6125
+ h in v && this.logger[E](`${j}: option ${a}. ${F[h]}`);
6101
6126
  }
6102
6127
  }
6103
6128
  function w(F) {
6104
6129
  return F = (0, d.normalizeId)(F), this.schemas[F] || this.refs[F];
6105
6130
  }
6106
- function C() {
6131
+ function O() {
6107
6132
  const F = this.opts.schemas;
6108
6133
  if (F)
6109
6134
  if (Array.isArray(F))
@@ -6131,7 +6156,7 @@ uri$1.default = uri;
6131
6156
  }
6132
6157
  function z() {
6133
6158
  const F = { ...this.opts };
6134
- for (const v of R)
6159
+ for (const v of S)
6135
6160
  delete F[v];
6136
6161
  return F;
6137
6162
  }
@@ -6151,16 +6176,16 @@ uri$1.default = uri;
6151
6176
  const ue = /^[a-z_$][a-z0-9_$:-]*$/i;
6152
6177
  function oe(F, v) {
6153
6178
  const { RULES: j } = this;
6154
- if ((0, p.eachItem)(F, (b) => {
6155
- if (j.keywords[b])
6156
- throw new Error(`Keyword ${b} is already defined`);
6157
- if (!ue.test(b))
6158
- throw new Error(`Keyword ${b} has invalid name`);
6179
+ if ((0, p.eachItem)(F, (E) => {
6180
+ if (j.keywords[E])
6181
+ throw new Error(`Keyword ${E} is already defined`);
6182
+ if (!ue.test(E))
6183
+ throw new Error(`Keyword ${E} has invalid name`);
6159
6184
  }), !!v && v.$data && !("code" in v || "validate" in v))
6160
6185
  throw new Error('$data keyword must have "code" or "validate" function');
6161
6186
  }
6162
6187
  function ke(F, v, j) {
6163
- var b;
6188
+ var E;
6164
6189
  const a = v == null ? void 0 : v.post;
6165
6190
  if (j && a)
6166
6191
  throw new Error('keyword with "post" flag cannot have "type"');
@@ -6176,11 +6201,11 @@ uri$1.default = uri;
6176
6201
  schemaType: (0, u.getJSONTypes)(v.schemaType)
6177
6202
  }
6178
6203
  };
6179
- v.before ? Ce.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (b = v.implements) === null || b === void 0 || b.forEach((L) => this.addKeyword(L));
6204
+ v.before ? Ce.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (E = v.implements) === null || E === void 0 || E.forEach((L) => this.addKeyword(L));
6180
6205
  }
6181
6206
  function Ce(F, v, j) {
6182
- const b = F.rules.findIndex((a) => a.keyword === j);
6183
- b >= 0 ? F.rules.splice(b, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
6207
+ const E = F.rules.findIndex((a) => a.keyword === j);
6208
+ E >= 0 ? F.rules.splice(E, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
6184
6209
  }
6185
6210
  function Le(F) {
6186
6211
  let { metaSchema: v } = F;
@@ -6211,32 +6236,32 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
6211
6236
  code(e) {
6212
6237
  const { gen: t, schema: r, it: n } = e, { baseId: s, schemaEnv: i, validateName: o, opts: c, self: d } = n, { root: u } = i;
6213
6238
  if ((r === "#" || r === "#/") && s === u.baseId)
6214
- return g();
6239
+ return _();
6215
6240
  const p = compile_1$1.resolveRef.call(d, u, s, r);
6216
6241
  if (p === void 0)
6217
6242
  throw new ref_error_1.default(n.opts.uriResolver, s, r);
6218
6243
  if (p instanceof compile_1$1.SchemaEnv)
6219
6244
  return T(p);
6220
- return O(p);
6221
- function g() {
6245
+ return C(p);
6246
+ function _() {
6222
6247
  if (i === u)
6223
6248
  return callRef(e, o, i, i.$async);
6224
- const R = t.scopeValue("root", { ref: u });
6225
- return callRef(e, (0, codegen_1$l._)`${R}.validate`, u, u.$async);
6249
+ const S = t.scopeValue("root", { ref: u });
6250
+ return callRef(e, (0, codegen_1$l._)`${S}.validate`, u, u.$async);
6226
6251
  }
6227
- function T(R) {
6228
- const k = getValidate(e, R);
6229
- callRef(e, k, R, R.$async);
6252
+ function T(S) {
6253
+ const k = getValidate(e, S);
6254
+ callRef(e, k, S, S.$async);
6230
6255
  }
6231
- function O(R) {
6232
- const k = t.scopeValue("schema", c.code.source === !0 ? { ref: R, code: (0, codegen_1$l.stringify)(R) } : { ref: R }), $ = t.name("valid"), _ = e.subschema({
6233
- schema: R,
6256
+ function C(S) {
6257
+ const k = t.scopeValue("schema", c.code.source === !0 ? { ref: S, code: (0, codegen_1$l.stringify)(S) } : { ref: S }), $ = t.name("valid"), g = e.subschema({
6258
+ schema: S,
6234
6259
  dataTypes: [],
6235
6260
  schemaPath: codegen_1$l.nil,
6236
6261
  topSchemaRef: k,
6237
6262
  errSchemaPath: r
6238
6263
  }, $);
6239
- e.mergeEvaluated(_), e.ok($);
6264
+ e.mergeEvaluated(g), e.ok($);
6240
6265
  }
6241
6266
  }
6242
6267
  };
@@ -6247,25 +6272,25 @@ function getValidate(e, t) {
6247
6272
  ref.getValidate = getValidate;
6248
6273
  function callRef(e, t, r, n) {
6249
6274
  const { gen: s, it: i } = e, { allErrors: o, schemaEnv: c, opts: d } = i, u = d.passContext ? names_1$1.default.this : codegen_1$l.nil;
6250
- n ? p() : g();
6275
+ n ? p() : _();
6251
6276
  function p() {
6252
6277
  if (!c.$async)
6253
6278
  throw new Error("async schema referenced by sync schema");
6254
- const R = s.let("valid");
6279
+ const S = s.let("valid");
6255
6280
  s.try(() => {
6256
- s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), O(t), o || s.assign(R, !0);
6281
+ s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), C(t), o || s.assign(S, !0);
6257
6282
  }, (k) => {
6258
- s.if((0, codegen_1$l._)`!(${k} instanceof ${i.ValidationError})`, () => s.throw(k)), T(k), o || s.assign(R, !1);
6259
- }), e.ok(R);
6283
+ s.if((0, codegen_1$l._)`!(${k} instanceof ${i.ValidationError})`, () => s.throw(k)), T(k), o || s.assign(S, !1);
6284
+ }), e.ok(S);
6260
6285
  }
6261
- function g() {
6262
- e.result((0, code_1$8.callValidateCode)(e, t, u), () => O(t), () => T(t));
6286
+ function _() {
6287
+ e.result((0, code_1$8.callValidateCode)(e, t, u), () => C(t), () => T(t));
6263
6288
  }
6264
- function T(R) {
6265
- const k = (0, codegen_1$l._)`${R}.errors`;
6289
+ function T(S) {
6290
+ const k = (0, codegen_1$l._)`${S}.errors`;
6266
6291
  s.assign(names_1$1.default.vErrors, (0, codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${k} : ${names_1$1.default.vErrors}.concat(${k})`), s.assign(names_1$1.default.errors, (0, codegen_1$l._)`${names_1$1.default.vErrors}.length`);
6267
6292
  }
6268
- function O(R) {
6293
+ function C(S) {
6269
6294
  var k;
6270
6295
  if (!i.opts.unevaluated)
6271
6296
  return;
@@ -6274,15 +6299,15 @@ function callRef(e, t, r, n) {
6274
6299
  if ($ && !$.dynamicProps)
6275
6300
  $.props !== void 0 && (i.props = util_1$j.mergeEvaluated.props(s, $.props, i.props));
6276
6301
  else {
6277
- const _ = s.var("props", (0, codegen_1$l._)`${R}.evaluated.props`);
6278
- i.props = util_1$j.mergeEvaluated.props(s, _, i.props, codegen_1$l.Name);
6302
+ const g = s.var("props", (0, codegen_1$l._)`${S}.evaluated.props`);
6303
+ i.props = util_1$j.mergeEvaluated.props(s, g, i.props, codegen_1$l.Name);
6279
6304
  }
6280
6305
  if (i.items !== !0)
6281
6306
  if ($ && !$.dynamicItems)
6282
6307
  $.items !== void 0 && (i.items = util_1$j.mergeEvaluated.items(s, $.items, i.items));
6283
6308
  else {
6284
- const _ = s.var("items", (0, codegen_1$l._)`${R}.evaluated.items`);
6285
- i.items = util_1$j.mergeEvaluated.items(s, _, i.items, codegen_1$l.Name);
6309
+ const g = s.var("items", (0, codegen_1$l._)`${S}.evaluated.items`);
6310
+ i.items = util_1$j.mergeEvaluated.items(s, g, i.items, codegen_1$l.Name);
6286
6311
  }
6287
6312
  }
6288
6313
  }
@@ -6423,36 +6448,36 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
6423
6448
  return;
6424
6449
  const d = r.length >= c.loopRequired;
6425
6450
  if (o.allErrors ? u() : p(), c.strictRequired) {
6426
- const O = e.parentSchema.properties, { definedProperties: R } = e.it;
6451
+ const C = e.parentSchema.properties, { definedProperties: S } = e.it;
6427
6452
  for (const k of r)
6428
- if ((O == null ? void 0 : O[k]) === void 0 && !R.has(k)) {
6429
- const $ = o.schemaEnv.baseId + o.errSchemaPath, _ = `required property "${k}" is not defined at "${$}" (strictRequired)`;
6430
- (0, util_1$h.checkStrictMode)(o, _, o.opts.strictRequired);
6453
+ if ((C == null ? void 0 : C[k]) === void 0 && !S.has(k)) {
6454
+ const $ = o.schemaEnv.baseId + o.errSchemaPath, g = `required property "${k}" is not defined at "${$}" (strictRequired)`;
6455
+ (0, util_1$h.checkStrictMode)(o, g, o.opts.strictRequired);
6431
6456
  }
6432
6457
  }
6433
6458
  function u() {
6434
6459
  if (d || i)
6435
- e.block$data(codegen_1$f.nil, g);
6460
+ e.block$data(codegen_1$f.nil, _);
6436
6461
  else
6437
- for (const O of r)
6438
- (0, code_1$6.checkReportMissingProp)(e, O);
6462
+ for (const C of r)
6463
+ (0, code_1$6.checkReportMissingProp)(e, C);
6439
6464
  }
6440
6465
  function p() {
6441
- const O = t.let("missing");
6466
+ const C = t.let("missing");
6442
6467
  if (d || i) {
6443
- const R = t.let("valid", !0);
6444
- e.block$data(R, () => T(O, R)), e.ok(R);
6468
+ const S = t.let("valid", !0);
6469
+ e.block$data(S, () => T(C, S)), e.ok(S);
6445
6470
  } else
6446
- t.if((0, code_1$6.checkMissingProp)(e, r, O)), (0, code_1$6.reportMissingProp)(e, O), t.else();
6471
+ t.if((0, code_1$6.checkMissingProp)(e, r, C)), (0, code_1$6.reportMissingProp)(e, C), t.else();
6447
6472
  }
6448
- function g() {
6449
- t.forOf("prop", n, (O) => {
6450
- e.setParams({ missingProperty: O }), t.if((0, code_1$6.noPropertyInData)(t, s, O, c.ownProperties), () => e.error());
6473
+ function _() {
6474
+ t.forOf("prop", n, (C) => {
6475
+ e.setParams({ missingProperty: C }), t.if((0, code_1$6.noPropertyInData)(t, s, C, c.ownProperties), () => e.error());
6451
6476
  });
6452
6477
  }
6453
- function T(O, R) {
6454
- e.setParams({ missingProperty: O }), t.forOf(O, n, () => {
6455
- t.assign(R, (0, code_1$6.propertyInData)(t, s, O, c.ownProperties)), t.if((0, codegen_1$f.not)(R), () => {
6478
+ function T(C, S) {
6479
+ e.setParams({ missingProperty: C }), t.forOf(C, n, () => {
6480
+ t.assign(S, (0, code_1$6.propertyInData)(t, s, C, c.ownProperties)), t.if((0, codegen_1$f.not)(S), () => {
6456
6481
  e.error(), t.break();
6457
6482
  });
6458
6483
  }, codegen_1$f.nil);
@@ -6502,24 +6527,24 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
6502
6527
  const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
6503
6528
  e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
6504
6529
  function p() {
6505
- const R = t.let("i", (0, codegen_1$d._)`${r}.length`), k = t.let("j");
6506
- e.setParams({ i: R, j: k }), t.assign(d, !0), t.if((0, codegen_1$d._)`${R} > 1`, () => (g() ? T : O)(R, k));
6530
+ const S = t.let("i", (0, codegen_1$d._)`${r}.length`), k = t.let("j");
6531
+ e.setParams({ i: S, j: k }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => (_() ? T : C)(S, k));
6507
6532
  }
6508
- function g() {
6509
- return u.length > 0 && !u.some((R) => R === "object" || R === "array");
6533
+ function _() {
6534
+ return u.length > 0 && !u.some((S) => S === "object" || S === "array");
6510
6535
  }
6511
- function T(R, k) {
6512
- const $ = t.name("item"), _ = (0, dataType_1.checkDataTypes)(u, $, c.opts.strictNumbers, dataType_1.DataType.Wrong), y = t.const("indices", (0, codegen_1$d._)`{}`);
6513
- t.for((0, codegen_1$d._)`;${R}--;`, () => {
6514
- t.let($, (0, codegen_1$d._)`${r}[${R}]`), t.if(_, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${$} == "string"`, (0, codegen_1$d._)`${$} += "_"`), t.if((0, codegen_1$d._)`typeof ${y}[${$}] == "number"`, () => {
6536
+ function T(S, k) {
6537
+ const $ = t.name("item"), g = (0, dataType_1.checkDataTypes)(u, $, c.opts.strictNumbers, dataType_1.DataType.Wrong), y = t.const("indices", (0, codegen_1$d._)`{}`);
6538
+ t.for((0, codegen_1$d._)`;${S}--;`, () => {
6539
+ t.let($, (0, codegen_1$d._)`${r}[${S}]`), t.if(g, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${$} == "string"`, (0, codegen_1$d._)`${$} += "_"`), t.if((0, codegen_1$d._)`typeof ${y}[${$}] == "number"`, () => {
6515
6540
  t.assign(k, (0, codegen_1$d._)`${y}[${$}]`), e.error(), t.assign(d, !1).break();
6516
- }).code((0, codegen_1$d._)`${y}[${$}] = ${R}`);
6541
+ }).code((0, codegen_1$d._)`${y}[${$}] = ${S}`);
6517
6542
  });
6518
6543
  }
6519
- function O(R, k) {
6520
- const $ = (0, util_1$g.useFunc)(t, equal_1$2.default), _ = t.name("outer");
6521
- t.label(_).for((0, codegen_1$d._)`;${R}--;`, () => t.for((0, codegen_1$d._)`${k} = ${R}; ${k}--;`, () => t.if((0, codegen_1$d._)`${$}(${r}[${R}], ${r}[${k}])`, () => {
6522
- e.error(), t.assign(d, !1).break(_);
6544
+ function C(S, k) {
6545
+ const $ = (0, util_1$g.useFunc)(t, equal_1$2.default), g = t.name("outer");
6546
+ t.label(g).for((0, codegen_1$d._)`;${S}--;`, () => t.for((0, codegen_1$d._)`${k} = ${S}; ${k}--;`, () => t.if((0, codegen_1$d._)`${$}(${r}[${S}], ${r}[${k}])`, () => {
6547
+ e.error(), t.assign(d, !1).break(g);
6523
6548
  })));
6524
6549
  }
6525
6550
  }
@@ -6559,20 +6584,20 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
6559
6584
  const u = () => d ?? (d = (0, util_1$e.useFunc)(t, equal_1.default));
6560
6585
  let p;
6561
6586
  if (c || n)
6562
- p = t.let("valid"), e.block$data(p, g);
6587
+ p = t.let("valid"), e.block$data(p, _);
6563
6588
  else {
6564
6589
  if (!Array.isArray(s))
6565
6590
  throw new Error("ajv implementation error");
6566
- const O = t.const("vSchema", i);
6567
- p = (0, codegen_1$b.or)(...s.map((R, k) => T(O, k)));
6591
+ const C = t.const("vSchema", i);
6592
+ p = (0, codegen_1$b.or)(...s.map((S, k) => T(C, k)));
6568
6593
  }
6569
6594
  e.pass(p);
6570
- function g() {
6571
- t.assign(p, !1), t.forOf("v", i, (O) => t.if((0, codegen_1$b._)`${u()}(${r}, ${O})`, () => t.assign(p, !0).break()));
6595
+ function _() {
6596
+ t.assign(p, !1), t.forOf("v", i, (C) => t.if((0, codegen_1$b._)`${u()}(${r}, ${C})`, () => t.assign(p, !0).break()));
6572
6597
  }
6573
- function T(O, R) {
6574
- const k = s[R];
6575
- return typeof k == "object" && k !== null ? (0, codegen_1$b._)`${u()}(${r}, ${O}[${R}])` : (0, codegen_1$b._)`${r} === ${k}`;
6598
+ function T(C, S) {
6599
+ const k = s[S];
6600
+ return typeof k == "object" && k !== null ? (0, codegen_1$b._)`${u()}(${r}, ${C}[${S}])` : (0, codegen_1$b._)`${r} === ${k}`;
6576
6601
  }
6577
6602
  }
6578
6603
  };
@@ -6656,17 +6681,17 @@ function validateTuple(e, t, r = e.schema) {
6656
6681
  const { gen: n, parentSchema: s, data: i, keyword: o, it: c } = e;
6657
6682
  p(s), c.opts.unevaluated && r.length && c.items !== !0 && (c.items = util_1$c.mergeEvaluated.items(n, r.length, c.items));
6658
6683
  const d = n.name("valid"), u = n.const("len", (0, codegen_1$9._)`${i}.length`);
6659
- r.forEach((g, T) => {
6660
- (0, util_1$c.alwaysValidSchema)(c, g) || (n.if((0, codegen_1$9._)`${u} > ${T}`, () => e.subschema({
6684
+ r.forEach((_, T) => {
6685
+ (0, util_1$c.alwaysValidSchema)(c, _) || (n.if((0, codegen_1$9._)`${u} > ${T}`, () => e.subschema({
6661
6686
  keyword: o,
6662
6687
  schemaProp: T,
6663
6688
  dataProp: T
6664
6689
  }, d)), e.ok(d));
6665
6690
  });
6666
- function p(g) {
6667
- const { opts: T, errSchemaPath: O } = c, R = r.length, k = R === g.minItems && (R === g.maxItems || g[t] === !1);
6691
+ function p(_) {
6692
+ const { opts: T, errSchemaPath: C } = c, S = r.length, k = S === _.minItems && (S === _.maxItems || _[t] === !1);
6668
6693
  if (T.strictTuples && !k) {
6669
- const $ = `"${o}" is ${R}-tuple, but minItems or maxItems/${t} are not specified or different at path "${O}"`;
6694
+ const $ = `"${o}" is ${S}-tuple, but minItems or maxItems/${t} are not specified or different at path "${C}"`;
6670
6695
  (0, util_1$c.checkStrictMode)(c, $, T.strictTuples);
6671
6696
  }
6672
6697
  }
@@ -6731,24 +6756,24 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
6731
6756
  return;
6732
6757
  }
6733
6758
  i.items = !0;
6734
- const g = t.name("valid");
6735
- c === void 0 && o === 1 ? O(g, () => t.if(g, () => t.break())) : o === 0 ? (t.let(g, !0), c !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, T)) : (t.let(g, !1), T()), e.result(g, () => e.reset());
6759
+ const _ = t.name("valid");
6760
+ c === void 0 && o === 1 ? C(_, () => t.if(_, () => t.break())) : o === 0 ? (t.let(_, !0), c !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, T)) : (t.let(_, !1), T()), e.result(_, () => e.reset());
6736
6761
  function T() {
6737
6762
  const k = t.name("_valid"), $ = t.let("count", 0);
6738
- O(k, () => t.if(k, () => R($)));
6763
+ C(k, () => t.if(k, () => S($)));
6739
6764
  }
6740
- function O(k, $) {
6741
- t.forRange("i", 0, p, (_) => {
6765
+ function C(k, $) {
6766
+ t.forRange("i", 0, p, (g) => {
6742
6767
  e.subschema({
6743
6768
  keyword: "contains",
6744
- dataProp: _,
6769
+ dataProp: g,
6745
6770
  dataPropType: util_1$a.Type.Num,
6746
6771
  compositeRule: !0
6747
6772
  }, k), $();
6748
6773
  });
6749
6774
  }
6750
- function R(k) {
6751
- t.code((0, codegen_1$7._)`${k}++`), c === void 0 ? t.if((0, codegen_1$7._)`${k} >= ${o}`, () => t.assign(g, !0).break()) : (t.if((0, codegen_1$7._)`${k} > ${c}`, () => t.assign(g, !1).break()), o === 1 ? t.assign(g, !0) : t.if((0, codegen_1$7._)`${k} >= ${o}`, () => t.assign(g, !0)));
6775
+ function S(k) {
6776
+ t.code((0, codegen_1$7._)`${k}++`), c === void 0 ? t.if((0, codegen_1$7._)`${k} >= ${o}`, () => t.assign(_, !0).break()) : (t.if((0, codegen_1$7._)`${k} > ${c}`, () => t.assign(_, !1).break()), o === 1 ? t.assign(_, !0) : t.if((0, codegen_1$7._)`${k} >= ${o}`, () => t.assign(_, !0)));
6752
6777
  }
6753
6778
  }
6754
6779
  };
@@ -6759,11 +6784,11 @@ var dependencies = {};
6759
6784
  const t = codegen, r = util, n = code;
6760
6785
  e.error = {
6761
6786
  message: ({ params: { property: d, depsCount: u, deps: p } }) => {
6762
- const g = u === 1 ? "property" : "properties";
6763
- return (0, t.str)`must have ${g} ${p} when property ${d} is present`;
6787
+ const _ = u === 1 ? "property" : "properties";
6788
+ return (0, t.str)`must have ${_} ${p} when property ${d} is present`;
6764
6789
  },
6765
- params: ({ params: { property: d, depsCount: u, deps: p, missingProperty: g } }) => (0, t._)`{property: ${d},
6766
- missingProperty: ${g},
6790
+ params: ({ params: { property: d, depsCount: u, deps: p, missingProperty: _ } }) => (0, t._)`{property: ${d},
6791
+ missingProperty: ${_},
6767
6792
  depsCount: ${u},
6768
6793
  deps: ${p}}`
6769
6794
  // TODO change to reference
@@ -6780,47 +6805,47 @@ var dependencies = {};
6780
6805
  };
6781
6806
  function i({ schema: d }) {
6782
6807
  const u = {}, p = {};
6783
- for (const g in d) {
6784
- if (g === "__proto__")
6808
+ for (const _ in d) {
6809
+ if (_ === "__proto__")
6785
6810
  continue;
6786
- const T = Array.isArray(d[g]) ? u : p;
6787
- T[g] = d[g];
6811
+ const T = Array.isArray(d[_]) ? u : p;
6812
+ T[_] = d[_];
6788
6813
  }
6789
6814
  return [u, p];
6790
6815
  }
6791
6816
  function o(d, u = d.schema) {
6792
- const { gen: p, data: g, it: T } = d;
6817
+ const { gen: p, data: _, it: T } = d;
6793
6818
  if (Object.keys(u).length === 0)
6794
6819
  return;
6795
- const O = p.let("missing");
6796
- for (const R in u) {
6797
- const k = u[R];
6820
+ const C = p.let("missing");
6821
+ for (const S in u) {
6822
+ const k = u[S];
6798
6823
  if (k.length === 0)
6799
6824
  continue;
6800
- const $ = (0, n.propertyInData)(p, g, R, T.opts.ownProperties);
6825
+ const $ = (0, n.propertyInData)(p, _, S, T.opts.ownProperties);
6801
6826
  d.setParams({
6802
- property: R,
6827
+ property: S,
6803
6828
  depsCount: k.length,
6804
6829
  deps: k.join(", ")
6805
6830
  }), T.allErrors ? p.if($, () => {
6806
- for (const _ of k)
6807
- (0, n.checkReportMissingProp)(d, _);
6808
- }) : (p.if((0, t._)`${$} && (${(0, n.checkMissingProp)(d, k, O)})`), (0, n.reportMissingProp)(d, O), p.else());
6831
+ for (const g of k)
6832
+ (0, n.checkReportMissingProp)(d, g);
6833
+ }) : (p.if((0, t._)`${$} && (${(0, n.checkMissingProp)(d, k, C)})`), (0, n.reportMissingProp)(d, C), p.else());
6809
6834
  }
6810
6835
  }
6811
6836
  e.validatePropertyDeps = o;
6812
6837
  function c(d, u = d.schema) {
6813
- const { gen: p, data: g, keyword: T, it: O } = d, R = p.name("valid");
6838
+ const { gen: p, data: _, keyword: T, it: C } = d, S = p.name("valid");
6814
6839
  for (const k in u)
6815
- (0, r.alwaysValidSchema)(O, u[k]) || (p.if(
6816
- (0, n.propertyInData)(p, g, k, O.opts.ownProperties),
6840
+ (0, r.alwaysValidSchema)(C, u[k]) || (p.if(
6841
+ (0, n.propertyInData)(p, _, k, C.opts.ownProperties),
6817
6842
  () => {
6818
- const $ = d.subschema({ keyword: T, schemaProp: k }, R);
6819
- d.mergeValidEvaluated($, R);
6843
+ const $ = d.subschema({ keyword: T, schemaProp: k }, S);
6844
+ d.mergeValidEvaluated($, S);
6820
6845
  },
6821
- () => p.var(R, !0)
6846
+ () => p.var(S, !0)
6822
6847
  // TODO var
6823
- ), d.ok(R));
6848
+ ), d.ok(S));
6824
6849
  }
6825
6850
  e.validateSchemaDeps = c, e.default = s;
6826
6851
  })(dependencies);
@@ -6873,27 +6898,27 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
6873
6898
  if (o.props = !0, d.removeAdditional !== "all" && (0, util_1$8.alwaysValidSchema)(o, r))
6874
6899
  return;
6875
6900
  const u = (0, code_1$3.allSchemaProperties)(n.properties), p = (0, code_1$3.allSchemaProperties)(n.patternProperties);
6876
- g(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
6877
- function g() {
6901
+ _(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
6902
+ function _() {
6878
6903
  t.forIn("key", s, ($) => {
6879
- !u.length && !p.length ? R($) : t.if(T($), () => R($));
6904
+ !u.length && !p.length ? S($) : t.if(T($), () => S($));
6880
6905
  });
6881
6906
  }
6882
6907
  function T($) {
6883
- let _;
6908
+ let g;
6884
6909
  if (u.length > 8) {
6885
6910
  const y = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
6886
- _ = (0, code_1$3.isOwnProperty)(t, y, $);
6911
+ g = (0, code_1$3.isOwnProperty)(t, y, $);
6887
6912
  } else
6888
- u.length ? _ = (0, codegen_1$5.or)(...u.map((y) => (0, codegen_1$5._)`${$} === ${y}`)) : _ = codegen_1$5.nil;
6889
- return p.length && (_ = (0, codegen_1$5.or)(_, ...p.map((y) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, y)}.test(${$})`))), (0, codegen_1$5.not)(_);
6913
+ u.length ? g = (0, codegen_1$5.or)(...u.map((y) => (0, codegen_1$5._)`${$} === ${y}`)) : g = codegen_1$5.nil;
6914
+ return p.length && (g = (0, codegen_1$5.or)(g, ...p.map((y) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, y)}.test(${$})`))), (0, codegen_1$5.not)(g);
6890
6915
  }
6891
- function O($) {
6916
+ function C($) {
6892
6917
  t.code((0, codegen_1$5._)`delete ${s}[${$}]`);
6893
6918
  }
6894
- function R($) {
6919
+ function S($) {
6895
6920
  if (d.removeAdditional === "all" || d.removeAdditional && r === !1) {
6896
- O($);
6921
+ C($);
6897
6922
  return;
6898
6923
  }
6899
6924
  if (r === !1) {
@@ -6901,13 +6926,13 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
6901
6926
  return;
6902
6927
  }
6903
6928
  if (typeof r == "object" && !(0, util_1$8.alwaysValidSchema)(o, r)) {
6904
- const _ = t.name("valid");
6905
- d.removeAdditional === "failing" ? (k($, _, !1), t.if((0, codegen_1$5.not)(_), () => {
6906
- e.reset(), O($);
6907
- })) : (k($, _), c || t.if((0, codegen_1$5.not)(_), () => t.break()));
6929
+ const g = t.name("valid");
6930
+ d.removeAdditional === "failing" ? (k($, g, !1), t.if((0, codegen_1$5.not)(g), () => {
6931
+ e.reset(), C($);
6932
+ })) : (k($, g), c || t.if((0, codegen_1$5.not)(g), () => t.break()));
6908
6933
  }
6909
6934
  }
6910
- function k($, _, y) {
6935
+ function k($, g, y) {
6911
6936
  const P = {
6912
6937
  keyword: "additionalProperties",
6913
6938
  dataProp: $,
@@ -6917,7 +6942,7 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
6917
6942
  compositeRule: !0,
6918
6943
  createErrors: !1,
6919
6944
  allErrors: !1
6920
- }), e.subschema(P, _);
6945
+ }), e.subschema(P, g);
6921
6946
  }
6922
6947
  }
6923
6948
  };
@@ -6932,23 +6957,23 @@ const validate_1 = validate, code_1$2 = code, util_1$7 = util, additionalPropert
6932
6957
  const { gen: t, schema: r, parentSchema: n, data: s, it: i } = e;
6933
6958
  i.opts.removeAdditional === "all" && n.additionalProperties === void 0 && additionalProperties_1$1.default.code(new validate_1.KeywordCxt(i, additionalProperties_1$1.default, "additionalProperties"));
6934
6959
  const o = (0, code_1$2.allSchemaProperties)(r);
6935
- for (const g of o)
6936
- i.definedProperties.add(g);
6960
+ for (const _ of o)
6961
+ i.definedProperties.add(_);
6937
6962
  i.opts.unevaluated && o.length && i.props !== !0 && (i.props = util_1$7.mergeEvaluated.props(t, (0, util_1$7.toHash)(o), i.props));
6938
- const c = o.filter((g) => !(0, util_1$7.alwaysValidSchema)(i, r[g]));
6963
+ const c = o.filter((_) => !(0, util_1$7.alwaysValidSchema)(i, r[_]));
6939
6964
  if (c.length === 0)
6940
6965
  return;
6941
6966
  const d = t.name("valid");
6942
- for (const g of c)
6943
- u(g) ? p(g) : (t.if((0, code_1$2.propertyInData)(t, s, g, i.opts.ownProperties)), p(g), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(g), e.ok(d);
6944
- function u(g) {
6945
- return i.opts.useDefaults && !i.compositeRule && r[g].default !== void 0;
6967
+ for (const _ of c)
6968
+ u(_) ? p(_) : (t.if((0, code_1$2.propertyInData)(t, s, _, i.opts.ownProperties)), p(_), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(_), e.ok(d);
6969
+ function u(_) {
6970
+ return i.opts.useDefaults && !i.compositeRule && r[_].default !== void 0;
6946
6971
  }
6947
- function p(g) {
6972
+ function p(_) {
6948
6973
  e.subschema({
6949
6974
  keyword: "properties",
6950
- schemaProp: g,
6951
- dataProp: g
6975
+ schemaProp: _,
6976
+ dataProp: _
6952
6977
  }, d);
6953
6978
  }
6954
6979
  }
@@ -6966,26 +6991,26 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
6966
6991
  return;
6967
6992
  const u = o.strictSchema && !o.allowMatchingProperties && s.properties, p = t.name("valid");
6968
6993
  i.props !== !0 && !(i.props instanceof codegen_1$4.Name) && (i.props = (0, util_2.evaluatedPropsToName)(t, i.props));
6969
- const { props: g } = i;
6994
+ const { props: _ } = i;
6970
6995
  T();
6971
6996
  function T() {
6972
6997
  for (const k of c)
6973
- u && O(k), i.allErrors ? R(k) : (t.var(p, !0), R(k), t.if(p));
6998
+ u && C(k), i.allErrors ? S(k) : (t.var(p, !0), S(k), t.if(p));
6974
6999
  }
6975
- function O(k) {
7000
+ function C(k) {
6976
7001
  for (const $ in u)
6977
7002
  new RegExp(k).test($) && (0, util_1$6.checkStrictMode)(i, `property ${$} matches pattern ${k} (use allowMatchingProperties)`);
6978
7003
  }
6979
- function R(k) {
7004
+ function S(k) {
6980
7005
  t.forIn("key", n, ($) => {
6981
7006
  t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, k)}.test(${$})`, () => {
6982
- const _ = d.includes(k);
6983
- _ || e.subschema({
7007
+ const g = d.includes(k);
7008
+ g || e.subschema({
6984
7009
  keyword: "patternProperties",
6985
7010
  schemaProp: k,
6986
7011
  dataProp: $,
6987
7012
  dataPropType: util_2.Type.Str
6988
- }, p), i.opts.unevaluated && g !== !0 ? t.assign((0, codegen_1$4._)`${g}[${$}]`, !0) : !_ && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
7013
+ }, p), i.opts.unevaluated && _ !== !0 ? t.assign((0, codegen_1$4._)`${_}[${$}]`, !0) : !g && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
6989
7014
  });
6990
7015
  });
6991
7016
  }
@@ -7044,14 +7069,14 @@ const codegen_1$3 = codegen, util_1$4 = util, error$3 = {
7044
7069
  const i = r, o = t.let("valid", !1), c = t.let("passing", null), d = t.name("_valid");
7045
7070
  e.setParams({ passing: c }), t.block(u), e.result(o, () => e.reset(), () => e.error(!0));
7046
7071
  function u() {
7047
- i.forEach((p, g) => {
7072
+ i.forEach((p, _) => {
7048
7073
  let T;
7049
7074
  (0, util_1$4.alwaysValidSchema)(s, p) ? t.var(d, !0) : T = e.subschema({
7050
7075
  keyword: "oneOf",
7051
- schemaProp: g,
7076
+ schemaProp: _,
7052
7077
  compositeRule: !0
7053
- }, d), g > 0 && t.if((0, codegen_1$3._)`${d} && ${o}`).assign(o, !1).assign(c, (0, codegen_1$3._)`[${c}, ${g}]`).else(), t.if(d, () => {
7054
- t.assign(o, !0), t.assign(c, g), T && e.mergeEvaluated(T, codegen_1$3.Name);
7078
+ }, d), _ > 0 && t.if((0, codegen_1$3._)`${d} && ${o}`).assign(o, !1).assign(c, (0, codegen_1$3._)`[${c}, ${_}]`).else(), t.if(d, () => {
7079
+ t.assign(o, !0), t.assign(c, _), T && e.mergeEvaluated(T, codegen_1$3.Name);
7055
7080
  });
7056
7081
  });
7057
7082
  }
@@ -7109,10 +7134,10 @@ const codegen_1$2 = codegen, util_1$2 = util, error$2 = {
7109
7134
  }, c);
7110
7135
  e.mergeEvaluated(p);
7111
7136
  }
7112
- function u(p, g) {
7137
+ function u(p, _) {
7113
7138
  return () => {
7114
7139
  const T = e.subschema({ keyword: p }, c);
7115
- t.assign(o, c), e.mergeValidEvaluated(T, o), g ? t.assign(g, (0, codegen_1$2._)`${p}`) : e.setParams({ ifClause: p });
7140
+ t.assign(o, c), e.mergeValidEvaluated(T, o), _ ? t.assign(_, (0, codegen_1$2._)`${p}`) : e.setParams({ ifClause: p });
7116
7141
  };
7117
7142
  }
7118
7143
  }
@@ -7165,37 +7190,37 @@ const codegen_1$1 = codegen, error$1 = {
7165
7190
  $data: !0,
7166
7191
  error: error$1,
7167
7192
  code(e, t) {
7168
- const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: c } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self: g } = c;
7193
+ const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: c } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self: _ } = c;
7169
7194
  if (!d.validateFormats)
7170
7195
  return;
7171
- s ? T() : O();
7196
+ s ? T() : C();
7172
7197
  function T() {
7173
- const R = r.scopeValue("formats", {
7174
- ref: g.formats,
7198
+ const S = r.scopeValue("formats", {
7199
+ ref: _.formats,
7175
7200
  code: d.code.formats
7176
- }), k = r.const("fDef", (0, codegen_1$1._)`${R}[${o}]`), $ = r.let("fType"), _ = r.let("format");
7177
- r.if((0, codegen_1$1._)`typeof ${k} == "object" && !(${k} instanceof RegExp)`, () => r.assign($, (0, codegen_1$1._)`${k}.type || "string"`).assign(_, (0, codegen_1$1._)`${k}.validate`), () => r.assign($, (0, codegen_1$1._)`"string"`).assign(_, k)), e.fail$data((0, codegen_1$1.or)(y(), P()));
7201
+ }), k = r.const("fDef", (0, codegen_1$1._)`${S}[${o}]`), $ = r.let("fType"), g = r.let("format");
7202
+ r.if((0, codegen_1$1._)`typeof ${k} == "object" && !(${k} instanceof RegExp)`, () => r.assign($, (0, codegen_1$1._)`${k}.type || "string"`).assign(g, (0, codegen_1$1._)`${k}.validate`), () => r.assign($, (0, codegen_1$1._)`"string"`).assign(g, k)), e.fail$data((0, codegen_1$1.or)(y(), P()));
7178
7203
  function y() {
7179
- return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${_}`;
7204
+ return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${g}`;
7180
7205
  }
7181
7206
  function P() {
7182
- const I = p.$async ? (0, codegen_1$1._)`(${k}.async ? await ${_}(${n}) : ${_}(${n}))` : (0, codegen_1$1._)`${_}(${n})`, D = (0, codegen_1$1._)`(typeof ${_} == "function" ? ${I} : ${_}.test(${n}))`;
7183
- return (0, codegen_1$1._)`${_} && ${_} !== true && ${$} === ${t} && !${D}`;
7207
+ const I = p.$async ? (0, codegen_1$1._)`(${k}.async ? await ${g}(${n}) : ${g}(${n}))` : (0, codegen_1$1._)`${g}(${n})`, D = (0, codegen_1$1._)`(typeof ${g} == "function" ? ${I} : ${g}.test(${n}))`;
7208
+ return (0, codegen_1$1._)`${g} && ${g} !== true && ${$} === ${t} && !${D}`;
7184
7209
  }
7185
7210
  }
7186
- function O() {
7187
- const R = g.formats[i];
7188
- if (!R) {
7211
+ function C() {
7212
+ const S = _.formats[i];
7213
+ if (!S) {
7189
7214
  y();
7190
7215
  return;
7191
7216
  }
7192
- if (R === !0)
7217
+ if (S === !0)
7193
7218
  return;
7194
- const [k, $, _] = P(R);
7219
+ const [k, $, g] = P(S);
7195
7220
  k === t && e.pass(I());
7196
7221
  function y() {
7197
7222
  if (d.strictSchema === !1) {
7198
- g.logger.warn(D());
7223
+ _.logger.warn(D());
7199
7224
  return;
7200
7225
  }
7201
7226
  throw new Error(D());
@@ -7204,16 +7229,16 @@ const codegen_1$1 = codegen, error$1 = {
7204
7229
  }
7205
7230
  }
7206
7231
  function P(D) {
7207
- const w = D instanceof RegExp ? (0, codegen_1$1.regexpCode)(D) : d.code.formats ? (0, codegen_1$1._)`${d.code.formats}${(0, codegen_1$1.getProperty)(i)}` : void 0, C = r.scopeValue("formats", { key: i, ref: D, code: w });
7208
- return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${C}.validate`] : ["string", D, C];
7232
+ const w = D instanceof RegExp ? (0, codegen_1$1.regexpCode)(D) : d.code.formats ? (0, codegen_1$1._)`${d.code.formats}${(0, codegen_1$1.getProperty)(i)}` : void 0, O = r.scopeValue("formats", { key: i, ref: D, code: w });
7233
+ return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${O}.validate`] : ["string", D, O];
7209
7234
  }
7210
7235
  function I() {
7211
- if (typeof R == "object" && !(R instanceof RegExp) && R.async) {
7236
+ if (typeof S == "object" && !(S instanceof RegExp) && S.async) {
7212
7237
  if (!p.$async)
7213
7238
  throw new Error("async format in sync schema");
7214
- return (0, codegen_1$1._)`await ${_}(${n})`;
7239
+ return (0, codegen_1$1._)`await ${g}(${n})`;
7215
7240
  }
7216
- return typeof $ == "function" ? (0, codegen_1$1._)`${_}(${n})` : (0, codegen_1$1._)`${_}.test(${n})`;
7241
+ return typeof $ == "function" ? (0, codegen_1$1._)`${g}(${n})` : (0, codegen_1$1._)`${g}.test(${n})`;
7217
7242
  }
7218
7243
  }
7219
7244
  }
@@ -7278,32 +7303,32 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7278
7303
  const d = t.let("valid", !1), u = t.const("tag", (0, codegen_1._)`${r}${(0, codegen_1.getProperty)(c)}`);
7279
7304
  t.if((0, codegen_1._)`typeof ${u} == "string"`, () => p(), () => e.error(!1, { discrError: types_1.DiscrError.Tag, tag: u, tagName: c })), e.ok(d);
7280
7305
  function p() {
7281
- const O = T();
7306
+ const C = T();
7282
7307
  t.if(!1);
7283
- for (const R in O)
7284
- t.elseIf((0, codegen_1._)`${u} === ${R}`), t.assign(d, g(O[R]));
7308
+ for (const S in C)
7309
+ t.elseIf((0, codegen_1._)`${u} === ${S}`), t.assign(d, _(C[S]));
7285
7310
  t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: c }), t.endIf();
7286
7311
  }
7287
- function g(O) {
7288
- const R = t.name("valid"), k = e.subschema({ keyword: "oneOf", schemaProp: O }, R);
7289
- return e.mergeEvaluated(k, codegen_1.Name), R;
7312
+ function _(C) {
7313
+ const S = t.name("valid"), k = e.subschema({ keyword: "oneOf", schemaProp: C }, S);
7314
+ return e.mergeEvaluated(k, codegen_1.Name), S;
7290
7315
  }
7291
7316
  function T() {
7292
- var O;
7293
- const R = {}, k = _(s);
7317
+ var C;
7318
+ const S = {}, k = g(s);
7294
7319
  let $ = !0;
7295
7320
  for (let I = 0; I < o.length; I++) {
7296
7321
  let D = o[I];
7297
7322
  D != null && D.$ref && !(0, util_1.schemaHasRulesButRef)(D, i.self.RULES) && (D = compile_1.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, D == null ? void 0 : D.$ref), D instanceof compile_1.SchemaEnv && (D = D.schema));
7298
- const w = (O = D == null ? void 0 : D.properties) === null || O === void 0 ? void 0 : O[c];
7323
+ const w = (C = D == null ? void 0 : D.properties) === null || C === void 0 ? void 0 : C[c];
7299
7324
  if (typeof w != "object")
7300
7325
  throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);
7301
- $ = $ && (k || _(D)), y(w, I);
7326
+ $ = $ && (k || g(D)), y(w, I);
7302
7327
  }
7303
7328
  if (!$)
7304
7329
  throw new Error(`discriminator: "${c}" must be required`);
7305
- return R;
7306
- function _({ required: I }) {
7330
+ return S;
7331
+ function g({ required: I }) {
7307
7332
  return Array.isArray(I) && I.includes(c);
7308
7333
  }
7309
7334
  function y(I, D) {
@@ -7316,9 +7341,9 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7316
7341
  throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`);
7317
7342
  }
7318
7343
  function P(I, D) {
7319
- if (typeof I != "string" || I in R)
7344
+ if (typeof I != "string" || I in S)
7320
7345
  throw new Error(`discriminator: "${c}" values must be unique strings`);
7321
- R[I] = D;
7346
+ S[I] = D;
7322
7347
  }
7323
7348
  }
7324
7349
  }
@@ -7570,13 +7595,13 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
7570
7595
  const r = core$2, n = draft7, s = discriminator, i = require$$3, o = ["/properties"], c = "http://json-schema.org/draft-07/schema";
7571
7596
  class d extends r.default {
7572
7597
  _addVocabularies() {
7573
- super._addVocabularies(), n.default.forEach((R) => this.addVocabulary(R)), this.opts.discriminator && this.addKeyword(s.default);
7598
+ super._addVocabularies(), n.default.forEach((S) => this.addVocabulary(S)), this.opts.discriminator && this.addKeyword(s.default);
7574
7599
  }
7575
7600
  _addDefaultMetaSchema() {
7576
7601
  if (super._addDefaultMetaSchema(), !this.opts.meta)
7577
7602
  return;
7578
- const R = this.opts.$data ? this.$dataMetaSchema(i, o) : i;
7579
- this.addMetaSchema(R, c, !1), this.refs["http://json-schema.org/schema"] = c;
7603
+ const S = this.opts.$data ? this.$dataMetaSchema(i, o) : i;
7604
+ this.addMetaSchema(S, c, !1), this.refs["http://json-schema.org/schema"] = c;
7580
7605
  }
7581
7606
  defaultMeta() {
7582
7607
  return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(c) ? c : void 0);
@@ -7601,9 +7626,9 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
7601
7626
  } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
7602
7627
  return p.CodeGen;
7603
7628
  } });
7604
- var g = validation_error;
7629
+ var _ = validation_error;
7605
7630
  Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
7606
- return g.default;
7631
+ return _.default;
7607
7632
  } });
7608
7633
  var T = ref_error;
7609
7634
  Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
@@ -8217,36 +8242,6 @@ for existing apps using this option.`
8217
8242
  "step"
8218
8243
  ]
8219
8244
  },
8220
- {
8221
- type: "object",
8222
- additionalProperties: !1,
8223
- properties: {
8224
- progress: {
8225
- type: "object",
8226
- properties: {
8227
- weight: {
8228
- type: "number"
8229
- },
8230
- caption: {
8231
- type: "string"
8232
- }
8233
- },
8234
- additionalProperties: !1
8235
- },
8236
- step: {
8237
- type: "string",
8238
- const: "importFile"
8239
- },
8240
- file: {
8241
- $ref: "#/definitions/FileReference",
8242
- description: "The file to import"
8243
- }
8244
- },
8245
- required: [
8246
- "file",
8247
- "step"
8248
- ]
8249
- },
8250
8245
  {
8251
8246
  type: "object",
8252
8247
  additionalProperties: !1,
@@ -8297,6 +8292,15 @@ for existing apps using this option.`
8297
8292
  },
8298
8293
  additionalProperties: !1
8299
8294
  },
8295
+ ifAlreadyInstalled: {
8296
+ type: "string",
8297
+ enum: [
8298
+ "overwrite",
8299
+ "skip",
8300
+ "error"
8301
+ ],
8302
+ description: "What to do if the asset already exists."
8303
+ },
8300
8304
  step: {
8301
8305
  type: "string",
8302
8306
  const: "installPlugin",
@@ -8332,6 +8336,15 @@ for existing apps using this option.`
8332
8336
  },
8333
8337
  additionalProperties: !1
8334
8338
  },
8339
+ ifAlreadyInstalled: {
8340
+ type: "string",
8341
+ enum: [
8342
+ "overwrite",
8343
+ "skip",
8344
+ "error"
8345
+ ],
8346
+ description: "What to do if the asset already exists."
8347
+ },
8335
8348
  step: {
8336
8349
  type: "string",
8337
8350
  const: "installTheme",
@@ -9221,7 +9234,7 @@ function compileBlueprint(e, {
9221
9234
  onStepCompleted: n = () => {
9222
9235
  }
9223
9236
  } = {}) {
9224
- var g, T, O, R, k, $, _;
9237
+ var _, T, C, S, k, $, g;
9225
9238
  e = {
9226
9239
  ...e,
9227
9240
  steps: (e.steps || []).filter(isStepDefinition)
@@ -9253,7 +9266,7 @@ function compileBlueprint(e, {
9253
9266
  step: "login",
9254
9267
  ...e.login === !0 ? { username: "admin", password: "password" } : e.login
9255
9268
  }), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles.length === 0 && e.phpExtensionBundles.push("kitchen-sink");
9256
- const s = (g = e.steps) == null ? void 0 : g.findIndex(
9269
+ const s = (_ = e.steps) == null ? void 0 : _.findIndex(
9257
9270
  (y) => typeof y == "object" && (y == null ? void 0 : y.step) === "wp-cli"
9258
9271
  );
9259
9272
  s !== void 0 && s > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
@@ -9278,14 +9291,14 @@ function compileBlueprint(e, {
9278
9291
  },
9279
9292
  path: "/tmp/wp-cli.phar"
9280
9293
  }));
9281
- const i = (O = e.steps) == null ? void 0 : O.findIndex(
9294
+ const i = (C = e.steps) == null ? void 0 : C.findIndex(
9282
9295
  (y) => typeof y == "object" && (y == null ? void 0 : y.step) === "importWxr"
9283
9296
  );
9284
9297
  i !== void 0 && i > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
9285
9298
  (y) => y !== "light"
9286
9299
  ), console.warn(
9287
9300
  "The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
9288
- )), (R = e.steps) == null || R.splice(i, 0, {
9301
+ )), (S = e.steps) == null || S.splice(i, 0, {
9289
9302
  step: "installPlugin",
9290
9303
  pluginZipFile: {
9291
9304
  resource: "url",
@@ -9328,7 +9341,7 @@ function compileBlueprint(e, {
9328
9341
  ),
9329
9342
  features: {
9330
9343
  // Disable networking by default
9331
- networking: ((_ = e.features) == null ? void 0 : _.networking) ?? !1
9344
+ networking: ((g = e.features) == null ? void 0 : g.networking) ?? !1
9332
9345
  },
9333
9346
  run: async (y) => {
9334
9347
  try {
@@ -9401,17 +9414,17 @@ function compileStep(e, {
9401
9414
  const s = r.stage(
9402
9415
  (((p = e.progress) == null ? void 0 : p.weight) || 1) / n
9403
9416
  ), i = {};
9404
- for (const g of Object.keys(e)) {
9405
- let T = e[g];
9417
+ for (const _ of Object.keys(e)) {
9418
+ let T = e[_];
9406
9419
  isFileReference(T) && (T = Resource.create(T, {
9407
9420
  semaphore: t
9408
- })), i[g] = T;
9421
+ })), i[_] = T;
9409
9422
  }
9410
- const o = async (g) => {
9423
+ const o = async (_) => {
9411
9424
  var T;
9412
9425
  try {
9413
9426
  return s.fillSlowly(), await keyedStepHandlers[e.step](
9414
- g,
9427
+ _,
9415
9428
  await resolveArguments(i),
9416
9429
  {
9417
9430
  tracker: s,
@@ -9422,10 +9435,10 @@ function compileStep(e, {
9422
9435
  s.finish();
9423
9436
  }
9424
9437
  }, c = getResources(i), d = getResources(i).filter(
9425
- (g) => g.isAsync
9438
+ (_) => _.isAsync
9426
9439
  ), u = 1 / (d.length + 1);
9427
- for (const g of d)
9428
- g.progress = s.stage(u);
9440
+ for (const _ of d)
9441
+ _.progress = s.stage(u);
9429
9442
  return { run: o, step: e, resources: c };
9430
9443
  }
9431
9444
  function getResources(e) {
@@ -9500,27 +9513,27 @@ function expose(e, t = globalThis, r = ["*"]) {
9500
9513
  const { id: i, type: o, path: c } = Object.assign({ path: [] }, s.data), d = (s.data.argumentList || []).map(fromWireValue);
9501
9514
  let u;
9502
9515
  try {
9503
- const p = c.slice(0, -1).reduce((T, O) => T[O], e), g = c.reduce((T, O) => T[O], e);
9516
+ const p = c.slice(0, -1).reduce((T, C) => T[C], e), _ = c.reduce((T, C) => T[C], e);
9504
9517
  switch (o) {
9505
9518
  case "GET":
9506
- u = g;
9519
+ u = _;
9507
9520
  break;
9508
9521
  case "SET":
9509
9522
  p[c.slice(-1)[0]] = fromWireValue(s.data.value), u = !0;
9510
9523
  break;
9511
9524
  case "APPLY":
9512
- u = g.apply(p, d);
9525
+ u = _.apply(p, d);
9513
9526
  break;
9514
9527
  case "CONSTRUCT":
9515
9528
  {
9516
- const T = new g(...d);
9529
+ const T = new _(...d);
9517
9530
  u = proxy(T);
9518
9531
  }
9519
9532
  break;
9520
9533
  case "ENDPOINT":
9521
9534
  {
9522
- const { port1: T, port2: O } = new MessageChannel();
9523
- expose(e, O), u = transfer(T, [T]);
9535
+ const { port1: T, port2: C } = new MessageChannel();
9536
+ expose(e, C), u = transfer(T, [T]);
9524
9537
  }
9525
9538
  break;
9526
9539
  case "RELEASE":
@@ -9533,14 +9546,14 @@ function expose(e, t = globalThis, r = ["*"]) {
9533
9546
  u = { value: p, [throwMarker]: 0 };
9534
9547
  }
9535
9548
  Promise.resolve(u).catch((p) => ({ value: p, [throwMarker]: 0 })).then((p) => {
9536
- const [g, T] = toWireValue(p);
9537
- t.postMessage(Object.assign(Object.assign({}, g), { id: i }), T), o === "RELEASE" && (t.removeEventListener("message", n), closeEndPoint(t), finalizer in e && typeof e[finalizer] == "function" && e[finalizer]());
9549
+ const [_, T] = toWireValue(p);
9550
+ t.postMessage(Object.assign(Object.assign({}, _), { id: i }), T), o === "RELEASE" && (t.removeEventListener("message", n), closeEndPoint(t), finalizer in e && typeof e[finalizer] == "function" && e[finalizer]());
9538
9551
  }).catch((p) => {
9539
- const [g, T] = toWireValue({
9552
+ const [_, T] = toWireValue({
9540
9553
  value: new TypeError("Unserializable return value"),
9541
9554
  [throwMarker]: 0
9542
9555
  });
9543
- t.postMessage(Object.assign(Object.assign({}, g), { id: i }), T);
9556
+ t.postMessage(Object.assign(Object.assign({}, _), { id: i }), T);
9544
9557
  });
9545
9558
  }), t.start && t.start();
9546
9559
  }
@@ -9616,7 +9629,7 @@ function createProxy(e, t = [], r = function() {
9616
9629
  const [u, p] = processArguments(c);
9617
9630
  return requestResponseMessage(e, {
9618
9631
  type: "APPLY",
9619
- path: t.map((g) => g.toString()),
9632
+ path: t.map((_) => _.toString()),
9620
9633
  argumentList: u
9621
9634
  }, p).then(fromWireValue);
9622
9635
  },
@@ -9714,34 +9727,41 @@ async function runWithTimeout(e, t) {
9714
9727
  }
9715
9728
  let isTransferHandlersSetup = !1;
9716
9729
  function setupTransferHandlers() {
9717
- isTransferHandlersSetup || (isTransferHandlersSetup = !0, transferHandlers.set("EVENT", {
9718
- canHandle: (e) => e instanceof CustomEvent,
9719
- serialize: (e) => [
9730
+ if (isTransferHandlersSetup)
9731
+ return;
9732
+ isTransferHandlersSetup = !0, transferHandlers.set("EVENT", {
9733
+ canHandle: (r) => r instanceof CustomEvent,
9734
+ serialize: (r) => [
9720
9735
  {
9721
- detail: e.detail
9736
+ detail: r.detail
9722
9737
  },
9723
9738
  []
9724
9739
  ],
9725
- deserialize: (e) => e
9740
+ deserialize: (r) => r
9726
9741
  }), transferHandlers.set("FUNCTION", {
9727
- canHandle: (e) => typeof e == "function",
9728
- serialize(e) {
9742
+ canHandle: (r) => typeof r == "function",
9743
+ serialize(r) {
9729
9744
  console.debug("[Comlink][Performance] Proxying a function");
9730
- const { port1: t, port2: r } = new MessageChannel();
9731
- return expose(e, t), [r, [r]];
9745
+ const { port1: n, port2: s } = new MessageChannel();
9746
+ return expose(r, n), [s, [s]];
9732
9747
  },
9733
- deserialize(e) {
9734
- return e.start(), wrap(e);
9748
+ deserialize(r) {
9749
+ return r.start(), wrap(r);
9735
9750
  }
9736
9751
  }), transferHandlers.set("PHPResponse", {
9737
- canHandle: (e) => typeof e == "object" && e !== null && "headers" in e && "bytes" in e && "errors" in e && "exitCode" in e && "httpStatusCode" in e,
9738
- serialize(e) {
9739
- return [e.toRawData(), []];
9752
+ canHandle: (r) => typeof r == "object" && r !== null && "headers" in r && "bytes" in r && "errors" in r && "exitCode" in r && "httpStatusCode" in r,
9753
+ serialize(r) {
9754
+ return [r.toRawData(), []];
9740
9755
  },
9741
- deserialize(e) {
9742
- return PHPResponse.fromRawData(e);
9756
+ deserialize(r) {
9757
+ return PHPResponse.fromRawData(r);
9743
9758
  }
9744
- }));
9759
+ });
9760
+ const e = transferHandlers.get("throw"), t = e == null ? void 0 : e.serialize;
9761
+ e.serialize = ({ value: r }) => {
9762
+ const n = t({ value: r });
9763
+ return r.response && (n[0].value.response = r.response), r.source && (n[0].value.source = r.source), n;
9764
+ };
9745
9765
  }
9746
9766
  function proxyClone(e) {
9747
9767
  return new Proxy(e, {