@wp-playground/blueprints 0.2.0 → 0.3.1

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/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zr=async(t,{pluginPath:e,pluginName:r},n)=>{n?.tracker.setCaption(`Activating ${r||e}`);const s=[`${await t.documentRoot}/wp-load.php`,`${await t.documentRoot}/wp-admin/includes/plugin.php`];if(!s.every(l=>t.fileExists(l)))throw new Error(`Required WordPress files do not exist: ${s.join(", ")}`);if((await t.run({code:`<?php
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vr=async(t,{pluginPath:e,pluginName:r},n)=>{n?.tracker.setCaption(`Activating ${r||e}`);const s=[`${await t.documentRoot}/wp-load.php`,`${await t.documentRoot}/wp-admin/includes/plugin.php`];if(!s.every(l=>t.fileExists(l)))throw new Error(`Required WordPress files do not exist: ${s.join(", ")}`);if((await t.run({code:`<?php
2
2
  define( 'WP_ADMIN', true );
3
3
  ${s.map(l=>`require_once( '${l}' );`).join(`
4
4
  `)}
@@ -16,27 +16,345 @@ foreach ( ( glob( $plugin_path . '/*.php' ) ?: array() ) as $file ) {
16
16
  }
17
17
  }
18
18
  echo 'NO_ENTRY_FILE';
19
- `})).text.endsWith("NO_ENTRY_FILE"))throw new Error("Could not find plugin entry file.")},Hr=async(t,{themeFolderName:e},r)=>{r?.tracker.setCaption(`Activating ${e}`);const n=`${await t.documentRoot}/wp-load.php`;if(!t.fileExists(n))throw new Error(`Required WordPress file does not exist: ${n}`);await t.run({code:`<?php
19
+ `})).text.endsWith("NO_ENTRY_FILE"))throw new Error("Could not find plugin entry file.")},zr=async(t,{themeFolderName:e},r)=>{r?.tracker.setCaption(`Activating ${e}`);const n=`${await t.documentRoot}/wp-load.php`;if(!t.fileExists(n))throw new Error(`Required WordPress file does not exist: ${n}`);await t.run({code:`<?php
20
20
  define( 'WP_ADMIN', true );
21
21
  require_once( '${n}' );
22
22
  switch_theme( '${e}' );
23
- `})};function _r(t){const e=t.split(".").shift().replace(/-/g," ");return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}async function Ht(t,e,r){let n="";await t.fileExists(e)&&(n=await t.readFileAsText(e)),await t.writeFile(e,r(n))}async function Ji(t){return new Uint8Array(await t.arrayBuffer())}class Yi extends File{constructor(e,r){super(e,r),this.buffers=e}async arrayBuffer(){return this.buffers[0]}}const Wr=File.prototype.arrayBuffer instanceof Function?File:Yi,Jn="/vfs-blueprints",wr=async(t,{consts:e,virtualize:r=!1})=>{const n=await t.documentRoot,s=r?Jn:n,i=`${s}/playground-consts.json`,a=`${s}/wp-config.php`;return r&&(t.mkdir(Jn),t.setPhpIniEntry("auto_prepend_file",a)),await Ht(t,i,l=>JSON.stringify({...JSON.parse(l||"{}"),...e})),await Ht(t,a,l=>l.includes("playground-consts.json")?l:`<?php
23
+ `})};function wr(t){const e=t.split(".").shift().replace(/-/g," ");return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}async function at(t,e,r){let n="";await t.fileExists(e)&&(n=await t.readFileAsText(e)),await t.writeFile(e,r(n))}async function xi(t){return new Uint8Array(await t.arrayBuffer())}class Ji extends File{constructor(e,r){super(e,r),this.buffers=e}async arrayBuffer(){return this.buffers[0]}}const Wr=File.prototype.arrayBuffer instanceof Function?File:Ji,Gn="/vfs-blueprints",Et=async(t,{consts:e,virtualize:r=!1})=>{const n=await t.documentRoot,s=r?Gn:n,i=`${s}/playground-consts.json`,c=`${s}/wp-config.php`;return r&&(t.mkdir(Gn),t.setPhpIniEntry("auto_prepend_file",c)),await at(t,i,l=>JSON.stringify({...JSON.parse(l||"{}"),...e})),await at(t,c,l=>l.includes("playground-consts.json")?l:`<?php
24
24
  $consts = json_decode(file_get_contents('${i}'), true);
25
25
  foreach ($consts as $const => $value) {
26
26
  if (!defined($const)) {
27
27
  define($const, $value);
28
28
  }
29
29
  }
30
- ?>${l}`),a},Ns=async(t,e)=>{const r=new xi(t,e.wordpressPath||"/wordpress",e.siteUrl);e.addPhpInfo===!0&&await r.addPhpInfo(),e.siteUrl&&await r.patchSiteUrl(),e.patchSecrets===!0&&await r.patchSecrets(),e.disableSiteHealth===!0&&await r.disableSiteHealth(),e.disableWpNewBlogNotification===!0&&await r.disableWpNewBlogNotification()};class xi{constructor(e,r,n){this.php=e,this.scopedSiteUrl=n,this.wordpressPath=r}async addPhpInfo(){await this.php.writeFile(`${this.wordpressPath}/phpinfo.php`,"<?php phpinfo(); ")}async patchSiteUrl(){await wr(this.php,{consts:{WP_HOME:this.scopedSiteUrl,WP_SITEURL:this.scopedSiteUrl},virtualize:!0})}async patchSecrets(){await Ht(this.php,`${this.wordpressPath}/wp-config.php`,e=>`<?php
31
- define('AUTH_KEY', '${Ge(40)}');
32
- define('SECURE_AUTH_KEY', '${Ge(40)}');
33
- define('LOGGED_IN_KEY', '${Ge(40)}');
34
- define('NONCE_KEY', '${Ge(40)}');
35
- define('AUTH_SALT', '${Ge(40)}');
36
- define('SECURE_AUTH_SALT', '${Ge(40)}');
37
- define('LOGGED_IN_SALT', '${Ge(40)}');
38
- define('NONCE_SALT', '${Ge(40)}');
39
- ?>${e.replaceAll("', 'put your unique phrase here'","__', ''")}`)}async disableSiteHealth(){await Ht(this.php,`${this.wordpressPath}/wp-includes/default-filters.php`,e=>e.replace(/add_filter[^;]+wp_maybe_grant_site_health_caps[^;]+;/i,""))}async disableWpNewBlogNotification(){await Ht(this.php,`${this.wordpressPath}/wp-config.php`,e=>`${e} function wp_new_blog_notification(...$args){} `)}}function Ge(t){const e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=-[]/.,<>?";let r="";for(let n=t;n>0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}const Os=async(t,{code:e})=>await t.run({code:e}),Cs=async(t,{options:e})=>await t.run(e),js=async(t,{key:e,value:r})=>{await t.setPhpIniEntry(e,r)},ks=async(t,{request:e})=>await t.request(e),Is=async(t,{fromPath:e,toPath:r})=>{await t.writeFile(r,await t.readFileAsBuffer(e))},As=async(t,{fromPath:e,toPath:r})=>{await t.mv(e,r)},Ds=async(t,{path:e})=>{await t.mkdir(e)},Fs=async(t,{path:e})=>{await t.unlink(e)},Ms=async(t,{path:e})=>{await t.rmdir(e)},Kr=async(t,{path:e,data:r})=>{r instanceof File&&(r=await Ji(r)),await t.writeFile(e,r)},Us=async(t,{siteUrl:e})=>await wr(t,{consts:{WP_HOME:e,WP_SITEURL:e}});class qs{constructor({concurrency:e}){this._running=0,this.concurrency=e,this.queue=[]}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency)await new Promise(e=>this.queue.push(e));else{this._running++;let e=!1;return()=>{e||(e=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(e){const r=await this.acquire();try{return await e()}finally{r()}}}const Zi=Symbol("literal");function St(t){if(typeof t=="string")return t.startsWith("$")?t:JSON.stringify(t);if(typeof t=="number")return t.toString();if(Array.isArray(t))return`array(${t.map(St).join(", ")})`;if(t===null)return"null";if(typeof t=="object")return Zi in t?t.toString():`array(${Object.entries(t).map(([r,n])=>`${JSON.stringify(r)} => ${St(n)}`).join(", ")})`;if(typeof t=="function")return t();throw new Error(`Unsupported value: ${t}`)}function Gr(t){const e={};for(const r in t)e[r]=St(t[r]);return e}const Yn=`<?php
30
+ ?>${l}`),c},Yi=`<?php
31
+
32
+ /**
33
+ * This transport delegates PHP HTTP requests to JavaScript synchronous XHR.
34
+ *
35
+ * This file isn't actually used. It's just here for reference and development. The actual
36
+ * PHP code used in WordPress is hardcoded copy residing in wordpress.mjs in the _patchWordPressCode
37
+ * function.
38
+ *
39
+ * @TODO Make the build pipeline use this exact file instead of creating it
40
+ * from within the JavaScript runtime.
41
+ */
42
+
43
+ class Requests_Transport_Fetch implements Requests_Transport
44
+ {
45
+ public $headers = '';
46
+
47
+ public function __construct()
48
+ {
49
+ }
50
+
51
+ public function __destruct()
52
+ {
53
+ }
54
+
55
+ /**
56
+ * Delegates PHP HTTP requests to JavaScript synchronous XHR.
57
+ *
58
+ * @TODO Implement handling for more $options such as cookies, filename, auth, etc.
59
+ *
60
+ * @param $url
61
+ * @param $headers
62
+ * @param $data
63
+ * @param $options
64
+ *
65
+ * @return false|string
66
+ */
67
+ public function request($url, $headers = array(), $data = array(), $options = array())
68
+ {
69
+ // Disable wp-cron requests that are extremely slow in node.js runtime environment.
70
+ // @TODO: Make wp-cron requests faster.
71
+ if (str_contains($url, '/wp-cron.php')) {
72
+ return false;
73
+ }
74
+
75
+ $headers = Requests::flatten($headers);
76
+ if (!empty($data)) {
77
+ $data_format = $options['data_format'];
78
+ if ($data_format === 'query') {
79
+ $url = self::format_get($url, $data);
80
+ $data = '';
81
+ } elseif (!is_string($data)) {
82
+ $data = http_build_query($data, null, '&');
83
+ }
84
+ }
85
+
86
+ $request = json_encode(json_encode(array(
87
+ 'headers' => $headers,
88
+ 'data' => $data,
89
+ 'url' => $url,
90
+ 'method' => $options['type'],
91
+ )));
92
+
93
+ $js = <<<JAVASCRIPT
94
+ const request = JSON.parse({$request});
95
+ console.log("Requesting " + request.url);
96
+ const xhr = new XMLHttpRequest();
97
+ xhr.open(
98
+ request.method,
99
+ request.url,
100
+ false // false makes the xhr synchronous
101
+ );
102
+ for ( var name in request.headers ) {
103
+ xhr.setRequestHeader(name, request.headers[name]);
104
+ }
105
+ xhr.send(request.data);
106
+
107
+ [
108
+ "HTTP/1.1 " + xhr.status + " " + xhr.statusText,
109
+ xhr.getAllResponseHeaders(),
110
+ "",
111
+ xhr.responseText
112
+ ].join("\\\\r\\\\n");
113
+ JAVASCRIPT;
114
+
115
+ $this->headers = vrzno_eval($js);
116
+
117
+ return $this->headers;
118
+ }
119
+
120
+ public function request_multiple($requests, $options)
121
+ {
122
+ $responses = array();
123
+ $class = get_class($this);
124
+ foreach ($requests as $id => $request) {
125
+ try {
126
+ $handler = new $class();
127
+ $responses[$id] = $handler->request($request['url'], $request['headers'], $request['data'], $request['options']);
128
+ $request['options']['hooks']->dispatch('transport.internal.parse_response', array(&$responses[$id], $request));
129
+ } catch (Requests_Exception $e) {
130
+ $responses[$id] = $e;
131
+ }
132
+ if (!is_string($responses[$id])) {
133
+ $request['options']['hooks']->dispatch('multiple.request.complete', array(&$responses[$id], $id));
134
+ }
135
+ }
136
+
137
+ return $responses;
138
+ }
139
+
140
+ protected static function format_get($url, $data)
141
+ {
142
+ if (!empty($data)) {
143
+ $query = '';
144
+ $url_parts = parse_url($url);
145
+ if (empty($url_parts['query'])) {
146
+ $url_parts['query'] = '';
147
+ } else {
148
+ $query = $url_parts['query'];
149
+ }
150
+ $query .= '&' . http_build_query($data, null, '&');
151
+ $query = trim($query, '&');
152
+ if (empty($url_parts['query'])) {
153
+ $url .= '?' . $query;
154
+ } else {
155
+ $url = str_replace($url_parts['query'], $query, $url);
156
+ }
157
+ }
158
+
159
+ return $url;
160
+ }
161
+
162
+ public static function test($capabilities = array())
163
+ {
164
+ if (!function_exists('vrzno_eval')) {
165
+ return false;
166
+ }
167
+
168
+ if (vrzno_eval("typeof XMLHttpRequest;") !== 'function') {
169
+ return false;
170
+ }
171
+
172
+ return true;
173
+ }
174
+ }
175
+ `,Zi=`<?php
176
+
177
+ /**
178
+ * This transport does not perform any HTTP requests and only exists
179
+ * to prevent the Requests class from complaining about not having any
180
+ * transports.
181
+ */
182
+ class Requests_Transport_Dummy implements Requests_Transport
183
+ {
184
+ public $headers = '';
185
+
186
+ public function __construct()
187
+ {
188
+ }
189
+
190
+ public function __destruct()
191
+ {
192
+ }
193
+
194
+ public function request($url, $headers = array(), $data = array(), $options = array())
195
+ {
196
+ return false;
197
+ }
198
+
199
+ public function request_multiple($requests, $options)
200
+ {
201
+ $responses = array();
202
+ foreach ($requests as $id => $request) {
203
+ $responses[] = false;
204
+ }
205
+ return $responses;
206
+ }
207
+
208
+ protected static function format_get($url, $data)
209
+ {
210
+ return $url;
211
+ }
212
+
213
+ public static function test($capabilities = array())
214
+ {
215
+ return true;
216
+ }
217
+ }
218
+ `,Qi=`<?php
219
+ /**
220
+ * The default WordPress requests transports have been disabled
221
+ * at this point. However, the Requests class requires at least
222
+ * one working transport or else it throws warnings and acts up.
223
+ *
224
+ * This mu-plugin provides that transport. It's one of the two:
225
+ *
226
+ * * Requests_Transport_Fetch – Sends requests using browser's fetch() function.
227
+ * Only enabled when PHP was compiled with the VRZNO
228
+ * extension.
229
+ * * Requests_Transport_Dummy – Does not send any requests and only exists to keep
230
+ * the Requests class happy.
231
+ */
232
+ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
233
+ require(__DIR__ . '/includes/requests_transport_fetch.php');
234
+ Requests::add_transport('Requests_Transport_Fetch');
235
+ add_filter('http_request_host_is_external', function ($arg) {
236
+ return true;
237
+ });
238
+ } else {
239
+ require(__DIR__ . '/includes/requests_transport_dummy.php');
240
+ Requests::add_transport('Requests_Transport_Dummy');
241
+ }
242
+ `,Xi=`<?php
243
+ /**
244
+ * Add a notice to wp-login.php offering the username and password.
245
+ */
246
+
247
+ add_action(
248
+ 'login_message',
249
+ function() {
250
+ return <<<EOT
251
+ <div class="message info">
252
+ <strong>username:</strong> <code>admin</code><br /><strong>password</strong>: <code>password</code>
253
+ </div>
254
+ EOT;
255
+ }
256
+ );
257
+ `,eo=`<?php
258
+ /**
259
+ * Because the in-browser Playground doesn't have access to the internet,
260
+ * network-dependent features like directories don't work. Normally, you'll
261
+ * see a confusing message like "An unexpected error occurred." This mu-plugin
262
+ * makes it more clear that the feature is not yet supported.
263
+ *
264
+ * https://github.com/WordPress/wordpress-playground/issues/498
265
+ */
266
+
267
+ add_filter( 'plugins_api_result', function( $res ) {
268
+ if($res instanceof WP_Error) {
269
+ $res = new WP_Error(
270
+ 'plugins_api_failed',
271
+ 'Playground <a href="https://github.com/WordPress/wordpress-playground/issues/85">does not yet support</a> connecting to the plugin directory yet. 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).'
272
+ );
273
+ }
274
+ return $res;
275
+ } );
276
+
277
+ add_filter( 'gettext', function( $translation ) {
278
+ // There is no better hook for swapping the error message
279
+ // on the themes page, unfortunately.
280
+ global $pagenow;
281
+
282
+ // Only change the message on /wp-admin/theme-install.php
283
+ if( 'theme-install.php' !== $pagenow ) {
284
+ return $translation;
285
+ }
286
+
287
+ if($translation === 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.') {
288
+ return 'Playground <a href="https://github.com/WordPress/wordpress-playground/issues/85">does not yet support</a> connecting to the themes directory yet. You can still upload a theme or install it using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?theme=pendant).';
289
+ }
290
+ return $translation;
291
+ } );
292
+ `,to=`<?php
293
+ /**
294
+ * Links with target="top" don't work in the playground iframe because of
295
+ * the sandbox attribute. What they really should be targeting is the
296
+ * playground iframe itself (name="playground"). This mu-plugin rewrites
297
+ * all target="_top" links to target="playground" instead.
298
+ *
299
+ * https://github.com/WordPress/wordpress-playground/issues/266
300
+ */
301
+
302
+ add_action('admin_print_scripts', function () {
303
+ ?>
304
+ <script>
305
+ document.addEventListener('click', function (event) {
306
+ if (event.target.tagName === 'A' && ['_parent', '_top'].includes(event.target.target)) {
307
+ event.target.target = 'wordpress-playground';
308
+ }
309
+ });
310
+ <\/script>
311
+ <?php
312
+ });
313
+ `,Ts=async(t,e)=>{const r=new ro(t,e.wordpressPath||"/wordpress",e.siteUrl);e.addPhpInfo===!0&&await r.addPhpInfo(),e.siteUrl&&await r.patchSiteUrl(),e.patchSecrets===!0&&await r.patchSecrets(),e.disableSiteHealth===!0&&await r.disableSiteHealth(),e.disableWpNewBlogNotification===!0&&await r.disableWpNewBlogNotification(),e.makeEditorFrameControlled===!0&&await Rs(t,r.wordpressPath,[`${r.wordpressPath}/wp-includes/js/dist/block-editor.js`,`${r.wordpressPath}/wp-includes/js/dist/block-editor.min.js`]),e.prepareForRunningInsideWebBrowser===!0&&await r.prepareForRunningInsideWebBrowser()};class ro{constructor(e,r,n){this.php=e,this.scopedSiteUrl=n,this.wordpressPath=r}async addPhpInfo(){await this.php.writeFile(`${this.wordpressPath}/phpinfo.php`,"<?php phpinfo(); ")}async patchSiteUrl(){await Et(this.php,{consts:{WP_HOME:this.scopedSiteUrl,WP_SITEURL:this.scopedSiteUrl},virtualize:!0})}async patchSecrets(){await Et(this.php,{consts:{AUTH_KEY:Be(40),SECURE_AUTH_KEY:Be(40),LOGGED_IN_KEY:Be(40),NONCE_KEY:Be(40),AUTH_SALT:Be(40),SECURE_AUTH_SALT:Be(40),LOGGED_IN_SALT:Be(40),NONCE_SALT:Be(40)}}),await at(this.php,`${this.wordpressPath}/wp-config.php`,e=>e.replaceAll("', 'put your unique phrase here'","__', ''"))}async disableSiteHealth(){await at(this.php,`${this.wordpressPath}/wp-includes/default-filters.php`,e=>e.replace(/add_filter[^;]+wp_maybe_grant_site_health_caps[^;]+;/i,""))}async disableWpNewBlogNotification(){await at(this.php,`${this.wordpressPath}/wp-config.php`,e=>`${e} function wp_new_blog_notification(...$args){} `)}async prepareForRunningInsideWebBrowser(){await Et(this.php,{consts:{USE_FETCH_FOR_REQUESTS:!1}});const e=[`${this.wordpressPath}/wp-includes/Requests/Transport/fsockopen.php`,`${this.wordpressPath}/wp-includes/Requests/Transport/cURL.php`];for(const r of e)await this.php.fileExists(r)&&await at(this.php,r,n=>n.replace("public static function test","public static function test( $capabilities = array() ) { return false; } public static function test2"));await this.php.mkdirTree(`${this.wordpressPath}/wp-content/mu-plugins/includes`),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/includes/requests_transport_fetch.php`,Yi),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/includes/requests_transport_dummy.php`,Zi),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/add_requests_transport.php`,Qi),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/1-show-admin-credentials-on-wp-login.php`,Xi),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/2-nice-error-messages-for-plugins-and-themes-directories.php`,eo),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/3-links-targeting-top-frame-should-target-playground-iframe.php`,to)}}function Be(t){const e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=-[]/.,<>?";let r="";for(let n=t;n>0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}async function Rs(t,e,r){const n=`
314
+ /**
315
+ * A synchronous function to read a blob URL as text.
316
+ *
317
+ * @param {string} url
318
+ * @returns {string}
319
+ */
320
+ const __playground_readBlobAsText = function (url) {
321
+ try {
322
+ let xhr = new XMLHttpRequest();
323
+ xhr.open('GET', url, false);
324
+ xhr.overrideMimeType('text/plain;charset=utf-8');
325
+ xhr.send();
326
+ return xhr.responseText;
327
+ } catch(e) {
328
+ return '';
329
+ } finally {
330
+ URL.revokeObjectURL(url);
331
+ }
332
+ }
333
+
334
+ window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) {
335
+ const source = window.wp.element.useMemo(function () {
336
+ if (props.srcDoc) {
337
+ // WordPress <= 6.2 uses a srcDoc that only contains a doctype.
338
+ return '/wp-includes/empty.html';
339
+ } else if (props.src && props.src.startsWith('blob:')) {
340
+ // WordPress 6.3 uses a blob URL with doctype and a list of static assets.
341
+ // Let's pass the document content to empty.html and render it there.
342
+ return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src));
343
+ } else {
344
+ // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction.
345
+ return props.src;
346
+ }
347
+ }, [props.src]);
348
+ return (
349
+ window.wp.element.createElement('iframe', {
350
+ ...props,
351
+ ref: ref,
352
+ src: source,
353
+ // Make sure there's no srcDoc, as it would interfere with the src.
354
+ srcDoc: undefined
355
+ })
356
+ )
357
+ });`;for(const s of r)await t.fileExists(s)&&await at(t,s,i=>`${n} ${i.replace(/\(\s*"iframe",/,"(__playground_ControlledIframe,")}`);await t.writeFile(`${e}/wp-includes/empty.html`,"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>")}const Os=async(t,{code:e})=>await t.run({code:e}),Ns=async(t,{options:e})=>await t.run(e),Cs=async(t,{key:e,value:r})=>{await t.setPhpIniEntry(e,r)},js=async(t,{request:e})=>await t.request(e),ks=async(t,{fromPath:e,toPath:r})=>{await t.writeFile(r,await t.readFileAsBuffer(e))},Is=async(t,{fromPath:e,toPath:r})=>{await t.mv(e,r)},As=async(t,{path:e})=>{await t.unlink(e)},Ds=async(t,{path:e})=>{await t.mkdir(e)},qs=async(t,{path:e})=>{await t.rmdir(e)},Kr=async(t,{path:e,data:r})=>{r instanceof File&&(r=await xi(r)),await t.writeFile(e,r)},Fs=async(t,{siteUrl:e})=>await Et(t,{consts:{WP_HOME:e,WP_SITEURL:e}});class Ms{constructor({concurrency:e}){this._running=0,this.concurrency=e,this.queue=[]}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency)await new Promise(e=>this.queue.push(e));else{this._running++;let e=!1;return()=>{e||(e=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(e){const r=await this.acquire();try{return await e()}finally{r()}}}const no=Symbol("literal");function Rt(t){if(typeof t=="string")return t.startsWith("$")?t:JSON.stringify(t);if(typeof t=="number")return t.toString();if(Array.isArray(t))return`array(${t.map(Rt).join(", ")})`;if(t===null)return"null";if(typeof t=="object")return no in t?t.toString():`array(${Object.entries(t).map(([r,n])=>`${JSON.stringify(r)} => ${Rt(n)}`).join(", ")})`;if(typeof t=="function")return t();throw new Error(`Unsupported value: ${t}`)}function Br(t){const e={};for(const r in t)e[r]=Rt(t[r]);return e}const xn=`<?php
40
358
 
41
359
  function zipDir($dir, $output, $additionalFiles = array())
42
360
  {
@@ -98,32 +416,32 @@ function delTree($dir)
98
416
  }
99
417
  return rmdir($dir);
100
418
  }
101
- `;async function Ls(t){const e="wordpress-playground.zip",r=`/tmp/${e}`,n=Gr({zipPath:r,documentRoot:await t.documentRoot});await Hs(t,`zipDir(${n.documentRoot}, ${n.zipPath});`);const s=await t.readFileAsBuffer(r);return t.unlink(r),new File([s],e)}const Vs=async(t,{fullSiteZip:e})=>{const r="/import.zip";await t.writeFile(r,new Uint8Array(await e.arrayBuffer()));const n=await t.absoluteUrl,s=await t.documentRoot;await t.rmdir(s),await br(t,{zipPath:r,extractToPath:"/"});const i=Gr({absoluteUrl:n});await Xi(t,`${s}/wp-config.php`,a=>`<?php
419
+ `;async function Us(t){const e="wordpress-playground.zip",r=`/tmp/${e}`,n=Br({zipPath:r,documentRoot:await t.documentRoot});await Vs(t,`zipDir(${n.documentRoot}, ${n.zipPath});`);const s=await t.readFileAsBuffer(r);return t.unlink(r),new File([s],e)}const Ls=async(t,{fullSiteZip:e})=>{const r="/import.zip";await t.writeFile(r,new Uint8Array(await e.arrayBuffer()));const n=await t.absoluteUrl,s=await t.documentRoot;await t.rmdir(s),await br(t,{zipPath:r,extractToPath:"/"});const i=Br({absoluteUrl:n});await io(t,`${s}/wp-config.php`,c=>`<?php
102
420
  if(!defined('WP_HOME')) {
103
421
  define('WP_HOME', ${i.absoluteUrl});
104
422
  define('WP_SITEURL', ${i.absoluteUrl});
105
423
  }
106
- ?>${a}`)},br=async(t,{zipPath:e,extractToPath:r})=>{const n=Gr({zipPath:e,extractToPath:r});await Hs(t,`unzip(${n.zipPath}, ${n.extractToPath});`)},zs=async(t,{file:e})=>{const r=await t.request({url:"/wp-admin/admin.php?import=wordpress"}),n=xn(r).getElementById("import-upload-form")?.getAttribute("action"),s=await t.request({url:`/wp-admin/${n}`,method:"POST",files:{import:e}}),i=xn(s).querySelector("#wpbody-content form");if(!i)throw console.log(s.text),new Error("Could not find an importer form in response. See the response text above for details.");const a=Qi(i);a.fetch_attachments="1";for(const l in a)if(l.startsWith("user_map[")){const m="user_new["+l.slice(9,-1)+"]";a[m]="1"}await t.request({url:i.action,method:"POST",formData:a})};function xn(t){return new DOMParser().parseFromString(t.text,"text/html")}function Qi(t){return Object.fromEntries(new FormData(t).entries())}async function Xi(t,e,r){await t.writeFile(e,r(await t.readFileAsText(e)))}async function Hs(t,e){const r=await t.run({code:Yn+e});if(r.exitCode!==0)throw console.log(Yn+e),console.log(e+""),console.log(r.errors),r.errors;return r}async function Ws(t,{targetPath:e,zipFile:r}){const n=r.name,s=n.replace(/\.zip$/,""),i=`/tmp/assets/${s}`,a=`/tmp/${n}`,l=()=>t.rmdir(i,{recursive:!0});await t.fileExists(i)&&await l(),await Kr(t,{path:a,data:r});const m=()=>Promise.all([l,()=>t.unlink(a)]);try{await br(t,{zipPath:a,extractToPath:i});const u=await t.listFiles(i,{prependPath:!0}),f=u.length===1&&await t.isDir(u[0]);let g,k="";f?(k=u[0],g=u[0].split("/").pop()):(k=i,g=s);const C=`${e}/${g}`;return await t.mv(k,C),await m(),{assetFolderPath:C,assetFolderName:g}}catch(u){throw await m(),u}}const Ks=async(t,{pluginZipFile:e,options:r={}},n)=>{const s=e.name.split("/").pop()||"plugin.zip",i=_r(s);n?.tracker.setCaption(`Installing the ${i} plugin`);try{const{assetFolderPath:a}=await Ws(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/plugins`});("activate"in r?r.activate:!0)&&await zr(t,{pluginPath:a,pluginName:i},n),await eo(t)}catch(a){console.error(`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${a}`),console.error(a)}};async function eo(t){await t.isDir("/wordpress/wp-content/plugins/gutenberg")&&!await t.fileExists("/wordpress/.gutenberg-patched")&&(await t.writeFile("/wordpress/.gutenberg-patched","1"),await Zn(t,"/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.js",e=>e.replace(/srcDoc:("[^"]+"|[^,]+)/g,'src:"/wp-includes/empty.html"')),await Zn(t,"/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.min.js",e=>e.replace(/srcDoc:("[^"]+"|[^,]+)/g,'src:"/wp-includes/empty.html"')))}async function Zn(t,e,r){return await t.writeFile(e,r(await t.readFileAsText(e)))}const Gs=async(t,{themeZipFile:e,options:r={}},n)=>{const s=_r(e.name);n?.tracker.setCaption(`Installing the ${s} theme`);try{const{assetFolderName:i}=await Ws(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/themes`});("activate"in r?r.activate:!0)&&await Hr(t,{themeFolderName:i},n)}catch(i){console.error(`Proceeding without the ${s} theme. Could not install it in wp-admin. The original error was: ${i}`),console.error(i)}},Bs=async(t,{username:e="admin",password:r="password"}={},n)=>{n?.tracker.setCaption(n?.initialCaption||"Logging in"),await t.request({url:"/wp-login.php"}),await t.request({url:"/wp-login.php",method:"POST",formData:{log:e,pwd:r,rememberme:"forever"}})},Js=async(t,{options:e})=>{await t.request({url:"/wp-admin/install.php?step=2",method:"POST",formData:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:e.adminPassword||"admin",admin_password:e.adminPassword||"password",admin_password2:e.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},Ys=async(t,{options:e})=>{const r=`<?php
424
+ ?>${c}`)},br=async(t,{zipPath:e,extractToPath:r})=>{const n=Br({zipPath:e,extractToPath:r});await Vs(t,`unzip(${n.zipPath}, ${n.extractToPath});`)},Hs=async(t,{file:e})=>{const r=await t.request({url:"/wp-admin/admin.php?import=wordpress"}),n=Jn(r).getElementById("import-upload-form")?.getAttribute("action"),s=await t.request({url:`/wp-admin/${n}`,method:"POST",files:{import:e}}),i=Jn(s).querySelector("#wpbody-content form");if(!i)throw console.log(s.text),new Error("Could not find an importer form in response. See the response text above for details.");const c=so(i);c.fetch_attachments="1";for(const l in c)if(l.startsWith("user_map[")){const m="user_new["+l.slice(9,-1)+"]";c[m]="1"}await t.request({url:i.action,method:"POST",formData:c})};function Jn(t){return new DOMParser().parseFromString(t.text,"text/html")}function so(t){return Object.fromEntries(new FormData(t).entries())}async function io(t,e,r){await t.writeFile(e,r(await t.readFileAsText(e)))}async function Vs(t,e){const r=await t.run({code:xn+e});if(r.exitCode!==0)throw console.log(xn+e),console.log(e+""),console.log(r.errors),r.errors;return r}async function zs(t,{targetPath:e,zipFile:r}){const n=r.name,s=n.replace(/\.zip$/,""),i=`/tmp/assets/${s}`,c=`/tmp/${n}`,l=()=>t.rmdir(i,{recursive:!0});await t.fileExists(i)&&await l(),await Kr(t,{path:c,data:r});const m=()=>Promise.all([l,()=>t.unlink(c)]);try{await br(t,{zipPath:c,extractToPath:i});const u=await t.listFiles(i,{prependPath:!0}),p=u.length===1&&await t.isDir(u[0]);let g,k="";p?(k=u[0],g=u[0].split("/").pop()):(k=i,g=s);const C=`${e}/${g}`;return await t.mv(k,C),await m(),{assetFolderPath:C,assetFolderName:g}}catch(u){throw await m(),u}}const Ws=async(t,{pluginZipFile:e,options:r={}},n)=>{const s=e.name.split("/").pop()||"plugin.zip",i=wr(s);n?.tracker.setCaption(`Installing the ${i} plugin`);try{const{assetFolderPath:c}=await zs(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/plugins`});("activate"in r?r.activate:!0)&&await Vr(t,{pluginPath:c,pluginName:i},n),await oo(t)}catch(c){console.error(`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${c}`),console.error(c)}};async function oo(t){await t.isDir("/wordpress/wp-content/plugins/gutenberg")&&!await t.fileExists("/wordpress/.gutenberg-patched")&&(await t.writeFile("/wordpress/.gutenberg-patched","1"),await Rs(t,"/wordpress",["/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.js","/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.min.js"]))}const Ks=async(t,{themeZipFile:e,options:r={}},n)=>{const s=wr(e.name);n?.tracker.setCaption(`Installing the ${s} theme`);try{const{assetFolderName:i}=await zs(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/themes`});("activate"in r?r.activate:!0)&&await zr(t,{themeFolderName:i},n)}catch(i){console.error(`Proceeding without the ${s} theme. Could not install it in wp-admin. The original error was: ${i}`),console.error(i)}},Bs=async(t,{username:e="admin",password:r="password"}={},n)=>{n?.tracker.setCaption(n?.initialCaption||"Logging in"),await t.request({url:"/wp-login.php"}),await t.request({url:"/wp-login.php",method:"POST",formData:{log:e,pwd:r,rememberme:"forever"}})},Gs=async(t,{options:e})=>{await t.request({url:"/wp-admin/install.php?step=2",method:"POST",formData:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:e.adminPassword||"admin",admin_password:e.adminPassword||"password",admin_password2:e.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},xs=async(t,{options:e})=>{const r=`<?php
107
425
  include 'wordpress/wp-load.php';
108
- $site_options = ${St(e)};
426
+ $site_options = ${Rt(e)};
109
427
  foreach($site_options as $name => $value) {
110
428
  update_option($name, $value);
111
429
  }
112
430
  echo "Success";
113
- `,n=await t.run({code:r});return Zs(n),{code:r,result:n}},xs=async(t,{meta:e,userId:r})=>{const n=`<?php
431
+ `,n=await t.run({code:r});return Ys(n),{code:r,result:n}},Js=async(t,{meta:e,userId:r})=>{const n=`<?php
114
432
  include 'wordpress/wp-load.php';
115
- $meta = ${St(e)};
433
+ $meta = ${Rt(e)};
116
434
  foreach($meta as $name => $value) {
117
- update_user_meta(${St(r)}, $name, $value);
435
+ update_user_meta(${Rt(r)}, $name, $value);
118
436
  }
119
437
  echo "Success";
120
- `,s=await t.run({code:n});return Zs(s),{code:n,result:s}};async function Zs(t){if(t.text!=="Success")throw console.log(t),new Error(`Failed to run code: ${t.text} ${t.errors}`)}const to=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:zr,activateTheme:Hr,applyWordPressPatches:Ns,cp:Is,defineSiteUrl:Us,defineWpConfigConsts:wr,importFile:zs,installPlugin:Ks,installTheme:Gs,login:Bs,mkdir:Ds,mv:As,replaceSite:Vs,request:ks,rm:Fs,rmdir:Ms,runPHP:Os,runPHPWithOptions:Cs,runWpInstallationWizard:Js,setPhpIniEntry:js,setSiteOptions:Ys,unzip:br,updateUserMeta:xs,writeFile:Kr,zipEntireSite:Ls},Symbol.toStringTag,{value:"Module"})),ro=5*1024*1024;function no(t,e){const r=t.headers.get("content-length")||"",n=parseInt(r,10)||ro;function s(i,a){e(new CustomEvent("progress",{detail:{loaded:i,total:a}}))}return new Response(new ReadableStream({async start(i){if(!t.body){i.close();return}const a=t.body.getReader();let l=0;for(;;)try{const{done:m,value:u}=await a.read();if(u&&(l+=u.byteLength),m){s(l,l),i.close();break}else s(l,n),i.enqueue(u)}catch(m){console.error({e:m}),i.error(m);break}}}),{status:t.status,statusText:t.statusText,headers:t.headers})}const Nr=1e-5;class Br extends EventTarget{constructor({weight:e=1,caption:r="",fillTime:n=4}={}){super(),this._selfWeight=1,this._selfDone=!1,this._selfProgress=0,this._selfCaption="",this._isFilling=!1,this._subTrackers=[],this._weight=e,this._selfCaption=r,this._fillTime=n}stage(e,r=""){if(e||(e=this._selfWeight),this._selfWeight-e<-Nr)throw new Error(`Cannot add a stage with weight ${e} as the total weight of registered stages would exceed 1.`);this._selfWeight-=e;const n=new Br({caption:r,weight:e,fillTime:this._fillTime});return this._subTrackers.push(n),n.addEventListener("progress",()=>this.notifyProgress()),n.addEventListener("done",()=>{this.done&&this.notifyDone()}),n}fillSlowly({stopBeforeFinishing:e=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,n=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),e&&this._selfProgress>=99&&clearInterval(this._fillInterval)},n)}set(e){this._selfProgress=Math.min(e,100),this.notifyProgress(),this._selfProgress+Nr>=100&&this.finish()}finish(){this._fillInterval&&clearInterval(this._fillInterval),this._selfDone=!0,this._selfProgress=100,this._isFilling=!1,this._fillInterval=void 0,this.notifyProgress(),this.notifyDone()}get caption(){for(let e=this._subTrackers.length-1;e>=0;e--)if(!this._subTrackers[e].done){const r=this._subTrackers[e].caption;if(r)return r}return this._selfCaption}setCaption(e){this._selfCaption=e,this.notifyProgress()}get done(){return this.progress+Nr>=100}get progress(){if(this._selfDone)return 100;const e=this._subTrackers.reduce((r,n)=>r+n.progress*n.weight,this._selfProgress*this._selfWeight);return Math.round(e*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=e=>{this.set(e)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=e=>{this.set(e.detail.loaded/e.detail.total*100)}),this._loadingListener}pipe(e){e.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{e.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{e.setLoaded()})}addEventListener(e,r){super.addEventListener(e,r)}removeEventListener(e,r){super.removeEventListener(e,r)}notifyProgress(){const e=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return e.progress},get caption(){return e.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const Qn=Symbol("error"),Xn=Symbol("message");class Jr extends Event{constructor(e,r={}){super(e),this[Qn]=r.error===void 0?null:r.error,this[Xn]=r.message===void 0?"":r.message}get error(){return this[Qn]}get message(){return this[Xn]}}Object.defineProperty(Jr.prototype,"error",{enumerable:!0});Object.defineProperty(Jr.prototype,"message",{enumerable:!0});const so=typeof globalThis.ErrorEvent=="function"?globalThis.ErrorEvent:Jr;function io(t){return t instanceof Error?"exitCode"in t&&t?.exitCode===0||t?.name==="ExitStatus"&&"status"in t&&t.status===0:!1}class oo extends EventTarget{constructor(){super(...arguments),this.listenersCount=0}addEventListener(e,r){++this.listenersCount,super.addEventListener(e,r)}removeEventListener(e,r){--this.listenersCount,super.removeEventListener(e,r)}hasListeners(){return this.listenersCount>0}}function ao(t){t.asm={...t.asm};const e=new oo;for(const r in t.asm)if(typeof t.asm[r]=="function"){const n=t.asm[r];t.asm[r]=function(...s){try{return n(...s)}catch(i){if(!(i instanceof Error))throw i;const a=lo(i,t.lastAsyncifyStackSource?.stack);if(t.lastAsyncifyStackSource&&(i.cause=t.lastAsyncifyStackSource),e.hasListeners()){e.dispatchEvent(new so("error",{error:i,message:a}));return}throw io(i)||po(a),i}}}return e}let Ar=[];function co(){return Ar}function lo(t,e){if(t.message==="unreachable"){let r=uo;e||(r+=`
438
+ `,s=await t.run({code:n});return Ys(s),{code:n,result:s}};async function Ys(t){if(t.text!=="Success")throw console.log(t),new Error(`Failed to run code: ${t.text} ${t.errors}`)}const ao=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Vr,activateTheme:zr,applyWordPressPatches:Ts,cp:ks,defineSiteUrl:Fs,defineWpConfigConsts:Et,importFile:Hs,installPlugin:Ws,installTheme:Ks,login:Bs,mkdir:Ds,mv:Is,replaceSite:Ls,request:js,rm:As,rmdir:qs,runPHP:Os,runPHPWithOptions:Ns,runWpInstallationWizard:Gs,setPhpIniEntry:Cs,setSiteOptions:xs,unzip:br,updateUserMeta:Js,writeFile:Kr,zipEntireSite:Us},Symbol.toStringTag,{value:"Module"})),co=5*1024*1024;function lo(t,e){const r=t.headers.get("content-length")||"",n=parseInt(r,10)||co;function s(i,c){e(new CustomEvent("progress",{detail:{loaded:i,total:c}}))}return new Response(new ReadableStream({async start(i){if(!t.body){i.close();return}const c=t.body.getReader();let l=0;for(;;)try{const{done:m,value:u}=await c.read();if(u&&(l+=u.byteLength),m){s(l,l),i.close();break}else s(l,n),i.enqueue(u)}catch(m){console.error({e:m}),i.error(m);break}}}),{status:t.status,statusText:t.statusText,headers:t.headers})}const Or=1e-5;class Gr extends EventTarget{constructor({weight:e=1,caption:r="",fillTime:n=4}={}){super(),this._selfWeight=1,this._selfDone=!1,this._selfProgress=0,this._selfCaption="",this._isFilling=!1,this._subTrackers=[],this._weight=e,this._selfCaption=r,this._fillTime=n}stage(e,r=""){if(e||(e=this._selfWeight),this._selfWeight-e<-Or)throw new Error(`Cannot add a stage with weight ${e} as the total weight of registered stages would exceed 1.`);this._selfWeight-=e;const n=new Gr({caption:r,weight:e,fillTime:this._fillTime});return this._subTrackers.push(n),n.addEventListener("progress",()=>this.notifyProgress()),n.addEventListener("done",()=>{this.done&&this.notifyDone()}),n}fillSlowly({stopBeforeFinishing:e=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,n=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),e&&this._selfProgress>=99&&clearInterval(this._fillInterval)},n)}set(e){this._selfProgress=Math.min(e,100),this.notifyProgress(),this._selfProgress+Or>=100&&this.finish()}finish(){this._fillInterval&&clearInterval(this._fillInterval),this._selfDone=!0,this._selfProgress=100,this._isFilling=!1,this._fillInterval=void 0,this.notifyProgress(),this.notifyDone()}get caption(){for(let e=this._subTrackers.length-1;e>=0;e--)if(!this._subTrackers[e].done){const r=this._subTrackers[e].caption;if(r)return r}return this._selfCaption}setCaption(e){this._selfCaption=e,this.notifyProgress()}get done(){return this.progress+Or>=100}get progress(){if(this._selfDone)return 100;const e=this._subTrackers.reduce((r,n)=>r+n.progress*n.weight,this._selfProgress*this._selfWeight);return Math.round(e*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=e=>{this.set(e)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=e=>{this.set(e.detail.loaded/e.detail.total*100)}),this._loadingListener}pipe(e){e.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{e.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{e.setLoaded()})}addEventListener(e,r){super.addEventListener(e,r)}removeEventListener(e,r){super.removeEventListener(e,r)}notifyProgress(){const e=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return e.progress},get caption(){return e.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const Yn=Symbol("error"),Zn=Symbol("message");class xr extends Event{constructor(e,r={}){super(e),this[Yn]=r.error===void 0?null:r.error,this[Zn]=r.message===void 0?"":r.message}get error(){return this[Yn]}get message(){return this[Zn]}}Object.defineProperty(xr.prototype,"error",{enumerable:!0});Object.defineProperty(xr.prototype,"message",{enumerable:!0});const uo=typeof globalThis.ErrorEvent=="function"?globalThis.ErrorEvent:xr;function po(t){return t instanceof Error?"exitCode"in t&&t?.exitCode===0||t?.name==="ExitStatus"&&"status"in t&&t.status===0:!1}class fo extends EventTarget{constructor(){super(...arguments),this.listenersCount=0}addEventListener(e,r){++this.listenersCount,super.addEventListener(e,r)}removeEventListener(e,r){--this.listenersCount,super.removeEventListener(e,r)}hasListeners(){return this.listenersCount>0}}function ho(t){t.asm={...t.asm};const e=new fo;for(const r in t.asm)if(typeof t.asm[r]=="function"){const n=t.asm[r];t.asm[r]=function(...s){try{return n(...s)}catch(i){if(!(i instanceof Error))throw i;const c=yo(i,t.lastAsyncifyStackSource?.stack);if(t.lastAsyncifyStackSource&&(i.cause=t.lastAsyncifyStackSource),e.hasListeners()){e.dispatchEvent(new uo("error",{error:i,message:c}));return}throw po(i)||vo(c),i}}}return e}let Ar=[];function mo(){return Ar}function yo(t,e){if(t.message==="unreachable"){let r=go;e||(r+=`
121
439
 
122
440
  This stack trace is lacking. For a better one initialize
123
441
  the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
124
442
 
125
- `),Ar=ho(e||t.stack||"");for(const n of Ar)r+=` * ${n}
126
- `;return r}return t.message}const uo=`
443
+ `),Ar=_o(e||t.stack||"");for(const n of Ar)r+=` * ${n}
444
+ `;return r}return t.message}const go=`
127
445
  "unreachable" WASM instruction executed.
128
446
 
129
447
  The typical reason is a PHP function missing from the ASYNCIFY_ONLY
@@ -147,20 +465,20 @@ the Dockerfile, you'll need to trigger this error again with long stack
147
465
  traces enabled. In node.js, you can do it using the --stack-trace-limit=100
148
466
  CLI option:
149
467
 
150
- `,es="\x1B[41m",fo="\x1B[1m",ts="\x1B[0m",rs="\x1B[K";let ns=!1;function po(t){if(!ns){ns=!0,console.log(`${es}
151
- ${rs}
152
- ${fo} WASM ERROR${ts}${es}`);for(const e of t.split(`
153
- `))console.log(`${rs} ${e} `);console.log(`${ts}`)}}function ho(t){try{const e=t.split(`
154
- `).slice(1).map(r=>{const n=r.trim().substring(3).split(" ");return{fn:n.length>=2?n[0]:"<unknown>",isWasm:r.includes("wasm://")}}).filter(({fn:r,isWasm:n})=>n&&!r.startsWith("dynCall_")&&!r.startsWith("invoke_")).map(({fn:r})=>r);return Array.from(new Set(e))}catch{return[]}}class Pt{constructor(e,r,n,s="",i=0){this.httpStatusCode=e,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(e){return new Pt(e.httpStatusCode,e.headers,e.bytes,e.errors,e.exitCode)}toRawData(){return{headers:this.headers,bytes:this.bytes,errors:this.errors,exitCode:this.exitCode,httpStatusCode:this.httpStatusCode}}get json(){return JSON.parse(this.text)}get text(){return new TextDecoder().decode(this.bytes)}}const Qs=["8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0","5.6"],mo=Qs[0];class yo{#e;#t;constructor(e,r={}){this.requestHandler=e,this.#e={},this.#t={handleRedirects:!1,maxRedirects:4,...r}}async request(e,r=0){const n=await this.requestHandler.request({...e,headers:{...e.headers,cookie:this.#r()}});if(n.headers["set-cookie"]&&this.#n(n.headers["set-cookie"]),this.#t.handleRedirects&&n.headers.location&&r<this.#t.maxRedirects){const s=new URL(n.headers.location[0],this.requestHandler.absoluteUrl);return this.request({url:s.toString(),method:"GET",headers:{}},r+1)}return n}pathToInternalUrl(e){return this.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.internalUrlToPath(e)}get absoluteUrl(){return this.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.documentRoot}#n(e){for(const r of e)try{if(!r.includes("="))continue;const n=r.indexOf("="),s=r.substring(0,n),i=r.substring(n+1).split(";")[0];this.#e[s]=i}catch(n){console.error(n)}}#r(){const e=[];for(const r in this.#e)e.push(`${r}=${this.#e[r]}`);return e.join("; ")}}const go="http://example.com";function ss(t){return t.toString().substring(t.origin.length)}function is(t,e){return!e||!t.startsWith(e)?t:t.substring(e.length)}function vo(t,e){return!e||t.startsWith(e)?t:e+t}class $o{#e;#t;#n;#r;#i;#s;#o;#a;#c;constructor(e,r={}){this.#a=new qs({concurrency:1});const{documentRoot:n="/www/",absoluteUrl:s=typeof location=="object"?location?.href:"",isStaticFilePath:i=()=>!1}=r;this.php=e,this.#e=n,this.#c=i;const a=new URL(s);this.#n=a.hostname,this.#r=a.port?Number(a.port):a.protocol==="https:"?443:80,this.#t=(a.protocol||"").replace(":","");const l=this.#r!==443&&this.#r!==80;this.#i=[this.#n,l?`:${this.#r}`:""].join(""),this.#s=a.pathname.replace(/\/+$/,""),this.#o=[`${this.#t}://`,this.#i,this.#s].join("")}pathToInternalUrl(e){return`${this.absoluteUrl}${e}`}internalUrlToPath(e){const r=new URL(e);return r.pathname.startsWith(this.#s)&&(r.pathname=r.pathname.slice(this.#s.length)),ss(r)}get isRequestRunning(){return this.#a.running>0}get absoluteUrl(){return this.#o}get documentRoot(){return this.#e}async request(e){const r=e.url.startsWith("http://")||e.url.startsWith("https://"),n=new URL(e.url,r?void 0:go),s=is(n.pathname,this.#s);return this.#c(s)?this.#l(s):await this.#u(e,n)}#l(e){const r=`${this.#e}${e}`;if(!this.php.fileExists(r))return new Pt(404,{},new TextEncoder().encode("404 File not found"));const n=this.php.readFileAsBuffer(r);return new Pt(200,{"content-length":[`${n.byteLength}`],"content-type":[wo(r)],"accept-ranges":["bytes"],"cache-control":["public, max-age=0"]},n)}async#u(e,r){const n=await this.#a.acquire();try{this.php.addServerGlobalEntry("DOCUMENT_ROOT",this.#e),this.php.addServerGlobalEntry("HTTPS",this.#o.startsWith("https://")?"on":"");let s="GET";const i={host:this.#i,...Xs(e.headers||{})},a=[];if(e.files&&Object.keys(e.files).length){s="POST";for(const u in e.files){const f=e.files[u];a.push({key:u,name:f.name,type:f.type,data:new Uint8Array(await f.arrayBuffer())})}i["content-type"]?.startsWith("multipart/form-data")&&(e.formData=_o(e.body||""),i["content-type"]="application/x-www-form-urlencoded",delete e.body)}let l;e.formData!==void 0?(s="POST",i["content-type"]=i["content-type"]||"application/x-www-form-urlencoded",l=new URLSearchParams(e.formData).toString()):l=e.body;let m;try{m=this.#d(r.pathname)}catch{return new Pt(404,{},new TextEncoder().encode("404 File not found"))}return await this.php.run({relativeUri:vo(ss(r),this.#s),protocol:this.#t,method:e.method||s,body:l,fileInfos:a,scriptPath:m,headers:i})}finally{n()}}#d(e){let r=is(e,this.#s);r.includes(".php")?r=r.split(".php")[0]+".php":(r.endsWith("/")||(r+="/"),r.endsWith("index.php")||(r+="index.php"));const n=`${this.#e}${r}`;if(this.php.fileExists(n))return n;if(!this.php.fileExists(`${this.#e}/index.php`))throw new Error(`File not found: ${n}`);return`${this.#e}/index.php`}}function _o(t){const e={},r=t.match(/--(.*)\r\n/);if(!r)return e;const n=r[1],s=t.split(`--${n}`);return s.shift(),s.pop(),s.forEach(i=>{const a=i.indexOf(`\r
468
+ `,Qn="\x1B[41m",$o="\x1B[1m",Xn="\x1B[0m",es="\x1B[K";let ts=!1;function vo(t){if(!ts){ts=!0,console.log(`${Qn}
469
+ ${es}
470
+ ${$o} WASM ERROR${Xn}${Qn}`);for(const e of t.split(`
471
+ `))console.log(`${es} ${e} `);console.log(`${Xn}`)}}function _o(t){try{const e=t.split(`
472
+ `).slice(1).map(r=>{const n=r.trim().substring(3).split(" ");return{fn:n.length>=2?n[0]:"<unknown>",isWasm:r.includes("wasm://")}}).filter(({fn:r,isWasm:n})=>n&&!r.startsWith("dynCall_")&&!r.startsWith("invoke_")).map(({fn:r})=>r);return Array.from(new Set(e))}catch{return[]}}class St{constructor(e,r,n,s="",i=0){this.httpStatusCode=e,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(e){return new St(e.httpStatusCode,e.headers,e.bytes,e.errors,e.exitCode)}toRawData(){return{headers:this.headers,bytes:this.bytes,errors:this.errors,exitCode:this.exitCode,httpStatusCode:this.httpStatusCode}}get json(){return JSON.parse(this.text)}get text(){return new TextDecoder().decode(this.bytes)}}const Zs=["8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0","5.6"],wo=Zs[0],Qs=["iconv","mbstring","xml-bundle","gd"],rs={"kitchen-sink":Qs};class bo{#e;#t;constructor(e,r={}){this.requestHandler=e,this.#e={},this.#t={handleRedirects:!1,maxRedirects:4,...r}}async request(e,r=0){const n=await this.requestHandler.request({...e,headers:{...e.headers,cookie:this.#r()}});if(n.headers["set-cookie"]&&this.#n(n.headers["set-cookie"]),this.#t.handleRedirects&&n.headers.location&&r<this.#t.maxRedirects){const s=new URL(n.headers.location[0],this.requestHandler.absoluteUrl);return this.request({url:s.toString(),method:"GET",headers:{}},r+1)}return n}pathToInternalUrl(e){return this.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.internalUrlToPath(e)}get absoluteUrl(){return this.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.documentRoot}#n(e){for(const r of e)try{if(!r.includes("="))continue;const n=r.indexOf("="),s=r.substring(0,n),i=r.substring(n+1).split(";")[0];this.#e[s]=i}catch(n){console.error(n)}}#r(){const e=[];for(const r in this.#e)e.push(`${r}=${this.#e[r]}`);return e.join("; ")}}const Po="http://example.com";function ns(t){return t.toString().substring(t.origin.length)}function ss(t,e){return!e||!t.startsWith(e)?t:t.substring(e.length)}function Eo(t,e){return!e||t.startsWith(e)?t:e+t}class So{#e;#t;#n;#r;#i;#s;#o;#a;constructor(e,r={}){this.#a=new Ms({concurrency:1});const{documentRoot:n="/www/",absoluteUrl:s=typeof location=="object"?location?.href:""}=r;this.php=e,this.#e=n;const i=new URL(s);this.#n=i.hostname,this.#r=i.port?Number(i.port):i.protocol==="https:"?443:80,this.#t=(i.protocol||"").replace(":","");const c=this.#r!==443&&this.#r!==80;this.#i=[this.#n,c?`:${this.#r}`:""].join(""),this.#s=i.pathname.replace(/\/+$/,""),this.#o=[`${this.#t}://`,this.#i,this.#s].join("")}pathToInternalUrl(e){return`${this.absoluteUrl}${e}`}internalUrlToPath(e){const r=new URL(e);return r.pathname.startsWith(this.#s)&&(r.pathname=r.pathname.slice(this.#s.length)),ns(r)}get isRequestRunning(){return this.#a.running>0}get absoluteUrl(){return this.#o}get documentRoot(){return this.#e}async request(e){const r=e.url.startsWith("http://")||e.url.startsWith("https://"),n=new URL(e.url,r?void 0:Po),s=ss(n.pathname,this.#s),i=`${this.#e}${s}`;return Oo(i)?await this.#l(e,n):this.#c(i)}#c(e){if(!this.php.fileExists(e))return new St(404,{"x-file-type":["static"]},new TextEncoder().encode("404 File not found"));const r=this.php.readFileAsBuffer(e);return new St(200,{"content-length":[`${r.byteLength}`],"content-type":[Ro(e)],"accept-ranges":["bytes"],"cache-control":["public, max-age=0"]},r)}async#l(e,r){const n=await this.#a.acquire();try{this.php.addServerGlobalEntry("DOCUMENT_ROOT",this.#e),this.php.addServerGlobalEntry("HTTPS",this.#o.startsWith("https://")?"on":"");let s="GET";const i={host:this.#i,...Xs(e.headers||{})},c=[];if(e.files&&Object.keys(e.files).length){s="POST";for(const u in e.files){const p=e.files[u];c.push({key:u,name:p.name,type:p.type,data:new Uint8Array(await p.arrayBuffer())})}i["content-type"]?.startsWith("multipart/form-data")&&(e.formData=To(e.body||""),i["content-type"]="application/x-www-form-urlencoded",delete e.body)}let l;e.formData!==void 0?(s="POST",i["content-type"]=i["content-type"]||"application/x-www-form-urlencoded",l=new URLSearchParams(e.formData).toString()):l=e.body;let m;try{m=this.#u(r.pathname)}catch{return new St(404,{},new TextEncoder().encode("404 File not found"))}return await this.php.run({relativeUri:Eo(ns(r),this.#s),protocol:this.#t,method:e.method||s,body:l,fileInfos:c,scriptPath:m,headers:i})}finally{n()}}#u(e){let r=ss(e,this.#s);r.includes(".php")?r=r.split(".php")[0]+".php":(r.endsWith("/")||(r+="/"),r.endsWith("index.php")||(r+="index.php"));const n=`${this.#e}${r}`;if(this.php.fileExists(n))return n;if(!this.php.fileExists(`${this.#e}/index.php`))throw new Error(`File not found: ${n}`);return`${this.#e}/index.php`}}function To(t){const e={},r=t.match(/--(.*)\r\n/);if(!r)return e;const n=r[1],s=t.split(`--${n}`);return s.shift(),s.pop(),s.forEach(i=>{const c=i.indexOf(`\r
155
473
  \r
156
- `),l=i.substring(0,a).trim(),m=i.substring(a+4).trim(),u=l.match(/name="([^"]+)"/);if(u){const f=u[1];e[f]=m}}),e}function wo(t){switch(t.split(".").pop()){case"css":return"text/css";case"js":return"application/javascript";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"woff":return"font/woff";case"woff2":return"font/woff2";case"ttf":return"font/ttf";case"otf":return"font/otf";case"eot":return"font/eot";case"ico":return"image/x-icon";case"html":return"text/html";case"json":return"application/json";case"xml":return"application/xml";case"txt":case"md":return"text/plain";default:return"application-octet-stream"}}const os={0:"No error occurred. System call completed successfully.",1:"Argument list too long.",2:"Permission denied.",3:"Address in use.",4:"Address not available.",5:"Address family not supported.",6:"Resource unavailable, or operation would block.",7:"Connection already in progress.",8:"Bad file descriptor.",9:"Bad message.",10:"Device or resource busy.",11:"Operation canceled.",12:"No child processes.",13:"Connection aborted.",14:"Connection refused.",15:"Connection reset.",16:"Resource deadlock would occur.",17:"Destination address required.",18:"Mathematics argument out of domain of function.",19:"Reserved.",20:"File exists.",21:"Bad address.",22:"File too large.",23:"Host is unreachable.",24:"Identifier removed.",25:"Illegal byte sequence.",26:"Operation in progress.",27:"Interrupted function.",28:"Invalid argument.",29:"I/O error.",30:"Socket is connected.",31:"There is a directory under that path.",32:"Too many levels of symbolic links.",33:"File descriptor value too large.",34:"Too many links.",35:"Message too large.",36:"Reserved.",37:"Filename too long.",38:"Network is down.",39:"Connection aborted by network.",40:"Network unreachable.",41:"Too many files open in system.",42:"No buffer space available.",43:"No such device.",44:"There is no such file or directory OR the parent directory does not exist.",45:"Executable file format error.",46:"No locks available.",47:"Reserved.",48:"Not enough space.",49:"No message of the desired type.",50:"Protocol not available.",51:"No space left on device.",52:"Function not supported.",53:"The socket is not connected.",54:"Not a directory or a symbolic link to a directory.",55:"Directory not empty.",56:"State not recoverable.",57:"Not a socket.",58:"Not supported, or operation not supported on socket.",59:"Inappropriate I/O control operation.",60:"No such device or address.",61:"Value too large to be stored in data type.",62:"Previous owner died.",63:"Operation not permitted.",64:"Broken pipe.",65:"Protocol error.",66:"Protocol not supported.",67:"Protocol wrong type for socket.",68:"Result too large.",69:"Read-only file system.",70:"Invalid seek.",71:"No such process.",72:"Reserved.",73:"Connection timed out.",74:"Text file busy.",75:"Cross-device link.",76:"Extension: Capabilities insufficient."};function Ce(t=""){return function(r,n,s){const i=s.value;s.value=function(...a){try{return i.apply(this,a)}catch(l){const m=typeof l=="object"?l?.errno:null;if(m in os){const u=os[m],f=typeof a[0]=="string"?a[0]:null,g=f!==null?t.replaceAll("{path}",f):t;throw new Error(`${g}: ${u}`,{cause:l})}throw l}}}}const bo=[];function Po(t){return bo[t]}(function(){return typeof process<"u"&&process.release?.name==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();var Eo=Object.defineProperty,So=Object.getOwnPropertyDescriptor,je=(t,e,r,n)=>{for(var s=n>1?void 0:n?So(e,r):e,i=t.length-1,a;i>=0;i--)(a=t[i])&&(s=(n?a(e,r,s):a(s))||s);return n&&s&&Eo(e,r,s),s};const me="string",$t="number",ee=Symbol("__private__dont__use");class ke{constructor(e,r){this.#e=[],this.#t=!1,this.#n=null,this.#r={},this.#i=[],e!==void 0&&this.initializeRuntime(e),r&&(this.requestHandler=new yo(new $o(this,r)))}#e;#t;#n;#r;#i;async onMessage(e){this.#i.push(e)}get absoluteUrl(){return this.requestHandler.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.requestHandler.documentRoot}pathToInternalUrl(e){return this.requestHandler.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.requestHandler.internalUrlToPath(e)}initializeRuntime(e){if(this[ee])throw new Error("PHP runtime already initialized.");const r=Po(e);if(!r)throw new Error("Invalid PHP runtime id.");this[ee]=r,r.onMessage=n=>{for(const s of this.#i)s(n)},this.#n=ao(r)}setPhpIniPath(e){if(this.#t)throw new Error("Cannot set PHP ini path after calling run().");this[ee].ccall("wasm_set_phpini_path",null,["string"],[e])}setPhpIniEntry(e,r){if(this.#t)throw new Error("Cannot set PHP ini entries after calling run().");this.#e.push([e,r])}chdir(e){this[ee].FS.chdir(e)}async request(e,r){if(!this.requestHandler)throw new Error("No request handler available.");return this.requestHandler.request(e,r)}async run(e){this.#t||(this.#s(),this.#t=!0),this.#f(e.scriptPath||""),this.#a(e.relativeUri||""),this.#l(e.method||"GET");const{host:r,...n}={host:"example.com:443",...Xs(e.headers||{})};if(this.#c(r,e.protocol||"http"),this.#u(n),e.body&&this.#d(e.body),e.fileInfos)for(const s of e.fileInfos)this.#h(s);return e.code&&this.#m(" ?>"+e.code),this.#p(),await this.#y()}#s(){if(this.#e.length>0){const e=this.#e.map(([r,n])=>`${r}=${n}`).join(`
474
+ `),l=i.substring(0,c).trim(),m=i.substring(c+4).trim(),u=l.match(/name="([^"]+)"/);if(u){const p=u[1];e[p]=m}}),e}function Ro(t){switch(t.split(".").pop()){case"css":return"text/css";case"js":return"application/javascript";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"woff":return"font/woff";case"woff2":return"font/woff2";case"ttf":return"font/ttf";case"otf":return"font/otf";case"eot":return"font/eot";case"ico":return"image/x-icon";case"html":return"text/html";case"json":return"application/json";case"xml":return"application/xml";case"txt":case"md":return"text/plain";default:return"application-octet-stream"}}function Oo(t){return No(t)||Co(t)}function No(t){return t.endsWith(".php")||t.includes(".php/")}function Co(t){return!t.split("/").pop().includes(".")}const is={0:"No error occurred. System call completed successfully.",1:"Argument list too long.",2:"Permission denied.",3:"Address in use.",4:"Address not available.",5:"Address family not supported.",6:"Resource unavailable, or operation would block.",7:"Connection already in progress.",8:"Bad file descriptor.",9:"Bad message.",10:"Device or resource busy.",11:"Operation canceled.",12:"No child processes.",13:"Connection aborted.",14:"Connection refused.",15:"Connection reset.",16:"Resource deadlock would occur.",17:"Destination address required.",18:"Mathematics argument out of domain of function.",19:"Reserved.",20:"File exists.",21:"Bad address.",22:"File too large.",23:"Host is unreachable.",24:"Identifier removed.",25:"Illegal byte sequence.",26:"Operation in progress.",27:"Interrupted function.",28:"Invalid argument.",29:"I/O error.",30:"Socket is connected.",31:"There is a directory under that path.",32:"Too many levels of symbolic links.",33:"File descriptor value too large.",34:"Too many links.",35:"Message too large.",36:"Reserved.",37:"Filename too long.",38:"Network is down.",39:"Connection aborted by network.",40:"Network unreachable.",41:"Too many files open in system.",42:"No buffer space available.",43:"No such device.",44:"There is no such file or directory OR the parent directory does not exist.",45:"Executable file format error.",46:"No locks available.",47:"Reserved.",48:"Not enough space.",49:"No message of the desired type.",50:"Protocol not available.",51:"No space left on device.",52:"Function not supported.",53:"The socket is not connected.",54:"Not a directory or a symbolic link to a directory.",55:"Directory not empty.",56:"State not recoverable.",57:"Not a socket.",58:"Not supported, or operation not supported on socket.",59:"Inappropriate I/O control operation.",60:"No such device or address.",61:"Value too large to be stored in data type.",62:"Previous owner died.",63:"Operation not permitted.",64:"Broken pipe.",65:"Protocol error.",66:"Protocol not supported.",67:"Protocol wrong type for socket.",68:"Result too large.",69:"Read-only file system.",70:"Invalid seek.",71:"No such process.",72:"Reserved.",73:"Connection timed out.",74:"Text file busy.",75:"Cross-device link.",76:"Extension: Capabilities insufficient."};function Ce(t=""){return function(r,n,s){const i=s.value;s.value=function(...c){try{return i.apply(this,c)}catch(l){const m=typeof l=="object"?l?.errno:null;if(m in is){const u=is[m],p=typeof c[0]=="string"?c[0]:null,g=p!==null?t.replaceAll("{path}",p):t;throw new Error(`${g}: ${u}`,{cause:l})}throw l}}}}const jo=[];function ko(t){return jo[t]}(function(){return typeof process<"u"&&process.release?.name==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();var Io=Object.defineProperty,Ao=Object.getOwnPropertyDescriptor,je=(t,e,r,n)=>{for(var s=n>1?void 0:n?Ao(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(s=(n?c(e,r,s):c(s))||s);return n&&s&&Io(e,r,s),s};const me="string",_t="number",ee=Symbol("__private__dont__use");class ke{constructor(e,r){this.#e=[],this.#t=!1,this.#n=null,this.#r={},this.#i=[],e!==void 0&&this.initializeRuntime(e),r&&(this.requestHandler=new bo(new So(this,r)))}#e;#t;#n;#r;#i;async onMessage(e){this.#i.push(e)}get absoluteUrl(){return this.requestHandler.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.requestHandler.documentRoot}pathToInternalUrl(e){return this.requestHandler.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.requestHandler.internalUrlToPath(e)}initializeRuntime(e){if(this[ee])throw new Error("PHP runtime already initialized.");const r=ko(e);if(!r)throw new Error("Invalid PHP runtime id.");this[ee]=r,r.onMessage=n=>{for(const s of this.#i)s(n)},this.#n=ho(r)}setPhpIniPath(e){if(this.#t)throw new Error("Cannot set PHP ini path after calling run().");this[ee].ccall("wasm_set_phpini_path",null,["string"],[e])}setPhpIniEntry(e,r){if(this.#t)throw new Error("Cannot set PHP ini entries after calling run().");this.#e.push([e,r])}chdir(e){this[ee].FS.chdir(e)}async request(e,r){if(!this.requestHandler)throw new Error("No request handler available.");return this.requestHandler.request(e,r)}async run(e){this.#t||(this.#s(),this.#t=!0),this.#p(e.scriptPath||""),this.#a(e.relativeUri||""),this.#l(e.method||"GET");const{host:r,...n}={host:"example.com:443",...Xs(e.headers||{})};if(this.#c(r,e.protocol||"http"),this.#u(n),e.body&&this.#d(e.body),e.fileInfos)for(const s of e.fileInfos)this.#h(s);return e.code&&this.#m(" ?>"+e.code),this.#f(),await this.#y()}#s(){if(this.#e.length>0){const e=this.#e.map(([r,n])=>`${r}=${n}`).join(`
157
475
  `)+`
158
476
 
159
- `;this[ee].ccall("wasm_set_phpini_entries",null,[me],[e])}this[ee].ccall("php_wasm_init",null,[],[])}#o(){const e="/tmp/headers.json";if(!this.fileExists(e))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(e)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),a=s.substring(0,i).toLowerCase(),l=s.substring(i+2);a in n||(n[a]=[]),n[a].push(l)}return{headers:n,httpStatusCode:r.status}}#a(e){if(this[ee].ccall("wasm_set_request_uri",null,[me],[e]),e.includes("?")){const r=e.substring(e.indexOf("?")+1);this[ee].ccall("wasm_set_query_string",null,[me],[r])}}#c(e,r){this[ee].ccall("wasm_set_request_host",null,[me],[e]);let n;try{n=parseInt(new URL(e).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[ee].ccall("wasm_set_request_port",null,[$t],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")}#l(e){this[ee].ccall("wasm_set_request_method",null,[me],[e])}#u(e){e.cookie&&this[ee].ccall("wasm_set_cookies",null,[me],[e.cookie]),e["content-type"]&&this[ee].ccall("wasm_set_content_type",null,[me],[e["content-type"]]),e["content-length"]&&this[ee].ccall("wasm_set_content_length",null,[$t],[parseInt(e["content-length"],10)]);for(const r in e){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,e[r])}}#d(e){this[ee].ccall("wasm_set_request_body",null,[me],[e]),this[ee].ccall("wasm_set_content_length",null,[$t],[new TextEncoder().encode(e).length])}#f(e){this[ee].ccall("wasm_set_path_translated",null,[me],[e])}addServerGlobalEntry(e,r){this.#r[e]=r}#p(){for(const e in this.#r)this[ee].ccall("wasm_add_SERVER_entry",null,[me,me],[e,this.#r[e]])}#h(e){const{key:r,name:n,type:s,data:i}=e,a=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(a,i);const l=0;this[ee].ccall("wasm_add_uploaded_file",null,[me,me,me,me,$t,$t],[r,n,s,a,l,i.byteLength])}#m(e){this[ee].ccall("wasm_set_php_code",null,[me],[e])}async#y(){let e,r;try{e=await new Promise((i,a)=>{r=m=>{const u=new Error("Rethrown");u.cause=m.error,u.betterMessage=m.message,a(u)},this.#n?.addEventListener("error",r);const l=this[ee].ccall("wasm_sapi_handle_request",$t,[],[]);return l instanceof Promise?l.then(i,a):i(l)})}catch(i){for(const u in this)typeof this[u]=="function"&&(this[u]=()=>{throw new Error("PHP runtime has crashed – see the earlier error for details.")});this.functionsMaybeMissingFromAsyncify=co();const a=i,l="betterMessage"in a?a.betterMessage:a.message,m=new Error(l);throw m.cause=a,m}finally{this.#n?.removeEventListener("error",r),this.#r={}}const{headers:n,httpStatusCode:s}=this.#o();return new Pt(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),e)}mkdir(e){this[ee].FS.mkdirTree(e)}mkdirTree(e){this.mkdir(e)}readFileAsText(e){return new TextDecoder().decode(this.readFileAsBuffer(e))}readFileAsBuffer(e){return this[ee].FS.readFile(e)}writeFile(e,r){this[ee].FS.writeFile(e,r)}unlink(e){this[ee].FS.unlink(e)}mv(e,r){this[ee].FS.rename(e,r)}rmdir(e,r={recursive:!0}){r?.recursive&&this.listFiles(e).forEach(n=>{const s=`${e}/${n}`;this.isDir(s)?this.rmdir(s,r):this.unlink(s)}),this[ee].FS.rmdir(e)}listFiles(e,r={prependPath:!1}){if(!this.fileExists(e))return[];try{const n=this[ee].FS.readdir(e).filter(s=>s!=="."&&s!=="..");if(r.prependPath){const s=e.replace(/\/$/,"");return n.map(i=>`${s}/${i}`)}return n}catch(n){return console.error(n,{path:e}),[]}}isDir(e){return this.fileExists(e)?this[ee].FS.isDir(this[ee].FS.lookupPath(e).node.mode):!1}fileExists(e){try{return this[ee].FS.lookupPath(e),!0}catch{return!1}}}je([Ce('Could not create directory "{path}"')],ke.prototype,"mkdir",1);je([Ce('Could not create directory "{path}"')],ke.prototype,"mkdirTree",1);je([Ce('Could not read "{path}"')],ke.prototype,"readFileAsText",1);je([Ce('Could not read "{path}"')],ke.prototype,"readFileAsBuffer",1);je([Ce('Could not write to "{path}"')],ke.prototype,"writeFile",1);je([Ce('Could not unlink "{path}"')],ke.prototype,"unlink",1);je([Ce('Could not move "{path}"')],ke.prototype,"mv",1);je([Ce('Could not remove directory "{path}"')],ke.prototype,"rmdir",1);je([Ce('Could not list files in "{path}"')],ke.prototype,"listFiles",1);je([Ce('Could not stat "{path}"')],ke.prototype,"isDir",1);je([Ce('Could not stat "{path}"')],ke.prototype,"fileExists",1);function Xs(t){const e={};for(const r in t)e[r.toLowerCase()]=t[r];return e}const To=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function Ro(t){return t&&typeof t=="object"&&typeof t.resource=="string"&&To.includes(t.resource)}class lt{static create(e,{semaphore:r,progress:n}){let s;switch(e.resource){case"vfs":s=new No(e,n);break;case"literal":s=new Oo(e,n);break;case"wordpress.org/themes":s=new Io(e,n);break;case"wordpress.org/plugins":s=new Ao(e,n);break;case"url":s=new jo(e,n);break;default:throw new Error(`Invalid resource: ${e}`)}return s=new Do(s),r&&(s=new Fo(s,r)),s}setPlayground(e){this.playground=e}get isAsync(){return!1}}class No extends lt{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){const e=await this.playground.readFileAsBuffer(this.resource.path);return this.progress?.set(100),new Wr([e],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Oo extends lt{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){return this.progress?.set(100),new Wr([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class Yr extends lt{constructor(e){super(),this.progress=e}async resolve(){this.progress?.setCaption(this.caption);const e=this.getURL();let r=await fetch(e);if(r=await no(r,this.progress?.loadingListener??Co),r.status!==200)throw new Error(`Could not download "${e}"`);return new Wr([await r.blob()],this.name)}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const Co=()=>{};class jo extends Yr{constructor(e,r){super(r),this.resource=e}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}let xr="https://playground.wordpress.net/plugin-proxy";function ko(t){xr=t}class Io extends Yr{constructor(e,r){super(r),this.resource=e}get name(){return _r(this.resource.slug)}getURL(){const e=ei(this.resource.slug);return`${xr}?theme=`+e}}class Ao extends Yr{constructor(e,r){super(r),this.resource=e}get name(){return _r(this.resource.slug)}getURL(){const e=ei(this.resource.slug);return`${xr}?plugin=`+e}}function ei(t){return!t||t.endsWith(".zip")?t:t+".latest-stable.zip"}class ti extends lt{constructor(e){super(),this.resource=e}async resolve(){return this.resource.resolve()}async setPlayground(e){return this.resource.setPlayground(e)}get progress(){return this.resource.progress}set progress(e){this.resource.progress=e}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class Do extends ti{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class Fo extends ti{constructor(e,r){super(e),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Mo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dr={exports:{}},ri={},Oe={},Tt={},xt={},G={},Yt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(T){if(super(),!t.IDENTIFIER.test(T))throw new Error("CodeGen: name must be a valid identifier");this.str=T}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(T){super(),this._items=typeof T=="string"?[T]:T}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const T=this._items[0];return T===""||T==='""'}get str(){var T;return(T=this._str)!==null&&T!==void 0?T:this._str=this._items.reduce((R,j)=>`${R}${j}`,"")}get names(){var T;return(T=this._names)!==null&&T!==void 0?T:this._names=this._items.reduce((R,j)=>(j instanceof r&&(R[j.str]=(R[j.str]||0)+1),R),{})}}t._Code=n,t.nil=new n("");function s(y,...T){const R=[y[0]];let j=0;for(;j<T.length;)l(R,T[j]),R.push(y[++j]);return new n(R)}t._=s;const i=new n("+");function a(y,...T){const R=[C(y[0])];let j=0;for(;j<T.length;)R.push(i),l(R,T[j]),R.push(i,C(y[++j]));return m(R),new n(R)}t.str=a;function l(y,T){T instanceof n?y.push(...T._items):T instanceof r?y.push(T):y.push(g(T))}t.addCodeArg=l;function m(y){let T=1;for(;T<y.length-1;){if(y[T]===i){const R=u(y[T-1],y[T+1]);if(R!==void 0){y.splice(T-1,3,R);continue}y[T++]="+"}T++}}function u(y,T){if(T==='""')return y;if(y==='""')return T;if(typeof y=="string")return T instanceof r||y[y.length-1]!=='"'?void 0:typeof T!="string"?`${y.slice(0,-1)}${T}"`:T[0]==='"'?y.slice(0,-1)+T.slice(1):void 0;if(typeof T=="string"&&T[0]==='"'&&!(y instanceof r))return`"${y}${T.slice(1)}`}function f(y,T){return T.emptyStr()?y:y.emptyStr()?T:a`${y}${T}`}t.strConcat=f;function g(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:C(Array.isArray(y)?y.join(","):y)}function k(y){return new n(C(y))}t.stringify=k;function C(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=C;function E(y){return typeof y=="string"&&t.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}t.getProperty=E;function S(y){if(typeof y=="string"&&t.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}t.getEsmExportName=S;function $(y){return new n(y.toString())}t.regexpCode=$})(Yt);var Fr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=Yt;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:u,parent:f}={}){this._names={},this._prefixes=u,this._parent=f}toName(u){return u instanceof e.Name?u:this.name(u)}name(u){return new e.Name(this._newName(u))}_newName(u){const f=this._names[u]||this._nameGroup(u);return`${u}${f.index++}`}_nameGroup(u){var f,g;if(!((g=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||g===void 0)&&g.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}t.Scope=s;class i extends e.Name{constructor(u,f){super(f),this.prefix=u}setValue(u,{property:f,itemIndex:g}){this.value=u,this.scopePath=(0,e._)`.${new e.Name(f)}[${g}]`}}t.ValueScopeName=i;const a=(0,e._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:e.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,f){var g;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const k=this.toName(u),{prefix:C}=k,E=(g=f.key)!==null&&g!==void 0?g:f.ref;let S=this._values[C];if(S){const T=S.get(E);if(T)return T}else S=this._values[C]=new Map;S.set(E,k);const $=this._scope[C]||(this._scope[C]=[]),y=$.length;return $[y]=f.ref,k.setValue(f,{property:C,itemIndex:y}),k}getValue(u,f){const g=this._values[u];if(g)return g.get(f)}scopeRefs(u,f=this._values){return this._reduceValues(f,g=>{if(g.scopePath===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return(0,e._)`${u}${g.scopePath}`})}scopeCode(u=this._values,f,g){return this._reduceValues(u,k=>{if(k.value===void 0)throw new Error(`CodeGen: name "${k}" has no value`);return k.value.code},f,g)}_reduceValues(u,f,g={},k){let C=e.nil;for(const E in u){const S=u[E];if(!S)continue;const $=g[E]=g[E]||new Map;S.forEach(y=>{if($.has(y))return;$.set(y,n.Started);let T=f(y);if(T){const R=this.opts.es5?t.varKinds.var:t.varKinds.const;C=(0,e._)`${C}${R} ${y} = ${T};${this.opts._n}`}else if(T=k?.(y))C=(0,e._)`${C}${T}${this.opts._n}`;else throw new r(y);$.set(y,n.Completed)})}return C}}t.ValueScope=l})(Fr);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=Yt,r=Fr;var n=Yt;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Fr;Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(o,p){return this}}class a extends i{constructor(o,p,O){super(),this.varKind=o,this.name=p,this.rhs=O}render({es5:o,_n:p}){const O=o?r.varKinds.var:this.varKind,M=this.rhs===void 0?"":` = ${this.rhs}`;return`${O} ${this.name}${M};`+p}optimizeNames(o,p){if(o[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,o,p)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(o,p,O){super(),this.lhs=o,this.rhs=p,this.sideEffects=O}render({_n:o}){return`${this.lhs} = ${this.rhs};`+o}optimizeNames(o,p){if(!(this.lhs instanceof e.Name&&!o[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,o,p),this}get names(){const o=this.lhs instanceof e.Name?{}:{...this.lhs.names};return be(o,this.rhs)}}class m extends l{constructor(o,p,O,M){super(o,O,M),this.op=p}render({_n:o}){return`${this.lhs} ${this.op}= ${this.rhs};`+o}}class u extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`${this.label}:`+o}}class f extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`break${this.label?` ${this.label}`:""};`+o}}class g extends i{constructor(o){super(),this.error=o}render({_n:o}){return`throw ${this.error};`+o}get names(){return this.error.names}}class k extends i{constructor(o){super(),this.code=o}render({_n:o}){return`${this.code};`+o}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(o,p){return this.code=de(this.code,o,p),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class C extends i{constructor(o=[]){super(),this.nodes=o}render(o){return this.nodes.reduce((p,O)=>p+O.render(o),"")}optimizeNodes(){const{nodes:o}=this;let p=o.length;for(;p--;){const O=o[p].optimizeNodes();Array.isArray(O)?o.splice(p,1,...O):O?o[p]=O:o.splice(p,1)}return o.length>0?this:void 0}optimizeNames(o,p){const{nodes:O}=this;let M=O.length;for(;M--;){const U=O[M];U.optimizeNames(o,p)||(Ze(o,U.names),O.splice(M,1))}return O.length>0?this:void 0}get names(){return this.nodes.reduce((o,p)=>Z(o,p.names),{})}}class E extends C{render(o){return"{"+o._n+super.render(o)+"}"+o._n}}class S extends C{}class $ extends E{}$.kind="else";class y extends E{constructor(o,p){super(p),this.condition=o}render(o){let p=`if(${this.condition})`+super.render(o);return this.else&&(p+="else "+this.else.render(o)),p}optimizeNodes(){super.optimizeNodes();const o=this.condition;if(o===!0)return this.nodes;let p=this.else;if(p){const O=p.optimizeNodes();p=this.else=Array.isArray(O)?new $(O):O}if(p)return o===!1?p instanceof y?p:p.nodes:this.nodes.length?this:new y(Qe(o),p instanceof y?[p]:p.nodes);if(!(o===!1||!this.nodes.length))return this}optimizeNames(o,p){var O;if(this.else=(O=this.else)===null||O===void 0?void 0:O.optimizeNames(o,p),!!(super.optimizeNames(o,p)||this.else))return this.condition=de(this.condition,o,p),this}get names(){const o=super.names;return be(o,this.condition),this.else&&Z(o,this.else.names),o}}y.kind="if";class T extends E{}T.kind="for";class R extends T{constructor(o){super(),this.iteration=o}render(o){return`for(${this.iteration})`+super.render(o)}optimizeNames(o,p){if(super.optimizeNames(o,p))return this.iteration=de(this.iteration,o,p),this}get names(){return Z(super.names,this.iteration.names)}}class j extends T{constructor(o,p,O,M){super(),this.varKind=o,this.name=p,this.from=O,this.to=M}render(o){const p=o.es5?r.varKinds.var:this.varKind,{name:O,from:M,to:U}=this;return`for(${p} ${O}=${M}; ${O}<${U}; ${O}++)`+super.render(o)}get names(){const o=be(super.names,this.from);return be(o,this.to)}}class D extends T{constructor(o,p,O,M){super(),this.loop=o,this.varKind=p,this.name=O,this.iterable=M}render(o){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(o)}optimizeNames(o,p){if(super.optimizeNames(o,p))return this.iterable=de(this.iterable,o,p),this}get names(){return Z(super.names,this.iterable.names)}}class _ extends E{constructor(o,p,O){super(),this.name=o,this.args=p,this.async=O}render(o){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(o)}}_.kind="func";class N extends C{render(o){return"return "+super.render(o)}}N.kind="return";class A extends E{render(o){let p="try"+super.render(o);return this.catch&&(p+=this.catch.render(o)),this.finally&&(p+=this.finally.render(o)),p}optimizeNodes(){var o,p;return super.optimizeNodes(),(o=this.catch)===null||o===void 0||o.optimizeNodes(),(p=this.finally)===null||p===void 0||p.optimizeNodes(),this}optimizeNames(o,p){var O,M;return super.optimizeNames(o,p),(O=this.catch)===null||O===void 0||O.optimizeNames(o,p),(M=this.finally)===null||M===void 0||M.optimizeNames(o,p),this}get names(){const o=super.names;return this.catch&&Z(o,this.catch.names),this.finally&&Z(o,this.finally.names),o}}class H extends E{constructor(o){super(),this.error=o}render(o){return`catch(${this.error})`+super.render(o)}}H.kind="catch";class B extends E{render(o){return"finally"+super.render(o)}}B.kind="finally";class oe{constructor(o,p={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...p,_n:p.lines?`
160
- `:""},this._extScope=o,this._scope=new r.Scope({parent:o}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(o){return this._scope.name(o)}scopeName(o){return this._extScope.name(o)}scopeValue(o,p){const O=this._extScope.value(o,p);return(this._values[O.prefix]||(this._values[O.prefix]=new Set)).add(O),O}getScopeValue(o,p){return this._extScope.getValue(o,p)}scopeRefs(o){return this._extScope.scopeRefs(o,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(o,p,O,M){const U=this._scope.toName(p);return O!==void 0&&M&&(this._constants[U.str]=O),this._leafNode(new a(o,U,O)),U}const(o,p,O){return this._def(r.varKinds.const,o,p,O)}let(o,p,O){return this._def(r.varKinds.let,o,p,O)}var(o,p,O){return this._def(r.varKinds.var,o,p,O)}assign(o,p,O){return this._leafNode(new l(o,p,O))}add(o,p){return this._leafNode(new m(o,t.operators.ADD,p))}code(o){return typeof o=="function"?o():o!==e.nil&&this._leafNode(new k(o)),this}object(...o){const p=["{"];for(const[O,M]of o)p.length>1&&p.push(","),p.push(O),(O!==M||this.opts.es5)&&(p.push(":"),(0,e.addCodeArg)(p,M));return p.push("}"),new e._Code(p)}if(o,p,O){if(this._blockNode(new y(o)),p&&O)this.code(p).else().code(O).endIf();else if(p)this.code(p).endIf();else if(O)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(o){return this._elseNode(new y(o))}else(){return this._elseNode(new $)}endIf(){return this._endBlockNode(y,$)}_for(o,p){return this._blockNode(o),p&&this.code(p).endFor(),this}for(o,p){return this._for(new R(o),p)}forRange(o,p,O,M,U=this.opts.es5?r.varKinds.var:r.varKinds.let){const J=this._scope.toName(o);return this._for(new j(U,J,p,O),()=>M(J))}forOf(o,p,O,M=r.varKinds.const){const U=this._scope.toName(o);if(this.opts.es5){const J=p instanceof e.Name?p:this.var("_arr",p);return this.forRange("_i",0,(0,e._)`${J}.length`,x=>{this.var(U,(0,e._)`${J}[${x}]`),O(U)})}return this._for(new D("of",M,U,p),()=>O(U))}forIn(o,p,O,M=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(o,(0,e._)`Object.keys(${p})`,O);const U=this._scope.toName(o);return this._for(new D("in",M,U,p),()=>O(U))}endFor(){return this._endBlockNode(T)}label(o){return this._leafNode(new u(o))}break(o){return this._leafNode(new f(o))}return(o){const p=new N;if(this._blockNode(p),this.code(o),p.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(N)}try(o,p,O){if(!p&&!O)throw new Error('CodeGen: "try" without "catch" and "finally"');const M=new A;if(this._blockNode(M),this.code(o),p){const U=this.name("e");this._currNode=M.catch=new H(U),p(U)}return O&&(this._currNode=M.finally=new B,this.code(O)),this._endBlockNode(H,B)}throw(o){return this._leafNode(new g(o))}block(o,p){return this._blockStarts.push(this._nodes.length),o&&this.code(o).endBlock(p),this}endBlock(o){const p=this._blockStarts.pop();if(p===void 0)throw new Error("CodeGen: not in self-balancing block");const O=this._nodes.length-p;if(O<0||o!==void 0&&O!==o)throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${o} expected`);return this._nodes.length=p,this}func(o,p=e.nil,O,M){return this._blockNode(new _(o,p,O)),M&&this.code(M).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(o=1){for(;o-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(o){return this._currNode.nodes.push(o),this}_blockNode(o){this._currNode.nodes.push(o),this._nodes.push(o)}_endBlockNode(o,p){const O=this._currNode;if(O instanceof o||p&&O instanceof p)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${p?`${o.kind}/${p.kind}`:o.kind}"`)}_elseNode(o){const p=this._currNode;if(!(p instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=p.else=o,this}get _root(){return this._nodes[0]}get _currNode(){const o=this._nodes;return o[o.length-1]}set _currNode(o){const p=this._nodes;p[p.length-1]=o}}t.CodeGen=oe;function Z(w,o){for(const p in o)w[p]=(w[p]||0)+(o[p]||0);return w}function be(w,o){return o instanceof e._CodeOrName?Z(w,o.names):w}function de(w,o,p){if(w instanceof e.Name)return O(w);if(!M(w))return w;return new e._Code(w._items.reduce((U,J)=>(J instanceof e.Name&&(J=O(J)),J instanceof e._Code?U.push(...J._items):U.push(J),U),[]));function O(U){const J=p[U.str];return J===void 0||o[U.str]!==1?U:(delete o[U.str],J)}function M(U){return U instanceof e._Code&&U._items.some(J=>J instanceof e.Name&&o[J.str]===1&&p[J.str]!==void 0)}}function Ze(w,o){for(const p in o)w[p]=(w[p]||0)-(o[p]||0)}function Qe(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,e._)`!${I(w)}`}t.not=Qe;const ut=v(t.operators.AND);function Ct(...w){return w.reduce(ut)}t.and=Ct;const dt=v(t.operators.OR);function F(...w){return w.reduce(dt)}t.or=F;function v(w){return(o,p)=>o===e.nil?p:p===e.nil?o:(0,e._)`${I(o)} ${w} ${I(p)}`}function I(w){return w instanceof e.Name?w:(0,e._)`(${w})`}})(G);var X={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const e=G,r=Yt;function n(_){const N={};for(const A of _)N[A]=!0;return N}t.toHash=n;function s(_,N){return typeof N=="boolean"?N:Object.keys(N).length===0?!0:(i(_,N),!a(N,_.self.RULES.all))}t.alwaysValidSchema=s;function i(_,N=_.schema){const{opts:A,self:H}=_;if(!A.strictSchema||typeof N=="boolean")return;const B=H.RULES.keywords;for(const oe in N)B[oe]||D(_,`unknown keyword: "${oe}"`)}t.checkUnknownRules=i;function a(_,N){if(typeof _=="boolean")return!_;for(const A in _)if(N[A])return!0;return!1}t.schemaHasRules=a;function l(_,N){if(typeof _=="boolean")return!_;for(const A in _)if(A!=="$ref"&&N.all[A])return!0;return!1}t.schemaHasRulesButRef=l;function m({topSchemaRef:_,schemaPath:N},A,H,B){if(!B){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,e._)`${A}`}return(0,e._)`${_}${N}${(0,e.getProperty)(H)}`}t.schemaRefOrVal=m;function u(_){return k(decodeURIComponent(_))}t.unescapeFragment=u;function f(_){return encodeURIComponent(g(_))}t.escapeFragment=f;function g(_){return typeof _=="number"?`${_}`:_.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=g;function k(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=k;function C(_,N){if(Array.isArray(_))for(const A of _)N(A);else N(_)}t.eachItem=C;function E({mergeNames:_,mergeToName:N,mergeValues:A,resultToName:H}){return(B,oe,Z,be)=>{const de=Z===void 0?oe:Z instanceof e.Name?(oe instanceof e.Name?_(B,oe,Z):N(B,oe,Z),Z):oe instanceof e.Name?(N(B,Z,oe),oe):A(oe,Z);return be===e.Name&&!(de instanceof e.Name)?H(B,de):de}}t.mergeEvaluated={props:E({mergeNames:(_,N,A)=>_.if((0,e._)`${A} !== true && ${N} !== undefined`,()=>{_.if((0,e._)`${N} === true`,()=>_.assign(A,!0),()=>_.assign(A,(0,e._)`${A} || {}`).code((0,e._)`Object.assign(${A}, ${N})`))}),mergeToName:(_,N,A)=>_.if((0,e._)`${A} !== true`,()=>{N===!0?_.assign(A,!0):(_.assign(A,(0,e._)`${A} || {}`),$(_,A,N))}),mergeValues:(_,N)=>_===!0?!0:{..._,...N},resultToName:S}),items:E({mergeNames:(_,N,A)=>_.if((0,e._)`${A} !== true && ${N} !== undefined`,()=>_.assign(A,(0,e._)`${N} === true ? true : ${A} > ${N} ? ${A} : ${N}`)),mergeToName:(_,N,A)=>_.if((0,e._)`${A} !== true`,()=>_.assign(A,N===!0?!0:(0,e._)`${A} > ${N} ? ${A} : ${N}`)),mergeValues:(_,N)=>_===!0?!0:Math.max(_,N),resultToName:(_,N)=>_.var("items",N)})};function S(_,N){if(N===!0)return _.var("props",!0);const A=_.var("props",(0,e._)`{}`);return N!==void 0&&$(_,A,N),A}t.evaluatedPropsToName=S;function $(_,N,A){Object.keys(A).forEach(H=>_.assign((0,e._)`${N}${(0,e.getProperty)(H)}`,!0))}t.setEvaluated=$;const y={};function T(_,N){return _.scopeValue("func",{ref:N,code:y[N.code]||(y[N.code]=new r._Code(N.code))})}t.useFunc=T;var R;(function(_){_[_.Num=0]="Num",_[_.Str=1]="Str"})(R=t.Type||(t.Type={}));function j(_,N,A){if(_ instanceof e.Name){const H=N===R.Num;return A?H?(0,e._)`"[" + ${_} + "]"`:(0,e._)`"['" + ${_} + "']"`:H?(0,e._)`"/" + ${_}`:(0,e._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,e.getProperty)(_).toString():"/"+g(_)}t.getErrorPath=j;function D(_,N,A=_.opts.strictSchema){if(A){if(N=`strict mode: ${N}`,A===!0)throw new Error(N);_.self.logger.warn(N)}}t.checkStrictMode=D})(X);var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});const ye=G,qo={data:new ye.Name("data"),valCxt:new ye.Name("valCxt"),instancePath:new ye.Name("instancePath"),parentData:new ye.Name("parentData"),parentDataProperty:new ye.Name("parentDataProperty"),rootData:new ye.Name("rootData"),dynamicAnchors:new ye.Name("dynamicAnchors"),vErrors:new ye.Name("vErrors"),errors:new ye.Name("errors"),this:new ye.Name("this"),self:new ye.Name("self"),scope:new ye.Name("scope"),json:new ye.Name("json"),jsonPos:new ye.Name("jsonPos"),jsonLen:new ye.Name("jsonLen"),jsonPart:new ye.Name("jsonPart")};Ve.default=qo;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=G,r=X,n=Ve;t.keywordError={message:({keyword:$})=>(0,e.str)`must pass "${$}" keyword validation`},t.keyword$DataError={message:({keyword:$,schemaType:y})=>y?(0,e.str)`"${$}" keyword must be ${y} ($data)`:(0,e.str)`"${$}" keyword is invalid ($data)`};function s($,y=t.keywordError,T,R){const{it:j}=$,{gen:D,compositeRule:_,allErrors:N}=j,A=g($,y,T);R??(_||N)?m(D,A):u(j,(0,e._)`[${A}]`)}t.reportError=s;function i($,y=t.keywordError,T){const{it:R}=$,{gen:j,compositeRule:D,allErrors:_}=R,N=g($,y,T);m(j,N),D||_||u(R,n.default.vErrors)}t.reportExtraError=i;function a($,y){$.assign(n.default.errors,y),$.if((0,e._)`${n.default.vErrors} !== null`,()=>$.if(y,()=>$.assign((0,e._)`${n.default.vErrors}.length`,y),()=>$.assign(n.default.vErrors,null)))}t.resetErrorsCount=a;function l({gen:$,keyword:y,schemaValue:T,data:R,errsCount:j,it:D}){if(j===void 0)throw new Error("ajv implementation error");const _=$.name("err");$.forRange("i",j,n.default.errors,N=>{$.const(_,(0,e._)`${n.default.vErrors}[${N}]`),$.if((0,e._)`${_}.instancePath === undefined`,()=>$.assign((0,e._)`${_}.instancePath`,(0,e.strConcat)(n.default.instancePath,D.errorPath))),$.assign((0,e._)`${_}.schemaPath`,(0,e.str)`${D.errSchemaPath}/${y}`),D.opts.verbose&&($.assign((0,e._)`${_}.schema`,T),$.assign((0,e._)`${_}.data`,R))})}t.extendErrors=l;function m($,y){const T=$.const("err",y);$.if((0,e._)`${n.default.vErrors} === null`,()=>$.assign(n.default.vErrors,(0,e._)`[${T}]`),(0,e._)`${n.default.vErrors}.push(${T})`),$.code((0,e._)`${n.default.errors}++`)}function u($,y){const{gen:T,validateName:R,schemaEnv:j}=$;j.$async?T.throw((0,e._)`new ${$.ValidationError}(${y})`):(T.assign((0,e._)`${R}.errors`,y),T.return(!1))}const f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function g($,y,T){const{createErrors:R}=$.it;return R===!1?(0,e._)`{}`:k($,y,T)}function k($,y,T={}){const{gen:R,it:j}=$,D=[C(j,T),E($,T)];return S($,y,D),R.object(...D)}function C({errorPath:$},{instancePath:y}){const T=y?(0,e.str)`${$}${(0,r.getErrorPath)(y,r.Type.Str)}`:$;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,T)]}function E({keyword:$,it:{errSchemaPath:y}},{schemaPath:T,parentSchema:R}){let j=R?y:(0,e.str)`${y}/${$}`;return T&&(j=(0,e.str)`${j}${(0,r.getErrorPath)(T,r.Type.Str)}`),[f.schemaPath,j]}function S($,{params:y,message:T},R){const{keyword:j,data:D,schemaValue:_,it:N}=$,{opts:A,propertyName:H,topSchemaRef:B,schemaPath:oe}=N;R.push([f.keyword,j],[f.params,typeof y=="function"?y($):y||(0,e._)`{}`]),A.messages&&R.push([f.message,typeof T=="function"?T($):T]),A.verbose&&R.push([f.schema,_],[f.parentSchema,(0,e._)`${B}${oe}`],[n.default.data,D]),H&&R.push([f.propertyName,H])}})(xt);Object.defineProperty(Tt,"__esModule",{value:!0});Tt.boolOrEmptySchema=Tt.topBoolOrEmptySchema=void 0;const Lo=xt,Vo=G,zo=Ve,Ho={message:"boolean schema is false"};function Wo(t){const{gen:e,schema:r,validateName:n}=t;r===!1?ni(t,!1):typeof r=="object"&&r.$async===!0?e.return(zo.default.data):(e.assign((0,Vo._)`${n}.errors`,null),e.return(!0))}Tt.topBoolOrEmptySchema=Wo;function Ko(t,e){const{gen:r,schema:n}=t;n===!1?(r.var(e,!1),ni(t)):r.var(e,!0)}Tt.boolOrEmptySchema=Ko;function ni(t,e){const{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Lo.reportError)(s,Ho,void 0,e)}var Zt={},at={};Object.defineProperty(at,"__esModule",{value:!0});at.getRules=at.isJSONType=void 0;const Go=["string","number","integer","boolean","null","object","array"],Bo=new Set(Go);function Jo(t){return typeof t=="string"&&Bo.has(t)}at.isJSONType=Jo;function Yo(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}at.getRules=Yo;var He={};Object.defineProperty(He,"__esModule",{value:!0});He.shouldUseRule=He.shouldUseGroup=He.schemaHasRulesForType=void 0;function xo({schema:t,self:e},r){const n=e.RULES.types[r];return n&&n!==!0&&si(t,n)}He.schemaHasRulesForType=xo;function si(t,e){return e.rules.some(r=>ii(t,r))}He.shouldUseGroup=si;function ii(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}He.shouldUseRule=ii;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const e=at,r=He,n=xt,s=G,i=X;var a;(function(R){R[R.Correct=0]="Correct",R[R.Wrong=1]="Wrong"})(a=t.DataType||(t.DataType={}));function l(R){const j=m(R.type);if(j.includes("null")){if(R.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&R.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');R.nullable===!0&&j.push("null")}return j}t.getSchemaTypes=l;function m(R){const j=Array.isArray(R)?R:R?[R]:[];if(j.every(e.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}t.getJSONTypes=m;function u(R,j){const{gen:D,data:_,opts:N}=R,A=g(j,N.coerceTypes),H=j.length>0&&!(A.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(R,j[0]));if(H){const B=S(j,_,N.strictNumbers,a.Wrong);D.if(B,()=>{A.length?k(R,j,A):y(R)})}return H}t.coerceAndCheckDataType=u;const f=new Set(["string","number","integer","boolean","null"]);function g(R,j){return j?R.filter(D=>f.has(D)||j==="array"&&D==="array"):[]}function k(R,j,D){const{gen:_,data:N,opts:A}=R,H=_.let("dataType",(0,s._)`typeof ${N}`),B=_.let("coerced",(0,s._)`undefined`);A.coerceTypes==="array"&&_.if((0,s._)`${H} == 'object' && Array.isArray(${N}) && ${N}.length == 1`,()=>_.assign(N,(0,s._)`${N}[0]`).assign(H,(0,s._)`typeof ${N}`).if(S(j,N,A.strictNumbers),()=>_.assign(B,N))),_.if((0,s._)`${B} !== undefined`);for(const Z of D)(f.has(Z)||Z==="array"&&A.coerceTypes==="array")&&oe(Z);_.else(),y(R),_.endIf(),_.if((0,s._)`${B} !== undefined`,()=>{_.assign(N,B),C(R,B)});function oe(Z){switch(Z){case"string":_.elseIf((0,s._)`${H} == "number" || ${H} == "boolean"`).assign(B,(0,s._)`"" + ${N}`).elseIf((0,s._)`${N} === null`).assign(B,(0,s._)`""`);return;case"number":_.elseIf((0,s._)`${H} == "boolean" || ${N} === null
161
- || (${H} == "string" && ${N} && ${N} == +${N})`).assign(B,(0,s._)`+${N}`);return;case"integer":_.elseIf((0,s._)`${H} === "boolean" || ${N} === null
162
- || (${H} === "string" && ${N} && ${N} == +${N} && !(${N} % 1))`).assign(B,(0,s._)`+${N}`);return;case"boolean":_.elseIf((0,s._)`${N} === "false" || ${N} === 0 || ${N} === null`).assign(B,!1).elseIf((0,s._)`${N} === "true" || ${N} === 1`).assign(B,!0);return;case"null":_.elseIf((0,s._)`${N} === "" || ${N} === 0 || ${N} === false`),_.assign(B,null);return;case"array":_.elseIf((0,s._)`${H} === "string" || ${H} === "number"
163
- || ${H} === "boolean" || ${N} === null`).assign(B,(0,s._)`[${N}]`)}}}function C({gen:R,parentData:j,parentDataProperty:D},_){R.if((0,s._)`${j} !== undefined`,()=>R.assign((0,s._)`${j}[${D}]`,_))}function E(R,j,D,_=a.Correct){const N=_===a.Correct?s.operators.EQ:s.operators.NEQ;let A;switch(R){case"null":return(0,s._)`${j} ${N} null`;case"array":A=(0,s._)`Array.isArray(${j})`;break;case"object":A=(0,s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":A=H((0,s._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":A=H();break;default:return(0,s._)`typeof ${j} ${N} ${R}`}return _===a.Correct?A:(0,s.not)(A);function H(B=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,B,D?(0,s._)`isFinite(${j})`:s.nil)}}t.checkDataType=E;function S(R,j,D,_){if(R.length===1)return E(R[0],j,D,_);let N;const A=(0,i.toHash)(R);if(A.array&&A.object){const H=(0,s._)`typeof ${j} != "object"`;N=A.null?H:(0,s._)`!${j} || ${H}`,delete A.null,delete A.array,delete A.object}else N=s.nil;A.number&&delete A.integer;for(const H in A)N=(0,s.and)(N,E(H,j,D,_));return N}t.checkDataTypes=S;const $={message:({schema:R})=>`must be ${R}`,params:({schema:R,schemaValue:j})=>typeof R=="string"?(0,s._)`{type: ${R}}`:(0,s._)`{type: ${j}}`};function y(R){const j=T(R);(0,n.reportError)(j,$)}t.reportTypeError=y;function T(R){const{gen:j,data:D,schema:_}=R,N=(0,i.schemaRefOrVal)(R,_,"type");return{gen:j,keyword:"type",data:D,schema:_.type,schemaCode:N,schemaValue:N,parentSchema:_,params:{},it:R}}})(Zt);var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.assignDefaults=void 0;const _t=G,Zo=X;function Qo(t,e){const{properties:r,items:n}=t.schema;if(e==="object"&&r)for(const s in r)as(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>as(t,i,s.default))}Pr.assignDefaults=Qo;function as(t,e,r){const{gen:n,compositeRule:s,data:i,opts:a}=t;if(r===void 0)return;const l=(0,_t._)`${i}${(0,_t.getProperty)(e)}`;if(s){(0,Zo.checkStrictMode)(t,`default is ignored for: ${l}`);return}let m=(0,_t._)`${l} === undefined`;a.useDefaults==="empty"&&(m=(0,_t._)`${m} || ${l} === null || ${l} === ""`),n.if(m,(0,_t._)`${l} = ${(0,_t.stringify)(r)}`)}var Le={},K={};Object.defineProperty(K,"__esModule",{value:!0});K.validateUnion=K.validateArray=K.usePattern=K.callValidateCode=K.schemaProperties=K.allSchemaProperties=K.noPropertyInData=K.propertyInData=K.isOwnProperty=K.hasPropFunc=K.reportMissingProp=K.checkMissingProp=K.checkReportMissingProp=void 0;const ne=G,Zr=X,Be=Ve,Xo=X;function ea(t,e){const{gen:r,data:n,it:s}=t;r.if(Xr(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ne._)`${e}`},!0),t.error()})}K.checkReportMissingProp=ea;function ta({gen:t,data:e,it:{opts:r}},n,s){return(0,ne.or)(...n.map(i=>(0,ne.and)(Xr(t,e,i,r.ownProperties),(0,ne._)`${s} = ${i}`)))}K.checkMissingProp=ta;function ra(t,e){t.setParams({missingProperty:e},!0),t.error()}K.reportMissingProp=ra;function oi(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ne._)`Object.prototype.hasOwnProperty`})}K.hasPropFunc=oi;function Qr(t,e,r){return(0,ne._)`${oi(t)}.call(${e}, ${r})`}K.isOwnProperty=Qr;function na(t,e,r,n){const s=(0,ne._)`${e}${(0,ne.getProperty)(r)} !== undefined`;return n?(0,ne._)`${s} && ${Qr(t,e,r)}`:s}K.propertyInData=na;function Xr(t,e,r,n){const s=(0,ne._)`${e}${(0,ne.getProperty)(r)} === undefined`;return n?(0,ne.or)(s,(0,ne.not)(Qr(t,e,r))):s}K.noPropertyInData=Xr;function ai(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}K.allSchemaProperties=ai;function sa(t,e){return ai(e).filter(r=>!(0,Zr.alwaysValidSchema)(t,e[r]))}K.schemaProperties=sa;function ia({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:a},l,m,u){const f=u?(0,ne._)`${t}, ${e}, ${n}${s}`:e,g=[[Be.default.instancePath,(0,ne.strConcat)(Be.default.instancePath,i)],[Be.default.parentData,a.parentData],[Be.default.parentDataProperty,a.parentDataProperty],[Be.default.rootData,Be.default.rootData]];a.opts.dynamicRef&&g.push([Be.default.dynamicAnchors,Be.default.dynamicAnchors]);const k=(0,ne._)`${f}, ${r.object(...g)}`;return m!==ne.nil?(0,ne._)`${l}.call(${m}, ${k})`:(0,ne._)`${l}(${k})`}K.callValidateCode=ia;const oa=(0,ne._)`new RegExp`;function aa({gen:t,it:{opts:e}},r){const n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ne._)`${s.code==="new RegExp"?oa:(0,Xo.useFunc)(t,s)}(${r}, ${n})`})}K.usePattern=aa;function ca(t){const{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){const l=e.let("valid",!0);return a(()=>e.assign(l,!1)),l}return e.var(i,!0),a(()=>e.break()),i;function a(l){const m=e.const("len",(0,ne._)`${r}.length`);e.forRange("i",0,m,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Zr.Type.Num},i),e.if((0,ne.not)(i),l)})}}K.validateArray=ca;function la(t){const{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(m=>(0,Zr.alwaysValidSchema)(s,m))&&!s.opts.unevaluated)return;const a=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((m,u)=>{const f=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);e.assign(a,(0,ne._)`${a} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,ne.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}K.validateUnion=la;Object.defineProperty(Le,"__esModule",{value:!0});Le.validateKeywordUsage=Le.validSchemaType=Le.funcKeywordCode=Le.macroKeywordCode=void 0;const ge=G,st=Ve,ua=K,da=xt;function fa(t,e){const{gen:r,keyword:n,schema:s,parentSchema:i,it:a}=t,l=e.macro.call(a.self,s,i,a),m=ci(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);const u=r.name("valid");t.subschema({schema:l,schemaPath:ge.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:m,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Le.macroKeywordCode=fa;function pa(t,e){var r;const{gen:n,keyword:s,schema:i,parentSchema:a,$data:l,it:m}=t;ma(m,e);const u=!l&&e.compile?e.compile.call(m.self,i,a,m):e.validate,f=ci(n,s,u),g=n.let("valid");t.block$data(g,k),t.ok((r=e.valid)!==null&&r!==void 0?r:g);function k(){if(e.errors===!1)S(),e.modifying&&cs(t),$(()=>t.error());else{const y=e.async?C():E();e.modifying&&cs(t),$(()=>ha(t,y))}}function C(){const y=n.let("ruleErrs",null);return n.try(()=>S((0,ge._)`await `),T=>n.assign(g,!1).if((0,ge._)`${T} instanceof ${m.ValidationError}`,()=>n.assign(y,(0,ge._)`${T}.errors`),()=>n.throw(T))),y}function E(){const y=(0,ge._)`${f}.errors`;return n.assign(y,null),S(ge.nil),y}function S(y=e.async?(0,ge._)`await `:ge.nil){const T=m.opts.passContext?st.default.this:st.default.self,R=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,ge._)`${y}${(0,ua.callValidateCode)(t,f,T,R)}`,e.modifying)}function $(y){var T;n.if((0,ge.not)((T=e.valid)!==null&&T!==void 0?T:g),y)}}Le.funcKeywordCode=pa;function cs(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,ge._)`${n.parentData}[${n.parentDataProperty}]`))}function ha(t,e){const{gen:r}=t;r.if((0,ge._)`Array.isArray(${e})`,()=>{r.assign(st.default.vErrors,(0,ge._)`${st.default.vErrors} === null ? ${e} : ${st.default.vErrors}.concat(${e})`).assign(st.default.errors,(0,ge._)`${st.default.vErrors}.length`),(0,da.extendErrors)(t)},()=>t.error())}function ma({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function ci(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ge.stringify)(r)})}function ya(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Le.validSchemaType=ya;function ga({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");const a=s.dependencies;if(a?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){const m=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(m);else throw new Error(m)}}Le.validateKeywordUsage=ga;var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.extendSubschemaMode=xe.extendSubschemaData=xe.getSubschema=void 0;const qe=G,li=X;function va(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,qe._)`${t.schemaPath}${(0,qe.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,qe._)`${t.schemaPath}${(0,qe.getProperty)(e)}${(0,qe.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,li.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}xe.getSubschema=va;function $a(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=e;if(r!==void 0){const{errorPath:u,dataPathArr:f,opts:g}=e,k=l.let("data",(0,qe._)`${e.data}${(0,qe.getProperty)(r)}`,!0);m(k),t.errorPath=(0,qe.str)`${u}${(0,li.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,qe._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(s!==void 0){const u=s instanceof qe.Name?s:l.let("data",s,!0);m(u),a!==void 0&&(t.propertyName=a)}i&&(t.dataTypes=i);function m(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}xe.extendSubschemaData=$a;function _a(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}xe.extendSubschemaMode=_a;var he={},ui=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r},di={exports:{}},Ye=di.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};dr(e,n,s,t,"",t)};Ye.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ye.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ye.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ye.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function dr(t,e,r,n,s,i,a,l,m,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,a,l,m,u);for(var f in n){var g=n[f];if(Array.isArray(g)){if(f in Ye.arrayKeywords)for(var k=0;k<g.length;k++)dr(t,e,r,g[k],s+"/"+f+"/"+k,i,s,f,n,k)}else if(f in Ye.propsKeywords){if(g&&typeof g=="object")for(var C in g)dr(t,e,r,g[C],s+"/"+f+"/"+wa(C),i,s,f,n,C)}else(f in Ye.keywords||t.allKeys&&!(f in Ye.skipKeywords))&&dr(t,e,r,g,s+"/"+f,i,s,f,n)}r(n,s,i,a,l,m,u)}}function wa(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var ba=di.exports;Object.defineProperty(he,"__esModule",{value:!0});he.getSchemaRefs=he.resolveUrl=he.normalizeId=he._getFullPath=he.getFullPath=he.inlineRef=void 0;const Pa=X,Ea=ui,Sa=ba,Ta=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Ra(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Mr(t):e?fi(t)<=e:!1}he.inlineRef=Ra;const Na=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Mr(t){for(const e in t){if(Na.has(e))return!0;const r=t[e];if(Array.isArray(r)&&r.some(Mr)||typeof r=="object"&&Mr(r))return!0}return!1}function fi(t){let e=0;for(const r in t){if(r==="$ref")return 1/0;if(e++,!Ta.has(r)&&(typeof t[r]=="object"&&(0,Pa.eachItem)(t[r],n=>e+=fi(n)),e===1/0))return 1/0}return e}function pi(t,e="",r){r!==!1&&(e=Et(e));const n=t.parse(e);return hi(t,n)}he.getFullPath=pi;function hi(t,e){return t.serialize(e).split("#")[0]+"#"}he._getFullPath=hi;const Oa=/#\/?$/;function Et(t){return t?t.replace(Oa,""):""}he.normalizeId=Et;function Ca(t,e,r){return r=Et(r),t.resolve(e,r)}he.resolveUrl=Ca;const ja=/^[a-z_][-a-z0-9._]*$/i;function ka(t,e){if(typeof t=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Et(t[r]||e),i={"":s},a=pi(n,s,!1),l={},m=new Set;return Sa(t,{allKeys:!0},(g,k,C,E)=>{if(E===void 0)return;const S=a+k;let $=i[E];typeof g[r]=="string"&&($=y.call(this,g[r])),T.call(this,g.$anchor),T.call(this,g.$dynamicAnchor),i[k]=$;function y(R){const j=this.opts.uriResolver.resolve;if(R=Et($?j($,R):R),m.has(R))throw f(R);m.add(R);let D=this.refs[R];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?u(g,D.schema,R):R!==Et(S)&&(R[0]==="#"?(u(g,l[R],R),l[R]=g):this.refs[R]=S),R}function T(R){if(typeof R=="string"){if(!ja.test(R))throw new Error(`invalid anchor "${R}"`);y.call(this,`#${R}`)}}}),l;function u(g,k,C){if(k!==void 0&&!Ea(g,k))throw f(C)}function f(g){return new Error(`reference "${g}" resolves to more than one schema`)}}he.getSchemaRefs=ka;Object.defineProperty(Oe,"__esModule",{value:!0});Oe.getData=Oe.KeywordCxt=Oe.validateFunctionCode=void 0;const mi=Tt,ls=Zt,en=He,mr=Zt,Ia=Pr,Wt=Le,Or=xe,q=G,z=Ve,Aa=he,We=X,Lt=xt;function Da(t){if(vi(t)&&($i(t),gi(t))){Ua(t);return}yi(t,()=>(0,mi.topBoolOrEmptySchema)(t))}Oe.validateFunctionCode=Da;function yi({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,q._)`${z.default.data}, ${z.default.valCxt}`,n.$async,()=>{t.code((0,q._)`"use strict"; ${us(r,s)}`),Ma(t,s),t.code(i)}):t.func(e,(0,q._)`${z.default.data}, ${Fa(s)}`,n.$async,()=>t.code(us(r,s)).code(i))}function Fa(t){return(0,q._)`{${z.default.instancePath}="", ${z.default.parentData}, ${z.default.parentDataProperty}, ${z.default.rootData}=${z.default.data}${t.dynamicRef?(0,q._)`, ${z.default.dynamicAnchors}={}`:q.nil}}={}`}function Ma(t,e){t.if(z.default.valCxt,()=>{t.var(z.default.instancePath,(0,q._)`${z.default.valCxt}.${z.default.instancePath}`),t.var(z.default.parentData,(0,q._)`${z.default.valCxt}.${z.default.parentData}`),t.var(z.default.parentDataProperty,(0,q._)`${z.default.valCxt}.${z.default.parentDataProperty}`),t.var(z.default.rootData,(0,q._)`${z.default.valCxt}.${z.default.rootData}`),e.dynamicRef&&t.var(z.default.dynamicAnchors,(0,q._)`${z.default.valCxt}.${z.default.dynamicAnchors}`)},()=>{t.var(z.default.instancePath,(0,q._)`""`),t.var(z.default.parentData,(0,q._)`undefined`),t.var(z.default.parentDataProperty,(0,q._)`undefined`),t.var(z.default.rootData,z.default.data),e.dynamicRef&&t.var(z.default.dynamicAnchors,(0,q._)`{}`)})}function Ua(t){const{schema:e,opts:r,gen:n}=t;yi(t,()=>{r.$comment&&e.$comment&&wi(t),Ha(t),n.let(z.default.vErrors,null),n.let(z.default.errors,0),r.unevaluated&&qa(t),_i(t),Ga(t)})}function qa(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,q._)`${r}.evaluated`),e.if((0,q._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,q._)`${t.evaluated}.props`,(0,q._)`undefined`)),e.if((0,q._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,q._)`${t.evaluated}.items`,(0,q._)`undefined`))}function us(t,e){const r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,q._)`/*# sourceURL=${r} */`:q.nil}function La(t,e){if(vi(t)&&($i(t),gi(t))){Va(t,e);return}(0,mi.boolOrEmptySchema)(t,e)}function gi({schema:t,self:e}){if(typeof t=="boolean")return!t;for(const r in t)if(e.RULES.all[r])return!0;return!1}function vi(t){return typeof t.schema!="boolean"}function Va(t,e){const{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&wi(t),Wa(t),Ka(t);const i=n.const("_errs",z.default.errors);_i(t,i),n.var(e,(0,q._)`${i} === ${z.default.errors}`)}function $i(t){(0,We.checkUnknownRules)(t),za(t)}function _i(t,e){if(t.opts.jtd)return ds(t,[],!1,e);const r=(0,ls.getSchemaTypes)(t.schema),n=(0,ls.coerceAndCheckDataType)(t,r);ds(t,r,!n,e)}function za(t){const{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,We.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Ha(t){const{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,We.checkStrictMode)(t,"default is ignored in the schema root")}function Wa(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Aa.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Ka(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function wi({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)t.code((0,q._)`${z.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const a=(0,q.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,q._)`${z.default.self}.opts.$comment(${i}, ${a}, ${l}.schema)`)}}function Ga(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,q._)`${z.default.errors} === 0`,()=>e.return(z.default.data),()=>e.throw((0,q._)`new ${s}(${z.default.vErrors})`)):(e.assign((0,q._)`${n}.errors`,z.default.vErrors),i.unevaluated&&Ba(t),e.return((0,q._)`${z.default.errors} === 0`))}function Ba({gen:t,evaluated:e,props:r,items:n}){r instanceof q.Name&&t.assign((0,q._)`${e}.props`,r),n instanceof q.Name&&t.assign((0,q._)`${e}.items`,n)}function ds(t,e,r,n){const{gen:s,schema:i,data:a,allErrors:l,opts:m,self:u}=t,{RULES:f}=u;if(i.$ref&&(m.ignoreKeywordsWithRef||!(0,We.schemaHasRulesButRef)(i,f))){s.block(()=>Ei(t,"$ref",f.all.$ref.definition));return}m.jtd||Ja(t,e),s.block(()=>{for(const k of f.rules)g(k);g(f.post)});function g(k){(0,en.shouldUseGroup)(i,k)&&(k.type?(s.if((0,mr.checkDataType)(k.type,a,m.strictNumbers)),fs(t,k),e.length===1&&e[0]===k.type&&r&&(s.else(),(0,mr.reportTypeError)(t)),s.endIf()):fs(t,k),l||s.if((0,q._)`${z.default.errors} === ${n||0}`))}}function fs(t,e){const{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,Ia.assignDefaults)(t,e.type),r.block(()=>{for(const i of e.rules)(0,en.shouldUseRule)(n,i)&&Ei(t,i.keyword,i.definition,e.type)})}function Ja(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Ya(t,e),t.opts.allowUnionTypes||xa(t,e),Za(t,t.dataTypes))}function Ya(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{bi(t.dataTypes,r)||tn(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Xa(t,e)}}function xa(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&tn(t,"use allowUnionTypes to allow union type keyword")}function Za(t,e){const r=t.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,en.shouldUseRule)(t.schema,s)){const{type:i}=s.definition;i.length&&!i.some(a=>Qa(e,a))&&tn(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Qa(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function bi(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Xa(t,e){const r=[];for(const n of t.dataTypes)bi(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function tn(t,e){const r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,We.checkStrictMode)(t,e,t.opts.strictTypes)}class Pi{constructor(e,r,n){if((0,Wt.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,We.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Si(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Wt.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",z.default.errors))}result(e,r,n){this.failResult((0,q.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,q.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:r}=this;this.fail((0,q._)`${r} !== undefined && (${(0,q.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Lt.reportExtraError:Lt.reportError)(this,this.def.error,r)}$dataError(){(0,Lt.reportError)(this,this.def.$dataError||Lt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Lt.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=q.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=q.nil,r=q.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:a}=this;n.if((0,q.or)((0,q._)`${s} === undefined`,r)),e!==q.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==q.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,q.or)(a(),l());function a(){if(n.length){if(!(r instanceof q.Name))throw new Error("ajv implementation error");const m=Array.isArray(n)?n:[n];return(0,q._)`${(0,mr.checkDataTypes)(m,r,i.opts.strictNumbers,mr.DataType.Wrong)}`}return q.nil}function l(){if(s.validateSchema){const m=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,q._)`!${m}(${r})`}return q.nil}}subschema(e,r){const n=(0,Or.getSubschema)(this.it,e);(0,Or.extendSubschemaData)(n,this.it,e),(0,Or.extendSubschemaMode)(n,e);const s={...this.it,...n,items:void 0,props:void 0};return La(s,r),s}mergeEvaluated(e,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=We.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=We.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,q.Name)),!0}}Oe.KeywordCxt=Pi;function Ei(t,e,r,n){const s=new Pi(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Wt.funcKeywordCode)(s,r):"macro"in r?(0,Wt.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Wt.funcKeywordCode)(s,r)}const ec=/^\/(?:[^~]|~0|~1)*$/,tc=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Si(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return z.default.rootData;if(t[0]==="/"){if(!ec.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=z.default.rootData}else{const u=tc.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);const f=+u[1];if(s=u[2],s==="#"){if(f>=e)throw new Error(m("property/index",f));return n[e-f]}if(f>e)throw new Error(m("data",f));if(i=r[e-f],!s)return i}let a=i;const l=s.split("/");for(const u of l)u&&(i=(0,q._)`${i}${(0,q.getProperty)((0,We.unescapeJsonPointer)(u))}`,a=(0,q._)`${a} && ${i}`);return a;function m(u,f){return`Cannot access ${u} ${f} levels up, current level is ${e}`}}Oe.getData=Si;var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});class rc extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Qt.default=rc;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0});const Cr=he;class nc extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Cr.resolveUrl)(e,r,n),this.missingSchema=(0,Cr.normalizeId)((0,Cr.getFullPath)(e,this.missingRef))}}Xt.default=nc;var _e={};Object.defineProperty(_e,"__esModule",{value:!0});_e.resolveSchema=_e.getCompilingSchema=_e.resolveRef=_e.compileSchema=_e.SchemaEnv=void 0;const Te=G,sc=Qt,nt=Ve,Ne=he,ps=X,ic=Oe;class Er{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Ne.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}}_e.SchemaEnv=Er;function rn(t){const e=Ti.call(this,t);if(e)return e;const r=(0,Ne.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,a=new Te.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let l;t.$async&&(l=a.scopeValue("Error",{ref:sc.default,code:(0,Te._)`require("ajv/dist/runtime/validation_error").default`}));const m=a.scopeName("validate");t.validateName=m;const u={gen:a,allErrors:this.opts.allErrors,data:nt.default.data,parentData:nt.default.parentData,parentDataProperty:nt.default.parentDataProperty,dataNames:[nt.default.data],dataPathArr:[Te.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Te.stringify)(t.schema)}:{ref:t.schema}),validateName:m,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Te.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Te._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(t),(0,ic.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const g=a.toString();f=`${a.scopeRefs(nt.default.scope)}return ${g}`,this.opts.code.process&&(f=this.opts.code.process(f,t));const C=new Function(`${nt.default.self}`,`${nt.default.scope}`,f)(this,this.scope.get());if(this.scope.value(m,{ref:C}),C.errors=null,C.schema=t.schema,C.schemaEnv=t,t.$async&&(C.$async=!0),this.opts.code.source===!0&&(C.source={validateName:m,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){const{props:E,items:S}=u;C.evaluated={props:E instanceof Te.Name?void 0:E,items:S instanceof Te.Name?void 0:S,dynamicProps:E instanceof Te.Name,dynamicItems:S instanceof Te.Name},C.source&&(C.source.evaluated=(0,Te.stringify)(C.evaluated))}return t.validate=C,t}catch(g){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),g}finally{this._compilations.delete(t)}}_e.compileSchema=rn;function oc(t,e,r){var n;r=(0,Ne.resolveUrl)(this.opts.uriResolver,e,r);const s=t.refs[r];if(s)return s;let i=lc.call(this,t,r);if(i===void 0){const a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(i=new Er({schema:a,schemaId:l,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=ac.call(this,i)}_e.resolveRef=oc;function ac(t){return(0,Ne.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:rn.call(this,t)}function Ti(t){for(const e of this._compilations)if(cc(e,t))return e}_e.getCompilingSchema=Ti;function cc(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function lc(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Sr.call(this,t,e)}function Sr(t,e){const r=this.opts.uriResolver.parse(e),n=(0,Ne._getFullPath)(this.opts.uriResolver,r);let s=(0,Ne.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return jr.call(this,r,t);const i=(0,Ne.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){const l=Sr.call(this,t,a);return typeof l?.schema!="object"?void 0:jr.call(this,r,l)}if(typeof a?.schema=="object"){if(a.validate||rn.call(this,a),i===(0,Ne.normalizeId)(e)){const{schema:l}=a,{schemaId:m}=this.opts,u=l[m];return u&&(s=(0,Ne.resolveUrl)(this.opts.uriResolver,s,u)),new Er({schema:l,schemaId:m,root:t,baseId:s})}return jr.call(this,r,a)}}_e.resolveSchema=Sr;const uc=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function jr(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const m=r[(0,ps.unescapeFragment)(l)];if(m===void 0)return;r=m;const u=typeof r=="object"&&r[this.opts.schemaId];!uc.has(l)&&u&&(e=(0,Ne.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,ps.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Ne.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Sr.call(this,n,l)}const{schemaId:a}=this.opts;if(i=i||new Er({schema:r,schemaId:a,root:n,baseId:e}),i.schema!==i.root.schema)return i}const dc="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",fc="Meta-schema for $data reference (JSON AnySchema extension proposal)",pc="object",hc=["$data"],mc={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},yc=!1,gc={$id:dc,description:fc,type:pc,required:hc,properties:mc,additionalProperties:yc};var nn={},Ur={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(r,n){n(e)})(Mo,function(r){function n(){for(var d=arguments.length,c=Array(d),h=0;h<d;h++)c[h]=arguments[h];if(c.length>1){c[0]=c[0].slice(0,-1);for(var P=c.length-1,b=1;b<P;++b)c[b]=c[b].slice(1,-1);return c[P]=c[P].slice(1),c.join("")}else return c[0]}function s(d){return"(?:"+d+")"}function i(d){return d===void 0?"undefined":d===null?"null":Object.prototype.toString.call(d).split(" ").pop().split("]").shift().toLowerCase()}function a(d){return d.toUpperCase()}function l(d){return d!=null?d instanceof Array?d:typeof d.length!="number"||d.split||d.setInterval||d.call?[d]:Array.prototype.slice.call(d):[]}function m(d,c){var h=d;if(c)for(var P in c)h[P]=c[P];return h}function u(d){var c="[A-Za-z]",h="[0-9]",P=n(h,"[A-Fa-f]"),b=s(s("%[EFef]"+P+"%"+P+P+"%"+P+P)+"|"+s("%[89A-Fa-f]"+P+"%"+P+P)+"|"+s("%"+P+P)),L="[\\:\\/\\?\\#\\[\\]\\@]",V="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Q=n(L,V),re=d?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ce=d?"[\\uE000-\\uF8FF]":"[]",Y=n(c,h,"[\\-\\.\\_\\~]",re);s(c+n(c,h,"[\\+\\-\\.]")+"*"),s(s(b+"|"+n(Y,V,"[\\:]"))+"*");var te=s(s("25[0-5]")+"|"+s("2[0-4]"+h)+"|"+s("1"+h+h)+"|"+s("0?[1-9]"+h)+"|0?0?"+h),le=s(te+"\\."+te+"\\."+te+"\\."+te),W=s(P+"{1,4}"),se=s(s(W+"\\:"+W)+"|"+le),fe=s(s(W+"\\:")+"{6}"+se),ie=s("\\:\\:"+s(W+"\\:")+"{5}"+se),Ke=s(s(W)+"?\\:\\:"+s(W+"\\:")+"{4}"+se),Fe=s(s(s(W+"\\:")+"{0,1}"+W)+"?\\:\\:"+s(W+"\\:")+"{3}"+se),Me=s(s(s(W+"\\:")+"{0,2}"+W)+"?\\:\\:"+s(W+"\\:")+"{2}"+se),vt=s(s(s(W+"\\:")+"{0,3}"+W)+"?\\:\\:"+W+"\\:"+se),tt=s(s(s(W+"\\:")+"{0,4}"+W)+"?\\:\\:"+se),Ee=s(s(s(W+"\\:")+"{0,5}"+W)+"?\\:\\:"+W),Ue=s(s(s(W+"\\:")+"{0,6}"+W)+"?\\:\\:"),rt=s([fe,ie,Ke,Fe,Me,vt,tt,Ee,Ue].join("|")),ze=s(s(Y+"|"+b)+"+");s("[vV]"+P+"+\\."+n(Y,V,"[\\:]")+"+"),s(s(b+"|"+n(Y,V))+"*");var Ut=s(b+"|"+n(Y,V,"[\\:\\@]"));return s(s(b+"|"+n(Y,V,"[\\@]"))+"+"),s(s(Ut+"|"+n("[\\/\\?]",ce))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,h,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",Y,V),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",Y,V),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",Y,V),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",Y,V),"g"),NOT_QUERY:new RegExp(n("[^\\%]",Y,V,"[\\:\\@\\/\\?]",ce),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",Y,V,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",Y,V),"g"),UNRESERVED:new RegExp(Y,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",Y,Q),"g"),PCT_ENCODED:new RegExp(b,"g"),IPV4ADDRESS:new RegExp("^("+le+")$"),IPV6ADDRESS:new RegExp("^\\[?("+rt+")"+s(s("\\%25|\\%(?!"+P+"{2})")+"("+ze+")")+"?\\]?$")}}var f=u(!1),g=u(!0),k=function(){function d(c,h){var P=[],b=!0,L=!1,V=void 0;try{for(var Q=c[Symbol.iterator](),re;!(b=(re=Q.next()).done)&&(P.push(re.value),!(h&&P.length===h));b=!0);}catch(ce){L=!0,V=ce}finally{try{!b&&Q.return&&Q.return()}finally{if(L)throw V}}return P}return function(c,h){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return d(c,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),C=function(d){if(Array.isArray(d)){for(var c=0,h=Array(d.length);c<d.length;c++)h[c]=d[c];return h}else return Array.from(d)},E=2147483647,S=36,$=1,y=26,T=38,R=700,j=72,D=128,_="-",N=/^xn--/,A=/[^\0-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},oe=S-$,Z=Math.floor,be=String.fromCharCode;function de(d){throw new RangeError(B[d])}function Ze(d,c){for(var h=[],P=d.length;P--;)h[P]=c(d[P]);return h}function Qe(d,c){var h=d.split("@"),P="";h.length>1&&(P=h[0]+"@",d=h[1]),d=d.replace(H,".");var b=d.split("."),L=Ze(b,c).join(".");return P+L}function ut(d){for(var c=[],h=0,P=d.length;h<P;){var b=d.charCodeAt(h++);if(b>=55296&&b<=56319&&h<P){var L=d.charCodeAt(h++);(L&64512)==56320?c.push(((b&1023)<<10)+(L&1023)+65536):(c.push(b),h--)}else c.push(b)}return c}var Ct=function(c){return String.fromCodePoint.apply(String,C(c))},dt=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:S},F=function(c,h){return c+22+75*(c<26)-((h!=0)<<5)},v=function(c,h,P){var b=0;for(c=P?Z(c/R):c>>1,c+=Z(c/h);c>oe*y>>1;b+=S)c=Z(c/oe);return Z(b+(oe+1)*c/(c+T))},I=function(c){var h=[],P=c.length,b=0,L=D,V=j,Q=c.lastIndexOf(_);Q<0&&(Q=0);for(var re=0;re<Q;++re)c.charCodeAt(re)>=128&&de("not-basic"),h.push(c.charCodeAt(re));for(var ce=Q>0?Q+1:0;ce<P;){for(var Y=b,te=1,le=S;;le+=S){ce>=P&&de("invalid-input");var W=dt(c.charCodeAt(ce++));(W>=S||W>Z((E-b)/te))&&de("overflow"),b+=W*te;var se=le<=V?$:le>=V+y?y:le-V;if(W<se)break;var fe=S-se;te>Z(E/fe)&&de("overflow"),te*=fe}var ie=h.length+1;V=v(b-Y,ie,Y==0),Z(b/ie)>E-L&&de("overflow"),L+=Z(b/ie),b%=ie,h.splice(b++,0,L)}return String.fromCodePoint.apply(String,h)},w=function(c){var h=[];c=ut(c);var P=c.length,b=D,L=0,V=j,Q=!0,re=!1,ce=void 0;try{for(var Y=c[Symbol.iterator](),te;!(Q=(te=Y.next()).done);Q=!0){var le=te.value;le<128&&h.push(be(le))}}catch(qt){re=!0,ce=qt}finally{try{!Q&&Y.return&&Y.return()}finally{if(re)throw ce}}var W=h.length,se=W;for(W&&h.push(_);se<P;){var fe=E,ie=!0,Ke=!1,Fe=void 0;try{for(var Me=c[Symbol.iterator](),vt;!(ie=(vt=Me.next()).done);ie=!0){var tt=vt.value;tt>=b&&tt<fe&&(fe=tt)}}catch(qt){Ke=!0,Fe=qt}finally{try{!ie&&Me.return&&Me.return()}finally{if(Ke)throw Fe}}var Ee=se+1;fe-b>Z((E-L)/Ee)&&de("overflow"),L+=(fe-b)*Ee,b=fe;var Ue=!0,rt=!1,ze=void 0;try{for(var Ut=c[Symbol.iterator](),Wn;!(Ue=(Wn=Ut.next()).done);Ue=!0){var Kn=Wn.value;if(Kn<b&&++L>E&&de("overflow"),Kn==b){for(var rr=L,nr=S;;nr+=S){var sr=nr<=V?$:nr>=V+y?y:nr-V;if(rr<sr)break;var Gn=rr-sr,Bn=S-sr;h.push(be(F(sr+Gn%Bn,0))),rr=Z(Gn/Bn)}h.push(be(F(rr,0))),V=v(L,Ee,se==W),L=0,++se}}}catch(qt){rt=!0,ze=qt}finally{try{!Ue&&Ut.return&&Ut.return()}finally{if(rt)throw ze}}++L,++b}return h.join("")},o=function(c){return Qe(c,function(h){return N.test(h)?I(h.slice(4).toLowerCase()):h})},p=function(c){return Qe(c,function(h){return A.test(h)?"xn--"+w(h):h})},O={version:"2.1.0",ucs2:{decode:ut,encode:Ct},decode:I,encode:w,toASCII:p,toUnicode:o},M={};function U(d){var c=d.charCodeAt(0),h=void 0;return c<16?h="%0"+c.toString(16).toUpperCase():c<128?h="%"+c.toString(16).toUpperCase():c<2048?h="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():h="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),h}function J(d){for(var c="",h=0,P=d.length;h<P;){var b=parseInt(d.substr(h+1,2),16);if(b<128)c+=String.fromCharCode(b),h+=3;else if(b>=194&&b<224){if(P-h>=6){var L=parseInt(d.substr(h+4,2),16);c+=String.fromCharCode((b&31)<<6|L&63)}else c+=d.substr(h,6);h+=6}else if(b>=224){if(P-h>=9){var V=parseInt(d.substr(h+4,2),16),Q=parseInt(d.substr(h+7,2),16);c+=String.fromCharCode((b&15)<<12|(V&63)<<6|Q&63)}else c+=d.substr(h,9);h+=9}else c+=d.substr(h,3),h+=3}return c}function x(d,c){function h(P){var b=J(P);return b.match(c.UNRESERVED)?b:P}return d.scheme&&(d.scheme=String(d.scheme).replace(c.PCT_ENCODED,h).toLowerCase().replace(c.NOT_SCHEME,"")),d.userinfo!==void 0&&(d.userinfo=String(d.userinfo).replace(c.PCT_ENCODED,h).replace(c.NOT_USERINFO,U).replace(c.PCT_ENCODED,a)),d.host!==void 0&&(d.host=String(d.host).replace(c.PCT_ENCODED,h).toLowerCase().replace(c.NOT_HOST,U).replace(c.PCT_ENCODED,a)),d.path!==void 0&&(d.path=String(d.path).replace(c.PCT_ENCODED,h).replace(d.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,U).replace(c.PCT_ENCODED,a)),d.query!==void 0&&(d.query=String(d.query).replace(c.PCT_ENCODED,h).replace(c.NOT_QUERY,U).replace(c.PCT_ENCODED,a)),d.fragment!==void 0&&(d.fragment=String(d.fragment).replace(c.PCT_ENCODED,h).replace(c.NOT_FRAGMENT,U).replace(c.PCT_ENCODED,a)),d}function ae(d){return d.replace(/^0*(.*)/,"$1")||"0"}function Ie(d,c){var h=d.match(c.IPV4ADDRESS)||[],P=k(h,2),b=P[1];return b?b.split(".").map(ae).join("."):d}function ft(d,c){var h=d.match(c.IPV6ADDRESS)||[],P=k(h,3),b=P[1],L=P[2];if(b){for(var V=b.toLowerCase().split("::").reverse(),Q=k(V,2),re=Q[0],ce=Q[1],Y=ce?ce.split(":").map(ae):[],te=re.split(":").map(ae),le=c.IPV4ADDRESS.test(te[te.length-1]),W=le?7:8,se=te.length-W,fe=Array(W),ie=0;ie<W;++ie)fe[ie]=Y[ie]||te[se+ie]||"";le&&(fe[W-1]=Ie(fe[W-1],c));var Ke=fe.reduce(function(Ee,Ue,rt){if(!Ue||Ue==="0"){var ze=Ee[Ee.length-1];ze&&ze.index+ze.length===rt?ze.length++:Ee.push({index:rt,length:1})}return Ee},[]),Fe=Ke.sort(function(Ee,Ue){return Ue.length-Ee.length})[0],Me=void 0;if(Fe&&Fe.length>1){var vt=fe.slice(0,Fe.index),tt=fe.slice(Fe.index+Fe.length);Me=vt.join(":")+"::"+tt.join(":")}else Me=fe.join(":");return L&&(Me+="%"+L),Me}else return d}var jt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,kt="".match(/(){0}/)[1]===void 0;function we(d){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h={},P=c.iri!==!1?g:f;c.reference==="suffix"&&(d=(c.scheme?c.scheme+":":"")+"//"+d);var b=d.match(jt);if(b){kt?(h.scheme=b[1],h.userinfo=b[3],h.host=b[4],h.port=parseInt(b[5],10),h.path=b[6]||"",h.query=b[7],h.fragment=b[8],isNaN(h.port)&&(h.port=b[5])):(h.scheme=b[1]||void 0,h.userinfo=d.indexOf("@")!==-1?b[3]:void 0,h.host=d.indexOf("//")!==-1?b[4]:void 0,h.port=parseInt(b[5],10),h.path=b[6]||"",h.query=d.indexOf("?")!==-1?b[7]:void 0,h.fragment=d.indexOf("#")!==-1?b[8]:void 0,isNaN(h.port)&&(h.port=d.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?b[4]:void 0)),h.host&&(h.host=ft(Ie(h.host,P),P)),h.scheme===void 0&&h.userinfo===void 0&&h.host===void 0&&h.port===void 0&&!h.path&&h.query===void 0?h.reference="same-document":h.scheme===void 0?h.reference="relative":h.fragment===void 0?h.reference="absolute":h.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==h.reference&&(h.error=h.error||"URI is not a "+c.reference+" reference.");var L=M[(c.scheme||h.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!L||!L.unicodeSupport)){if(h.host&&(c.domainHost||L&&L.domainHost))try{h.host=O.toASCII(h.host.replace(P.PCT_ENCODED,J).toLowerCase())}catch(V){h.error=h.error||"Host's domain name can not be converted to ASCII via punycode: "+V}x(h,f)}else x(h,P);L&&L.parse&&L.parse(h,c)}else h.error=h.error||"URI can not be parsed.";return h}function It(d,c){var h=c.iri!==!1?g:f,P=[];return d.userinfo!==void 0&&(P.push(d.userinfo),P.push("@")),d.host!==void 0&&P.push(ft(Ie(String(d.host),h),h).replace(h.IPV6ADDRESS,function(b,L,V){return"["+L+(V?"%25"+V:"")+"]"})),(typeof d.port=="number"||typeof d.port=="string")&&(P.push(":"),P.push(String(d.port))),P.length?P.join(""):void 0}var pt=/^\.\.?\//,ht=/^\/\.(\/|$)/,mt=/^\/\.\.(\/|$)/,At=/^\/?(?:.|\n)*?(?=\/|$)/;function Ae(d){for(var c=[];d.length;)if(d.match(pt))d=d.replace(pt,"");else if(d.match(ht))d=d.replace(ht,"/");else if(d.match(mt))d=d.replace(mt,"/"),c.pop();else if(d==="."||d==="..")d="";else{var h=d.match(At);if(h){var P=h[0];d=d.slice(P.length),c.push(P)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function ve(d){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=c.iri?g:f,P=[],b=M[(c.scheme||d.scheme||"").toLowerCase()];if(b&&b.serialize&&b.serialize(d,c),d.host&&!h.IPV6ADDRESS.test(d.host)){if(c.domainHost||b&&b.domainHost)try{d.host=c.iri?O.toUnicode(d.host):O.toASCII(d.host.replace(h.PCT_ENCODED,J).toLowerCase())}catch(Q){d.error=d.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+Q}}x(d,h),c.reference!=="suffix"&&d.scheme&&(P.push(d.scheme),P.push(":"));var L=It(d,c);if(L!==void 0&&(c.reference!=="suffix"&&P.push("//"),P.push(L),d.path&&d.path.charAt(0)!=="/"&&P.push("/")),d.path!==void 0){var V=d.path;!c.absolutePath&&(!b||!b.absolutePath)&&(V=Ae(V)),L===void 0&&(V=V.replace(/^\/\//,"/%2F")),P.push(V)}return d.query!==void 0&&(P.push("?"),P.push(d.query)),d.fragment!==void 0&&(P.push("#"),P.push(d.fragment)),P.join("")}function yt(d,c){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments[3],b={};return P||(d=we(ve(d,h),h),c=we(ve(c,h),h)),h=h||{},!h.tolerant&&c.scheme?(b.scheme=c.scheme,b.userinfo=c.userinfo,b.host=c.host,b.port=c.port,b.path=Ae(c.path||""),b.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(b.userinfo=c.userinfo,b.host=c.host,b.port=c.port,b.path=Ae(c.path||""),b.query=c.query):(c.path?(c.path.charAt(0)==="/"?b.path=Ae(c.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?b.path="/"+c.path:d.path?b.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+c.path:b.path=c.path,b.path=Ae(b.path)),b.query=c.query):(b.path=d.path,c.query!==void 0?b.query=c.query:b.query=d.query),b.userinfo=d.userinfo,b.host=d.host,b.port=d.port),b.scheme=d.scheme),b.fragment=c.fragment,b}function Dt(d,c,h){var P=m({scheme:"null"},h);return ve(yt(we(d,P),we(c,P),P,!0),P)}function Xe(d,c){return typeof d=="string"?d=ve(we(d,c),c):i(d)==="object"&&(d=we(ve(d,c),c)),d}function Ft(d,c,h){return typeof d=="string"?d=ve(we(d,h),h):i(d)==="object"&&(d=ve(d,h)),typeof c=="string"?c=ve(we(c,h),h):i(c)==="object"&&(c=ve(c,h)),d===c}function tr(d,c){return d&&d.toString().replace(!c||!c.iri?f.ESCAPE:g.ESCAPE,U)}function Pe(d,c){return d&&d.toString().replace(!c||!c.iri?f.PCT_ENCODED:g.PCT_ENCODED,J)}var et={scheme:"http",domainHost:!0,parse:function(c,h){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,h){var P=String(c.scheme).toLowerCase()==="https";return(c.port===(P?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},Fn={scheme:"https",domainHost:et.domainHost,parse:et.parse,serialize:et.serialize};function Mn(d){return typeof d.secure=="boolean"?d.secure:String(d.scheme).toLowerCase()==="wss"}var Mt={scheme:"ws",domainHost:!0,parse:function(c,h){var P=c;return P.secure=Mn(P),P.resourceName=(P.path||"/")+(P.query?"?"+P.query:""),P.path=void 0,P.query=void 0,P},serialize:function(c,h){if((c.port===(Mn(c)?443:80)||c.port==="")&&(c.port=void 0),typeof c.secure=="boolean"&&(c.scheme=c.secure?"wss":"ws",c.secure=void 0),c.resourceName){var P=c.resourceName.split("?"),b=k(P,2),L=b[0],V=b[1];c.path=L&&L!=="/"?L:void 0,c.query=V,c.resourceName=void 0}return c.fragment=void 0,c}},Un={scheme:"wss",domainHost:Mt.domainHost,parse:Mt.parse,serialize:Mt.serialize},Mi={},qn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",De="[0-9A-Fa-f]",Ui=s(s("%[EFef]"+De+"%"+De+De+"%"+De+De)+"|"+s("%[89A-Fa-f]"+De+"%"+De+De)+"|"+s("%"+De+De)),qi="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Li="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Vi=n(Li,'[\\"\\\\]'),zi="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Hi=new RegExp(qn,"g"),gt=new RegExp(Ui,"g"),Wi=new RegExp(n("[^]",qi,"[\\.]",'[\\"]',Vi),"g"),Ln=new RegExp(n("[^]",qn,zi),"g"),Ki=Ln;function Rr(d){var c=J(d);return c.match(Hi)?c:d}var Vn={scheme:"mailto",parse:function(c,h){var P=c,b=P.to=P.path?P.path.split(","):[];if(P.path=void 0,P.query){for(var L=!1,V={},Q=P.query.split("&"),re=0,ce=Q.length;re<ce;++re){var Y=Q[re].split("=");switch(Y[0]){case"to":for(var te=Y[1].split(","),le=0,W=te.length;le<W;++le)b.push(te[le]);break;case"subject":P.subject=Pe(Y[1],h);break;case"body":P.body=Pe(Y[1],h);break;default:L=!0,V[Pe(Y[0],h)]=Pe(Y[1],h);break}}L&&(P.headers=V)}P.query=void 0;for(var se=0,fe=b.length;se<fe;++se){var ie=b[se].split("@");if(ie[0]=Pe(ie[0]),h.unicodeSupport)ie[1]=Pe(ie[1],h).toLowerCase();else try{ie[1]=O.toASCII(Pe(ie[1],h).toLowerCase())}catch(Ke){P.error=P.error||"Email address's domain name can not be converted to ASCII via punycode: "+Ke}b[se]=ie.join("@")}return P},serialize:function(c,h){var P=c,b=l(c.to);if(b){for(var L=0,V=b.length;L<V;++L){var Q=String(b[L]),re=Q.lastIndexOf("@"),ce=Q.slice(0,re).replace(gt,Rr).replace(gt,a).replace(Wi,U),Y=Q.slice(re+1);try{Y=h.iri?O.toUnicode(Y):O.toASCII(Pe(Y,h).toLowerCase())}catch(se){P.error=P.error||"Email address's domain name can not be converted to "+(h.iri?"Unicode":"ASCII")+" via punycode: "+se}b[L]=ce+"@"+Y}P.path=b.join(",")}var te=c.headers=c.headers||{};c.subject&&(te.subject=c.subject),c.body&&(te.body=c.body);var le=[];for(var W in te)te[W]!==Mi[W]&&le.push(W.replace(gt,Rr).replace(gt,a).replace(Ln,U)+"="+te[W].replace(gt,Rr).replace(gt,a).replace(Ki,U));return le.length&&(P.query=le.join("&")),P}},Gi=/^([^\:]+)\:(.*)/,zn={scheme:"urn",parse:function(c,h){var P=c.path&&c.path.match(Gi),b=c;if(P){var L=h.scheme||b.scheme||"urn",V=P[1].toLowerCase(),Q=P[2],re=L+":"+(h.nid||V),ce=M[re];b.nid=V,b.nss=Q,b.path=void 0,ce&&(b=ce.parse(b,h))}else b.error=b.error||"URN can not be parsed.";return b},serialize:function(c,h){var P=h.scheme||c.scheme||"urn",b=c.nid,L=P+":"+(h.nid||b),V=M[L];V&&(c=V.serialize(c,h));var Q=c,re=c.nss;return Q.path=(b||h.nid)+":"+re,Q}},Bi=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Hn={scheme:"urn:uuid",parse:function(c,h){var P=c;return P.uuid=P.nss,P.nss=void 0,!h.tolerant&&(!P.uuid||!P.uuid.match(Bi))&&(P.error=P.error||"UUID is not valid."),P},serialize:function(c,h){var P=c;return P.nss=(c.uuid||"").toLowerCase(),P}};M[et.scheme]=et,M[Fn.scheme]=Fn,M[Mt.scheme]=Mt,M[Un.scheme]=Un,M[Vn.scheme]=Vn,M[zn.scheme]=zn,M[Hn.scheme]=Hn,r.SCHEMES=M,r.pctEncChar=U,r.pctDecChars=J,r.parse=we,r.removeDotSegments=Ae,r.serialize=ve,r.resolveComponents=yt,r.resolve=Dt,r.normalize=Xe,r.equal=Ft,r.escapeComponent=tr,r.unescapeComponent=Pe,Object.defineProperty(r,"__esModule",{value:!0})})})(Ur,Ur.exports);var vc=Ur.exports;Object.defineProperty(nn,"__esModule",{value:!0});const Ri=vc;Ri.code='require("ajv/dist/runtime/uri").default';nn.default=Ri;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Oe;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=G;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Qt,s=Xt,i=at,a=_e,l=G,m=he,u=Zt,f=X,g=gc,k=nn,C=(F,v)=>new RegExp(F,v);C.code="new RegExp";const E=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),$={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},T=200;function R(F){var v,I,w,o,p,O,M,U,J,x,ae,Ie,ft,jt,kt,we,It,pt,ht,mt,At,Ae,ve,yt,Dt;const Xe=F.strict,Ft=(v=F.code)===null||v===void 0?void 0:v.optimize,tr=Ft===!0||Ft===void 0?1:Ft||0,Pe=(w=(I=F.code)===null||I===void 0?void 0:I.regExp)!==null&&w!==void 0?w:C,et=(o=F.uriResolver)!==null&&o!==void 0?o:k.default;return{strictSchema:(O=(p=F.strictSchema)!==null&&p!==void 0?p:Xe)!==null&&O!==void 0?O:!0,strictNumbers:(U=(M=F.strictNumbers)!==null&&M!==void 0?M:Xe)!==null&&U!==void 0?U:!0,strictTypes:(x=(J=F.strictTypes)!==null&&J!==void 0?J:Xe)!==null&&x!==void 0?x:"log",strictTuples:(Ie=(ae=F.strictTuples)!==null&&ae!==void 0?ae:Xe)!==null&&Ie!==void 0?Ie:"log",strictRequired:(jt=(ft=F.strictRequired)!==null&&ft!==void 0?ft:Xe)!==null&&jt!==void 0?jt:!1,code:F.code?{...F.code,optimize:tr,regExp:Pe}:{optimize:tr,regExp:Pe},loopRequired:(kt=F.loopRequired)!==null&&kt!==void 0?kt:T,loopEnum:(we=F.loopEnum)!==null&&we!==void 0?we:T,meta:(It=F.meta)!==null&&It!==void 0?It:!0,messages:(pt=F.messages)!==null&&pt!==void 0?pt:!0,inlineRefs:(ht=F.inlineRefs)!==null&&ht!==void 0?ht:!0,schemaId:(mt=F.schemaId)!==null&&mt!==void 0?mt:"$id",addUsedSchema:(At=F.addUsedSchema)!==null&&At!==void 0?At:!0,validateSchema:(Ae=F.validateSchema)!==null&&Ae!==void 0?Ae:!0,validateFormats:(ve=F.validateFormats)!==null&&ve!==void 0?ve:!0,unicodeRegExp:(yt=F.unicodeRegExp)!==null&&yt!==void 0?yt:!0,int32range:(Dt=F.int32range)!==null&&Dt!==void 0?Dt:!0,uriResolver:et}}class j{constructor(v={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,v=this.opts={...v,...R(v)};const{es5:I,lines:w}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:S,es5:I,lines:w}),this.logger=Z(v.logger);const o=v.validateFormats;v.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,$,v,"NOT SUPPORTED"),D.call(this,y,v,"DEPRECATED","warn"),this._metaOpts=B.call(this),v.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),v.keywords&&H.call(this,v.keywords),typeof v.meta=="object"&&this.addMetaSchema(v.meta),N.call(this),v.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:v,meta:I,schemaId:w}=this.opts;let o=g;w==="id"&&(o={...g},o.id=o.$id,delete o.$id),I&&v&&this.addMetaSchema(o,o[w],!1)}defaultMeta(){const{meta:v,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof v=="object"?v[I]||v:void 0}validate(v,I){let w;if(typeof v=="string"){if(w=this.getSchema(v),!w)throw new Error(`no schema with key or ref "${v}"`)}else w=this.compile(v);const o=w(I);return"$async"in w||(this.errors=w.errors),o}compile(v,I){const w=this._addSchema(v,I);return w.validate||this._compileSchemaEnv(w)}compileAsync(v,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:w}=this.opts;return o.call(this,v,I);async function o(x,ae){await p.call(this,x.$schema);const Ie=this._addSchema(x,ae);return Ie.validate||O.call(this,Ie)}async function p(x){x&&!this.getSchema(x)&&await o.call(this,{$ref:x},!0)}async function O(x){try{return this._compileSchemaEnv(x)}catch(ae){if(!(ae instanceof s.default))throw ae;return M.call(this,ae),await U.call(this,ae.missingSchema),O.call(this,x)}}function M({missingSchema:x,missingRef:ae}){if(this.refs[x])throw new Error(`AnySchema ${x} is loaded but ${ae} cannot be resolved`)}async function U(x){const ae=await J.call(this,x);this.refs[x]||await p.call(this,ae.$schema),this.refs[x]||this.addSchema(ae,x,I)}async function J(x){const ae=this._loading[x];if(ae)return ae;try{return await(this._loading[x]=w(x))}finally{delete this._loading[x]}}}addSchema(v,I,w,o=this.opts.validateSchema){if(Array.isArray(v)){for(const O of v)this.addSchema(O,void 0,w,o);return this}let p;if(typeof v=="object"){const{schemaId:O}=this.opts;if(p=v[O],p!==void 0&&typeof p!="string")throw new Error(`schema ${O} must be string`)}return I=(0,m.normalizeId)(I||p),this._checkUnique(I),this.schemas[I]=this._addSchema(v,w,I,o,!0),this}addMetaSchema(v,I,w=this.opts.validateSchema){return this.addSchema(v,I,!0,w),this}validateSchema(v,I){if(typeof v=="boolean")return!0;let w;if(w=v.$schema,w!==void 0&&typeof w!="string")throw new Error("$schema must be a string");if(w=w||this.opts.defaultMeta||this.defaultMeta(),!w)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate(w,v);if(!o&&I){const p="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(p);else throw new Error(p)}return o}getSchema(v){let I;for(;typeof(I=_.call(this,v))=="string";)v=I;if(I===void 0){const{schemaId:w}=this.opts,o=new a.SchemaEnv({schema:{},schemaId:w});if(I=a.resolveSchema.call(this,o,v),!I)return;this.refs[v]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema(v){if(v instanceof RegExp)return this._removeAllSchemas(this.schemas,v),this._removeAllSchemas(this.refs,v),this;switch(typeof v){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=_.call(this,v);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[v],delete this.refs[v],this}case"object":{const I=v;this._cache.delete(I);let w=v[this.opts.schemaId];return w&&(w=(0,m.normalizeId)(w),delete this.schemas[w],delete this.refs[w]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(v){for(const I of v)this.addKeyword(I);return this}addKeyword(v,I){let w;if(typeof v=="string")w=v,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=w);else if(typeof v=="object"&&I===void 0){if(I=v,w=I.keyword,Array.isArray(w)&&!w.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(de.call(this,w,I),!I)return(0,f.eachItem)(w,p=>Ze.call(this,p)),this;ut.call(this,I);const o={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,f.eachItem)(w,o.type.length===0?p=>Ze.call(this,p,o):p=>o.type.forEach(O=>Ze.call(this,p,o,O))),this}getKeyword(v){const I=this.RULES.all[v];return typeof I=="object"?I.definition:!!I}removeKeyword(v){const{RULES:I}=this;delete I.keywords[v],delete I.all[v];for(const w of I.rules){const o=w.rules.findIndex(p=>p.keyword===v);o>=0&&w.rules.splice(o,1)}return this}addFormat(v,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[v]=I,this}errorsText(v=this.errors,{separator:I=", ",dataVar:w="data"}={}){return!v||v.length===0?"No errors":v.map(o=>`${w}${o.instancePath} ${o.message}`).reduce((o,p)=>o+I+p)}$dataMetaSchema(v,I){const w=this.RULES.all;v=JSON.parse(JSON.stringify(v));for(const o of I){const p=o.split("/").slice(1);let O=v;for(const M of p)O=O[M];for(const M in w){const U=w[M];if(typeof U!="object")continue;const{$data:J}=U.definition,x=O[M];J&&x&&(O[M]=dt(x))}}return v}_removeAllSchemas(v,I){for(const w in v){const o=v[w];(!I||I.test(w))&&(typeof o=="string"?delete v[w]:o&&!o.meta&&(this._cache.delete(o.schema),delete v[w]))}}_addSchema(v,I,w,o=this.opts.validateSchema,p=this.opts.addUsedSchema){let O;const{schemaId:M}=this.opts;if(typeof v=="object")O=v[M];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof v!="boolean")throw new Error("schema must be object or boolean")}let U=this._cache.get(v);if(U!==void 0)return U;w=(0,m.normalizeId)(O||w);const J=m.getSchemaRefs.call(this,v,w);return U=new a.SchemaEnv({schema:v,schemaId:M,meta:I,baseId:w,localRefs:J}),this._cache.set(U.schema,U),p&&!w.startsWith("#")&&(w&&this._checkUnique(w),this.refs[w]=U),o&&this.validateSchema(v,!0),U}_checkUnique(v){if(this.schemas[v]||this.refs[v])throw new Error(`schema with key or id "${v}" already exists`)}_compileSchemaEnv(v){if(v.meta?this._compileMetaSchema(v):a.compileSchema.call(this,v),!v.validate)throw new Error("ajv implementation error");return v.validate}_compileMetaSchema(v){const I=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,v)}finally{this.opts=I}}}t.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function D(F,v,I,w="error"){for(const o in F){const p=o;p in v&&this.logger[w](`${I}: option ${o}. ${F[p]}`)}}function _(F){return F=(0,m.normalizeId)(F),this.schemas[F]||this.refs[F]}function N(){const F=this.opts.schemas;if(F)if(Array.isArray(F))this.addSchema(F);else for(const v in F)this.addSchema(F[v],v)}function A(){for(const F in this.opts.formats){const v=this.opts.formats[F];v&&this.addFormat(F,v)}}function H(F){if(Array.isArray(F)){this.addVocabulary(F);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const v in F){const I=F[v];I.keyword||(I.keyword=v),this.addKeyword(I)}}function B(){const F={...this.opts};for(const v of E)delete F[v];return F}const oe={log(){},warn(){},error(){}};function Z(F){if(F===!1)return oe;if(F===void 0)return console;if(F.log&&F.warn&&F.error)return F;throw new Error("logger must implement log, warn and error methods")}const be=/^[a-z_$][a-z0-9_$:-]*$/i;function de(F,v){const{RULES:I}=this;if((0,f.eachItem)(F,w=>{if(I.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!be.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!v&&v.$data&&!("code"in v||"validate"in v))throw new Error('$data keyword must have "code" or "validate" function')}function Ze(F,v,I){var w;const o=v?.post;if(I&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:p}=this;let O=o?p.post:p.rules.find(({type:U})=>U===I);if(O||(O={type:I,rules:[]},p.rules.push(O)),p.keywords[F]=!0,!v)return;const M={keyword:F,definition:{...v,type:(0,u.getJSONTypes)(v.type),schemaType:(0,u.getJSONTypes)(v.schemaType)}};v.before?Qe.call(this,O,M,v.before):O.rules.push(M),p.all[F]=M,(w=v.implements)===null||w===void 0||w.forEach(U=>this.addKeyword(U))}function Qe(F,v,I){const w=F.rules.findIndex(o=>o.keyword===I);w>=0?F.rules.splice(w,0,v):(F.rules.push(v),this.logger.warn(`rule ${I} is not defined`))}function ut(F){let{metaSchema:v}=F;v!==void 0&&(F.$data&&this.opts.$data&&(v=dt(v)),F.validateSchema=this.compile(v,!0))}const Ct={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dt(F){return{anyOf:[F,Ct]}}})(ri);var sn={},on={},an={};Object.defineProperty(an,"__esModule",{value:!0});const $c={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};an.default=$c;var ct={};Object.defineProperty(ct,"__esModule",{value:!0});ct.callRef=ct.getValidate=void 0;const _c=Xt,hs=K,$e=G,wt=Ve,ms=_e,ir=X,wc={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:a,opts:l,self:m}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return g();const f=ms.resolveRef.call(m,u,s,r);if(f===void 0)throw new _c.default(n.opts.uriResolver,s,r);if(f instanceof ms.SchemaEnv)return k(f);return C(f);function g(){if(i===u)return fr(t,a,i,i.$async);const E=e.scopeValue("root",{ref:u});return fr(t,(0,$e._)`${E}.validate`,u,u.$async)}function k(E){const S=Ni(t,E);fr(t,S,E,E.$async)}function C(E){const S=e.scopeValue("schema",l.code.source===!0?{ref:E,code:(0,$e.stringify)(E)}:{ref:E}),$=e.name("valid"),y=t.subschema({schema:E,dataTypes:[],schemaPath:$e.nil,topSchemaRef:S,errSchemaPath:r},$);t.mergeEvaluated(y),t.ok($)}}};function Ni(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,$e._)`${r.scopeValue("wrapper",{ref:e})}.validate`}ct.getValidate=Ni;function fr(t,e,r,n){const{gen:s,it:i}=t,{allErrors:a,schemaEnv:l,opts:m}=i,u=m.passContext?wt.default.this:$e.nil;n?f():g();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");const E=s.let("valid");s.try(()=>{s.code((0,$e._)`await ${(0,hs.callValidateCode)(t,e,u)}`),C(e),a||s.assign(E,!0)},S=>{s.if((0,$e._)`!(${S} instanceof ${i.ValidationError})`,()=>s.throw(S)),k(S),a||s.assign(E,!1)}),t.ok(E)}function g(){t.result((0,hs.callValidateCode)(t,e,u),()=>C(e),()=>k(e))}function k(E){const S=(0,$e._)`${E}.errors`;s.assign(wt.default.vErrors,(0,$e._)`${wt.default.vErrors} === null ? ${S} : ${wt.default.vErrors}.concat(${S})`),s.assign(wt.default.errors,(0,$e._)`${wt.default.vErrors}.length`)}function C(E){var S;if(!i.opts.unevaluated)return;const $=(S=r?.validate)===null||S===void 0?void 0:S.evaluated;if(i.props!==!0)if($&&!$.dynamicProps)$.props!==void 0&&(i.props=ir.mergeEvaluated.props(s,$.props,i.props));else{const y=s.var("props",(0,$e._)`${E}.evaluated.props`);i.props=ir.mergeEvaluated.props(s,y,i.props,$e.Name)}if(i.items!==!0)if($&&!$.dynamicItems)$.items!==void 0&&(i.items=ir.mergeEvaluated.items(s,$.items,i.items));else{const y=s.var("items",(0,$e._)`${E}.evaluated.items`);i.items=ir.mergeEvaluated.items(s,y,i.items,$e.Name)}}}ct.callRef=fr;ct.default=wc;Object.defineProperty(on,"__esModule",{value:!0});const bc=an,Pc=ct,Ec=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",bc.default,Pc.default];on.default=Ec;var cn={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});const yr=G,Je=yr.operators,gr={maximum:{okStr:"<=",ok:Je.LTE,fail:Je.GT},minimum:{okStr:">=",ok:Je.GTE,fail:Je.LT},exclusiveMaximum:{okStr:"<",ok:Je.LT,fail:Je.GTE},exclusiveMinimum:{okStr:">",ok:Je.GT,fail:Je.LTE}},Sc={message:({keyword:t,schemaCode:e})=>(0,yr.str)`must be ${gr[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,yr._)`{comparison: ${gr[t].okStr}, limit: ${e}}`},Tc={keyword:Object.keys(gr),type:"number",schemaType:"number",$data:!0,error:Sc,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,yr._)`${r} ${gr[e].fail} ${n} || isNaN(${r})`)}};ln.default=Tc;var un={};Object.defineProperty(un,"__esModule",{value:!0});const Kt=G,Rc={message:({schemaCode:t})=>(0,Kt.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Kt._)`{multipleOf: ${t}}`},Nc={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Rc,code(t){const{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,a=e.let("res"),l=i?(0,Kt._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,Kt._)`${a} !== parseInt(${a})`;t.fail$data((0,Kt._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};un.default=Nc;var dn={},fn={};Object.defineProperty(fn,"__esModule",{value:!0});function Oi(t){const e=t.length;let r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}fn.default=Oi;Oi.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(dn,"__esModule",{value:!0});const it=G,Oc=X,Cc=fn,jc={message({keyword:t,schemaCode:e}){const r=t==="maxLength"?"more":"fewer";return(0,it.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,it._)`{limit: ${t}}`},kc={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:jc,code(t){const{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?it.operators.GT:it.operators.LT,a=s.opts.unicode===!1?(0,it._)`${r}.length`:(0,it._)`${(0,Oc.useFunc)(t.gen,Cc.default)}(${r})`;t.fail$data((0,it._)`${a} ${i} ${n}`)}};dn.default=kc;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});const Ic=K,vr=G,Ac={message:({schemaCode:t})=>(0,vr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,vr._)`{pattern: ${t}}`},Dc={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Ac,code(t){const{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"",l=r?(0,vr._)`(new RegExp(${s}, ${a}))`:(0,Ic.usePattern)(t,n);t.fail$data((0,vr._)`!${l}.test(${e})`)}};pn.default=Dc;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});const Gt=G,Fc={message({keyword:t,schemaCode:e}){const r=t==="maxProperties"?"more":"fewer";return(0,Gt.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Gt._)`{limit: ${t}}`},Mc={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Fc,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?Gt.operators.GT:Gt.operators.LT;t.fail$data((0,Gt._)`Object.keys(${r}).length ${s} ${n}`)}};hn.default=Mc;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});const Vt=K,Bt=G,Uc=X,qc={message:({params:{missingProperty:t}})=>(0,Bt.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Bt._)`{missingProperty: ${t}}`},Lc={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qc,code(t){const{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:a}=t,{opts:l}=a;if(!i&&r.length===0)return;const m=r.length>=l.loopRequired;if(a.allErrors?u():f(),l.strictRequired){const C=t.parentSchema.properties,{definedProperties:E}=t.it;for(const S of r)if(C?.[S]===void 0&&!E.has(S)){const $=a.schemaEnv.baseId+a.errSchemaPath,y=`required property "${S}" is not defined at "${$}" (strictRequired)`;(0,Uc.checkStrictMode)(a,y,a.opts.strictRequired)}}function u(){if(m||i)t.block$data(Bt.nil,g);else for(const C of r)(0,Vt.checkReportMissingProp)(t,C)}function f(){const C=e.let("missing");if(m||i){const E=e.let("valid",!0);t.block$data(E,()=>k(C,E)),t.ok(E)}else e.if((0,Vt.checkMissingProp)(t,r,C)),(0,Vt.reportMissingProp)(t,C),e.else()}function g(){e.forOf("prop",n,C=>{t.setParams({missingProperty:C}),e.if((0,Vt.noPropertyInData)(e,s,C,l.ownProperties),()=>t.error())})}function k(C,E){t.setParams({missingProperty:C}),e.forOf(C,n,()=>{e.assign(E,(0,Vt.propertyInData)(e,s,C,l.ownProperties)),e.if((0,Bt.not)(E),()=>{t.error(),e.break()})},Bt.nil)}}};mn.default=Lc;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});const Jt=G,Vc={message({keyword:t,schemaCode:e}){const r=t==="maxItems"?"more":"fewer";return(0,Jt.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Jt._)`{limit: ${t}}`},zc={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Vc,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Jt.operators.GT:Jt.operators.LT;t.fail$data((0,Jt._)`${r}.length ${s} ${n}`)}};yn.default=zc;var gn={},er={};Object.defineProperty(er,"__esModule",{value:!0});const Ci=ui;Ci.code='require("ajv/dist/runtime/equal").default';er.default=Ci;Object.defineProperty(gn,"__esModule",{value:!0});const kr=Zt,pe=G,Hc=X,Wc=er,Kc={message:({params:{i:t,j:e}})=>(0,pe.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,pe._)`{i: ${t}, j: ${e}}`},Gc={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Kc,code(t){const{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:a,it:l}=t;if(!n&&!s)return;const m=e.let("valid"),u=i.items?(0,kr.getSchemaTypes)(i.items):[];t.block$data(m,f,(0,pe._)`${a} === false`),t.ok(m);function f(){const E=e.let("i",(0,pe._)`${r}.length`),S=e.let("j");t.setParams({i:E,j:S}),e.assign(m,!0),e.if((0,pe._)`${E} > 1`,()=>(g()?k:C)(E,S))}function g(){return u.length>0&&!u.some(E=>E==="object"||E==="array")}function k(E,S){const $=e.name("item"),y=(0,kr.checkDataTypes)(u,$,l.opts.strictNumbers,kr.DataType.Wrong),T=e.const("indices",(0,pe._)`{}`);e.for((0,pe._)`;${E}--;`,()=>{e.let($,(0,pe._)`${r}[${E}]`),e.if(y,(0,pe._)`continue`),u.length>1&&e.if((0,pe._)`typeof ${$} == "string"`,(0,pe._)`${$} += "_"`),e.if((0,pe._)`typeof ${T}[${$}] == "number"`,()=>{e.assign(S,(0,pe._)`${T}[${$}]`),t.error(),e.assign(m,!1).break()}).code((0,pe._)`${T}[${$}] = ${E}`)})}function C(E,S){const $=(0,Hc.useFunc)(e,Wc.default),y=e.name("outer");e.label(y).for((0,pe._)`;${E}--;`,()=>e.for((0,pe._)`${S} = ${E}; ${S}--;`,()=>e.if((0,pe._)`${$}(${r}[${E}], ${r}[${S}])`,()=>{t.error(),e.assign(m,!1).break(y)})))}}};gn.default=Gc;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});const qr=G,Bc=X,Jc=er,Yc={message:"must be equal to constant",params:({schemaCode:t})=>(0,qr._)`{allowedValue: ${t}}`},xc={keyword:"const",$data:!0,error:Yc,code(t){const{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,qr._)`!${(0,Bc.useFunc)(e,Jc.default)}(${r}, ${s})`):t.fail((0,qr._)`${i} !== ${r}`)}};vn.default=xc;var $n={};Object.defineProperty($n,"__esModule",{value:!0});const zt=G,Zc=X,Qc=er,Xc={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,zt._)`{allowedValues: ${t}}`},el={keyword:"enum",schemaType:"array",$data:!0,error:Xc,code(t){const{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:a}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const l=s.length>=a.opts.loopEnum;let m;const u=()=>m??(m=(0,Zc.useFunc)(e,Qc.default));let f;if(l||n)f=e.let("valid"),t.block$data(f,g);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const C=e.const("vSchema",i);f=(0,zt.or)(...s.map((E,S)=>k(C,S)))}t.pass(f);function g(){e.assign(f,!1),e.forOf("v",i,C=>e.if((0,zt._)`${u()}(${r}, ${C})`,()=>e.assign(f,!0).break()))}function k(C,E){const S=s[E];return typeof S=="object"&&S!==null?(0,zt._)`${u()}(${r}, ${C}[${E}])`:(0,zt._)`${r} === ${S}`}}};$n.default=el;Object.defineProperty(cn,"__esModule",{value:!0});const tl=ln,rl=un,nl=dn,sl=pn,il=hn,ol=mn,al=yn,cl=gn,ll=vn,ul=$n,dl=[tl.default,rl.default,nl.default,sl.default,il.default,ol.default,al.default,cl.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ll.default,ul.default];cn.default=dl;var _n={},Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.validateAdditionalItems=void 0;const ot=G,Lr=X,fl={message:({params:{len:t}})=>(0,ot.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ot._)`{limit: ${t}}`},pl={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:fl,code(t){const{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Lr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ji(t,n)}};function ji(t,e){const{gen:r,schema:n,data:s,keyword:i,it:a}=t;a.items=!0;const l=r.const("len",(0,ot._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,ot._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Lr.alwaysValidSchema)(a,n)){const u=r.var("valid",(0,ot._)`${l} <= ${e.length}`);r.if((0,ot.not)(u),()=>m(u)),t.ok(u)}function m(u){r.forRange("i",e.length,l,f=>{t.subschema({keyword:i,dataProp:f,dataPropType:Lr.Type.Num},u),a.allErrors||r.if((0,ot.not)(u),()=>r.break())})}}Nt.validateAdditionalItems=ji;Nt.default=pl;var wn={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.validateTuple=void 0;const ys=G,pr=X,hl=K,ml={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return ki(t,"additionalItems",e);r.items=!0,!(0,pr.alwaysValidSchema)(r,e)&&t.ok((0,hl.validateArray)(t))}};function ki(t,e,r=t.schema){const{gen:n,parentSchema:s,data:i,keyword:a,it:l}=t;f(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=pr.mergeEvaluated.items(n,r.length,l.items));const m=n.name("valid"),u=n.const("len",(0,ys._)`${i}.length`);r.forEach((g,k)=>{(0,pr.alwaysValidSchema)(l,g)||(n.if((0,ys._)`${u} > ${k}`,()=>t.subschema({keyword:a,schemaProp:k,dataProp:k},m)),t.ok(m))});function f(g){const{opts:k,errSchemaPath:C}=l,E=r.length,S=E===g.minItems&&(E===g.maxItems||g[e]===!1);if(k.strictTuples&&!S){const $=`"${a}" is ${E}-tuple, but minItems or maxItems/${e} are not specified or different at path "${C}"`;(0,pr.checkStrictMode)(l,$,k.strictTuples)}}}Ot.validateTuple=ki;Ot.default=ml;Object.defineProperty(wn,"__esModule",{value:!0});const yl=Ot,gl={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,yl.validateTuple)(t,"items")};wn.default=gl;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const gs=G,vl=X,$l=K,_l=Nt,wl={message:({params:{len:t}})=>(0,gs.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,gs._)`{limit: ${t}}`},bl={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:wl,code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,vl.alwaysValidSchema)(n,e)&&(s?(0,_l.validateAdditionalItems)(t,s):t.ok((0,$l.validateArray)(t)))}};bn.default=bl;var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});const Se=G,or=X,Pl={message:({params:{min:t,max:e}})=>e===void 0?(0,Se.str)`must contain at least ${t} valid item(s)`:(0,Se.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Se._)`{minContains: ${t}}`:(0,Se._)`{minContains: ${t}, maxContains: ${e}}`},El={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Pl,code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;let a,l;const{minContains:m,maxContains:u}=n;i.opts.next?(a=m===void 0?1:m,l=u):a=1;const f=e.const("len",(0,Se._)`${s}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,or.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,or.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,or.alwaysValidSchema)(i,r)){let S=(0,Se._)`${f} >= ${a}`;l!==void 0&&(S=(0,Se._)`${S} && ${f} <= ${l}`),t.pass(S);return}i.items=!0;const g=e.name("valid");l===void 0&&a===1?C(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,Se._)`${s}.length > 0`,k)):(e.let(g,!1),k()),t.result(g,()=>t.reset());function k(){const S=e.name("_valid"),$=e.let("count",0);C(S,()=>e.if(S,()=>E($)))}function C(S,$){e.forRange("i",0,f,y=>{t.subschema({keyword:"contains",dataProp:y,dataPropType:or.Type.Num,compositeRule:!0},S),$()})}function E(S){e.code((0,Se._)`${S}++`),l===void 0?e.if((0,Se._)`${S} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,Se._)`${S} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,Se._)`${S} >= ${a}`,()=>e.assign(g,!0)))}}};Pn.default=El;var Ii={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=G,r=X,n=K;t.error={message:({params:{property:m,depsCount:u,deps:f}})=>{const g=u===1?"property":"properties";return(0,e.str)`must have ${g} ${f} when property ${m} is present`},params:({params:{property:m,depsCount:u,deps:f,missingProperty:g}})=>(0,e._)`{property: ${m},
477
+ `;this[ee].ccall("wasm_set_phpini_entries",null,[me],[e])}this[ee].ccall("php_wasm_init",null,[],[])}#o(){const e="/tmp/headers.json";if(!this.fileExists(e))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(e)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),c=s.substring(0,i).toLowerCase(),l=s.substring(i+2);c in n||(n[c]=[]),n[c].push(l)}return{headers:n,httpStatusCode:r.status}}#a(e){if(this[ee].ccall("wasm_set_request_uri",null,[me],[e]),e.includes("?")){const r=e.substring(e.indexOf("?")+1);this[ee].ccall("wasm_set_query_string",null,[me],[r])}}#c(e,r){this[ee].ccall("wasm_set_request_host",null,[me],[e]);let n;try{n=parseInt(new URL(e).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[ee].ccall("wasm_set_request_port",null,[_t],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")}#l(e){this[ee].ccall("wasm_set_request_method",null,[me],[e])}#u(e){e.cookie&&this[ee].ccall("wasm_set_cookies",null,[me],[e.cookie]),e["content-type"]&&this[ee].ccall("wasm_set_content_type",null,[me],[e["content-type"]]),e["content-length"]&&this[ee].ccall("wasm_set_content_length",null,[_t],[parseInt(e["content-length"],10)]);for(const r in e){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,e[r])}}#d(e){this[ee].ccall("wasm_set_request_body",null,[me],[e]),this[ee].ccall("wasm_set_content_length",null,[_t],[new TextEncoder().encode(e).length])}#p(e){this[ee].ccall("wasm_set_path_translated",null,[me],[e])}addServerGlobalEntry(e,r){this.#r[e]=r}#f(){for(const e in this.#r)this[ee].ccall("wasm_add_SERVER_entry",null,[me,me],[e,this.#r[e]])}#h(e){const{key:r,name:n,type:s,data:i}=e,c=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(c,i);const l=0;this[ee].ccall("wasm_add_uploaded_file",null,[me,me,me,me,_t,_t],[r,n,s,c,l,i.byteLength])}#m(e){this[ee].ccall("wasm_set_php_code",null,[me],[e])}async#y(){let e,r;try{e=await new Promise((i,c)=>{r=m=>{const u=new Error("Rethrown");u.cause=m.error,u.betterMessage=m.message,c(u)},this.#n?.addEventListener("error",r);const l=this[ee].ccall("wasm_sapi_handle_request",_t,[],[]);return l instanceof Promise?l.then(i,c):i(l)})}catch(i){for(const u in this)typeof this[u]=="function"&&(this[u]=()=>{throw new Error("PHP runtime has crashed – see the earlier error for details.")});this.functionsMaybeMissingFromAsyncify=mo();const c=i,l="betterMessage"in c?c.betterMessage:c.message,m=new Error(l);throw m.cause=c,m}finally{this.#n?.removeEventListener("error",r),this.#r={}}const{headers:n,httpStatusCode:s}=this.#o();return new St(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),e)}mkdir(e){this[ee].FS.mkdirTree(e)}mkdirTree(e){this.mkdir(e)}readFileAsText(e){return new TextDecoder().decode(this.readFileAsBuffer(e))}readFileAsBuffer(e){return this[ee].FS.readFile(e)}writeFile(e,r){this[ee].FS.writeFile(e,r)}unlink(e){this[ee].FS.unlink(e)}mv(e,r){this[ee].FS.rename(e,r)}rmdir(e,r={recursive:!0}){r?.recursive&&this.listFiles(e).forEach(n=>{const s=`${e}/${n}`;this.isDir(s)?this.rmdir(s,r):this.unlink(s)}),this[ee].FS.rmdir(e)}listFiles(e,r={prependPath:!1}){if(!this.fileExists(e))return[];try{const n=this[ee].FS.readdir(e).filter(s=>s!=="."&&s!=="..");if(r.prependPath){const s=e.replace(/\/$/,"");return n.map(i=>`${s}/${i}`)}return n}catch(n){return console.error(n,{path:e}),[]}}isDir(e){return this.fileExists(e)?this[ee].FS.isDir(this[ee].FS.lookupPath(e).node.mode):!1}fileExists(e){try{return this[ee].FS.lookupPath(e),!0}catch{return!1}}}je([Ce('Could not create directory "{path}"')],ke.prototype,"mkdir",1);je([Ce('Could not create directory "{path}"')],ke.prototype,"mkdirTree",1);je([Ce('Could not read "{path}"')],ke.prototype,"readFileAsText",1);je([Ce('Could not read "{path}"')],ke.prototype,"readFileAsBuffer",1);je([Ce('Could not write to "{path}"')],ke.prototype,"writeFile",1);je([Ce('Could not unlink "{path}"')],ke.prototype,"unlink",1);je([Ce('Could not move "{path}"')],ke.prototype,"mv",1);je([Ce('Could not remove directory "{path}"')],ke.prototype,"rmdir",1);je([Ce('Could not list files in "{path}"')],ke.prototype,"listFiles",1);je([Ce('Could not stat "{path}"')],ke.prototype,"isDir",1);je([Ce('Could not stat "{path}"')],ke.prototype,"fileExists",1);function Xs(t){const e={};for(const r in t)e[r.toLowerCase()]=t[r];return e}const Do=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function qo(t){return t&&typeof t=="object"&&typeof t.resource=="string"&&Do.includes(t.resource)}class ut{static create(e,{semaphore:r,progress:n}){let s;switch(e.resource){case"vfs":s=new Fo(e,n);break;case"literal":s=new Mo(e,n);break;case"wordpress.org/themes":s=new Ho(e,n);break;case"wordpress.org/plugins":s=new Vo(e,n);break;case"url":s=new Lo(e,n);break;default:throw new Error(`Invalid resource: ${e}`)}return s=new zo(s),r&&(s=new Wo(s,r)),s}setPlayground(e){this.playground=e}get isAsync(){return!1}}class Fo extends ut{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){const e=await this.playground.readFileAsBuffer(this.resource.path);return this.progress?.set(100),new Wr([e],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Mo extends ut{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){return this.progress?.set(100),new Wr([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class Jr extends ut{constructor(e){super(),this.progress=e}async resolve(){this.progress?.setCaption(this.caption);const e=this.getURL();let r=await fetch(e);if(r=await lo(r,this.progress?.loadingListener??Uo),r.status!==200)throw new Error(`Could not download "${e}"`);return new Wr([await r.blob()],this.name)}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const Uo=()=>{};class Lo extends Jr{constructor(e,r){super(r),this.resource=e}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class Ho extends Jr{constructor(e,r){super(r),this.resource=e}get name(){return wr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${ei(this.resource.slug)}`}}class Vo extends Jr{constructor(e,r){super(r),this.resource=e}get name(){return wr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${ei(this.resource.slug)}`}}function ei(t){return!t||t.endsWith(".zip")?t:t+".latest-stable.zip"}class ti extends ut{constructor(e){super(),this.resource=e}async resolve(){return this.resource.resolve()}async setPlayground(e){return this.resource.setPlayground(e)}get progress(){return this.resource.progress}set progress(e){this.resource.progress=e}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class zo extends ti{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class Wo extends ti{constructor(e,r){super(e),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Ko=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dr={exports:{}},ri={},Ne={},Ot={},Zt={},B={},Yt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(T){if(super(),!t.IDENTIFIER.test(T))throw new Error("CodeGen: name must be a valid identifier");this.str=T}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(T){super(),this._items=typeof T=="string"?[T]:T}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const T=this._items[0];return T===""||T==='""'}get str(){var T;return(T=this._str)!==null&&T!==void 0?T:this._str=this._items.reduce((R,j)=>`${R}${j}`,"")}get names(){var T;return(T=this._names)!==null&&T!==void 0?T:this._names=this._items.reduce((R,j)=>(j instanceof r&&(R[j.str]=(R[j.str]||0)+1),R),{})}}t._Code=n,t.nil=new n("");function s(y,...T){const R=[y[0]];let j=0;for(;j<T.length;)l(R,T[j]),R.push(y[++j]);return new n(R)}t._=s;const i=new n("+");function c(y,...T){const R=[C(y[0])];let j=0;for(;j<T.length;)R.push(i),l(R,T[j]),R.push(i,C(y[++j]));return m(R),new n(R)}t.str=c;function l(y,T){T instanceof n?y.push(...T._items):T instanceof r?y.push(T):y.push(g(T))}t.addCodeArg=l;function m(y){let T=1;for(;T<y.length-1;){if(y[T]===i){const R=u(y[T-1],y[T+1]);if(R!==void 0){y.splice(T-1,3,R);continue}y[T++]="+"}T++}}function u(y,T){if(T==='""')return y;if(y==='""')return T;if(typeof y=="string")return T instanceof r||y[y.length-1]!=='"'?void 0:typeof T!="string"?`${y.slice(0,-1)}${T}"`:T[0]==='"'?y.slice(0,-1)+T.slice(1):void 0;if(typeof T=="string"&&T[0]==='"'&&!(y instanceof r))return`"${y}${T.slice(1)}`}function p(y,T){return T.emptyStr()?y:y.emptyStr()?T:c`${y}${T}`}t.strConcat=p;function g(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:C(Array.isArray(y)?y.join(","):y)}function k(y){return new n(C(y))}t.stringify=k;function C(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=C;function E(y){return typeof y=="string"&&t.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}t.getProperty=E;function S(y){if(typeof y=="string"&&t.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}t.getEsmExportName=S;function v(y){return new n(y.toString())}t.regexpCode=v})(Yt);var qr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=Yt;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:u,parent:p}={}){this._names={},this._prefixes=u,this._parent=p}toName(u){return u instanceof e.Name?u:this.name(u)}name(u){return new e.Name(this._newName(u))}_newName(u){const p=this._names[u]||this._nameGroup(u);return`${u}${p.index++}`}_nameGroup(u){var p,g;if(!((g=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||g===void 0)&&g.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}t.Scope=s;class i extends e.Name{constructor(u,p){super(p),this.prefix=u}setValue(u,{property:p,itemIndex:g}){this.value=u,this.scopePath=(0,e._)`.${new e.Name(p)}[${g}]`}}t.ValueScopeName=i;const c=(0,e._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?c:e.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,p){var g;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const k=this.toName(u),{prefix:C}=k,E=(g=p.key)!==null&&g!==void 0?g:p.ref;let S=this._values[C];if(S){const T=S.get(E);if(T)return T}else S=this._values[C]=new Map;S.set(E,k);const v=this._scope[C]||(this._scope[C]=[]),y=v.length;return v[y]=p.ref,k.setValue(p,{property:C,itemIndex:y}),k}getValue(u,p){const g=this._values[u];if(g)return g.get(p)}scopeRefs(u,p=this._values){return this._reduceValues(p,g=>{if(g.scopePath===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return(0,e._)`${u}${g.scopePath}`})}scopeCode(u=this._values,p,g){return this._reduceValues(u,k=>{if(k.value===void 0)throw new Error(`CodeGen: name "${k}" has no value`);return k.value.code},p,g)}_reduceValues(u,p,g={},k){let C=e.nil;for(const E in u){const S=u[E];if(!S)continue;const v=g[E]=g[E]||new Map;S.forEach(y=>{if(v.has(y))return;v.set(y,n.Started);let T=p(y);if(T){const R=this.opts.es5?t.varKinds.var:t.varKinds.const;C=(0,e._)`${C}${R} ${y} = ${T};${this.opts._n}`}else if(T=k?.(y))C=(0,e._)`${C}${T}${this.opts._n}`;else throw new r(y);v.set(y,n.Completed)})}return C}}t.ValueScope=l})(qr);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=Yt,r=qr;var n=Yt;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var s=qr;Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(o,f){return this}}class c extends i{constructor(o,f,N){super(),this.varKind=o,this.name=f,this.rhs=N}render({es5:o,_n:f}){const N=o?r.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${F};`+f}optimizeNames(o,f){if(o[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,o,f)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(o,f,N){super(),this.lhs=o,this.rhs=f,this.sideEffects=N}render({_n:o}){return`${this.lhs} = ${this.rhs};`+o}optimizeNames(o,f){if(!(this.lhs instanceof e.Name&&!o[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,o,f),this}get names(){const o=this.lhs instanceof e.Name?{}:{...this.lhs.names};return be(o,this.rhs)}}class m extends l{constructor(o,f,N,F){super(o,N,F),this.op=f}render({_n:o}){return`${this.lhs} ${this.op}= ${this.rhs};`+o}}class u extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`${this.label}:`+o}}class p extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`break${this.label?` ${this.label}`:""};`+o}}class g extends i{constructor(o){super(),this.error=o}render({_n:o}){return`throw ${this.error};`+o}get names(){return this.error.names}}class k extends i{constructor(o){super(),this.code=o}render({_n:o}){return`${this.code};`+o}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(o,f){return this.code=de(this.code,o,f),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class C extends i{constructor(o=[]){super(),this.nodes=o}render(o){return this.nodes.reduce((f,N)=>f+N.render(o),"")}optimizeNodes(){const{nodes:o}=this;let f=o.length;for(;f--;){const N=o[f].optimizeNodes();Array.isArray(N)?o.splice(f,1,...N):N?o[f]=N:o.splice(f,1)}return o.length>0?this:void 0}optimizeNames(o,f){const{nodes:N}=this;let F=N.length;for(;F--;){const M=N[F];M.optimizeNames(o,f)||(Ze(o,M.names),N.splice(F,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((o,f)=>Z(o,f.names),{})}}class E extends C{render(o){return"{"+o._n+super.render(o)+"}"+o._n}}class S extends C{}class v extends E{}v.kind="else";class y extends E{constructor(o,f){super(f),this.condition=o}render(o){let f=`if(${this.condition})`+super.render(o);return this.else&&(f+="else "+this.else.render(o)),f}optimizeNodes(){super.optimizeNodes();const o=this.condition;if(o===!0)return this.nodes;let f=this.else;if(f){const N=f.optimizeNodes();f=this.else=Array.isArray(N)?new v(N):N}if(f)return o===!1?f instanceof y?f:f.nodes:this.nodes.length?this:new y(Qe(o),f instanceof y?[f]:f.nodes);if(!(o===!1||!this.nodes.length))return this}optimizeNames(o,f){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(o,f),!!(super.optimizeNames(o,f)||this.else))return this.condition=de(this.condition,o,f),this}get names(){const o=super.names;return be(o,this.condition),this.else&&Z(o,this.else.names),o}}y.kind="if";class T extends E{}T.kind="for";class R extends T{constructor(o){super(),this.iteration=o}render(o){return`for(${this.iteration})`+super.render(o)}optimizeNames(o,f){if(super.optimizeNames(o,f))return this.iteration=de(this.iteration,o,f),this}get names(){return Z(super.names,this.iteration.names)}}class j extends T{constructor(o,f,N,F){super(),this.varKind=o,this.name=f,this.from=N,this.to=F}render(o){const f=o.es5?r.varKinds.var:this.varKind,{name:N,from:F,to:M}=this;return`for(${f} ${N}=${F}; ${N}<${M}; ${N}++)`+super.render(o)}get names(){const o=be(super.names,this.from);return be(o,this.to)}}class D extends T{constructor(o,f,N,F){super(),this.loop=o,this.varKind=f,this.name=N,this.iterable=F}render(o){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(o)}optimizeNames(o,f){if(super.optimizeNames(o,f))return this.iterable=de(this.iterable,o,f),this}get names(){return Z(super.names,this.iterable.names)}}class _ extends E{constructor(o,f,N){super(),this.name=o,this.args=f,this.async=N}render(o){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(o)}}_.kind="func";class O extends C{render(o){return"return "+super.render(o)}}O.kind="return";class A extends E{render(o){let f="try"+super.render(o);return this.catch&&(f+=this.catch.render(o)),this.finally&&(f+=this.finally.render(o)),f}optimizeNodes(){var o,f;return super.optimizeNodes(),(o=this.catch)===null||o===void 0||o.optimizeNodes(),(f=this.finally)===null||f===void 0||f.optimizeNodes(),this}optimizeNames(o,f){var N,F;return super.optimizeNames(o,f),(N=this.catch)===null||N===void 0||N.optimizeNames(o,f),(F=this.finally)===null||F===void 0||F.optimizeNames(o,f),this}get names(){const o=super.names;return this.catch&&Z(o,this.catch.names),this.finally&&Z(o,this.finally.names),o}}class z extends E{constructor(o){super(),this.error=o}render(o){return`catch(${this.error})`+super.render(o)}}z.kind="catch";class G extends E{render(o){return"finally"+super.render(o)}}G.kind="finally";class oe{constructor(o,f={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...f,_n:f.lines?`
478
+ `:""},this._extScope=o,this._scope=new r.Scope({parent:o}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(o){return this._scope.name(o)}scopeName(o){return this._extScope.name(o)}scopeValue(o,f){const N=this._extScope.value(o,f);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(o,f){return this._extScope.getValue(o,f)}scopeRefs(o){return this._extScope.scopeRefs(o,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(o,f,N,F){const M=this._scope.toName(f);return N!==void 0&&F&&(this._constants[M.str]=N),this._leafNode(new c(o,M,N)),M}const(o,f,N){return this._def(r.varKinds.const,o,f,N)}let(o,f,N){return this._def(r.varKinds.let,o,f,N)}var(o,f,N){return this._def(r.varKinds.var,o,f,N)}assign(o,f,N){return this._leafNode(new l(o,f,N))}add(o,f){return this._leafNode(new m(o,t.operators.ADD,f))}code(o){return typeof o=="function"?o():o!==e.nil&&this._leafNode(new k(o)),this}object(...o){const f=["{"];for(const[N,F]of o)f.length>1&&f.push(","),f.push(N),(N!==F||this.opts.es5)&&(f.push(":"),(0,e.addCodeArg)(f,F));return f.push("}"),new e._Code(f)}if(o,f,N){if(this._blockNode(new y(o)),f&&N)this.code(f).else().code(N).endIf();else if(f)this.code(f).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(o){return this._elseNode(new y(o))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(o,f){return this._blockNode(o),f&&this.code(f).endFor(),this}for(o,f){return this._for(new R(o),f)}forRange(o,f,N,F,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const x=this._scope.toName(o);return this._for(new j(M,x,f,N),()=>F(x))}forOf(o,f,N,F=r.varKinds.const){const M=this._scope.toName(o);if(this.opts.es5){const x=f instanceof e.Name?f:this.var("_arr",f);return this.forRange("_i",0,(0,e._)`${x}.length`,Y=>{this.var(M,(0,e._)`${x}[${Y}]`),N(M)})}return this._for(new D("of",F,M,f),()=>N(M))}forIn(o,f,N,F=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(o,(0,e._)`Object.keys(${f})`,N);const M=this._scope.toName(o);return this._for(new D("in",F,M,f),()=>N(M))}endFor(){return this._endBlockNode(T)}label(o){return this._leafNode(new u(o))}break(o){return this._leafNode(new p(o))}return(o){const f=new O;if(this._blockNode(f),this.code(o),f.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(o,f,N){if(!f&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new A;if(this._blockNode(F),this.code(o),f){const M=this.name("e");this._currNode=F.catch=new z(M),f(M)}return N&&(this._currNode=F.finally=new G,this.code(N)),this._endBlockNode(z,G)}throw(o){return this._leafNode(new g(o))}block(o,f){return this._blockStarts.push(this._nodes.length),o&&this.code(o).endBlock(f),this}endBlock(o){const f=this._blockStarts.pop();if(f===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-f;if(N<0||o!==void 0&&N!==o)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${o} expected`);return this._nodes.length=f,this}func(o,f=e.nil,N,F){return this._blockNode(new _(o,f,N)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(o=1){for(;o-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(o){return this._currNode.nodes.push(o),this}_blockNode(o){this._currNode.nodes.push(o),this._nodes.push(o)}_endBlockNode(o,f){const N=this._currNode;if(N instanceof o||f&&N instanceof f)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${f?`${o.kind}/${f.kind}`:o.kind}"`)}_elseNode(o){const f=this._currNode;if(!(f instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=f.else=o,this}get _root(){return this._nodes[0]}get _currNode(){const o=this._nodes;return o[o.length-1]}set _currNode(o){const f=this._nodes;f[f.length-1]=o}}t.CodeGen=oe;function Z(w,o){for(const f in o)w[f]=(w[f]||0)+(o[f]||0);return w}function be(w,o){return o instanceof e._CodeOrName?Z(w,o.names):w}function de(w,o,f){if(w instanceof e.Name)return N(w);if(!F(w))return w;return new e._Code(w._items.reduce((M,x)=>(x instanceof e.Name&&(x=N(x)),x instanceof e._Code?M.push(...x._items):M.push(x),M),[]));function N(M){const x=f[M.str];return x===void 0||o[M.str]!==1?M:(delete o[M.str],x)}function F(M){return M instanceof e._Code&&M._items.some(x=>x instanceof e.Name&&o[x.str]===1&&f[x.str]!==void 0)}}function Ze(w,o){for(const f in o)w[f]=(w[f]||0)-(o[f]||0)}function Qe(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,e._)`!${I(w)}`}t.not=Qe;const dt=$(t.operators.AND);function kt(...w){return w.reduce(dt)}t.and=kt;const pt=$(t.operators.OR);function q(...w){return w.reduce(pt)}t.or=q;function $(w){return(o,f)=>o===e.nil?f:f===e.nil?o:(0,e._)`${I(o)} ${w} ${I(f)}`}function I(w){return w instanceof e.Name?w:(0,e._)`(${w})`}})(B);var X={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const e=B,r=Yt;function n(_){const O={};for(const A of _)O[A]=!0;return O}t.toHash=n;function s(_,O){return typeof O=="boolean"?O:Object.keys(O).length===0?!0:(i(_,O),!c(O,_.self.RULES.all))}t.alwaysValidSchema=s;function i(_,O=_.schema){const{opts:A,self:z}=_;if(!A.strictSchema||typeof O=="boolean")return;const G=z.RULES.keywords;for(const oe in O)G[oe]||D(_,`unknown keyword: "${oe}"`)}t.checkUnknownRules=i;function c(_,O){if(typeof _=="boolean")return!_;for(const A in _)if(O[A])return!0;return!1}t.schemaHasRules=c;function l(_,O){if(typeof _=="boolean")return!_;for(const A in _)if(A!=="$ref"&&O.all[A])return!0;return!1}t.schemaHasRulesButRef=l;function m({topSchemaRef:_,schemaPath:O},A,z,G){if(!G){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,e._)`${A}`}return(0,e._)`${_}${O}${(0,e.getProperty)(z)}`}t.schemaRefOrVal=m;function u(_){return k(decodeURIComponent(_))}t.unescapeFragment=u;function p(_){return encodeURIComponent(g(_))}t.escapeFragment=p;function g(_){return typeof _=="number"?`${_}`:_.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=g;function k(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=k;function C(_,O){if(Array.isArray(_))for(const A of _)O(A);else O(_)}t.eachItem=C;function E({mergeNames:_,mergeToName:O,mergeValues:A,resultToName:z}){return(G,oe,Z,be)=>{const de=Z===void 0?oe:Z instanceof e.Name?(oe instanceof e.Name?_(G,oe,Z):O(G,oe,Z),Z):oe instanceof e.Name?(O(G,Z,oe),oe):A(oe,Z);return be===e.Name&&!(de instanceof e.Name)?z(G,de):de}}t.mergeEvaluated={props:E({mergeNames:(_,O,A)=>_.if((0,e._)`${A} !== true && ${O} !== undefined`,()=>{_.if((0,e._)`${O} === true`,()=>_.assign(A,!0),()=>_.assign(A,(0,e._)`${A} || {}`).code((0,e._)`Object.assign(${A}, ${O})`))}),mergeToName:(_,O,A)=>_.if((0,e._)`${A} !== true`,()=>{O===!0?_.assign(A,!0):(_.assign(A,(0,e._)`${A} || {}`),v(_,A,O))}),mergeValues:(_,O)=>_===!0?!0:{..._,...O},resultToName:S}),items:E({mergeNames:(_,O,A)=>_.if((0,e._)`${A} !== true && ${O} !== undefined`,()=>_.assign(A,(0,e._)`${O} === true ? true : ${A} > ${O} ? ${A} : ${O}`)),mergeToName:(_,O,A)=>_.if((0,e._)`${A} !== true`,()=>_.assign(A,O===!0?!0:(0,e._)`${A} > ${O} ? ${A} : ${O}`)),mergeValues:(_,O)=>_===!0?!0:Math.max(_,O),resultToName:(_,O)=>_.var("items",O)})};function S(_,O){if(O===!0)return _.var("props",!0);const A=_.var("props",(0,e._)`{}`);return O!==void 0&&v(_,A,O),A}t.evaluatedPropsToName=S;function v(_,O,A){Object.keys(A).forEach(z=>_.assign((0,e._)`${O}${(0,e.getProperty)(z)}`,!0))}t.setEvaluated=v;const y={};function T(_,O){return _.scopeValue("func",{ref:O,code:y[O.code]||(y[O.code]=new r._Code(O.code))})}t.useFunc=T;var R;(function(_){_[_.Num=0]="Num",_[_.Str=1]="Str"})(R=t.Type||(t.Type={}));function j(_,O,A){if(_ instanceof e.Name){const z=O===R.Num;return A?z?(0,e._)`"[" + ${_} + "]"`:(0,e._)`"['" + ${_} + "']"`:z?(0,e._)`"/" + ${_}`:(0,e._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,e.getProperty)(_).toString():"/"+g(_)}t.getErrorPath=j;function D(_,O,A=_.opts.strictSchema){if(A){if(O=`strict mode: ${O}`,A===!0)throw new Error(O);_.self.logger.warn(O)}}t.checkStrictMode=D})(X);var He={};Object.defineProperty(He,"__esModule",{value:!0});const ye=B,Go={data:new ye.Name("data"),valCxt:new ye.Name("valCxt"),instancePath:new ye.Name("instancePath"),parentData:new ye.Name("parentData"),parentDataProperty:new ye.Name("parentDataProperty"),rootData:new ye.Name("rootData"),dynamicAnchors:new ye.Name("dynamicAnchors"),vErrors:new ye.Name("vErrors"),errors:new ye.Name("errors"),this:new ye.Name("this"),self:new ye.Name("self"),scope:new ye.Name("scope"),json:new ye.Name("json"),jsonPos:new ye.Name("jsonPos"),jsonLen:new ye.Name("jsonLen"),jsonPart:new ye.Name("jsonPart")};He.default=Go;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=B,r=X,n=He;t.keywordError={message:({keyword:v})=>(0,e.str)`must pass "${v}" keyword validation`},t.keyword$DataError={message:({keyword:v,schemaType:y})=>y?(0,e.str)`"${v}" keyword must be ${y} ($data)`:(0,e.str)`"${v}" keyword is invalid ($data)`};function s(v,y=t.keywordError,T,R){const{it:j}=v,{gen:D,compositeRule:_,allErrors:O}=j,A=g(v,y,T);R??(_||O)?m(D,A):u(j,(0,e._)`[${A}]`)}t.reportError=s;function i(v,y=t.keywordError,T){const{it:R}=v,{gen:j,compositeRule:D,allErrors:_}=R,O=g(v,y,T);m(j,O),D||_||u(R,n.default.vErrors)}t.reportExtraError=i;function c(v,y){v.assign(n.default.errors,y),v.if((0,e._)`${n.default.vErrors} !== null`,()=>v.if(y,()=>v.assign((0,e._)`${n.default.vErrors}.length`,y),()=>v.assign(n.default.vErrors,null)))}t.resetErrorsCount=c;function l({gen:v,keyword:y,schemaValue:T,data:R,errsCount:j,it:D}){if(j===void 0)throw new Error("ajv implementation error");const _=v.name("err");v.forRange("i",j,n.default.errors,O=>{v.const(_,(0,e._)`${n.default.vErrors}[${O}]`),v.if((0,e._)`${_}.instancePath === undefined`,()=>v.assign((0,e._)`${_}.instancePath`,(0,e.strConcat)(n.default.instancePath,D.errorPath))),v.assign((0,e._)`${_}.schemaPath`,(0,e.str)`${D.errSchemaPath}/${y}`),D.opts.verbose&&(v.assign((0,e._)`${_}.schema`,T),v.assign((0,e._)`${_}.data`,R))})}t.extendErrors=l;function m(v,y){const T=v.const("err",y);v.if((0,e._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,e._)`[${T}]`),(0,e._)`${n.default.vErrors}.push(${T})`),v.code((0,e._)`${n.default.errors}++`)}function u(v,y){const{gen:T,validateName:R,schemaEnv:j}=v;j.$async?T.throw((0,e._)`new ${v.ValidationError}(${y})`):(T.assign((0,e._)`${R}.errors`,y),T.return(!1))}const p={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function g(v,y,T){const{createErrors:R}=v.it;return R===!1?(0,e._)`{}`:k(v,y,T)}function k(v,y,T={}){const{gen:R,it:j}=v,D=[C(j,T),E(v,T)];return S(v,y,D),R.object(...D)}function C({errorPath:v},{instancePath:y}){const T=y?(0,e.str)`${v}${(0,r.getErrorPath)(y,r.Type.Str)}`:v;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,T)]}function E({keyword:v,it:{errSchemaPath:y}},{schemaPath:T,parentSchema:R}){let j=R?y:(0,e.str)`${y}/${v}`;return T&&(j=(0,e.str)`${j}${(0,r.getErrorPath)(T,r.Type.Str)}`),[p.schemaPath,j]}function S(v,{params:y,message:T},R){const{keyword:j,data:D,schemaValue:_,it:O}=v,{opts:A,propertyName:z,topSchemaRef:G,schemaPath:oe}=O;R.push([p.keyword,j],[p.params,typeof y=="function"?y(v):y||(0,e._)`{}`]),A.messages&&R.push([p.message,typeof T=="function"?T(v):T]),A.verbose&&R.push([p.schema,_],[p.parentSchema,(0,e._)`${G}${oe}`],[n.default.data,D]),z&&R.push([p.propertyName,z])}})(Zt);Object.defineProperty(Ot,"__esModule",{value:!0});Ot.boolOrEmptySchema=Ot.topBoolOrEmptySchema=void 0;const xo=Zt,Jo=B,Yo=He,Zo={message:"boolean schema is false"};function Qo(t){const{gen:e,schema:r,validateName:n}=t;r===!1?ni(t,!1):typeof r=="object"&&r.$async===!0?e.return(Yo.default.data):(e.assign((0,Jo._)`${n}.errors`,null),e.return(!0))}Ot.topBoolOrEmptySchema=Qo;function Xo(t,e){const{gen:r,schema:n}=t;n===!1?(r.var(e,!1),ni(t)):r.var(e,!0)}Ot.boolOrEmptySchema=Xo;function ni(t,e){const{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,xo.reportError)(s,Zo,void 0,e)}var Qt={},ct={};Object.defineProperty(ct,"__esModule",{value:!0});ct.getRules=ct.isJSONType=void 0;const ea=["string","number","integer","boolean","null","object","array"],ta=new Set(ea);function ra(t){return typeof t=="string"&&ta.has(t)}ct.isJSONType=ra;function na(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}ct.getRules=na;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.shouldUseRule=ze.shouldUseGroup=ze.schemaHasRulesForType=void 0;function sa({schema:t,self:e},r){const n=e.RULES.types[r];return n&&n!==!0&&si(t,n)}ze.schemaHasRulesForType=sa;function si(t,e){return e.rules.some(r=>ii(t,r))}ze.shouldUseGroup=si;function ii(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ze.shouldUseRule=ii;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const e=ct,r=ze,n=Zt,s=B,i=X;var c;(function(R){R[R.Correct=0]="Correct",R[R.Wrong=1]="Wrong"})(c=t.DataType||(t.DataType={}));function l(R){const j=m(R.type);if(j.includes("null")){if(R.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&R.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');R.nullable===!0&&j.push("null")}return j}t.getSchemaTypes=l;function m(R){const j=Array.isArray(R)?R:R?[R]:[];if(j.every(e.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}t.getJSONTypes=m;function u(R,j){const{gen:D,data:_,opts:O}=R,A=g(j,O.coerceTypes),z=j.length>0&&!(A.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(R,j[0]));if(z){const G=S(j,_,O.strictNumbers,c.Wrong);D.if(G,()=>{A.length?k(R,j,A):y(R)})}return z}t.coerceAndCheckDataType=u;const p=new Set(["string","number","integer","boolean","null"]);function g(R,j){return j?R.filter(D=>p.has(D)||j==="array"&&D==="array"):[]}function k(R,j,D){const{gen:_,data:O,opts:A}=R,z=_.let("dataType",(0,s._)`typeof ${O}`),G=_.let("coerced",(0,s._)`undefined`);A.coerceTypes==="array"&&_.if((0,s._)`${z} == 'object' && Array.isArray(${O}) && ${O}.length == 1`,()=>_.assign(O,(0,s._)`${O}[0]`).assign(z,(0,s._)`typeof ${O}`).if(S(j,O,A.strictNumbers),()=>_.assign(G,O))),_.if((0,s._)`${G} !== undefined`);for(const Z of D)(p.has(Z)||Z==="array"&&A.coerceTypes==="array")&&oe(Z);_.else(),y(R),_.endIf(),_.if((0,s._)`${G} !== undefined`,()=>{_.assign(O,G),C(R,G)});function oe(Z){switch(Z){case"string":_.elseIf((0,s._)`${z} == "number" || ${z} == "boolean"`).assign(G,(0,s._)`"" + ${O}`).elseIf((0,s._)`${O} === null`).assign(G,(0,s._)`""`);return;case"number":_.elseIf((0,s._)`${z} == "boolean" || ${O} === null
479
+ || (${z} == "string" && ${O} && ${O} == +${O})`).assign(G,(0,s._)`+${O}`);return;case"integer":_.elseIf((0,s._)`${z} === "boolean" || ${O} === null
480
+ || (${z} === "string" && ${O} && ${O} == +${O} && !(${O} % 1))`).assign(G,(0,s._)`+${O}`);return;case"boolean":_.elseIf((0,s._)`${O} === "false" || ${O} === 0 || ${O} === null`).assign(G,!1).elseIf((0,s._)`${O} === "true" || ${O} === 1`).assign(G,!0);return;case"null":_.elseIf((0,s._)`${O} === "" || ${O} === 0 || ${O} === false`),_.assign(G,null);return;case"array":_.elseIf((0,s._)`${z} === "string" || ${z} === "number"
481
+ || ${z} === "boolean" || ${O} === null`).assign(G,(0,s._)`[${O}]`)}}}function C({gen:R,parentData:j,parentDataProperty:D},_){R.if((0,s._)`${j} !== undefined`,()=>R.assign((0,s._)`${j}[${D}]`,_))}function E(R,j,D,_=c.Correct){const O=_===c.Correct?s.operators.EQ:s.operators.NEQ;let A;switch(R){case"null":return(0,s._)`${j} ${O} null`;case"array":A=(0,s._)`Array.isArray(${j})`;break;case"object":A=(0,s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":A=z((0,s._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":A=z();break;default:return(0,s._)`typeof ${j} ${O} ${R}`}return _===c.Correct?A:(0,s.not)(A);function z(G=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,G,D?(0,s._)`isFinite(${j})`:s.nil)}}t.checkDataType=E;function S(R,j,D,_){if(R.length===1)return E(R[0],j,D,_);let O;const A=(0,i.toHash)(R);if(A.array&&A.object){const z=(0,s._)`typeof ${j} != "object"`;O=A.null?z:(0,s._)`!${j} || ${z}`,delete A.null,delete A.array,delete A.object}else O=s.nil;A.number&&delete A.integer;for(const z in A)O=(0,s.and)(O,E(z,j,D,_));return O}t.checkDataTypes=S;const v={message:({schema:R})=>`must be ${R}`,params:({schema:R,schemaValue:j})=>typeof R=="string"?(0,s._)`{type: ${R}}`:(0,s._)`{type: ${j}}`};function y(R){const j=T(R);(0,n.reportError)(j,v)}t.reportTypeError=y;function T(R){const{gen:j,data:D,schema:_}=R,O=(0,i.schemaRefOrVal)(R,_,"type");return{gen:j,keyword:"type",data:D,schema:_.type,schemaCode:O,schemaValue:O,parentSchema:_,params:{},it:R}}})(Qt);var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.assignDefaults=void 0;const wt=B,ia=X;function oa(t,e){const{properties:r,items:n}=t.schema;if(e==="object"&&r)for(const s in r)os(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>os(t,i,s.default))}Pr.assignDefaults=oa;function os(t,e,r){const{gen:n,compositeRule:s,data:i,opts:c}=t;if(r===void 0)return;const l=(0,wt._)`${i}${(0,wt.getProperty)(e)}`;if(s){(0,ia.checkStrictMode)(t,`default is ignored for: ${l}`);return}let m=(0,wt._)`${l} === undefined`;c.useDefaults==="empty"&&(m=(0,wt._)`${m} || ${l} === null || ${l} === ""`),n.if(m,(0,wt._)`${l} = ${(0,wt.stringify)(r)}`)}var Le={},K={};Object.defineProperty(K,"__esModule",{value:!0});K.validateUnion=K.validateArray=K.usePattern=K.callValidateCode=K.schemaProperties=K.allSchemaProperties=K.noPropertyInData=K.propertyInData=K.isOwnProperty=K.hasPropFunc=K.reportMissingProp=K.checkMissingProp=K.checkReportMissingProp=void 0;const ne=B,Yr=X,Ge=He,aa=X;function ca(t,e){const{gen:r,data:n,it:s}=t;r.if(Qr(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ne._)`${e}`},!0),t.error()})}K.checkReportMissingProp=ca;function la({gen:t,data:e,it:{opts:r}},n,s){return(0,ne.or)(...n.map(i=>(0,ne.and)(Qr(t,e,i,r.ownProperties),(0,ne._)`${s} = ${i}`)))}K.checkMissingProp=la;function ua(t,e){t.setParams({missingProperty:e},!0),t.error()}K.reportMissingProp=ua;function oi(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ne._)`Object.prototype.hasOwnProperty`})}K.hasPropFunc=oi;function Zr(t,e,r){return(0,ne._)`${oi(t)}.call(${e}, ${r})`}K.isOwnProperty=Zr;function da(t,e,r,n){const s=(0,ne._)`${e}${(0,ne.getProperty)(r)} !== undefined`;return n?(0,ne._)`${s} && ${Zr(t,e,r)}`:s}K.propertyInData=da;function Qr(t,e,r,n){const s=(0,ne._)`${e}${(0,ne.getProperty)(r)} === undefined`;return n?(0,ne.or)(s,(0,ne.not)(Zr(t,e,r))):s}K.noPropertyInData=Qr;function ai(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}K.allSchemaProperties=ai;function pa(t,e){return ai(e).filter(r=>!(0,Yr.alwaysValidSchema)(t,e[r]))}K.schemaProperties=pa;function fa({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:c},l,m,u){const p=u?(0,ne._)`${t}, ${e}, ${n}${s}`:e,g=[[Ge.default.instancePath,(0,ne.strConcat)(Ge.default.instancePath,i)],[Ge.default.parentData,c.parentData],[Ge.default.parentDataProperty,c.parentDataProperty],[Ge.default.rootData,Ge.default.rootData]];c.opts.dynamicRef&&g.push([Ge.default.dynamicAnchors,Ge.default.dynamicAnchors]);const k=(0,ne._)`${p}, ${r.object(...g)}`;return m!==ne.nil?(0,ne._)`${l}.call(${m}, ${k})`:(0,ne._)`${l}(${k})`}K.callValidateCode=fa;const ha=(0,ne._)`new RegExp`;function ma({gen:t,it:{opts:e}},r){const n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ne._)`${s.code==="new RegExp"?ha:(0,aa.useFunc)(t,s)}(${r}, ${n})`})}K.usePattern=ma;function ya(t){const{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){const l=e.let("valid",!0);return c(()=>e.assign(l,!1)),l}return e.var(i,!0),c(()=>e.break()),i;function c(l){const m=e.const("len",(0,ne._)`${r}.length`);e.forRange("i",0,m,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Yr.Type.Num},i),e.if((0,ne.not)(i),l)})}}K.validateArray=ya;function ga(t){const{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(m=>(0,Yr.alwaysValidSchema)(s,m))&&!s.opts.unevaluated)return;const c=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((m,u)=>{const p=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);e.assign(c,(0,ne._)`${c} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,ne.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}K.validateUnion=ga;Object.defineProperty(Le,"__esModule",{value:!0});Le.validateKeywordUsage=Le.validSchemaType=Le.funcKeywordCode=Le.macroKeywordCode=void 0;const ge=B,st=He,$a=K,va=Zt;function _a(t,e){const{gen:r,keyword:n,schema:s,parentSchema:i,it:c}=t,l=e.macro.call(c.self,s,i,c),m=ci(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);const u=r.name("valid");t.subschema({schema:l,schemaPath:ge.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:m,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Le.macroKeywordCode=_a;function wa(t,e){var r;const{gen:n,keyword:s,schema:i,parentSchema:c,$data:l,it:m}=t;Pa(m,e);const u=!l&&e.compile?e.compile.call(m.self,i,c,m):e.validate,p=ci(n,s,u),g=n.let("valid");t.block$data(g,k),t.ok((r=e.valid)!==null&&r!==void 0?r:g);function k(){if(e.errors===!1)S(),e.modifying&&as(t),v(()=>t.error());else{const y=e.async?C():E();e.modifying&&as(t),v(()=>ba(t,y))}}function C(){const y=n.let("ruleErrs",null);return n.try(()=>S((0,ge._)`await `),T=>n.assign(g,!1).if((0,ge._)`${T} instanceof ${m.ValidationError}`,()=>n.assign(y,(0,ge._)`${T}.errors`),()=>n.throw(T))),y}function E(){const y=(0,ge._)`${p}.errors`;return n.assign(y,null),S(ge.nil),y}function S(y=e.async?(0,ge._)`await `:ge.nil){const T=m.opts.passContext?st.default.this:st.default.self,R=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,ge._)`${y}${(0,$a.callValidateCode)(t,p,T,R)}`,e.modifying)}function v(y){var T;n.if((0,ge.not)((T=e.valid)!==null&&T!==void 0?T:g),y)}}Le.funcKeywordCode=wa;function as(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,ge._)`${n.parentData}[${n.parentDataProperty}]`))}function ba(t,e){const{gen:r}=t;r.if((0,ge._)`Array.isArray(${e})`,()=>{r.assign(st.default.vErrors,(0,ge._)`${st.default.vErrors} === null ? ${e} : ${st.default.vErrors}.concat(${e})`).assign(st.default.errors,(0,ge._)`${st.default.vErrors}.length`),(0,va.extendErrors)(t)},()=>t.error())}function Pa({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function ci(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ge.stringify)(r)})}function Ea(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Le.validSchemaType=Ea;function Sa({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");const c=s.dependencies;if(c?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${i}: ${c.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){const m=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(m);else throw new Error(m)}}Le.validateKeywordUsage=Sa;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.extendSubschemaMode=Ye.extendSubschemaData=Ye.getSubschema=void 0;const Ue=B,li=X;function Ta(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:c}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,Ue._)`${t.schemaPath}${(0,Ue.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Ue._)`${t.schemaPath}${(0,Ue.getProperty)(e)}${(0,Ue.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,li.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:c,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ye.getSubschema=Ta;function Ra(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:c}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=e;if(r!==void 0){const{errorPath:u,dataPathArr:p,opts:g}=e,k=l.let("data",(0,Ue._)`${e.data}${(0,Ue.getProperty)(r)}`,!0);m(k),t.errorPath=(0,Ue.str)`${u}${(0,li.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,Ue._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(s!==void 0){const u=s instanceof Ue.Name?s:l.let("data",s,!0);m(u),c!==void 0&&(t.propertyName=c)}i&&(t.dataTypes=i);function m(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Ye.extendSubschemaData=Ra;function Oa(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}Ye.extendSubschemaMode=Oa;var he={},ui=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var c=i[s];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r},di={exports:{}},Je=di.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};pr(e,n,s,t,"",t)};Je.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Je.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Je.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Je.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function pr(t,e,r,n,s,i,c,l,m,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,c,l,m,u);for(var p in n){var g=n[p];if(Array.isArray(g)){if(p in Je.arrayKeywords)for(var k=0;k<g.length;k++)pr(t,e,r,g[k],s+"/"+p+"/"+k,i,s,p,n,k)}else if(p in Je.propsKeywords){if(g&&typeof g=="object")for(var C in g)pr(t,e,r,g[C],s+"/"+p+"/"+Na(C),i,s,p,n,C)}else(p in Je.keywords||t.allKeys&&!(p in Je.skipKeywords))&&pr(t,e,r,g,s+"/"+p,i,s,p,n)}r(n,s,i,c,l,m,u)}}function Na(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var Ca=di.exports;Object.defineProperty(he,"__esModule",{value:!0});he.getSchemaRefs=he.resolveUrl=he.normalizeId=he._getFullPath=he.getFullPath=he.inlineRef=void 0;const ja=X,ka=ui,Ia=Ca,Aa=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Da(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Fr(t):e?pi(t)<=e:!1}he.inlineRef=Da;const qa=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Fr(t){for(const e in t){if(qa.has(e))return!0;const r=t[e];if(Array.isArray(r)&&r.some(Fr)||typeof r=="object"&&Fr(r))return!0}return!1}function pi(t){let e=0;for(const r in t){if(r==="$ref")return 1/0;if(e++,!Aa.has(r)&&(typeof t[r]=="object"&&(0,ja.eachItem)(t[r],n=>e+=pi(n)),e===1/0))return 1/0}return e}function fi(t,e="",r){r!==!1&&(e=Tt(e));const n=t.parse(e);return hi(t,n)}he.getFullPath=fi;function hi(t,e){return t.serialize(e).split("#")[0]+"#"}he._getFullPath=hi;const Fa=/#\/?$/;function Tt(t){return t?t.replace(Fa,""):""}he.normalizeId=Tt;function Ma(t,e,r){return r=Tt(r),t.resolve(e,r)}he.resolveUrl=Ma;const Ua=/^[a-z_][-a-z0-9._]*$/i;function La(t,e){if(typeof t=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Tt(t[r]||e),i={"":s},c=fi(n,s,!1),l={},m=new Set;return Ia(t,{allKeys:!0},(g,k,C,E)=>{if(E===void 0)return;const S=c+k;let v=i[E];typeof g[r]=="string"&&(v=y.call(this,g[r])),T.call(this,g.$anchor),T.call(this,g.$dynamicAnchor),i[k]=v;function y(R){const j=this.opts.uriResolver.resolve;if(R=Tt(v?j(v,R):R),m.has(R))throw p(R);m.add(R);let D=this.refs[R];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?u(g,D.schema,R):R!==Tt(S)&&(R[0]==="#"?(u(g,l[R],R),l[R]=g):this.refs[R]=S),R}function T(R){if(typeof R=="string"){if(!Ua.test(R))throw new Error(`invalid anchor "${R}"`);y.call(this,`#${R}`)}}}),l;function u(g,k,C){if(k!==void 0&&!ka(g,k))throw p(C)}function p(g){return new Error(`reference "${g}" resolves to more than one schema`)}}he.getSchemaRefs=La;Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getData=Ne.KeywordCxt=Ne.validateFunctionCode=void 0;const mi=Ot,cs=Qt,Xr=ze,yr=Qt,Ha=Pr,Kt=Le,Nr=Ye,U=B,V=He,Va=he,We=X,Vt=Zt;function za(t){if($i(t)&&(vi(t),gi(t))){Ba(t);return}yi(t,()=>(0,mi.topBoolOrEmptySchema)(t))}Ne.validateFunctionCode=za;function yi({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,U._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{t.code((0,U._)`"use strict"; ${ls(r,s)}`),Ka(t,s),t.code(i)}):t.func(e,(0,U._)`${V.default.data}, ${Wa(s)}`,n.$async,()=>t.code(ls(r,s)).code(i))}function Wa(t){return(0,U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${t.dynamicRef?(0,U._)`, ${V.default.dynamicAnchors}={}`:U.nil}}={}`}function Ka(t,e){t.if(V.default.valCxt,()=>{t.var(V.default.instancePath,(0,U._)`${V.default.valCxt}.${V.default.instancePath}`),t.var(V.default.parentData,(0,U._)`${V.default.valCxt}.${V.default.parentData}`),t.var(V.default.parentDataProperty,(0,U._)`${V.default.valCxt}.${V.default.parentDataProperty}`),t.var(V.default.rootData,(0,U._)`${V.default.valCxt}.${V.default.rootData}`),e.dynamicRef&&t.var(V.default.dynamicAnchors,(0,U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{t.var(V.default.instancePath,(0,U._)`""`),t.var(V.default.parentData,(0,U._)`undefined`),t.var(V.default.parentDataProperty,(0,U._)`undefined`),t.var(V.default.rootData,V.default.data),e.dynamicRef&&t.var(V.default.dynamicAnchors,(0,U._)`{}`)})}function Ba(t){const{schema:e,opts:r,gen:n}=t;yi(t,()=>{r.$comment&&e.$comment&&wi(t),Za(t),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&Ga(t),_i(t),ec(t)})}function Ga(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,U._)`${r}.evaluated`),e.if((0,U._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,U._)`${t.evaluated}.props`,(0,U._)`undefined`)),e.if((0,U._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,U._)`${t.evaluated}.items`,(0,U._)`undefined`))}function ls(t,e){const r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function xa(t,e){if($i(t)&&(vi(t),gi(t))){Ja(t,e);return}(0,mi.boolOrEmptySchema)(t,e)}function gi({schema:t,self:e}){if(typeof t=="boolean")return!t;for(const r in t)if(e.RULES.all[r])return!0;return!1}function $i(t){return typeof t.schema!="boolean"}function Ja(t,e){const{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&wi(t),Qa(t),Xa(t);const i=n.const("_errs",V.default.errors);_i(t,i),n.var(e,(0,U._)`${i} === ${V.default.errors}`)}function vi(t){(0,We.checkUnknownRules)(t),Ya(t)}function _i(t,e){if(t.opts.jtd)return us(t,[],!1,e);const r=(0,cs.getSchemaTypes)(t.schema),n=(0,cs.coerceAndCheckDataType)(t,r);us(t,r,!n,e)}function Ya(t){const{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,We.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Za(t){const{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,We.checkStrictMode)(t,"default is ignored in the schema root")}function Qa(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Va.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Xa(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function wi({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)t.code((0,U._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const c=(0,U.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,U._)`${V.default.self}.opts.$comment(${i}, ${c}, ${l}.schema)`)}}function ec(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,U._)`${V.default.errors} === 0`,()=>e.return(V.default.data),()=>e.throw((0,U._)`new ${s}(${V.default.vErrors})`)):(e.assign((0,U._)`${n}.errors`,V.default.vErrors),i.unevaluated&&tc(t),e.return((0,U._)`${V.default.errors} === 0`))}function tc({gen:t,evaluated:e,props:r,items:n}){r instanceof U.Name&&t.assign((0,U._)`${e}.props`,r),n instanceof U.Name&&t.assign((0,U._)`${e}.items`,n)}function us(t,e,r,n){const{gen:s,schema:i,data:c,allErrors:l,opts:m,self:u}=t,{RULES:p}=u;if(i.$ref&&(m.ignoreKeywordsWithRef||!(0,We.schemaHasRulesButRef)(i,p))){s.block(()=>Ei(t,"$ref",p.all.$ref.definition));return}m.jtd||rc(t,e),s.block(()=>{for(const k of p.rules)g(k);g(p.post)});function g(k){(0,Xr.shouldUseGroup)(i,k)&&(k.type?(s.if((0,yr.checkDataType)(k.type,c,m.strictNumbers)),ds(t,k),e.length===1&&e[0]===k.type&&r&&(s.else(),(0,yr.reportTypeError)(t)),s.endIf()):ds(t,k),l||s.if((0,U._)`${V.default.errors} === ${n||0}`))}}function ds(t,e){const{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,Ha.assignDefaults)(t,e.type),r.block(()=>{for(const i of e.rules)(0,Xr.shouldUseRule)(n,i)&&Ei(t,i.keyword,i.definition,e.type)})}function rc(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(nc(t,e),t.opts.allowUnionTypes||sc(t,e),ic(t,t.dataTypes))}function nc(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{bi(t.dataTypes,r)||en(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),ac(t,e)}}function sc(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&en(t,"use allowUnionTypes to allow union type keyword")}function ic(t,e){const r=t.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Xr.shouldUseRule)(t.schema,s)){const{type:i}=s.definition;i.length&&!i.some(c=>oc(e,c))&&en(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function oc(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function bi(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function ac(t,e){const r=[];for(const n of t.dataTypes)bi(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function en(t,e){const r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,We.checkStrictMode)(t,e,t.opts.strictTypes)}class Pi{constructor(e,r,n){if((0,Kt.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,We.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Si(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Kt.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",V.default.errors))}result(e,r,n){this.failResult((0,U.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,U.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:r}=this;this.fail((0,U._)`${r} !== undefined && (${(0,U.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Vt.reportExtraError:Vt.reportError)(this,this.def.error,r)}$dataError(){(0,Vt.reportError)(this,this.def.$dataError||Vt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Vt.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=U.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:c}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),e!==U.nil&&n.assign(e,!0),(i.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==U.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,U.or)(c(),l());function c(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const m=Array.isArray(n)?n:[n];return(0,U._)`${(0,yr.checkDataTypes)(m,r,i.opts.strictNumbers,yr.DataType.Wrong)}`}return U.nil}function l(){if(s.validateSchema){const m=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${m}(${r})`}return U.nil}}subschema(e,r){const n=(0,Nr.getSubschema)(this.it,e);(0,Nr.extendSubschemaData)(n,this.it,e),(0,Nr.extendSubschemaMode)(n,e);const s={...this.it,...n,items:void 0,props:void 0};return xa(s,r),s}mergeEvaluated(e,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=We.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=We.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,U.Name)),!0}}Ne.KeywordCxt=Pi;function Ei(t,e,r,n){const s=new Pi(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Kt.funcKeywordCode)(s,r):"macro"in r?(0,Kt.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Kt.funcKeywordCode)(s,r)}const cc=/^\/(?:[^~]|~0|~1)*$/,lc=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Si(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return V.default.rootData;if(t[0]==="/"){if(!cc.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=V.default.rootData}else{const u=lc.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);const p=+u[1];if(s=u[2],s==="#"){if(p>=e)throw new Error(m("property/index",p));return n[e-p]}if(p>e)throw new Error(m("data",p));if(i=r[e-p],!s)return i}let c=i;const l=s.split("/");for(const u of l)u&&(i=(0,U._)`${i}${(0,U.getProperty)((0,We.unescapeJsonPointer)(u))}`,c=(0,U._)`${c} && ${i}`);return c;function m(u,p){return`Cannot access ${u} ${p} levels up, current level is ${e}`}}Ne.getData=Si;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0});class uc extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Xt.default=uc;var er={};Object.defineProperty(er,"__esModule",{value:!0});const Cr=he;class dc extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Cr.resolveUrl)(e,r,n),this.missingSchema=(0,Cr.normalizeId)((0,Cr.getFullPath)(e,this.missingRef))}}er.default=dc;var _e={};Object.defineProperty(_e,"__esModule",{value:!0});_e.resolveSchema=_e.getCompilingSchema=_e.resolveRef=_e.compileSchema=_e.SchemaEnv=void 0;const Te=B,pc=Xt,nt=He,Oe=he,ps=X,fc=Ne;class Er{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Oe.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}}_e.SchemaEnv=Er;function tn(t){const e=Ti.call(this,t);if(e)return e;const r=(0,Oe.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,c=new Te.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let l;t.$async&&(l=c.scopeValue("Error",{ref:pc.default,code:(0,Te._)`require("ajv/dist/runtime/validation_error").default`}));const m=c.scopeName("validate");t.validateName=m;const u={gen:c,allErrors:this.opts.allErrors,data:nt.default.data,parentData:nt.default.parentData,parentDataProperty:nt.default.parentDataProperty,dataNames:[nt.default.data],dataPathArr:[Te.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Te.stringify)(t.schema)}:{ref:t.schema}),validateName:m,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Te.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Te._)`""`,opts:this.opts,self:this};let p;try{this._compilations.add(t),(0,fc.validateFunctionCode)(u),c.optimize(this.opts.code.optimize);const g=c.toString();p=`${c.scopeRefs(nt.default.scope)}return ${g}`,this.opts.code.process&&(p=this.opts.code.process(p,t));const C=new Function(`${nt.default.self}`,`${nt.default.scope}`,p)(this,this.scope.get());if(this.scope.value(m,{ref:C}),C.errors=null,C.schema=t.schema,C.schemaEnv=t,t.$async&&(C.$async=!0),this.opts.code.source===!0&&(C.source={validateName:m,validateCode:g,scopeValues:c._values}),this.opts.unevaluated){const{props:E,items:S}=u;C.evaluated={props:E instanceof Te.Name?void 0:E,items:S instanceof Te.Name?void 0:S,dynamicProps:E instanceof Te.Name,dynamicItems:S instanceof Te.Name},C.source&&(C.source.evaluated=(0,Te.stringify)(C.evaluated))}return t.validate=C,t}catch(g){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),g}finally{this._compilations.delete(t)}}_e.compileSchema=tn;function hc(t,e,r){var n;r=(0,Oe.resolveUrl)(this.opts.uriResolver,e,r);const s=t.refs[r];if(s)return s;let i=gc.call(this,t,r);if(i===void 0){const c=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;c&&(i=new Er({schema:c,schemaId:l,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=mc.call(this,i)}_e.resolveRef=hc;function mc(t){return(0,Oe.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tn.call(this,t)}function Ti(t){for(const e of this._compilations)if(yc(e,t))return e}_e.getCompilingSchema=Ti;function yc(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function gc(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Sr.call(this,t,e)}function Sr(t,e){const r=this.opts.uriResolver.parse(e),n=(0,Oe._getFullPath)(this.opts.uriResolver,r);let s=(0,Oe.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return jr.call(this,r,t);const i=(0,Oe.normalizeId)(n),c=this.refs[i]||this.schemas[i];if(typeof c=="string"){const l=Sr.call(this,t,c);return typeof l?.schema!="object"?void 0:jr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||tn.call(this,c),i===(0,Oe.normalizeId)(e)){const{schema:l}=c,{schemaId:m}=this.opts,u=l[m];return u&&(s=(0,Oe.resolveUrl)(this.opts.uriResolver,s,u)),new Er({schema:l,schemaId:m,root:t,baseId:s})}return jr.call(this,r,c)}}_e.resolveSchema=Sr;const $c=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function jr(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const m=r[(0,ps.unescapeFragment)(l)];if(m===void 0)return;r=m;const u=typeof r=="object"&&r[this.opts.schemaId];!$c.has(l)&&u&&(e=(0,Oe.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,ps.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Oe.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Sr.call(this,n,l)}const{schemaId:c}=this.opts;if(i=i||new Er({schema:r,schemaId:c,root:n,baseId:e}),i.schema!==i.root.schema)return i}const vc="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",_c="Meta-schema for $data reference (JSON AnySchema extension proposal)",wc="object",bc=["$data"],Pc={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ec=!1,Sc={$id:vc,description:_c,type:wc,required:bc,properties:Pc,additionalProperties:Ec};var rn={},Mr={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(r,n){n(e)})(Ko,function(r){function n(){for(var d=arguments.length,a=Array(d),h=0;h<d;h++)a[h]=arguments[h];if(a.length>1){a[0]=a[0].slice(0,-1);for(var P=a.length-1,b=1;b<P;++b)a[b]=a[b].slice(1,-1);return a[P]=a[P].slice(1),a.join("")}else return a[0]}function s(d){return"(?:"+d+")"}function i(d){return d===void 0?"undefined":d===null?"null":Object.prototype.toString.call(d).split(" ").pop().split("]").shift().toLowerCase()}function c(d){return d.toUpperCase()}function l(d){return d!=null?d instanceof Array?d:typeof d.length!="number"||d.split||d.setInterval||d.call?[d]:Array.prototype.slice.call(d):[]}function m(d,a){var h=d;if(a)for(var P in a)h[P]=a[P];return h}function u(d){var a="[A-Za-z]",h="[0-9]",P=n(h,"[A-Fa-f]"),b=s(s("%[EFef]"+P+"%"+P+P+"%"+P+P)+"|"+s("%[89A-Fa-f]"+P+"%"+P+P)+"|"+s("%"+P+P)),L="[\\:\\/\\?\\#\\[\\]\\@]",H="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Q=n(L,H),re=d?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ce=d?"[\\uE000-\\uF8FF]":"[]",J=n(a,h,"[\\-\\.\\_\\~]",re);s(a+n(a,h,"[\\+\\-\\.]")+"*"),s(s(b+"|"+n(J,H,"[\\:]"))+"*");var te=s(s("25[0-5]")+"|"+s("2[0-4]"+h)+"|"+s("1"+h+h)+"|"+s("0?[1-9]"+h)+"|0?0?"+h),le=s(te+"\\."+te+"\\."+te+"\\."+te),W=s(P+"{1,4}"),se=s(s(W+"\\:"+W)+"|"+le),pe=s(s(W+"\\:")+"{6}"+se),ie=s("\\:\\:"+s(W+"\\:")+"{5}"+se),Ke=s(s(W)+"?\\:\\:"+s(W+"\\:")+"{4}"+se),qe=s(s(s(W+"\\:")+"{0,1}"+W)+"?\\:\\:"+s(W+"\\:")+"{3}"+se),Fe=s(s(s(W+"\\:")+"{0,2}"+W)+"?\\:\\:"+s(W+"\\:")+"{2}"+se),vt=s(s(s(W+"\\:")+"{0,3}"+W)+"?\\:\\:"+W+"\\:"+se),tt=s(s(s(W+"\\:")+"{0,4}"+W)+"?\\:\\:"+se),Ee=s(s(s(W+"\\:")+"{0,5}"+W)+"?\\:\\:"+W),Me=s(s(s(W+"\\:")+"{0,6}"+W)+"?\\:\\:"),rt=s([pe,ie,Ke,qe,Fe,vt,tt,Ee,Me].join("|")),Ve=s(s(J+"|"+b)+"+");s("[vV]"+P+"+\\."+n(J,H,"[\\:]")+"+"),s(s(b+"|"+n(J,H))+"*");var Lt=s(b+"|"+n(J,H,"[\\:\\@]"));return s(s(b+"|"+n(J,H,"[\\@]"))+"+"),s(s(Lt+"|"+n("[\\/\\?]",ce))+"*"),{NOT_SCHEME:new RegExp(n("[^]",a,h,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",J,H),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",J,H),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",J,H),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",J,H),"g"),NOT_QUERY:new RegExp(n("[^\\%]",J,H,"[\\:\\@\\/\\?]",ce),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",J,H,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",J,H),"g"),UNRESERVED:new RegExp(J,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",J,Q),"g"),PCT_ENCODED:new RegExp(b,"g"),IPV4ADDRESS:new RegExp("^("+le+")$"),IPV6ADDRESS:new RegExp("^\\[?("+rt+")"+s(s("\\%25|\\%(?!"+P+"{2})")+"("+Ve+")")+"?\\]?$")}}var p=u(!1),g=u(!0),k=function(){function d(a,h){var P=[],b=!0,L=!1,H=void 0;try{for(var Q=a[Symbol.iterator](),re;!(b=(re=Q.next()).done)&&(P.push(re.value),!(h&&P.length===h));b=!0);}catch(ce){L=!0,H=ce}finally{try{!b&&Q.return&&Q.return()}finally{if(L)throw H}}return P}return function(a,h){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a))return d(a,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),C=function(d){if(Array.isArray(d)){for(var a=0,h=Array(d.length);a<d.length;a++)h[a]=d[a];return h}else return Array.from(d)},E=2147483647,S=36,v=1,y=26,T=38,R=700,j=72,D=128,_="-",O=/^xn--/,A=/[^\0-\x7E]/,z=/[\x2E\u3002\uFF0E\uFF61]/g,G={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},oe=S-v,Z=Math.floor,be=String.fromCharCode;function de(d){throw new RangeError(G[d])}function Ze(d,a){for(var h=[],P=d.length;P--;)h[P]=a(d[P]);return h}function Qe(d,a){var h=d.split("@"),P="";h.length>1&&(P=h[0]+"@",d=h[1]),d=d.replace(z,".");var b=d.split("."),L=Ze(b,a).join(".");return P+L}function dt(d){for(var a=[],h=0,P=d.length;h<P;){var b=d.charCodeAt(h++);if(b>=55296&&b<=56319&&h<P){var L=d.charCodeAt(h++);(L&64512)==56320?a.push(((b&1023)<<10)+(L&1023)+65536):(a.push(b),h--)}else a.push(b)}return a}var kt=function(a){return String.fromCodePoint.apply(String,C(a))},pt=function(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:S},q=function(a,h){return a+22+75*(a<26)-((h!=0)<<5)},$=function(a,h,P){var b=0;for(a=P?Z(a/R):a>>1,a+=Z(a/h);a>oe*y>>1;b+=S)a=Z(a/oe);return Z(b+(oe+1)*a/(a+T))},I=function(a){var h=[],P=a.length,b=0,L=D,H=j,Q=a.lastIndexOf(_);Q<0&&(Q=0);for(var re=0;re<Q;++re)a.charCodeAt(re)>=128&&de("not-basic"),h.push(a.charCodeAt(re));for(var ce=Q>0?Q+1:0;ce<P;){for(var J=b,te=1,le=S;;le+=S){ce>=P&&de("invalid-input");var W=pt(a.charCodeAt(ce++));(W>=S||W>Z((E-b)/te))&&de("overflow"),b+=W*te;var se=le<=H?v:le>=H+y?y:le-H;if(W<se)break;var pe=S-se;te>Z(E/pe)&&de("overflow"),te*=pe}var ie=h.length+1;H=$(b-J,ie,J==0),Z(b/ie)>E-L&&de("overflow"),L+=Z(b/ie),b%=ie,h.splice(b++,0,L)}return String.fromCodePoint.apply(String,h)},w=function(a){var h=[];a=dt(a);var P=a.length,b=D,L=0,H=j,Q=!0,re=!1,ce=void 0;try{for(var J=a[Symbol.iterator](),te;!(Q=(te=J.next()).done);Q=!0){var le=te.value;le<128&&h.push(be(le))}}catch(Ht){re=!0,ce=Ht}finally{try{!Q&&J.return&&J.return()}finally{if(re)throw ce}}var W=h.length,se=W;for(W&&h.push(_);se<P;){var pe=E,ie=!0,Ke=!1,qe=void 0;try{for(var Fe=a[Symbol.iterator](),vt;!(ie=(vt=Fe.next()).done);ie=!0){var tt=vt.value;tt>=b&&tt<pe&&(pe=tt)}}catch(Ht){Ke=!0,qe=Ht}finally{try{!ie&&Fe.return&&Fe.return()}finally{if(Ke)throw qe}}var Ee=se+1;pe-b>Z((E-L)/Ee)&&de("overflow"),L+=(pe-b)*Ee,b=pe;var Me=!0,rt=!1,Ve=void 0;try{for(var Lt=a[Symbol.iterator](),zn;!(Me=(zn=Lt.next()).done);Me=!0){var Wn=zn.value;if(Wn<b&&++L>E&&de("overflow"),Wn==b){for(var nr=L,sr=S;;sr+=S){var ir=sr<=H?v:sr>=H+y?y:sr-H;if(nr<ir)break;var Kn=nr-ir,Bn=S-ir;h.push(be(q(ir+Kn%Bn,0))),nr=Z(Kn/Bn)}h.push(be(q(nr,0))),H=$(L,Ee,se==W),L=0,++se}}}catch(Ht){rt=!0,Ve=Ht}finally{try{!Me&&Lt.return&&Lt.return()}finally{if(rt)throw Ve}}++L,++b}return h.join("")},o=function(a){return Qe(a,function(h){return O.test(h)?I(h.slice(4).toLowerCase()):h})},f=function(a){return Qe(a,function(h){return A.test(h)?"xn--"+w(h):h})},N={version:"2.1.0",ucs2:{decode:dt,encode:kt},decode:I,encode:w,toASCII:f,toUnicode:o},F={};function M(d){var a=d.charCodeAt(0),h=void 0;return a<16?h="%0"+a.toString(16).toUpperCase():a<128?h="%"+a.toString(16).toUpperCase():a<2048?h="%"+(a>>6|192).toString(16).toUpperCase()+"%"+(a&63|128).toString(16).toUpperCase():h="%"+(a>>12|224).toString(16).toUpperCase()+"%"+(a>>6&63|128).toString(16).toUpperCase()+"%"+(a&63|128).toString(16).toUpperCase(),h}function x(d){for(var a="",h=0,P=d.length;h<P;){var b=parseInt(d.substr(h+1,2),16);if(b<128)a+=String.fromCharCode(b),h+=3;else if(b>=194&&b<224){if(P-h>=6){var L=parseInt(d.substr(h+4,2),16);a+=String.fromCharCode((b&31)<<6|L&63)}else a+=d.substr(h,6);h+=6}else if(b>=224){if(P-h>=9){var H=parseInt(d.substr(h+4,2),16),Q=parseInt(d.substr(h+7,2),16);a+=String.fromCharCode((b&15)<<12|(H&63)<<6|Q&63)}else a+=d.substr(h,9);h+=9}else a+=d.substr(h,3),h+=3}return a}function Y(d,a){function h(P){var b=x(P);return b.match(a.UNRESERVED)?b:P}return d.scheme&&(d.scheme=String(d.scheme).replace(a.PCT_ENCODED,h).toLowerCase().replace(a.NOT_SCHEME,"")),d.userinfo!==void 0&&(d.userinfo=String(d.userinfo).replace(a.PCT_ENCODED,h).replace(a.NOT_USERINFO,M).replace(a.PCT_ENCODED,c)),d.host!==void 0&&(d.host=String(d.host).replace(a.PCT_ENCODED,h).toLowerCase().replace(a.NOT_HOST,M).replace(a.PCT_ENCODED,c)),d.path!==void 0&&(d.path=String(d.path).replace(a.PCT_ENCODED,h).replace(d.scheme?a.NOT_PATH:a.NOT_PATH_NOSCHEME,M).replace(a.PCT_ENCODED,c)),d.query!==void 0&&(d.query=String(d.query).replace(a.PCT_ENCODED,h).replace(a.NOT_QUERY,M).replace(a.PCT_ENCODED,c)),d.fragment!==void 0&&(d.fragment=String(d.fragment).replace(a.PCT_ENCODED,h).replace(a.NOT_FRAGMENT,M).replace(a.PCT_ENCODED,c)),d}function ae(d){return d.replace(/^0*(.*)/,"$1")||"0"}function Ie(d,a){var h=d.match(a.IPV4ADDRESS)||[],P=k(h,2),b=P[1];return b?b.split(".").map(ae).join("."):d}function ft(d,a){var h=d.match(a.IPV6ADDRESS)||[],P=k(h,3),b=P[1],L=P[2];if(b){for(var H=b.toLowerCase().split("::").reverse(),Q=k(H,2),re=Q[0],ce=Q[1],J=ce?ce.split(":").map(ae):[],te=re.split(":").map(ae),le=a.IPV4ADDRESS.test(te[te.length-1]),W=le?7:8,se=te.length-W,pe=Array(W),ie=0;ie<W;++ie)pe[ie]=J[ie]||te[se+ie]||"";le&&(pe[W-1]=Ie(pe[W-1],a));var Ke=pe.reduce(function(Ee,Me,rt){if(!Me||Me==="0"){var Ve=Ee[Ee.length-1];Ve&&Ve.index+Ve.length===rt?Ve.length++:Ee.push({index:rt,length:1})}return Ee},[]),qe=Ke.sort(function(Ee,Me){return Me.length-Ee.length})[0],Fe=void 0;if(qe&&qe.length>1){var vt=pe.slice(0,qe.index),tt=pe.slice(qe.index+qe.length);Fe=vt.join(":")+"::"+tt.join(":")}else Fe=pe.join(":");return L&&(Fe+="%"+L),Fe}else return d}var It=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,At="".match(/(){0}/)[1]===void 0;function we(d){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h={},P=a.iri!==!1?g:p;a.reference==="suffix"&&(d=(a.scheme?a.scheme+":":"")+"//"+d);var b=d.match(It);if(b){At?(h.scheme=b[1],h.userinfo=b[3],h.host=b[4],h.port=parseInt(b[5],10),h.path=b[6]||"",h.query=b[7],h.fragment=b[8],isNaN(h.port)&&(h.port=b[5])):(h.scheme=b[1]||void 0,h.userinfo=d.indexOf("@")!==-1?b[3]:void 0,h.host=d.indexOf("//")!==-1?b[4]:void 0,h.port=parseInt(b[5],10),h.path=b[6]||"",h.query=d.indexOf("?")!==-1?b[7]:void 0,h.fragment=d.indexOf("#")!==-1?b[8]:void 0,isNaN(h.port)&&(h.port=d.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?b[4]:void 0)),h.host&&(h.host=ft(Ie(h.host,P),P)),h.scheme===void 0&&h.userinfo===void 0&&h.host===void 0&&h.port===void 0&&!h.path&&h.query===void 0?h.reference="same-document":h.scheme===void 0?h.reference="relative":h.fragment===void 0?h.reference="absolute":h.reference="uri",a.reference&&a.reference!=="suffix"&&a.reference!==h.reference&&(h.error=h.error||"URI is not a "+a.reference+" reference.");var L=F[(a.scheme||h.scheme||"").toLowerCase()];if(!a.unicodeSupport&&(!L||!L.unicodeSupport)){if(h.host&&(a.domainHost||L&&L.domainHost))try{h.host=N.toASCII(h.host.replace(P.PCT_ENCODED,x).toLowerCase())}catch(H){h.error=h.error||"Host's domain name can not be converted to ASCII via punycode: "+H}Y(h,p)}else Y(h,P);L&&L.parse&&L.parse(h,a)}else h.error=h.error||"URI can not be parsed.";return h}function Dt(d,a){var h=a.iri!==!1?g:p,P=[];return d.userinfo!==void 0&&(P.push(d.userinfo),P.push("@")),d.host!==void 0&&P.push(ft(Ie(String(d.host),h),h).replace(h.IPV6ADDRESS,function(b,L,H){return"["+L+(H?"%25"+H:"")+"]"})),(typeof d.port=="number"||typeof d.port=="string")&&(P.push(":"),P.push(String(d.port))),P.length?P.join(""):void 0}var ht=/^\.\.?\//,mt=/^\/\.(\/|$)/,yt=/^\/\.\.(\/|$)/,qt=/^\/?(?:.|\n)*?(?=\/|$)/;function Ae(d){for(var a=[];d.length;)if(d.match(ht))d=d.replace(ht,"");else if(d.match(mt))d=d.replace(mt,"/");else if(d.match(yt))d=d.replace(yt,"/"),a.pop();else if(d==="."||d==="..")d="";else{var h=d.match(qt);if(h){var P=h[0];d=d.slice(P.length),a.push(P)}else throw new Error("Unexpected dot segment condition")}return a.join("")}function $e(d){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=a.iri?g:p,P=[],b=F[(a.scheme||d.scheme||"").toLowerCase()];if(b&&b.serialize&&b.serialize(d,a),d.host&&!h.IPV6ADDRESS.test(d.host)){if(a.domainHost||b&&b.domainHost)try{d.host=a.iri?N.toUnicode(d.host):N.toASCII(d.host.replace(h.PCT_ENCODED,x).toLowerCase())}catch(Q){d.error=d.error||"Host's domain name can not be converted to "+(a.iri?"Unicode":"ASCII")+" via punycode: "+Q}}Y(d,h),a.reference!=="suffix"&&d.scheme&&(P.push(d.scheme),P.push(":"));var L=Dt(d,a);if(L!==void 0&&(a.reference!=="suffix"&&P.push("//"),P.push(L),d.path&&d.path.charAt(0)!=="/"&&P.push("/")),d.path!==void 0){var H=d.path;!a.absolutePath&&(!b||!b.absolutePath)&&(H=Ae(H)),L===void 0&&(H=H.replace(/^\/\//,"/%2F")),P.push(H)}return d.query!==void 0&&(P.push("?"),P.push(d.query)),d.fragment!==void 0&&(P.push("#"),P.push(d.fragment)),P.join("")}function gt(d,a){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments[3],b={};return P||(d=we($e(d,h),h),a=we($e(a,h),h)),h=h||{},!h.tolerant&&a.scheme?(b.scheme=a.scheme,b.userinfo=a.userinfo,b.host=a.host,b.port=a.port,b.path=Ae(a.path||""),b.query=a.query):(a.userinfo!==void 0||a.host!==void 0||a.port!==void 0?(b.userinfo=a.userinfo,b.host=a.host,b.port=a.port,b.path=Ae(a.path||""),b.query=a.query):(a.path?(a.path.charAt(0)==="/"?b.path=Ae(a.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?b.path="/"+a.path:d.path?b.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+a.path:b.path=a.path,b.path=Ae(b.path)),b.query=a.query):(b.path=d.path,a.query!==void 0?b.query=a.query:b.query=d.query),b.userinfo=d.userinfo,b.host=d.host,b.port=d.port),b.scheme=d.scheme),b.fragment=a.fragment,b}function Ft(d,a,h){var P=m({scheme:"null"},h);return $e(gt(we(d,P),we(a,P),P,!0),P)}function Xe(d,a){return typeof d=="string"?d=$e(we(d,a),a):i(d)==="object"&&(d=we($e(d,a),a)),d}function Mt(d,a,h){return typeof d=="string"?d=$e(we(d,h),h):i(d)==="object"&&(d=$e(d,h)),typeof a=="string"?a=$e(we(a,h),h):i(a)==="object"&&(a=$e(a,h)),d===a}function rr(d,a){return d&&d.toString().replace(!a||!a.iri?p.ESCAPE:g.ESCAPE,M)}function Pe(d,a){return d&&d.toString().replace(!a||!a.iri?p.PCT_ENCODED:g.PCT_ENCODED,x)}var et={scheme:"http",domainHost:!0,parse:function(a,h){return a.host||(a.error=a.error||"HTTP URIs must have a host."),a},serialize:function(a,h){var P=String(a.scheme).toLowerCase()==="https";return(a.port===(P?443:80)||a.port==="")&&(a.port=void 0),a.path||(a.path="/"),a}},Dn={scheme:"https",domainHost:et.domainHost,parse:et.parse,serialize:et.serialize};function qn(d){return typeof d.secure=="boolean"?d.secure:String(d.scheme).toLowerCase()==="wss"}var Ut={scheme:"ws",domainHost:!0,parse:function(a,h){var P=a;return P.secure=qn(P),P.resourceName=(P.path||"/")+(P.query?"?"+P.query:""),P.path=void 0,P.query=void 0,P},serialize:function(a,h){if((a.port===(qn(a)?443:80)||a.port==="")&&(a.port=void 0),typeof a.secure=="boolean"&&(a.scheme=a.secure?"wss":"ws",a.secure=void 0),a.resourceName){var P=a.resourceName.split("?"),b=k(P,2),L=b[0],H=b[1];a.path=L&&L!=="/"?L:void 0,a.query=H,a.resourceName=void 0}return a.fragment=void 0,a}},Fn={scheme:"wss",domainHost:Ut.domainHost,parse:Ut.parse,serialize:Ut.serialize},Fi={},Mn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",De="[0-9A-Fa-f]",Mi=s(s("%[EFef]"+De+"%"+De+De+"%"+De+De)+"|"+s("%[89A-Fa-f]"+De+"%"+De+De)+"|"+s("%"+De+De)),Ui="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Li="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Hi=n(Li,'[\\"\\\\]'),Vi="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",zi=new RegExp(Mn,"g"),$t=new RegExp(Mi,"g"),Wi=new RegExp(n("[^]",Ui,"[\\.]",'[\\"]',Hi),"g"),Un=new RegExp(n("[^]",Mn,Vi),"g"),Ki=Un;function Rr(d){var a=x(d);return a.match(zi)?a:d}var Ln={scheme:"mailto",parse:function(a,h){var P=a,b=P.to=P.path?P.path.split(","):[];if(P.path=void 0,P.query){for(var L=!1,H={},Q=P.query.split("&"),re=0,ce=Q.length;re<ce;++re){var J=Q[re].split("=");switch(J[0]){case"to":for(var te=J[1].split(","),le=0,W=te.length;le<W;++le)b.push(te[le]);break;case"subject":P.subject=Pe(J[1],h);break;case"body":P.body=Pe(J[1],h);break;default:L=!0,H[Pe(J[0],h)]=Pe(J[1],h);break}}L&&(P.headers=H)}P.query=void 0;for(var se=0,pe=b.length;se<pe;++se){var ie=b[se].split("@");if(ie[0]=Pe(ie[0]),h.unicodeSupport)ie[1]=Pe(ie[1],h).toLowerCase();else try{ie[1]=N.toASCII(Pe(ie[1],h).toLowerCase())}catch(Ke){P.error=P.error||"Email address's domain name can not be converted to ASCII via punycode: "+Ke}b[se]=ie.join("@")}return P},serialize:function(a,h){var P=a,b=l(a.to);if(b){for(var L=0,H=b.length;L<H;++L){var Q=String(b[L]),re=Q.lastIndexOf("@"),ce=Q.slice(0,re).replace($t,Rr).replace($t,c).replace(Wi,M),J=Q.slice(re+1);try{J=h.iri?N.toUnicode(J):N.toASCII(Pe(J,h).toLowerCase())}catch(se){P.error=P.error||"Email address's domain name can not be converted to "+(h.iri?"Unicode":"ASCII")+" via punycode: "+se}b[L]=ce+"@"+J}P.path=b.join(",")}var te=a.headers=a.headers||{};a.subject&&(te.subject=a.subject),a.body&&(te.body=a.body);var le=[];for(var W in te)te[W]!==Fi[W]&&le.push(W.replace($t,Rr).replace($t,c).replace(Un,M)+"="+te[W].replace($t,Rr).replace($t,c).replace(Ki,M));return le.length&&(P.query=le.join("&")),P}},Bi=/^([^\:]+)\:(.*)/,Hn={scheme:"urn",parse:function(a,h){var P=a.path&&a.path.match(Bi),b=a;if(P){var L=h.scheme||b.scheme||"urn",H=P[1].toLowerCase(),Q=P[2],re=L+":"+(h.nid||H),ce=F[re];b.nid=H,b.nss=Q,b.path=void 0,ce&&(b=ce.parse(b,h))}else b.error=b.error||"URN can not be parsed.";return b},serialize:function(a,h){var P=h.scheme||a.scheme||"urn",b=a.nid,L=P+":"+(h.nid||b),H=F[L];H&&(a=H.serialize(a,h));var Q=a,re=a.nss;return Q.path=(b||h.nid)+":"+re,Q}},Gi=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Vn={scheme:"urn:uuid",parse:function(a,h){var P=a;return P.uuid=P.nss,P.nss=void 0,!h.tolerant&&(!P.uuid||!P.uuid.match(Gi))&&(P.error=P.error||"UUID is not valid."),P},serialize:function(a,h){var P=a;return P.nss=(a.uuid||"").toLowerCase(),P}};F[et.scheme]=et,F[Dn.scheme]=Dn,F[Ut.scheme]=Ut,F[Fn.scheme]=Fn,F[Ln.scheme]=Ln,F[Hn.scheme]=Hn,F[Vn.scheme]=Vn,r.SCHEMES=F,r.pctEncChar=M,r.pctDecChars=x,r.parse=we,r.removeDotSegments=Ae,r.serialize=$e,r.resolveComponents=gt,r.resolve=Ft,r.normalize=Xe,r.equal=Mt,r.escapeComponent=rr,r.unescapeComponent=Pe,Object.defineProperty(r,"__esModule",{value:!0})})})(Mr,Mr.exports);var Tc=Mr.exports;Object.defineProperty(rn,"__esModule",{value:!0});const Ri=Tc;Ri.code='require("ajv/dist/runtime/uri").default';rn.default=Ri;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Ne;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=B;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Xt,s=er,i=ct,c=_e,l=B,m=he,u=Qt,p=X,g=Sc,k=rn,C=(q,$)=>new RegExp(q,$);C.code="new RegExp";const E=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},T=200;function R(q){var $,I,w,o,f,N,F,M,x,Y,ae,Ie,ft,It,At,we,Dt,ht,mt,yt,qt,Ae,$e,gt,Ft;const Xe=q.strict,Mt=($=q.code)===null||$===void 0?void 0:$.optimize,rr=Mt===!0||Mt===void 0?1:Mt||0,Pe=(w=(I=q.code)===null||I===void 0?void 0:I.regExp)!==null&&w!==void 0?w:C,et=(o=q.uriResolver)!==null&&o!==void 0?o:k.default;return{strictSchema:(N=(f=q.strictSchema)!==null&&f!==void 0?f:Xe)!==null&&N!==void 0?N:!0,strictNumbers:(M=(F=q.strictNumbers)!==null&&F!==void 0?F:Xe)!==null&&M!==void 0?M:!0,strictTypes:(Y=(x=q.strictTypes)!==null&&x!==void 0?x:Xe)!==null&&Y!==void 0?Y:"log",strictTuples:(Ie=(ae=q.strictTuples)!==null&&ae!==void 0?ae:Xe)!==null&&Ie!==void 0?Ie:"log",strictRequired:(It=(ft=q.strictRequired)!==null&&ft!==void 0?ft:Xe)!==null&&It!==void 0?It:!1,code:q.code?{...q.code,optimize:rr,regExp:Pe}:{optimize:rr,regExp:Pe},loopRequired:(At=q.loopRequired)!==null&&At!==void 0?At:T,loopEnum:(we=q.loopEnum)!==null&&we!==void 0?we:T,meta:(Dt=q.meta)!==null&&Dt!==void 0?Dt:!0,messages:(ht=q.messages)!==null&&ht!==void 0?ht:!0,inlineRefs:(mt=q.inlineRefs)!==null&&mt!==void 0?mt:!0,schemaId:(yt=q.schemaId)!==null&&yt!==void 0?yt:"$id",addUsedSchema:(qt=q.addUsedSchema)!==null&&qt!==void 0?qt:!0,validateSchema:(Ae=q.validateSchema)!==null&&Ae!==void 0?Ae:!0,validateFormats:($e=q.validateFormats)!==null&&$e!==void 0?$e:!0,unicodeRegExp:(gt=q.unicodeRegExp)!==null&&gt!==void 0?gt:!0,int32range:(Ft=q.int32range)!==null&&Ft!==void 0?Ft:!0,uriResolver:et}}class j{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...R($)};const{es5:I,lines:w}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:S,es5:I,lines:w}),this.logger=Z($.logger);const o=$.validateFormats;$.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,v,$,"NOT SUPPORTED"),D.call(this,y,$,"DEPRECATED","warn"),this._metaOpts=G.call(this),$.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords&&z.call(this,$.keywords),typeof $.meta=="object"&&this.addMetaSchema($.meta),O.call(this),$.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:$,meta:I,schemaId:w}=this.opts;let o=g;w==="id"&&(o={...g},o.id=o.$id,delete o.$id),I&&$&&this.addMetaSchema(o,o[w],!1)}defaultMeta(){const{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let w;if(typeof $=="string"){if(w=this.getSchema($),!w)throw new Error(`no schema with key or ref "${$}"`)}else w=this.compile($);const o=w(I);return"$async"in w||(this.errors=w.errors),o}compile($,I){const w=this._addSchema($,I);return w.validate||this._compileSchemaEnv(w)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:w}=this.opts;return o.call(this,$,I);async function o(Y,ae){await f.call(this,Y.$schema);const Ie=this._addSchema(Y,ae);return Ie.validate||N.call(this,Ie)}async function f(Y){Y&&!this.getSchema(Y)&&await o.call(this,{$ref:Y},!0)}async function N(Y){try{return this._compileSchemaEnv(Y)}catch(ae){if(!(ae instanceof s.default))throw ae;return F.call(this,ae),await M.call(this,ae.missingSchema),N.call(this,Y)}}function F({missingSchema:Y,missingRef:ae}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${ae} cannot be resolved`)}async function M(Y){const ae=await x.call(this,Y);this.refs[Y]||await f.call(this,ae.$schema),this.refs[Y]||this.addSchema(ae,Y,I)}async function x(Y){const ae=this._loading[Y];if(ae)return ae;try{return await(this._loading[Y]=w(Y))}finally{delete this._loading[Y]}}}addSchema($,I,w,o=this.opts.validateSchema){if(Array.isArray($)){for(const N of $)this.addSchema(N,void 0,w,o);return this}let f;if(typeof $=="object"){const{schemaId:N}=this.opts;if(f=$[N],f!==void 0&&typeof f!="string")throw new Error(`schema ${N} must be string`)}return I=(0,m.normalizeId)(I||f),this._checkUnique(I),this.schemas[I]=this._addSchema($,w,I,o,!0),this}addMetaSchema($,I,w=this.opts.validateSchema){return this.addSchema($,I,!0,w),this}validateSchema($,I){if(typeof $=="boolean")return!0;let w;if(w=$.$schema,w!==void 0&&typeof w!="string")throw new Error("$schema must be a string");if(w=w||this.opts.defaultMeta||this.defaultMeta(),!w)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate(w,$);if(!o&&I){const f="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(f);else throw new Error(f)}return o}getSchema($){let I;for(;typeof(I=_.call(this,$))=="string";)$=I;if(I===void 0){const{schemaId:w}=this.opts,o=new c.SchemaEnv({schema:{},schemaId:w});if(I=c.resolveSchema.call(this,o,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=_.call(this,$);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[$],delete this.refs[$],this}case"object":{const I=$;this._cache.delete(I);let w=$[this.opts.schemaId];return w&&(w=(0,m.normalizeId)(w),delete this.schemas[w],delete this.refs[w]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(const I of $)this.addKeyword(I);return this}addKeyword($,I){let w;if(typeof $=="string")w=$,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=w);else if(typeof $=="object"&&I===void 0){if(I=$,w=I.keyword,Array.isArray(w)&&!w.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(de.call(this,w,I),!I)return(0,p.eachItem)(w,f=>Ze.call(this,f)),this;dt.call(this,I);const o={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,p.eachItem)(w,o.type.length===0?f=>Ze.call(this,f,o):f=>o.type.forEach(N=>Ze.call(this,f,o,N))),this}getKeyword($){const I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){const{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(const w of I.rules){const o=w.rules.findIndex(f=>f.keyword===$);o>=0&&w.rules.splice(o,1)}return this}addFormat($,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:w="data"}={}){return!$||$.length===0?"No errors":$.map(o=>`${w}${o.instancePath} ${o.message}`).reduce((o,f)=>o+I+f)}$dataMetaSchema($,I){const w=this.RULES.all;$=JSON.parse(JSON.stringify($));for(const o of I){const f=o.split("/").slice(1);let N=$;for(const F of f)N=N[F];for(const F in w){const M=w[F];if(typeof M!="object")continue;const{$data:x}=M.definition,Y=N[F];x&&Y&&(N[F]=pt(Y))}}return $}_removeAllSchemas($,I){for(const w in $){const o=$[w];(!I||I.test(w))&&(typeof o=="string"?delete $[w]:o&&!o.meta&&(this._cache.delete(o.schema),delete $[w]))}}_addSchema($,I,w,o=this.opts.validateSchema,f=this.opts.addUsedSchema){let N;const{schemaId:F}=this.opts;if(typeof $=="object")N=$[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof $!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get($);if(M!==void 0)return M;w=(0,m.normalizeId)(N||w);const x=m.getSchemaRefs.call(this,$,w);return M=new c.SchemaEnv({schema:$,schemaId:F,meta:I,baseId:w,localRefs:x}),this._cache.set(M.schema,M),f&&!w.startsWith("#")&&(w&&this._checkUnique(w),this.refs[w]=M),o&&this.validateSchema($,!0),M}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta?this._compileMetaSchema($):c.compileSchema.call(this,$),!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){const I=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,$)}finally{this.opts=I}}}t.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function D(q,$,I,w="error"){for(const o in q){const f=o;f in $&&this.logger[w](`${I}: option ${o}. ${q[f]}`)}}function _(q){return q=(0,m.normalizeId)(q),this.schemas[q]||this.refs[q]}function O(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const $ in q)this.addSchema(q[$],$)}function A(){for(const q in this.opts.formats){const $=this.opts.formats[q];$&&this.addFormat(q,$)}}function z(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const $ in q){const I=q[$];I.keyword||(I.keyword=$),this.addKeyword(I)}}function G(){const q={...this.opts};for(const $ of E)delete q[$];return q}const oe={log(){},warn(){},error(){}};function Z(q){if(q===!1)return oe;if(q===void 0)return console;if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const be=/^[a-z_$][a-z0-9_$:-]*$/i;function de(q,$){const{RULES:I}=this;if((0,p.eachItem)(q,w=>{if(I.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!be.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw new Error('$data keyword must have "code" or "validate" function')}function Ze(q,$,I){var w;const o=$?.post;if(I&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:f}=this;let N=o?f.post:f.rules.find(({type:M})=>M===I);if(N||(N={type:I,rules:[]},f.rules.push(N)),f.keywords[q]=!0,!$)return;const F={keyword:q,definition:{...$,type:(0,u.getJSONTypes)($.type),schemaType:(0,u.getJSONTypes)($.schemaType)}};$.before?Qe.call(this,N,F,$.before):N.rules.push(F),f.all[q]=F,(w=$.implements)===null||w===void 0||w.forEach(M=>this.addKeyword(M))}function Qe(q,$,I){const w=q.rules.findIndex(o=>o.keyword===I);w>=0?q.rules.splice(w,0,$):(q.rules.push($),this.logger.warn(`rule ${I} is not defined`))}function dt(q){let{metaSchema:$}=q;$!==void 0&&(q.$data&&this.opts.$data&&($=pt($)),q.validateSchema=this.compile($,!0))}const kt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pt(q){return{anyOf:[q,kt]}}})(ri);var nn={},sn={},on={};Object.defineProperty(on,"__esModule",{value:!0});const Rc={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};on.default=Rc;var lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.callRef=lt.getValidate=void 0;const Oc=er,fs=K,ve=B,bt=He,hs=_e,or=X,Nc={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:c,opts:l,self:m}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return g();const p=hs.resolveRef.call(m,u,s,r);if(p===void 0)throw new Oc.default(n.opts.uriResolver,s,r);if(p instanceof hs.SchemaEnv)return k(p);return C(p);function g(){if(i===u)return fr(t,c,i,i.$async);const E=e.scopeValue("root",{ref:u});return fr(t,(0,ve._)`${E}.validate`,u,u.$async)}function k(E){const S=Oi(t,E);fr(t,S,E,E.$async)}function C(E){const S=e.scopeValue("schema",l.code.source===!0?{ref:E,code:(0,ve.stringify)(E)}:{ref:E}),v=e.name("valid"),y=t.subschema({schema:E,dataTypes:[],schemaPath:ve.nil,topSchemaRef:S,errSchemaPath:r},v);t.mergeEvaluated(y),t.ok(v)}}};function Oi(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ve._)`${r.scopeValue("wrapper",{ref:e})}.validate`}lt.getValidate=Oi;function fr(t,e,r,n){const{gen:s,it:i}=t,{allErrors:c,schemaEnv:l,opts:m}=i,u=m.passContext?bt.default.this:ve.nil;n?p():g();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");const E=s.let("valid");s.try(()=>{s.code((0,ve._)`await ${(0,fs.callValidateCode)(t,e,u)}`),C(e),c||s.assign(E,!0)},S=>{s.if((0,ve._)`!(${S} instanceof ${i.ValidationError})`,()=>s.throw(S)),k(S),c||s.assign(E,!1)}),t.ok(E)}function g(){t.result((0,fs.callValidateCode)(t,e,u),()=>C(e),()=>k(e))}function k(E){const S=(0,ve._)`${E}.errors`;s.assign(bt.default.vErrors,(0,ve._)`${bt.default.vErrors} === null ? ${S} : ${bt.default.vErrors}.concat(${S})`),s.assign(bt.default.errors,(0,ve._)`${bt.default.vErrors}.length`)}function C(E){var S;if(!i.opts.unevaluated)return;const v=(S=r?.validate)===null||S===void 0?void 0:S.evaluated;if(i.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(i.props=or.mergeEvaluated.props(s,v.props,i.props));else{const y=s.var("props",(0,ve._)`${E}.evaluated.props`);i.props=or.mergeEvaluated.props(s,y,i.props,ve.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=or.mergeEvaluated.items(s,v.items,i.items));else{const y=s.var("items",(0,ve._)`${E}.evaluated.items`);i.items=or.mergeEvaluated.items(s,y,i.items,ve.Name)}}}lt.callRef=fr;lt.default=Nc;Object.defineProperty(sn,"__esModule",{value:!0});const Cc=on,jc=lt,kc=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Cc.default,jc.default];sn.default=kc;var an={},cn={};Object.defineProperty(cn,"__esModule",{value:!0});const gr=B,xe=gr.operators,$r={maximum:{okStr:"<=",ok:xe.LTE,fail:xe.GT},minimum:{okStr:">=",ok:xe.GTE,fail:xe.LT},exclusiveMaximum:{okStr:"<",ok:xe.LT,fail:xe.GTE},exclusiveMinimum:{okStr:">",ok:xe.GT,fail:xe.LTE}},Ic={message:({keyword:t,schemaCode:e})=>(0,gr.str)`must be ${$r[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,gr._)`{comparison: ${$r[t].okStr}, limit: ${e}}`},Ac={keyword:Object.keys($r),type:"number",schemaType:"number",$data:!0,error:Ic,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,gr._)`${r} ${$r[e].fail} ${n} || isNaN(${r})`)}};cn.default=Ac;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});const Bt=B,Dc={message:({schemaCode:t})=>(0,Bt.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Bt._)`{multipleOf: ${t}}`},qc={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Dc,code(t){const{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,c=e.let("res"),l=i?(0,Bt._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${i}`:(0,Bt._)`${c} !== parseInt(${c})`;t.fail$data((0,Bt._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};ln.default=qc;var un={},dn={};Object.defineProperty(dn,"__esModule",{value:!0});function Ni(t){const e=t.length;let r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}dn.default=Ni;Ni.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(un,"__esModule",{value:!0});const it=B,Fc=X,Mc=dn,Uc={message({keyword:t,schemaCode:e}){const r=t==="maxLength"?"more":"fewer";return(0,it.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,it._)`{limit: ${t}}`},Lc={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Uc,code(t){const{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?it.operators.GT:it.operators.LT,c=s.opts.unicode===!1?(0,it._)`${r}.length`:(0,it._)`${(0,Fc.useFunc)(t.gen,Mc.default)}(${r})`;t.fail$data((0,it._)`${c} ${i} ${n}`)}};un.default=Lc;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});const Hc=K,vr=B,Vc={message:({schemaCode:t})=>(0,vr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,vr._)`{pattern: ${t}}`},zc={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Vc,code(t){const{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,c=i.opts.unicodeRegExp?"u":"",l=r?(0,vr._)`(new RegExp(${s}, ${c}))`:(0,Hc.usePattern)(t,n);t.fail$data((0,vr._)`!${l}.test(${e})`)}};pn.default=zc;var fn={};Object.defineProperty(fn,"__esModule",{value:!0});const Gt=B,Wc={message({keyword:t,schemaCode:e}){const r=t==="maxProperties"?"more":"fewer";return(0,Gt.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Gt._)`{limit: ${t}}`},Kc={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Wc,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?Gt.operators.GT:Gt.operators.LT;t.fail$data((0,Gt._)`Object.keys(${r}).length ${s} ${n}`)}};fn.default=Kc;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});const zt=K,xt=B,Bc=X,Gc={message:({params:{missingProperty:t}})=>(0,xt.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,xt._)`{missingProperty: ${t}}`},xc={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Gc,code(t){const{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:c}=t,{opts:l}=c;if(!i&&r.length===0)return;const m=r.length>=l.loopRequired;if(c.allErrors?u():p(),l.strictRequired){const C=t.parentSchema.properties,{definedProperties:E}=t.it;for(const S of r)if(C?.[S]===void 0&&!E.has(S)){const v=c.schemaEnv.baseId+c.errSchemaPath,y=`required property "${S}" is not defined at "${v}" (strictRequired)`;(0,Bc.checkStrictMode)(c,y,c.opts.strictRequired)}}function u(){if(m||i)t.block$data(xt.nil,g);else for(const C of r)(0,zt.checkReportMissingProp)(t,C)}function p(){const C=e.let("missing");if(m||i){const E=e.let("valid",!0);t.block$data(E,()=>k(C,E)),t.ok(E)}else e.if((0,zt.checkMissingProp)(t,r,C)),(0,zt.reportMissingProp)(t,C),e.else()}function g(){e.forOf("prop",n,C=>{t.setParams({missingProperty:C}),e.if((0,zt.noPropertyInData)(e,s,C,l.ownProperties),()=>t.error())})}function k(C,E){t.setParams({missingProperty:C}),e.forOf(C,n,()=>{e.assign(E,(0,zt.propertyInData)(e,s,C,l.ownProperties)),e.if((0,xt.not)(E),()=>{t.error(),e.break()})},xt.nil)}}};hn.default=xc;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});const Jt=B,Jc={message({keyword:t,schemaCode:e}){const r=t==="maxItems"?"more":"fewer";return(0,Jt.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Jt._)`{limit: ${t}}`},Yc={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Jc,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Jt.operators.GT:Jt.operators.LT;t.fail$data((0,Jt._)`${r}.length ${s} ${n}`)}};mn.default=Yc;var yn={},tr={};Object.defineProperty(tr,"__esModule",{value:!0});const Ci=ui;Ci.code='require("ajv/dist/runtime/equal").default';tr.default=Ci;Object.defineProperty(yn,"__esModule",{value:!0});const kr=Qt,fe=B,Zc=X,Qc=tr,Xc={message:({params:{i:t,j:e}})=>(0,fe.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,fe._)`{i: ${t}, j: ${e}}`},el={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Xc,code(t){const{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:c,it:l}=t;if(!n&&!s)return;const m=e.let("valid"),u=i.items?(0,kr.getSchemaTypes)(i.items):[];t.block$data(m,p,(0,fe._)`${c} === false`),t.ok(m);function p(){const E=e.let("i",(0,fe._)`${r}.length`),S=e.let("j");t.setParams({i:E,j:S}),e.assign(m,!0),e.if((0,fe._)`${E} > 1`,()=>(g()?k:C)(E,S))}function g(){return u.length>0&&!u.some(E=>E==="object"||E==="array")}function k(E,S){const v=e.name("item"),y=(0,kr.checkDataTypes)(u,v,l.opts.strictNumbers,kr.DataType.Wrong),T=e.const("indices",(0,fe._)`{}`);e.for((0,fe._)`;${E}--;`,()=>{e.let(v,(0,fe._)`${r}[${E}]`),e.if(y,(0,fe._)`continue`),u.length>1&&e.if((0,fe._)`typeof ${v} == "string"`,(0,fe._)`${v} += "_"`),e.if((0,fe._)`typeof ${T}[${v}] == "number"`,()=>{e.assign(S,(0,fe._)`${T}[${v}]`),t.error(),e.assign(m,!1).break()}).code((0,fe._)`${T}[${v}] = ${E}`)})}function C(E,S){const v=(0,Zc.useFunc)(e,Qc.default),y=e.name("outer");e.label(y).for((0,fe._)`;${E}--;`,()=>e.for((0,fe._)`${S} = ${E}; ${S}--;`,()=>e.if((0,fe._)`${v}(${r}[${E}], ${r}[${S}])`,()=>{t.error(),e.assign(m,!1).break(y)})))}}};yn.default=el;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});const Ur=B,tl=X,rl=tr,nl={message:"must be equal to constant",params:({schemaCode:t})=>(0,Ur._)`{allowedValue: ${t}}`},sl={keyword:"const",$data:!0,error:nl,code(t){const{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Ur._)`!${(0,tl.useFunc)(e,rl.default)}(${r}, ${s})`):t.fail((0,Ur._)`${i} !== ${r}`)}};gn.default=sl;var $n={};Object.defineProperty($n,"__esModule",{value:!0});const Wt=B,il=X,ol=tr,al={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Wt._)`{allowedValues: ${t}}`},cl={keyword:"enum",schemaType:"array",$data:!0,error:al,code(t){const{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:c}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const l=s.length>=c.opts.loopEnum;let m;const u=()=>m??(m=(0,il.useFunc)(e,ol.default));let p;if(l||n)p=e.let("valid"),t.block$data(p,g);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const C=e.const("vSchema",i);p=(0,Wt.or)(...s.map((E,S)=>k(C,S)))}t.pass(p);function g(){e.assign(p,!1),e.forOf("v",i,C=>e.if((0,Wt._)`${u()}(${r}, ${C})`,()=>e.assign(p,!0).break()))}function k(C,E){const S=s[E];return typeof S=="object"&&S!==null?(0,Wt._)`${u()}(${r}, ${C}[${E}])`:(0,Wt._)`${r} === ${S}`}}};$n.default=cl;Object.defineProperty(an,"__esModule",{value:!0});const ll=cn,ul=ln,dl=un,pl=pn,fl=fn,hl=hn,ml=mn,yl=yn,gl=gn,$l=$n,vl=[ll.default,ul.default,dl.default,pl.default,fl.default,hl.default,ml.default,yl.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gl.default,$l.default];an.default=vl;var vn={},Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validateAdditionalItems=void 0;const ot=B,Lr=X,_l={message:({params:{len:t}})=>(0,ot.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ot._)`{limit: ${t}}`},wl={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_l,code(t){const{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Lr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ji(t,n)}};function ji(t,e){const{gen:r,schema:n,data:s,keyword:i,it:c}=t;c.items=!0;const l=r.const("len",(0,ot._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,ot._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Lr.alwaysValidSchema)(c,n)){const u=r.var("valid",(0,ot._)`${l} <= ${e.length}`);r.if((0,ot.not)(u),()=>m(u)),t.ok(u)}function m(u){r.forRange("i",e.length,l,p=>{t.subschema({keyword:i,dataProp:p,dataPropType:Lr.Type.Num},u),c.allErrors||r.if((0,ot.not)(u),()=>r.break())})}}Ct.validateAdditionalItems=ji;Ct.default=wl;var _n={},jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.validateTuple=void 0;const ms=B,hr=X,bl=K,Pl={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return ki(t,"additionalItems",e);r.items=!0,!(0,hr.alwaysValidSchema)(r,e)&&t.ok((0,bl.validateArray)(t))}};function ki(t,e,r=t.schema){const{gen:n,parentSchema:s,data:i,keyword:c,it:l}=t;p(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=hr.mergeEvaluated.items(n,r.length,l.items));const m=n.name("valid"),u=n.const("len",(0,ms._)`${i}.length`);r.forEach((g,k)=>{(0,hr.alwaysValidSchema)(l,g)||(n.if((0,ms._)`${u} > ${k}`,()=>t.subschema({keyword:c,schemaProp:k,dataProp:k},m)),t.ok(m))});function p(g){const{opts:k,errSchemaPath:C}=l,E=r.length,S=E===g.minItems&&(E===g.maxItems||g[e]===!1);if(k.strictTuples&&!S){const v=`"${c}" is ${E}-tuple, but minItems or maxItems/${e} are not specified or different at path "${C}"`;(0,hr.checkStrictMode)(l,v,k.strictTuples)}}}jt.validateTuple=ki;jt.default=Pl;Object.defineProperty(_n,"__esModule",{value:!0});const El=jt,Sl={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,El.validateTuple)(t,"items")};_n.default=Sl;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});const ys=B,Tl=X,Rl=K,Ol=Ct,Nl={message:({params:{len:t}})=>(0,ys.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ys._)`{limit: ${t}}`},Cl={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Nl,code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,Tl.alwaysValidSchema)(n,e)&&(s?(0,Ol.validateAdditionalItems)(t,s):t.ok((0,Rl.validateArray)(t)))}};wn.default=Cl;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const Se=B,ar=X,jl={message:({params:{min:t,max:e}})=>e===void 0?(0,Se.str)`must contain at least ${t} valid item(s)`:(0,Se.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Se._)`{minContains: ${t}}`:(0,Se._)`{minContains: ${t}, maxContains: ${e}}`},kl={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:jl,code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;let c,l;const{minContains:m,maxContains:u}=n;i.opts.next?(c=m===void 0?1:m,l=u):c=1;const p=e.const("len",(0,Se._)`${s}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,ar.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,ar.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ar.alwaysValidSchema)(i,r)){let S=(0,Se._)`${p} >= ${c}`;l!==void 0&&(S=(0,Se._)`${S} && ${p} <= ${l}`),t.pass(S);return}i.items=!0;const g=e.name("valid");l===void 0&&c===1?C(g,()=>e.if(g,()=>e.break())):c===0?(e.let(g,!0),l!==void 0&&e.if((0,Se._)`${s}.length > 0`,k)):(e.let(g,!1),k()),t.result(g,()=>t.reset());function k(){const S=e.name("_valid"),v=e.let("count",0);C(S,()=>e.if(S,()=>E(v)))}function C(S,v){e.forRange("i",0,p,y=>{t.subschema({keyword:"contains",dataProp:y,dataPropType:ar.Type.Num,compositeRule:!0},S),v()})}function E(S){e.code((0,Se._)`${S}++`),l===void 0?e.if((0,Se._)`${S} >= ${c}`,()=>e.assign(g,!0).break()):(e.if((0,Se._)`${S} > ${l}`,()=>e.assign(g,!1).break()),c===1?e.assign(g,!0):e.if((0,Se._)`${S} >= ${c}`,()=>e.assign(g,!0)))}}};bn.default=kl;var Ii={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=B,r=X,n=K;t.error={message:({params:{property:m,depsCount:u,deps:p}})=>{const g=u===1?"property":"properties";return(0,e.str)`must have ${g} ${p} when property ${m} is present`},params:({params:{property:m,depsCount:u,deps:p,missingProperty:g}})=>(0,e._)`{property: ${m},
164
482
  missingProperty: ${g},
165
483
  depsCount: ${u},
166
- deps: ${f}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(m){const[u,f]=i(m);a(m,u),l(m,f)}};function i({schema:m}){const u={},f={};for(const g in m){if(g==="__proto__")continue;const k=Array.isArray(m[g])?u:f;k[g]=m[g]}return[u,f]}function a(m,u=m.schema){const{gen:f,data:g,it:k}=m;if(Object.keys(u).length===0)return;const C=f.let("missing");for(const E in u){const S=u[E];if(S.length===0)continue;const $=(0,n.propertyInData)(f,g,E,k.opts.ownProperties);m.setParams({property:E,depsCount:S.length,deps:S.join(", ")}),k.allErrors?f.if($,()=>{for(const y of S)(0,n.checkReportMissingProp)(m,y)}):(f.if((0,e._)`${$} && (${(0,n.checkMissingProp)(m,S,C)})`),(0,n.reportMissingProp)(m,C),f.else())}}t.validatePropertyDeps=a;function l(m,u=m.schema){const{gen:f,data:g,keyword:k,it:C}=m,E=f.name("valid");for(const S in u)(0,r.alwaysValidSchema)(C,u[S])||(f.if((0,n.propertyInData)(f,g,S,C.opts.ownProperties),()=>{const $=m.subschema({keyword:k,schemaProp:S},E);m.mergeValidEvaluated($,E)},()=>f.var(E,!0)),m.ok(E))}t.validateSchemaDeps=l,t.default=s})(Ii);var En={};Object.defineProperty(En,"__esModule",{value:!0});const Ai=G,Sl=X,Tl={message:"property name must be valid",params:({params:t})=>(0,Ai._)`{propertyName: ${t.propertyName}}`},Rl={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Tl,code(t){const{gen:e,schema:r,data:n,it:s}=t;if((0,Sl.alwaysValidSchema)(s,r))return;const i=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),e.if((0,Ai.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};En.default=Rl;var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});const ar=K,Re=G,Nl=Ve,cr=X,Ol={message:"must NOT have additional properties",params:({params:t})=>(0,Re._)`{additionalProperty: ${t.additionalProperty}}`},Cl={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Ol,code(t){const{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");const{allErrors:l,opts:m}=a;if(a.props=!0,m.removeAdditional!=="all"&&(0,cr.alwaysValidSchema)(a,r))return;const u=(0,ar.allSchemaProperties)(n.properties),f=(0,ar.allSchemaProperties)(n.patternProperties);g(),t.ok((0,Re._)`${i} === ${Nl.default.errors}`);function g(){e.forIn("key",s,$=>{!u.length&&!f.length?E($):e.if(k($),()=>E($))})}function k($){let y;if(u.length>8){const T=(0,cr.schemaRefOrVal)(a,n.properties,"properties");y=(0,ar.isOwnProperty)(e,T,$)}else u.length?y=(0,Re.or)(...u.map(T=>(0,Re._)`${$} === ${T}`)):y=Re.nil;return f.length&&(y=(0,Re.or)(y,...f.map(T=>(0,Re._)`${(0,ar.usePattern)(t,T)}.test(${$})`))),(0,Re.not)(y)}function C($){e.code((0,Re._)`delete ${s}[${$}]`)}function E($){if(m.removeAdditional==="all"||m.removeAdditional&&r===!1){C($);return}if(r===!1){t.setParams({additionalProperty:$}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,cr.alwaysValidSchema)(a,r)){const y=e.name("valid");m.removeAdditional==="failing"?(S($,y,!1),e.if((0,Re.not)(y),()=>{t.reset(),C($)})):(S($,y),l||e.if((0,Re.not)(y),()=>e.break()))}}function S($,y,T){const R={keyword:"additionalProperties",dataProp:$,dataPropType:cr.Type.Str};T===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(R,y)}}};Tr.default=Cl;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});const jl=Oe,vs=K,Ir=X,$s=Tr,kl={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&$s.default.code(new jl.KeywordCxt(i,$s.default,"additionalProperties"));const a=(0,vs.allSchemaProperties)(r);for(const g of a)i.definedProperties.add(g);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=Ir.mergeEvaluated.props(e,(0,Ir.toHash)(a),i.props));const l=a.filter(g=>!(0,Ir.alwaysValidSchema)(i,r[g]));if(l.length===0)return;const m=e.name("valid");for(const g of l)u(g)?f(g):(e.if((0,vs.propertyInData)(e,s,g,i.opts.ownProperties)),f(g),i.allErrors||e.else().var(m,!0),e.endIf()),t.it.definedProperties.add(g),t.ok(m);function u(g){return i.opts.useDefaults&&!i.compositeRule&&r[g].default!==void 0}function f(g){t.subschema({keyword:"properties",schemaProp:g,dataProp:g},m)}}};Sn.default=kl;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});const _s=K,lr=G,ws=X,bs=X,Il={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:a}=i,l=(0,_s.allSchemaProperties)(r),m=l.filter(S=>(0,ws.alwaysValidSchema)(i,r[S]));if(l.length===0||m.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,f=e.name("valid");i.props!==!0&&!(i.props instanceof lr.Name)&&(i.props=(0,bs.evaluatedPropsToName)(e,i.props));const{props:g}=i;k();function k(){for(const S of l)u&&C(S),i.allErrors?E(S):(e.var(f,!0),E(S),e.if(f))}function C(S){for(const $ in u)new RegExp(S).test($)&&(0,ws.checkStrictMode)(i,`property ${$} matches pattern ${S} (use allowMatchingProperties)`)}function E(S){e.forIn("key",n,$=>{e.if((0,lr._)`${(0,_s.usePattern)(t,S)}.test(${$})`,()=>{const y=m.includes(S);y||t.subschema({keyword:"patternProperties",schemaProp:S,dataProp:$,dataPropType:bs.Type.Str},f),i.opts.unevaluated&&g!==!0?e.assign((0,lr._)`${g}[${$}]`,!0):!y&&!i.allErrors&&e.if((0,lr.not)(f),()=>e.break())})})}}};Tn.default=Il;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});const Al=X,Dl={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,Al.alwaysValidSchema)(n,r)){t.fail();return}const s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Rn.default=Dl;var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});const Fl=K,Ml={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Fl.validateUnion,error:{message:"must match a schema in anyOf"}};Nn.default=Ml;var On={};Object.defineProperty(On,"__esModule",{value:!0});const hr=G,Ul=X,ql={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,hr._)`{passingSchemas: ${t.passing}}`},Ll={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:ql,code(t){const{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,a=e.let("valid",!1),l=e.let("passing",null),m=e.name("_valid");t.setParams({passing:l}),e.block(u),t.result(a,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((f,g)=>{let k;(0,Ul.alwaysValidSchema)(s,f)?e.var(m,!0):k=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},m),g>0&&e.if((0,hr._)`${m} && ${a}`).assign(a,!1).assign(l,(0,hr._)`[${l}, ${g}]`).else(),e.if(m,()=>{e.assign(a,!0),e.assign(l,g),k&&t.mergeEvaluated(k,hr.Name)})})}}};On.default=Ll;var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});const Vl=X,zl={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=e.name("valid");r.forEach((i,a)=>{if((0,Vl.alwaysValidSchema)(n,i))return;const l=t.subschema({keyword:"allOf",schemaProp:a},s);t.ok(s),t.mergeEvaluated(l)})}};Cn.default=zl;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});const $r=G,Di=X,Hl={message:({params:t})=>(0,$r.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,$r._)`{failingKeyword: ${t.ifClause}}`},Wl={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Hl,code(t){const{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Di.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=Ps(n,"then"),i=Ps(n,"else");if(!s&&!i)return;const a=e.let("valid",!0),l=e.name("_valid");if(m(),t.reset(),s&&i){const f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,u("then",f),u("else",f))}else s?e.if(l,u("then")):e.if((0,$r.not)(l),u("else"));t.pass(a,()=>t.error(!0));function m(){const f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}function u(f,g){return()=>{const k=t.subschema({keyword:f},l);e.assign(a,l),t.mergeValidEvaluated(k,a),g?e.assign(g,(0,$r._)`${f}`):t.setParams({ifClause:f})}}}};function Ps(t,e){const r=t.schema[e];return r!==void 0&&!(0,Di.alwaysValidSchema)(t,r)}jn.default=Wl;var kn={};Object.defineProperty(kn,"__esModule",{value:!0});const Kl=X,Gl={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Kl.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};kn.default=Gl;Object.defineProperty(_n,"__esModule",{value:!0});const Bl=Nt,Jl=wn,Yl=Ot,xl=bn,Zl=Pn,Ql=Ii,Xl=En,eu=Tr,tu=Sn,ru=Tn,nu=Rn,su=Nn,iu=On,ou=Cn,au=jn,cu=kn;function lu(t=!1){const e=[nu.default,su.default,iu.default,ou.default,au.default,cu.default,Xl.default,eu.default,Ql.default,tu.default,ru.default];return t?e.push(Jl.default,xl.default):e.push(Bl.default,Yl.default),e.push(Zl.default),e}_n.default=lu;var In={},An={};Object.defineProperty(An,"__esModule",{value:!0});const ue=G,uu={message:({schemaCode:t})=>(0,ue.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ue._)`{format: ${t}}`},du={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:uu,code(t,e){const{gen:r,data:n,$data:s,schema:i,schemaCode:a,it:l}=t,{opts:m,errSchemaPath:u,schemaEnv:f,self:g}=l;if(!m.validateFormats)return;s?k():C();function k(){const E=r.scopeValue("formats",{ref:g.formats,code:m.code.formats}),S=r.const("fDef",(0,ue._)`${E}[${a}]`),$=r.let("fType"),y=r.let("format");r.if((0,ue._)`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>r.assign($,(0,ue._)`${S}.type || "string"`).assign(y,(0,ue._)`${S}.validate`),()=>r.assign($,(0,ue._)`"string"`).assign(y,S)),t.fail$data((0,ue.or)(T(),R()));function T(){return m.strictSchema===!1?ue.nil:(0,ue._)`${a} && !${y}`}function R(){const j=f.$async?(0,ue._)`(${S}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,ue._)`${y}(${n})`,D=(0,ue._)`(typeof ${y} == "function" ? ${j} : ${y}.test(${n}))`;return(0,ue._)`${y} && ${y} !== true && ${$} === ${e} && !${D}`}}function C(){const E=g.formats[i];if(!E){T();return}if(E===!0)return;const[S,$,y]=R(E);S===e&&t.pass(j());function T(){if(m.strictSchema===!1){g.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function R(D){const _=D instanceof RegExp?(0,ue.regexpCode)(D):m.code.formats?(0,ue._)`${m.code.formats}${(0,ue.getProperty)(i)}`:void 0,N=r.scopeValue("formats",{key:i,ref:D,code:_});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,ue._)`${N}.validate`]:["string",D,N]}function j(){if(typeof E=="object"&&!(E instanceof RegExp)&&E.async){if(!f.$async)throw new Error("async format in sync schema");return(0,ue._)`await ${y}(${n})`}return typeof $=="function"?(0,ue._)`${y}(${n})`:(0,ue._)`${y}.test(${n})`}}}};An.default=du;Object.defineProperty(In,"__esModule",{value:!0});const fu=An,pu=[fu.default];In.default=pu;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.contentVocabulary=Rt.metadataVocabulary=void 0;Rt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Rt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(sn,"__esModule",{value:!0});const hu=on,mu=cn,yu=_n,gu=In,Es=Rt,vu=[hu.default,mu.default,(0,yu.default)(),gu.default,Es.metadataVocabulary,Es.contentVocabulary];sn.default=vu;var Dn={},Fi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))})(Fi);Object.defineProperty(Dn,"__esModule",{value:!0});const bt=G,Vr=Fi,Ss=_e,$u=X,_u={message:({params:{discrError:t,tagName:e}})=>t===Vr.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,bt._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},wu={keyword:"discriminator",type:"object",schemaType:"object",error:_u,code(t){const{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:a}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const m=e.let("valid",!1),u=e.const("tag",(0,bt._)`${r}${(0,bt.getProperty)(l)}`);e.if((0,bt._)`typeof ${u} == "string"`,()=>f(),()=>t.error(!1,{discrError:Vr.DiscrError.Tag,tag:u,tagName:l})),t.ok(m);function f(){const C=k();e.if(!1);for(const E in C)e.elseIf((0,bt._)`${u} === ${E}`),e.assign(m,g(C[E]));e.else(),t.error(!1,{discrError:Vr.DiscrError.Mapping,tag:u,tagName:l}),e.endIf()}function g(C){const E=e.name("valid"),S=t.subschema({keyword:"oneOf",schemaProp:C},E);return t.mergeEvaluated(S,bt.Name),E}function k(){var C;const E={},S=y(s);let $=!0;for(let j=0;j<a.length;j++){let D=a[j];D?.$ref&&!(0,$u.schemaHasRulesButRef)(D,i.self.RULES)&&(D=Ss.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D?.$ref),D instanceof Ss.SchemaEnv&&(D=D.schema));const _=(C=D?.properties)===null||C===void 0?void 0:C[l];if(typeof _!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);$=$&&(S||y(D)),T(_,j)}if(!$)throw new Error(`discriminator: "${l}" must be required`);return E;function y({required:j}){return Array.isArray(j)&&j.includes(l)}function T(j,D){if(j.const)R(j.const,D);else if(j.enum)for(const _ of j.enum)R(_,D);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function R(j,D){if(typeof j!="string"||j in E)throw new Error(`discriminator: "${l}" values must be unique strings`);E[j]=D}}}};Dn.default=wu;const bu="http://json-schema.org/draft-07/schema#",Pu="http://json-schema.org/draft-07/schema#",Eu="Core schema meta-schema",Su={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Tu=["object","boolean"],Ru={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Nu={$schema:bu,$id:Pu,title:Eu,definitions:Su,type:Tu,properties:Ru,default:!0};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=ri,n=sn,s=Dn,i=Nu,a=["/properties"],l="http://json-schema.org/draft-07/schema";class m extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(E=>this.addVocabulary(E)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const E=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(E,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.exports=e=m,Object.defineProperty(e,"__esModule",{value:!0}),e.default=m;var u=Oe;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=G;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var g=Qt;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return g.default}});var k=Xt;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return k.default}})})(Dr,Dr.exports);var Ou=Dr.exports;const Cu=Uo(Ou),ju="http://json-schema.org/schema",ku="#/definitions/Blueprint",Iu={Blueprint:{type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run."},$schema:{type:"string"}},additionalProperties:!1},SupportedPHPVersion:{type:"string",enum:["8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0","5.6"]},StepDefinition:{type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"applyWordPressPatches"},siteUrl:{type:"string"},wordpressPath:{type:"string"},addPhpInfo:{type:"boolean"},patchSecrets:{type:"boolean"},disableSiteHealth:{type:"boolean"},disableWpNewBlogNotification:{type:"boolean"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},virtualize:{type:"boolean",description:"Enables the virtualization of wp-config.php and playground-consts.json files, leaving the local system files untouched. The variables defined in the /vfs-blueprints/playground-consts.json file are loaded via the auto_prepend_file directive in the php.ini file.",default:!1}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importFile"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"replaceSite"},fullSiteZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the new WordPress site"}},required:["fullSiteZip","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setPhpIniEntry"},key:{type:"string",description:'Entry name e.g. "display_errors"'},value:{type:"string",description:'Entry value as a string e.g. "1"'}},required:["key","step","value"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipPath:{type:"string",description:"The zip file to extract"},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step","zipPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]}]},FileReference:{anyOf:[{$ref:"#/definitions/VFSReference"},{$ref:"#/definitions/LiteralReference"},{$ref:"#/definitions/CoreThemeReference"},{$ref:"#/definitions/CorePluginReference"},{$ref:"#/definitions/UrlReference"}]},VFSReference:{type:"object",properties:{resource:{type:"string",const:"vfs",description:"Identifies the file resource as Virtual File System (VFS)"},path:{type:"string",description:"The path to the file in the VFS"}},required:["resource","path"],additionalProperties:!1},LiteralReference:{type:"object",properties:{resource:{type:"string",const:"literal",description:"Identifies the file resource as a literal file"},name:{type:"string",description:"The name of the file"},contents:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The contents of the file"}},required:["resource","name","contents"],additionalProperties:!1},CoreThemeReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/themes",description:"Identifies the file resource as a WordPress Core theme"},slug:{type:"string",description:"The slug of the WordPress Core theme"}},required:["resource","slug"],additionalProperties:!1},CorePluginReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/plugins",description:"Identifies the file resource as a WordPress Core plugin"},slug:{type:"string",description:"The slug of the WordPress Core plugin"}},required:["resource","slug"],additionalProperties:!1},UrlReference:{type:"object",properties:{resource:{type:"string",const:"url",description:"Identifies the file resource as a URL"},url:{type:"string",description:"The URL of the file"},caption:{type:"string",description:"Optional caption for displaying a progress message"}},required:["resource","url"],additionalProperties:!1},InstallPluginOptions:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the plugin after installing it."}},additionalProperties:!1},PHPRequest:{type:"object",properties:{method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},url:{type:"string",description:"Request path or absolute URL."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},files:{type:"object",additionalProperties:{type:"object",properties:{size:{type:"number"},type:{type:"string"},lastModified:{type:"number"},name:{type:"string"},webkitRelativePath:{type:"string"}},required:["lastModified","name","size","type","webkitRelativePath"],additionalProperties:!1},description:"Uploaded files"},body:{type:"string",description:"Request body without the files."},formData:{type:"object",additionalProperties:{},description:"Form data. If set, the request body will be ignored and the content-type header will be set to `application/x-www-form-urlencoded`."}},required:["url"],additionalProperties:!1},HTTPMethod:{type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]},PHPRequestHeaders:{type:"object",additionalProperties:{type:"string"}},PHPRunOptions:{type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{type:"string",description:"Request body without the files."},fileInfos:{type:"array",items:{$ref:"#/definitions/FileInfo"},description:"Uploaded files."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},FileInfo:{type:"object",properties:{key:{type:"string"},name:{type:"string"},type:{type:"string"},data:{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}},required:["key","name","type","data"],additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},Au={$schema:ju,$ref:ku,definitions:Iu},Du=["6.2","6.1","6.0","5.9","nightly"];function Fu(t,{progress:e=new Br,semaphore:r=new qs({concurrency:3}),onStepCompleted:n=()=>{}}={}){t={...t,steps:(t.steps||[]).filter(qu)};const{valid:s,errors:i}=Uu(t);if(!s){const u=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw u.errors=i,u}const a=t.steps||[],l=a.reduce((u,f)=>u+(f.progress?.weight||1),0),m=a.map(u=>Lu(u,{semaphore:r,rootProgressTracker:e,totalProgressWeight:l}));return{versions:{php:Ts(t.preferredVersions?.php,Qs,mo),wp:Ts(t.preferredVersions?.wp,Du,"6.2")},run:async u=>{try{for(const{resources:f}of m)for(const g of f)g.setPlayground(u),g.isAsync&&g.resolve();for(const{run:f,step:g}of m){const k=await f(u);n(k,g)}}finally{try{await u.goTo(t.landingPage||"/")}catch{}e.finish()}}}}const Mu=new Cu({discriminator:!0});let ur;function Uu(t){ur=Mu.compile(Au);const e=ur(t);if(e)return{valid:e};const r=new Set;for(const s of ur.errors)s.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(s.instancePath);const n=ur.errors?.filter(s=>!(s.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(s.instancePath)));return{valid:e,errors:n}}function Ts(t,e,r){return t&&e.includes(t)?t:r}function qu(t){return!!(typeof t=="object"&&t)}function Lu(t,{semaphore:e,rootProgressTracker:r,totalProgressWeight:n}){const s=r.stage((t.progress?.weight||1)/n),i={};for(const f of Object.keys(t)){let g=t[f];Ro(g)&&(g=lt.create(g,{semaphore:e})),i[f]=g}const a=async f=>{try{return s.fillSlowly(),await to[t.step](f,await Vu(i),{tracker:s,initialCaption:t.progress?.caption})}finally{s.finish()}},l=Rs(i),m=Rs(i).filter(f=>f.isAsync),u=1/(m.length+1);for(const f of m)f.progress=s.stage(u);return{run:a,step:t,resources:l}}function Rs(t){const e=[];for(const r in t){const n=t[r];n instanceof lt&&e.push(n)}return e}async function Vu(t){const e={};for(const r in t){const n=t[r];n instanceof lt?e[r]=await n.resolve():e[r]=n}return e}async function zu(t,e){await t.run(e)}exports.activatePlugin=zr;exports.activateTheme=Hr;exports.applyWordPressPatches=Ns;exports.compileBlueprint=Fu;exports.cp=Is;exports.defineSiteUrl=Us;exports.defineWpConfigConsts=wr;exports.importFile=zs;exports.installPlugin=Ks;exports.installTheme=Gs;exports.login=Bs;exports.mkdir=Ds;exports.mv=As;exports.replaceSite=Vs;exports.request=ks;exports.rm=Fs;exports.rmdir=Ms;exports.runBlueprintSteps=zu;exports.runPHP=Os;exports.runPHPWithOptions=Cs;exports.runWpInstallationWizard=Js;exports.setPhpIniEntry=js;exports.setPluginProxyURL=ko;exports.setSiteOptions=Ys;exports.unzip=br;exports.updateUserMeta=xs;exports.writeFile=Kr;exports.zipEntireSite=Ls;
484
+ deps: ${p}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(m){const[u,p]=i(m);c(m,u),l(m,p)}};function i({schema:m}){const u={},p={};for(const g in m){if(g==="__proto__")continue;const k=Array.isArray(m[g])?u:p;k[g]=m[g]}return[u,p]}function c(m,u=m.schema){const{gen:p,data:g,it:k}=m;if(Object.keys(u).length===0)return;const C=p.let("missing");for(const E in u){const S=u[E];if(S.length===0)continue;const v=(0,n.propertyInData)(p,g,E,k.opts.ownProperties);m.setParams({property:E,depsCount:S.length,deps:S.join(", ")}),k.allErrors?p.if(v,()=>{for(const y of S)(0,n.checkReportMissingProp)(m,y)}):(p.if((0,e._)`${v} && (${(0,n.checkMissingProp)(m,S,C)})`),(0,n.reportMissingProp)(m,C),p.else())}}t.validatePropertyDeps=c;function l(m,u=m.schema){const{gen:p,data:g,keyword:k,it:C}=m,E=p.name("valid");for(const S in u)(0,r.alwaysValidSchema)(C,u[S])||(p.if((0,n.propertyInData)(p,g,S,C.opts.ownProperties),()=>{const v=m.subschema({keyword:k,schemaProp:S},E);m.mergeValidEvaluated(v,E)},()=>p.var(E,!0)),m.ok(E))}t.validateSchemaDeps=l,t.default=s})(Ii);var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});const Ai=B,Il=X,Al={message:"property name must be valid",params:({params:t})=>(0,Ai._)`{propertyName: ${t.propertyName}}`},Dl={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Al,code(t){const{gen:e,schema:r,data:n,it:s}=t;if((0,Il.alwaysValidSchema)(s,r))return;const i=e.name("valid");e.forIn("key",n,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},i),e.if((0,Ai.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};Pn.default=Dl;var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});const cr=K,Re=B,ql=He,lr=X,Fl={message:"must NOT have additional properties",params:({params:t})=>(0,Re._)`{additionalProperty: ${t.additionalProperty}}`},Ml={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Fl,code(t){const{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:c}=t;if(!i)throw new Error("ajv implementation error");const{allErrors:l,opts:m}=c;if(c.props=!0,m.removeAdditional!=="all"&&(0,lr.alwaysValidSchema)(c,r))return;const u=(0,cr.allSchemaProperties)(n.properties),p=(0,cr.allSchemaProperties)(n.patternProperties);g(),t.ok((0,Re._)`${i} === ${ql.default.errors}`);function g(){e.forIn("key",s,v=>{!u.length&&!p.length?E(v):e.if(k(v),()=>E(v))})}function k(v){let y;if(u.length>8){const T=(0,lr.schemaRefOrVal)(c,n.properties,"properties");y=(0,cr.isOwnProperty)(e,T,v)}else u.length?y=(0,Re.or)(...u.map(T=>(0,Re._)`${v} === ${T}`)):y=Re.nil;return p.length&&(y=(0,Re.or)(y,...p.map(T=>(0,Re._)`${(0,cr.usePattern)(t,T)}.test(${v})`))),(0,Re.not)(y)}function C(v){e.code((0,Re._)`delete ${s}[${v}]`)}function E(v){if(m.removeAdditional==="all"||m.removeAdditional&&r===!1){C(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,lr.alwaysValidSchema)(c,r)){const y=e.name("valid");m.removeAdditional==="failing"?(S(v,y,!1),e.if((0,Re.not)(y),()=>{t.reset(),C(v)})):(S(v,y),l||e.if((0,Re.not)(y),()=>e.break()))}}function S(v,y,T){const R={keyword:"additionalProperties",dataProp:v,dataPropType:lr.Type.Str};T===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(R,y)}}};Tr.default=Ml;var En={};Object.defineProperty(En,"__esModule",{value:!0});const Ul=Ne,gs=K,Ir=X,$s=Tr,Ll={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&$s.default.code(new Ul.KeywordCxt(i,$s.default,"additionalProperties"));const c=(0,gs.allSchemaProperties)(r);for(const g of c)i.definedProperties.add(g);i.opts.unevaluated&&c.length&&i.props!==!0&&(i.props=Ir.mergeEvaluated.props(e,(0,Ir.toHash)(c),i.props));const l=c.filter(g=>!(0,Ir.alwaysValidSchema)(i,r[g]));if(l.length===0)return;const m=e.name("valid");for(const g of l)u(g)?p(g):(e.if((0,gs.propertyInData)(e,s,g,i.opts.ownProperties)),p(g),i.allErrors||e.else().var(m,!0),e.endIf()),t.it.definedProperties.add(g),t.ok(m);function u(g){return i.opts.useDefaults&&!i.compositeRule&&r[g].default!==void 0}function p(g){t.subschema({keyword:"properties",schemaProp:g,dataProp:g},m)}}};En.default=Ll;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});const vs=K,ur=B,_s=X,ws=X,Hl={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:c}=i,l=(0,vs.allSchemaProperties)(r),m=l.filter(S=>(0,_s.alwaysValidSchema)(i,r[S]));if(l.length===0||m.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=c.strictSchema&&!c.allowMatchingProperties&&s.properties,p=e.name("valid");i.props!==!0&&!(i.props instanceof ur.Name)&&(i.props=(0,ws.evaluatedPropsToName)(e,i.props));const{props:g}=i;k();function k(){for(const S of l)u&&C(S),i.allErrors?E(S):(e.var(p,!0),E(S),e.if(p))}function C(S){for(const v in u)new RegExp(S).test(v)&&(0,_s.checkStrictMode)(i,`property ${v} matches pattern ${S} (use allowMatchingProperties)`)}function E(S){e.forIn("key",n,v=>{e.if((0,ur._)`${(0,vs.usePattern)(t,S)}.test(${v})`,()=>{const y=m.includes(S);y||t.subschema({keyword:"patternProperties",schemaProp:S,dataProp:v,dataPropType:ws.Type.Str},p),i.opts.unevaluated&&g!==!0?e.assign((0,ur._)`${g}[${v}]`,!0):!y&&!i.allErrors&&e.if((0,ur.not)(p),()=>e.break())})})}}};Sn.default=Hl;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});const Vl=X,zl={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,Vl.alwaysValidSchema)(n,r)){t.fail();return}const s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Tn.default=zl;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});const Wl=K,Kl={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Wl.validateUnion,error:{message:"must match a schema in anyOf"}};Rn.default=Kl;var On={};Object.defineProperty(On,"__esModule",{value:!0});const mr=B,Bl=X,Gl={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,mr._)`{passingSchemas: ${t.passing}}`},xl={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Gl,code(t){const{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,c=e.let("valid",!1),l=e.let("passing",null),m=e.name("_valid");t.setParams({passing:l}),e.block(u),t.result(c,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((p,g)=>{let k;(0,Bl.alwaysValidSchema)(s,p)?e.var(m,!0):k=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},m),g>0&&e.if((0,mr._)`${m} && ${c}`).assign(c,!1).assign(l,(0,mr._)`[${l}, ${g}]`).else(),e.if(m,()=>{e.assign(c,!0),e.assign(l,g),k&&t.mergeEvaluated(k,mr.Name)})})}}};On.default=xl;var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});const Jl=X,Yl={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=e.name("valid");r.forEach((i,c)=>{if((0,Jl.alwaysValidSchema)(n,i))return;const l=t.subschema({keyword:"allOf",schemaProp:c},s);t.ok(s),t.mergeEvaluated(l)})}};Nn.default=Yl;var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});const _r=B,Di=X,Zl={message:({params:t})=>(0,_r.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,_r._)`{failingKeyword: ${t.ifClause}}`},Ql={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Zl,code(t){const{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Di.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=bs(n,"then"),i=bs(n,"else");if(!s&&!i)return;const c=e.let("valid",!0),l=e.name("_valid");if(m(),t.reset(),s&&i){const p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,u("then",p),u("else",p))}else s?e.if(l,u("then")):e.if((0,_r.not)(l),u("else"));t.pass(c,()=>t.error(!0));function m(){const p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function u(p,g){return()=>{const k=t.subschema({keyword:p},l);e.assign(c,l),t.mergeValidEvaluated(k,c),g?e.assign(g,(0,_r._)`${p}`):t.setParams({ifClause:p})}}}};function bs(t,e){const r=t.schema[e];return r!==void 0&&!(0,Di.alwaysValidSchema)(t,r)}Cn.default=Ql;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});const Xl=X,eu={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Xl.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};jn.default=eu;Object.defineProperty(vn,"__esModule",{value:!0});const tu=Ct,ru=_n,nu=jt,su=wn,iu=bn,ou=Ii,au=Pn,cu=Tr,lu=En,uu=Sn,du=Tn,pu=Rn,fu=On,hu=Nn,mu=Cn,yu=jn;function gu(t=!1){const e=[du.default,pu.default,fu.default,hu.default,mu.default,yu.default,au.default,cu.default,ou.default,lu.default,uu.default];return t?e.push(ru.default,su.default):e.push(tu.default,nu.default),e.push(iu.default),e}vn.default=gu;var kn={},In={};Object.defineProperty(In,"__esModule",{value:!0});const ue=B,$u={message:({schemaCode:t})=>(0,ue.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ue._)`{format: ${t}}`},vu={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:$u,code(t,e){const{gen:r,data:n,$data:s,schema:i,schemaCode:c,it:l}=t,{opts:m,errSchemaPath:u,schemaEnv:p,self:g}=l;if(!m.validateFormats)return;s?k():C();function k(){const E=r.scopeValue("formats",{ref:g.formats,code:m.code.formats}),S=r.const("fDef",(0,ue._)`${E}[${c}]`),v=r.let("fType"),y=r.let("format");r.if((0,ue._)`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>r.assign(v,(0,ue._)`${S}.type || "string"`).assign(y,(0,ue._)`${S}.validate`),()=>r.assign(v,(0,ue._)`"string"`).assign(y,S)),t.fail$data((0,ue.or)(T(),R()));function T(){return m.strictSchema===!1?ue.nil:(0,ue._)`${c} && !${y}`}function R(){const j=p.$async?(0,ue._)`(${S}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,ue._)`${y}(${n})`,D=(0,ue._)`(typeof ${y} == "function" ? ${j} : ${y}.test(${n}))`;return(0,ue._)`${y} && ${y} !== true && ${v} === ${e} && !${D}`}}function C(){const E=g.formats[i];if(!E){T();return}if(E===!0)return;const[S,v,y]=R(E);S===e&&t.pass(j());function T(){if(m.strictSchema===!1){g.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function R(D){const _=D instanceof RegExp?(0,ue.regexpCode)(D):m.code.formats?(0,ue._)`${m.code.formats}${(0,ue.getProperty)(i)}`:void 0,O=r.scopeValue("formats",{key:i,ref:D,code:_});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,ue._)`${O}.validate`]:["string",D,O]}function j(){if(typeof E=="object"&&!(E instanceof RegExp)&&E.async){if(!p.$async)throw new Error("async format in sync schema");return(0,ue._)`await ${y}(${n})`}return typeof v=="function"?(0,ue._)`${y}(${n})`:(0,ue._)`${y}.test(${n})`}}}};In.default=vu;Object.defineProperty(kn,"__esModule",{value:!0});const _u=In,wu=[_u.default];kn.default=wu;var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.contentVocabulary=Nt.metadataVocabulary=void 0;Nt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Nt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(nn,"__esModule",{value:!0});const bu=sn,Pu=an,Eu=vn,Su=kn,Ps=Nt,Tu=[bu.default,Pu.default,(0,Eu.default)(),Su.default,Ps.metadataVocabulary,Ps.contentVocabulary];nn.default=Tu;var An={},qi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))})(qi);Object.defineProperty(An,"__esModule",{value:!0});const Pt=B,Hr=qi,Es=_e,Ru=X,Ou={message:({params:{discrError:t,tagName:e}})=>t===Hr.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Pt._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Nu={keyword:"discriminator",type:"object",schemaType:"object",error:Ou,code(t){const{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:c}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const m=e.let("valid",!1),u=e.const("tag",(0,Pt._)`${r}${(0,Pt.getProperty)(l)}`);e.if((0,Pt._)`typeof ${u} == "string"`,()=>p(),()=>t.error(!1,{discrError:Hr.DiscrError.Tag,tag:u,tagName:l})),t.ok(m);function p(){const C=k();e.if(!1);for(const E in C)e.elseIf((0,Pt._)`${u} === ${E}`),e.assign(m,g(C[E]));e.else(),t.error(!1,{discrError:Hr.DiscrError.Mapping,tag:u,tagName:l}),e.endIf()}function g(C){const E=e.name("valid"),S=t.subschema({keyword:"oneOf",schemaProp:C},E);return t.mergeEvaluated(S,Pt.Name),E}function k(){var C;const E={},S=y(s);let v=!0;for(let j=0;j<c.length;j++){let D=c[j];D?.$ref&&!(0,Ru.schemaHasRulesButRef)(D,i.self.RULES)&&(D=Es.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D?.$ref),D instanceof Es.SchemaEnv&&(D=D.schema));const _=(C=D?.properties)===null||C===void 0?void 0:C[l];if(typeof _!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);v=v&&(S||y(D)),T(_,j)}if(!v)throw new Error(`discriminator: "${l}" must be required`);return E;function y({required:j}){return Array.isArray(j)&&j.includes(l)}function T(j,D){if(j.const)R(j.const,D);else if(j.enum)for(const _ of j.enum)R(_,D);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function R(j,D){if(typeof j!="string"||j in E)throw new Error(`discriminator: "${l}" values must be unique strings`);E[j]=D}}}};An.default=Nu;const Cu="http://json-schema.org/draft-07/schema#",ju="http://json-schema.org/draft-07/schema#",ku="Core schema meta-schema",Iu={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Au=["object","boolean"],Du={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},qu={$schema:Cu,$id:ju,title:ku,definitions:Iu,type:Au,properties:Du,default:!0};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=ri,n=nn,s=An,i=qu,c=["/properties"],l="http://json-schema.org/draft-07/schema";class m extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(E=>this.addVocabulary(E)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const E=this.opts.$data?this.$dataMetaSchema(i,c):i;this.addMetaSchema(E,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.exports=e=m,Object.defineProperty(e,"__esModule",{value:!0}),e.default=m;var u=Ne;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var p=B;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var g=Xt;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return g.default}});var k=er;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return k.default}})})(Dr,Dr.exports);var Fu=Dr.exports;const Mu=Bo(Fu),Uu="http://json-schema.org/schema",Lu="#/definitions/Blueprint",Hu={Blueprint:{type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},phpExtensionBundles:{type:"array",items:{$ref:"#/definitions/SupportedPHPExtensionBundle"},description:"The PHP extensions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run."},$schema:{type:"string"}},additionalProperties:!1},SupportedPHPVersion:{type:"string",enum:["8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0","5.6"]},SupportedPHPExtensionBundle:{type:"string",const:"kitchen-sink"},StepDefinition:{type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"applyWordPressPatches"},siteUrl:{type:"string"},wordpressPath:{type:"string"},addPhpInfo:{type:"boolean"},patchSecrets:{type:"boolean"},disableSiteHealth:{type:"boolean"},disableWpNewBlogNotification:{type:"boolean"},makeEditorFrameControlled:{type:"boolean"},prepareForRunningInsideWebBrowser:{type:"boolean"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},virtualize:{type:"boolean",description:"Enables the virtualization of wp-config.php and playground-consts.json files, leaving the local system files untouched. The variables defined in the /vfs-blueprints/playground-consts.json file are loaded via the auto_prepend_file directive in the php.ini file.",default:!1}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importFile"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"replaceSite"},fullSiteZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the new WordPress site"}},required:["fullSiteZip","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setPhpIniEntry"},key:{type:"string",description:'Entry name e.g. "display_errors"'},value:{type:"string",description:'Entry value as a string e.g. "1"'}},required:["key","step","value"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipPath:{type:"string",description:"The zip file to extract"},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step","zipPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]}]},FileReference:{anyOf:[{$ref:"#/definitions/VFSReference"},{$ref:"#/definitions/LiteralReference"},{$ref:"#/definitions/CoreThemeReference"},{$ref:"#/definitions/CorePluginReference"},{$ref:"#/definitions/UrlReference"}]},VFSReference:{type:"object",properties:{resource:{type:"string",const:"vfs",description:"Identifies the file resource as Virtual File System (VFS)"},path:{type:"string",description:"The path to the file in the VFS"}},required:["resource","path"],additionalProperties:!1},LiteralReference:{type:"object",properties:{resource:{type:"string",const:"literal",description:"Identifies the file resource as a literal file"},name:{type:"string",description:"The name of the file"},contents:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The contents of the file"}},required:["resource","name","contents"],additionalProperties:!1},CoreThemeReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/themes",description:"Identifies the file resource as a WordPress Core theme"},slug:{type:"string",description:"The slug of the WordPress Core theme"}},required:["resource","slug"],additionalProperties:!1},CorePluginReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/plugins",description:"Identifies the file resource as a WordPress Core plugin"},slug:{type:"string",description:"The slug of the WordPress Core plugin"}},required:["resource","slug"],additionalProperties:!1},UrlReference:{type:"object",properties:{resource:{type:"string",const:"url",description:"Identifies the file resource as a URL"},url:{type:"string",description:"The URL of the file"},caption:{type:"string",description:"Optional caption for displaying a progress message"}},required:["resource","url"],additionalProperties:!1},InstallPluginOptions:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the plugin after installing it."}},additionalProperties:!1},PHPRequest:{type:"object",properties:{method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},url:{type:"string",description:"Request path or absolute URL."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},files:{type:"object",additionalProperties:{type:"object",properties:{size:{type:"number"},type:{type:"string"},lastModified:{type:"number"},name:{type:"string"},webkitRelativePath:{type:"string"}},required:["lastModified","name","size","type","webkitRelativePath"],additionalProperties:!1},description:"Uploaded files"},body:{type:"string",description:"Request body without the files."},formData:{type:"object",additionalProperties:{},description:"Form data. If set, the request body will be ignored and the content-type header will be set to `application/x-www-form-urlencoded`."}},required:["url"],additionalProperties:!1},HTTPMethod:{type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]},PHPRequestHeaders:{type:"object",additionalProperties:{type:"string"}},PHPRunOptions:{type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{type:"string",description:"Request body without the files."},fileInfos:{type:"array",items:{$ref:"#/definitions/FileInfo"},description:"Uploaded files."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},FileInfo:{type:"object",properties:{key:{type:"string"},name:{type:"string"},type:{type:"string"},data:{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}},required:["key","name","type","data"],additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},Vu={$schema:Uu,$ref:Lu,definitions:Hu};function zu(t,{progress:e=new Gr,semaphore:r=new Ms({concurrency:3}),onStepCompleted:n=()=>{}}={}){t={...t,steps:(t.steps||[]).filter(xu)};const{valid:s,errors:i}=Ku(t);if(!s){const u=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw u.errors=i,u}const c=t.steps||[],l=c.reduce((u,p)=>u+(p.progress?.weight||1),0),m=c.map(u=>Ju(u,{semaphore:r,rootProgressTracker:e,totalProgressWeight:l}));return{versions:{php:Bu(t.preferredVersions?.php,Zs,wo),wp:t.preferredVersions?.wp||"latest"},phpExtensions:Gu([],t.phpExtensionBundles||[]),run:async u=>{try{for(const{resources:p}of m)for(const g of p)g.setPlayground(u),g.isAsync&&g.resolve();for(const{run:p,step:g}of m){const k=await p(u);n(k,g)}}finally{try{await u.goTo(t.landingPage||"/")}catch{}e.finish()}}}}const Wu=new Mu({discriminator:!0});let dr;function Ku(t){dr=Wu.compile(Vu);const e=dr(t);if(e)return{valid:e};const r=new Set;for(const s of dr.errors)s.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(s.instancePath);const n=dr.errors?.filter(s=>!(s.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(s.instancePath)));return{valid:e,errors:n}}function Bu(t,e,r){return t&&e.includes(t)?t:r}function Gu(t,e){const r=Qs.filter(s=>t.includes(s)),n=e.flatMap(s=>s in rs?rs[s]:[]);return Array.from(new Set([...r,...n]))}function xu(t){return!!(typeof t=="object"&&t)}function Ju(t,{semaphore:e,rootProgressTracker:r,totalProgressWeight:n}){const s=r.stage((t.progress?.weight||1)/n),i={};for(const p of Object.keys(t)){let g=t[p];qo(g)&&(g=ut.create(g,{semaphore:e})),i[p]=g}const c=async p=>{try{return s.fillSlowly(),await ao[t.step](p,await Yu(i),{tracker:s,initialCaption:t.progress?.caption})}finally{s.finish()}},l=Ss(i),m=Ss(i).filter(p=>p.isAsync),u=1/(m.length+1);for(const p of m)p.progress=s.stage(u);return{run:c,step:t,resources:l}}function Ss(t){const e=[];for(const r in t){const n=t[r];n instanceof ut&&e.push(n)}return e}async function Yu(t){const e={};for(const r in t){const n=t[r];n instanceof ut?e[r]=await n.resolve():e[r]=n}return e}async function Zu(t,e){await t.run(e)}function Qu(){}exports.activatePlugin=Vr;exports.activateTheme=zr;exports.applyWordPressPatches=Ts;exports.compileBlueprint=zu;exports.cp=ks;exports.defineSiteUrl=Fs;exports.defineWpConfigConsts=Et;exports.importFile=Hs;exports.installPlugin=Ws;exports.installTheme=Ks;exports.login=Bs;exports.mkdir=Ds;exports.mv=Is;exports.replaceSite=Ls;exports.request=js;exports.rm=As;exports.rmdir=qs;exports.runBlueprintSteps=Zu;exports.runPHP=Os;exports.runPHPWithOptions=Ns;exports.runWpInstallationWizard=Gs;exports.setPhpIniEntry=Cs;exports.setPluginProxyURL=Qu;exports.setSiteOptions=xs;exports.unzip=br;exports.updateUserMeta=Js;exports.writeFile=Kr;exports.zipEntireSite=Us;