@wp-playground/client 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/index.cjs +28 -72
- package/index.d.ts +0 -1
- package/index.js +876 -950
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var bn = (e, t, r) => {
|
|
2
2
|
if (!t.has(e))
|
|
3
3
|
throw TypeError("Cannot " + r);
|
|
4
4
|
};
|
|
5
|
-
var z = (e, t, r) => (
|
|
5
|
+
var z = (e, t, r) => (bn(e, t, "read from private field"), r ? r.call(e) : t.get(e)), ee = (e, t, r) => {
|
|
6
6
|
if (t.has(e))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
9
|
-
}, pe = (e, t, r, n) => (
|
|
10
|
-
var _e = (e, t, r) => (
|
|
9
|
+
}, pe = (e, t, r, n) => (bn(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
|
|
10
|
+
var _e = (e, t, r) => (bn(e, t, "access private method"), r);
|
|
11
11
|
if (typeof File > "u") {
|
|
12
12
|
class e extends Blob {
|
|
13
13
|
constructor(r, n, s) {
|
|
@@ -33,15 +33,15 @@ typeof Blob.prototype.text > "u" && (Blob.prototype.text = function() {
|
|
|
33
33
|
const t = new FileReader();
|
|
34
34
|
return t.readAsText(this), Si(t);
|
|
35
35
|
});
|
|
36
|
-
function
|
|
36
|
+
function ta() {
|
|
37
37
|
const e = new Uint8Array([1, 2, 3, 4]), r = new File([e], "test").stream();
|
|
38
38
|
try {
|
|
39
|
-
return r.getReader({ mode: "byob" }),
|
|
39
|
+
return r.getReader({ mode: "byob" }), !0;
|
|
40
40
|
} catch {
|
|
41
41
|
return !1;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
(typeof Blob.prototype.stream > "u" || !
|
|
44
|
+
(typeof Blob.prototype.stream > "u" || !ta()) && (Blob.prototype.stream = function() {
|
|
45
45
|
let e = 0;
|
|
46
46
|
const t = this;
|
|
47
47
|
return new ReadableStream({
|
|
@@ -170,7 +170,7 @@ function ye(...e) {
|
|
|
170
170
|
const r = t[0] === "/", n = t.substring(t.length - 1) === "/";
|
|
171
171
|
return t = Oi(t), !t && !r && (t = "."), t && n && (t += "/"), t;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function ra(e) {
|
|
174
174
|
if (e === "/")
|
|
175
175
|
return "/";
|
|
176
176
|
e = Oi(e);
|
|
@@ -179,12 +179,12 @@ function na(e) {
|
|
|
179
179
|
}
|
|
180
180
|
function Oi(e) {
|
|
181
181
|
const t = e[0] === "/";
|
|
182
|
-
return e =
|
|
182
|
+
return e = na(
|
|
183
183
|
e.split("/").filter((r) => !!r),
|
|
184
184
|
!t
|
|
185
185
|
).join("/"), (t ? "/" : "") + e.replace(/\/$/, "");
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function na(e, t) {
|
|
188
188
|
let r = 0;
|
|
189
189
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
190
190
|
const s = e[n];
|
|
@@ -196,24 +196,24 @@ function sa(e, t) {
|
|
|
196
196
|
return e;
|
|
197
197
|
}
|
|
198
198
|
function gr(e) {
|
|
199
|
-
return `json_decode(base64_decode('${
|
|
199
|
+
return `json_decode(base64_decode('${sa(
|
|
200
200
|
JSON.stringify(e)
|
|
201
201
|
)}'), true)`;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function hn(e) {
|
|
204
204
|
const t = {};
|
|
205
205
|
for (const r in e)
|
|
206
206
|
t[r] = gr(e[r]);
|
|
207
207
|
return t;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return
|
|
209
|
+
function sa(e) {
|
|
210
|
+
return ia(new TextEncoder().encode(e));
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function ia(e) {
|
|
213
213
|
const t = String.fromCodePoint(...e);
|
|
214
214
|
return btoa(t);
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const oa = `<?php
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* Rewrites the wp-config.php file to ensure specific constants are defined
|
|
@@ -547,10 +547,10 @@ function skip_whitespace($tokens) {
|
|
|
547
547
|
`, ur = async (e, { consts: t, method: r = "rewrite-wp-config" }) => {
|
|
548
548
|
switch (r) {
|
|
549
549
|
case "define-before-run":
|
|
550
|
-
await
|
|
550
|
+
await aa(e, t);
|
|
551
551
|
break;
|
|
552
552
|
case "rewrite-wp-config": {
|
|
553
|
-
const n = await e.documentRoot, s = ye(n, "/wp-config.php"), i = await e.readFileAsText(s), o = await
|
|
553
|
+
const n = await e.documentRoot, s = ye(n, "/wp-config.php"), i = await e.readFileAsText(s), o = await ca(
|
|
554
554
|
e,
|
|
555
555
|
i,
|
|
556
556
|
t
|
|
@@ -562,17 +562,17 @@ function skip_whitespace($tokens) {
|
|
|
562
562
|
throw new Error(`Invalid method: ${r}`);
|
|
563
563
|
}
|
|
564
564
|
};
|
|
565
|
-
async function
|
|
565
|
+
async function aa(e, t) {
|
|
566
566
|
for (const r in t)
|
|
567
567
|
await e.defineConstant(r, t[r]);
|
|
568
568
|
}
|
|
569
|
-
async function
|
|
569
|
+
async function ca(e, t, r) {
|
|
570
570
|
await e.writeFile("/tmp/code.php", t);
|
|
571
|
-
const n =
|
|
571
|
+
const n = hn({
|
|
572
572
|
consts: r
|
|
573
573
|
});
|
|
574
574
|
return await e.run({
|
|
575
|
-
code: `${
|
|
575
|
+
code: `${oa}
|
|
576
576
|
$wp_config_path = '/tmp/code.php';
|
|
577
577
|
$wp_config = file_get_contents($wp_config_path);
|
|
578
578
|
$new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${n.consts});
|
|
@@ -580,7 +580,7 @@ async function la(e, t, r) {
|
|
|
580
580
|
`
|
|
581
581
|
}), await e.readFileAsText("/tmp/code.php");
|
|
582
582
|
}
|
|
583
|
-
const
|
|
583
|
+
const la = `<?php
|
|
584
584
|
|
|
585
585
|
/**
|
|
586
586
|
* This transport delegates PHP HTTP requests to JavaScript synchronous XHR.
|
|
@@ -725,7 +725,7 @@ if (class_exists('\\WpOrg\\Requests\\Requests')) {
|
|
|
725
725
|
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
`,
|
|
728
|
+
`, ua = `<?php
|
|
729
729
|
|
|
730
730
|
/**
|
|
731
731
|
* This transport does not perform any HTTP requests and only exists
|
|
@@ -780,7 +780,7 @@ if (class_exists('\\WpOrg\\Requests\\Requests')) {
|
|
|
780
780
|
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
|
-
`,
|
|
783
|
+
`, da = `<?php
|
|
784
784
|
/**
|
|
785
785
|
* Add a notice to wp-login.php offering the username and password.
|
|
786
786
|
*/
|
|
@@ -807,7 +807,7 @@ add_filter('plugins_api_result', function ($res) {
|
|
|
807
807
|
if ($res instanceof WP_Error) {
|
|
808
808
|
$res = new WP_Error(
|
|
809
809
|
'plugins_api_failed',
|
|
810
|
-
'Enable networking support in Playground settings to access the Plugins directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload plugins or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?plugin=coblocks).'
|
|
810
|
+
'Enable networking support in Playground settings to access the Plugins directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85" target="_blank">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload plugins or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?plugin=coblocks).'
|
|
811
811
|
);
|
|
812
812
|
}
|
|
813
813
|
return $res;
|
|
@@ -824,7 +824,7 @@ add_filter('gettext', function ($translation) {
|
|
|
824
824
|
}
|
|
825
825
|
|
|
826
826
|
if ($translation === 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.') {
|
|
827
|
-
return 'Enable networking support in Playground settings to access the Themes directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload themes or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?theme=pendant).';
|
|
827
|
+
return 'Enable networking support in Playground settings to access the Themes directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85" target="_blank">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload themes or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?theme=pendant).';
|
|
828
828
|
}
|
|
829
829
|
return $translation;
|
|
830
830
|
});
|
|
@@ -903,22 +903,19 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
|
|
|
903
903
|
$__requests_class::add_transport('Requests_Transport_Dummy');
|
|
904
904
|
}
|
|
905
905
|
`;
|
|
906
|
-
async function
|
|
906
|
+
async function Pn(e, t, r) {
|
|
907
907
|
let n = "";
|
|
908
908
|
await e.fileExists(t) && (n = await e.readFileAsText(t)), await e.writeFile(t, r(n));
|
|
909
909
|
}
|
|
910
|
-
const
|
|
911
|
-
const r = new
|
|
910
|
+
const pa = async (e, t) => {
|
|
911
|
+
const r = new fa(
|
|
912
912
|
e,
|
|
913
913
|
t.wordpressPath || "/wordpress",
|
|
914
914
|
t.siteUrl
|
|
915
915
|
);
|
|
916
|
-
t.addPhpInfo === !0 && await r.addPhpInfo(), t.siteUrl && await r.patchSiteUrl(), t.patchSecrets === !0 && await r.patchSecrets(), t.disableSiteHealth === !0 && await r.disableSiteHealth(), t.disableWpNewBlogNotification === !0 && await r.disableWpNewBlogNotification(), t.
|
|
917
|
-
`${r.wordpressPath}/wp-includes/js/dist/block-editor.js`,
|
|
918
|
-
`${r.wordpressPath}/wp-includes/js/dist/block-editor.min.js`
|
|
919
|
-
]), t.prepareForRunningInsideWebBrowser === !0 && await r.prepareForRunningInsideWebBrowser(), t.addFetchNetworkTransport === !0 && await r.addFetchNetworkTransport();
|
|
916
|
+
t.addPhpInfo === !0 && await r.addPhpInfo(), t.siteUrl && await r.patchSiteUrl(), t.patchSecrets === !0 && await r.patchSecrets(), t.disableSiteHealth === !0 && await r.disableSiteHealth(), t.disableWpNewBlogNotification === !0 && await r.disableWpNewBlogNotification(), t.prepareForRunningInsideWebBrowser === !0 && await r.prepareForRunningInsideWebBrowser(), t.addFetchNetworkTransport === !0 && await r.addFetchNetworkTransport();
|
|
920
917
|
};
|
|
921
|
-
class
|
|
918
|
+
class fa {
|
|
922
919
|
constructor(t, r, n) {
|
|
923
920
|
this.php = t, this.scopedSiteUrl = n, this.wordpressPath = r;
|
|
924
921
|
}
|
|
@@ -951,7 +948,7 @@ class ha {
|
|
|
951
948
|
});
|
|
952
949
|
}
|
|
953
950
|
async disableSiteHealth() {
|
|
954
|
-
await
|
|
951
|
+
await Pn(
|
|
955
952
|
this.php,
|
|
956
953
|
`${this.wordpressPath}/wp-includes/default-filters.php`,
|
|
957
954
|
(t) => t.replace(
|
|
@@ -961,7 +958,7 @@ class ha {
|
|
|
961
958
|
);
|
|
962
959
|
}
|
|
963
960
|
async disableWpNewBlogNotification() {
|
|
964
|
-
await
|
|
961
|
+
await Pn(
|
|
965
962
|
this.php,
|
|
966
963
|
`${this.wordpressPath}/wp-config.php`,
|
|
967
964
|
// The original version of this function crashes WASM PHP, let's define an empty one instead.
|
|
@@ -971,12 +968,12 @@ class ha {
|
|
|
971
968
|
async prepareForRunningInsideWebBrowser() {
|
|
972
969
|
await this.php.mkdir(`${this.wordpressPath}/wp-content/mu-plugins`), await this.php.writeFile(
|
|
973
970
|
`${this.wordpressPath}/wp-content/mu-plugins/0-playground.php`,
|
|
974
|
-
|
|
971
|
+
da
|
|
975
972
|
), await this.php.mkdir(
|
|
976
973
|
`${this.wordpressPath}/wp-content/mu-plugins/playground-includes`
|
|
977
974
|
), await this.php.writeFile(
|
|
978
975
|
`${this.wordpressPath}/wp-content/mu-plugins/playground-includes/requests_transport_dummy.php`,
|
|
979
|
-
|
|
976
|
+
ua
|
|
980
977
|
);
|
|
981
978
|
}
|
|
982
979
|
async addFetchNetworkTransport() {
|
|
@@ -992,13 +989,13 @@ class ha {
|
|
|
992
989
|
`${this.wordpressPath}/wp-includes/Requests/src/Transport/Curl.php`
|
|
993
990
|
];
|
|
994
991
|
for (const r of t)
|
|
995
|
-
await this.php.fileExists(r) && await
|
|
992
|
+
await this.php.fileExists(r) && await Pn(this.php, r, (n) => n.includes("public static function test2") ? n : n.replace(
|
|
996
993
|
"public static function test",
|
|
997
994
|
"public static function test( $capabilities = array() ) { return false; } public static function test2"
|
|
998
995
|
));
|
|
999
996
|
await this.php.writeFile(
|
|
1000
997
|
`${this.wordpressPath}/wp-content/mu-plugins/playground-includes/wp_http_fetch.php`,
|
|
1001
|
-
|
|
998
|
+
la
|
|
1002
999
|
), await this.php.mkdir(`${this.wordpressPath}/wp-content/fonts`);
|
|
1003
1000
|
}
|
|
1004
1001
|
}
|
|
@@ -1009,77 +1006,16 @@ function et(e) {
|
|
|
1009
1006
|
r += t[Math.floor(Math.random() * t.length)];
|
|
1010
1007
|
return r;
|
|
1011
1008
|
}
|
|
1012
|
-
async
|
|
1013
|
-
const n = `
|
|
1014
|
-
/**
|
|
1015
|
-
* A synchronous function to read a blob URL as text.
|
|
1016
|
-
*
|
|
1017
|
-
* @param {string} url
|
|
1018
|
-
* @returns {string}
|
|
1019
|
-
*/
|
|
1020
|
-
const __playground_readBlobAsText = function (url) {
|
|
1021
|
-
try {
|
|
1022
|
-
let xhr = new XMLHttpRequest();
|
|
1023
|
-
xhr.open('GET', url, false);
|
|
1024
|
-
xhr.overrideMimeType('text/plain;charset=utf-8');
|
|
1025
|
-
xhr.send();
|
|
1026
|
-
return xhr.responseText;
|
|
1027
|
-
} catch(e) {
|
|
1028
|
-
return '';
|
|
1029
|
-
} finally {
|
|
1030
|
-
URL.revokeObjectURL(url);
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) {
|
|
1035
|
-
const source = window.wp.element.useMemo(function () {
|
|
1036
|
-
if (props.srcDoc) {
|
|
1037
|
-
// WordPress <= 6.2 uses a srcDoc that only contains a doctype.
|
|
1038
|
-
return '/wp-includes/empty.html';
|
|
1039
|
-
} else if (props.src && props.src.startsWith('blob:')) {
|
|
1040
|
-
// WordPress 6.3 uses a blob URL with doctype and a list of static assets.
|
|
1041
|
-
// Let's pass the document content to empty.html and render it there.
|
|
1042
|
-
return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src));
|
|
1043
|
-
} else {
|
|
1044
|
-
// WordPress >= 6.4 uses a plain HTTPS URL that needs no correction.
|
|
1045
|
-
return props.src;
|
|
1046
|
-
}
|
|
1047
|
-
}, [props.src]);
|
|
1048
|
-
return (
|
|
1049
|
-
window.wp.element.createElement('iframe', {
|
|
1050
|
-
...props,
|
|
1051
|
-
ref: ref,
|
|
1052
|
-
src: source,
|
|
1053
|
-
// Make sure there's no srcDoc, as it would interfere with the src.
|
|
1054
|
-
srcDoc: undefined
|
|
1055
|
-
})
|
|
1056
|
-
)
|
|
1057
|
-
});`;
|
|
1058
|
-
for (const s of r)
|
|
1059
|
-
await e.fileExists(s) && await qr(
|
|
1060
|
-
e,
|
|
1061
|
-
s,
|
|
1062
|
-
// The original version of this function crashes WASM PHP, let's define an empty one instead.
|
|
1063
|
-
(i) => `${n} ${i.replace(
|
|
1064
|
-
/\(\s*"iframe",/,
|
|
1065
|
-
"(__playground_ControlledIframe,"
|
|
1066
|
-
)}`
|
|
1067
|
-
);
|
|
1068
|
-
await e.writeFile(
|
|
1069
|
-
`${t}/wp-includes/empty.html`,
|
|
1070
|
-
"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>"
|
|
1071
|
-
);
|
|
1072
|
-
}
|
|
1073
|
-
const ma = async (e, { code: t }) => await e.run({ code: t }), ya = async (e, { options: t }) => await e.run(t), Ni = async (e, { path: t }) => {
|
|
1009
|
+
const ha = async (e, { code: t }) => await e.run({ code: t }), ma = async (e, { options: t }) => await e.run(t), Ci = async (e, { path: t }) => {
|
|
1074
1010
|
await e.unlink(t);
|
|
1075
|
-
},
|
|
1011
|
+
}, ya = async (e, { sql: t }, r) => {
|
|
1076
1012
|
r == null || r.tracker.setCaption("Executing SQL Queries");
|
|
1077
1013
|
const n = `/tmp/${crypto.randomUUID()}.sql`;
|
|
1078
1014
|
await e.writeFile(
|
|
1079
1015
|
n,
|
|
1080
1016
|
new Uint8Array(await t.arrayBuffer())
|
|
1081
1017
|
);
|
|
1082
|
-
const s = await e.documentRoot, i =
|
|
1018
|
+
const s = await e.documentRoot, i = hn({ docroot: s, sqlFilename: n }), o = await e.run({
|
|
1083
1019
|
code: `<?php
|
|
1084
1020
|
require_once ${i.docroot} . '/wp-load.php';
|
|
1085
1021
|
|
|
@@ -1101,30 +1037,30 @@ const ma = async (e, { code: t }) => await e.run({ code: t }), ya = async (e, {
|
|
|
1101
1037
|
}
|
|
1102
1038
|
`
|
|
1103
1039
|
});
|
|
1104
|
-
return await
|
|
1105
|
-
},
|
|
1040
|
+
return await Ci(e, { path: n }), o;
|
|
1041
|
+
}, ga = async (e, { key: t, value: r }) => {
|
|
1106
1042
|
await e.setPhpIniEntry(t, r);
|
|
1107
|
-
},
|
|
1043
|
+
}, $a = async (e, { request: t }) => await e.request(t), _a = async (e, { fromPath: t, toPath: r }) => {
|
|
1108
1044
|
await e.writeFile(
|
|
1109
1045
|
r,
|
|
1110
1046
|
await e.readFileAsBuffer(t)
|
|
1111
1047
|
);
|
|
1112
|
-
},
|
|
1048
|
+
}, wa = async (e, { fromPath: t, toPath: r }) => {
|
|
1113
1049
|
await e.mv(t, r);
|
|
1114
|
-
},
|
|
1050
|
+
}, va = async (e, { path: t }) => {
|
|
1115
1051
|
await e.mkdir(t);
|
|
1116
|
-
},
|
|
1052
|
+
}, ba = async (e, { path: t }) => {
|
|
1117
1053
|
await e.rmdir(t);
|
|
1118
|
-
},
|
|
1054
|
+
}, Ni = async (e, { path: t, data: r }) => {
|
|
1119
1055
|
r instanceof File && (r = new Uint8Array(await r.arrayBuffer())), await e.writeFile(t, r);
|
|
1120
|
-
},
|
|
1056
|
+
}, Pa = async (e, { siteUrl: t }) => {
|
|
1121
1057
|
await ur(e, {
|
|
1122
1058
|
consts: {
|
|
1123
1059
|
WP_HOME: t,
|
|
1124
1060
|
WP_SITEURL: t
|
|
1125
1061
|
}
|
|
1126
1062
|
});
|
|
1127
|
-
},
|
|
1063
|
+
}, Ea = async (e, { file: t }) => {
|
|
1128
1064
|
var l;
|
|
1129
1065
|
const r = await e.request({
|
|
1130
1066
|
url: "/wp-admin/admin.php?import=wordpress"
|
|
@@ -1139,7 +1075,7 @@ const ma = async (e, { code: t }) => await e.run({ code: t }), ya = async (e, {
|
|
|
1139
1075
|
throw console.log(s.text), new Error(
|
|
1140
1076
|
"Could not find an importer form in response. See the response text above for details."
|
|
1141
1077
|
);
|
|
1142
|
-
const o =
|
|
1078
|
+
const o = Sa(i);
|
|
1143
1079
|
o.fetch_attachments = "1";
|
|
1144
1080
|
for (const d in o)
|
|
1145
1081
|
if (d.startsWith("user_map[")) {
|
|
@@ -1155,10 +1091,10 @@ const ma = async (e, { code: t }) => await e.run({ code: t }), ya = async (e, {
|
|
|
1155
1091
|
function Vs(e) {
|
|
1156
1092
|
return new DOMParser().parseFromString(e.text, "text/html");
|
|
1157
1093
|
}
|
|
1158
|
-
function
|
|
1094
|
+
function Sa(e) {
|
|
1159
1095
|
return Object.fromEntries(new FormData(e).entries());
|
|
1160
1096
|
}
|
|
1161
|
-
const
|
|
1097
|
+
const Ws = `<?php
|
|
1162
1098
|
|
|
1163
1099
|
function zipDir($root, $output, $options = array())
|
|
1164
1100
|
{
|
|
@@ -1242,24 +1178,24 @@ function delTree($dir)
|
|
|
1242
1178
|
return rmdir($dir);
|
|
1243
1179
|
}
|
|
1244
1180
|
`;
|
|
1245
|
-
async function
|
|
1181
|
+
async function ji(e, t) {
|
|
1246
1182
|
const r = await e.run({
|
|
1247
|
-
code:
|
|
1183
|
+
code: Ws + t
|
|
1248
1184
|
});
|
|
1249
1185
|
if (r.exitCode !== 0)
|
|
1250
|
-
throw console.log(
|
|
1186
|
+
throw console.log(Ws + t), console.log(t + ""), console.log(r.errors), r.errors;
|
|
1251
1187
|
return r;
|
|
1252
1188
|
}
|
|
1253
1189
|
const Hn = async (e, { zipPath: t, extractToPath: r }) => {
|
|
1254
|
-
const n =
|
|
1190
|
+
const n = hn({
|
|
1255
1191
|
zipPath: t,
|
|
1256
1192
|
extractToPath: r
|
|
1257
1193
|
});
|
|
1258
|
-
await
|
|
1194
|
+
await ji(
|
|
1259
1195
|
e,
|
|
1260
1196
|
`unzip(${n.zipPath}, ${n.extractToPath});`
|
|
1261
1197
|
);
|
|
1262
|
-
},
|
|
1198
|
+
}, Ta = async (e, { wordPressFilesZip: t, pathInZip: r = "" }) => {
|
|
1263
1199
|
const n = "/import.zip";
|
|
1264
1200
|
await e.writeFile(
|
|
1265
1201
|
n,
|
|
@@ -1274,9 +1210,9 @@ const Hn = async (e, { zipPath: t, extractToPath: r }) => {
|
|
|
1274
1210
|
o,
|
|
1275
1211
|
h
|
|
1276
1212
|
);
|
|
1277
|
-
await
|
|
1213
|
+
await xs(e, v);
|
|
1278
1214
|
const T = ye(l, h);
|
|
1279
|
-
await e.fileExists(T) && (await e.mkdir(
|
|
1215
|
+
await e.fileExists(T) && (await e.mkdir(ra(v)), await e.mv(T, v));
|
|
1280
1216
|
}
|
|
1281
1217
|
const d = ye(
|
|
1282
1218
|
i,
|
|
@@ -1289,7 +1225,7 @@ const Hn = async (e, { zipPath: t, extractToPath: r }) => {
|
|
|
1289
1225
|
);
|
|
1290
1226
|
const u = await e.listFiles(i);
|
|
1291
1227
|
for (const h of u)
|
|
1292
|
-
await
|
|
1228
|
+
await xs(e, ye(s, h)), await e.mv(
|
|
1293
1229
|
ye(i, h),
|
|
1294
1230
|
ye(s, h)
|
|
1295
1231
|
);
|
|
@@ -1304,26 +1240,26 @@ const Hn = async (e, { zipPath: t, extractToPath: r }) => {
|
|
|
1304
1240
|
`
|
|
1305
1241
|
});
|
|
1306
1242
|
};
|
|
1307
|
-
async function
|
|
1243
|
+
async function xs(e, t) {
|
|
1308
1244
|
await e.fileExists(t) && (await e.isDir(t) ? await e.rmdir(t) : await e.unlink(t));
|
|
1309
1245
|
}
|
|
1310
|
-
async function
|
|
1246
|
+
async function Ra(e) {
|
|
1311
1247
|
const t = await e.request({
|
|
1312
1248
|
url: "/wp-admin/export.php?download=true&content=all"
|
|
1313
1249
|
});
|
|
1314
1250
|
return new File([t.bytes], "export.xml");
|
|
1315
1251
|
}
|
|
1316
|
-
async function
|
|
1252
|
+
async function ka(e) {
|
|
1317
1253
|
const t = await e.request({
|
|
1318
1254
|
url: "/wp-admin/export.php?download=true&content=all&export_wxz=1"
|
|
1319
1255
|
});
|
|
1320
1256
|
return new File([t.bytes], "export.wxz");
|
|
1321
1257
|
}
|
|
1322
|
-
async function
|
|
1258
|
+
async function Ii(e, { targetPath: t, zipFile: r }) {
|
|
1323
1259
|
const n = r.name, s = n.replace(/\.zip$/, ""), i = ye(await e.documentRoot, "wp-content"), o = ye(i, crypto.randomUUID()), l = ye(o, n), d = ye(o, "assets", s);
|
|
1324
1260
|
await e.fileExists(d) && await e.rmdir(o, {
|
|
1325
1261
|
recursive: !0
|
|
1326
|
-
}), await e.mkdir(o), await
|
|
1262
|
+
}), await e.mkdir(o), await Ni(e, {
|
|
1327
1263
|
path: l,
|
|
1328
1264
|
data: r
|
|
1329
1265
|
});
|
|
@@ -1350,15 +1286,15 @@ async function Ai(e, { targetPath: t, zipFile: r }) {
|
|
|
1350
1286
|
});
|
|
1351
1287
|
}
|
|
1352
1288
|
}
|
|
1353
|
-
function
|
|
1289
|
+
function mn(e) {
|
|
1354
1290
|
const t = e.split(".").shift().replace(/-/g, " ");
|
|
1355
1291
|
return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
1356
1292
|
}
|
|
1357
|
-
const
|
|
1358
|
-
const s = t.name.split("/").pop() || "plugin.zip", i =
|
|
1293
|
+
const Oa = async (e, { pluginZipFile: t, options: r = {} }, n) => {
|
|
1294
|
+
const s = t.name.split("/").pop() || "plugin.zip", i = mn(s);
|
|
1359
1295
|
n == null || n.tracker.setCaption(`Installing the ${i} plugin`);
|
|
1360
1296
|
try {
|
|
1361
|
-
const { assetFolderPath: o } = await
|
|
1297
|
+
const { assetFolderPath: o } = await Ii(e, {
|
|
1362
1298
|
zipFile: t,
|
|
1363
1299
|
targetPath: `${await e.documentRoot}/wp-content/plugins`
|
|
1364
1300
|
});
|
|
@@ -1369,24 +1305,17 @@ const Ca = async (e, { pluginZipFile: t, options: r = {} }, n) => {
|
|
|
1369
1305
|
pluginName: i
|
|
1370
1306
|
},
|
|
1371
1307
|
n
|
|
1372
|
-
)
|
|
1308
|
+
);
|
|
1373
1309
|
} catch (o) {
|
|
1374
1310
|
console.error(
|
|
1375
1311
|
`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${o}`
|
|
1376
1312
|
), console.error(o);
|
|
1377
1313
|
}
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
await e.isDir("/wordpress/wp-content/plugins/gutenberg") && !await e.fileExists("/wordpress/.gutenberg-patched") && (await e.writeFile("/wordpress/.gutenberg-patched", "1"), await Ci(e, "/wordpress", [
|
|
1381
|
-
"/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.js",
|
|
1382
|
-
"/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.min.js"
|
|
1383
|
-
]));
|
|
1384
|
-
}
|
|
1385
|
-
const ja = async (e, { themeZipFile: t, options: r = {} }, n) => {
|
|
1386
|
-
const s = yn(t.name);
|
|
1314
|
+
}, Ca = async (e, { themeZipFile: t, options: r = {} }, n) => {
|
|
1315
|
+
const s = mn(t.name);
|
|
1387
1316
|
n == null || n.tracker.setCaption(`Installing the ${s} theme`);
|
|
1388
1317
|
try {
|
|
1389
|
-
const { assetFolderName: i } = await
|
|
1318
|
+
const { assetFolderName: i } = await Ii(e, {
|
|
1390
1319
|
zipFile: t,
|
|
1391
1320
|
targetPath: `${await e.documentRoot}/wp-content/themes`
|
|
1392
1321
|
});
|
|
@@ -1402,7 +1331,7 @@ const ja = async (e, { themeZipFile: t, options: r = {} }, n) => {
|
|
|
1402
1331
|
`Proceeding without the ${s} theme. Could not install it in wp-admin. The original error was: ${i}`
|
|
1403
1332
|
), console.error(i);
|
|
1404
1333
|
}
|
|
1405
|
-
},
|
|
1334
|
+
}, Na = async (e, { username: t = "admin", password: r = "password" } = {}, n) => {
|
|
1406
1335
|
n == null || n.tracker.setCaption((n == null ? void 0 : n.initialCaption) || "Logging in"), await e.request({
|
|
1407
1336
|
url: "/wp-login.php"
|
|
1408
1337
|
}), await e.request({
|
|
@@ -1414,7 +1343,7 @@ const ja = async (e, { themeZipFile: t, options: r = {} }, n) => {
|
|
|
1414
1343
|
rememberme: "forever"
|
|
1415
1344
|
}
|
|
1416
1345
|
});
|
|
1417
|
-
},
|
|
1346
|
+
}, ja = async (e, { options: t }) => {
|
|
1418
1347
|
await e.request({
|
|
1419
1348
|
url: "/wp-admin/install.php?step=2",
|
|
1420
1349
|
method: "POST",
|
|
@@ -1431,7 +1360,7 @@ const ja = async (e, { themeZipFile: t, options: r = {} }, n) => {
|
|
|
1431
1360
|
admin_email: "admin@localhost.com"
|
|
1432
1361
|
}
|
|
1433
1362
|
});
|
|
1434
|
-
},
|
|
1363
|
+
}, Ia = async (e, { options: t }) => {
|
|
1435
1364
|
const r = `<?php
|
|
1436
1365
|
include 'wordpress/wp-load.php';
|
|
1437
1366
|
$site_options = ${gr(t)};
|
|
@@ -1442,8 +1371,8 @@ const ja = async (e, { themeZipFile: t, options: r = {} }, n) => {
|
|
|
1442
1371
|
`, n = await e.run({
|
|
1443
1372
|
code: r
|
|
1444
1373
|
});
|
|
1445
|
-
return
|
|
1446
|
-
},
|
|
1374
|
+
return Ai(n), { code: r, result: n };
|
|
1375
|
+
}, Aa = async (e, { meta: t, userId: r }) => {
|
|
1447
1376
|
const n = `<?php
|
|
1448
1377
|
include 'wordpress/wp-load.php';
|
|
1449
1378
|
$meta = ${gr(t)};
|
|
@@ -1454,17 +1383,17 @@ const ja = async (e, { themeZipFile: t, options: r = {} }, n) => {
|
|
|
1454
1383
|
`, s = await e.run({
|
|
1455
1384
|
code: n
|
|
1456
1385
|
});
|
|
1457
|
-
return
|
|
1386
|
+
return Ai(s), { code: n, result: s };
|
|
1458
1387
|
};
|
|
1459
|
-
async function
|
|
1388
|
+
async function Ai(e) {
|
|
1460
1389
|
if (e.text !== "Success")
|
|
1461
1390
|
throw console.log(e), new Error(`Failed to run code: ${e.text} ${e.errors}`);
|
|
1462
1391
|
}
|
|
1463
|
-
const
|
|
1392
|
+
const Da = async (e, { selfContained: t = !1 } = {}) => {
|
|
1464
1393
|
const r = "/tmp/wordpress-playground.zip", n = await e.documentRoot, s = ye(n, "wp-content");
|
|
1465
1394
|
let i = Ti;
|
|
1466
1395
|
t && (i = i.filter((d) => !d.startsWith("themes/twenty")).filter((d) => d !== "plugins/sqlite-database-integration"));
|
|
1467
|
-
const o =
|
|
1396
|
+
const o = hn({
|
|
1468
1397
|
zipPath: r,
|
|
1469
1398
|
wpContentPath: s,
|
|
1470
1399
|
documentRoot: n,
|
|
@@ -1475,7 +1404,7 @@ const qa = async (e, { selfContained: t = !1 } = {}) => {
|
|
|
1475
1404
|
[ye(n, "wp-config.php")]: "wp-config.php"
|
|
1476
1405
|
} : {}
|
|
1477
1406
|
});
|
|
1478
|
-
await
|
|
1407
|
+
await ji(
|
|
1479
1408
|
e,
|
|
1480
1409
|
`zipDir(${o.wpContentPath}, ${o.zipPath}, array(
|
|
1481
1410
|
'exclude_paths' => ${o.exceptPaths},
|
|
@@ -1485,39 +1414,39 @@ const qa = async (e, { selfContained: t = !1 } = {}) => {
|
|
|
1485
1414
|
);
|
|
1486
1415
|
const l = await e.readFileAsBuffer(r);
|
|
1487
1416
|
return e.unlink(r), l;
|
|
1488
|
-
},
|
|
1417
|
+
}, Fa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1489
1418
|
__proto__: null,
|
|
1490
1419
|
activatePlugin: Ri,
|
|
1491
1420
|
activateTheme: ki,
|
|
1492
|
-
applyWordPressPatches:
|
|
1493
|
-
cp:
|
|
1494
|
-
defineSiteUrl:
|
|
1421
|
+
applyWordPressPatches: pa,
|
|
1422
|
+
cp: _a,
|
|
1423
|
+
defineSiteUrl: Pa,
|
|
1495
1424
|
defineWpConfigConsts: ur,
|
|
1496
|
-
exportWXR:
|
|
1497
|
-
exportWXZ:
|
|
1498
|
-
importFile:
|
|
1499
|
-
importWordPressFiles:
|
|
1500
|
-
installPlugin:
|
|
1501
|
-
installTheme:
|
|
1502
|
-
login:
|
|
1503
|
-
mkdir:
|
|
1504
|
-
mv:
|
|
1505
|
-
request:
|
|
1506
|
-
rm:
|
|
1507
|
-
rmdir:
|
|
1508
|
-
runPHP:
|
|
1509
|
-
runPHPWithOptions:
|
|
1510
|
-
runSql:
|
|
1511
|
-
runWpInstallationWizard:
|
|
1512
|
-
setPhpIniEntry:
|
|
1513
|
-
setSiteOptions:
|
|
1425
|
+
exportWXR: Ra,
|
|
1426
|
+
exportWXZ: ka,
|
|
1427
|
+
importFile: Ea,
|
|
1428
|
+
importWordPressFiles: Ta,
|
|
1429
|
+
installPlugin: Oa,
|
|
1430
|
+
installTheme: Ca,
|
|
1431
|
+
login: Na,
|
|
1432
|
+
mkdir: va,
|
|
1433
|
+
mv: wa,
|
|
1434
|
+
request: $a,
|
|
1435
|
+
rm: Ci,
|
|
1436
|
+
rmdir: ba,
|
|
1437
|
+
runPHP: ha,
|
|
1438
|
+
runPHPWithOptions: ma,
|
|
1439
|
+
runSql: ya,
|
|
1440
|
+
runWpInstallationWizard: ja,
|
|
1441
|
+
setPhpIniEntry: ga,
|
|
1442
|
+
setSiteOptions: Ia,
|
|
1514
1443
|
unzip: Hn,
|
|
1515
|
-
updateUserMeta:
|
|
1516
|
-
writeFile:
|
|
1517
|
-
zipWpContent:
|
|
1518
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1519
|
-
function
|
|
1520
|
-
const r = e.headers.get("content-length") || "", n = parseInt(r, 10) ||
|
|
1444
|
+
updateUserMeta: Aa,
|
|
1445
|
+
writeFile: Ni,
|
|
1446
|
+
zipWpContent: Da
|
|
1447
|
+
}, Symbol.toStringTag, { value: "Module" })), qa = 5 * 1024 * 1024;
|
|
1448
|
+
function Ma(e, t) {
|
|
1449
|
+
const r = e.headers.get("content-length") || "", n = parseInt(r, 10) || qa;
|
|
1521
1450
|
function s(i, o) {
|
|
1522
1451
|
t(
|
|
1523
1452
|
new CustomEvent("progress", {
|
|
@@ -1559,7 +1488,7 @@ function La(e, t) {
|
|
|
1559
1488
|
);
|
|
1560
1489
|
}
|
|
1561
1490
|
const En = 1e-5;
|
|
1562
|
-
class
|
|
1491
|
+
class yn extends EventTarget {
|
|
1563
1492
|
constructor({
|
|
1564
1493
|
weight: t = 1,
|
|
1565
1494
|
caption: r = "",
|
|
@@ -1608,7 +1537,7 @@ class gn extends EventTarget {
|
|
|
1608
1537
|
`Cannot add a stage with weight ${t} as the total weight of registered stages would exceed 1.`
|
|
1609
1538
|
);
|
|
1610
1539
|
this._selfWeight -= t;
|
|
1611
|
-
const n = new
|
|
1540
|
+
const n = new yn({
|
|
1612
1541
|
caption: r,
|
|
1613
1542
|
weight: t,
|
|
1614
1543
|
fillTime: this._fillTime
|
|
@@ -1746,11 +1675,11 @@ class zn extends Event {
|
|
|
1746
1675
|
}
|
|
1747
1676
|
Object.defineProperty(zn.prototype, "error", { enumerable: !0 });
|
|
1748
1677
|
Object.defineProperty(zn.prototype, "message", { enumerable: !0 });
|
|
1749
|
-
const
|
|
1750
|
-
function
|
|
1678
|
+
const Ua = typeof globalThis.ErrorEvent == "function" ? globalThis.ErrorEvent : zn;
|
|
1679
|
+
function La(e) {
|
|
1751
1680
|
return e instanceof Error ? "exitCode" in e && (e == null ? void 0 : e.exitCode) === 0 || (e == null ? void 0 : e.name) === "ExitStatus" && "status" in e && e.status === 0 : !1;
|
|
1752
1681
|
}
|
|
1753
|
-
class
|
|
1682
|
+
class Ha extends EventTarget {
|
|
1754
1683
|
constructor() {
|
|
1755
1684
|
super(...arguments), this.listenersCount = 0;
|
|
1756
1685
|
}
|
|
@@ -1764,11 +1693,11 @@ class Va extends EventTarget {
|
|
|
1764
1693
|
return this.listenersCount > 0;
|
|
1765
1694
|
}
|
|
1766
1695
|
}
|
|
1767
|
-
function
|
|
1696
|
+
function za(e) {
|
|
1768
1697
|
e.asm = {
|
|
1769
1698
|
...e.asm
|
|
1770
1699
|
};
|
|
1771
|
-
const t = new
|
|
1700
|
+
const t = new Ha();
|
|
1772
1701
|
for (const r in e.asm)
|
|
1773
1702
|
if (typeof e.asm[r] == "function") {
|
|
1774
1703
|
const n = e.asm[r];
|
|
@@ -1779,38 +1708,38 @@ function xa(e) {
|
|
|
1779
1708
|
} catch (o) {
|
|
1780
1709
|
if (!(o instanceof Error))
|
|
1781
1710
|
throw o;
|
|
1782
|
-
const l =
|
|
1711
|
+
const l = Wa(
|
|
1783
1712
|
o,
|
|
1784
1713
|
(i = e.lastAsyncifyStackSource) == null ? void 0 : i.stack
|
|
1785
1714
|
);
|
|
1786
1715
|
if (e.lastAsyncifyStackSource && (o.cause = e.lastAsyncifyStackSource), t.hasListeners()) {
|
|
1787
1716
|
t.dispatchEvent(
|
|
1788
|
-
new
|
|
1717
|
+
new Ua("error", {
|
|
1789
1718
|
error: o,
|
|
1790
1719
|
message: l
|
|
1791
1720
|
})
|
|
1792
1721
|
);
|
|
1793
1722
|
return;
|
|
1794
1723
|
}
|
|
1795
|
-
throw
|
|
1724
|
+
throw La(o) || Ga(l), o;
|
|
1796
1725
|
}
|
|
1797
1726
|
};
|
|
1798
1727
|
}
|
|
1799
1728
|
return t;
|
|
1800
1729
|
}
|
|
1801
1730
|
let Nn = [];
|
|
1802
|
-
function
|
|
1731
|
+
function Va() {
|
|
1803
1732
|
return Nn;
|
|
1804
1733
|
}
|
|
1805
|
-
function
|
|
1734
|
+
function Wa(e, t) {
|
|
1806
1735
|
if (e.message === "unreachable") {
|
|
1807
|
-
let r =
|
|
1736
|
+
let r = xa;
|
|
1808
1737
|
t || (r += `
|
|
1809
1738
|
|
|
1810
1739
|
This stack trace is lacking. For a better one initialize
|
|
1811
1740
|
the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
|
|
1812
1741
|
|
|
1813
|
-
`), Nn =
|
|
1742
|
+
`), Nn = Ka(
|
|
1814
1743
|
t || e.stack || ""
|
|
1815
1744
|
);
|
|
1816
1745
|
for (const n of Nn)
|
|
@@ -1820,7 +1749,7 @@ the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
|
|
|
1820
1749
|
}
|
|
1821
1750
|
return e.message;
|
|
1822
1751
|
}
|
|
1823
|
-
const
|
|
1752
|
+
const xa = `
|
|
1824
1753
|
"unreachable" WASM instruction executed.
|
|
1825
1754
|
|
|
1826
1755
|
The typical reason is a PHP function missing from the ASYNCIFY_ONLY
|
|
@@ -1844,20 +1773,20 @@ the Dockerfile, you'll need to trigger this error again with long stack
|
|
|
1844
1773
|
traces enabled. In node.js, you can do it using the --stack-trace-limit=100
|
|
1845
1774
|
CLI option:
|
|
1846
1775
|
|
|
1847
|
-
`, Ks = "\x1B[41m",
|
|
1776
|
+
`, Ks = "\x1B[41m", Ba = "\x1B[1m", Js = "\x1B[0m", Ys = "\x1B[K";
|
|
1848
1777
|
let Qs = !1;
|
|
1849
|
-
function
|
|
1850
|
-
if (!Qs) {
|
|
1851
|
-
|
|
1778
|
+
function Ga(e) {
|
|
1779
|
+
if (!Qs && (Qs = !0, !(e != null && e.trim().startsWith("Program terminated with exit")))) {
|
|
1780
|
+
console.log(`${Ks}
|
|
1852
1781
|
${Ys}
|
|
1853
|
-
${
|
|
1782
|
+
${Ba} WASM ERROR${Js}${Ks}`);
|
|
1854
1783
|
for (const t of e.split(`
|
|
1855
1784
|
`))
|
|
1856
1785
|
console.log(`${Ys} ${t} `);
|
|
1857
1786
|
console.log(`${Js}`);
|
|
1858
1787
|
}
|
|
1859
1788
|
}
|
|
1860
|
-
function
|
|
1789
|
+
function Ka(e) {
|
|
1861
1790
|
try {
|
|
1862
1791
|
const t = e.split(`
|
|
1863
1792
|
`).slice(1).map((r) => {
|
|
@@ -1933,16 +1862,16 @@ const Vn = [
|
|
|
1933
1862
|
"7.2",
|
|
1934
1863
|
"7.1",
|
|
1935
1864
|
"7.0"
|
|
1936
|
-
],
|
|
1865
|
+
], Ja = Vn[0], xp = Vn, Di = [
|
|
1937
1866
|
"iconv",
|
|
1938
1867
|
"mbstring",
|
|
1939
1868
|
"xml-bundle",
|
|
1940
1869
|
"gd"
|
|
1941
1870
|
], Zs = {
|
|
1942
|
-
"kitchen-sink":
|
|
1871
|
+
"kitchen-sink": Di
|
|
1943
1872
|
};
|
|
1944
1873
|
var $t, Ht;
|
|
1945
|
-
class
|
|
1874
|
+
class Ya {
|
|
1946
1875
|
/**
|
|
1947
1876
|
* @param server - The PHP server to browse.
|
|
1948
1877
|
* @param config - The browser configuration.
|
|
@@ -2029,18 +1958,18 @@ class Za {
|
|
|
2029
1958
|
}
|
|
2030
1959
|
}
|
|
2031
1960
|
$t = new WeakMap(), Ht = new WeakMap();
|
|
2032
|
-
const
|
|
1961
|
+
const Qa = "http://example.com";
|
|
2033
1962
|
function Xs(e) {
|
|
2034
1963
|
return e.toString().substring(e.origin.length);
|
|
2035
1964
|
}
|
|
2036
1965
|
function ei(e, t) {
|
|
2037
1966
|
return !t || !e.startsWith(t) ? e : e.substring(t.length);
|
|
2038
1967
|
}
|
|
2039
|
-
function
|
|
1968
|
+
function Za(e, t) {
|
|
2040
1969
|
return !t || e.startsWith(t) ? e : t + e;
|
|
2041
1970
|
}
|
|
2042
|
-
var He, zt, _r, _t, Vt, ze, xt,
|
|
2043
|
-
class
|
|
1971
|
+
var He, zt, _r, _t, Vt, ze, Wt, xt, Zr, Fi, Xr, qi, en, Mi;
|
|
1972
|
+
class Xa {
|
|
2044
1973
|
/**
|
|
2045
1974
|
* @param php - The PHP instance.
|
|
2046
1975
|
* @param config - Request Handler configuration.
|
|
@@ -2052,7 +1981,7 @@ class tc {
|
|
|
2052
1981
|
* @param fsPath - Absolute path of the static file to serve.
|
|
2053
1982
|
* @returns The response.
|
|
2054
1983
|
*/
|
|
2055
|
-
ee(this,
|
|
1984
|
+
ee(this, Zr);
|
|
2056
1985
|
/**
|
|
2057
1986
|
* Runs the requested PHP file with all the request and $_SERVER
|
|
2058
1987
|
* superglobals populated.
|
|
@@ -2060,7 +1989,7 @@ class tc {
|
|
|
2060
1989
|
* @param request - The request.
|
|
2061
1990
|
* @returns The response.
|
|
2062
1991
|
*/
|
|
2063
|
-
ee(this,
|
|
1992
|
+
ee(this, Xr);
|
|
2064
1993
|
/**
|
|
2065
1994
|
* Resolve the requested path to the filesystem path of the requested PHP file.
|
|
2066
1995
|
*
|
|
@@ -2070,16 +1999,16 @@ class tc {
|
|
|
2070
1999
|
* @throws {Error} If the requested path doesn't exist.
|
|
2071
2000
|
* @returns The resolved filesystem path.
|
|
2072
2001
|
*/
|
|
2073
|
-
ee(this,
|
|
2002
|
+
ee(this, en);
|
|
2074
2003
|
ee(this, He, void 0);
|
|
2075
2004
|
ee(this, zt, void 0);
|
|
2076
2005
|
ee(this, _r, void 0);
|
|
2077
2006
|
ee(this, _t, void 0);
|
|
2078
2007
|
ee(this, Vt, void 0);
|
|
2079
2008
|
ee(this, ze, void 0);
|
|
2080
|
-
ee(this, xt, void 0);
|
|
2081
2009
|
ee(this, Wt, void 0);
|
|
2082
|
-
|
|
2010
|
+
ee(this, xt, void 0);
|
|
2011
|
+
pe(this, xt, new Ln({ concurrency: 1 }));
|
|
2083
2012
|
const {
|
|
2084
2013
|
documentRoot: n = "/www/",
|
|
2085
2014
|
absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : ""
|
|
@@ -2091,7 +2020,7 @@ class tc {
|
|
|
2091
2020
|
pe(this, Vt, [
|
|
2092
2021
|
z(this, _r),
|
|
2093
2022
|
o ? `:${z(this, _t)}` : ""
|
|
2094
|
-
].join("")), pe(this, ze, i.pathname.replace(/\/+$/, "")), pe(this,
|
|
2023
|
+
].join("")), pe(this, ze, i.pathname.replace(/\/+$/, "")), pe(this, Wt, [
|
|
2095
2024
|
`${z(this, zt)}://`,
|
|
2096
2025
|
z(this, Vt),
|
|
2097
2026
|
z(this, ze)
|
|
@@ -2107,11 +2036,11 @@ class tc {
|
|
|
2107
2036
|
return r.pathname.startsWith(z(this, ze)) && (r.pathname = r.pathname.slice(z(this, ze).length)), Xs(r);
|
|
2108
2037
|
}
|
|
2109
2038
|
get isRequestRunning() {
|
|
2110
|
-
return z(this,
|
|
2039
|
+
return z(this, xt).running > 0;
|
|
2111
2040
|
}
|
|
2112
2041
|
/** @inheritDoc */
|
|
2113
2042
|
get absoluteUrl() {
|
|
2114
|
-
return z(this,
|
|
2043
|
+
return z(this, Wt);
|
|
2115
2044
|
}
|
|
2116
2045
|
/** @inheritDoc */
|
|
2117
2046
|
get documentRoot() {
|
|
@@ -2121,15 +2050,15 @@ class tc {
|
|
|
2121
2050
|
async request(t) {
|
|
2122
2051
|
const r = t.url.startsWith("http://") || t.url.startsWith("https://"), n = new URL(
|
|
2123
2052
|
t.url,
|
|
2124
|
-
r ? void 0 :
|
|
2053
|
+
r ? void 0 : Qa
|
|
2125
2054
|
), s = ei(
|
|
2126
2055
|
n.pathname,
|
|
2127
2056
|
z(this, ze)
|
|
2128
2057
|
), i = `${z(this, He)}${s}`;
|
|
2129
|
-
return
|
|
2058
|
+
return rc(i) ? await _e(this, Xr, qi).call(this, t, n) : _e(this, Zr, Fi).call(this, i);
|
|
2130
2059
|
}
|
|
2131
2060
|
}
|
|
2132
|
-
He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(), Vt = new WeakMap(), ze = new WeakMap(),
|
|
2061
|
+
He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(), Vt = new WeakMap(), ze = new WeakMap(), Wt = new WeakMap(), xt = new WeakMap(), Zr = new WeakSet(), Fi = function(t) {
|
|
2133
2062
|
if (!this.php.fileExists(t))
|
|
2134
2063
|
return new bt(
|
|
2135
2064
|
404,
|
|
@@ -2148,24 +2077,24 @@ He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(),
|
|
|
2148
2077
|
// @TODO: Infer the content-type from the arrayBuffer instead of the file path.
|
|
2149
2078
|
// The code below won't return the correct mime-type if the extension
|
|
2150
2079
|
// was tampered with.
|
|
2151
|
-
"content-type": [
|
|
2080
|
+
"content-type": [tc(t)],
|
|
2152
2081
|
"accept-ranges": ["bytes"],
|
|
2153
2082
|
"cache-control": ["public, max-age=0"]
|
|
2154
2083
|
},
|
|
2155
2084
|
r
|
|
2156
2085
|
);
|
|
2157
|
-
},
|
|
2086
|
+
}, Xr = new WeakSet(), qi = async function(t, r) {
|
|
2158
2087
|
var s;
|
|
2159
|
-
const n = await z(this,
|
|
2088
|
+
const n = await z(this, xt).acquire();
|
|
2160
2089
|
try {
|
|
2161
2090
|
this.php.addServerGlobalEntry("DOCUMENT_ROOT", z(this, He)), this.php.addServerGlobalEntry(
|
|
2162
2091
|
"HTTPS",
|
|
2163
|
-
z(this,
|
|
2092
|
+
z(this, Wt).startsWith("https://") ? "on" : ""
|
|
2164
2093
|
);
|
|
2165
2094
|
let i = "GET";
|
|
2166
2095
|
const o = {
|
|
2167
2096
|
host: z(this, Vt),
|
|
2168
|
-
...
|
|
2097
|
+
...Qi(t.headers || {})
|
|
2169
2098
|
}, l = [];
|
|
2170
2099
|
if (t.files && Object.keys(t.files).length) {
|
|
2171
2100
|
i = "POST";
|
|
@@ -2178,7 +2107,7 @@ He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(),
|
|
|
2178
2107
|
data: new Uint8Array(await h.arrayBuffer())
|
|
2179
2108
|
});
|
|
2180
2109
|
}
|
|
2181
|
-
(s = o["content-type"]) != null && s.startsWith("multipart/form-data") && (t.formData =
|
|
2110
|
+
(s = o["content-type"]) != null && s.startsWith("multipart/form-data") && (t.formData = ec(
|
|
2182
2111
|
t.body || ""
|
|
2183
2112
|
), o["content-type"] = "application/x-www-form-urlencoded", delete t.body);
|
|
2184
2113
|
}
|
|
@@ -2188,7 +2117,7 @@ He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(),
|
|
|
2188
2117
|
).toString()) : d = t.body;
|
|
2189
2118
|
let u;
|
|
2190
2119
|
try {
|
|
2191
|
-
u = _e(this,
|
|
2120
|
+
u = _e(this, en, Mi).call(this, r.pathname);
|
|
2192
2121
|
} catch {
|
|
2193
2122
|
return new bt(
|
|
2194
2123
|
404,
|
|
@@ -2197,7 +2126,7 @@ He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(),
|
|
|
2197
2126
|
);
|
|
2198
2127
|
}
|
|
2199
2128
|
return await this.php.run({
|
|
2200
|
-
relativeUri:
|
|
2129
|
+
relativeUri: Za(
|
|
2201
2130
|
Xs(r),
|
|
2202
2131
|
z(this, ze)
|
|
2203
2132
|
),
|
|
@@ -2211,7 +2140,7 @@ He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(),
|
|
|
2211
2140
|
} finally {
|
|
2212
2141
|
n();
|
|
2213
2142
|
}
|
|
2214
|
-
},
|
|
2143
|
+
}, en = new WeakSet(), Mi = function(t) {
|
|
2215
2144
|
let r = ei(t, z(this, ze));
|
|
2216
2145
|
r.includes(".php") ? r = r.split(".php")[0] + ".php" : (r.endsWith("/") || (r += "/"), r.endsWith("index.php") || (r += "index.php"));
|
|
2217
2146
|
const n = `${z(this, He)}${r}`;
|
|
@@ -2221,7 +2150,7 @@ He = new WeakMap(), zt = new WeakMap(), _r = new WeakMap(), _t = new WeakMap(),
|
|
|
2221
2150
|
throw new Error(`File not found: ${n}`);
|
|
2222
2151
|
return `${z(this, He)}/index.php`;
|
|
2223
2152
|
};
|
|
2224
|
-
function
|
|
2153
|
+
function ec(e) {
|
|
2225
2154
|
const t = {}, r = e.match(/--(.*)\r\n/);
|
|
2226
2155
|
if (!r)
|
|
2227
2156
|
return t;
|
|
@@ -2236,7 +2165,7 @@ function rc(e) {
|
|
|
2236
2165
|
}
|
|
2237
2166
|
}), t;
|
|
2238
2167
|
}
|
|
2239
|
-
function
|
|
2168
|
+
function tc(e) {
|
|
2240
2169
|
switch (e.split(".").pop()) {
|
|
2241
2170
|
case "css":
|
|
2242
2171
|
return "text/css";
|
|
@@ -2276,16 +2205,16 @@ function nc(e) {
|
|
|
2276
2205
|
return "application-octet-stream";
|
|
2277
2206
|
}
|
|
2278
2207
|
}
|
|
2279
|
-
function
|
|
2280
|
-
return
|
|
2208
|
+
function rc(e) {
|
|
2209
|
+
return nc(e) || sc(e);
|
|
2281
2210
|
}
|
|
2282
|
-
function
|
|
2211
|
+
function nc(e) {
|
|
2283
2212
|
return e.endsWith(".php") || e.includes(".php/");
|
|
2284
2213
|
}
|
|
2285
|
-
function
|
|
2214
|
+
function sc(e) {
|
|
2286
2215
|
return !e.split("/").pop().includes(".");
|
|
2287
2216
|
}
|
|
2288
|
-
const
|
|
2217
|
+
const Vr = {
|
|
2289
2218
|
0: "No error occurred. System call completed successfully.",
|
|
2290
2219
|
1: "Argument list too long.",
|
|
2291
2220
|
2: "Permission denied.",
|
|
@@ -2364,12 +2293,12 @@ const xr = {
|
|
|
2364
2293
|
75: "Cross-device link.",
|
|
2365
2294
|
76: "Extension: Capabilities insufficient."
|
|
2366
2295
|
};
|
|
2367
|
-
function
|
|
2296
|
+
function ic(e) {
|
|
2368
2297
|
const t = typeof e == "object" ? e == null ? void 0 : e.errno : null;
|
|
2369
|
-
if (t in
|
|
2370
|
-
return
|
|
2298
|
+
if (t in Vr)
|
|
2299
|
+
return Vr[t];
|
|
2371
2300
|
}
|
|
2372
|
-
function
|
|
2301
|
+
function xe(e = "") {
|
|
2373
2302
|
return function(r, n, s) {
|
|
2374
2303
|
const i = s.value;
|
|
2375
2304
|
s.value = function(...o) {
|
|
@@ -2377,8 +2306,8 @@ function We(e = "") {
|
|
|
2377
2306
|
return i.apply(this, o);
|
|
2378
2307
|
} catch (l) {
|
|
2379
2308
|
const d = typeof l == "object" ? l == null ? void 0 : l.errno : null;
|
|
2380
|
-
if (d in
|
|
2381
|
-
const u =
|
|
2309
|
+
if (d in Vr) {
|
|
2310
|
+
const u = Vr[d], p = typeof o[0] == "string" ? o[0] : null, h = p !== null ? e.replaceAll("{path}", p) : e;
|
|
2382
2311
|
throw new Error(`${h}: ${u}`, {
|
|
2383
2312
|
cause: l
|
|
2384
2313
|
});
|
|
@@ -2388,21 +2317,21 @@ function We(e = "") {
|
|
|
2388
2317
|
};
|
|
2389
2318
|
};
|
|
2390
2319
|
}
|
|
2391
|
-
const
|
|
2392
|
-
function
|
|
2393
|
-
return
|
|
2320
|
+
const oc = /* @__PURE__ */ new Map();
|
|
2321
|
+
function ac(e) {
|
|
2322
|
+
return oc.get(e);
|
|
2394
2323
|
}
|
|
2395
2324
|
(function() {
|
|
2396
2325
|
var e;
|
|
2397
2326
|
return typeof process < "u" && ((e = process.release) == null ? void 0 : e.name) === "node" ? "NODE" : typeof window < "u" ? "WEB" : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? "WORKER" : "NODE";
|
|
2398
2327
|
})();
|
|
2399
|
-
var
|
|
2400
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
2328
|
+
var cc = Object.defineProperty, lc = Object.getOwnPropertyDescriptor, Be = (e, t, r, n) => {
|
|
2329
|
+
for (var s = n > 1 ? void 0 : n ? lc(t, r) : t, i = e.length - 1, o; i >= 0; i--)
|
|
2401
2330
|
(o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
|
|
2402
|
-
return n && s &&
|
|
2331
|
+
return n && s && cc(t, r, s), s;
|
|
2403
2332
|
};
|
|
2404
2333
|
const we = "string", Dt = "number", te = Symbol("__private__dont__use");
|
|
2405
|
-
var wt, nt, vt, st, Ye, Bt, wr, rn, Li, nn, Hi, sn, zi, on, Vi, an,
|
|
2334
|
+
var wt, nt, vt, st, Ye, Bt, wr, tn, Ui, rn, Li, nn, Hi, sn, zi, on, Vi, an, Wi, cn, xi, ln, Bi, un, Gi, dn, Ki, pn, Ji, fn, Yi;
|
|
2406
2335
|
class Ge {
|
|
2407
2336
|
/**
|
|
2408
2337
|
* Initializes a PHP runtime.
|
|
@@ -2412,6 +2341,7 @@ class Ge {
|
|
|
2412
2341
|
* @param serverOptions - Optional. Options for the PHPRequestHandler. If undefined, no request handler will be initialized.
|
|
2413
2342
|
*/
|
|
2414
2343
|
constructor(t, r) {
|
|
2344
|
+
ee(this, tn);
|
|
2415
2345
|
ee(this, rn);
|
|
2416
2346
|
ee(this, nn);
|
|
2417
2347
|
ee(this, sn);
|
|
@@ -2420,7 +2350,6 @@ class Ge {
|
|
|
2420
2350
|
ee(this, cn);
|
|
2421
2351
|
ee(this, ln);
|
|
2422
2352
|
ee(this, un);
|
|
2423
|
-
ee(this, dn);
|
|
2424
2353
|
/**
|
|
2425
2354
|
* Adds file information to $_FILES superglobal in PHP.
|
|
2426
2355
|
*
|
|
@@ -2430,9 +2359,9 @@ class Ge {
|
|
|
2430
2359
|
*
|
|
2431
2360
|
* @param fileInfo - File details
|
|
2432
2361
|
*/
|
|
2362
|
+
ee(this, dn);
|
|
2433
2363
|
ee(this, pn);
|
|
2434
2364
|
ee(this, fn);
|
|
2435
|
-
ee(this, hn);
|
|
2436
2365
|
ee(this, wt, void 0);
|
|
2437
2366
|
ee(this, nt, void 0);
|
|
2438
2367
|
ee(this, vt, void 0);
|
|
@@ -2440,8 +2369,8 @@ class Ge {
|
|
|
2440
2369
|
ee(this, Ye, void 0);
|
|
2441
2370
|
ee(this, Bt, void 0);
|
|
2442
2371
|
ee(this, wr, void 0);
|
|
2443
|
-
pe(this, wt, []), pe(this, nt, !1), pe(this, vt, null), pe(this, st, {}), pe(this, Ye, /* @__PURE__ */ new Map()), pe(this, Bt, []), pe(this, wr, new Ln({ concurrency: 1 })), t !== void 0 && this.initializeRuntime(t), r && (this.requestHandler = new
|
|
2444
|
-
new
|
|
2372
|
+
pe(this, wt, []), pe(this, nt, !1), pe(this, vt, null), pe(this, st, {}), pe(this, Ye, /* @__PURE__ */ new Map()), pe(this, Bt, []), pe(this, wr, new Ln({ concurrency: 1 })), t !== void 0 && this.initializeRuntime(t), r && (this.requestHandler = new Ya(
|
|
2373
|
+
new Xa(this, r)
|
|
2445
2374
|
));
|
|
2446
2375
|
}
|
|
2447
2376
|
addEventListener(t, r) {
|
|
@@ -2486,7 +2415,7 @@ class Ge {
|
|
|
2486
2415
|
initializeRuntime(t) {
|
|
2487
2416
|
if (this[te])
|
|
2488
2417
|
throw new Error("PHP runtime already initialized.");
|
|
2489
|
-
const r =
|
|
2418
|
+
const r = ac(t);
|
|
2490
2419
|
if (!r)
|
|
2491
2420
|
throw new Error("Invalid PHP runtime id.");
|
|
2492
2421
|
this[te] = r, r.onMessage = async (n) => {
|
|
@@ -2496,7 +2425,7 @@ class Ge {
|
|
|
2496
2425
|
return i;
|
|
2497
2426
|
}
|
|
2498
2427
|
return "";
|
|
2499
|
-
}, pe(this, vt,
|
|
2428
|
+
}, pe(this, vt, za(r));
|
|
2500
2429
|
}
|
|
2501
2430
|
/** @inheritDoc */
|
|
2502
2431
|
setPhpIniPath(t) {
|
|
@@ -2529,12 +2458,12 @@ class Ge {
|
|
|
2529
2458
|
async run(t) {
|
|
2530
2459
|
const r = await z(this, wr).acquire();
|
|
2531
2460
|
try {
|
|
2532
|
-
z(this, nt) || (_e(this,
|
|
2533
|
-
const n =
|
|
2534
|
-
if (_e(this,
|
|
2461
|
+
z(this, nt) || (_e(this, tn, Ui).call(this), pe(this, nt, !0)), _e(this, ln, Bi).call(this, t.scriptPath || ""), _e(this, nn, Hi).call(this, t.relativeUri || ""), _e(this, on, Vi).call(this, t.method || "GET");
|
|
2462
|
+
const n = Qi(t.headers || {}), s = n.host || "example.com:443";
|
|
2463
|
+
if (_e(this, sn, zi).call(this, s, t.protocol || "http"), _e(this, an, Wi).call(this, n), t.body && _e(this, cn, xi).call(this, t.body), t.fileInfos)
|
|
2535
2464
|
for (const i of t.fileInfos)
|
|
2536
|
-
_e(this,
|
|
2537
|
-
return t.code && _e(this,
|
|
2465
|
+
_e(this, dn, Ki).call(this, i);
|
|
2466
|
+
return t.code && _e(this, pn, Ji).call(this, " ?>" + t.code), _e(this, un, Gi).call(this), await _e(this, fn, Yi).call(this);
|
|
2538
2467
|
} finally {
|
|
2539
2468
|
r(), this.dispatchEvent({
|
|
2540
2469
|
type: "request.end"
|
|
@@ -2583,7 +2512,7 @@ class Ge {
|
|
|
2583
2512
|
try {
|
|
2584
2513
|
this[te].FS.rename(t, r);
|
|
2585
2514
|
} catch (n) {
|
|
2586
|
-
const s =
|
|
2515
|
+
const s = ic(n);
|
|
2587
2516
|
throw s ? new Error(
|
|
2588
2517
|
`Could not move ${t} to ${r}: ${s}`,
|
|
2589
2518
|
{
|
|
@@ -2630,7 +2559,7 @@ class Ge {
|
|
|
2630
2559
|
return this[te]._exit(t);
|
|
2631
2560
|
}
|
|
2632
2561
|
}
|
|
2633
|
-
wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(), Ye = new WeakMap(), Bt = new WeakMap(), wr = new WeakMap(),
|
|
2562
|
+
wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(), Ye = new WeakMap(), Bt = new WeakMap(), wr = new WeakMap(), tn = new WeakSet(), Ui = function() {
|
|
2634
2563
|
if (this.setPhpIniEntry("auto_prepend_file", "/tmp/consts.php"), this.fileExists("/tmp/consts.php") || this.writeFile(
|
|
2635
2564
|
"/tmp/consts.php",
|
|
2636
2565
|
`<?php
|
|
@@ -2655,7 +2584,7 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2655
2584
|
);
|
|
2656
2585
|
}
|
|
2657
2586
|
this[te].ccall("php_wasm_init", null, [], []);
|
|
2658
|
-
},
|
|
2587
|
+
}, rn = new WeakSet(), Li = function() {
|
|
2659
2588
|
const t = "/tmp/headers.json";
|
|
2660
2589
|
if (!this.fileExists(t))
|
|
2661
2590
|
throw new Error(
|
|
@@ -2672,7 +2601,7 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2672
2601
|
headers: n,
|
|
2673
2602
|
httpStatusCode: r.status
|
|
2674
2603
|
};
|
|
2675
|
-
},
|
|
2604
|
+
}, nn = new WeakSet(), Hi = function(t) {
|
|
2676
2605
|
if (this[te].ccall(
|
|
2677
2606
|
"wasm_set_request_uri",
|
|
2678
2607
|
null,
|
|
@@ -2687,7 +2616,7 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2687
2616
|
[r]
|
|
2688
2617
|
);
|
|
2689
2618
|
}
|
|
2690
|
-
},
|
|
2619
|
+
}, sn = new WeakSet(), zi = function(t, r) {
|
|
2691
2620
|
this[te].ccall(
|
|
2692
2621
|
"wasm_set_request_host",
|
|
2693
2622
|
null,
|
|
@@ -2705,14 +2634,14 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2705
2634
|
[Dt],
|
|
2706
2635
|
[n]
|
|
2707
2636
|
), (r === "https" || !r && n === 443) && this.addServerGlobalEntry("HTTPS", "on");
|
|
2708
|
-
},
|
|
2637
|
+
}, on = new WeakSet(), Vi = function(t) {
|
|
2709
2638
|
this[te].ccall(
|
|
2710
2639
|
"wasm_set_request_method",
|
|
2711
2640
|
null,
|
|
2712
2641
|
[we],
|
|
2713
2642
|
[t]
|
|
2714
2643
|
);
|
|
2715
|
-
},
|
|
2644
|
+
}, an = new WeakSet(), Wi = function(t) {
|
|
2716
2645
|
t.cookie && this[te].ccall(
|
|
2717
2646
|
"wasm_set_cookies",
|
|
2718
2647
|
null,
|
|
@@ -2736,7 +2665,7 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2736
2665
|
t[r]
|
|
2737
2666
|
);
|
|
2738
2667
|
}
|
|
2739
|
-
},
|
|
2668
|
+
}, cn = new WeakSet(), xi = function(t) {
|
|
2740
2669
|
this[te].ccall(
|
|
2741
2670
|
"wasm_set_request_body",
|
|
2742
2671
|
null,
|
|
@@ -2748,14 +2677,14 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2748
2677
|
[Dt],
|
|
2749
2678
|
[new TextEncoder().encode(t).length]
|
|
2750
2679
|
);
|
|
2751
|
-
},
|
|
2680
|
+
}, ln = new WeakSet(), Bi = function(t) {
|
|
2752
2681
|
this[te].ccall(
|
|
2753
2682
|
"wasm_set_path_translated",
|
|
2754
2683
|
null,
|
|
2755
2684
|
[we],
|
|
2756
2685
|
[t]
|
|
2757
2686
|
);
|
|
2758
|
-
},
|
|
2687
|
+
}, un = new WeakSet(), Gi = function() {
|
|
2759
2688
|
for (const t in z(this, st))
|
|
2760
2689
|
this[te].ccall(
|
|
2761
2690
|
"wasm_add_SERVER_entry",
|
|
@@ -2763,7 +2692,7 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2763
2692
|
[we, we],
|
|
2764
2693
|
[t, z(this, st)[t]]
|
|
2765
2694
|
);
|
|
2766
|
-
},
|
|
2695
|
+
}, dn = new WeakSet(), Ki = function(t) {
|
|
2767
2696
|
const { key: r, name: n, type: s, data: i } = t, o = `/tmp/${Math.random().toFixed(20)}`;
|
|
2768
2697
|
this.writeFile(o, i);
|
|
2769
2698
|
const l = 0;
|
|
@@ -2773,14 +2702,14 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2773
2702
|
[we, we, we, we, Dt, Dt],
|
|
2774
2703
|
[r, n, s, o, l, i.byteLength]
|
|
2775
2704
|
);
|
|
2776
|
-
},
|
|
2705
|
+
}, pn = new WeakSet(), Ji = function(t) {
|
|
2777
2706
|
this[te].ccall(
|
|
2778
2707
|
"wasm_set_php_code",
|
|
2779
2708
|
null,
|
|
2780
2709
|
[we],
|
|
2781
2710
|
[t]
|
|
2782
2711
|
);
|
|
2783
|
-
},
|
|
2712
|
+
}, fn = new WeakSet(), Yi = async function() {
|
|
2784
2713
|
var i;
|
|
2785
2714
|
let t, r;
|
|
2786
2715
|
try {
|
|
@@ -2809,13 +2738,13 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2809
2738
|
"PHP runtime has crashed – see the earlier error for details."
|
|
2810
2739
|
);
|
|
2811
2740
|
});
|
|
2812
|
-
this.functionsMaybeMissingFromAsyncify =
|
|
2741
|
+
this.functionsMaybeMissingFromAsyncify = Va();
|
|
2813
2742
|
const l = o, d = "betterMessage" in l ? l.betterMessage : l.message, u = new Error(d);
|
|
2814
2743
|
throw u.cause = l, u;
|
|
2815
2744
|
} finally {
|
|
2816
2745
|
(i = z(this, vt)) == null || i.removeEventListener("error", r), pe(this, st, {});
|
|
2817
2746
|
}
|
|
2818
|
-
const { headers: n, httpStatusCode: s } = _e(this,
|
|
2747
|
+
const { headers: n, httpStatusCode: s } = _e(this, rn, Li).call(this);
|
|
2819
2748
|
return new bt(
|
|
2820
2749
|
s,
|
|
2821
2750
|
n,
|
|
@@ -2825,50 +2754,50 @@ wt = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
|
|
|
2825
2754
|
);
|
|
2826
2755
|
};
|
|
2827
2756
|
Be([
|
|
2828
|
-
|
|
2757
|
+
xe('Could not create directory "{path}"')
|
|
2829
2758
|
], Ge.prototype, "mkdir", 1);
|
|
2830
2759
|
Be([
|
|
2831
|
-
|
|
2760
|
+
xe('Could not create directory "{path}"')
|
|
2832
2761
|
], Ge.prototype, "mkdirTree", 1);
|
|
2833
2762
|
Be([
|
|
2834
|
-
|
|
2763
|
+
xe('Could not read "{path}"')
|
|
2835
2764
|
], Ge.prototype, "readFileAsText", 1);
|
|
2836
2765
|
Be([
|
|
2837
|
-
|
|
2766
|
+
xe('Could not read "{path}"')
|
|
2838
2767
|
], Ge.prototype, "readFileAsBuffer", 1);
|
|
2839
2768
|
Be([
|
|
2840
|
-
|
|
2769
|
+
xe('Could not write to "{path}"')
|
|
2841
2770
|
], Ge.prototype, "writeFile", 1);
|
|
2842
2771
|
Be([
|
|
2843
|
-
|
|
2772
|
+
xe('Could not unlink "{path}"')
|
|
2844
2773
|
], Ge.prototype, "unlink", 1);
|
|
2845
2774
|
Be([
|
|
2846
|
-
|
|
2775
|
+
xe('Could not remove directory "{path}"')
|
|
2847
2776
|
], Ge.prototype, "rmdir", 1);
|
|
2848
2777
|
Be([
|
|
2849
|
-
|
|
2778
|
+
xe('Could not list files in "{path}"')
|
|
2850
2779
|
], Ge.prototype, "listFiles", 1);
|
|
2851
2780
|
Be([
|
|
2852
|
-
|
|
2781
|
+
xe('Could not stat "{path}"')
|
|
2853
2782
|
], Ge.prototype, "isDir", 1);
|
|
2854
2783
|
Be([
|
|
2855
|
-
|
|
2784
|
+
xe('Could not stat "{path}"')
|
|
2856
2785
|
], Ge.prototype, "fileExists", 1);
|
|
2857
|
-
function
|
|
2786
|
+
function Qi(e) {
|
|
2858
2787
|
const t = {};
|
|
2859
2788
|
for (const r in e)
|
|
2860
2789
|
t[r.toLowerCase()] = e[r];
|
|
2861
2790
|
return t;
|
|
2862
2791
|
}
|
|
2863
|
-
const
|
|
2792
|
+
const uc = [
|
|
2864
2793
|
"vfs",
|
|
2865
2794
|
"literal",
|
|
2866
2795
|
"wordpress.org/themes",
|
|
2867
2796
|
"wordpress.org/plugins",
|
|
2868
2797
|
"url"
|
|
2869
2798
|
];
|
|
2870
|
-
function
|
|
2871
|
-
return e && typeof e == "object" && typeof e.resource == "string" &&
|
|
2799
|
+
function dc(e) {
|
|
2800
|
+
return e && typeof e == "object" && typeof e.resource == "string" && uc.includes(e.resource);
|
|
2872
2801
|
}
|
|
2873
2802
|
class St {
|
|
2874
2803
|
/**
|
|
@@ -2882,24 +2811,24 @@ class St {
|
|
|
2882
2811
|
let s;
|
|
2883
2812
|
switch (t.resource) {
|
|
2884
2813
|
case "vfs":
|
|
2885
|
-
s = new
|
|
2814
|
+
s = new pc(t, n);
|
|
2886
2815
|
break;
|
|
2887
2816
|
case "literal":
|
|
2888
|
-
s = new
|
|
2817
|
+
s = new fc(t, n);
|
|
2889
2818
|
break;
|
|
2890
2819
|
case "wordpress.org/themes":
|
|
2891
|
-
s = new
|
|
2820
|
+
s = new yc(t, n);
|
|
2892
2821
|
break;
|
|
2893
2822
|
case "wordpress.org/plugins":
|
|
2894
|
-
s = new
|
|
2823
|
+
s = new gc(t, n);
|
|
2895
2824
|
break;
|
|
2896
2825
|
case "url":
|
|
2897
|
-
s = new
|
|
2826
|
+
s = new mc(t, n);
|
|
2898
2827
|
break;
|
|
2899
2828
|
default:
|
|
2900
2829
|
throw new Error(`Invalid resource: ${t}`);
|
|
2901
2830
|
}
|
|
2902
|
-
return s = new
|
|
2831
|
+
return s = new $c(s), r && (s = new _c(s, r)), s;
|
|
2903
2832
|
}
|
|
2904
2833
|
setPlayground(t) {
|
|
2905
2834
|
this.playground = t;
|
|
@@ -2909,7 +2838,7 @@ class St {
|
|
|
2909
2838
|
return !1;
|
|
2910
2839
|
}
|
|
2911
2840
|
}
|
|
2912
|
-
class
|
|
2841
|
+
class pc extends St {
|
|
2913
2842
|
/**
|
|
2914
2843
|
* Creates a new instance of `VFSResource`.
|
|
2915
2844
|
* @param playground The playground client.
|
|
@@ -2932,7 +2861,7 @@ class hc extends St {
|
|
|
2932
2861
|
return this.resource.path.split("/").pop() || "";
|
|
2933
2862
|
}
|
|
2934
2863
|
}
|
|
2935
|
-
class
|
|
2864
|
+
class fc extends St {
|
|
2936
2865
|
/**
|
|
2937
2866
|
* Creates a new instance of `LiteralResource`.
|
|
2938
2867
|
* @param resource The literal reference.
|
|
@@ -2951,7 +2880,7 @@ class mc extends St {
|
|
|
2951
2880
|
return this.resource.name;
|
|
2952
2881
|
}
|
|
2953
2882
|
}
|
|
2954
|
-
class
|
|
2883
|
+
class Wn extends St {
|
|
2955
2884
|
/**
|
|
2956
2885
|
* Creates a new instance of `FetchResource`.
|
|
2957
2886
|
* @param progress The progress tracker.
|
|
@@ -2965,9 +2894,9 @@ class xn extends St {
|
|
|
2965
2894
|
(n = this.progress) == null || n.setCaption(this.caption);
|
|
2966
2895
|
const t = this.getURL();
|
|
2967
2896
|
let r = await fetch(t);
|
|
2968
|
-
if (r = await
|
|
2897
|
+
if (r = await Ma(
|
|
2969
2898
|
r,
|
|
2970
|
-
((s = this.progress) == null ? void 0 : s.loadingListener) ??
|
|
2899
|
+
((s = this.progress) == null ? void 0 : s.loadingListener) ?? hc
|
|
2971
2900
|
), r.status !== 200)
|
|
2972
2901
|
throw new Error(`Could not download "${t}"`);
|
|
2973
2902
|
return new File([await r.blob()], this.name);
|
|
@@ -2992,9 +2921,9 @@ class xn extends St {
|
|
|
2992
2921
|
return !0;
|
|
2993
2922
|
}
|
|
2994
2923
|
}
|
|
2995
|
-
const
|
|
2924
|
+
const hc = () => {
|
|
2996
2925
|
};
|
|
2997
|
-
class
|
|
2926
|
+
class mc extends Wn {
|
|
2998
2927
|
/**
|
|
2999
2928
|
* Creates a new instance of `UrlResource`.
|
|
3000
2929
|
* @param resource The URL reference.
|
|
@@ -3012,34 +2941,34 @@ class gc extends xn {
|
|
|
3012
2941
|
return this.resource.caption ?? super.caption;
|
|
3013
2942
|
}
|
|
3014
2943
|
}
|
|
3015
|
-
class
|
|
2944
|
+
class yc extends Wn {
|
|
3016
2945
|
constructor(t, r) {
|
|
3017
2946
|
super(r), this.resource = t;
|
|
3018
2947
|
}
|
|
3019
2948
|
get name() {
|
|
3020
|
-
return
|
|
2949
|
+
return mn(this.resource.slug);
|
|
3021
2950
|
}
|
|
3022
2951
|
getURL() {
|
|
3023
|
-
return `https://downloads.wordpress.org/theme/${
|
|
2952
|
+
return `https://downloads.wordpress.org/theme/${Zi(this.resource.slug)}`;
|
|
3024
2953
|
}
|
|
3025
2954
|
}
|
|
3026
|
-
class
|
|
2955
|
+
class gc extends Wn {
|
|
3027
2956
|
constructor(t, r) {
|
|
3028
2957
|
super(r), this.resource = t;
|
|
3029
2958
|
}
|
|
3030
2959
|
/** @inheritDoc */
|
|
3031
2960
|
get name() {
|
|
3032
|
-
return
|
|
2961
|
+
return mn(this.resource.slug);
|
|
3033
2962
|
}
|
|
3034
2963
|
/** @inheritDoc */
|
|
3035
2964
|
getURL() {
|
|
3036
|
-
return `https://downloads.wordpress.org/plugin/${
|
|
2965
|
+
return `https://downloads.wordpress.org/plugin/${Zi(this.resource.slug)}`;
|
|
3037
2966
|
}
|
|
3038
2967
|
}
|
|
3039
|
-
function
|
|
2968
|
+
function Zi(e) {
|
|
3040
2969
|
return !e || e.endsWith(".zip") ? e : e + ".latest-stable.zip";
|
|
3041
2970
|
}
|
|
3042
|
-
class
|
|
2971
|
+
class Xi extends St {
|
|
3043
2972
|
constructor(t) {
|
|
3044
2973
|
super(), this.resource = t;
|
|
3045
2974
|
}
|
|
@@ -3068,13 +2997,13 @@ class eo extends St {
|
|
|
3068
2997
|
return this.resource.isAsync;
|
|
3069
2998
|
}
|
|
3070
2999
|
}
|
|
3071
|
-
class
|
|
3000
|
+
class $c extends Xi {
|
|
3072
3001
|
/** @inheritDoc */
|
|
3073
3002
|
async resolve() {
|
|
3074
3003
|
return this.promise || (this.promise = super.resolve()), this.promise;
|
|
3075
3004
|
}
|
|
3076
3005
|
}
|
|
3077
|
-
class
|
|
3006
|
+
class _c extends Xi {
|
|
3078
3007
|
constructor(t, r) {
|
|
3079
3008
|
super(t), this.semaphore = r;
|
|
3080
3009
|
}
|
|
@@ -3083,11 +3012,11 @@ class vc extends eo {
|
|
|
3083
3012
|
return this.isAsync ? this.semaphore.run(() => super.resolve()) : super.resolve();
|
|
3084
3013
|
}
|
|
3085
3014
|
}
|
|
3086
|
-
var
|
|
3087
|
-
function
|
|
3015
|
+
var wc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3016
|
+
function vc(e) {
|
|
3088
3017
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3089
3018
|
}
|
|
3090
|
-
var jn = { exports: {} },
|
|
3019
|
+
var jn = { exports: {} }, eo = {}, Ae = {}, Gt = {}, vr = {}, G = {}, $r = {};
|
|
3091
3020
|
(function(e) {
|
|
3092
3021
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
|
|
3093
3022
|
class t {
|
|
@@ -3615,7 +3544,7 @@ var In = {};
|
|
|
3615
3544
|
return this.catch && Z(a, this.catch.names), this.finally && Z(a, this.finally.names), a;
|
|
3616
3545
|
}
|
|
3617
3546
|
}
|
|
3618
|
-
class
|
|
3547
|
+
class W extends w {
|
|
3619
3548
|
constructor(a) {
|
|
3620
3549
|
super(), this.error = a;
|
|
3621
3550
|
}
|
|
@@ -3623,7 +3552,7 @@ var In = {};
|
|
|
3623
3552
|
return `catch(${this.error})` + super.render(a);
|
|
3624
3553
|
}
|
|
3625
3554
|
}
|
|
3626
|
-
|
|
3555
|
+
W.kind = "catch";
|
|
3627
3556
|
class K extends w {
|
|
3628
3557
|
render(a) {
|
|
3629
3558
|
return "finally" + super.render(a);
|
|
@@ -3776,9 +3705,9 @@ var In = {};
|
|
|
3776
3705
|
const q = new A();
|
|
3777
3706
|
if (this._blockNode(q), this.code(a), m) {
|
|
3778
3707
|
const M = this.name("e");
|
|
3779
|
-
this._currNode = q.catch = new
|
|
3708
|
+
this._currNode = q.catch = new W(M), m(M);
|
|
3780
3709
|
}
|
|
3781
|
-
return N && (this._currNode = q.finally = new K(), this.code(N)), this._endBlockNode(
|
|
3710
|
+
return N && (this._currNode = q.finally = new K(), this.code(N)), this._endBlockNode(W, K);
|
|
3782
3711
|
}
|
|
3783
3712
|
// `throw` statement
|
|
3784
3713
|
throw(a) {
|
|
@@ -3904,10 +3833,10 @@ var re = {};
|
|
|
3904
3833
|
}
|
|
3905
3834
|
e.alwaysValidSchema = s;
|
|
3906
3835
|
function i(b, C = b.schema) {
|
|
3907
|
-
const { opts: A, self:
|
|
3836
|
+
const { opts: A, self: W } = b;
|
|
3908
3837
|
if (!A.strictSchema || typeof C == "boolean")
|
|
3909
3838
|
return;
|
|
3910
|
-
const K =
|
|
3839
|
+
const K = W.RULES.keywords;
|
|
3911
3840
|
for (const ce in C)
|
|
3912
3841
|
K[ce] || D(b, `unknown keyword: "${ce}"`);
|
|
3913
3842
|
}
|
|
@@ -3930,14 +3859,14 @@ var re = {};
|
|
|
3930
3859
|
return !1;
|
|
3931
3860
|
}
|
|
3932
3861
|
e.schemaHasRulesButRef = l;
|
|
3933
|
-
function d({ topSchemaRef: b, schemaPath: C }, A,
|
|
3862
|
+
function d({ topSchemaRef: b, schemaPath: C }, A, W, K) {
|
|
3934
3863
|
if (!K) {
|
|
3935
3864
|
if (typeof A == "number" || typeof A == "boolean")
|
|
3936
3865
|
return A;
|
|
3937
3866
|
if (typeof A == "string")
|
|
3938
3867
|
return (0, t._)`${A}`;
|
|
3939
3868
|
}
|
|
3940
|
-
return (0, t._)`${b}${C}${(0, t.getProperty)(
|
|
3869
|
+
return (0, t._)`${b}${C}${(0, t.getProperty)(W)}`;
|
|
3941
3870
|
}
|
|
3942
3871
|
e.schemaRefOrVal = d;
|
|
3943
3872
|
function u(b) {
|
|
@@ -3964,10 +3893,10 @@ var re = {};
|
|
|
3964
3893
|
C(b);
|
|
3965
3894
|
}
|
|
3966
3895
|
e.eachItem = T;
|
|
3967
|
-
function w({ mergeNames: b, mergeToName: C, mergeValues: A, resultToName:
|
|
3896
|
+
function w({ mergeNames: b, mergeToName: C, mergeValues: A, resultToName: W }) {
|
|
3968
3897
|
return (K, ce, Z, Re) => {
|
|
3969
3898
|
const he = Z === void 0 ? ce : Z instanceof t.Name ? (ce instanceof t.Name ? b(K, ce, Z) : C(K, ce, Z), Z) : ce instanceof t.Name ? (C(K, Z, ce), ce) : A(ce, Z);
|
|
3970
|
-
return Re === t.Name && !(he instanceof t.Name) ?
|
|
3899
|
+
return Re === t.Name && !(he instanceof t.Name) ? W(K, he) : he;
|
|
3971
3900
|
};
|
|
3972
3901
|
}
|
|
3973
3902
|
e.mergeEvaluated = {
|
|
@@ -3996,7 +3925,7 @@ var re = {};
|
|
|
3996
3925
|
}
|
|
3997
3926
|
e.evaluatedPropsToName = R;
|
|
3998
3927
|
function _(b, C, A) {
|
|
3999
|
-
Object.keys(A).forEach((
|
|
3928
|
+
Object.keys(A).forEach((W) => b.assign((0, t._)`${C}${(0, t.getProperty)(W)}`, !0));
|
|
4000
3929
|
}
|
|
4001
3930
|
e.setEvaluated = _;
|
|
4002
3931
|
const g = {};
|
|
@@ -4013,8 +3942,8 @@ var re = {};
|
|
|
4013
3942
|
})(O = e.Type || (e.Type = {}));
|
|
4014
3943
|
function j(b, C, A) {
|
|
4015
3944
|
if (b instanceof t.Name) {
|
|
4016
|
-
const
|
|
4017
|
-
return A ?
|
|
3945
|
+
const W = C === O.Num;
|
|
3946
|
+
return A ? W ? (0, t._)`"[" + ${b} + "]"` : (0, t._)`"['" + ${b} + "']"` : W ? (0, t._)`"/" + ${b}` : (0, t._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
4018
3947
|
}
|
|
4019
3948
|
return A ? (0, t.getProperty)(b).toString() : "/" + h(b);
|
|
4020
3949
|
}
|
|
@@ -4030,7 +3959,7 @@ var re = {};
|
|
|
4030
3959
|
})(re);
|
|
4031
3960
|
var Ke = {};
|
|
4032
3961
|
Object.defineProperty(Ke, "__esModule", { value: !0 });
|
|
4033
|
-
const ve = G,
|
|
3962
|
+
const ve = G, bc = {
|
|
4034
3963
|
// validation function arguments
|
|
4035
3964
|
data: new ve.Name("data"),
|
|
4036
3965
|
// args passed from referencing schema
|
|
@@ -4053,7 +3982,7 @@ const ve = G, Ec = {
|
|
|
4053
3982
|
jsonLen: new ve.Name("jsonLen"),
|
|
4054
3983
|
jsonPart: new ve.Name("jsonPart")
|
|
4055
3984
|
};
|
|
4056
|
-
Ke.default =
|
|
3985
|
+
Ke.default = bc;
|
|
4057
3986
|
(function(e) {
|
|
4058
3987
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
|
|
4059
3988
|
const t = G, r = re, n = Ke;
|
|
@@ -4122,26 +4051,26 @@ Ke.default = Ec;
|
|
|
4122
4051
|
return k && (j = (0, t.str)`${j}${(0, r.getErrorPath)(k, r.Type.Str)}`), [p.schemaPath, j];
|
|
4123
4052
|
}
|
|
4124
4053
|
function R(_, { params: g, message: k }, O) {
|
|
4125
|
-
const { keyword: j, data: D, schemaValue: b, it: C } = _, { opts: A, propertyName:
|
|
4126
|
-
O.push([p.keyword, j], [p.params, typeof g == "function" ? g(_) : g || (0, t._)`{}`]), A.messages && O.push([p.message, typeof k == "function" ? k(_) : k]), A.verbose && O.push([p.schema, b], [p.parentSchema, (0, t._)`${K}${ce}`], [n.default.data, D]),
|
|
4054
|
+
const { keyword: j, data: D, schemaValue: b, it: C } = _, { opts: A, propertyName: W, topSchemaRef: K, schemaPath: ce } = C;
|
|
4055
|
+
O.push([p.keyword, j], [p.params, typeof g == "function" ? g(_) : g || (0, t._)`{}`]), A.messages && O.push([p.message, typeof k == "function" ? k(_) : k]), A.verbose && O.push([p.schema, b], [p.parentSchema, (0, t._)`${K}${ce}`], [n.default.data, D]), W && O.push([p.propertyName, W]);
|
|
4127
4056
|
}
|
|
4128
4057
|
})(vr);
|
|
4129
4058
|
Object.defineProperty(Gt, "__esModule", { value: !0 });
|
|
4130
4059
|
Gt.boolOrEmptySchema = Gt.topBoolOrEmptySchema = void 0;
|
|
4131
|
-
const
|
|
4060
|
+
const Pc = vr, Ec = G, Sc = Ke, Tc = {
|
|
4132
4061
|
message: "boolean schema is false"
|
|
4133
4062
|
};
|
|
4134
|
-
function
|
|
4063
|
+
function Rc(e) {
|
|
4135
4064
|
const { gen: t, schema: r, validateName: n } = e;
|
|
4136
|
-
r === !1 ?
|
|
4065
|
+
r === !1 ? to(e, !1) : typeof r == "object" && r.$async === !0 ? t.return(Sc.default.data) : (t.assign((0, Ec._)`${n}.errors`, null), t.return(!0));
|
|
4137
4066
|
}
|
|
4138
|
-
Gt.topBoolOrEmptySchema =
|
|
4139
|
-
function
|
|
4067
|
+
Gt.topBoolOrEmptySchema = Rc;
|
|
4068
|
+
function kc(e, t) {
|
|
4140
4069
|
const { gen: r, schema: n } = e;
|
|
4141
|
-
n === !1 ? (r.var(t, !1),
|
|
4070
|
+
n === !1 ? (r.var(t, !1), to(e)) : r.var(t, !0);
|
|
4142
4071
|
}
|
|
4143
|
-
Gt.boolOrEmptySchema =
|
|
4144
|
-
function
|
|
4072
|
+
Gt.boolOrEmptySchema = kc;
|
|
4073
|
+
function to(e, t) {
|
|
4145
4074
|
const { gen: r, data: n } = e, s = {
|
|
4146
4075
|
gen: r,
|
|
4147
4076
|
keyword: "false schema",
|
|
@@ -4152,17 +4081,17 @@ function ro(e, t) {
|
|
|
4152
4081
|
params: {},
|
|
4153
4082
|
it: e
|
|
4154
4083
|
};
|
|
4155
|
-
(0,
|
|
4084
|
+
(0, Pc.reportError)(s, Tc, void 0, t);
|
|
4156
4085
|
}
|
|
4157
4086
|
var br = {}, Pt = {};
|
|
4158
4087
|
Object.defineProperty(Pt, "__esModule", { value: !0 });
|
|
4159
4088
|
Pt.getRules = Pt.isJSONType = void 0;
|
|
4160
|
-
const
|
|
4161
|
-
function
|
|
4162
|
-
return typeof e == "string" &&
|
|
4089
|
+
const Oc = ["string", "number", "integer", "boolean", "null", "object", "array"], Cc = new Set(Oc);
|
|
4090
|
+
function Nc(e) {
|
|
4091
|
+
return typeof e == "string" && Cc.has(e);
|
|
4163
4092
|
}
|
|
4164
|
-
Pt.isJSONType =
|
|
4165
|
-
function
|
|
4093
|
+
Pt.isJSONType = Nc;
|
|
4094
|
+
function jc() {
|
|
4166
4095
|
const e = {
|
|
4167
4096
|
number: { type: "number", rules: [] },
|
|
4168
4097
|
string: { type: "string", rules: [] },
|
|
@@ -4177,24 +4106,24 @@ function Ac() {
|
|
|
4177
4106
|
keywords: {}
|
|
4178
4107
|
};
|
|
4179
4108
|
}
|
|
4180
|
-
Pt.getRules =
|
|
4109
|
+
Pt.getRules = jc;
|
|
4181
4110
|
var Qe = {};
|
|
4182
4111
|
Object.defineProperty(Qe, "__esModule", { value: !0 });
|
|
4183
4112
|
Qe.shouldUseRule = Qe.shouldUseGroup = Qe.schemaHasRulesForType = void 0;
|
|
4184
|
-
function
|
|
4113
|
+
function Ic({ schema: e, self: t }, r) {
|
|
4185
4114
|
const n = t.RULES.types[r];
|
|
4186
|
-
return n && n !== !0 &&
|
|
4115
|
+
return n && n !== !0 && ro(e, n);
|
|
4187
4116
|
}
|
|
4188
|
-
Qe.schemaHasRulesForType =
|
|
4189
|
-
function
|
|
4190
|
-
return t.rules.some((r) =>
|
|
4117
|
+
Qe.schemaHasRulesForType = Ic;
|
|
4118
|
+
function ro(e, t) {
|
|
4119
|
+
return t.rules.some((r) => no(e, r));
|
|
4191
4120
|
}
|
|
4192
|
-
Qe.shouldUseGroup =
|
|
4193
|
-
function
|
|
4121
|
+
Qe.shouldUseGroup = ro;
|
|
4122
|
+
function no(e, t) {
|
|
4194
4123
|
var r;
|
|
4195
4124
|
return e[t.keyword] !== void 0 || ((r = t.definition.implements) === null || r === void 0 ? void 0 : r.some((n) => e[n] !== void 0));
|
|
4196
4125
|
}
|
|
4197
|
-
Qe.shouldUseRule =
|
|
4126
|
+
Qe.shouldUseRule = no;
|
|
4198
4127
|
(function(e) {
|
|
4199
4128
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0;
|
|
4200
4129
|
const t = Pt, r = Qe, n = vr, s = G, i = re;
|
|
@@ -4223,14 +4152,14 @@ Qe.shouldUseRule = so;
|
|
|
4223
4152
|
}
|
|
4224
4153
|
e.getJSONTypes = d;
|
|
4225
4154
|
function u(O, j) {
|
|
4226
|
-
const { gen: D, data: b, opts: C } = O, A = h(j, C.coerceTypes),
|
|
4227
|
-
if (
|
|
4155
|
+
const { gen: D, data: b, opts: C } = O, A = h(j, C.coerceTypes), W = j.length > 0 && !(A.length === 0 && j.length === 1 && (0, r.schemaHasRulesForType)(O, j[0]));
|
|
4156
|
+
if (W) {
|
|
4228
4157
|
const K = R(j, b, C.strictNumbers, o.Wrong);
|
|
4229
4158
|
D.if(K, () => {
|
|
4230
4159
|
A.length ? v(O, j, A) : g(O);
|
|
4231
4160
|
});
|
|
4232
4161
|
}
|
|
4233
|
-
return
|
|
4162
|
+
return W;
|
|
4234
4163
|
}
|
|
4235
4164
|
e.coerceAndCheckDataType = u;
|
|
4236
4165
|
const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
@@ -4238,8 +4167,8 @@ Qe.shouldUseRule = so;
|
|
|
4238
4167
|
return j ? O.filter((D) => p.has(D) || j === "array" && D === "array") : [];
|
|
4239
4168
|
}
|
|
4240
4169
|
function v(O, j, D) {
|
|
4241
|
-
const { gen: b, data: C, opts: A } = O,
|
|
4242
|
-
A.coerceTypes === "array" && b.if((0, s._)`${
|
|
4170
|
+
const { gen: b, data: C, opts: A } = O, W = b.let("dataType", (0, s._)`typeof ${C}`), K = b.let("coerced", (0, s._)`undefined`);
|
|
4171
|
+
A.coerceTypes === "array" && b.if((0, s._)`${W} == 'object' && Array.isArray(${C}) && ${C}.length == 1`, () => b.assign(C, (0, s._)`${C}[0]`).assign(W, (0, s._)`typeof ${C}`).if(R(j, C, A.strictNumbers), () => b.assign(K, C))), b.if((0, s._)`${K} !== undefined`);
|
|
4243
4172
|
for (const Z of D)
|
|
4244
4173
|
(p.has(Z) || Z === "array" && A.coerceTypes === "array") && ce(Z);
|
|
4245
4174
|
b.else(), g(O), b.endIf(), b.if((0, s._)`${K} !== undefined`, () => {
|
|
@@ -4248,15 +4177,15 @@ Qe.shouldUseRule = so;
|
|
|
4248
4177
|
function ce(Z) {
|
|
4249
4178
|
switch (Z) {
|
|
4250
4179
|
case "string":
|
|
4251
|
-
b.elseIf((0, s._)`${
|
|
4180
|
+
b.elseIf((0, s._)`${W} == "number" || ${W} == "boolean"`).assign(K, (0, s._)`"" + ${C}`).elseIf((0, s._)`${C} === null`).assign(K, (0, s._)`""`);
|
|
4252
4181
|
return;
|
|
4253
4182
|
case "number":
|
|
4254
|
-
b.elseIf((0, s._)`${
|
|
4255
|
-
|| (${
|
|
4183
|
+
b.elseIf((0, s._)`${W} == "boolean" || ${C} === null
|
|
4184
|
+
|| (${W} == "string" && ${C} && ${C} == +${C})`).assign(K, (0, s._)`+${C}`);
|
|
4256
4185
|
return;
|
|
4257
4186
|
case "integer":
|
|
4258
|
-
b.elseIf((0, s._)`${
|
|
4259
|
-
|| (${
|
|
4187
|
+
b.elseIf((0, s._)`${W} === "boolean" || ${C} === null
|
|
4188
|
+
|| (${W} === "string" && ${C} && ${C} == +${C} && !(${C} % 1))`).assign(K, (0, s._)`+${C}`);
|
|
4260
4189
|
return;
|
|
4261
4190
|
case "boolean":
|
|
4262
4191
|
b.elseIf((0, s._)`${C} === "false" || ${C} === 0 || ${C} === null`).assign(K, !1).elseIf((0, s._)`${C} === "true" || ${C} === 1`).assign(K, !0);
|
|
@@ -4265,8 +4194,8 @@ Qe.shouldUseRule = so;
|
|
|
4265
4194
|
b.elseIf((0, s._)`${C} === "" || ${C} === 0 || ${C} === false`), b.assign(K, null);
|
|
4266
4195
|
return;
|
|
4267
4196
|
case "array":
|
|
4268
|
-
b.elseIf((0, s._)`${
|
|
4269
|
-
|| ${
|
|
4197
|
+
b.elseIf((0, s._)`${W} === "string" || ${W} === "number"
|
|
4198
|
+
|| ${W} === "boolean" || ${C} === null`).assign(K, (0, s._)`[${C}]`);
|
|
4270
4199
|
}
|
|
4271
4200
|
}
|
|
4272
4201
|
}
|
|
@@ -4286,16 +4215,16 @@ Qe.shouldUseRule = so;
|
|
|
4286
4215
|
A = (0, s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;
|
|
4287
4216
|
break;
|
|
4288
4217
|
case "integer":
|
|
4289
|
-
A =
|
|
4218
|
+
A = W((0, s._)`!(${j} % 1) && !isNaN(${j})`);
|
|
4290
4219
|
break;
|
|
4291
4220
|
case "number":
|
|
4292
|
-
A =
|
|
4221
|
+
A = W();
|
|
4293
4222
|
break;
|
|
4294
4223
|
default:
|
|
4295
4224
|
return (0, s._)`typeof ${j} ${C} ${O}`;
|
|
4296
4225
|
}
|
|
4297
4226
|
return b === o.Correct ? A : (0, s.not)(A);
|
|
4298
|
-
function
|
|
4227
|
+
function W(K = s.nil) {
|
|
4299
4228
|
return (0, s.and)((0, s._)`typeof ${j} == "number"`, K, D ? (0, s._)`isFinite(${j})` : s.nil);
|
|
4300
4229
|
}
|
|
4301
4230
|
}
|
|
@@ -4306,13 +4235,13 @@ Qe.shouldUseRule = so;
|
|
|
4306
4235
|
let C;
|
|
4307
4236
|
const A = (0, i.toHash)(O);
|
|
4308
4237
|
if (A.array && A.object) {
|
|
4309
|
-
const
|
|
4310
|
-
C = A.null ?
|
|
4238
|
+
const W = (0, s._)`typeof ${j} != "object"`;
|
|
4239
|
+
C = A.null ? W : (0, s._)`!${j} || ${W}`, delete A.null, delete A.array, delete A.object;
|
|
4311
4240
|
} else
|
|
4312
4241
|
C = s.nil;
|
|
4313
4242
|
A.number && delete A.integer;
|
|
4314
|
-
for (const
|
|
4315
|
-
C = (0, s.and)(C, w(
|
|
4243
|
+
for (const W in A)
|
|
4244
|
+
C = (0, s.and)(C, w(W, j, D, b));
|
|
4316
4245
|
return C;
|
|
4317
4246
|
}
|
|
4318
4247
|
e.checkDataTypes = R;
|
|
@@ -4340,11 +4269,11 @@ Qe.shouldUseRule = so;
|
|
|
4340
4269
|
};
|
|
4341
4270
|
}
|
|
4342
4271
|
})(br);
|
|
4343
|
-
var
|
|
4344
|
-
Object.defineProperty(
|
|
4345
|
-
|
|
4346
|
-
const Ft = G,
|
|
4347
|
-
function
|
|
4272
|
+
var gn = {};
|
|
4273
|
+
Object.defineProperty(gn, "__esModule", { value: !0 });
|
|
4274
|
+
gn.assignDefaults = void 0;
|
|
4275
|
+
const Ft = G, Ac = re;
|
|
4276
|
+
function Dc(e, t) {
|
|
4348
4277
|
const { properties: r, items: n } = e.schema;
|
|
4349
4278
|
if (t === "object" && r)
|
|
4350
4279
|
for (const s in r)
|
|
@@ -4352,69 +4281,69 @@ function qc(e, t) {
|
|
|
4352
4281
|
else
|
|
4353
4282
|
t === "array" && Array.isArray(n) && n.forEach((s, i) => ti(e, i, s.default));
|
|
4354
4283
|
}
|
|
4355
|
-
|
|
4284
|
+
gn.assignDefaults = Dc;
|
|
4356
4285
|
function ti(e, t, r) {
|
|
4357
4286
|
const { gen: n, compositeRule: s, data: i, opts: o } = e;
|
|
4358
4287
|
if (r === void 0)
|
|
4359
4288
|
return;
|
|
4360
4289
|
const l = (0, Ft._)`${i}${(0, Ft.getProperty)(t)}`;
|
|
4361
4290
|
if (s) {
|
|
4362
|
-
(0,
|
|
4291
|
+
(0, Ac.checkStrictMode)(e, `default is ignored for: ${l}`);
|
|
4363
4292
|
return;
|
|
4364
4293
|
}
|
|
4365
4294
|
let d = (0, Ft._)`${l} === undefined`;
|
|
4366
4295
|
o.useDefaults === "empty" && (d = (0, Ft._)`${d} || ${l} === null || ${l} === ""`), n.if(d, (0, Ft._)`${l} = ${(0, Ft.stringify)(r)}`);
|
|
4367
4296
|
}
|
|
4368
|
-
var
|
|
4297
|
+
var We = {}, B = {};
|
|
4369
4298
|
Object.defineProperty(B, "__esModule", { value: !0 });
|
|
4370
4299
|
B.validateUnion = B.validateArray = B.usePattern = B.callValidateCode = B.schemaProperties = B.allSchemaProperties = B.noPropertyInData = B.propertyInData = B.isOwnProperty = B.hasPropFunc = B.reportMissingProp = B.checkMissingProp = B.checkReportMissingProp = void 0;
|
|
4371
|
-
const ie = G,
|
|
4372
|
-
function
|
|
4300
|
+
const ie = G, xn = re, tt = Ke, Fc = re;
|
|
4301
|
+
function qc(e, t) {
|
|
4373
4302
|
const { gen: r, data: n, it: s } = e;
|
|
4374
4303
|
r.if(Gn(r, n, t, s.opts.ownProperties), () => {
|
|
4375
4304
|
e.setParams({ missingProperty: (0, ie._)`${t}` }, !0), e.error();
|
|
4376
4305
|
});
|
|
4377
4306
|
}
|
|
4378
|
-
B.checkReportMissingProp =
|
|
4379
|
-
function
|
|
4307
|
+
B.checkReportMissingProp = qc;
|
|
4308
|
+
function Mc({ gen: e, data: t, it: { opts: r } }, n, s) {
|
|
4380
4309
|
return (0, ie.or)(...n.map((i) => (0, ie.and)(Gn(e, t, i, r.ownProperties), (0, ie._)`${s} = ${i}`)));
|
|
4381
4310
|
}
|
|
4382
|
-
B.checkMissingProp =
|
|
4383
|
-
function
|
|
4311
|
+
B.checkMissingProp = Mc;
|
|
4312
|
+
function Uc(e, t) {
|
|
4384
4313
|
e.setParams({ missingProperty: t }, !0), e.error();
|
|
4385
4314
|
}
|
|
4386
|
-
B.reportMissingProp =
|
|
4387
|
-
function
|
|
4315
|
+
B.reportMissingProp = Uc;
|
|
4316
|
+
function so(e) {
|
|
4388
4317
|
return e.scopeValue("func", {
|
|
4389
4318
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
4390
4319
|
ref: Object.prototype.hasOwnProperty,
|
|
4391
4320
|
code: (0, ie._)`Object.prototype.hasOwnProperty`
|
|
4392
4321
|
});
|
|
4393
4322
|
}
|
|
4394
|
-
B.hasPropFunc =
|
|
4323
|
+
B.hasPropFunc = so;
|
|
4395
4324
|
function Bn(e, t, r) {
|
|
4396
|
-
return (0, ie._)`${
|
|
4325
|
+
return (0, ie._)`${so(e)}.call(${t}, ${r})`;
|
|
4397
4326
|
}
|
|
4398
4327
|
B.isOwnProperty = Bn;
|
|
4399
|
-
function
|
|
4328
|
+
function Lc(e, t, r, n) {
|
|
4400
4329
|
const s = (0, ie._)`${t}${(0, ie.getProperty)(r)} !== undefined`;
|
|
4401
4330
|
return n ? (0, ie._)`${s} && ${Bn(e, t, r)}` : s;
|
|
4402
4331
|
}
|
|
4403
|
-
B.propertyInData =
|
|
4332
|
+
B.propertyInData = Lc;
|
|
4404
4333
|
function Gn(e, t, r, n) {
|
|
4405
4334
|
const s = (0, ie._)`${t}${(0, ie.getProperty)(r)} === undefined`;
|
|
4406
4335
|
return n ? (0, ie.or)(s, (0, ie.not)(Bn(e, t, r))) : s;
|
|
4407
4336
|
}
|
|
4408
4337
|
B.noPropertyInData = Gn;
|
|
4409
|
-
function
|
|
4338
|
+
function io(e) {
|
|
4410
4339
|
return e ? Object.keys(e).filter((t) => t !== "__proto__") : [];
|
|
4411
4340
|
}
|
|
4412
|
-
B.allSchemaProperties =
|
|
4413
|
-
function
|
|
4414
|
-
return
|
|
4341
|
+
B.allSchemaProperties = io;
|
|
4342
|
+
function Hc(e, t) {
|
|
4343
|
+
return io(t).filter((r) => !(0, xn.alwaysValidSchema)(e, t[r]));
|
|
4415
4344
|
}
|
|
4416
|
-
B.schemaProperties =
|
|
4417
|
-
function
|
|
4345
|
+
B.schemaProperties = Hc;
|
|
4346
|
+
function zc({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath: s, errorPath: i }, it: o }, l, d, u) {
|
|
4418
4347
|
const p = u ? (0, ie._)`${e}, ${t}, ${n}${s}` : t, h = [
|
|
4419
4348
|
[tt.default.instancePath, (0, ie.strConcat)(tt.default.instancePath, i)],
|
|
4420
4349
|
[tt.default.parentData, o.parentData],
|
|
@@ -4425,18 +4354,18 @@ function xc({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath:
|
|
|
4425
4354
|
const v = (0, ie._)`${p}, ${r.object(...h)}`;
|
|
4426
4355
|
return d !== ie.nil ? (0, ie._)`${l}.call(${d}, ${v})` : (0, ie._)`${l}(${v})`;
|
|
4427
4356
|
}
|
|
4428
|
-
B.callValidateCode =
|
|
4429
|
-
const
|
|
4430
|
-
function
|
|
4357
|
+
B.callValidateCode = zc;
|
|
4358
|
+
const Vc = (0, ie._)`new RegExp`;
|
|
4359
|
+
function Wc({ gen: e, it: { opts: t } }, r) {
|
|
4431
4360
|
const n = t.unicodeRegExp ? "u" : "", { regExp: s } = t.code, i = s(r, n);
|
|
4432
4361
|
return e.scopeValue("pattern", {
|
|
4433
4362
|
key: i.toString(),
|
|
4434
4363
|
ref: i,
|
|
4435
|
-
code: (0, ie._)`${s.code === "new RegExp" ?
|
|
4364
|
+
code: (0, ie._)`${s.code === "new RegExp" ? Vc : (0, Fc.useFunc)(e, s)}(${r}, ${n})`
|
|
4436
4365
|
});
|
|
4437
4366
|
}
|
|
4438
|
-
B.usePattern =
|
|
4439
|
-
function
|
|
4367
|
+
B.usePattern = Wc;
|
|
4368
|
+
function xc(e) {
|
|
4440
4369
|
const { gen: t, data: r, keyword: n, it: s } = e, i = t.name("valid");
|
|
4441
4370
|
if (s.allErrors) {
|
|
4442
4371
|
const l = t.let("valid", !0);
|
|
@@ -4449,17 +4378,17 @@ function Gc(e) {
|
|
|
4449
4378
|
e.subschema({
|
|
4450
4379
|
keyword: n,
|
|
4451
4380
|
dataProp: u,
|
|
4452
|
-
dataPropType:
|
|
4381
|
+
dataPropType: xn.Type.Num
|
|
4453
4382
|
}, i), t.if((0, ie.not)(i), l);
|
|
4454
4383
|
});
|
|
4455
4384
|
}
|
|
4456
4385
|
}
|
|
4457
|
-
B.validateArray =
|
|
4458
|
-
function
|
|
4386
|
+
B.validateArray = xc;
|
|
4387
|
+
function Bc(e) {
|
|
4459
4388
|
const { gen: t, schema: r, keyword: n, it: s } = e;
|
|
4460
4389
|
if (!Array.isArray(r))
|
|
4461
4390
|
throw new Error("ajv implementation error");
|
|
4462
|
-
if (r.some((d) => (0,
|
|
4391
|
+
if (r.some((d) => (0, xn.alwaysValidSchema)(s, d)) && !s.opts.unevaluated)
|
|
4463
4392
|
return;
|
|
4464
4393
|
const o = t.let("valid", !1), l = t.name("_valid");
|
|
4465
4394
|
t.block(() => r.forEach((d, u) => {
|
|
@@ -4471,12 +4400,12 @@ function Kc(e) {
|
|
|
4471
4400
|
t.assign(o, (0, ie._)`${o} || ${l}`), e.mergeValidEvaluated(p, l) || t.if((0, ie.not)(o));
|
|
4472
4401
|
})), e.result(o, () => e.reset(), () => e.error(!0));
|
|
4473
4402
|
}
|
|
4474
|
-
B.validateUnion =
|
|
4475
|
-
Object.defineProperty(
|
|
4476
|
-
|
|
4477
|
-
const be = G, ht = Ke,
|
|
4478
|
-
function
|
|
4479
|
-
const { gen: r, keyword: n, schema: s, parentSchema: i, it: o } = e, l = t.macro.call(o.self, s, i, o), d =
|
|
4403
|
+
B.validateUnion = Bc;
|
|
4404
|
+
Object.defineProperty(We, "__esModule", { value: !0 });
|
|
4405
|
+
We.validateKeywordUsage = We.validSchemaType = We.funcKeywordCode = We.macroKeywordCode = void 0;
|
|
4406
|
+
const be = G, ht = Ke, Gc = B, Kc = vr;
|
|
4407
|
+
function Jc(e, t) {
|
|
4408
|
+
const { gen: r, keyword: n, schema: s, parentSchema: i, it: o } = e, l = t.macro.call(o.self, s, i, o), d = oo(r, n, l);
|
|
4480
4409
|
o.opts.validateSchema !== !1 && o.self.validateSchema(l, !0);
|
|
4481
4410
|
const u = r.name("valid");
|
|
4482
4411
|
e.subschema({
|
|
@@ -4487,19 +4416,19 @@ function Qc(e, t) {
|
|
|
4487
4416
|
compositeRule: !0
|
|
4488
4417
|
}, u), e.pass(u, () => e.error(!0));
|
|
4489
4418
|
}
|
|
4490
|
-
|
|
4491
|
-
function
|
|
4419
|
+
We.macroKeywordCode = Jc;
|
|
4420
|
+
function Yc(e, t) {
|
|
4492
4421
|
var r;
|
|
4493
4422
|
const { gen: n, keyword: s, schema: i, parentSchema: o, $data: l, it: d } = e;
|
|
4494
|
-
|
|
4495
|
-
const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p =
|
|
4423
|
+
Zc(d, t);
|
|
4424
|
+
const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = oo(n, s, u), h = n.let("valid");
|
|
4496
4425
|
e.block$data(h, v), e.ok((r = t.valid) !== null && r !== void 0 ? r : h);
|
|
4497
4426
|
function v() {
|
|
4498
4427
|
if (t.errors === !1)
|
|
4499
4428
|
R(), t.modifying && ri(e), _(() => e.error());
|
|
4500
4429
|
else {
|
|
4501
4430
|
const g = t.async ? T() : w();
|
|
4502
|
-
t.modifying && ri(e), _(() =>
|
|
4431
|
+
t.modifying && ri(e), _(() => Qc(e, g));
|
|
4503
4432
|
}
|
|
4504
4433
|
}
|
|
4505
4434
|
function T() {
|
|
@@ -4512,38 +4441,38 @@ function Zc(e, t) {
|
|
|
4512
4441
|
}
|
|
4513
4442
|
function R(g = t.async ? (0, be._)`await ` : be.nil) {
|
|
4514
4443
|
const k = d.opts.passContext ? ht.default.this : ht.default.self, O = !("compile" in t && !l || t.schema === !1);
|
|
4515
|
-
n.assign(h, (0, be._)`${g}${(0,
|
|
4444
|
+
n.assign(h, (0, be._)`${g}${(0, Gc.callValidateCode)(e, p, k, O)}`, t.modifying);
|
|
4516
4445
|
}
|
|
4517
4446
|
function _(g) {
|
|
4518
4447
|
var k;
|
|
4519
4448
|
n.if((0, be.not)((k = t.valid) !== null && k !== void 0 ? k : h), g);
|
|
4520
4449
|
}
|
|
4521
4450
|
}
|
|
4522
|
-
|
|
4451
|
+
We.funcKeywordCode = Yc;
|
|
4523
4452
|
function ri(e) {
|
|
4524
4453
|
const { gen: t, data: r, it: n } = e;
|
|
4525
4454
|
t.if(n.parentData, () => t.assign(r, (0, be._)`${n.parentData}[${n.parentDataProperty}]`));
|
|
4526
4455
|
}
|
|
4527
|
-
function
|
|
4456
|
+
function Qc(e, t) {
|
|
4528
4457
|
const { gen: r } = e;
|
|
4529
4458
|
r.if((0, be._)`Array.isArray(${t})`, () => {
|
|
4530
|
-
r.assign(ht.default.vErrors, (0, be._)`${ht.default.vErrors} === null ? ${t} : ${ht.default.vErrors}.concat(${t})`).assign(ht.default.errors, (0, be._)`${ht.default.vErrors}.length`), (0,
|
|
4459
|
+
r.assign(ht.default.vErrors, (0, be._)`${ht.default.vErrors} === null ? ${t} : ${ht.default.vErrors}.concat(${t})`).assign(ht.default.errors, (0, be._)`${ht.default.vErrors}.length`), (0, Kc.extendErrors)(e);
|
|
4531
4460
|
}, () => e.error());
|
|
4532
4461
|
}
|
|
4533
|
-
function
|
|
4462
|
+
function Zc({ schemaEnv: e }, t) {
|
|
4534
4463
|
if (t.async && !e.$async)
|
|
4535
4464
|
throw new Error("async keyword in sync schema");
|
|
4536
4465
|
}
|
|
4537
|
-
function
|
|
4466
|
+
function oo(e, t, r) {
|
|
4538
4467
|
if (r === void 0)
|
|
4539
4468
|
throw new Error(`keyword "${t}" failed to compile`);
|
|
4540
4469
|
return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : { ref: r, code: (0, be.stringify)(r) });
|
|
4541
4470
|
}
|
|
4542
|
-
function
|
|
4471
|
+
function Xc(e, t, r = !1) {
|
|
4543
4472
|
return !t.length || t.some((n) => n === "array" ? Array.isArray(e) : n === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == n || r && typeof e > "u");
|
|
4544
4473
|
}
|
|
4545
|
-
|
|
4546
|
-
function
|
|
4474
|
+
We.validSchemaType = Xc;
|
|
4475
|
+
function el({ schema: e, opts: t, self: r, errSchemaPath: n }, s, i) {
|
|
4547
4476
|
if (Array.isArray(s.keyword) ? !s.keyword.includes(i) : s.keyword !== i)
|
|
4548
4477
|
throw new Error("ajv implementation error");
|
|
4549
4478
|
const o = s.dependencies;
|
|
@@ -4557,12 +4486,12 @@ function rl({ schema: e, opts: t, self: r, errSchemaPath: n }, s, i) {
|
|
|
4557
4486
|
throw new Error(d);
|
|
4558
4487
|
}
|
|
4559
4488
|
}
|
|
4560
|
-
|
|
4489
|
+
We.validateKeywordUsage = el;
|
|
4561
4490
|
var ot = {};
|
|
4562
4491
|
Object.defineProperty(ot, "__esModule", { value: !0 });
|
|
4563
4492
|
ot.extendSubschemaMode = ot.extendSubschemaData = ot.getSubschema = void 0;
|
|
4564
|
-
const Ve = G,
|
|
4565
|
-
function
|
|
4493
|
+
const Ve = G, ao = re;
|
|
4494
|
+
function tl(e, { keyword: t, schemaProp: r, schema: n, schemaPath: s, errSchemaPath: i, topSchemaRef: o }) {
|
|
4566
4495
|
if (t !== void 0 && n !== void 0)
|
|
4567
4496
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
4568
4497
|
if (t !== void 0) {
|
|
@@ -4574,7 +4503,7 @@ function nl(e, { keyword: t, schemaProp: r, schema: n, schemaPath: s, errSchemaP
|
|
|
4574
4503
|
} : {
|
|
4575
4504
|
schema: l[r],
|
|
4576
4505
|
schemaPath: (0, Ve._)`${e.schemaPath}${(0, Ve.getProperty)(t)}${(0, Ve.getProperty)(r)}`,
|
|
4577
|
-
errSchemaPath: `${e.errSchemaPath}/${t}/${(0,
|
|
4506
|
+
errSchemaPath: `${e.errSchemaPath}/${t}/${(0, ao.escapeFragment)(r)}`
|
|
4578
4507
|
};
|
|
4579
4508
|
}
|
|
4580
4509
|
if (n !== void 0) {
|
|
@@ -4589,14 +4518,14 @@ function nl(e, { keyword: t, schemaProp: r, schema: n, schemaPath: s, errSchemaP
|
|
|
4589
4518
|
}
|
|
4590
4519
|
throw new Error('either "keyword" or "schema" must be passed');
|
|
4591
4520
|
}
|
|
4592
|
-
ot.getSubschema =
|
|
4593
|
-
function
|
|
4521
|
+
ot.getSubschema = tl;
|
|
4522
|
+
function rl(e, t, { dataProp: r, dataPropType: n, data: s, dataTypes: i, propertyName: o }) {
|
|
4594
4523
|
if (s !== void 0 && r !== void 0)
|
|
4595
4524
|
throw new Error('both "data" and "dataProp" passed, only one allowed');
|
|
4596
4525
|
const { gen: l } = t;
|
|
4597
4526
|
if (r !== void 0) {
|
|
4598
4527
|
const { errorPath: u, dataPathArr: p, opts: h } = t, v = l.let("data", (0, Ve._)`${t.data}${(0, Ve.getProperty)(r)}`, !0);
|
|
4599
|
-
d(v), e.errorPath = (0, Ve.str)`${u}${(0,
|
|
4528
|
+
d(v), e.errorPath = (0, Ve.str)`${u}${(0, ao.getErrorPath)(r, n, h.jsPropertySyntax)}`, e.parentDataProperty = (0, Ve._)`${r}`, e.dataPathArr = [...p, e.parentDataProperty];
|
|
4600
4529
|
}
|
|
4601
4530
|
if (s !== void 0) {
|
|
4602
4531
|
const u = s instanceof Ve.Name ? s : l.let("data", s, !0);
|
|
@@ -4607,12 +4536,12 @@ function sl(e, t, { dataProp: r, dataPropType: n, data: s, dataTypes: i, propert
|
|
|
4607
4536
|
e.data = u, e.dataLevel = t.dataLevel + 1, e.dataTypes = [], t.definedProperties = /* @__PURE__ */ new Set(), e.parentData = t.data, e.dataNames = [...t.dataNames, u];
|
|
4608
4537
|
}
|
|
4609
4538
|
}
|
|
4610
|
-
ot.extendSubschemaData =
|
|
4611
|
-
function
|
|
4539
|
+
ot.extendSubschemaData = rl;
|
|
4540
|
+
function nl(e, { jtdDiscriminator: t, jtdMetadata: r, compositeRule: n, createErrors: s, allErrors: i }) {
|
|
4612
4541
|
n !== void 0 && (e.compositeRule = n), s !== void 0 && (e.createErrors = s), i !== void 0 && (e.allErrors = i), e.jtdDiscriminator = t, e.jtdMetadata = r;
|
|
4613
4542
|
}
|
|
4614
|
-
ot.extendSubschemaMode =
|
|
4615
|
-
var $e = {},
|
|
4543
|
+
ot.extendSubschemaMode = nl;
|
|
4544
|
+
var $e = {}, co = function e(t, r) {
|
|
4616
4545
|
if (t === r)
|
|
4617
4546
|
return !0;
|
|
4618
4547
|
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
@@ -4646,12 +4575,12 @@ var $e = {}, lo = function e(t, r) {
|
|
|
4646
4575
|
return !0;
|
|
4647
4576
|
}
|
|
4648
4577
|
return t !== t && r !== r;
|
|
4649
|
-
},
|
|
4578
|
+
}, lo = { exports: {} }, it = lo.exports = function(e, t, r) {
|
|
4650
4579
|
typeof t == "function" && (r = t, t = {}), r = t.cb || r;
|
|
4651
4580
|
var n = typeof r == "function" ? r : r.pre || function() {
|
|
4652
4581
|
}, s = r.post || function() {
|
|
4653
4582
|
};
|
|
4654
|
-
|
|
4583
|
+
qr(t, n, s, e, "", e);
|
|
4655
4584
|
};
|
|
4656
4585
|
it.keywords = {
|
|
4657
4586
|
additionalItems: !0,
|
|
@@ -4697,7 +4626,7 @@ it.skipKeywords = {
|
|
|
4697
4626
|
maxProperties: !0,
|
|
4698
4627
|
minProperties: !0
|
|
4699
4628
|
};
|
|
4700
|
-
function
|
|
4629
|
+
function qr(e, t, r, n, s, i, o, l, d, u) {
|
|
4701
4630
|
if (n && typeof n == "object" && !Array.isArray(n)) {
|
|
4702
4631
|
t(n, s, i, o, l, d, u);
|
|
4703
4632
|
for (var p in n) {
|
|
@@ -4705,24 +4634,24 @@ function Mr(e, t, r, n, s, i, o, l, d, u) {
|
|
|
4705
4634
|
if (Array.isArray(h)) {
|
|
4706
4635
|
if (p in it.arrayKeywords)
|
|
4707
4636
|
for (var v = 0; v < h.length; v++)
|
|
4708
|
-
|
|
4637
|
+
qr(e, t, r, h[v], s + "/" + p + "/" + v, i, s, p, n, v);
|
|
4709
4638
|
} else if (p in it.propsKeywords) {
|
|
4710
4639
|
if (h && typeof h == "object")
|
|
4711
4640
|
for (var T in h)
|
|
4712
|
-
|
|
4641
|
+
qr(e, t, r, h[T], s + "/" + p + "/" + sl(T), i, s, p, n, T);
|
|
4713
4642
|
} else
|
|
4714
|
-
(p in it.keywords || e.allKeys && !(p in it.skipKeywords)) &&
|
|
4643
|
+
(p in it.keywords || e.allKeys && !(p in it.skipKeywords)) && qr(e, t, r, h, s + "/" + p, i, s, p, n);
|
|
4715
4644
|
}
|
|
4716
4645
|
r(n, s, i, o, l, d, u);
|
|
4717
4646
|
}
|
|
4718
4647
|
}
|
|
4719
|
-
function
|
|
4648
|
+
function sl(e) {
|
|
4720
4649
|
return e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
4721
4650
|
}
|
|
4722
|
-
var
|
|
4651
|
+
var il = lo.exports;
|
|
4723
4652
|
Object.defineProperty($e, "__esModule", { value: !0 });
|
|
4724
4653
|
$e.getSchemaRefs = $e.resolveUrl = $e.normalizeId = $e._getFullPath = $e.getFullPath = $e.inlineRef = void 0;
|
|
4725
|
-
const
|
|
4654
|
+
const ol = re, al = co, cl = il, ll = /* @__PURE__ */ new Set([
|
|
4726
4655
|
"type",
|
|
4727
4656
|
"format",
|
|
4728
4657
|
"pattern",
|
|
@@ -4740,11 +4669,11 @@ const cl = re, ll = lo, ul = al, dl = /* @__PURE__ */ new Set([
|
|
|
4740
4669
|
"enum",
|
|
4741
4670
|
"const"
|
|
4742
4671
|
]);
|
|
4743
|
-
function
|
|
4744
|
-
return typeof e == "boolean" ? !0 : t === !0 ? !An(e) : t ?
|
|
4672
|
+
function ul(e, t = !0) {
|
|
4673
|
+
return typeof e == "boolean" ? !0 : t === !0 ? !An(e) : t ? uo(e) <= t : !1;
|
|
4745
4674
|
}
|
|
4746
|
-
$e.inlineRef =
|
|
4747
|
-
const
|
|
4675
|
+
$e.inlineRef = ul;
|
|
4676
|
+
const dl = /* @__PURE__ */ new Set([
|
|
4748
4677
|
"$ref",
|
|
4749
4678
|
"$recursiveRef",
|
|
4750
4679
|
"$recursiveAnchor",
|
|
@@ -4753,7 +4682,7 @@ const fl = /* @__PURE__ */ new Set([
|
|
|
4753
4682
|
]);
|
|
4754
4683
|
function An(e) {
|
|
4755
4684
|
for (const t in e) {
|
|
4756
|
-
if (
|
|
4685
|
+
if (dl.has(t))
|
|
4757
4686
|
return !0;
|
|
4758
4687
|
const r = e[t];
|
|
4759
4688
|
if (Array.isArray(r) && r.some(An) || typeof r == "object" && An(r))
|
|
@@ -4761,41 +4690,41 @@ function An(e) {
|
|
|
4761
4690
|
}
|
|
4762
4691
|
return !1;
|
|
4763
4692
|
}
|
|
4764
|
-
function
|
|
4693
|
+
function uo(e) {
|
|
4765
4694
|
let t = 0;
|
|
4766
4695
|
for (const r in e) {
|
|
4767
4696
|
if (r === "$ref")
|
|
4768
4697
|
return 1 / 0;
|
|
4769
|
-
if (t++, !
|
|
4698
|
+
if (t++, !ll.has(r) && (typeof e[r] == "object" && (0, ol.eachItem)(e[r], (n) => t += uo(n)), t === 1 / 0))
|
|
4770
4699
|
return 1 / 0;
|
|
4771
4700
|
}
|
|
4772
4701
|
return t;
|
|
4773
4702
|
}
|
|
4774
|
-
function
|
|
4703
|
+
function po(e, t = "", r) {
|
|
4775
4704
|
r !== !1 && (t = Lt(t));
|
|
4776
4705
|
const n = e.parse(t);
|
|
4777
|
-
return
|
|
4706
|
+
return fo(e, n);
|
|
4778
4707
|
}
|
|
4779
|
-
$e.getFullPath =
|
|
4780
|
-
function
|
|
4708
|
+
$e.getFullPath = po;
|
|
4709
|
+
function fo(e, t) {
|
|
4781
4710
|
return e.serialize(t).split("#")[0] + "#";
|
|
4782
4711
|
}
|
|
4783
|
-
$e._getFullPath =
|
|
4784
|
-
const
|
|
4712
|
+
$e._getFullPath = fo;
|
|
4713
|
+
const pl = /#\/?$/;
|
|
4785
4714
|
function Lt(e) {
|
|
4786
|
-
return e ? e.replace(
|
|
4715
|
+
return e ? e.replace(pl, "") : "";
|
|
4787
4716
|
}
|
|
4788
4717
|
$e.normalizeId = Lt;
|
|
4789
|
-
function
|
|
4718
|
+
function fl(e, t, r) {
|
|
4790
4719
|
return r = Lt(r), e.resolve(t, r);
|
|
4791
4720
|
}
|
|
4792
|
-
$e.resolveUrl =
|
|
4793
|
-
const
|
|
4794
|
-
function
|
|
4721
|
+
$e.resolveUrl = fl;
|
|
4722
|
+
const hl = /^[a-z_][-a-z0-9._]*$/i;
|
|
4723
|
+
function ml(e, t) {
|
|
4795
4724
|
if (typeof e == "boolean")
|
|
4796
4725
|
return {};
|
|
4797
|
-
const { schemaId: r, uriResolver: n } = this.opts, s = Lt(e[r] || t), i = { "": s }, o =
|
|
4798
|
-
return
|
|
4726
|
+
const { schemaId: r, uriResolver: n } = this.opts, s = Lt(e[r] || t), i = { "": s }, o = po(n, s, !1), l = {}, d = /* @__PURE__ */ new Set();
|
|
4727
|
+
return cl(e, { allKeys: !0 }, (h, v, T, w) => {
|
|
4799
4728
|
if (w === void 0)
|
|
4800
4729
|
return;
|
|
4801
4730
|
const R = o + v;
|
|
@@ -4811,54 +4740,54 @@ function gl(e, t) {
|
|
|
4811
4740
|
}
|
|
4812
4741
|
function k(O) {
|
|
4813
4742
|
if (typeof O == "string") {
|
|
4814
|
-
if (!
|
|
4743
|
+
if (!hl.test(O))
|
|
4815
4744
|
throw new Error(`invalid anchor "${O}"`);
|
|
4816
4745
|
g.call(this, `#${O}`);
|
|
4817
4746
|
}
|
|
4818
4747
|
}
|
|
4819
4748
|
}), l;
|
|
4820
4749
|
function u(h, v, T) {
|
|
4821
|
-
if (v !== void 0 && !
|
|
4750
|
+
if (v !== void 0 && !al(h, v))
|
|
4822
4751
|
throw p(T);
|
|
4823
4752
|
}
|
|
4824
4753
|
function p(h) {
|
|
4825
4754
|
return new Error(`reference "${h}" resolves to more than one schema`);
|
|
4826
4755
|
}
|
|
4827
4756
|
}
|
|
4828
|
-
$e.getSchemaRefs =
|
|
4757
|
+
$e.getSchemaRefs = ml;
|
|
4829
4758
|
Object.defineProperty(Ae, "__esModule", { value: !0 });
|
|
4830
4759
|
Ae.getData = Ae.KeywordCxt = Ae.validateFunctionCode = void 0;
|
|
4831
|
-
const
|
|
4832
|
-
function
|
|
4833
|
-
if (
|
|
4834
|
-
|
|
4760
|
+
const ho = Gt, ni = br, Kn = Qe, Wr = br, yl = gn, dr = We, Sn = ot, U = G, V = Ke, gl = $e, Ze = re, ar = vr;
|
|
4761
|
+
function $l(e) {
|
|
4762
|
+
if (go(e) && ($o(e), yo(e))) {
|
|
4763
|
+
vl(e);
|
|
4835
4764
|
return;
|
|
4836
4765
|
}
|
|
4837
|
-
|
|
4766
|
+
mo(e, () => (0, ho.topBoolOrEmptySchema)(e));
|
|
4838
4767
|
}
|
|
4839
|
-
Ae.validateFunctionCode =
|
|
4840
|
-
function
|
|
4768
|
+
Ae.validateFunctionCode = $l;
|
|
4769
|
+
function mo({ gen: e, validateName: t, schema: r, schemaEnv: n, opts: s }, i) {
|
|
4841
4770
|
s.code.es5 ? e.func(t, (0, U._)`${V.default.data}, ${V.default.valCxt}`, n.$async, () => {
|
|
4842
|
-
e.code((0, U._)`"use strict"; ${si(r, s)}`),
|
|
4843
|
-
}) : e.func(t, (0, U._)`${V.default.data}, ${
|
|
4771
|
+
e.code((0, U._)`"use strict"; ${si(r, s)}`), wl(e, s), e.code(i);
|
|
4772
|
+
}) : e.func(t, (0, U._)`${V.default.data}, ${_l(s)}`, n.$async, () => e.code(si(r, s)).code(i));
|
|
4844
4773
|
}
|
|
4845
|
-
function
|
|
4774
|
+
function _l(e) {
|
|
4846
4775
|
return (0, U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${e.dynamicRef ? (0, U._)`, ${V.default.dynamicAnchors}={}` : U.nil}}={}`;
|
|
4847
4776
|
}
|
|
4848
|
-
function
|
|
4777
|
+
function wl(e, t) {
|
|
4849
4778
|
e.if(V.default.valCxt, () => {
|
|
4850
4779
|
e.var(V.default.instancePath, (0, U._)`${V.default.valCxt}.${V.default.instancePath}`), e.var(V.default.parentData, (0, U._)`${V.default.valCxt}.${V.default.parentData}`), e.var(V.default.parentDataProperty, (0, U._)`${V.default.valCxt}.${V.default.parentDataProperty}`), e.var(V.default.rootData, (0, U._)`${V.default.valCxt}.${V.default.rootData}`), t.dynamicRef && e.var(V.default.dynamicAnchors, (0, U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`);
|
|
4851
4780
|
}, () => {
|
|
4852
4781
|
e.var(V.default.instancePath, (0, U._)`""`), e.var(V.default.parentData, (0, U._)`undefined`), e.var(V.default.parentDataProperty, (0, U._)`undefined`), e.var(V.default.rootData, V.default.data), t.dynamicRef && e.var(V.default.dynamicAnchors, (0, U._)`{}`);
|
|
4853
4782
|
});
|
|
4854
4783
|
}
|
|
4855
|
-
function
|
|
4784
|
+
function vl(e) {
|
|
4856
4785
|
const { schema: t, opts: r, gen: n } = e;
|
|
4857
|
-
|
|
4858
|
-
r.$comment && t.$comment &&
|
|
4786
|
+
mo(e, () => {
|
|
4787
|
+
r.$comment && t.$comment && wo(e), Tl(e), n.let(V.default.vErrors, null), n.let(V.default.errors, 0), r.unevaluated && bl(e), _o(e), Ol(e);
|
|
4859
4788
|
});
|
|
4860
4789
|
}
|
|
4861
|
-
function
|
|
4790
|
+
function bl(e) {
|
|
4862
4791
|
const { gen: t, validateName: r } = e;
|
|
4863
4792
|
e.evaluated = t.const("evaluated", (0, U._)`${r}.evaluated`), t.if((0, U._)`${e.evaluated}.dynamicProps`, () => t.assign((0, U._)`${e.evaluated}.props`, (0, U._)`undefined`)), t.if((0, U._)`${e.evaluated}.dynamicItems`, () => t.assign((0, U._)`${e.evaluated}.items`, (0, U._)`undefined`));
|
|
4864
4793
|
}
|
|
@@ -4866,14 +4795,14 @@ function si(e, t) {
|
|
|
4866
4795
|
const r = typeof e == "object" && e[t.schemaId];
|
|
4867
4796
|
return r && (t.code.source || t.code.process) ? (0, U._)`/*# sourceURL=${r} */` : U.nil;
|
|
4868
4797
|
}
|
|
4869
|
-
function
|
|
4870
|
-
if (
|
|
4871
|
-
|
|
4798
|
+
function Pl(e, t) {
|
|
4799
|
+
if (go(e) && ($o(e), yo(e))) {
|
|
4800
|
+
El(e, t);
|
|
4872
4801
|
return;
|
|
4873
4802
|
}
|
|
4874
|
-
(0,
|
|
4803
|
+
(0, ho.boolOrEmptySchema)(e, t);
|
|
4875
4804
|
}
|
|
4876
|
-
function
|
|
4805
|
+
function yo({ schema: e, self: t }) {
|
|
4877
4806
|
if (typeof e == "boolean")
|
|
4878
4807
|
return !e;
|
|
4879
4808
|
for (const r in e)
|
|
@@ -4881,41 +4810,41 @@ function go({ schema: e, self: t }) {
|
|
|
4881
4810
|
return !0;
|
|
4882
4811
|
return !1;
|
|
4883
4812
|
}
|
|
4884
|
-
function
|
|
4813
|
+
function go(e) {
|
|
4885
4814
|
return typeof e.schema != "boolean";
|
|
4886
4815
|
}
|
|
4887
|
-
function
|
|
4816
|
+
function El(e, t) {
|
|
4888
4817
|
const { schema: r, gen: n, opts: s } = e;
|
|
4889
|
-
s.$comment && r.$comment &&
|
|
4818
|
+
s.$comment && r.$comment && wo(e), Rl(e), kl(e);
|
|
4890
4819
|
const i = n.const("_errs", V.default.errors);
|
|
4891
|
-
|
|
4820
|
+
_o(e, i), n.var(t, (0, U._)`${i} === ${V.default.errors}`);
|
|
4892
4821
|
}
|
|
4893
|
-
function
|
|
4894
|
-
(0, Ze.checkUnknownRules)(e),
|
|
4822
|
+
function $o(e) {
|
|
4823
|
+
(0, Ze.checkUnknownRules)(e), Sl(e);
|
|
4895
4824
|
}
|
|
4896
|
-
function
|
|
4825
|
+
function _o(e, t) {
|
|
4897
4826
|
if (e.opts.jtd)
|
|
4898
4827
|
return ii(e, [], !1, t);
|
|
4899
4828
|
const r = (0, ni.getSchemaTypes)(e.schema), n = (0, ni.coerceAndCheckDataType)(e, r);
|
|
4900
4829
|
ii(e, r, !n, t);
|
|
4901
4830
|
}
|
|
4902
|
-
function
|
|
4831
|
+
function Sl(e) {
|
|
4903
4832
|
const { schema: t, errSchemaPath: r, opts: n, self: s } = e;
|
|
4904
4833
|
t.$ref && n.ignoreKeywordsWithRef && (0, Ze.schemaHasRulesButRef)(t, s.RULES) && s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`);
|
|
4905
4834
|
}
|
|
4906
|
-
function
|
|
4835
|
+
function Tl(e) {
|
|
4907
4836
|
const { schema: t, opts: r } = e;
|
|
4908
4837
|
t.default !== void 0 && r.useDefaults && r.strictSchema && (0, Ze.checkStrictMode)(e, "default is ignored in the schema root");
|
|
4909
4838
|
}
|
|
4910
|
-
function
|
|
4839
|
+
function Rl(e) {
|
|
4911
4840
|
const t = e.schema[e.opts.schemaId];
|
|
4912
|
-
t && (e.baseId = (0,
|
|
4841
|
+
t && (e.baseId = (0, gl.resolveUrl)(e.opts.uriResolver, e.baseId, t));
|
|
4913
4842
|
}
|
|
4914
|
-
function
|
|
4843
|
+
function kl(e) {
|
|
4915
4844
|
if (e.schema.$async && !e.schemaEnv.$async)
|
|
4916
4845
|
throw new Error("async schema in sync schema");
|
|
4917
4846
|
}
|
|
4918
|
-
function
|
|
4847
|
+
function wo({ gen: e, schemaEnv: t, schema: r, errSchemaPath: n, opts: s }) {
|
|
4919
4848
|
const i = r.$comment;
|
|
4920
4849
|
if (s.$comment === !0)
|
|
4921
4850
|
e.code((0, U._)`${V.default.self}.logger.log(${i})`);
|
|
@@ -4924,20 +4853,20 @@ function vo({ gen: e, schemaEnv: t, schema: r, errSchemaPath: n, opts: s }) {
|
|
|
4924
4853
|
e.code((0, U._)`${V.default.self}.opts.$comment(${i}, ${o}, ${l}.schema)`);
|
|
4925
4854
|
}
|
|
4926
4855
|
}
|
|
4927
|
-
function
|
|
4856
|
+
function Ol(e) {
|
|
4928
4857
|
const { gen: t, schemaEnv: r, validateName: n, ValidationError: s, opts: i } = e;
|
|
4929
|
-
r.$async ? t.if((0, U._)`${V.default.errors} === 0`, () => t.return(V.default.data), () => t.throw((0, U._)`new ${s}(${V.default.vErrors})`)) : (t.assign((0, U._)`${n}.errors`, V.default.vErrors), i.unevaluated &&
|
|
4858
|
+
r.$async ? t.if((0, U._)`${V.default.errors} === 0`, () => t.return(V.default.data), () => t.throw((0, U._)`new ${s}(${V.default.vErrors})`)) : (t.assign((0, U._)`${n}.errors`, V.default.vErrors), i.unevaluated && Cl(e), t.return((0, U._)`${V.default.errors} === 0`));
|
|
4930
4859
|
}
|
|
4931
|
-
function
|
|
4860
|
+
function Cl({ gen: e, evaluated: t, props: r, items: n }) {
|
|
4932
4861
|
r instanceof U.Name && e.assign((0, U._)`${t}.props`, r), n instanceof U.Name && e.assign((0, U._)`${t}.items`, n);
|
|
4933
4862
|
}
|
|
4934
4863
|
function ii(e, t, r, n) {
|
|
4935
4864
|
const { gen: s, schema: i, data: o, allErrors: l, opts: d, self: u } = e, { RULES: p } = u;
|
|
4936
4865
|
if (i.$ref && (d.ignoreKeywordsWithRef || !(0, Ze.schemaHasRulesButRef)(i, p))) {
|
|
4937
|
-
s.block(() =>
|
|
4866
|
+
s.block(() => Po(e, "$ref", p.all.$ref.definition));
|
|
4938
4867
|
return;
|
|
4939
4868
|
}
|
|
4940
|
-
d.jtd ||
|
|
4869
|
+
d.jtd || Nl(e, t), s.block(() => {
|
|
4941
4870
|
for (const v of p.rules)
|
|
4942
4871
|
h(v);
|
|
4943
4872
|
h(p.post);
|
|
@@ -4948,58 +4877,58 @@ function ii(e, t, r, n) {
|
|
|
4948
4877
|
}
|
|
4949
4878
|
function oi(e, t) {
|
|
4950
4879
|
const { gen: r, schema: n, opts: { useDefaults: s } } = e;
|
|
4951
|
-
s && (0,
|
|
4880
|
+
s && (0, yl.assignDefaults)(e, t.type), r.block(() => {
|
|
4952
4881
|
for (const i of t.rules)
|
|
4953
|
-
(0, Kn.shouldUseRule)(n, i) &&
|
|
4882
|
+
(0, Kn.shouldUseRule)(n, i) && Po(e, i.keyword, i.definition, t.type);
|
|
4954
4883
|
});
|
|
4955
4884
|
}
|
|
4956
|
-
function
|
|
4957
|
-
e.schemaEnv.meta || !e.opts.strictTypes || (
|
|
4885
|
+
function Nl(e, t) {
|
|
4886
|
+
e.schemaEnv.meta || !e.opts.strictTypes || (jl(e, t), e.opts.allowUnionTypes || Il(e, t), Al(e, e.dataTypes));
|
|
4958
4887
|
}
|
|
4959
|
-
function
|
|
4888
|
+
function jl(e, t) {
|
|
4960
4889
|
if (t.length) {
|
|
4961
4890
|
if (!e.dataTypes.length) {
|
|
4962
4891
|
e.dataTypes = t;
|
|
4963
4892
|
return;
|
|
4964
4893
|
}
|
|
4965
4894
|
t.forEach((r) => {
|
|
4966
|
-
|
|
4967
|
-
}),
|
|
4895
|
+
vo(e.dataTypes, r) || Jn(e, `type "${r}" not allowed by context "${e.dataTypes.join(",")}"`);
|
|
4896
|
+
}), Fl(e, t);
|
|
4968
4897
|
}
|
|
4969
4898
|
}
|
|
4970
|
-
function
|
|
4899
|
+
function Il(e, t) {
|
|
4971
4900
|
t.length > 1 && !(t.length === 2 && t.includes("null")) && Jn(e, "use allowUnionTypes to allow union type keyword");
|
|
4972
4901
|
}
|
|
4973
|
-
function
|
|
4902
|
+
function Al(e, t) {
|
|
4974
4903
|
const r = e.self.RULES.all;
|
|
4975
4904
|
for (const n in r) {
|
|
4976
4905
|
const s = r[n];
|
|
4977
4906
|
if (typeof s == "object" && (0, Kn.shouldUseRule)(e.schema, s)) {
|
|
4978
4907
|
const { type: i } = s.definition;
|
|
4979
|
-
i.length && !i.some((o) =>
|
|
4908
|
+
i.length && !i.some((o) => Dl(t, o)) && Jn(e, `missing type "${i.join(",")}" for keyword "${n}"`);
|
|
4980
4909
|
}
|
|
4981
4910
|
}
|
|
4982
4911
|
}
|
|
4983
|
-
function
|
|
4912
|
+
function Dl(e, t) {
|
|
4984
4913
|
return e.includes(t) || t === "number" && e.includes("integer");
|
|
4985
4914
|
}
|
|
4986
|
-
function
|
|
4915
|
+
function vo(e, t) {
|
|
4987
4916
|
return e.includes(t) || t === "integer" && e.includes("number");
|
|
4988
4917
|
}
|
|
4989
|
-
function
|
|
4918
|
+
function Fl(e, t) {
|
|
4990
4919
|
const r = [];
|
|
4991
4920
|
for (const n of e.dataTypes)
|
|
4992
|
-
|
|
4921
|
+
vo(t, n) ? r.push(n) : t.includes("integer") && n === "number" && r.push("integer");
|
|
4993
4922
|
e.dataTypes = r;
|
|
4994
4923
|
}
|
|
4995
4924
|
function Jn(e, t) {
|
|
4996
4925
|
const r = e.schemaEnv.baseId + e.errSchemaPath;
|
|
4997
4926
|
t += ` at "${r}" (strictTypes)`, (0, Ze.checkStrictMode)(e, t, e.opts.strictTypes);
|
|
4998
4927
|
}
|
|
4999
|
-
class
|
|
4928
|
+
class bo {
|
|
5000
4929
|
constructor(t, r, n) {
|
|
5001
4930
|
if ((0, dr.validateKeywordUsage)(t, r, n), this.gen = t.gen, this.allErrors = t.allErrors, this.keyword = n, this.data = t.data, this.schema = t.schema[n], this.$data = r.$data && t.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, Ze.schemaRefOrVal)(t, this.schema, n, this.$data), this.schemaType = r.schemaType, this.parentSchema = t.schema, this.params = {}, this.it = t, this.def = r, this.$data)
|
|
5002
|
-
this.schemaCode = t.gen.const("vSchema",
|
|
4931
|
+
this.schemaCode = t.gen.const("vSchema", Eo(this.$data, t));
|
|
5003
4932
|
else if (this.schemaCode = this.schemaValue, !(0, dr.validSchemaType)(this.schema, r.schemaType, r.allowUndefined))
|
|
5004
4933
|
throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);
|
|
5005
4934
|
("code" in r ? r.trackErrors : r.errors !== !1) && (this.errsCount = t.gen.const("_errs", V.default.errors));
|
|
@@ -5085,7 +5014,7 @@ class Po {
|
|
|
5085
5014
|
const n = (0, Sn.getSubschema)(this.it, t);
|
|
5086
5015
|
(0, Sn.extendSubschemaData)(n, this.it, t), (0, Sn.extendSubschemaMode)(n, t);
|
|
5087
5016
|
const s = { ...this.it, ...n, items: void 0, props: void 0 };
|
|
5088
|
-
return
|
|
5017
|
+
return Pl(s, r), s;
|
|
5089
5018
|
}
|
|
5090
5019
|
mergeEvaluated(t, r) {
|
|
5091
5020
|
const { it: n, gen: s } = this;
|
|
@@ -5097,22 +5026,22 @@ class Po {
|
|
|
5097
5026
|
return s.if(r, () => this.mergeEvaluated(t, U.Name)), !0;
|
|
5098
5027
|
}
|
|
5099
5028
|
}
|
|
5100
|
-
Ae.KeywordCxt =
|
|
5101
|
-
function
|
|
5102
|
-
const s = new
|
|
5029
|
+
Ae.KeywordCxt = bo;
|
|
5030
|
+
function Po(e, t, r, n) {
|
|
5031
|
+
const s = new bo(e, r, t);
|
|
5103
5032
|
"code" in r ? r.code(s, n) : s.$data && r.validate ? (0, dr.funcKeywordCode)(s, r) : "macro" in r ? (0, dr.macroKeywordCode)(s, r) : (r.compile || r.validate) && (0, dr.funcKeywordCode)(s, r);
|
|
5104
5033
|
}
|
|
5105
|
-
const
|
|
5106
|
-
function
|
|
5034
|
+
const ql = /^\/(?:[^~]|~0|~1)*$/, Ml = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
5035
|
+
function Eo(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
|
|
5107
5036
|
let s, i;
|
|
5108
5037
|
if (e === "")
|
|
5109
5038
|
return V.default.rootData;
|
|
5110
5039
|
if (e[0] === "/") {
|
|
5111
|
-
if (!
|
|
5040
|
+
if (!ql.test(e))
|
|
5112
5041
|
throw new Error(`Invalid JSON-pointer: ${e}`);
|
|
5113
5042
|
s = e, i = V.default.rootData;
|
|
5114
5043
|
} else {
|
|
5115
|
-
const u =
|
|
5044
|
+
const u = Ml.exec(e);
|
|
5116
5045
|
if (!u)
|
|
5117
5046
|
throw new Error(`Invalid JSON-pointer: ${e}`);
|
|
5118
5047
|
const p = +u[1];
|
|
@@ -5135,29 +5064,29 @@ function So(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
|
|
|
5135
5064
|
return `Cannot access ${u} ${p} levels up, current level is ${t}`;
|
|
5136
5065
|
}
|
|
5137
5066
|
}
|
|
5138
|
-
Ae.getData =
|
|
5067
|
+
Ae.getData = Eo;
|
|
5139
5068
|
var Pr = {};
|
|
5140
5069
|
Object.defineProperty(Pr, "__esModule", { value: !0 });
|
|
5141
|
-
class
|
|
5070
|
+
class Ul extends Error {
|
|
5142
5071
|
constructor(t) {
|
|
5143
5072
|
super("validation failed"), this.errors = t, this.ajv = this.validation = !0;
|
|
5144
5073
|
}
|
|
5145
5074
|
}
|
|
5146
|
-
Pr.default =
|
|
5075
|
+
Pr.default = Ul;
|
|
5147
5076
|
var Er = {};
|
|
5148
5077
|
Object.defineProperty(Er, "__esModule", { value: !0 });
|
|
5149
5078
|
const Tn = $e;
|
|
5150
|
-
class
|
|
5079
|
+
class Ll extends Error {
|
|
5151
5080
|
constructor(t, r, n, s) {
|
|
5152
5081
|
super(s || `can't resolve reference ${n} from id ${r}`), this.missingRef = (0, Tn.resolveUrl)(t, r, n), this.missingSchema = (0, Tn.normalizeId)((0, Tn.getFullPath)(t, this.missingRef));
|
|
5153
5082
|
}
|
|
5154
5083
|
}
|
|
5155
|
-
Er.default =
|
|
5084
|
+
Er.default = Ll;
|
|
5156
5085
|
var Se = {};
|
|
5157
5086
|
Object.defineProperty(Se, "__esModule", { value: !0 });
|
|
5158
5087
|
Se.resolveSchema = Se.getCompilingSchema = Se.resolveRef = Se.compileSchema = Se.SchemaEnv = void 0;
|
|
5159
|
-
const Ne = G,
|
|
5160
|
-
class
|
|
5088
|
+
const Ne = G, Hl = Pr, ft = Ke, Ie = $e, ai = re, zl = Ae;
|
|
5089
|
+
class $n {
|
|
5161
5090
|
constructor(t) {
|
|
5162
5091
|
var r;
|
|
5163
5092
|
this.refs = {}, this.dynamicAnchors = {};
|
|
@@ -5165,15 +5094,15 @@ class _n {
|
|
|
5165
5094
|
typeof t.schema == "object" && (n = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (r = t.baseId) !== null && r !== void 0 ? r : (0, Ie.normalizeId)(n == null ? void 0 : n[t.schemaId || "$id"]), this.schemaPath = t.schemaPath, this.localRefs = t.localRefs, this.meta = t.meta, this.$async = n == null ? void 0 : n.$async, this.refs = {};
|
|
5166
5095
|
}
|
|
5167
5096
|
}
|
|
5168
|
-
Se.SchemaEnv =
|
|
5097
|
+
Se.SchemaEnv = $n;
|
|
5169
5098
|
function Yn(e) {
|
|
5170
|
-
const t =
|
|
5099
|
+
const t = So.call(this, e);
|
|
5171
5100
|
if (t)
|
|
5172
5101
|
return t;
|
|
5173
5102
|
const r = (0, Ie.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: n, lines: s } = this.opts.code, { ownProperties: i } = this.opts, o = new Ne.CodeGen(this.scope, { es5: n, lines: s, ownProperties: i });
|
|
5174
5103
|
let l;
|
|
5175
5104
|
e.$async && (l = o.scopeValue("Error", {
|
|
5176
|
-
ref:
|
|
5105
|
+
ref: Hl.default,
|
|
5177
5106
|
code: (0, Ne._)`require("ajv/dist/runtime/validation_error").default`
|
|
5178
5107
|
}));
|
|
5179
5108
|
const d = o.scopeName("validate");
|
|
@@ -5204,7 +5133,7 @@ function Yn(e) {
|
|
|
5204
5133
|
};
|
|
5205
5134
|
let p;
|
|
5206
5135
|
try {
|
|
5207
|
-
this._compilations.add(e), (0,
|
|
5136
|
+
this._compilations.add(e), (0, zl.validateFunctionCode)(u), o.optimize(this.opts.code.optimize);
|
|
5208
5137
|
const h = o.toString();
|
|
5209
5138
|
p = `${o.scopeRefs(ft.default.scope)}return ${h}`, this.opts.code.process && (p = this.opts.code.process(p, e));
|
|
5210
5139
|
const T = new Function(`${ft.default.self}`, `${ft.default.scope}`, p)(this, this.scope.get());
|
|
@@ -5225,59 +5154,59 @@ function Yn(e) {
|
|
|
5225
5154
|
}
|
|
5226
5155
|
}
|
|
5227
5156
|
Se.compileSchema = Yn;
|
|
5228
|
-
function
|
|
5157
|
+
function Vl(e, t, r) {
|
|
5229
5158
|
var n;
|
|
5230
5159
|
r = (0, Ie.resolveUrl)(this.opts.uriResolver, t, r);
|
|
5231
5160
|
const s = e.refs[r];
|
|
5232
5161
|
if (s)
|
|
5233
5162
|
return s;
|
|
5234
|
-
let i =
|
|
5163
|
+
let i = Bl.call(this, e, r);
|
|
5235
5164
|
if (i === void 0) {
|
|
5236
5165
|
const o = (n = e.localRefs) === null || n === void 0 ? void 0 : n[r], { schemaId: l } = this.opts;
|
|
5237
|
-
o && (i = new
|
|
5166
|
+
o && (i = new $n({ schema: o, schemaId: l, root: e, baseId: t }));
|
|
5238
5167
|
}
|
|
5239
5168
|
if (i !== void 0)
|
|
5240
|
-
return e.refs[r] =
|
|
5169
|
+
return e.refs[r] = Wl.call(this, i);
|
|
5241
5170
|
}
|
|
5242
|
-
Se.resolveRef =
|
|
5243
|
-
function
|
|
5171
|
+
Se.resolveRef = Vl;
|
|
5172
|
+
function Wl(e) {
|
|
5244
5173
|
return (0, Ie.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : Yn.call(this, e);
|
|
5245
5174
|
}
|
|
5246
|
-
function
|
|
5175
|
+
function So(e) {
|
|
5247
5176
|
for (const t of this._compilations)
|
|
5248
|
-
if (
|
|
5177
|
+
if (xl(t, e))
|
|
5249
5178
|
return t;
|
|
5250
5179
|
}
|
|
5251
|
-
Se.getCompilingSchema =
|
|
5252
|
-
function
|
|
5180
|
+
Se.getCompilingSchema = So;
|
|
5181
|
+
function xl(e, t) {
|
|
5253
5182
|
return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
|
|
5254
5183
|
}
|
|
5255
|
-
function
|
|
5184
|
+
function Bl(e, t) {
|
|
5256
5185
|
let r;
|
|
5257
5186
|
for (; typeof (r = this.refs[t]) == "string"; )
|
|
5258
5187
|
t = r;
|
|
5259
|
-
return r || this.schemas[t] ||
|
|
5188
|
+
return r || this.schemas[t] || _n.call(this, e, t);
|
|
5260
5189
|
}
|
|
5261
|
-
function
|
|
5190
|
+
function _n(e, t) {
|
|
5262
5191
|
const r = this.opts.uriResolver.parse(t), n = (0, Ie._getFullPath)(this.opts.uriResolver, r);
|
|
5263
5192
|
let s = (0, Ie.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
|
|
5264
5193
|
if (Object.keys(e.schema).length > 0 && n === s)
|
|
5265
5194
|
return Rn.call(this, r, e);
|
|
5266
5195
|
const i = (0, Ie.normalizeId)(n), o = this.refs[i] || this.schemas[i];
|
|
5267
5196
|
if (typeof o == "string") {
|
|
5268
|
-
const l =
|
|
5197
|
+
const l = _n.call(this, e, o);
|
|
5269
5198
|
return typeof (l == null ? void 0 : l.schema) != "object" ? void 0 : Rn.call(this, r, l);
|
|
5270
5199
|
}
|
|
5271
5200
|
if (typeof (o == null ? void 0 : o.schema) == "object") {
|
|
5272
5201
|
if (o.validate || Yn.call(this, o), i === (0, Ie.normalizeId)(t)) {
|
|
5273
5202
|
const { schema: l } = o, { schemaId: d } = this.opts, u = l[d];
|
|
5274
|
-
return u && (s = (0, Ie.resolveUrl)(this.opts.uriResolver, s, u)), new
|
|
5203
|
+
return u && (s = (0, Ie.resolveUrl)(this.opts.uriResolver, s, u)), new $n({ schema: l, schemaId: d, root: e, baseId: s });
|
|
5275
5204
|
}
|
|
5276
5205
|
return Rn.call(this, r, o);
|
|
5277
5206
|
}
|
|
5278
5207
|
}
|
|
5279
|
-
Se.resolveSchema =
|
|
5280
|
-
const
|
|
5208
|
+
Se.resolveSchema = _n;
|
|
5209
|
+
const Gl = /* @__PURE__ */ new Set([
|
|
5281
5210
|
"properties",
|
|
5282
5211
|
"patternProperties",
|
|
5283
5212
|
"enum",
|
|
@@ -5296,20 +5225,20 @@ function Rn(e, { baseId: t, schema: r, root: n }) {
|
|
|
5296
5225
|
return;
|
|
5297
5226
|
r = d;
|
|
5298
5227
|
const u = typeof r == "object" && r[this.opts.schemaId];
|
|
5299
|
-
!
|
|
5228
|
+
!Gl.has(l) && u && (t = (0, Ie.resolveUrl)(this.opts.uriResolver, t, u));
|
|
5300
5229
|
}
|
|
5301
5230
|
let i;
|
|
5302
5231
|
if (typeof r != "boolean" && r.$ref && !(0, ai.schemaHasRulesButRef)(r, this.RULES)) {
|
|
5303
5232
|
const l = (0, Ie.resolveUrl)(this.opts.uriResolver, t, r.$ref);
|
|
5304
|
-
i =
|
|
5233
|
+
i = _n.call(this, n, l);
|
|
5305
5234
|
}
|
|
5306
5235
|
const { schemaId: o } = this.opts;
|
|
5307
|
-
if (i = i || new
|
|
5236
|
+
if (i = i || new $n({ schema: r, schemaId: o, root: n, baseId: t }), i.schema !== i.root.schema)
|
|
5308
5237
|
return i;
|
|
5309
5238
|
}
|
|
5310
|
-
const
|
|
5239
|
+
const Kl = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", Jl = "Meta-schema for $data reference (JSON AnySchema extension proposal)", Yl = "object", Ql = [
|
|
5311
5240
|
"$data"
|
|
5312
|
-
],
|
|
5241
|
+
], Zl = {
|
|
5313
5242
|
$data: {
|
|
5314
5243
|
type: "string",
|
|
5315
5244
|
anyOf: [
|
|
@@ -5321,20 +5250,20 @@ const Yl = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/
|
|
|
5321
5250
|
}
|
|
5322
5251
|
]
|
|
5323
5252
|
}
|
|
5324
|
-
},
|
|
5325
|
-
$id:
|
|
5326
|
-
description:
|
|
5327
|
-
type:
|
|
5328
|
-
required:
|
|
5329
|
-
properties:
|
|
5330
|
-
additionalProperties:
|
|
5253
|
+
}, Xl = !1, eu = {
|
|
5254
|
+
$id: Kl,
|
|
5255
|
+
description: Jl,
|
|
5256
|
+
type: Yl,
|
|
5257
|
+
required: Ql,
|
|
5258
|
+
properties: Zl,
|
|
5259
|
+
additionalProperties: Xl
|
|
5331
5260
|
};
|
|
5332
5261
|
var Qn = {}, Dn = { exports: {} };
|
|
5333
5262
|
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
5334
5263
|
(function(e, t) {
|
|
5335
5264
|
(function(r, n) {
|
|
5336
5265
|
n(t);
|
|
5337
|
-
})(
|
|
5266
|
+
})(wc, function(r) {
|
|
5338
5267
|
function n() {
|
|
5339
5268
|
for (var f = arguments.length, c = Array(f), y = 0; y < f; y++)
|
|
5340
5269
|
c[y] = arguments[y];
|
|
@@ -5368,7 +5297,7 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5368
5297
|
function u(f) {
|
|
5369
5298
|
var c = "[A-Za-z]", y = "[0-9]", S = n(y, "[A-Fa-f]"), E = s(s("%[EFef]" + S + "%" + S + S + "%" + S + S) + "|" + s("%[89A-Fa-f]" + S + "%" + S + S) + "|" + s("%" + S + S)), L = "[\\:\\/\\?\\#\\[\\]\\@]", H = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", X = n(L, H), se = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", ue = f ? "[\\uE000-\\uF8FF]" : "[]", Y = n(c, y, "[\\-\\.\\_\\~]", se);
|
|
5370
5299
|
s(c + n(c, y, "[\\+\\-\\.]") + "*"), s(s(E + "|" + n(Y, H, "[\\:]")) + "*");
|
|
5371
|
-
var ne = s(s("25[0-5]") + "|" + s("2[0-4]" + y) + "|" + s("1" + y + y) + "|" + s("0?[1-9]" + y) + "|0?0?" + y), de = s(ne + "\\." + ne + "\\." + ne + "\\." + ne),
|
|
5300
|
+
var ne = s(s("25[0-5]") + "|" + s("2[0-4]" + y) + "|" + s("1" + y + y) + "|" + s("0?[1-9]" + y) + "|0?0?" + y), de = s(ne + "\\." + ne + "\\." + ne + "\\." + ne), x = s(S + "{1,4}"), oe = s(s(x + "\\:" + x) + "|" + de), me = s(s(x + "\\:") + "{6}" + oe), ae = s("\\:\\:" + s(x + "\\:") + "{5}" + oe), Xe = s(s(x) + "?\\:\\:" + s(x + "\\:") + "{4}" + oe), Me = s(s(s(x + "\\:") + "{0,1}" + x) + "?\\:\\:" + s(x + "\\:") + "{3}" + oe), Ue = s(s(s(x + "\\:") + "{0,2}" + x) + "?\\:\\:" + s(x + "\\:") + "{2}" + oe), At = s(s(s(x + "\\:") + "{0,3}" + x) + "?\\:\\:" + x + "\\:" + oe), dt = s(s(s(x + "\\:") + "{0,4}" + x) + "?\\:\\:" + oe), Oe = s(s(s(x + "\\:") + "{0,5}" + x) + "?\\:\\:" + x), Le = s(s(s(x + "\\:") + "{0,6}" + x) + "?\\:\\:"), pt = s([me, ae, Xe, Me, Ue, At, dt, Oe, Le].join("|")), Je = s(s(Y + "|" + E) + "+");
|
|
5372
5301
|
s("[vV]" + S + "+\\." + n(Y, H, "[\\:]") + "+"), s(s(E + "|" + n(Y, H)) + "*");
|
|
5373
5302
|
var ir = s(E + "|" + n(Y, H, "[\\:\\@]"));
|
|
5374
5303
|
return s(s(E + "|" + n(Y, H, "[\\@]")) + "+"), s(s(ir + "|" + n("[\\/\\?]", ue)) + "*"), {
|
|
@@ -5420,7 +5349,7 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5420
5349
|
return y;
|
|
5421
5350
|
} else
|
|
5422
5351
|
return Array.from(f);
|
|
5423
|
-
}, w = 2147483647, R = 36, _ = 1, g = 26, k = 38, O = 700, j = 72, D = 128, b = "-", C = /^xn--/, A = /[^\0-\x7E]/,
|
|
5352
|
+
}, w = 2147483647, R = 36, _ = 1, g = 26, k = 38, O = 700, j = 72, D = 128, b = "-", C = /^xn--/, A = /[^\0-\x7E]/, W = /[\x2E\u3002\uFF0E\uFF61]/g, K = {
|
|
5424
5353
|
overflow: "Overflow: input needs wider integers to process",
|
|
5425
5354
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
5426
5355
|
"invalid-input": "Invalid input"
|
|
@@ -5435,7 +5364,7 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5435
5364
|
}
|
|
5436
5365
|
function ct(f, c) {
|
|
5437
5366
|
var y = f.split("@"), S = "";
|
|
5438
|
-
y.length > 1 && (S = y[0] + "@", f = y[1]), f = f.replace(
|
|
5367
|
+
y.length > 1 && (S = y[0] + "@", f = y[1]), f = f.replace(W, ".");
|
|
5439
5368
|
var E = f.split("."), L = at(E, c).join(".");
|
|
5440
5369
|
return S + L;
|
|
5441
5370
|
}
|
|
@@ -5479,10 +5408,10 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5479
5408
|
de += R
|
|
5480
5409
|
) {
|
|
5481
5410
|
ue >= S && he("invalid-input");
|
|
5482
|
-
var
|
|
5483
|
-
(
|
|
5411
|
+
var x = Rt(c.charCodeAt(ue++));
|
|
5412
|
+
(x >= R || x > Z((w - E) / ne)) && he("overflow"), E += x * ne;
|
|
5484
5413
|
var oe = de <= H ? _ : de >= H + g ? g : de - H;
|
|
5485
|
-
if (
|
|
5414
|
+
if (x < oe)
|
|
5486
5415
|
break;
|
|
5487
5416
|
var me = R - oe;
|
|
5488
5417
|
ne > Z(w / me) && he("overflow"), ne *= me;
|
|
@@ -5510,8 +5439,8 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5510
5439
|
throw ue;
|
|
5511
5440
|
}
|
|
5512
5441
|
}
|
|
5513
|
-
var
|
|
5514
|
-
for (
|
|
5442
|
+
var x = y.length, oe = x;
|
|
5443
|
+
for (x && y.push(b); oe < S; ) {
|
|
5515
5444
|
var me = w, ae = !0, Xe = !1, Me = void 0;
|
|
5516
5445
|
try {
|
|
5517
5446
|
for (var Ue = c[Symbol.iterator](), At; !(ae = (At = Ue.next()).done); ae = !0) {
|
|
@@ -5547,7 +5476,7 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5547
5476
|
var Hs = Rr - Or, zs = R - Or;
|
|
5548
5477
|
y.push(Re(F(Or + Hs % zs, 0))), Rr = Z(Hs / zs);
|
|
5549
5478
|
}
|
|
5550
|
-
y.push(Re(F(Rr, 0))), H = $(L, Oe, oe ==
|
|
5479
|
+
y.push(Re(F(Rr, 0))), H = $(L, Oe, oe == x), L = 0, ++oe;
|
|
5551
5480
|
}
|
|
5552
5481
|
}
|
|
5553
5482
|
} catch (or) {
|
|
@@ -5639,9 +5568,9 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5639
5568
|
function kt(f, c) {
|
|
5640
5569
|
var y = f.match(c.IPV6ADDRESS) || [], S = v(y, 3), E = S[1], L = S[2];
|
|
5641
5570
|
if (E) {
|
|
5642
|
-
for (var H = E.toLowerCase().split("::").reverse(), X = v(H, 2), se = X[0], ue = X[1], Y = ue ? ue.split(":").map(le) : [], ne = se.split(":").map(le), de = c.IPV4ADDRESS.test(ne[ne.length - 1]),
|
|
5571
|
+
for (var H = E.toLowerCase().split("::").reverse(), X = v(H, 2), se = X[0], ue = X[1], Y = ue ? ue.split(":").map(le) : [], ne = se.split(":").map(le), de = c.IPV4ADDRESS.test(ne[ne.length - 1]), x = de ? 7 : 8, oe = ne.length - x, me = Array(x), ae = 0; ae < x; ++ae)
|
|
5643
5572
|
me[ae] = Y[ae] || ne[oe + ae] || "";
|
|
5644
|
-
de && (me[
|
|
5573
|
+
de && (me[x - 1] = De(me[x - 1], c));
|
|
5645
5574
|
var Xe = me.reduce(function(Oe, Le, pt) {
|
|
5646
5575
|
if (!Le || Le === "0") {
|
|
5647
5576
|
var Je = Oe[Oe.length - 1];
|
|
@@ -5786,10 +5715,10 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5786
5715
|
domainHost: sr.domainHost,
|
|
5787
5716
|
parse: sr.parse,
|
|
5788
5717
|
serialize: sr.serialize
|
|
5789
|
-
}, Wo = {}, As = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", qe = "[0-9A-Fa-f]",
|
|
5790
|
-
function
|
|
5718
|
+
}, Wo = {}, As = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", qe = "[0-9A-Fa-f]", xo = s(s("%[EFef]" + qe + "%" + qe + qe + "%" + qe + qe) + "|" + s("%[89A-Fa-f]" + qe + "%" + qe + qe) + "|" + s("%" + qe + qe)), Bo = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", Go = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", Ko = n(Go, '[\\"\\\\]'), Jo = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", Yo = new RegExp(As, "g"), It = new RegExp(xo, "g"), Qo = new RegExp(n("[^]", Bo, "[\\.]", '[\\"]', Ko), "g"), Ds = new RegExp(n("[^]", As, Jo), "g"), Zo = Ds;
|
|
5719
|
+
function vn(f) {
|
|
5791
5720
|
var c = J(f);
|
|
5792
|
-
return c.match(
|
|
5721
|
+
return c.match(Yo) ? c : f;
|
|
5793
5722
|
}
|
|
5794
5723
|
var Fs = {
|
|
5795
5724
|
scheme: "mailto",
|
|
@@ -5800,7 +5729,7 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5800
5729
|
var Y = X[se].split("=");
|
|
5801
5730
|
switch (Y[0]) {
|
|
5802
5731
|
case "to":
|
|
5803
|
-
for (var ne = Y[1].split(","), de = 0,
|
|
5732
|
+
for (var ne = Y[1].split(","), de = 0, x = ne.length; de < x; ++de)
|
|
5804
5733
|
E.push(ne[de]);
|
|
5805
5734
|
break;
|
|
5806
5735
|
case "subject":
|
|
@@ -5835,7 +5764,7 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5835
5764
|
var S = c, E = l(c.to);
|
|
5836
5765
|
if (E) {
|
|
5837
5766
|
for (var L = 0, H = E.length; L < H; ++L) {
|
|
5838
|
-
var X = String(E[L]), se = X.lastIndexOf("@"), ue = X.slice(0, se).replace(It,
|
|
5767
|
+
var X = String(E[L]), se = X.lastIndexOf("@"), ue = X.slice(0, se).replace(It, vn).replace(It, o).replace(Qo, M), Y = X.slice(se + 1);
|
|
5839
5768
|
try {
|
|
5840
5769
|
Y = y.iri ? N.toUnicode(Y) : N.toASCII(ke(Y, y).toLowerCase());
|
|
5841
5770
|
} catch (oe) {
|
|
@@ -5848,14 +5777,14 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5848
5777
|
var ne = c.headers = c.headers || {};
|
|
5849
5778
|
c.subject && (ne.subject = c.subject), c.body && (ne.body = c.body);
|
|
5850
5779
|
var de = [];
|
|
5851
|
-
for (var
|
|
5852
|
-
ne[
|
|
5780
|
+
for (var x in ne)
|
|
5781
|
+
ne[x] !== Wo[x] && de.push(x.replace(It, vn).replace(It, o).replace(Ds, M) + "=" + ne[x].replace(It, vn).replace(It, o).replace(Zo, M));
|
|
5853
5782
|
return de.length && (S.query = de.join("&")), S;
|
|
5854
5783
|
}
|
|
5855
|
-
},
|
|
5784
|
+
}, Xo = /^([^\:]+)\:(.*)/, qs = {
|
|
5856
5785
|
scheme: "urn",
|
|
5857
5786
|
parse: function(c, y) {
|
|
5858
|
-
var S = c.path && c.path.match(
|
|
5787
|
+
var S = c.path && c.path.match(Xo), E = c;
|
|
5859
5788
|
if (S) {
|
|
5860
5789
|
var L = y.scheme || E.scheme || "urn", H = S[1].toLowerCase(), X = S[2], se = L + ":" + (y.nid || H), ue = q[se];
|
|
5861
5790
|
E.nid = H, E.nss = X, E.path = void 0, ue && (E = ue.parse(E, y));
|
|
@@ -5869,11 +5798,11 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5869
5798
|
var X = c, se = c.nss;
|
|
5870
5799
|
return X.path = (E || y.nid) + ":" + se, X;
|
|
5871
5800
|
}
|
|
5872
|
-
},
|
|
5801
|
+
}, ea = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Ms = {
|
|
5873
5802
|
scheme: "urn:uuid",
|
|
5874
5803
|
parse: function(c, y) {
|
|
5875
5804
|
var S = c;
|
|
5876
|
-
return S.uuid = S.nss, S.nss = void 0, !y.tolerant && (!S.uuid || !S.uuid.match(
|
|
5805
|
+
return S.uuid = S.nss, S.nss = void 0, !y.tolerant && (!S.uuid || !S.uuid.match(ea)) && (S.error = S.error || "UUID is not valid."), S;
|
|
5877
5806
|
},
|
|
5878
5807
|
serialize: function(c, y) {
|
|
5879
5808
|
var S = c;
|
|
@@ -5883,11 +5812,11 @@ var Qn = {}, Dn = { exports: {} };
|
|
|
5883
5812
|
q[ut.scheme] = ut, q[Ns.scheme] = Ns, q[sr.scheme] = sr, q[Is.scheme] = Is, q[Fs.scheme] = Fs, q[qs.scheme] = qs, q[Ms.scheme] = Ms, r.SCHEMES = q, r.pctEncChar = M, r.pctDecChars = J, r.parse = Te, r.removeDotSegments = Fe, r.serialize = Pe, r.resolveComponents = jt, r.resolve = rr, r.normalize = lt, r.equal = nr, r.escapeComponent = Tr, r.unescapeComponent = ke, Object.defineProperty(r, "__esModule", { value: !0 });
|
|
5884
5813
|
});
|
|
5885
5814
|
})(Dn, Dn.exports);
|
|
5886
|
-
var
|
|
5815
|
+
var tu = Dn.exports;
|
|
5887
5816
|
Object.defineProperty(Qn, "__esModule", { value: !0 });
|
|
5888
|
-
const
|
|
5889
|
-
|
|
5890
|
-
Qn.default =
|
|
5817
|
+
const To = tu;
|
|
5818
|
+
To.code = 'require("ajv/dist/runtime/uri").default';
|
|
5819
|
+
Qn.default = To;
|
|
5891
5820
|
(function(e) {
|
|
5892
5821
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
|
|
5893
5822
|
var t = Ae;
|
|
@@ -5908,7 +5837,7 @@ Qn.default = Ro;
|
|
|
5908
5837
|
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
5909
5838
|
return r.CodeGen;
|
|
5910
5839
|
} });
|
|
5911
|
-
const n = Pr, s = Er, i = Pt, o = Se, l = G, d = $e, u = br, p = re, h =
|
|
5840
|
+
const n = Pr, s = Er, i = Pt, o = Se, l = G, d = $e, u = br, p = re, h = eu, v = Qn, T = (F, $) => new RegExp(F, $);
|
|
5912
5841
|
T.code = "new RegExp";
|
|
5913
5842
|
const w = ["removeAdditional", "useDefaults", "coerceTypes"], R = /* @__PURE__ */ new Set([
|
|
5914
5843
|
"validate",
|
|
@@ -5975,7 +5904,7 @@ Qn.default = Ro;
|
|
|
5975
5904
|
const { es5: I, lines: P } = this.opts.code;
|
|
5976
5905
|
this.scope = new l.ValueScope({ scope: {}, prefixes: R, es5: I, lines: P }), this.logger = Z($.logger);
|
|
5977
5906
|
const a = $.validateFormats;
|
|
5978
|
-
$.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, _, $, "NOT SUPPORTED"), D.call(this, g, $, "DEPRECATED", "warn"), this._metaOpts = K.call(this), $.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), $.keywords &&
|
|
5907
|
+
$.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, _, $, "NOT SUPPORTED"), D.call(this, g, $, "DEPRECATED", "warn"), this._metaOpts = K.call(this), $.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), $.keywords && W.call(this, $.keywords), typeof $.meta == "object" && this.addMetaSchema($.meta), C.call(this), $.validateFormats = a;
|
|
5979
5908
|
}
|
|
5980
5909
|
_addVocabularies() {
|
|
5981
5910
|
this.addKeyword("$async");
|
|
@@ -6253,7 +6182,7 @@ Qn.default = Ro;
|
|
|
6253
6182
|
$ && this.addFormat(F, $);
|
|
6254
6183
|
}
|
|
6255
6184
|
}
|
|
6256
|
-
function
|
|
6185
|
+
function W(F) {
|
|
6257
6186
|
if (Array.isArray(F)) {
|
|
6258
6187
|
this.addVocabulary(F);
|
|
6259
6188
|
return;
|
|
@@ -6327,20 +6256,20 @@ Qn.default = Ro;
|
|
|
6327
6256
|
function Rt(F) {
|
|
6328
6257
|
return { anyOf: [F, Qt] };
|
|
6329
6258
|
}
|
|
6330
|
-
})(
|
|
6259
|
+
})(eo);
|
|
6331
6260
|
var Zn = {}, Xn = {}, es = {};
|
|
6332
6261
|
Object.defineProperty(es, "__esModule", { value: !0 });
|
|
6333
|
-
const
|
|
6262
|
+
const ru = {
|
|
6334
6263
|
keyword: "id",
|
|
6335
6264
|
code() {
|
|
6336
6265
|
throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
|
|
6337
6266
|
}
|
|
6338
6267
|
};
|
|
6339
|
-
es.default =
|
|
6268
|
+
es.default = ru;
|
|
6340
6269
|
var Et = {};
|
|
6341
6270
|
Object.defineProperty(Et, "__esModule", { value: !0 });
|
|
6342
6271
|
Et.callRef = Et.getValidate = void 0;
|
|
6343
|
-
const
|
|
6272
|
+
const nu = Er, ci = B, Ee = G, qt = Ke, li = Se, Cr = re, su = {
|
|
6344
6273
|
keyword: "$ref",
|
|
6345
6274
|
schemaType: "string",
|
|
6346
6275
|
code(e) {
|
|
@@ -6349,19 +6278,19 @@ const iu = Er, ci = B, Ee = G, qt = Ke, li = Se, Cr = re, ou = {
|
|
|
6349
6278
|
return h();
|
|
6350
6279
|
const p = li.resolveRef.call(d, u, s, r);
|
|
6351
6280
|
if (p === void 0)
|
|
6352
|
-
throw new
|
|
6281
|
+
throw new nu.default(n.opts.uriResolver, s, r);
|
|
6353
6282
|
if (p instanceof li.SchemaEnv)
|
|
6354
6283
|
return v(p);
|
|
6355
6284
|
return T(p);
|
|
6356
6285
|
function h() {
|
|
6357
6286
|
if (i === u)
|
|
6358
|
-
return
|
|
6287
|
+
return Mr(e, o, i, i.$async);
|
|
6359
6288
|
const w = t.scopeValue("root", { ref: u });
|
|
6360
|
-
return
|
|
6289
|
+
return Mr(e, (0, Ee._)`${w}.validate`, u, u.$async);
|
|
6361
6290
|
}
|
|
6362
6291
|
function v(w) {
|
|
6363
|
-
const R =
|
|
6364
|
-
|
|
6292
|
+
const R = Ro(e, w);
|
|
6293
|
+
Mr(e, R, w, w.$async);
|
|
6365
6294
|
}
|
|
6366
6295
|
function T(w) {
|
|
6367
6296
|
const R = t.scopeValue("schema", l.code.source === !0 ? { ref: w, code: (0, Ee.stringify)(w) } : { ref: w }), _ = t.name("valid"), g = e.subschema({
|
|
@@ -6375,12 +6304,12 @@ const iu = Er, ci = B, Ee = G, qt = Ke, li = Se, Cr = re, ou = {
|
|
|
6375
6304
|
}
|
|
6376
6305
|
}
|
|
6377
6306
|
};
|
|
6378
|
-
function
|
|
6307
|
+
function Ro(e, t) {
|
|
6379
6308
|
const { gen: r } = e;
|
|
6380
6309
|
return t.validate ? r.scopeValue("validate", { ref: t.validate }) : (0, Ee._)`${r.scopeValue("wrapper", { ref: t })}.validate`;
|
|
6381
6310
|
}
|
|
6382
|
-
Et.getValidate =
|
|
6383
|
-
function
|
|
6311
|
+
Et.getValidate = Ro;
|
|
6312
|
+
function Mr(e, t, r, n) {
|
|
6384
6313
|
const { gen: s, it: i } = e, { allErrors: o, schemaEnv: l, opts: d } = i, u = d.passContext ? qt.default.this : Ee.nil;
|
|
6385
6314
|
n ? p() : h();
|
|
6386
6315
|
function p() {
|
|
@@ -6421,137 +6350,137 @@ function Ur(e, t, r, n) {
|
|
|
6421
6350
|
}
|
|
6422
6351
|
}
|
|
6423
6352
|
}
|
|
6424
|
-
Et.callRef =
|
|
6425
|
-
Et.default =
|
|
6353
|
+
Et.callRef = Mr;
|
|
6354
|
+
Et.default = su;
|
|
6426
6355
|
Object.defineProperty(Xn, "__esModule", { value: !0 });
|
|
6427
|
-
const
|
|
6356
|
+
const iu = es, ou = Et, au = [
|
|
6428
6357
|
"$schema",
|
|
6429
6358
|
"$id",
|
|
6430
6359
|
"$defs",
|
|
6431
6360
|
"$vocabulary",
|
|
6432
6361
|
{ keyword: "$comment" },
|
|
6433
6362
|
"definitions",
|
|
6434
|
-
|
|
6435
|
-
|
|
6363
|
+
iu.default,
|
|
6364
|
+
ou.default
|
|
6436
6365
|
];
|
|
6437
|
-
Xn.default =
|
|
6366
|
+
Xn.default = au;
|
|
6438
6367
|
var ts = {}, rs = {};
|
|
6439
6368
|
Object.defineProperty(rs, "__esModule", { value: !0 });
|
|
6440
|
-
const
|
|
6369
|
+
const xr = G, rt = xr.operators, Br = {
|
|
6441
6370
|
maximum: { okStr: "<=", ok: rt.LTE, fail: rt.GT },
|
|
6442
6371
|
minimum: { okStr: ">=", ok: rt.GTE, fail: rt.LT },
|
|
6443
6372
|
exclusiveMaximum: { okStr: "<", ok: rt.LT, fail: rt.GTE },
|
|
6444
6373
|
exclusiveMinimum: { okStr: ">", ok: rt.GT, fail: rt.LTE }
|
|
6445
|
-
},
|
|
6446
|
-
message: ({ keyword: e, schemaCode: t }) => (0,
|
|
6447
|
-
params: ({ keyword: e, schemaCode: t }) => (0,
|
|
6448
|
-
},
|
|
6449
|
-
keyword: Object.keys(
|
|
6374
|
+
}, cu = {
|
|
6375
|
+
message: ({ keyword: e, schemaCode: t }) => (0, xr.str)`must be ${Br[e].okStr} ${t}`,
|
|
6376
|
+
params: ({ keyword: e, schemaCode: t }) => (0, xr._)`{comparison: ${Br[e].okStr}, limit: ${t}}`
|
|
6377
|
+
}, lu = {
|
|
6378
|
+
keyword: Object.keys(Br),
|
|
6450
6379
|
type: "number",
|
|
6451
6380
|
schemaType: "number",
|
|
6452
6381
|
$data: !0,
|
|
6453
|
-
error:
|
|
6382
|
+
error: cu,
|
|
6454
6383
|
code(e) {
|
|
6455
6384
|
const { keyword: t, data: r, schemaCode: n } = e;
|
|
6456
|
-
e.fail$data((0,
|
|
6385
|
+
e.fail$data((0, xr._)`${r} ${Br[t].fail} ${n} || isNaN(${r})`);
|
|
6457
6386
|
}
|
|
6458
6387
|
};
|
|
6459
|
-
rs.default =
|
|
6388
|
+
rs.default = lu;
|
|
6460
6389
|
var ns = {};
|
|
6461
6390
|
Object.defineProperty(ns, "__esModule", { value: !0 });
|
|
6462
|
-
const pr = G,
|
|
6391
|
+
const pr = G, uu = {
|
|
6463
6392
|
message: ({ schemaCode: e }) => (0, pr.str)`must be multiple of ${e}`,
|
|
6464
6393
|
params: ({ schemaCode: e }) => (0, pr._)`{multipleOf: ${e}}`
|
|
6465
|
-
},
|
|
6394
|
+
}, du = {
|
|
6466
6395
|
keyword: "multipleOf",
|
|
6467
6396
|
type: "number",
|
|
6468
6397
|
schemaType: "number",
|
|
6469
6398
|
$data: !0,
|
|
6470
|
-
error:
|
|
6399
|
+
error: uu,
|
|
6471
6400
|
code(e) {
|
|
6472
6401
|
const { gen: t, data: r, schemaCode: n, it: s } = e, i = s.opts.multipleOfPrecision, o = t.let("res"), l = i ? (0, pr._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}` : (0, pr._)`${o} !== parseInt(${o})`;
|
|
6473
6402
|
e.fail$data((0, pr._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`);
|
|
6474
6403
|
}
|
|
6475
6404
|
};
|
|
6476
|
-
ns.default =
|
|
6405
|
+
ns.default = du;
|
|
6477
6406
|
var ss = {}, is = {};
|
|
6478
6407
|
Object.defineProperty(is, "__esModule", { value: !0 });
|
|
6479
|
-
function
|
|
6408
|
+
function ko(e) {
|
|
6480
6409
|
const t = e.length;
|
|
6481
6410
|
let r = 0, n = 0, s;
|
|
6482
6411
|
for (; n < t; )
|
|
6483
6412
|
r++, s = e.charCodeAt(n++), s >= 55296 && s <= 56319 && n < t && (s = e.charCodeAt(n), (s & 64512) === 56320 && n++);
|
|
6484
6413
|
return r;
|
|
6485
6414
|
}
|
|
6486
|
-
is.default =
|
|
6487
|
-
|
|
6415
|
+
is.default = ko;
|
|
6416
|
+
ko.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
6488
6417
|
Object.defineProperty(ss, "__esModule", { value: !0 });
|
|
6489
|
-
const mt = G,
|
|
6418
|
+
const mt = G, pu = re, fu = is, hu = {
|
|
6490
6419
|
message({ keyword: e, schemaCode: t }) {
|
|
6491
6420
|
const r = e === "maxLength" ? "more" : "fewer";
|
|
6492
6421
|
return (0, mt.str)`must NOT have ${r} than ${t} characters`;
|
|
6493
6422
|
},
|
|
6494
6423
|
params: ({ schemaCode: e }) => (0, mt._)`{limit: ${e}}`
|
|
6495
|
-
},
|
|
6424
|
+
}, mu = {
|
|
6496
6425
|
keyword: ["maxLength", "minLength"],
|
|
6497
6426
|
type: "string",
|
|
6498
6427
|
schemaType: "number",
|
|
6499
6428
|
$data: !0,
|
|
6500
|
-
error:
|
|
6429
|
+
error: hu,
|
|
6501
6430
|
code(e) {
|
|
6502
|
-
const { keyword: t, data: r, schemaCode: n, it: s } = e, i = t === "maxLength" ? mt.operators.GT : mt.operators.LT, o = s.opts.unicode === !1 ? (0, mt._)`${r}.length` : (0, mt._)`${(0,
|
|
6431
|
+
const { keyword: t, data: r, schemaCode: n, it: s } = e, i = t === "maxLength" ? mt.operators.GT : mt.operators.LT, o = s.opts.unicode === !1 ? (0, mt._)`${r}.length` : (0, mt._)`${(0, pu.useFunc)(e.gen, fu.default)}(${r})`;
|
|
6503
6432
|
e.fail$data((0, mt._)`${o} ${i} ${n}`);
|
|
6504
6433
|
}
|
|
6505
6434
|
};
|
|
6506
|
-
ss.default =
|
|
6435
|
+
ss.default = mu;
|
|
6507
6436
|
var os = {};
|
|
6508
6437
|
Object.defineProperty(os, "__esModule", { value: !0 });
|
|
6509
|
-
const
|
|
6510
|
-
message: ({ schemaCode: e }) => (0,
|
|
6511
|
-
params: ({ schemaCode: e }) => (0,
|
|
6512
|
-
},
|
|
6438
|
+
const yu = B, Gr = G, gu = {
|
|
6439
|
+
message: ({ schemaCode: e }) => (0, Gr.str)`must match pattern "${e}"`,
|
|
6440
|
+
params: ({ schemaCode: e }) => (0, Gr._)`{pattern: ${e}}`
|
|
6441
|
+
}, $u = {
|
|
6513
6442
|
keyword: "pattern",
|
|
6514
6443
|
type: "string",
|
|
6515
6444
|
schemaType: "string",
|
|
6516
6445
|
$data: !0,
|
|
6517
|
-
error:
|
|
6446
|
+
error: gu,
|
|
6518
6447
|
code(e) {
|
|
6519
|
-
const { data: t, $data: r, schema: n, schemaCode: s, it: i } = e, o = i.opts.unicodeRegExp ? "u" : "", l = r ? (0,
|
|
6520
|
-
e.fail$data((0,
|
|
6448
|
+
const { data: t, $data: r, schema: n, schemaCode: s, it: i } = e, o = i.opts.unicodeRegExp ? "u" : "", l = r ? (0, Gr._)`(new RegExp(${s}, ${o}))` : (0, yu.usePattern)(e, n);
|
|
6449
|
+
e.fail$data((0, Gr._)`!${l}.test(${t})`);
|
|
6521
6450
|
}
|
|
6522
6451
|
};
|
|
6523
|
-
os.default =
|
|
6452
|
+
os.default = $u;
|
|
6524
6453
|
var as = {};
|
|
6525
6454
|
Object.defineProperty(as, "__esModule", { value: !0 });
|
|
6526
|
-
const fr = G,
|
|
6455
|
+
const fr = G, _u = {
|
|
6527
6456
|
message({ keyword: e, schemaCode: t }) {
|
|
6528
6457
|
const r = e === "maxProperties" ? "more" : "fewer";
|
|
6529
6458
|
return (0, fr.str)`must NOT have ${r} than ${t} properties`;
|
|
6530
6459
|
},
|
|
6531
6460
|
params: ({ schemaCode: e }) => (0, fr._)`{limit: ${e}}`
|
|
6532
|
-
},
|
|
6461
|
+
}, wu = {
|
|
6533
6462
|
keyword: ["maxProperties", "minProperties"],
|
|
6534
6463
|
type: "object",
|
|
6535
6464
|
schemaType: "number",
|
|
6536
6465
|
$data: !0,
|
|
6537
|
-
error:
|
|
6466
|
+
error: _u,
|
|
6538
6467
|
code(e) {
|
|
6539
6468
|
const { keyword: t, data: r, schemaCode: n } = e, s = t === "maxProperties" ? fr.operators.GT : fr.operators.LT;
|
|
6540
6469
|
e.fail$data((0, fr._)`Object.keys(${r}).length ${s} ${n}`);
|
|
6541
6470
|
}
|
|
6542
6471
|
};
|
|
6543
|
-
as.default =
|
|
6472
|
+
as.default = wu;
|
|
6544
6473
|
var cs = {};
|
|
6545
6474
|
Object.defineProperty(cs, "__esModule", { value: !0 });
|
|
6546
|
-
const cr = B, hr = G,
|
|
6475
|
+
const cr = B, hr = G, vu = re, bu = {
|
|
6547
6476
|
message: ({ params: { missingProperty: e } }) => (0, hr.str)`must have required property '${e}'`,
|
|
6548
6477
|
params: ({ params: { missingProperty: e } }) => (0, hr._)`{missingProperty: ${e}}`
|
|
6549
|
-
},
|
|
6478
|
+
}, Pu = {
|
|
6550
6479
|
keyword: "required",
|
|
6551
6480
|
type: "object",
|
|
6552
6481
|
schemaType: "array",
|
|
6553
6482
|
$data: !0,
|
|
6554
|
-
error:
|
|
6483
|
+
error: bu,
|
|
6555
6484
|
code(e) {
|
|
6556
6485
|
const { gen: t, schema: r, schemaCode: n, data: s, $data: i, it: o } = e, { opts: l } = o;
|
|
6557
6486
|
if (!i && r.length === 0)
|
|
@@ -6562,7 +6491,7 @@ const cr = B, hr = G, Pu = re, Eu = {
|
|
|
6562
6491
|
for (const R of r)
|
|
6563
6492
|
if ((T == null ? void 0 : T[R]) === void 0 && !w.has(R)) {
|
|
6564
6493
|
const _ = o.schemaEnv.baseId + o.errSchemaPath, g = `required property "${R}" is not defined at "${_}" (strictRequired)`;
|
|
6565
|
-
(0,
|
|
6494
|
+
(0, vu.checkStrictMode)(o, g, o.opts.strictRequired);
|
|
6566
6495
|
}
|
|
6567
6496
|
}
|
|
6568
6497
|
function u() {
|
|
@@ -6594,42 +6523,42 @@ const cr = B, hr = G, Pu = re, Eu = {
|
|
|
6594
6523
|
}
|
|
6595
6524
|
}
|
|
6596
6525
|
};
|
|
6597
|
-
cs.default =
|
|
6526
|
+
cs.default = Pu;
|
|
6598
6527
|
var ls = {};
|
|
6599
6528
|
Object.defineProperty(ls, "__esModule", { value: !0 });
|
|
6600
|
-
const mr = G,
|
|
6529
|
+
const mr = G, Eu = {
|
|
6601
6530
|
message({ keyword: e, schemaCode: t }) {
|
|
6602
6531
|
const r = e === "maxItems" ? "more" : "fewer";
|
|
6603
6532
|
return (0, mr.str)`must NOT have ${r} than ${t} items`;
|
|
6604
6533
|
},
|
|
6605
6534
|
params: ({ schemaCode: e }) => (0, mr._)`{limit: ${e}}`
|
|
6606
|
-
},
|
|
6535
|
+
}, Su = {
|
|
6607
6536
|
keyword: ["maxItems", "minItems"],
|
|
6608
6537
|
type: "array",
|
|
6609
6538
|
schemaType: "number",
|
|
6610
6539
|
$data: !0,
|
|
6611
|
-
error:
|
|
6540
|
+
error: Eu,
|
|
6612
6541
|
code(e) {
|
|
6613
6542
|
const { keyword: t, data: r, schemaCode: n } = e, s = t === "maxItems" ? mr.operators.GT : mr.operators.LT;
|
|
6614
6543
|
e.fail$data((0, mr._)`${r}.length ${s} ${n}`);
|
|
6615
6544
|
}
|
|
6616
6545
|
};
|
|
6617
|
-
ls.default =
|
|
6546
|
+
ls.default = Su;
|
|
6618
6547
|
var us = {}, Sr = {};
|
|
6619
6548
|
Object.defineProperty(Sr, "__esModule", { value: !0 });
|
|
6620
|
-
const
|
|
6621
|
-
|
|
6622
|
-
Sr.default =
|
|
6549
|
+
const Oo = co;
|
|
6550
|
+
Oo.code = 'require("ajv/dist/runtime/equal").default';
|
|
6551
|
+
Sr.default = Oo;
|
|
6623
6552
|
Object.defineProperty(us, "__esModule", { value: !0 });
|
|
6624
|
-
const kn = br, ge = G,
|
|
6553
|
+
const kn = br, ge = G, Tu = re, Ru = Sr, ku = {
|
|
6625
6554
|
message: ({ params: { i: e, j: t } }) => (0, ge.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
|
|
6626
6555
|
params: ({ params: { i: e, j: t } }) => (0, ge._)`{i: ${e}, j: ${t}}`
|
|
6627
|
-
},
|
|
6556
|
+
}, Ou = {
|
|
6628
6557
|
keyword: "uniqueItems",
|
|
6629
6558
|
type: "array",
|
|
6630
6559
|
schemaType: "boolean",
|
|
6631
6560
|
$data: !0,
|
|
6632
|
-
error:
|
|
6561
|
+
error: ku,
|
|
6633
6562
|
code(e) {
|
|
6634
6563
|
const { gen: t, data: r, $data: n, schema: s, parentSchema: i, schemaCode: o, it: l } = e;
|
|
6635
6564
|
if (!n && !s)
|
|
@@ -6652,46 +6581,46 @@ const kn = br, ge = G, ku = re, Ou = Sr, Cu = {
|
|
|
6652
6581
|
});
|
|
6653
6582
|
}
|
|
6654
6583
|
function T(w, R) {
|
|
6655
|
-
const _ = (0,
|
|
6584
|
+
const _ = (0, Tu.useFunc)(t, Ru.default), g = t.name("outer");
|
|
6656
6585
|
t.label(g).for((0, ge._)`;${w}--;`, () => t.for((0, ge._)`${R} = ${w}; ${R}--;`, () => t.if((0, ge._)`${_}(${r}[${w}], ${r}[${R}])`, () => {
|
|
6657
6586
|
e.error(), t.assign(d, !1).break(g);
|
|
6658
6587
|
})));
|
|
6659
6588
|
}
|
|
6660
6589
|
}
|
|
6661
6590
|
};
|
|
6662
|
-
us.default =
|
|
6591
|
+
us.default = Ou;
|
|
6663
6592
|
var ds = {};
|
|
6664
6593
|
Object.defineProperty(ds, "__esModule", { value: !0 });
|
|
6665
|
-
const Fn = G,
|
|
6594
|
+
const Fn = G, Cu = re, Nu = Sr, ju = {
|
|
6666
6595
|
message: "must be equal to constant",
|
|
6667
6596
|
params: ({ schemaCode: e }) => (0, Fn._)`{allowedValue: ${e}}`
|
|
6668
|
-
},
|
|
6597
|
+
}, Iu = {
|
|
6669
6598
|
keyword: "const",
|
|
6670
6599
|
$data: !0,
|
|
6671
|
-
error:
|
|
6600
|
+
error: ju,
|
|
6672
6601
|
code(e) {
|
|
6673
6602
|
const { gen: t, data: r, $data: n, schemaCode: s, schema: i } = e;
|
|
6674
|
-
n || i && typeof i == "object" ? e.fail$data((0, Fn._)`!${(0,
|
|
6603
|
+
n || i && typeof i == "object" ? e.fail$data((0, Fn._)`!${(0, Cu.useFunc)(t, Nu.default)}(${r}, ${s})`) : e.fail((0, Fn._)`${i} !== ${r}`);
|
|
6675
6604
|
}
|
|
6676
6605
|
};
|
|
6677
|
-
ds.default =
|
|
6606
|
+
ds.default = Iu;
|
|
6678
6607
|
var ps = {};
|
|
6679
6608
|
Object.defineProperty(ps, "__esModule", { value: !0 });
|
|
6680
|
-
const lr = G,
|
|
6609
|
+
const lr = G, Au = re, Du = Sr, Fu = {
|
|
6681
6610
|
message: "must be equal to one of the allowed values",
|
|
6682
6611
|
params: ({ schemaCode: e }) => (0, lr._)`{allowedValues: ${e}}`
|
|
6683
|
-
},
|
|
6612
|
+
}, qu = {
|
|
6684
6613
|
keyword: "enum",
|
|
6685
6614
|
schemaType: "array",
|
|
6686
6615
|
$data: !0,
|
|
6687
|
-
error:
|
|
6616
|
+
error: Fu,
|
|
6688
6617
|
code(e) {
|
|
6689
6618
|
const { gen: t, data: r, $data: n, schema: s, schemaCode: i, it: o } = e;
|
|
6690
6619
|
if (!n && s.length === 0)
|
|
6691
6620
|
throw new Error("enum must have non-empty array");
|
|
6692
6621
|
const l = s.length >= o.opts.loopEnum;
|
|
6693
6622
|
let d;
|
|
6694
|
-
const u = () => d ?? (d = (0,
|
|
6623
|
+
const u = () => d ?? (d = (0, Au.useFunc)(t, Du.default));
|
|
6695
6624
|
let p;
|
|
6696
6625
|
if (l || n)
|
|
6697
6626
|
p = t.let("valid"), e.block$data(p, h);
|
|
@@ -6711,50 +6640,50 @@ const lr = G, Fu = re, qu = Sr, Mu = {
|
|
|
6711
6640
|
}
|
|
6712
6641
|
}
|
|
6713
6642
|
};
|
|
6714
|
-
ps.default =
|
|
6643
|
+
ps.default = qu;
|
|
6715
6644
|
Object.defineProperty(ts, "__esModule", { value: !0 });
|
|
6716
|
-
const
|
|
6645
|
+
const Mu = rs, Uu = ns, Lu = ss, Hu = os, zu = as, Vu = cs, Wu = ls, xu = us, Bu = ds, Gu = ps, Ku = [
|
|
6717
6646
|
// number
|
|
6647
|
+
Mu.default,
|
|
6648
|
+
Uu.default,
|
|
6649
|
+
// string
|
|
6718
6650
|
Lu.default,
|
|
6719
6651
|
Hu.default,
|
|
6720
|
-
//
|
|
6652
|
+
// object
|
|
6721
6653
|
zu.default,
|
|
6722
6654
|
Vu.default,
|
|
6723
|
-
// object
|
|
6724
|
-
xu.default,
|
|
6725
|
-
Wu.default,
|
|
6726
6655
|
// array
|
|
6727
|
-
|
|
6728
|
-
|
|
6656
|
+
Wu.default,
|
|
6657
|
+
xu.default,
|
|
6729
6658
|
// any
|
|
6730
6659
|
{ keyword: "type", schemaType: ["string", "array"] },
|
|
6731
6660
|
{ keyword: "nullable", schemaType: "boolean" },
|
|
6732
|
-
|
|
6733
|
-
|
|
6661
|
+
Bu.default,
|
|
6662
|
+
Gu.default
|
|
6734
6663
|
];
|
|
6735
|
-
ts.default =
|
|
6664
|
+
ts.default = Ku;
|
|
6736
6665
|
var fs = {}, Jt = {};
|
|
6737
6666
|
Object.defineProperty(Jt, "__esModule", { value: !0 });
|
|
6738
6667
|
Jt.validateAdditionalItems = void 0;
|
|
6739
|
-
const yt = G, qn = re,
|
|
6668
|
+
const yt = G, qn = re, Ju = {
|
|
6740
6669
|
message: ({ params: { len: e } }) => (0, yt.str)`must NOT have more than ${e} items`,
|
|
6741
6670
|
params: ({ params: { len: e } }) => (0, yt._)`{limit: ${e}}`
|
|
6742
|
-
},
|
|
6671
|
+
}, Yu = {
|
|
6743
6672
|
keyword: "additionalItems",
|
|
6744
6673
|
type: "array",
|
|
6745
6674
|
schemaType: ["boolean", "object"],
|
|
6746
6675
|
before: "uniqueItems",
|
|
6747
|
-
error:
|
|
6676
|
+
error: Ju,
|
|
6748
6677
|
code(e) {
|
|
6749
6678
|
const { parentSchema: t, it: r } = e, { items: n } = t;
|
|
6750
6679
|
if (!Array.isArray(n)) {
|
|
6751
6680
|
(0, qn.checkStrictMode)(r, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
6752
6681
|
return;
|
|
6753
6682
|
}
|
|
6754
|
-
|
|
6683
|
+
Co(e, n);
|
|
6755
6684
|
}
|
|
6756
6685
|
};
|
|
6757
|
-
function
|
|
6686
|
+
function Co(e, t) {
|
|
6758
6687
|
const { gen: r, schema: n, data: s, keyword: i, it: o } = e;
|
|
6759
6688
|
o.items = !0;
|
|
6760
6689
|
const l = r.const("len", (0, yt._)`${s}.length`);
|
|
@@ -6770,12 +6699,12 @@ function No(e, t) {
|
|
|
6770
6699
|
});
|
|
6771
6700
|
}
|
|
6772
6701
|
}
|
|
6773
|
-
Jt.validateAdditionalItems =
|
|
6774
|
-
Jt.default =
|
|
6702
|
+
Jt.validateAdditionalItems = Co;
|
|
6703
|
+
Jt.default = Yu;
|
|
6775
6704
|
var hs = {}, Yt = {};
|
|
6776
6705
|
Object.defineProperty(Yt, "__esModule", { value: !0 });
|
|
6777
6706
|
Yt.validateTuple = void 0;
|
|
6778
|
-
const ui = G,
|
|
6707
|
+
const ui = G, Ur = re, Qu = B, Zu = {
|
|
6779
6708
|
keyword: "items",
|
|
6780
6709
|
type: "array",
|
|
6781
6710
|
schemaType: ["object", "array", "boolean"],
|
|
@@ -6783,16 +6712,16 @@ const ui = G, Lr = re, Xu = B, ed = {
|
|
|
6783
6712
|
code(e) {
|
|
6784
6713
|
const { schema: t, it: r } = e;
|
|
6785
6714
|
if (Array.isArray(t))
|
|
6786
|
-
return
|
|
6787
|
-
r.items = !0, !(0,
|
|
6715
|
+
return No(e, "additionalItems", t);
|
|
6716
|
+
r.items = !0, !(0, Ur.alwaysValidSchema)(r, t) && e.ok((0, Qu.validateArray)(e));
|
|
6788
6717
|
}
|
|
6789
6718
|
};
|
|
6790
|
-
function
|
|
6719
|
+
function No(e, t, r = e.schema) {
|
|
6791
6720
|
const { gen: n, parentSchema: s, data: i, keyword: o, it: l } = e;
|
|
6792
|
-
p(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items =
|
|
6721
|
+
p(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items = Ur.mergeEvaluated.items(n, r.length, l.items));
|
|
6793
6722
|
const d = n.name("valid"), u = n.const("len", (0, ui._)`${i}.length`);
|
|
6794
6723
|
r.forEach((h, v) => {
|
|
6795
|
-
(0,
|
|
6724
|
+
(0, Ur.alwaysValidSchema)(l, h) || (n.if((0, ui._)`${u} > ${v}`, () => e.subschema({
|
|
6796
6725
|
keyword: o,
|
|
6797
6726
|
schemaProp: v,
|
|
6798
6727
|
dataProp: v
|
|
@@ -6802,50 +6731,50 @@ function jo(e, t, r = e.schema) {
|
|
|
6802
6731
|
const { opts: v, errSchemaPath: T } = l, w = r.length, R = w === h.minItems && (w === h.maxItems || h[t] === !1);
|
|
6803
6732
|
if (v.strictTuples && !R) {
|
|
6804
6733
|
const _ = `"${o}" is ${w}-tuple, but minItems or maxItems/${t} are not specified or different at path "${T}"`;
|
|
6805
|
-
(0,
|
|
6734
|
+
(0, Ur.checkStrictMode)(l, _, v.strictTuples);
|
|
6806
6735
|
}
|
|
6807
6736
|
}
|
|
6808
6737
|
}
|
|
6809
|
-
Yt.validateTuple =
|
|
6810
|
-
Yt.default =
|
|
6738
|
+
Yt.validateTuple = No;
|
|
6739
|
+
Yt.default = Zu;
|
|
6811
6740
|
Object.defineProperty(hs, "__esModule", { value: !0 });
|
|
6812
|
-
const
|
|
6741
|
+
const Xu = Yt, ed = {
|
|
6813
6742
|
keyword: "prefixItems",
|
|
6814
6743
|
type: "array",
|
|
6815
6744
|
schemaType: ["array"],
|
|
6816
6745
|
before: "uniqueItems",
|
|
6817
|
-
code: (e) => (0,
|
|
6746
|
+
code: (e) => (0, Xu.validateTuple)(e, "items")
|
|
6818
6747
|
};
|
|
6819
|
-
hs.default =
|
|
6748
|
+
hs.default = ed;
|
|
6820
6749
|
var ms = {};
|
|
6821
6750
|
Object.defineProperty(ms, "__esModule", { value: !0 });
|
|
6822
|
-
const di = G,
|
|
6751
|
+
const di = G, td = re, rd = B, nd = Jt, sd = {
|
|
6823
6752
|
message: ({ params: { len: e } }) => (0, di.str)`must NOT have more than ${e} items`,
|
|
6824
6753
|
params: ({ params: { len: e } }) => (0, di._)`{limit: ${e}}`
|
|
6825
|
-
},
|
|
6754
|
+
}, id = {
|
|
6826
6755
|
keyword: "items",
|
|
6827
6756
|
type: "array",
|
|
6828
6757
|
schemaType: ["object", "boolean"],
|
|
6829
6758
|
before: "uniqueItems",
|
|
6830
|
-
error:
|
|
6759
|
+
error: sd,
|
|
6831
6760
|
code(e) {
|
|
6832
6761
|
const { schema: t, parentSchema: r, it: n } = e, { prefixItems: s } = r;
|
|
6833
|
-
n.items = !0, !(0,
|
|
6762
|
+
n.items = !0, !(0, td.alwaysValidSchema)(n, t) && (s ? (0, nd.validateAdditionalItems)(e, s) : e.ok((0, rd.validateArray)(e)));
|
|
6834
6763
|
}
|
|
6835
6764
|
};
|
|
6836
|
-
ms.default =
|
|
6765
|
+
ms.default = id;
|
|
6837
6766
|
var ys = {};
|
|
6838
6767
|
Object.defineProperty(ys, "__esModule", { value: !0 });
|
|
6839
|
-
const Ce = G, Nr = re,
|
|
6768
|
+
const Ce = G, Nr = re, od = {
|
|
6840
6769
|
message: ({ params: { min: e, max: t } }) => t === void 0 ? (0, Ce.str)`must contain at least ${e} valid item(s)` : (0, Ce.str)`must contain at least ${e} and no more than ${t} valid item(s)`,
|
|
6841
6770
|
params: ({ params: { min: e, max: t } }) => t === void 0 ? (0, Ce._)`{minContains: ${e}}` : (0, Ce._)`{minContains: ${e}, maxContains: ${t}}`
|
|
6842
|
-
},
|
|
6771
|
+
}, ad = {
|
|
6843
6772
|
keyword: "contains",
|
|
6844
6773
|
type: "array",
|
|
6845
6774
|
schemaType: ["object", "boolean"],
|
|
6846
6775
|
before: "uniqueItems",
|
|
6847
6776
|
trackErrors: !0,
|
|
6848
|
-
error:
|
|
6777
|
+
error: od,
|
|
6849
6778
|
code(e) {
|
|
6850
6779
|
const { gen: t, schema: r, parentSchema: n, data: s, it: i } = e;
|
|
6851
6780
|
let o, l;
|
|
@@ -6887,8 +6816,8 @@ const Ce = G, Nr = re, cd = {
|
|
|
6887
6816
|
}
|
|
6888
6817
|
}
|
|
6889
6818
|
};
|
|
6890
|
-
ys.default =
|
|
6891
|
-
var
|
|
6819
|
+
ys.default = ad;
|
|
6820
|
+
var jo = {};
|
|
6892
6821
|
(function(e) {
|
|
6893
6822
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
|
|
6894
6823
|
const t = G, r = re, n = B;
|
|
@@ -6958,20 +6887,20 @@ var Io = {};
|
|
|
6958
6887
|
), d.ok(w));
|
|
6959
6888
|
}
|
|
6960
6889
|
e.validateSchemaDeps = l, e.default = s;
|
|
6961
|
-
})(
|
|
6890
|
+
})(jo);
|
|
6962
6891
|
var gs = {};
|
|
6963
6892
|
Object.defineProperty(gs, "__esModule", { value: !0 });
|
|
6964
|
-
const
|
|
6893
|
+
const Io = G, cd = re, ld = {
|
|
6965
6894
|
message: "property name must be valid",
|
|
6966
|
-
params: ({ params: e }) => (0,
|
|
6967
|
-
},
|
|
6895
|
+
params: ({ params: e }) => (0, Io._)`{propertyName: ${e.propertyName}}`
|
|
6896
|
+
}, ud = {
|
|
6968
6897
|
keyword: "propertyNames",
|
|
6969
6898
|
type: "object",
|
|
6970
6899
|
schemaType: ["object", "boolean"],
|
|
6971
|
-
error:
|
|
6900
|
+
error: ld,
|
|
6972
6901
|
code(e) {
|
|
6973
6902
|
const { gen: t, schema: r, data: n, it: s } = e;
|
|
6974
|
-
if ((0,
|
|
6903
|
+
if ((0, cd.alwaysValidSchema)(s, r))
|
|
6975
6904
|
return;
|
|
6976
6905
|
const i = t.name("valid");
|
|
6977
6906
|
t.forIn("key", n, (o) => {
|
|
@@ -6981,25 +6910,25 @@ const Ao = G, ud = re, dd = {
|
|
|
6981
6910
|
dataTypes: ["string"],
|
|
6982
6911
|
propertyName: o,
|
|
6983
6912
|
compositeRule: !0
|
|
6984
|
-
}, i), t.if((0,
|
|
6913
|
+
}, i), t.if((0, Io.not)(i), () => {
|
|
6985
6914
|
e.error(!0), s.allErrors || t.break();
|
|
6986
6915
|
});
|
|
6987
6916
|
}), e.ok(i);
|
|
6988
6917
|
}
|
|
6989
6918
|
};
|
|
6990
|
-
gs.default =
|
|
6991
|
-
var
|
|
6992
|
-
Object.defineProperty(
|
|
6993
|
-
const jr = B, je = G,
|
|
6919
|
+
gs.default = ud;
|
|
6920
|
+
var wn = {};
|
|
6921
|
+
Object.defineProperty(wn, "__esModule", { value: !0 });
|
|
6922
|
+
const jr = B, je = G, dd = Ke, Ir = re, pd = {
|
|
6994
6923
|
message: "must NOT have additional properties",
|
|
6995
6924
|
params: ({ params: e }) => (0, je._)`{additionalProperty: ${e.additionalProperty}}`
|
|
6996
|
-
},
|
|
6925
|
+
}, fd = {
|
|
6997
6926
|
keyword: "additionalProperties",
|
|
6998
6927
|
type: ["object"],
|
|
6999
6928
|
schemaType: ["boolean", "object"],
|
|
7000
6929
|
allowUndefined: !0,
|
|
7001
6930
|
trackErrors: !0,
|
|
7002
|
-
error:
|
|
6931
|
+
error: pd,
|
|
7003
6932
|
code(e) {
|
|
7004
6933
|
const { gen: t, schema: r, parentSchema: n, data: s, errsCount: i, it: o } = e;
|
|
7005
6934
|
if (!i)
|
|
@@ -7008,7 +6937,7 @@ const jr = B, je = G, fd = Ke, Ir = re, hd = {
|
|
|
7008
6937
|
if (o.props = !0, d.removeAdditional !== "all" && (0, Ir.alwaysValidSchema)(o, r))
|
|
7009
6938
|
return;
|
|
7010
6939
|
const u = (0, jr.allSchemaProperties)(n.properties), p = (0, jr.allSchemaProperties)(n.patternProperties);
|
|
7011
|
-
h(), e.ok((0, je._)`${i} === ${
|
|
6940
|
+
h(), e.ok((0, je._)`${i} === ${dd.default.errors}`);
|
|
7012
6941
|
function h() {
|
|
7013
6942
|
t.forIn("key", s, (_) => {
|
|
7014
6943
|
!u.length && !p.length ? w(_) : t.if(v(_), () => w(_));
|
|
@@ -7056,16 +6985,16 @@ const jr = B, je = G, fd = Ke, Ir = re, hd = {
|
|
|
7056
6985
|
}
|
|
7057
6986
|
}
|
|
7058
6987
|
};
|
|
7059
|
-
|
|
6988
|
+
wn.default = fd;
|
|
7060
6989
|
var $s = {};
|
|
7061
6990
|
Object.defineProperty($s, "__esModule", { value: !0 });
|
|
7062
|
-
const
|
|
6991
|
+
const hd = Ae, pi = B, On = re, fi = wn, md = {
|
|
7063
6992
|
keyword: "properties",
|
|
7064
6993
|
type: "object",
|
|
7065
6994
|
schemaType: "object",
|
|
7066
6995
|
code(e) {
|
|
7067
6996
|
const { gen: t, schema: r, parentSchema: n, data: s, it: i } = e;
|
|
7068
|
-
i.opts.removeAdditional === "all" && n.additionalProperties === void 0 && fi.default.code(new
|
|
6997
|
+
i.opts.removeAdditional === "all" && n.additionalProperties === void 0 && fi.default.code(new hd.KeywordCxt(i, fi.default, "additionalProperties"));
|
|
7069
6998
|
const o = (0, pi.allSchemaProperties)(r);
|
|
7070
6999
|
for (const h of o)
|
|
7071
7000
|
i.definedProperties.add(h);
|
|
@@ -7088,10 +7017,10 @@ const yd = Ae, pi = B, On = re, fi = vn, gd = {
|
|
|
7088
7017
|
}
|
|
7089
7018
|
}
|
|
7090
7019
|
};
|
|
7091
|
-
$s.default =
|
|
7020
|
+
$s.default = md;
|
|
7092
7021
|
var _s = {};
|
|
7093
7022
|
Object.defineProperty(_s, "__esModule", { value: !0 });
|
|
7094
|
-
const hi = B, Ar = G, mi = re, yi = re,
|
|
7023
|
+
const hi = B, Ar = G, mi = re, yi = re, yd = {
|
|
7095
7024
|
keyword: "patternProperties",
|
|
7096
7025
|
type: "object",
|
|
7097
7026
|
schemaType: "object",
|
|
@@ -7126,16 +7055,16 @@ const hi = B, Ar = G, mi = re, yi = re, $d = {
|
|
|
7126
7055
|
}
|
|
7127
7056
|
}
|
|
7128
7057
|
};
|
|
7129
|
-
_s.default =
|
|
7058
|
+
_s.default = yd;
|
|
7130
7059
|
var ws = {};
|
|
7131
7060
|
Object.defineProperty(ws, "__esModule", { value: !0 });
|
|
7132
|
-
const
|
|
7061
|
+
const gd = re, $d = {
|
|
7133
7062
|
keyword: "not",
|
|
7134
7063
|
schemaType: ["object", "boolean"],
|
|
7135
7064
|
trackErrors: !0,
|
|
7136
7065
|
code(e) {
|
|
7137
7066
|
const { gen: t, schema: r, it: n } = e;
|
|
7138
|
-
if ((0,
|
|
7067
|
+
if ((0, gd.alwaysValidSchema)(n, r)) {
|
|
7139
7068
|
e.fail();
|
|
7140
7069
|
return;
|
|
7141
7070
|
}
|
|
@@ -7149,27 +7078,27 @@ const _d = re, wd = {
|
|
|
7149
7078
|
},
|
|
7150
7079
|
error: { message: "must NOT be valid" }
|
|
7151
7080
|
};
|
|
7152
|
-
ws.default =
|
|
7081
|
+
ws.default = $d;
|
|
7153
7082
|
var vs = {};
|
|
7154
7083
|
Object.defineProperty(vs, "__esModule", { value: !0 });
|
|
7155
|
-
const
|
|
7084
|
+
const _d = B, wd = {
|
|
7156
7085
|
keyword: "anyOf",
|
|
7157
7086
|
schemaType: "array",
|
|
7158
7087
|
trackErrors: !0,
|
|
7159
|
-
code:
|
|
7088
|
+
code: _d.validateUnion,
|
|
7160
7089
|
error: { message: "must match a schema in anyOf" }
|
|
7161
7090
|
};
|
|
7162
|
-
vs.default =
|
|
7091
|
+
vs.default = wd;
|
|
7163
7092
|
var bs = {};
|
|
7164
7093
|
Object.defineProperty(bs, "__esModule", { value: !0 });
|
|
7165
|
-
const
|
|
7094
|
+
const Lr = G, vd = re, bd = {
|
|
7166
7095
|
message: "must match exactly one schema in oneOf",
|
|
7167
|
-
params: ({ params: e }) => (0,
|
|
7168
|
-
},
|
|
7096
|
+
params: ({ params: e }) => (0, Lr._)`{passingSchemas: ${e.passing}}`
|
|
7097
|
+
}, Pd = {
|
|
7169
7098
|
keyword: "oneOf",
|
|
7170
7099
|
schemaType: "array",
|
|
7171
7100
|
trackErrors: !0,
|
|
7172
|
-
error:
|
|
7101
|
+
error: bd,
|
|
7173
7102
|
code(e) {
|
|
7174
7103
|
const { gen: t, schema: r, parentSchema: n, it: s } = e;
|
|
7175
7104
|
if (!Array.isArray(r))
|
|
@@ -7181,21 +7110,21 @@ const Hr = G, Pd = re, Ed = {
|
|
|
7181
7110
|
function u() {
|
|
7182
7111
|
i.forEach((p, h) => {
|
|
7183
7112
|
let v;
|
|
7184
|
-
(0,
|
|
7113
|
+
(0, vd.alwaysValidSchema)(s, p) ? t.var(d, !0) : v = e.subschema({
|
|
7185
7114
|
keyword: "oneOf",
|
|
7186
7115
|
schemaProp: h,
|
|
7187
7116
|
compositeRule: !0
|
|
7188
|
-
}, d), h > 0 && t.if((0,
|
|
7189
|
-
t.assign(o, !0), t.assign(l, h), v && e.mergeEvaluated(v,
|
|
7117
|
+
}, d), h > 0 && t.if((0, Lr._)`${d} && ${o}`).assign(o, !1).assign(l, (0, Lr._)`[${l}, ${h}]`).else(), t.if(d, () => {
|
|
7118
|
+
t.assign(o, !0), t.assign(l, h), v && e.mergeEvaluated(v, Lr.Name);
|
|
7190
7119
|
});
|
|
7191
7120
|
});
|
|
7192
7121
|
}
|
|
7193
7122
|
}
|
|
7194
7123
|
};
|
|
7195
|
-
bs.default =
|
|
7124
|
+
bs.default = Pd;
|
|
7196
7125
|
var Ps = {};
|
|
7197
7126
|
Object.defineProperty(Ps, "__esModule", { value: !0 });
|
|
7198
|
-
const
|
|
7127
|
+
const Ed = re, Sd = {
|
|
7199
7128
|
keyword: "allOf",
|
|
7200
7129
|
schemaType: "array",
|
|
7201
7130
|
code(e) {
|
|
@@ -7204,27 +7133,27 @@ const Td = re, Rd = {
|
|
|
7204
7133
|
throw new Error("ajv implementation error");
|
|
7205
7134
|
const s = t.name("valid");
|
|
7206
7135
|
r.forEach((i, o) => {
|
|
7207
|
-
if ((0,
|
|
7136
|
+
if ((0, Ed.alwaysValidSchema)(n, i))
|
|
7208
7137
|
return;
|
|
7209
7138
|
const l = e.subschema({ keyword: "allOf", schemaProp: o }, s);
|
|
7210
7139
|
e.ok(s), e.mergeEvaluated(l);
|
|
7211
7140
|
});
|
|
7212
7141
|
}
|
|
7213
7142
|
};
|
|
7214
|
-
Ps.default =
|
|
7143
|
+
Ps.default = Sd;
|
|
7215
7144
|
var Es = {};
|
|
7216
7145
|
Object.defineProperty(Es, "__esModule", { value: !0 });
|
|
7217
|
-
const
|
|
7218
|
-
message: ({ params: e }) => (0,
|
|
7219
|
-
params: ({ params: e }) => (0,
|
|
7220
|
-
},
|
|
7146
|
+
const Kr = G, Ao = re, Td = {
|
|
7147
|
+
message: ({ params: e }) => (0, Kr.str)`must match "${e.ifClause}" schema`,
|
|
7148
|
+
params: ({ params: e }) => (0, Kr._)`{failingKeyword: ${e.ifClause}}`
|
|
7149
|
+
}, Rd = {
|
|
7221
7150
|
keyword: "if",
|
|
7222
7151
|
schemaType: ["object", "boolean"],
|
|
7223
7152
|
trackErrors: !0,
|
|
7224
|
-
error:
|
|
7153
|
+
error: Td,
|
|
7225
7154
|
code(e) {
|
|
7226
7155
|
const { gen: t, parentSchema: r, it: n } = e;
|
|
7227
|
-
r.then === void 0 && r.else === void 0 && (0,
|
|
7156
|
+
r.then === void 0 && r.else === void 0 && (0, Ao.checkStrictMode)(n, '"if" without "then" and "else" is ignored');
|
|
7228
7157
|
const s = gi(n, "then"), i = gi(n, "else");
|
|
7229
7158
|
if (!s && !i)
|
|
7230
7159
|
return;
|
|
@@ -7233,7 +7162,7 @@ const Jr = G, Do = re, kd = {
|
|
|
7233
7162
|
const p = t.let("ifClause");
|
|
7234
7163
|
e.setParams({ ifClause: p }), t.if(l, u("then", p), u("else", p));
|
|
7235
7164
|
} else
|
|
7236
|
-
s ? t.if(l, u("then")) : t.if((0,
|
|
7165
|
+
s ? t.if(l, u("then")) : t.if((0, Kr.not)(l), u("else"));
|
|
7237
7166
|
e.pass(o, () => e.error(!0));
|
|
7238
7167
|
function d() {
|
|
7239
7168
|
const p = e.subschema({
|
|
@@ -7247,58 +7176,58 @@ const Jr = G, Do = re, kd = {
|
|
|
7247
7176
|
function u(p, h) {
|
|
7248
7177
|
return () => {
|
|
7249
7178
|
const v = e.subschema({ keyword: p }, l);
|
|
7250
|
-
t.assign(o, l), e.mergeValidEvaluated(v, o), h ? t.assign(h, (0,
|
|
7179
|
+
t.assign(o, l), e.mergeValidEvaluated(v, o), h ? t.assign(h, (0, Kr._)`${p}`) : e.setParams({ ifClause: p });
|
|
7251
7180
|
};
|
|
7252
7181
|
}
|
|
7253
7182
|
}
|
|
7254
7183
|
};
|
|
7255
7184
|
function gi(e, t) {
|
|
7256
7185
|
const r = e.schema[t];
|
|
7257
|
-
return r !== void 0 && !(0,
|
|
7186
|
+
return r !== void 0 && !(0, Ao.alwaysValidSchema)(e, r);
|
|
7258
7187
|
}
|
|
7259
|
-
Es.default =
|
|
7188
|
+
Es.default = Rd;
|
|
7260
7189
|
var Ss = {};
|
|
7261
7190
|
Object.defineProperty(Ss, "__esModule", { value: !0 });
|
|
7262
|
-
const
|
|
7191
|
+
const kd = re, Od = {
|
|
7263
7192
|
keyword: ["then", "else"],
|
|
7264
7193
|
schemaType: ["object", "boolean"],
|
|
7265
7194
|
code({ keyword: e, parentSchema: t, it: r }) {
|
|
7266
|
-
t.if === void 0 && (0,
|
|
7195
|
+
t.if === void 0 && (0, kd.checkStrictMode)(r, `"${e}" without "if" is ignored`);
|
|
7267
7196
|
}
|
|
7268
7197
|
};
|
|
7269
|
-
Ss.default =
|
|
7198
|
+
Ss.default = Od;
|
|
7270
7199
|
Object.defineProperty(fs, "__esModule", { value: !0 });
|
|
7271
|
-
const
|
|
7272
|
-
function
|
|
7200
|
+
const Cd = Jt, Nd = hs, jd = Yt, Id = ms, Ad = ys, Dd = jo, Fd = gs, qd = wn, Md = $s, Ud = _s, Ld = ws, Hd = vs, zd = bs, Vd = Ps, Wd = Es, xd = Ss;
|
|
7201
|
+
function Bd(e = !1) {
|
|
7273
7202
|
const t = [
|
|
7274
7203
|
// any
|
|
7204
|
+
Ld.default,
|
|
7205
|
+
Hd.default,
|
|
7275
7206
|
zd.default,
|
|
7276
7207
|
Vd.default,
|
|
7277
|
-
xd.default,
|
|
7278
7208
|
Wd.default,
|
|
7279
|
-
|
|
7280
|
-
Gd.default,
|
|
7209
|
+
xd.default,
|
|
7281
7210
|
// object
|
|
7282
|
-
|
|
7283
|
-
Ud.default,
|
|
7211
|
+
Fd.default,
|
|
7284
7212
|
qd.default,
|
|
7285
|
-
|
|
7286
|
-
|
|
7213
|
+
Dd.default,
|
|
7214
|
+
Md.default,
|
|
7215
|
+
Ud.default
|
|
7287
7216
|
];
|
|
7288
|
-
return e ? t.push(
|
|
7217
|
+
return e ? t.push(Nd.default, Id.default) : t.push(Cd.default, jd.default), t.push(Ad.default), t;
|
|
7289
7218
|
}
|
|
7290
|
-
fs.default =
|
|
7219
|
+
fs.default = Bd;
|
|
7291
7220
|
var Ts = {}, Rs = {};
|
|
7292
7221
|
Object.defineProperty(Rs, "__esModule", { value: !0 });
|
|
7293
|
-
const fe = G,
|
|
7222
|
+
const fe = G, Gd = {
|
|
7294
7223
|
message: ({ schemaCode: e }) => (0, fe.str)`must match format "${e}"`,
|
|
7295
7224
|
params: ({ schemaCode: e }) => (0, fe._)`{format: ${e}}`
|
|
7296
|
-
},
|
|
7225
|
+
}, Kd = {
|
|
7297
7226
|
keyword: "format",
|
|
7298
7227
|
type: ["number", "string"],
|
|
7299
7228
|
schemaType: "string",
|
|
7300
7229
|
$data: !0,
|
|
7301
|
-
error:
|
|
7230
|
+
error: Gd,
|
|
7302
7231
|
code(e, t) {
|
|
7303
7232
|
const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: l } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self: h } = l;
|
|
7304
7233
|
if (!d.validateFormats)
|
|
@@ -7353,10 +7282,10 @@ const fe = G, Jd = {
|
|
|
7353
7282
|
}
|
|
7354
7283
|
}
|
|
7355
7284
|
};
|
|
7356
|
-
Rs.default =
|
|
7285
|
+
Rs.default = Kd;
|
|
7357
7286
|
Object.defineProperty(Ts, "__esModule", { value: !0 });
|
|
7358
|
-
const
|
|
7359
|
-
Ts.default =
|
|
7287
|
+
const Jd = Rs, Yd = [Jd.default];
|
|
7288
|
+
Ts.default = Yd;
|
|
7360
7289
|
var Kt = {};
|
|
7361
7290
|
Object.defineProperty(Kt, "__esModule", { value: !0 });
|
|
7362
7291
|
Kt.contentVocabulary = Kt.metadataVocabulary = void 0;
|
|
@@ -7375,30 +7304,30 @@ Kt.contentVocabulary = [
|
|
|
7375
7304
|
"contentSchema"
|
|
7376
7305
|
];
|
|
7377
7306
|
Object.defineProperty(Zn, "__esModule", { value: !0 });
|
|
7378
|
-
const
|
|
7379
|
-
|
|
7307
|
+
const Qd = Xn, Zd = ts, Xd = fs, ep = Ts, $i = Kt, tp = [
|
|
7308
|
+
Qd.default,
|
|
7309
|
+
Zd.default,
|
|
7310
|
+
(0, Xd.default)(),
|
|
7380
7311
|
ep.default,
|
|
7381
|
-
(0, tp.default)(),
|
|
7382
|
-
rp.default,
|
|
7383
7312
|
$i.metadataVocabulary,
|
|
7384
7313
|
$i.contentVocabulary
|
|
7385
7314
|
];
|
|
7386
|
-
Zn.default =
|
|
7387
|
-
var ks = {},
|
|
7315
|
+
Zn.default = tp;
|
|
7316
|
+
var ks = {}, Do = {};
|
|
7388
7317
|
(function(e) {
|
|
7389
7318
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.DiscrError = void 0, function(t) {
|
|
7390
7319
|
t.Tag = "tag", t.Mapping = "mapping";
|
|
7391
7320
|
}(e.DiscrError || (e.DiscrError = {}));
|
|
7392
|
-
})(
|
|
7321
|
+
})(Do);
|
|
7393
7322
|
Object.defineProperty(ks, "__esModule", { value: !0 });
|
|
7394
|
-
const Mt = G, Mn =
|
|
7323
|
+
const Mt = G, Mn = Do, _i = Se, rp = re, np = {
|
|
7395
7324
|
message: ({ params: { discrError: e, tagName: t } }) => e === Mn.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
|
|
7396
7325
|
params: ({ params: { discrError: e, tag: t, tagName: r } }) => (0, Mt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`
|
|
7397
|
-
},
|
|
7326
|
+
}, sp = {
|
|
7398
7327
|
keyword: "discriminator",
|
|
7399
7328
|
type: "object",
|
|
7400
7329
|
schemaType: "object",
|
|
7401
|
-
error:
|
|
7330
|
+
error: np,
|
|
7402
7331
|
code(e) {
|
|
7403
7332
|
const { gen: t, data: r, schema: n, parentSchema: s, it: i } = e, { oneOf: o } = s;
|
|
7404
7333
|
if (!i.opts.discriminator)
|
|
@@ -7429,7 +7358,7 @@ const Mt = G, Mn = Fo, _i = Se, sp = re, ip = {
|
|
|
7429
7358
|
let _ = !0;
|
|
7430
7359
|
for (let j = 0; j < o.length; j++) {
|
|
7431
7360
|
let D = o[j];
|
|
7432
|
-
D != null && D.$ref && !(0,
|
|
7361
|
+
D != null && D.$ref && !(0, rp.schemaHasRulesButRef)(D, i.self.RULES) && (D = _i.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, D == null ? void 0 : D.$ref), D instanceof _i.SchemaEnv && (D = D.schema));
|
|
7433
7362
|
const b = (T = D == null ? void 0 : D.properties) === null || T === void 0 ? void 0 : T[l];
|
|
7434
7363
|
if (typeof b != "object")
|
|
7435
7364
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
|
|
@@ -7458,8 +7387,8 @@ const Mt = G, Mn = Fo, _i = Se, sp = re, ip = {
|
|
|
7458
7387
|
}
|
|
7459
7388
|
}
|
|
7460
7389
|
};
|
|
7461
|
-
ks.default =
|
|
7462
|
-
const
|
|
7390
|
+
ks.default = sp;
|
|
7391
|
+
const ip = "http://json-schema.org/draft-07/schema#", op = "http://json-schema.org/draft-07/schema#", ap = "Core schema meta-schema", cp = {
|
|
7463
7392
|
schemaArray: {
|
|
7464
7393
|
type: "array",
|
|
7465
7394
|
minItems: 1,
|
|
@@ -7500,10 +7429,10 @@ const ap = "http://json-schema.org/draft-07/schema#", cp = "http://json-schema.o
|
|
|
7500
7429
|
uniqueItems: !0,
|
|
7501
7430
|
default: []
|
|
7502
7431
|
}
|
|
7503
|
-
},
|
|
7432
|
+
}, lp = [
|
|
7504
7433
|
"object",
|
|
7505
7434
|
"boolean"
|
|
7506
|
-
],
|
|
7435
|
+
], up = {
|
|
7507
7436
|
$id: {
|
|
7508
7437
|
type: "string",
|
|
7509
7438
|
format: "uri-reference"
|
|
@@ -7691,18 +7620,18 @@ const ap = "http://json-schema.org/draft-07/schema#", cp = "http://json-schema.o
|
|
|
7691
7620
|
not: {
|
|
7692
7621
|
$ref: "#"
|
|
7693
7622
|
}
|
|
7694
|
-
},
|
|
7695
|
-
$schema:
|
|
7696
|
-
$id:
|
|
7697
|
-
title:
|
|
7698
|
-
definitions:
|
|
7699
|
-
type:
|
|
7700
|
-
properties:
|
|
7623
|
+
}, dp = {
|
|
7624
|
+
$schema: ip,
|
|
7625
|
+
$id: op,
|
|
7626
|
+
title: ap,
|
|
7627
|
+
definitions: cp,
|
|
7628
|
+
type: lp,
|
|
7629
|
+
properties: up,
|
|
7701
7630
|
default: !0
|
|
7702
7631
|
};
|
|
7703
7632
|
(function(e, t) {
|
|
7704
7633
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = void 0;
|
|
7705
|
-
const r =
|
|
7634
|
+
const r = eo, n = Zn, s = ks, i = dp, o = ["/properties"], l = "http://json-schema.org/draft-07/schema";
|
|
7706
7635
|
class d extends r.default {
|
|
7707
7636
|
_addVocabularies() {
|
|
7708
7637
|
super._addVocabularies(), n.default.forEach((w) => this.addVocabulary(w)), this.opts.discriminator && this.addKeyword(s.default);
|
|
@@ -7745,8 +7674,8 @@ const ap = "http://json-schema.org/draft-07/schema#", cp = "http://json-schema.o
|
|
|
7745
7674
|
return v.default;
|
|
7746
7675
|
} });
|
|
7747
7676
|
})(jn, jn.exports);
|
|
7748
|
-
var
|
|
7749
|
-
const
|
|
7677
|
+
var pp = jn.exports;
|
|
7678
|
+
const fp = /* @__PURE__ */ vc(pp), hp = "http://json-schema.org/schema", mp = "#/definitions/Blueprint", yp = {
|
|
7750
7679
|
Blueprint: {
|
|
7751
7680
|
type: "object",
|
|
7752
7681
|
properties: {
|
|
@@ -8188,9 +8117,6 @@ const mp = /* @__PURE__ */ Pc(hp), yp = "http://json-schema.org/schema", gp = "#
|
|
|
8188
8117
|
disableWpNewBlogNotification: {
|
|
8189
8118
|
type: "boolean"
|
|
8190
8119
|
},
|
|
8191
|
-
makeEditorFrameControlled: {
|
|
8192
|
-
type: "boolean"
|
|
8193
|
-
},
|
|
8194
8120
|
prepareForRunningInsideWebBrowser: {
|
|
8195
8121
|
type: "boolean"
|
|
8196
8122
|
},
|
|
@@ -9189,13 +9115,13 @@ for existing apps using this option.`
|
|
|
9189
9115
|
},
|
|
9190
9116
|
additionalProperties: !1
|
|
9191
9117
|
}
|
|
9192
|
-
},
|
|
9193
|
-
$schema:
|
|
9194
|
-
$ref:
|
|
9195
|
-
definitions:
|
|
9118
|
+
}, gp = {
|
|
9119
|
+
$schema: hp,
|
|
9120
|
+
$ref: mp,
|
|
9121
|
+
definitions: yp
|
|
9196
9122
|
};
|
|
9197
|
-
function
|
|
9198
|
-
progress: t = new
|
|
9123
|
+
function $p(e, {
|
|
9124
|
+
progress: t = new yn(),
|
|
9199
9125
|
semaphore: r = new Ln({ concurrency: 3 }),
|
|
9200
9126
|
onStepCompleted: n = () => {
|
|
9201
9127
|
}
|
|
@@ -9203,7 +9129,7 @@ function wp(e, {
|
|
|
9203
9129
|
var u, p, h;
|
|
9204
9130
|
if (e = {
|
|
9205
9131
|
...e,
|
|
9206
|
-
steps: (e.steps || []).filter(
|
|
9132
|
+
steps: (e.steps || []).filter(Pp)
|
|
9207
9133
|
}, e.constants && e.steps.unshift({
|
|
9208
9134
|
step: "defineWpConfigConsts",
|
|
9209
9135
|
consts: e.constants
|
|
@@ -9227,7 +9153,7 @@ function wp(e, {
|
|
|
9227
9153
|
step: "login",
|
|
9228
9154
|
...e.login === !0 ? { username: "admin", password: "password" } : e.login
|
|
9229
9155
|
});
|
|
9230
|
-
const { valid: s, errors: i } =
|
|
9156
|
+
const { valid: s, errors: i } = wp(e);
|
|
9231
9157
|
if (!s) {
|
|
9232
9158
|
const v = new Error(
|
|
9233
9159
|
`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`
|
|
@@ -9241,7 +9167,7 @@ function wp(e, {
|
|
|
9241
9167
|
},
|
|
9242
9168
|
0
|
|
9243
9169
|
), d = o.map(
|
|
9244
|
-
(v) =>
|
|
9170
|
+
(v) => Ep(v, {
|
|
9245
9171
|
semaphore: r,
|
|
9246
9172
|
rootProgressTracker: t,
|
|
9247
9173
|
totalProgressWeight: l
|
|
@@ -9249,14 +9175,14 @@ function wp(e, {
|
|
|
9249
9175
|
);
|
|
9250
9176
|
return {
|
|
9251
9177
|
versions: {
|
|
9252
|
-
php:
|
|
9178
|
+
php: vp(
|
|
9253
9179
|
(u = e.preferredVersions) == null ? void 0 : u.php,
|
|
9254
9180
|
Vn,
|
|
9255
|
-
|
|
9181
|
+
Ja
|
|
9256
9182
|
),
|
|
9257
9183
|
wp: ((p = e.preferredVersions) == null ? void 0 : p.wp) || "latest"
|
|
9258
9184
|
},
|
|
9259
|
-
phpExtensions:
|
|
9185
|
+
phpExtensions: bp(
|
|
9260
9186
|
[],
|
|
9261
9187
|
e.phpExtensionBundles || []
|
|
9262
9188
|
),
|
|
@@ -9285,11 +9211,11 @@ function wp(e, {
|
|
|
9285
9211
|
}
|
|
9286
9212
|
};
|
|
9287
9213
|
}
|
|
9288
|
-
const
|
|
9214
|
+
const _p = new fp({ discriminator: !0 });
|
|
9289
9215
|
let Dr;
|
|
9290
|
-
function
|
|
9216
|
+
function wp(e) {
|
|
9291
9217
|
var s;
|
|
9292
|
-
Dr =
|
|
9218
|
+
Dr = _p.compile(gp);
|
|
9293
9219
|
const t = Dr(e);
|
|
9294
9220
|
if (t)
|
|
9295
9221
|
return { valid: t };
|
|
@@ -9304,21 +9230,21 @@ function bp(e) {
|
|
|
9304
9230
|
errors: n
|
|
9305
9231
|
};
|
|
9306
9232
|
}
|
|
9307
|
-
function
|
|
9233
|
+
function vp(e, t, r) {
|
|
9308
9234
|
return e && t.includes(e) ? e : r;
|
|
9309
9235
|
}
|
|
9310
|
-
function
|
|
9311
|
-
const r =
|
|
9236
|
+
function bp(e, t) {
|
|
9237
|
+
const r = Di.filter(
|
|
9312
9238
|
(s) => e.includes(s)
|
|
9313
9239
|
), n = t.flatMap(
|
|
9314
9240
|
(s) => s in Zs ? Zs[s] : []
|
|
9315
9241
|
);
|
|
9316
9242
|
return Array.from(/* @__PURE__ */ new Set([...r, ...n]));
|
|
9317
9243
|
}
|
|
9318
|
-
function
|
|
9244
|
+
function Pp(e) {
|
|
9319
9245
|
return !!(typeof e == "object" && e);
|
|
9320
9246
|
}
|
|
9321
|
-
function
|
|
9247
|
+
function Ep(e, {
|
|
9322
9248
|
semaphore: t,
|
|
9323
9249
|
rootProgressTracker: r,
|
|
9324
9250
|
totalProgressWeight: n
|
|
@@ -9329,16 +9255,16 @@ function Tp(e, {
|
|
|
9329
9255
|
), i = {};
|
|
9330
9256
|
for (const h of Object.keys(e)) {
|
|
9331
9257
|
let v = e[h];
|
|
9332
|
-
|
|
9258
|
+
dc(v) && (v = St.create(v, {
|
|
9333
9259
|
semaphore: t
|
|
9334
9260
|
})), i[h] = v;
|
|
9335
9261
|
}
|
|
9336
9262
|
const o = async (h) => {
|
|
9337
9263
|
var v;
|
|
9338
9264
|
try {
|
|
9339
|
-
return s.fillSlowly(), await
|
|
9265
|
+
return s.fillSlowly(), await Fa[e.step](
|
|
9340
9266
|
h,
|
|
9341
|
-
await
|
|
9267
|
+
await Sp(i),
|
|
9342
9268
|
{
|
|
9343
9269
|
tracker: s,
|
|
9344
9270
|
initialCaption: (v = e.progress) == null ? void 0 : v.caption
|
|
@@ -9362,7 +9288,7 @@ function wi(e) {
|
|
|
9362
9288
|
}
|
|
9363
9289
|
return t;
|
|
9364
9290
|
}
|
|
9365
|
-
async function
|
|
9291
|
+
async function Sp(e) {
|
|
9366
9292
|
const t = {};
|
|
9367
9293
|
for (const r in e) {
|
|
9368
9294
|
const n = e[r];
|
|
@@ -9370,18 +9296,18 @@ async function Rp(e) {
|
|
|
9370
9296
|
}
|
|
9371
9297
|
return t;
|
|
9372
9298
|
}
|
|
9373
|
-
async function
|
|
9299
|
+
async function Tp(e, t) {
|
|
9374
9300
|
await e.run(t);
|
|
9375
9301
|
}
|
|
9376
|
-
function
|
|
9302
|
+
function Bp() {
|
|
9377
9303
|
}
|
|
9378
9304
|
/**
|
|
9379
9305
|
* @license
|
|
9380
9306
|
* Copyright 2019 Google LLC
|
|
9381
9307
|
* SPDX-License-Identifier: Apache-2.0
|
|
9382
9308
|
*/
|
|
9383
|
-
const
|
|
9384
|
-
canHandle: (e) =>
|
|
9309
|
+
const Fo = Symbol("Comlink.proxy"), Rp = Symbol("Comlink.endpoint"), kp = Symbol("Comlink.releaseProxy"), Cn = Symbol("Comlink.finalizer"), Hr = Symbol("Comlink.thrown"), qo = (e) => typeof e == "object" && e !== null || typeof e == "function", Op = {
|
|
9310
|
+
canHandle: (e) => qo(e) && e[Fo],
|
|
9385
9311
|
serialize(e) {
|
|
9386
9312
|
const { port1: t, port2: r } = new MessageChannel();
|
|
9387
9313
|
return Os(e, t), [r, [r]];
|
|
@@ -9389,8 +9315,8 @@ const qo = Symbol("Comlink.proxy"), Op = Symbol("Comlink.endpoint"), Cp = Symbol
|
|
|
9389
9315
|
deserialize(e) {
|
|
9390
9316
|
return e.start(), Cs(e);
|
|
9391
9317
|
}
|
|
9392
|
-
},
|
|
9393
|
-
canHandle: (e) =>
|
|
9318
|
+
}, Cp = {
|
|
9319
|
+
canHandle: (e) => qo(e) && Hr in e,
|
|
9394
9320
|
serialize({ value: e }) {
|
|
9395
9321
|
let t;
|
|
9396
9322
|
return e instanceof Error ? t = {
|
|
@@ -9406,10 +9332,10 @@ const qo = Symbol("Comlink.proxy"), Op = Symbol("Comlink.endpoint"), Cp = Symbol
|
|
|
9406
9332
|
throw e.isError ? Object.assign(new Error(e.value.message), e.value) : e.value;
|
|
9407
9333
|
}
|
|
9408
9334
|
}, yr = /* @__PURE__ */ new Map([
|
|
9409
|
-
["proxy",
|
|
9410
|
-
["throw",
|
|
9335
|
+
["proxy", Op],
|
|
9336
|
+
["throw", Cp]
|
|
9411
9337
|
]);
|
|
9412
|
-
function
|
|
9338
|
+
function Np(e, t) {
|
|
9413
9339
|
for (const r of e)
|
|
9414
9340
|
if (t === r || r === "*" || r instanceof RegExp && r.test(t))
|
|
9415
9341
|
return !0;
|
|
@@ -9419,7 +9345,7 @@ function Os(e, t = globalThis, r = ["*"]) {
|
|
|
9419
9345
|
t.addEventListener("message", function n(s) {
|
|
9420
9346
|
if (!s || !s.data)
|
|
9421
9347
|
return;
|
|
9422
|
-
if (!
|
|
9348
|
+
if (!Np(r, s.origin)) {
|
|
9423
9349
|
console.warn(`Invalid origin '${s.origin}' for comlink proxy`);
|
|
9424
9350
|
return;
|
|
9425
9351
|
}
|
|
@@ -9440,13 +9366,13 @@ function Os(e, t = globalThis, r = ["*"]) {
|
|
|
9440
9366
|
case "CONSTRUCT":
|
|
9441
9367
|
{
|
|
9442
9368
|
const v = new h(...d);
|
|
9443
|
-
u =
|
|
9369
|
+
u = Ho(v);
|
|
9444
9370
|
}
|
|
9445
9371
|
break;
|
|
9446
9372
|
case "ENDPOINT":
|
|
9447
9373
|
{
|
|
9448
9374
|
const { port1: v, port2: T } = new MessageChannel();
|
|
9449
|
-
Os(e, T), u =
|
|
9375
|
+
Os(e, T), u = Fp(v, [v]);
|
|
9450
9376
|
}
|
|
9451
9377
|
break;
|
|
9452
9378
|
case "RELEASE":
|
|
@@ -9456,25 +9382,25 @@ function Os(e, t = globalThis, r = ["*"]) {
|
|
|
9456
9382
|
return;
|
|
9457
9383
|
}
|
|
9458
9384
|
} catch (p) {
|
|
9459
|
-
u = { value: p, [
|
|
9385
|
+
u = { value: p, [Hr]: 0 };
|
|
9460
9386
|
}
|
|
9461
|
-
Promise.resolve(u).catch((p) => ({ value: p, [
|
|
9462
|
-
const [h, v] =
|
|
9463
|
-
t.postMessage(Object.assign(Object.assign({}, h), { id: i }), v), o === "RELEASE" && (t.removeEventListener("message", n),
|
|
9387
|
+
Promise.resolve(u).catch((p) => ({ value: p, [Hr]: 0 })).then((p) => {
|
|
9388
|
+
const [h, v] = Qr(p);
|
|
9389
|
+
t.postMessage(Object.assign(Object.assign({}, h), { id: i }), v), o === "RELEASE" && (t.removeEventListener("message", n), Mo(t), Cn in e && typeof e[Cn] == "function" && e[Cn]());
|
|
9464
9390
|
}).catch((p) => {
|
|
9465
|
-
const [h, v] =
|
|
9391
|
+
const [h, v] = Qr({
|
|
9466
9392
|
value: new TypeError("Unserializable return value"),
|
|
9467
|
-
[
|
|
9393
|
+
[Hr]: 0
|
|
9468
9394
|
});
|
|
9469
9395
|
t.postMessage(Object.assign(Object.assign({}, h), { id: i }), v);
|
|
9470
9396
|
});
|
|
9471
9397
|
}), t.start && t.start();
|
|
9472
9398
|
}
|
|
9473
|
-
function
|
|
9399
|
+
function jp(e) {
|
|
9474
9400
|
return e.constructor.name === "MessagePort";
|
|
9475
9401
|
}
|
|
9476
|
-
function
|
|
9477
|
-
|
|
9402
|
+
function Mo(e) {
|
|
9403
|
+
jp(e) && e.close();
|
|
9478
9404
|
}
|
|
9479
9405
|
function Cs(e, t) {
|
|
9480
9406
|
return Un(e, [], t);
|
|
@@ -9483,32 +9409,32 @@ function Fr(e) {
|
|
|
9483
9409
|
if (e)
|
|
9484
9410
|
throw new Error("Proxy has been released and is not useable");
|
|
9485
9411
|
}
|
|
9486
|
-
function
|
|
9412
|
+
function Uo(e) {
|
|
9487
9413
|
return Ut(e, {
|
|
9488
9414
|
type: "RELEASE"
|
|
9489
9415
|
}).then(() => {
|
|
9490
|
-
|
|
9416
|
+
Mo(e);
|
|
9491
9417
|
});
|
|
9492
9418
|
}
|
|
9493
|
-
const
|
|
9494
|
-
const t = (
|
|
9495
|
-
|
|
9419
|
+
const Jr = /* @__PURE__ */ new WeakMap(), Yr = "FinalizationRegistry" in globalThis && new FinalizationRegistry((e) => {
|
|
9420
|
+
const t = (Jr.get(e) || 0) - 1;
|
|
9421
|
+
Jr.set(e, t), t === 0 && Uo(e);
|
|
9496
9422
|
});
|
|
9497
|
-
function
|
|
9498
|
-
const r = (
|
|
9499
|
-
|
|
9423
|
+
function Ip(e, t) {
|
|
9424
|
+
const r = (Jr.get(t) || 0) + 1;
|
|
9425
|
+
Jr.set(t, r), Yr && Yr.register(e, t, e);
|
|
9500
9426
|
}
|
|
9501
|
-
function
|
|
9502
|
-
|
|
9427
|
+
function Ap(e) {
|
|
9428
|
+
Yr && Yr.unregister(e);
|
|
9503
9429
|
}
|
|
9504
9430
|
function Un(e, t = [], r = function() {
|
|
9505
9431
|
}) {
|
|
9506
9432
|
let n = !1;
|
|
9507
9433
|
const s = new Proxy(r, {
|
|
9508
9434
|
get(i, o) {
|
|
9509
|
-
if (Fr(n), o ===
|
|
9435
|
+
if (Fr(n), o === kp)
|
|
9510
9436
|
return () => {
|
|
9511
|
-
|
|
9437
|
+
Ap(s), Uo(e), n = !0;
|
|
9512
9438
|
};
|
|
9513
9439
|
if (o === "then") {
|
|
9514
9440
|
if (t.length === 0)
|
|
@@ -9523,7 +9449,7 @@ function Un(e, t = [], r = function() {
|
|
|
9523
9449
|
},
|
|
9524
9450
|
set(i, o, l) {
|
|
9525
9451
|
Fr(n);
|
|
9526
|
-
const [d, u] =
|
|
9452
|
+
const [d, u] = Qr(l);
|
|
9527
9453
|
return Ut(e, {
|
|
9528
9454
|
type: "SET",
|
|
9529
9455
|
path: [...t, o].map((p) => p.toString()),
|
|
@@ -9533,7 +9459,7 @@ function Un(e, t = [], r = function() {
|
|
|
9533
9459
|
apply(i, o, l) {
|
|
9534
9460
|
Fr(n);
|
|
9535
9461
|
const d = t[t.length - 1];
|
|
9536
|
-
if (d ===
|
|
9462
|
+
if (d === Rp)
|
|
9537
9463
|
return Ut(e, {
|
|
9538
9464
|
type: "ENDPOINT"
|
|
9539
9465
|
}).then(gt);
|
|
@@ -9556,30 +9482,30 @@ function Un(e, t = [], r = function() {
|
|
|
9556
9482
|
}, d).then(gt);
|
|
9557
9483
|
}
|
|
9558
9484
|
});
|
|
9559
|
-
return
|
|
9485
|
+
return Ip(s, e), s;
|
|
9560
9486
|
}
|
|
9561
|
-
function
|
|
9487
|
+
function Dp(e) {
|
|
9562
9488
|
return Array.prototype.concat.apply([], e);
|
|
9563
9489
|
}
|
|
9564
9490
|
function vi(e) {
|
|
9565
|
-
const t = e.map(
|
|
9566
|
-
return [t.map((r) => r[0]),
|
|
9491
|
+
const t = e.map(Qr);
|
|
9492
|
+
return [t.map((r) => r[0]), Dp(t.map((r) => r[1]))];
|
|
9567
9493
|
}
|
|
9568
|
-
const
|
|
9569
|
-
function
|
|
9570
|
-
return
|
|
9494
|
+
const Lo = /* @__PURE__ */ new WeakMap();
|
|
9495
|
+
function Fp(e, t) {
|
|
9496
|
+
return Lo.set(e, t), e;
|
|
9571
9497
|
}
|
|
9572
|
-
function
|
|
9573
|
-
return Object.assign(e, { [
|
|
9498
|
+
function Ho(e) {
|
|
9499
|
+
return Object.assign(e, { [Fo]: !0 });
|
|
9574
9500
|
}
|
|
9575
|
-
function
|
|
9501
|
+
function qp(e, t = globalThis, r = "*") {
|
|
9576
9502
|
return {
|
|
9577
9503
|
postMessage: (n, s) => e.postMessage(n, r, s),
|
|
9578
9504
|
addEventListener: t.addEventListener.bind(t),
|
|
9579
9505
|
removeEventListener: t.removeEventListener.bind(t)
|
|
9580
9506
|
};
|
|
9581
9507
|
}
|
|
9582
|
-
function
|
|
9508
|
+
function Qr(e) {
|
|
9583
9509
|
for (const [t, r] of yr)
|
|
9584
9510
|
if (r.canHandle(e)) {
|
|
9585
9511
|
const [n, s] = r.serialize(e);
|
|
@@ -9597,7 +9523,7 @@ function Zr(e) {
|
|
|
9597
9523
|
type: "RAW",
|
|
9598
9524
|
value: e
|
|
9599
9525
|
},
|
|
9600
|
-
|
|
9526
|
+
Lo.get(e) || []
|
|
9601
9527
|
];
|
|
9602
9528
|
}
|
|
9603
9529
|
function gt(e) {
|
|
@@ -9610,36 +9536,36 @@ function gt(e) {
|
|
|
9610
9536
|
}
|
|
9611
9537
|
function Ut(e, t, r) {
|
|
9612
9538
|
return new Promise((n) => {
|
|
9613
|
-
const s =
|
|
9539
|
+
const s = Mp();
|
|
9614
9540
|
e.addEventListener("message", function i(o) {
|
|
9615
9541
|
!o.data || !o.data.id || o.data.id !== s || (e.removeEventListener("message", i), n(o.data));
|
|
9616
9542
|
}), e.start && e.start(), e.postMessage(Object.assign({ id: s }, t), r);
|
|
9617
9543
|
});
|
|
9618
9544
|
}
|
|
9619
|
-
function
|
|
9545
|
+
function Mp() {
|
|
9620
9546
|
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
|
9621
9547
|
}
|
|
9622
|
-
function
|
|
9623
|
-
|
|
9624
|
-
const t = e instanceof Worker ? e :
|
|
9548
|
+
function zo(e) {
|
|
9549
|
+
Lp();
|
|
9550
|
+
const t = e instanceof Worker ? e : qp(e), r = Cs(t), n = Vo(r);
|
|
9625
9551
|
return new Proxy(n, {
|
|
9626
9552
|
get: (s, i) => i === "isConnected" ? async () => {
|
|
9627
9553
|
for (let o = 0; o < 10; o++)
|
|
9628
9554
|
try {
|
|
9629
|
-
await
|
|
9555
|
+
await Up(r.isConnected(), 200);
|
|
9630
9556
|
break;
|
|
9631
9557
|
} catch {
|
|
9632
9558
|
}
|
|
9633
9559
|
} : r[i]
|
|
9634
9560
|
});
|
|
9635
9561
|
}
|
|
9636
|
-
async function
|
|
9562
|
+
async function Up(e, t) {
|
|
9637
9563
|
return new Promise((r, n) => {
|
|
9638
9564
|
setTimeout(n, t), e.then(r);
|
|
9639
9565
|
});
|
|
9640
9566
|
}
|
|
9641
9567
|
let bi = !1;
|
|
9642
|
-
function
|
|
9568
|
+
function Lp() {
|
|
9643
9569
|
bi || (bi = !0, yr.set("EVENT", {
|
|
9644
9570
|
canHandle: (e) => e instanceof CustomEvent,
|
|
9645
9571
|
serialize: (e) => [
|
|
@@ -9669,37 +9595,37 @@ function zp() {
|
|
|
9669
9595
|
}
|
|
9670
9596
|
}));
|
|
9671
9597
|
}
|
|
9672
|
-
function
|
|
9598
|
+
function Vo(e) {
|
|
9673
9599
|
return new Proxy(e, {
|
|
9674
9600
|
get(t, r) {
|
|
9675
9601
|
switch (typeof t[r]) {
|
|
9676
9602
|
case "function":
|
|
9677
9603
|
return (...n) => t[r](...n);
|
|
9678
9604
|
case "object":
|
|
9679
|
-
return t[r] === null ? t[r] :
|
|
9605
|
+
return t[r] === null ? t[r] : Vo(t[r]);
|
|
9680
9606
|
case "undefined":
|
|
9681
9607
|
case "number":
|
|
9682
9608
|
case "string":
|
|
9683
9609
|
return t[r];
|
|
9684
9610
|
default:
|
|
9685
|
-
return
|
|
9611
|
+
return Ho(t[r]);
|
|
9686
9612
|
}
|
|
9687
9613
|
}
|
|
9688
9614
|
});
|
|
9689
9615
|
}
|
|
9690
|
-
async function
|
|
9616
|
+
async function Hp({
|
|
9691
9617
|
iframe: e,
|
|
9692
9618
|
blueprint: t,
|
|
9693
9619
|
remoteUrl: r,
|
|
9694
|
-
progressTracker: n = new
|
|
9620
|
+
progressTracker: n = new yn(),
|
|
9695
9621
|
disableProgressBar: s,
|
|
9696
9622
|
onBlueprintStepCompleted: i
|
|
9697
9623
|
}) {
|
|
9698
|
-
if (
|
|
9624
|
+
if (Vp(r), zp(e), r = Ei(r, {
|
|
9699
9625
|
progressbar: !s
|
|
9700
9626
|
}), n.setCaption("Preparing WordPress"), !t)
|
|
9701
9627
|
return Pi(e, r, n);
|
|
9702
|
-
const o =
|
|
9628
|
+
const o = $p(t, {
|
|
9703
9629
|
progress: n.stage(0.5),
|
|
9704
9630
|
onStepCompleted: i
|
|
9705
9631
|
}), l = await Pi(
|
|
@@ -9712,9 +9638,9 @@ async function Vp({
|
|
|
9712
9638
|
}),
|
|
9713
9639
|
n
|
|
9714
9640
|
);
|
|
9715
|
-
return await
|
|
9641
|
+
return await Tp(o, l), n.finish(), l;
|
|
9716
9642
|
}
|
|
9717
|
-
function
|
|
9643
|
+
function zp(e) {
|
|
9718
9644
|
var t, r;
|
|
9719
9645
|
(t = e.sandbox) != null && t.length && !((r = e.sandbox) != null && r.contains("allow-storage-access-by-user-activation")) && e.sandbox.add("allow-storage-access-by-user-activation");
|
|
9720
9646
|
}
|
|
@@ -9722,23 +9648,23 @@ async function Pi(e, t, r) {
|
|
|
9722
9648
|
await new Promise((i) => {
|
|
9723
9649
|
e.src = t, e.addEventListener("load", i, !1);
|
|
9724
9650
|
});
|
|
9725
|
-
const n =
|
|
9651
|
+
const n = zo(
|
|
9726
9652
|
e.contentWindow
|
|
9727
9653
|
);
|
|
9728
9654
|
await n.isConnected(), r.pipe(n);
|
|
9729
9655
|
const s = r.stage();
|
|
9730
9656
|
return await n.onDownloadProgress(s.loadingListener), await n.isReady(), s.finish(), n;
|
|
9731
9657
|
}
|
|
9732
|
-
const
|
|
9733
|
-
function
|
|
9734
|
-
const t = new URL(e,
|
|
9735
|
-
if ((t.origin ===
|
|
9658
|
+
const zr = "https://playground.wordpress.net";
|
|
9659
|
+
function Vp(e) {
|
|
9660
|
+
const t = new URL(e, zr);
|
|
9661
|
+
if ((t.origin === zr || t.hostname === "localhost") && t.pathname !== "/remote.html")
|
|
9736
9662
|
throw new Error(
|
|
9737
|
-
`Invalid remote URL: ${t}. Expected origin to be ${
|
|
9663
|
+
`Invalid remote URL: ${t}. Expected origin to be ${zr}/remote.html.`
|
|
9738
9664
|
);
|
|
9739
9665
|
}
|
|
9740
9666
|
function Ei(e, t) {
|
|
9741
|
-
const r = new URL(e,
|
|
9667
|
+
const r = new URL(e, zr), n = new URLSearchParams(r.search);
|
|
9742
9668
|
for (const [s, i] of Object.entries(t))
|
|
9743
9669
|
if (i != null && i !== !1)
|
|
9744
9670
|
if (Array.isArray(i))
|
|
@@ -9748,57 +9674,57 @@ function Ei(e, t) {
|
|
|
9748
9674
|
n.set(s, i.toString());
|
|
9749
9675
|
return r.search = n.toString(), r.toString();
|
|
9750
9676
|
}
|
|
9751
|
-
async function
|
|
9677
|
+
async function Gp(e, t) {
|
|
9752
9678
|
if (console.warn(
|
|
9753
9679
|
"`connectPlayground` is deprecated and will be removed. Use `startPlayground` instead."
|
|
9754
9680
|
), t != null && t.loadRemote)
|
|
9755
|
-
return
|
|
9681
|
+
return Hp({
|
|
9756
9682
|
iframe: e,
|
|
9757
9683
|
remoteUrl: t.loadRemote
|
|
9758
9684
|
});
|
|
9759
|
-
const r =
|
|
9685
|
+
const r = zo(
|
|
9760
9686
|
e.contentWindow
|
|
9761
9687
|
);
|
|
9762
9688
|
return await r.isConnected(), r;
|
|
9763
9689
|
}
|
|
9764
9690
|
export {
|
|
9765
|
-
|
|
9691
|
+
Ja as LatestSupportedPHPVersion,
|
|
9766
9692
|
Vn as SupportedPHPVersions,
|
|
9767
|
-
|
|
9693
|
+
xp as SupportedPHPVersionsList,
|
|
9768
9694
|
Ri as activatePlugin,
|
|
9769
9695
|
ki as activateTheme,
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9696
|
+
pa as applyWordPressPatches,
|
|
9697
|
+
$p as compileBlueprint,
|
|
9698
|
+
Gp as connectPlayground,
|
|
9699
|
+
_a as cp,
|
|
9700
|
+
Pa as defineSiteUrl,
|
|
9775
9701
|
ur as defineWpConfigConsts,
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9702
|
+
Ra as exportWXR,
|
|
9703
|
+
ka as exportWXZ,
|
|
9704
|
+
Ea as importFile,
|
|
9705
|
+
Ta as importWordPressFiles,
|
|
9706
|
+
Oa as installPlugin,
|
|
9707
|
+
Ca as installTheme,
|
|
9708
|
+
Na as login,
|
|
9709
|
+
va as mkdir,
|
|
9710
|
+
wa as mv,
|
|
9785
9711
|
gr as phpVar,
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9712
|
+
hn as phpVars,
|
|
9713
|
+
$a as request,
|
|
9714
|
+
Ci as rm,
|
|
9715
|
+
ba as rmdir,
|
|
9716
|
+
Tp as runBlueprintSteps,
|
|
9717
|
+
ha as runPHP,
|
|
9718
|
+
ma as runPHPWithOptions,
|
|
9719
|
+
ya as runSql,
|
|
9720
|
+
ja as runWpInstallationWizard,
|
|
9721
|
+
ga as setPhpIniEntry,
|
|
9722
|
+
Bp as setPluginProxyURL,
|
|
9723
|
+
Ia as setSiteOptions,
|
|
9724
|
+
Hp as startPlaygroundWeb,
|
|
9799
9725
|
Hn as unzip,
|
|
9800
|
-
|
|
9726
|
+
Aa as updateUserMeta,
|
|
9801
9727
|
Ti as wpContentFilesExcludedFromExport,
|
|
9802
|
-
|
|
9803
|
-
|
|
9728
|
+
Ni as writeFile,
|
|
9729
|
+
Da as zipWpContent
|
|
9804
9730
|
};
|