@wp-playground/client 0.3.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 +26 -26
- package/index.d.ts +5 -1
- package/index.js +868 -872
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -20,14 +20,14 @@ echo 'NO_ENTRY_FILE';
|
|
|
20
20
|
define( 'WP_ADMIN', true );
|
|
21
21
|
require_once( '${n}' );
|
|
22
22
|
switch_theme( '${t}' );
|
|
23
|
-
`})};function Cr(e){const t=e.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}async function ct(e,t,r){let n="";await e.fileExists(t)&&(n=await e.readFileAsText(t)),await e.writeFile(t,r(n))}async function
|
|
23
|
+
`})};function Cr(e){const t=e.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}async function ct(e,t,r){let n="";await e.fileExists(t)&&(n=await e.readFileAsText(t)),await e.writeFile(t,r(n))}async function Eo(e){return new Uint8Array(await e.arrayBuffer())}class So extends File{constructor(t,r){super(t,r),this.buffers=t}async arrayBuffer(){return this.buffers[0]}}const sn=File.prototype.arrayBuffer instanceof Function?File:So,as="/vfs-blueprints",Ot=async(e,{consts:t,virtualize:r=!1})=>{const n=await e.documentRoot,s=r?as:n,i=`${s}/playground-consts.json`,o=`${s}/wp-config.php`;return r&&(e.mkdir(as),e.setPhpIniEntry("auto_prepend_file",o)),await ct(e,i,l=>JSON.stringify({...JSON.parse(l||"{}"),...t})),await ct(e,o,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}`),o},
|
|
30
|
+
?>${l}`),o},To=`<?php
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* This transport delegates PHP HTTP requests to JavaScript synchronous XHR.
|
|
@@ -172,7 +172,7 @@ JAVASCRIPT;
|
|
|
172
172
|
return true;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
`,
|
|
175
|
+
`,Ro=`<?php
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* This transport does not perform any HTTP requests and only exists
|
|
@@ -215,7 +215,7 @@ class Requests_Transport_Dummy implements Requests_Transport
|
|
|
215
215
|
return true;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
`,
|
|
218
|
+
`,Oo=`<?php
|
|
219
219
|
/**
|
|
220
220
|
* The default WordPress requests transports have been disabled
|
|
221
221
|
* at this point. However, the Requests class requires at least
|
|
@@ -239,7 +239,7 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
|
|
|
239
239
|
require(__DIR__ . '/includes/requests_transport_dummy.php');
|
|
240
240
|
Requests::add_transport('Requests_Transport_Dummy');
|
|
241
241
|
}
|
|
242
|
-
`,
|
|
242
|
+
`,No=`<?php
|
|
243
243
|
/**
|
|
244
244
|
* Add a notice to wp-login.php offering the username and password.
|
|
245
245
|
*/
|
|
@@ -254,7 +254,7 @@ add_action(
|
|
|
254
254
|
EOT;
|
|
255
255
|
}
|
|
256
256
|
);
|
|
257
|
-
`,
|
|
257
|
+
`,Co=`<?php
|
|
258
258
|
/**
|
|
259
259
|
* Because the in-browser Playground doesn't have access to the internet,
|
|
260
260
|
* network-dependent features like directories don't work. Normally, you'll
|
|
@@ -289,7 +289,7 @@ add_filter( 'gettext', function( $translation ) {
|
|
|
289
289
|
}
|
|
290
290
|
return $translation;
|
|
291
291
|
} );
|
|
292
|
-
`,
|
|
292
|
+
`,ko=`<?php
|
|
293
293
|
/**
|
|
294
294
|
* Links with target="top" don't work in the playground iframe because of
|
|
295
295
|
* the sandbox attribute. What they really should be targeting is the
|
|
@@ -310,7 +310,7 @@ add_action('admin_print_scripts', function () {
|
|
|
310
310
|
<\/script>
|
|
311
311
|
<?php
|
|
312
312
|
});
|
|
313
|
-
`,
|
|
313
|
+
`,Ws=async(e,t)=>{const r=new jo(e,t.wordpressPath||"/wordpress",t.siteUrl);t.addPhpInfo===!0&&await r.addPhpInfo(),t.siteUrl&&await r.patchSiteUrl(),t.patchSecrets===!0&&await r.patchSecrets(),t.disableSiteHealth===!0&&await r.disableSiteHealth(),t.disableWpNewBlogNotification===!0&&await r.disableWpNewBlogNotification(),t.makeEditorFrameControlled===!0&&await Ks(e,r.wordpressPath,[`${r.wordpressPath}/wp-includes/js/dist/block-editor.js`,`${r.wordpressPath}/wp-includes/js/dist/block-editor.min.js`]),t.prepareForRunningInsideWebBrowser===!0&&await r.prepareForRunningInsideWebBrowser()};class jo{constructor(t,r,n){this.php=t,this.scopedSiteUrl=n,this.wordpressPath=r}async addPhpInfo(){await this.php.writeFile(`${this.wordpressPath}/phpinfo.php`,"<?php phpinfo(); ")}async patchSiteUrl(){await Ot(this.php,{consts:{WP_HOME:this.scopedSiteUrl,WP_SITEURL:this.scopedSiteUrl},virtualize:!0})}async patchSecrets(){await Ot(this.php,{consts:{AUTH_KEY:xe(40),SECURE_AUTH_KEY:xe(40),LOGGED_IN_KEY:xe(40),NONCE_KEY:xe(40),AUTH_SALT:xe(40),SECURE_AUTH_SALT:xe(40),LOGGED_IN_SALT:xe(40),NONCE_SALT:xe(40)}}),await ct(this.php,`${this.wordpressPath}/wp-config.php`,t=>t.replaceAll("', 'put your unique phrase here'","__', ''"))}async disableSiteHealth(){await ct(this.php,`${this.wordpressPath}/wp-includes/default-filters.php`,t=>t.replace(/add_filter[^;]+wp_maybe_grant_site_health_caps[^;]+;/i,""))}async disableWpNewBlogNotification(){await ct(this.php,`${this.wordpressPath}/wp-config.php`,t=>`${t} function wp_new_blog_notification(...$args){} `)}async prepareForRunningInsideWebBrowser(){await Ot(this.php,{consts:{USE_FETCH_FOR_REQUESTS:!1}});const t=[`${this.wordpressPath}/wp-includes/Requests/Transport/fsockopen.php`,`${this.wordpressPath}/wp-includes/Requests/Transport/cURL.php`];for(const r of t)await this.php.fileExists(r)&&await ct(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`,To),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/includes/requests_transport_dummy.php`,Ro),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/add_requests_transport.php`,Oo),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/1-show-admin-credentials-on-wp-login.php`,No),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/2-nice-error-messages-for-plugins-and-themes-directories.php`,Co),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/3-links-targeting-top-frame-should-target-playground-iframe.php`,ko)}}function xe(e){const t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=-[]/.,<>?";let r="";for(let n=e;n>0;--n)r+=t[Math.floor(Math.random()*t.length)];return r}async function Ks(e,t,r){const n=`
|
|
314
314
|
/**
|
|
315
315
|
* A synchronous function to read a blob URL as text.
|
|
316
316
|
*
|
|
@@ -354,7 +354,7 @@ add_action('admin_print_scripts', function () {
|
|
|
354
354
|
srcDoc: undefined
|
|
355
355
|
})
|
|
356
356
|
)
|
|
357
|
-
});`;for(const s of r)await e.fileExists(s)&&await ct(e,s,i=>`${n} ${i.replace(/\(\s*"iframe",/,"(__playground_ControlledIframe,")}`);await e.writeFile(`${t}/wp-includes/empty.html`,"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>")}const
|
|
357
|
+
});`;for(const s of r)await e.fileExists(s)&&await ct(e,s,i=>`${n} ${i.replace(/\(\s*"iframe",/,"(__playground_ControlledIframe,")}`);await e.writeFile(`${t}/wp-includes/empty.html`,"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>")}const xs=async(e,{code:t})=>await e.run({code:t}),Bs=async(e,{options:t})=>await e.run(t),Gs=async(e,{key:t,value:r})=>{await e.setPhpIniEntry(t,r)},Js=async(e,{request:t})=>await e.request(t),Ys=async(e,{fromPath:t,toPath:r})=>{await e.writeFile(r,await e.readFileAsBuffer(t))},Qs=async(e,{fromPath:t,toPath:r})=>{await e.mv(t,r)},Xs=async(e,{path:t})=>{await e.unlink(t)},Zs=async(e,{path:t})=>{await e.mkdir(t)},ei=async(e,{path:t})=>{await e.rmdir(t)},on=async(e,{path:t,data:r})=>{r instanceof File&&(r=await Eo(r)),await e.writeFile(t,r)},ti=async(e,{siteUrl:t})=>await Ot(e,{consts:{WP_HOME:t,WP_SITEURL:t}});class ri{constructor({concurrency:t}){this._running=0,this.concurrency=t,this.queue=[]}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency)await new Promise(t=>this.queue.push(t));else{this._running++;let t=!1;return()=>{t||(t=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(t){const r=await this.acquire();try{return await t()}finally{r()}}}const Io=Symbol("literal");function ut(e){if(typeof e=="string")return e.startsWith("$")?e:JSON.stringify(e);if(typeof e=="number")return e.toString();if(Array.isArray(e))return`array(${e.map(ut).join(", ")})`;if(e===null)return"null";if(typeof e=="object")return Io in e?e.toString():`array(${Object.entries(e).map(([r,n])=>`${JSON.stringify(r)} => ${ut(n)}`).join(", ")})`;if(typeof e=="function")return e();throw new Error(`Unsupported value: ${e}`)}function kr(e){const t={};for(const r in e)t[r]=ut(e[r]);return t}const cs=`<?php
|
|
358
358
|
|
|
359
359
|
function zipDir($dir, $output, $additionalFiles = array())
|
|
360
360
|
{
|
|
@@ -416,32 +416,32 @@ function delTree($dir)
|
|
|
416
416
|
}
|
|
417
417
|
return rmdir($dir);
|
|
418
418
|
}
|
|
419
|
-
`;async function
|
|
419
|
+
`;async function ni(e){const t="wordpress-playground.zip",r=`/tmp/${t}`,n=kr({zipPath:r,documentRoot:await e.documentRoot});await oi(e,`zipDir(${n.documentRoot}, ${n.zipPath});`);const s=await e.readFileAsBuffer(r);return e.unlink(r),new File([s],t)}const si=async(e,{fullSiteZip:t})=>{const r="/import.zip";await e.writeFile(r,new Uint8Array(await t.arrayBuffer()));const n=await e.absoluteUrl,s=await e.documentRoot;await e.rmdir(s),await jr(e,{zipPath:r,extractToPath:"/"});const i=kr({absoluteUrl:n});await Do(e,`${s}/wp-config.php`,o=>`<?php
|
|
420
420
|
if(!defined('WP_HOME')) {
|
|
421
421
|
define('WP_HOME', ${i.absoluteUrl});
|
|
422
422
|
define('WP_SITEURL', ${i.absoluteUrl});
|
|
423
423
|
}
|
|
424
|
-
?>${o}`)},jr=async(e,{zipPath:t,extractToPath:r})=>{const n=kr({zipPath:t,extractToPath:r});await
|
|
424
|
+
?>${o}`)},jr=async(e,{zipPath:t,extractToPath:r})=>{const n=kr({zipPath:t,extractToPath:r});await oi(e,`unzip(${n.zipPath}, ${n.extractToPath});`)},ii=async(e,{file:t})=>{const r=await e.request({url:"/wp-admin/admin.php?import=wordpress"}),n=ls(r).getElementById("import-upload-form")?.getAttribute("action"),s=await e.request({url:`/wp-admin/${n}`,method:"POST",files:{import:t}}),i=ls(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 o=Ao(i);o.fetch_attachments="1";for(const l in o)if(l.startsWith("user_map[")){const p="user_new["+l.slice(9,-1)+"]";o[p]="1"}await e.request({url:i.action,method:"POST",formData:o})};function ls(e){return new DOMParser().parseFromString(e.text,"text/html")}function Ao(e){return Object.fromEntries(new FormData(e).entries())}async function Do(e,t,r){await e.writeFile(t,r(await e.readFileAsText(t)))}async function oi(e,t){const r=await e.run({code:cs+t});if(r.exitCode!==0)throw console.log(cs+t),console.log(t+""),console.log(r.errors),r.errors;return r}async function ai(e,{targetPath:t,zipFile:r}){const n=r.name,s=n.replace(/\.zip$/,""),i=`/tmp/assets/${s}`,o=`/tmp/${n}`,l=()=>e.rmdir(i,{recursive:!0});await e.fileExists(i)&&await l(),await on(e,{path:o,data:r});const p=()=>Promise.all([l,()=>e.unlink(o)]);try{await jr(e,{zipPath:o,extractToPath:i});const u=await e.listFiles(i,{prependPath:!0}),d=u.length===1&&await e.isDir(u[0]);let g,C="";d?(C=u[0],g=u[0].split("/").pop()):(C=i,g=s);const k=`${t}/${g}`;return await e.mv(C,k),await p(),{assetFolderPath:k,assetFolderName:g}}catch(u){throw await p(),u}}const ci=async(e,{pluginZipFile:t,options:r={}},n)=>{const s=t.name.split("/").pop()||"plugin.zip",i=Cr(s);n?.tracker.setCaption(`Installing the ${i} plugin`);try{const{assetFolderPath:o}=await ai(e,{zipFile:t,targetPath:`${await e.documentRoot}/wp-content/plugins`});("activate"in r?r.activate:!0)&&await rn(e,{pluginPath:o,pluginName:i},n),await Fo(e)}catch(o){console.error(`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${o}`),console.error(o)}};async function Fo(e){await e.isDir("/wordpress/wp-content/plugins/gutenberg")&&!await e.fileExists("/wordpress/.gutenberg-patched")&&(await e.writeFile("/wordpress/.gutenberg-patched","1"),await Ks(e,"/wordpress",["/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.js","/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.min.js"]))}const li=async(e,{themeZipFile:t,options:r={}},n)=>{const s=Cr(t.name);n?.tracker.setCaption(`Installing the ${s} theme`);try{const{assetFolderName:i}=await ai(e,{zipFile:t,targetPath:`${await e.documentRoot}/wp-content/themes`});("activate"in r?r.activate:!0)&&await nn(e,{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)}},ui=async(e,{username:t="admin",password:r="password"}={},n)=>{n?.tracker.setCaption(n?.initialCaption||"Logging in"),await e.request({url:"/wp-login.php"}),await e.request({url:"/wp-login.php",method:"POST",formData:{log:t,pwd:r,rememberme:"forever"}})},di=async(e,{options:t})=>{await e.request({url:"/wp-admin/install.php?step=2",method:"POST",formData:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:t.adminPassword||"admin",admin_password:t.adminPassword||"password",admin_password2:t.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},fi=async(e,{options:t})=>{const r=`<?php
|
|
425
425
|
include 'wordpress/wp-load.php';
|
|
426
426
|
$site_options = ${ut(t)};
|
|
427
427
|
foreach($site_options as $name => $value) {
|
|
428
428
|
update_option($name, $value);
|
|
429
429
|
}
|
|
430
430
|
echo "Success";
|
|
431
|
-
`,n=await e.run({code:r});return
|
|
431
|
+
`,n=await e.run({code:r});return hi(n),{code:r,result:n}},pi=async(e,{meta:t,userId:r})=>{const n=`<?php
|
|
432
432
|
include 'wordpress/wp-load.php';
|
|
433
433
|
$meta = ${ut(t)};
|
|
434
434
|
foreach($meta as $name => $value) {
|
|
435
435
|
update_user_meta(${ut(r)}, $name, $value);
|
|
436
436
|
}
|
|
437
437
|
echo "Success";
|
|
438
|
-
`,s=await e.run({code:n});return
|
|
438
|
+
`,s=await e.run({code:n});return hi(s),{code:n,result:s}};async function hi(e){if(e.text!=="Success")throw console.log(e),new Error(`Failed to run code: ${e.text} ${e.errors}`)}const qo=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:rn,activateTheme:nn,applyWordPressPatches:Ws,cp:Ys,defineSiteUrl:ti,defineWpConfigConsts:Ot,importFile:ii,installPlugin:ci,installTheme:li,login:ui,mkdir:Zs,mv:Qs,replaceSite:si,request:Js,rm:Xs,rmdir:ei,runPHP:xs,runPHPWithOptions:Bs,runWpInstallationWizard:di,setPhpIniEntry:Gs,setSiteOptions:fi,unzip:jr,updateUserMeta:pi,writeFile:on,zipEntireSite:ni},Symbol.toStringTag,{value:"Module"})),Mo=5*1024*1024;function Uo(e,t){const r=e.headers.get("content-length")||"",n=parseInt(r,10)||Mo;function s(i,o){t(new CustomEvent("progress",{detail:{loaded:i,total:o}}))}return new Response(new ReadableStream({async start(i){if(!e.body){i.close();return}const o=e.body.getReader();let l=0;for(;;)try{const{done:p,value:u}=await o.read();if(u&&(l+=u.byteLength),p){s(l,l),i.close();break}else s(l,n),i.enqueue(u)}catch(p){console.error({e:p}),i.error(p);break}}}),{status:e.status,statusText:e.statusText,headers:e.headers})}const Lr=1e-5;class Ir extends EventTarget{constructor({weight:t=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=t,this._selfCaption=r,this._fillTime=n}stage(t,r=""){if(t||(t=this._selfWeight),this._selfWeight-t<-Lr)throw new Error(`Cannot add a stage with weight ${t} as the total weight of registered stages would exceed 1.`);this._selfWeight-=t;const n=new Ir({caption:r,weight:t,fillTime:this._fillTime});return this._subTrackers.push(n),n.addEventListener("progress",()=>this.notifyProgress()),n.addEventListener("done",()=>{this.done&&this.notifyDone()}),n}fillSlowly({stopBeforeFinishing:t=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,n=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),t&&this._selfProgress>=99&&clearInterval(this._fillInterval)},n)}set(t){this._selfProgress=Math.min(t,100),this.notifyProgress(),this._selfProgress+Lr>=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 t=this._subTrackers.length-1;t>=0;t--)if(!this._subTrackers[t].done){const r=this._subTrackers[t].caption;if(r)return r}return this._selfCaption}setCaption(t){this._selfCaption=t,this.notifyProgress()}get done(){return this.progress+Lr>=100}get progress(){if(this._selfDone)return 100;const t=this._subTrackers.reduce((r,n)=>r+n.progress*n.weight,this._selfProgress*this._selfWeight);return Math.round(t*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=t=>{this.set(t)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=t=>{this.set(t.detail.loaded/t.detail.total*100)}),this._loadingListener}pipe(t){t.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{t.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{t.setLoaded()})}addEventListener(t,r){super.addEventListener(t,r)}removeEventListener(t,r){super.removeEventListener(t,r)}notifyProgress(){const t=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return t.progress},get caption(){return t.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const us=Symbol("error"),ds=Symbol("message");class an extends Event{constructor(t,r={}){super(t),this[us]=r.error===void 0?null:r.error,this[ds]=r.message===void 0?"":r.message}get error(){return this[us]}get message(){return this[ds]}}Object.defineProperty(an.prototype,"error",{enumerable:!0});Object.defineProperty(an.prototype,"message",{enumerable:!0});const Lo=typeof globalThis.ErrorEvent=="function"?globalThis.ErrorEvent:an;function Ho(e){return e instanceof Error?"exitCode"in e&&e?.exitCode===0||e?.name==="ExitStatus"&&"status"in e&&e.status===0:!1}class Vo extends EventTarget{constructor(){super(...arguments),this.listenersCount=0}addEventListener(t,r){++this.listenersCount,super.addEventListener(t,r)}removeEventListener(t,r){--this.listenersCount,super.removeEventListener(t,r)}hasListeners(){return this.listenersCount>0}}function zo(e){e.asm={...e.asm};const t=new Vo;for(const r in e.asm)if(typeof e.asm[r]=="function"){const n=e.asm[r];e.asm[r]=function(...s){try{return n(...s)}catch(i){if(!(i instanceof Error))throw i;const o=Ko(i,e.lastAsyncifyStackSource?.stack);if(e.lastAsyncifyStackSource&&(i.cause=e.lastAsyncifyStackSource),t.hasListeners()){t.dispatchEvent(new Lo("error",{error:i,message:o}));return}throw Ho(i)||Go(o),i}}}return t}let Br=[];function Wo(){return Br}function Ko(e,t){if(e.message==="unreachable"){let r=xo;t||(r+=`
|
|
439
439
|
|
|
440
440
|
This stack trace is lacking. For a better one initialize
|
|
441
441
|
the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
|
|
442
442
|
|
|
443
|
-
`),Br=
|
|
444
|
-
`;return r}return e.message}const
|
|
443
|
+
`),Br=Jo(t||e.stack||"");for(const n of Br)r+=` * ${n}
|
|
444
|
+
`;return r}return e.message}const xo=`
|
|
445
445
|
"unreachable" WASM instruction executed.
|
|
446
446
|
|
|
447
447
|
The typical reason is a PHP function missing from the ASYNCIFY_ONLY
|
|
@@ -465,24 +465,24 @@ the Dockerfile, you'll need to trigger this error again with long stack
|
|
|
465
465
|
traces enabled. In node.js, you can do it using the --stack-trace-limit=100
|
|
466
466
|
CLI option:
|
|
467
467
|
|
|
468
|
-
`,
|
|
469
|
-
${
|
|
470
|
-
${
|
|
471
|
-
`))console.log(`${
|
|
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(t))}catch{return[]}}class lt{constructor(t,r,n,s="",i=0){this.httpStatusCode=t,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(t){return new lt(t.httpStatusCode,t.headers,t.bytes,t.errors,t.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 Ar=["8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0","5.6"],
|
|
468
|
+
`,fs="\x1B[41m",Bo="\x1B[1m",ps="\x1B[0m",hs="\x1B[K";let ms=!1;function Go(e){if(!ms){ms=!0,console.log(`${fs}
|
|
469
|
+
${hs}
|
|
470
|
+
${Bo} WASM ERROR${ps}${fs}`);for(const t of e.split(`
|
|
471
|
+
`))console.log(`${hs} ${t} `);console.log(`${ps}`)}}function Jo(e){try{const t=e.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(t))}catch{return[]}}class lt{constructor(t,r,n,s="",i=0){this.httpStatusCode=t,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(t){return new lt(t.httpStatusCode,t.headers,t.bytes,t.errors,t.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 Ar=["8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0","5.6"],mi=Ar[0],Yo=Ar,yi=["iconv","mbstring","xml-bundle","gd"],ys={"kitchen-sink":yi};class Qo{#e;#t;constructor(t,r={}){this.requestHandler=t,this.#e={},this.#t={handleRedirects:!1,maxRedirects:4,...r}}async request(t,r=0){const n=await this.requestHandler.request({...t,headers:{...t.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(t){return this.requestHandler.pathToInternalUrl(t)}internalUrlToPath(t){return this.requestHandler.internalUrlToPath(t)}get absoluteUrl(){return this.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.documentRoot}#n(t){for(const r of t)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 t=[];for(const r in this.#e)t.push(`${r}=${this.#e[r]}`);return t.join("; ")}}const Xo="http://example.com";function gs(e){return e.toString().substring(e.origin.length)}function $s(e,t){return!t||!e.startsWith(t)?e:e.substring(t.length)}function Zo(e,t){return!t||e.startsWith(t)?e:t+e}class ea{#e;#t;#n;#r;#i;#s;#o;#a;constructor(t,r={}){this.#a=new ri({concurrency:1});const{documentRoot:n="/www/",absoluteUrl:s=typeof location=="object"?location?.href:""}=r;this.php=t,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 o=this.#r!==443&&this.#r!==80;this.#i=[this.#n,o?`:${this.#r}`:""].join(""),this.#s=i.pathname.replace(/\/+$/,""),this.#o=[`${this.#t}://`,this.#i,this.#s].join("")}pathToInternalUrl(t){return`${this.absoluteUrl}${t}`}internalUrlToPath(t){const r=new URL(t);return r.pathname.startsWith(this.#s)&&(r.pathname=r.pathname.slice(this.#s.length)),gs(r)}get isRequestRunning(){return this.#a.running>0}get absoluteUrl(){return this.#o}get documentRoot(){return this.#e}async request(t){const r=t.url.startsWith("http://")||t.url.startsWith("https://"),n=new URL(t.url,r?void 0:Xo),s=$s(n.pathname,this.#s),i=`${this.#e}${s}`;return na(i)?await this.#l(t,n):this.#c(i)}#c(t){if(!this.php.fileExists(t))return new lt(404,{"x-file-type":["static"]},new TextEncoder().encode("404 File not found"));const r=this.php.readFileAsBuffer(t);return new lt(200,{"content-length":[`${r.byteLength}`],"content-type":[ra(t)],"accept-ranges":["bytes"],"cache-control":["public, max-age=0"]},r)}async#l(t,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,...gi(t.headers||{})},o=[];if(t.files&&Object.keys(t.files).length){s="POST";for(const u in t.files){const d=t.files[u];o.push({key:u,name:d.name,type:d.type,data:new Uint8Array(await d.arrayBuffer())})}i["content-type"]?.startsWith("multipart/form-data")&&(t.formData=ta(t.body||""),i["content-type"]="application/x-www-form-urlencoded",delete t.body)}let l;t.formData!==void 0?(s="POST",i["content-type"]=i["content-type"]||"application/x-www-form-urlencoded",l=new URLSearchParams(t.formData).toString()):l=t.body;let p;try{p=this.#u(r.pathname)}catch{return new lt(404,{},new TextEncoder().encode("404 File not found"))}return await this.php.run({relativeUri:Zo(gs(r),this.#s),protocol:this.#t,method:t.method||s,body:l,fileInfos:o,scriptPath:p,headers:i})}finally{n()}}#u(t){let r=$s(t,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 ta(e){const t={},r=e.match(/--(.*)\r\n/);if(!r)return t;const n=r[1],s=e.split(`--${n}`);return s.shift(),s.pop(),s.forEach(i=>{const o=i.indexOf(`\r
|
|
473
473
|
\r
|
|
474
|
-
`),l=i.substring(0,o).trim(),p=i.substring(o+4).trim(),u=l.match(/name="([^"]+)"/);if(u){const d=u[1];t[d]=p}}),t}function
|
|
474
|
+
`),l=i.substring(0,o).trim(),p=i.substring(o+4).trim(),u=l.match(/name="([^"]+)"/);if(u){const d=u[1];t[d]=p}}),t}function ra(e){switch(e.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 na(e){return sa(e)||ia(e)}function sa(e){return e.endsWith(".php")||e.includes(".php/")}function ia(e){return!e.split("/").pop().includes(".")}const vs={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(e=""){return function(r,n,s){const i=s.value;s.value=function(...o){try{return i.apply(this,o)}catch(l){const p=typeof l=="object"?l?.errno:null;if(p in vs){const u=vs[p],d=typeof o[0]=="string"?o[0]:null,g=d!==null?e.replaceAll("{path}",d):e;throw new Error(`${g}: ${u}`,{cause:l})}throw l}}}}const oa=[];function aa(e){return oa[e]}(function(){return typeof process<"u"&&process.release?.name==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();var ca=Object.defineProperty,la=Object.getOwnPropertyDescriptor,ke=(e,t,r,n)=>{for(var s=n>1?void 0:n?la(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(n?o(t,r,s):o(s))||s);return n&&s&&ca(t,r,s),s};const me="string",Pt="number",ee=Symbol("__private__dont__use");class je{constructor(t,r){this.#e=[],this.#t=!1,this.#n=null,this.#r={},this.#i=[],t!==void 0&&this.initializeRuntime(t),r&&(this.requestHandler=new Qo(new ea(this,r)))}#e;#t;#n;#r;#i;async onMessage(t){this.#i.push(t)}get absoluteUrl(){return this.requestHandler.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.requestHandler.documentRoot}pathToInternalUrl(t){return this.requestHandler.requestHandler.pathToInternalUrl(t)}internalUrlToPath(t){return this.requestHandler.requestHandler.internalUrlToPath(t)}initializeRuntime(t){if(this[ee])throw new Error("PHP runtime already initialized.");const r=aa(t);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=zo(r)}setPhpIniPath(t){if(this.#t)throw new Error("Cannot set PHP ini path after calling run().");this[ee].ccall("wasm_set_phpini_path",null,["string"],[t])}setPhpIniEntry(t,r){if(this.#t)throw new Error("Cannot set PHP ini entries after calling run().");this.#e.push([t,r])}chdir(t){this[ee].FS.chdir(t)}async request(t,r){if(!this.requestHandler)throw new Error("No request handler available.");return this.requestHandler.request(t,r)}async run(t){this.#t||(this.#s(),this.#t=!0),this.#f(t.scriptPath||""),this.#a(t.relativeUri||""),this.#l(t.method||"GET");const{host:r,...n}={host:"example.com:443",...gi(t.headers||{})};if(this.#c(r,t.protocol||"http"),this.#u(n),t.body&&this.#d(t.body),t.fileInfos)for(const s of t.fileInfos)this.#h(s);return t.code&&this.#m(" ?>"+t.code),this.#p(),await this.#y()}#s(){if(this.#e.length>0){const t=this.#e.map(([r,n])=>`${r}=${n}`).join(`
|
|
475
475
|
`)+`
|
|
476
476
|
|
|
477
|
-
`;this[ee].ccall("wasm_set_phpini_entries",null,[me],[t])}this[ee].ccall("php_wasm_init",null,[],[])}#o(){const t="/tmp/headers.json";if(!this.fileExists(t))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(t)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),o=s.substring(0,i).toLowerCase(),l=s.substring(i+2);o in n||(n[o]=[]),n[o].push(l)}return{headers:n,httpStatusCode:r.status}}#a(t){if(this[ee].ccall("wasm_set_request_uri",null,[me],[t]),t.includes("?")){const r=t.substring(t.indexOf("?")+1);this[ee].ccall("wasm_set_query_string",null,[me],[r])}}#c(t,r){this[ee].ccall("wasm_set_request_host",null,[me],[t]);let n;try{n=parseInt(new URL(t).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[ee].ccall("wasm_set_request_port",null,[Pt],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")}#l(t){this[ee].ccall("wasm_set_request_method",null,[me],[t])}#u(t){t.cookie&&this[ee].ccall("wasm_set_cookies",null,[me],[t.cookie]),t["content-type"]&&this[ee].ccall("wasm_set_content_type",null,[me],[t["content-type"]]),t["content-length"]&&this[ee].ccall("wasm_set_content_length",null,[Pt],[parseInt(t["content-length"],10)]);for(const r in t){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,t[r])}}#d(t){this[ee].ccall("wasm_set_request_body",null,[me],[t]),this[ee].ccall("wasm_set_content_length",null,[Pt],[new TextEncoder().encode(t).length])}#f(t){this[ee].ccall("wasm_set_path_translated",null,[me],[t])}addServerGlobalEntry(t,r){this.#r[t]=r}#p(){for(const t in this.#r)this[ee].ccall("wasm_add_SERVER_entry",null,[me,me],[t,this.#r[t]])}#h(t){const{key:r,name:n,type:s,data:i}=t,o=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(o,i);const l=0;this[ee].ccall("wasm_add_uploaded_file",null,[me,me,me,me,Pt,Pt],[r,n,s,o,l,i.byteLength])}#m(t){this[ee].ccall("wasm_set_php_code",null,[me],[t])}async#y(){let t,r;try{t=await new Promise((i,o)=>{r=p=>{const u=new Error("Rethrown");u.cause=p.error,u.betterMessage=p.message,o(u)},this.#n?.addEventListener("error",r);const l=this[ee].ccall("wasm_sapi_handle_request",Pt,[],[]);return l instanceof Promise?l.then(i,o):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=xo();const o=i,l="betterMessage"in o?o.betterMessage:o.message,p=new Error(l);throw p.cause=o,p}finally{this.#n?.removeEventListener("error",r),this.#r={}}const{headers:n,httpStatusCode:s}=this.#o();return new lt(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),t)}mkdir(t){this[ee].FS.mkdirTree(t)}mkdirTree(t){this.mkdir(t)}readFileAsText(t){return new TextDecoder().decode(this.readFileAsBuffer(t))}readFileAsBuffer(t){return this[ee].FS.readFile(t)}writeFile(t,r){this[ee].FS.writeFile(t,r)}unlink(t){this[ee].FS.unlink(t)}mv(t,r){this[ee].FS.rename(t,r)}rmdir(t,r={recursive:!0}){r?.recursive&&this.listFiles(t).forEach(n=>{const s=`${t}/${n}`;this.isDir(s)?this.rmdir(s,r):this.unlink(s)}),this[ee].FS.rmdir(t)}listFiles(t,r={prependPath:!1}){if(!this.fileExists(t))return[];try{const n=this[ee].FS.readdir(t).filter(s=>s!=="."&&s!=="..");if(r.prependPath){const s=t.replace(/\/$/,"");return n.map(i=>`${s}/${i}`)}return n}catch(n){return console.error(n,{path:t}),[]}}isDir(t){return this.fileExists(t)?this[ee].FS.isDir(this[ee].FS.lookupPath(t).node.mode):!1}fileExists(t){try{return this[ee].FS.lookupPath(t),!0}catch{return!1}}}ke([Ce('Could not create directory "{path}"')],je.prototype,"mkdir",1);ke([Ce('Could not create directory "{path}"')],je.prototype,"mkdirTree",1);ke([Ce('Could not read "{path}"')],je.prototype,"readFileAsText",1);ke([Ce('Could not read "{path}"')],je.prototype,"readFileAsBuffer",1);ke([Ce('Could not write to "{path}"')],je.prototype,"writeFile",1);ke([Ce('Could not unlink "{path}"')],je.prototype,"unlink",1);ke([Ce('Could not move "{path}"')],je.prototype,"mv",1);ke([Ce('Could not remove directory "{path}"')],je.prototype,"rmdir",1);ke([Ce('Could not list files in "{path}"')],je.prototype,"listFiles",1);ke([Ce('Could not stat "{path}"')],je.prototype,"isDir",1);ke([Ce('Could not stat "{path}"')],je.prototype,"fileExists",1);function $i(e){const t={};for(const r in e)t[r.toLowerCase()]=e[r];return t}const da=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function fa(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&da.includes(e.resource)}class pt{static create(t,{semaphore:r,progress:n}){let s;switch(t.resource){case"vfs":s=new pa(t,n);break;case"literal":s=new ha(t,n);break;case"wordpress.org/themes":s=new $a(t,n);break;case"wordpress.org/plugins":s=new va(t,n);break;case"url":s=new ya(t,n);break;default:throw new Error(`Invalid resource: ${t}`)}return s=new _a(s),r&&(s=new wa(s,r)),s}setPlayground(t){this.playground=t}get isAsync(){return!1}}class pa extends pt{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){const t=await this.playground.readFileAsBuffer(this.resource.path);return this.progress?.set(100),new sn([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class ha extends pt{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){return this.progress?.set(100),new sn([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class cn extends pt{constructor(t){super(),this.progress=t}async resolve(){this.progress?.setCaption(this.caption);const t=this.getURL();let r=await fetch(t);if(r=await Lo(r,this.progress?.loadingListener??ma),r.status!==200)throw new Error(`Could not download "${t}"`);return new sn([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 ma=()=>{};class ya extends cn{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}let ln="https://playground.wordpress.net/plugin-proxy";function ga(e){ln=e}class $a extends cn{constructor(t,r){super(r),this.resource=t}get name(){return Cr(this.resource.slug)}getURL(){const t=vi(this.resource.slug);return`${ln}?theme=`+t}}class va extends cn{constructor(t,r){super(r),this.resource=t}get name(){return Cr(this.resource.slug)}getURL(){const t=vi(this.resource.slug);return`${ln}?plugin=`+t}}function vi(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class _i extends pt{constructor(t){super(),this.resource=t}async resolve(){return this.resource.resolve()}async setPlayground(t){return this.resource.setPlayground(t)}get progress(){return this.resource.progress}set progress(t){this.resource.progress=t}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class _a extends _i{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class wa extends _i{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var ba=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gr={exports:{}},wi={},Ne={},Ct={},er={},K={},Zt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(T){if(super(),!e.IDENTIFIER.test(T))throw new Error("CodeGen: name must be a valid identifier");this.str=T}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{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),{})}}e._Code=n,e.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)}e._=s;const i=new n("+");function o(y,...T){const R=[k(y[0])];let j=0;for(;j<T.length;)R.push(i),l(R,T[j]),R.push(i,k(y[++j]));return p(R),new n(R)}e.str=o;function l(y,T){T instanceof n?y.push(...T._items):T instanceof r?y.push(T):y.push(g(T))}e.addCodeArg=l;function p(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 d(y,T){return T.emptyStr()?y:y.emptyStr()?T:o`${y}${T}`}e.strConcat=d;function g(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:k(Array.isArray(y)?y.join(","):y)}function C(y){return new n(k(y))}e.stringify=C;function k(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=k;function E(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=E;function S(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=S;function v(y){return new n(y.toString())}e.regexpCode=v})(Zt);var Jr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Zt;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(p){p[p.Started=0]="Started",p[p.Completed=1]="Completed"})(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,g;if(!((g=(d=this._parent)===null||d===void 0?void 0:d._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}}}e.Scope=s;class i extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:g}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${g}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?o:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var g;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const C=this.toName(u),{prefix:k}=C,E=(g=d.key)!==null&&g!==void 0?g:d.ref;let S=this._values[k];if(S){const T=S.get(E);if(T)return T}else S=this._values[k]=new Map;S.set(E,C);const v=this._scope[k]||(this._scope[k]=[]),y=v.length;return v[y]=d.ref,C.setValue(d,{property:k,itemIndex:y}),C}getValue(u,d){const g=this._values[u];if(g)return g.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,g=>{if(g.scopePath===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return(0,t._)`${u}${g.scopePath}`})}scopeCode(u=this._values,d,g){return this._reduceValues(u,C=>{if(C.value===void 0)throw new Error(`CodeGen: name "${C}" has no value`);return C.value.code},d,g)}_reduceValues(u,d,g={},C){let k=t.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=d(y);if(T){const R=this.opts.es5?e.varKinds.var:e.varKinds.const;k=(0,t._)`${k}${R} ${y} = ${T};${this.opts._n}`}else if(T=C?.(y))k=(0,t._)`${k}${T}${this.opts._n}`;else throw new r(y);v.set(y,n.Completed)})}return k}}e.ValueScope=l})(Jr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Zt,r=Jr;var n=Zt;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Jr;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(a,h){return this}}class o extends i{constructor(a,h,N){super(),this.varKind=a,this.name=h,this.rhs=N}render({es5:a,_n:h}){const N=a?r.varKinds.var:this.varKind,q=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${q};`+h}optimizeNames(a,h){if(a[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,a,h)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(a,h,N){super(),this.lhs=a,this.rhs=h,this.sideEffects=N}render({_n:a}){return`${this.lhs} = ${this.rhs};`+a}optimizeNames(a,h){if(!(this.lhs instanceof t.Name&&!a[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,a,h),this}get names(){const a=this.lhs instanceof t.Name?{}:{...this.lhs.names};return be(a,this.rhs)}}class p extends l{constructor(a,h,N,q){super(a,N,q),this.op=h}render({_n:a}){return`${this.lhs} ${this.op}= ${this.rhs};`+a}}class u extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`${this.label}:`+a}}class d extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`break${this.label?` ${this.label}`:""};`+a}}class g extends i{constructor(a){super(),this.error=a}render({_n:a}){return`throw ${this.error};`+a}get names(){return this.error.names}}class C extends i{constructor(a){super(),this.code=a}render({_n:a}){return`${this.code};`+a}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(a,h){return this.code=de(this.code,a,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class k extends i{constructor(a=[]){super(),this.nodes=a}render(a){return this.nodes.reduce((h,N)=>h+N.render(a),"")}optimizeNodes(){const{nodes:a}=this;let h=a.length;for(;h--;){const N=a[h].optimizeNodes();Array.isArray(N)?a.splice(h,1,...N):N?a[h]=N:a.splice(h,1)}return a.length>0?this:void 0}optimizeNames(a,h){const{nodes:N}=this;let q=N.length;for(;q--;){const M=N[q];M.optimizeNames(a,h)||(Qe(a,M.names),N.splice(q,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((a,h)=>Q(a,h.names),{})}}class E extends k{render(a){return"{"+a._n+super.render(a)+"}"+a._n}}class S extends k{}class v extends E{}v.kind="else";class y extends E{constructor(a,h){super(h),this.condition=a}render(a){let h=`if(${this.condition})`+super.render(a);return this.else&&(h+="else "+this.else.render(a)),h}optimizeNodes(){super.optimizeNodes();const a=this.condition;if(a===!0)return this.nodes;let h=this.else;if(h){const N=h.optimizeNodes();h=this.else=Array.isArray(N)?new v(N):N}if(h)return a===!1?h instanceof y?h:h.nodes:this.nodes.length?this:new y(Xe(a),h instanceof y?[h]:h.nodes);if(!(a===!1||!this.nodes.length))return this}optimizeNames(a,h){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(a,h),!!(super.optimizeNames(a,h)||this.else))return this.condition=de(this.condition,a,h),this}get names(){const a=super.names;return be(a,this.condition),this.else&&Q(a,this.else.names),a}}y.kind="if";class T extends E{}T.kind="for";class R extends T{constructor(a){super(),this.iteration=a}render(a){return`for(${this.iteration})`+super.render(a)}optimizeNames(a,h){if(super.optimizeNames(a,h))return this.iteration=de(this.iteration,a,h),this}get names(){return Q(super.names,this.iteration.names)}}class j extends T{constructor(a,h,N,q){super(),this.varKind=a,this.name=h,this.from=N,this.to=q}render(a){const h=a.es5?r.varKinds.var:this.varKind,{name:N,from:q,to:M}=this;return`for(${h} ${N}=${q}; ${N}<${M}; ${N}++)`+super.render(a)}get names(){const a=be(super.names,this.from);return be(a,this.to)}}class D extends T{constructor(a,h,N,q){super(),this.loop=a,this.varKind=h,this.name=N,this.iterable=q}render(a){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(a)}optimizeNames(a,h){if(super.optimizeNames(a,h))return this.iterable=de(this.iterable,a,h),this}get names(){return Q(super.names,this.iterable.names)}}class _ extends E{constructor(a,h,N){super(),this.name=a,this.args=h,this.async=N}render(a){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(a)}}_.kind="func";class O extends k{render(a){return"return "+super.render(a)}}O.kind="return";class A extends E{render(a){let h="try"+super.render(a);return this.catch&&(h+=this.catch.render(a)),this.finally&&(h+=this.finally.render(a)),h}optimizeNodes(){var a,h;return super.optimizeNodes(),(a=this.catch)===null||a===void 0||a.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(a,h){var N,q;return super.optimizeNames(a,h),(N=this.catch)===null||N===void 0||N.optimizeNames(a,h),(q=this.finally)===null||q===void 0||q.optimizeNames(a,h),this}get names(){const a=super.names;return this.catch&&Q(a,this.catch.names),this.finally&&Q(a,this.finally.names),a}}class z extends E{constructor(a){super(),this.error=a}render(a){return`catch(${this.error})`+super.render(a)}}z.kind="catch";class B extends E{render(a){return"finally"+super.render(a)}}B.kind="finally";class oe{constructor(a,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
|
|
478
|
-
`:""},this._extScope=a,this._scope=new r.Scope({parent:a}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(a){return this._scope.name(a)}scopeName(a){return this._extScope.name(a)}scopeValue(a,h){const N=this._extScope.value(a,h);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(a,h){return this._extScope.getValue(a,h)}scopeRefs(a){return this._extScope.scopeRefs(a,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(a,h,N,q){const M=this._scope.toName(h);return N!==void 0&&q&&(this._constants[M.str]=N),this._leafNode(new o(a,M,N)),M}const(a,h,N){return this._def(r.varKinds.const,a,h,N)}let(a,h,N){return this._def(r.varKinds.let,a,h,N)}var(a,h,N){return this._def(r.varKinds.var,a,h,N)}assign(a,h,N){return this._leafNode(new l(a,h,N))}add(a,h){return this._leafNode(new p(a,e.operators.ADD,h))}code(a){return typeof a=="function"?a():a!==t.nil&&this._leafNode(new C(a)),this}object(...a){const h=["{"];for(const[N,q]of a)h.length>1&&h.push(","),h.push(N),(N!==q||this.opts.es5)&&(h.push(":"),(0,t.addCodeArg)(h,q));return h.push("}"),new t._Code(h)}if(a,h,N){if(this._blockNode(new y(a)),h&&N)this.code(h).else().code(N).endIf();else if(h)this.code(h).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(a){return this._elseNode(new y(a))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(a,h){return this._blockNode(a),h&&this.code(h).endFor(),this}for(a,h){return this._for(new R(a),h)}forRange(a,h,N,q,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const G=this._scope.toName(a);return this._for(new j(M,G,h,N),()=>q(G))}forOf(a,h,N,q=r.varKinds.const){const M=this._scope.toName(a);if(this.opts.es5){const G=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,t._)`${G}.length`,Y=>{this.var(M,(0,t._)`${G}[${Y}]`),N(M)})}return this._for(new D("of",q,M,h),()=>N(M))}forIn(a,h,N,q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(a,(0,t._)`Object.keys(${h})`,N);const M=this._scope.toName(a);return this._for(new D("in",q,M,h),()=>N(M))}endFor(){return this._endBlockNode(T)}label(a){return this._leafNode(new u(a))}break(a){return this._leafNode(new d(a))}return(a){const h=new O;if(this._blockNode(h),this.code(a),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(a,h,N){if(!h&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const q=new A;if(this._blockNode(q),this.code(a),h){const M=this.name("e");this._currNode=q.catch=new z(M),h(M)}return N&&(this._currNode=q.finally=new B,this.code(N)),this._endBlockNode(z,B)}throw(a){return this._leafNode(new g(a))}block(a,h){return this._blockStarts.push(this._nodes.length),a&&this.code(a).endBlock(h),this}endBlock(a){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-h;if(N<0||a!==void 0&&N!==a)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${a} expected`);return this._nodes.length=h,this}func(a,h=t.nil,N,q){return this._blockNode(new _(a,h,N)),q&&this.code(q).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(a=1){for(;a-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(a){return this._currNode.nodes.push(a),this}_blockNode(a){this._currNode.nodes.push(a),this._nodes.push(a)}_endBlockNode(a,h){const N=this._currNode;if(N instanceof a||h&&N instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${a.kind}/${h.kind}`:a.kind}"`)}_elseNode(a){const h=this._currNode;if(!(h instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=a,this}get _root(){return this._nodes[0]}get _currNode(){const a=this._nodes;return a[a.length-1]}set _currNode(a){const h=this._nodes;h[h.length-1]=a}}e.CodeGen=oe;function Q(w,a){for(const h in a)w[h]=(w[h]||0)+(a[h]||0);return w}function be(w,a){return a instanceof t._CodeOrName?Q(w,a.names):w}function de(w,a,h){if(w instanceof t.Name)return N(w);if(!q(w))return w;return new t._Code(w._items.reduce((M,G)=>(G instanceof t.Name&&(G=N(G)),G instanceof t._Code?M.push(...G._items):M.push(G),M),[]));function N(M){const G=h[M.str];return G===void 0||a[M.str]!==1?M:(delete a[M.str],G)}function q(M){return M instanceof t._Code&&M._items.some(G=>G instanceof t.Name&&a[G.str]===1&&h[G.str]!==void 0)}}function Qe(w,a){for(const h in a)w[h]=(w[h]||0)-(a[h]||0)}function Xe(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,t._)`!${I(w)}`}e.not=Xe;const ht=$(e.operators.AND);function At(...w){return w.reduce(ht)}e.and=At;const mt=$(e.operators.OR);function F(...w){return w.reduce(mt)}e.or=F;function $(w){return(a,h)=>a===t.nil?h:h===t.nil?a:(0,t._)`${I(a)} ${w} ${I(h)}`}function I(w){return w instanceof t.Name?w:(0,t._)`(${w})`}})(K);var Z={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=K,r=Zt;function n(_){const O={};for(const A of _)O[A]=!0;return O}e.toHash=n;function s(_,O){return typeof O=="boolean"?O:Object.keys(O).length===0?!0:(i(_,O),!o(O,_.self.RULES.all))}e.alwaysValidSchema=s;function i(_,O=_.schema){const{opts:A,self:z}=_;if(!A.strictSchema||typeof O=="boolean")return;const B=z.RULES.keywords;for(const oe in O)B[oe]||D(_,`unknown keyword: "${oe}"`)}e.checkUnknownRules=i;function o(_,O){if(typeof _=="boolean")return!_;for(const A in _)if(O[A])return!0;return!1}e.schemaHasRules=o;function l(_,O){if(typeof _=="boolean")return!_;for(const A in _)if(A!=="$ref"&&O.all[A])return!0;return!1}e.schemaHasRulesButRef=l;function p({topSchemaRef:_,schemaPath:O},A,z,B){if(!B){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,t._)`${A}`}return(0,t._)`${_}${O}${(0,t.getProperty)(z)}`}e.schemaRefOrVal=p;function u(_){return C(decodeURIComponent(_))}e.unescapeFragment=u;function d(_){return encodeURIComponent(g(_))}e.escapeFragment=d;function g(_){return typeof _=="number"?`${_}`:_.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=g;function C(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=C;function k(_,O){if(Array.isArray(_))for(const A of _)O(A);else O(_)}e.eachItem=k;function E({mergeNames:_,mergeToName:O,mergeValues:A,resultToName:z}){return(B,oe,Q,be)=>{const de=Q===void 0?oe:Q instanceof t.Name?(oe instanceof t.Name?_(B,oe,Q):O(B,oe,Q),Q):oe instanceof t.Name?(O(B,Q,oe),oe):A(oe,Q);return be===t.Name&&!(de instanceof t.Name)?z(B,de):de}}e.mergeEvaluated={props:E({mergeNames:(_,O,A)=>_.if((0,t._)`${A} !== true && ${O} !== undefined`,()=>{_.if((0,t._)`${O} === true`,()=>_.assign(A,!0),()=>_.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${O})`))}),mergeToName:(_,O,A)=>_.if((0,t._)`${A} !== true`,()=>{O===!0?_.assign(A,!0):(_.assign(A,(0,t._)`${A} || {}`),v(_,A,O))}),mergeValues:(_,O)=>_===!0?!0:{..._,...O},resultToName:S}),items:E({mergeNames:(_,O,A)=>_.if((0,t._)`${A} !== true && ${O} !== undefined`,()=>_.assign(A,(0,t._)`${O} === true ? true : ${A} > ${O} ? ${A} : ${O}`)),mergeToName:(_,O,A)=>_.if((0,t._)`${A} !== true`,()=>_.assign(A,O===!0?!0:(0,t._)`${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,t._)`{}`);return O!==void 0&&v(_,A,O),A}e.evaluatedPropsToName=S;function v(_,O,A){Object.keys(A).forEach(z=>_.assign((0,t._)`${O}${(0,t.getProperty)(z)}`,!0))}e.setEvaluated=v;const y={};function T(_,O){return _.scopeValue("func",{ref:O,code:y[O.code]||(y[O.code]=new r._Code(O.code))})}e.useFunc=T;var R;(function(_){_[_.Num=0]="Num",_[_.Str=1]="Str"})(R=e.Type||(e.Type={}));function j(_,O,A){if(_ instanceof t.Name){const z=O===R.Num;return A?z?(0,t._)`"[" + ${_} + "]"`:(0,t._)`"['" + ${_} + "']"`:z?(0,t._)`"/" + ${_}`:(0,t._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(_).toString():"/"+g(_)}e.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)}}e.checkStrictMode=D})(Z);var He={};Object.defineProperty(He,"__esModule",{value:!0});const ye=K,Ea={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=Ea;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=K,r=Z,n=He;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:y})=>y?(0,t.str)`"${v}" keyword must be ${y} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function s(v,y=e.keywordError,T,R){const{it:j}=v,{gen:D,compositeRule:_,allErrors:O}=j,A=g(v,y,T);R??(_||O)?p(D,A):u(j,(0,t._)`[${A}]`)}e.reportError=s;function i(v,y=e.keywordError,T){const{it:R}=v,{gen:j,compositeRule:D,allErrors:_}=R,O=g(v,y,T);p(j,O),D||_||u(R,n.default.vErrors)}e.reportExtraError=i;function o(v,y){v.assign(n.default.errors,y),v.if((0,t._)`${n.default.vErrors} !== null`,()=>v.if(y,()=>v.assign((0,t._)`${n.default.vErrors}.length`,y),()=>v.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;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,t._)`${n.default.vErrors}[${O}]`),v.if((0,t._)`${_}.instancePath === undefined`,()=>v.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,D.errorPath))),v.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${D.errSchemaPath}/${y}`),D.opts.verbose&&(v.assign((0,t._)`${_}.schema`,T),v.assign((0,t._)`${_}.data`,R))})}e.extendErrors=l;function p(v,y){const T=v.const("err",y);v.if((0,t._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,t._)`[${T}]`),(0,t._)`${n.default.vErrors}.push(${T})`),v.code((0,t._)`${n.default.errors}++`)}function u(v,y){const{gen:T,validateName:R,schemaEnv:j}=v;j.$async?T.throw((0,t._)`new ${v.ValidationError}(${y})`):(T.assign((0,t._)`${R}.errors`,y),T.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function g(v,y,T){const{createErrors:R}=v.it;return R===!1?(0,t._)`{}`:C(v,y,T)}function C(v,y,T={}){const{gen:R,it:j}=v,D=[k(j,T),E(v,T)];return S(v,y,D),R.object(...D)}function k({errorPath:v},{instancePath:y}){const T=y?(0,t.str)`${v}${(0,r.getErrorPath)(y,r.Type.Str)}`:v;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,T)]}function E({keyword:v,it:{errSchemaPath:y}},{schemaPath:T,parentSchema:R}){let j=R?y:(0,t.str)`${y}/${v}`;return T&&(j=(0,t.str)`${j}${(0,r.getErrorPath)(T,r.Type.Str)}`),[d.schemaPath,j]}function S(v,{params:y,message:T},R){const{keyword:j,data:D,schemaValue:_,it:O}=v,{opts:A,propertyName:z,topSchemaRef:B,schemaPath:oe}=O;R.push([d.keyword,j],[d.params,typeof y=="function"?y(v):y||(0,t._)`{}`]),A.messages&&R.push([d.message,typeof T=="function"?T(v):T]),A.verbose&&R.push([d.schema,_],[d.parentSchema,(0,t._)`${B}${oe}`],[n.default.data,D]),z&&R.push([d.propertyName,z])}})(er);Object.defineProperty(Ct,"__esModule",{value:!0});Ct.boolOrEmptySchema=Ct.topBoolOrEmptySchema=void 0;const Sa=er,Ta=K,Ra=He,Oa={message:"boolean schema is false"};function Na(e){const{gen:t,schema:r,validateName:n}=e;r===!1?bi(e,!1):typeof r=="object"&&r.$async===!0?t.return(Ra.default.data):(t.assign((0,Ta._)`${n}.errors`,null),t.return(!0))}Ct.topBoolOrEmptySchema=Na;function Ca(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),bi(e)):r.var(t,!0)}Ct.boolOrEmptySchema=Ca;function bi(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Sa.reportError)(s,Oa,void 0,t)}var tr={},dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.getRules=dt.isJSONType=void 0;const ka=["string","number","integer","boolean","null","object","array"],ja=new Set(ka);function Ia(e){return typeof e=="string"&&ja.has(e)}dt.isJSONType=Ia;function Aa(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}dt.getRules=Aa;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.shouldUseRule=ze.shouldUseGroup=ze.schemaHasRulesForType=void 0;function Da({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Pi(e,n)}ze.schemaHasRulesForType=Da;function Pi(e,t){return t.rules.some(r=>Ei(e,r))}ze.shouldUseGroup=Pi;function Ei(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ze.shouldUseRule=Ei;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=dt,r=ze,n=er,s=K,i=Z;var o;(function(R){R[R.Correct=0]="Correct",R[R.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function l(R){const j=p(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}e.getSchemaTypes=l;function p(R){const j=Array.isArray(R)?R:R?[R]:[];if(j.every(t.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}e.getJSONTypes=p;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 B=S(j,_,O.strictNumbers,o.Wrong);D.if(B,()=>{A.length?C(R,j,A):y(R)})}return z}e.coerceAndCheckDataType=u;const d=new Set(["string","number","integer","boolean","null"]);function g(R,j){return j?R.filter(D=>d.has(D)||j==="array"&&D==="array"):[]}function C(R,j,D){const{gen:_,data:O,opts:A}=R,z=_.let("dataType",(0,s._)`typeof ${O}`),B=_.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(B,O))),_.if((0,s._)`${B} !== undefined`);for(const Q of D)(d.has(Q)||Q==="array"&&A.coerceTypes==="array")&&oe(Q);_.else(),y(R),_.endIf(),_.if((0,s._)`${B} !== undefined`,()=>{_.assign(O,B),k(R,B)});function oe(Q){switch(Q){case"string":_.elseIf((0,s._)`${z} == "number" || ${z} == "boolean"`).assign(B,(0,s._)`"" + ${O}`).elseIf((0,s._)`${O} === null`).assign(B,(0,s._)`""`);return;case"number":_.elseIf((0,s._)`${z} == "boolean" || ${O} === null
|
|
477
|
+
`;this[ee].ccall("wasm_set_phpini_entries",null,[me],[t])}this[ee].ccall("php_wasm_init",null,[],[])}#o(){const t="/tmp/headers.json";if(!this.fileExists(t))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(t)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),o=s.substring(0,i).toLowerCase(),l=s.substring(i+2);o in n||(n[o]=[]),n[o].push(l)}return{headers:n,httpStatusCode:r.status}}#a(t){if(this[ee].ccall("wasm_set_request_uri",null,[me],[t]),t.includes("?")){const r=t.substring(t.indexOf("?")+1);this[ee].ccall("wasm_set_query_string",null,[me],[r])}}#c(t,r){this[ee].ccall("wasm_set_request_host",null,[me],[t]);let n;try{n=parseInt(new URL(t).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[ee].ccall("wasm_set_request_port",null,[Pt],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")}#l(t){this[ee].ccall("wasm_set_request_method",null,[me],[t])}#u(t){t.cookie&&this[ee].ccall("wasm_set_cookies",null,[me],[t.cookie]),t["content-type"]&&this[ee].ccall("wasm_set_content_type",null,[me],[t["content-type"]]),t["content-length"]&&this[ee].ccall("wasm_set_content_length",null,[Pt],[parseInt(t["content-length"],10)]);for(const r in t){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,t[r])}}#d(t){this[ee].ccall("wasm_set_request_body",null,[me],[t]),this[ee].ccall("wasm_set_content_length",null,[Pt],[new TextEncoder().encode(t).length])}#f(t){this[ee].ccall("wasm_set_path_translated",null,[me],[t])}addServerGlobalEntry(t,r){this.#r[t]=r}#p(){for(const t in this.#r)this[ee].ccall("wasm_add_SERVER_entry",null,[me,me],[t,this.#r[t]])}#h(t){const{key:r,name:n,type:s,data:i}=t,o=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(o,i);const l=0;this[ee].ccall("wasm_add_uploaded_file",null,[me,me,me,me,Pt,Pt],[r,n,s,o,l,i.byteLength])}#m(t){this[ee].ccall("wasm_set_php_code",null,[me],[t])}async#y(){let t,r;try{t=await new Promise((i,o)=>{r=p=>{const u=new Error("Rethrown");u.cause=p.error,u.betterMessage=p.message,o(u)},this.#n?.addEventListener("error",r);const l=this[ee].ccall("wasm_sapi_handle_request",Pt,[],[]);return l instanceof Promise?l.then(i,o):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=Wo();const o=i,l="betterMessage"in o?o.betterMessage:o.message,p=new Error(l);throw p.cause=o,p}finally{this.#n?.removeEventListener("error",r),this.#r={}}const{headers:n,httpStatusCode:s}=this.#o();return new lt(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),t)}mkdir(t){this[ee].FS.mkdirTree(t)}mkdirTree(t){this.mkdir(t)}readFileAsText(t){return new TextDecoder().decode(this.readFileAsBuffer(t))}readFileAsBuffer(t){return this[ee].FS.readFile(t)}writeFile(t,r){this[ee].FS.writeFile(t,r)}unlink(t){this[ee].FS.unlink(t)}mv(t,r){this[ee].FS.rename(t,r)}rmdir(t,r={recursive:!0}){r?.recursive&&this.listFiles(t).forEach(n=>{const s=`${t}/${n}`;this.isDir(s)?this.rmdir(s,r):this.unlink(s)}),this[ee].FS.rmdir(t)}listFiles(t,r={prependPath:!1}){if(!this.fileExists(t))return[];try{const n=this[ee].FS.readdir(t).filter(s=>s!=="."&&s!=="..");if(r.prependPath){const s=t.replace(/\/$/,"");return n.map(i=>`${s}/${i}`)}return n}catch(n){return console.error(n,{path:t}),[]}}isDir(t){return this.fileExists(t)?this[ee].FS.isDir(this[ee].FS.lookupPath(t).node.mode):!1}fileExists(t){try{return this[ee].FS.lookupPath(t),!0}catch{return!1}}}ke([Ce('Could not create directory "{path}"')],je.prototype,"mkdir",1);ke([Ce('Could not create directory "{path}"')],je.prototype,"mkdirTree",1);ke([Ce('Could not read "{path}"')],je.prototype,"readFileAsText",1);ke([Ce('Could not read "{path}"')],je.prototype,"readFileAsBuffer",1);ke([Ce('Could not write to "{path}"')],je.prototype,"writeFile",1);ke([Ce('Could not unlink "{path}"')],je.prototype,"unlink",1);ke([Ce('Could not move "{path}"')],je.prototype,"mv",1);ke([Ce('Could not remove directory "{path}"')],je.prototype,"rmdir",1);ke([Ce('Could not list files in "{path}"')],je.prototype,"listFiles",1);ke([Ce('Could not stat "{path}"')],je.prototype,"isDir",1);ke([Ce('Could not stat "{path}"')],je.prototype,"fileExists",1);function gi(e){const t={};for(const r in e)t[r.toLowerCase()]=e[r];return t}const ua=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function da(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&ua.includes(e.resource)}class pt{static create(t,{semaphore:r,progress:n}){let s;switch(t.resource){case"vfs":s=new fa(t,n);break;case"literal":s=new pa(t,n);break;case"wordpress.org/themes":s=new ya(t,n);break;case"wordpress.org/plugins":s=new ga(t,n);break;case"url":s=new ma(t,n);break;default:throw new Error(`Invalid resource: ${t}`)}return s=new $a(s),r&&(s=new va(s,r)),s}setPlayground(t){this.playground=t}get isAsync(){return!1}}class fa extends pt{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){const t=await this.playground.readFileAsBuffer(this.resource.path);return this.progress?.set(100),new sn([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class pa extends pt{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){return this.progress?.set(100),new sn([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class cn extends pt{constructor(t){super(),this.progress=t}async resolve(){this.progress?.setCaption(this.caption);const t=this.getURL();let r=await fetch(t);if(r=await Uo(r,this.progress?.loadingListener??ha),r.status!==200)throw new Error(`Could not download "${t}"`);return new sn([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 ha=()=>{};class ma extends cn{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class ya extends cn{constructor(t,r){super(r),this.resource=t}get name(){return Cr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${$i(this.resource.slug)}`}}class ga extends cn{constructor(t,r){super(r),this.resource=t}get name(){return Cr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${$i(this.resource.slug)}`}}function $i(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class vi extends pt{constructor(t){super(),this.resource=t}async resolve(){return this.resource.resolve()}async setPlayground(t){return this.resource.setPlayground(t)}get progress(){return this.resource.progress}set progress(t){this.resource.progress=t}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class $a extends vi{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class va extends vi{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var _a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gr={exports:{}},_i={},Ne={},Ct={},er={},x={},Zt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(T){if(super(),!e.IDENTIFIER.test(T))throw new Error("CodeGen: name must be a valid identifier");this.str=T}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{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),{})}}e._Code=n,e.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)}e._=s;const i=new n("+");function o(y,...T){const R=[k(y[0])];let j=0;for(;j<T.length;)R.push(i),l(R,T[j]),R.push(i,k(y[++j]));return p(R),new n(R)}e.str=o;function l(y,T){T instanceof n?y.push(...T._items):T instanceof r?y.push(T):y.push(g(T))}e.addCodeArg=l;function p(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 d(y,T){return T.emptyStr()?y:y.emptyStr()?T:o`${y}${T}`}e.strConcat=d;function g(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:k(Array.isArray(y)?y.join(","):y)}function C(y){return new n(k(y))}e.stringify=C;function k(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=k;function E(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=E;function S(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=S;function v(y){return new n(y.toString())}e.regexpCode=v})(Zt);var Jr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Zt;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(p){p[p.Started=0]="Started",p[p.Completed=1]="Completed"})(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,g;if(!((g=(d=this._parent)===null||d===void 0?void 0:d._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}}}e.Scope=s;class i extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:g}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${g}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?o:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var g;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const C=this.toName(u),{prefix:k}=C,E=(g=d.key)!==null&&g!==void 0?g:d.ref;let S=this._values[k];if(S){const T=S.get(E);if(T)return T}else S=this._values[k]=new Map;S.set(E,C);const v=this._scope[k]||(this._scope[k]=[]),y=v.length;return v[y]=d.ref,C.setValue(d,{property:k,itemIndex:y}),C}getValue(u,d){const g=this._values[u];if(g)return g.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,g=>{if(g.scopePath===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return(0,t._)`${u}${g.scopePath}`})}scopeCode(u=this._values,d,g){return this._reduceValues(u,C=>{if(C.value===void 0)throw new Error(`CodeGen: name "${C}" has no value`);return C.value.code},d,g)}_reduceValues(u,d,g={},C){let k=t.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=d(y);if(T){const R=this.opts.es5?e.varKinds.var:e.varKinds.const;k=(0,t._)`${k}${R} ${y} = ${T};${this.opts._n}`}else if(T=C?.(y))k=(0,t._)`${k}${T}${this.opts._n}`;else throw new r(y);v.set(y,n.Completed)})}return k}}e.ValueScope=l})(Jr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Zt,r=Jr;var n=Zt;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Jr;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(a,h){return this}}class o extends i{constructor(a,h,N){super(),this.varKind=a,this.name=h,this.rhs=N}render({es5:a,_n:h}){const N=a?r.varKinds.var:this.varKind,q=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${q};`+h}optimizeNames(a,h){if(a[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,a,h)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(a,h,N){super(),this.lhs=a,this.rhs=h,this.sideEffects=N}render({_n:a}){return`${this.lhs} = ${this.rhs};`+a}optimizeNames(a,h){if(!(this.lhs instanceof t.Name&&!a[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,a,h),this}get names(){const a=this.lhs instanceof t.Name?{}:{...this.lhs.names};return be(a,this.rhs)}}class p extends l{constructor(a,h,N,q){super(a,N,q),this.op=h}render({_n:a}){return`${this.lhs} ${this.op}= ${this.rhs};`+a}}class u extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`${this.label}:`+a}}class d extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`break${this.label?` ${this.label}`:""};`+a}}class g extends i{constructor(a){super(),this.error=a}render({_n:a}){return`throw ${this.error};`+a}get names(){return this.error.names}}class C extends i{constructor(a){super(),this.code=a}render({_n:a}){return`${this.code};`+a}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(a,h){return this.code=de(this.code,a,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class k extends i{constructor(a=[]){super(),this.nodes=a}render(a){return this.nodes.reduce((h,N)=>h+N.render(a),"")}optimizeNodes(){const{nodes:a}=this;let h=a.length;for(;h--;){const N=a[h].optimizeNodes();Array.isArray(N)?a.splice(h,1,...N):N?a[h]=N:a.splice(h,1)}return a.length>0?this:void 0}optimizeNames(a,h){const{nodes:N}=this;let q=N.length;for(;q--;){const M=N[q];M.optimizeNames(a,h)||(Qe(a,M.names),N.splice(q,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((a,h)=>Q(a,h.names),{})}}class E extends k{render(a){return"{"+a._n+super.render(a)+"}"+a._n}}class S extends k{}class v extends E{}v.kind="else";class y extends E{constructor(a,h){super(h),this.condition=a}render(a){let h=`if(${this.condition})`+super.render(a);return this.else&&(h+="else "+this.else.render(a)),h}optimizeNodes(){super.optimizeNodes();const a=this.condition;if(a===!0)return this.nodes;let h=this.else;if(h){const N=h.optimizeNodes();h=this.else=Array.isArray(N)?new v(N):N}if(h)return a===!1?h instanceof y?h:h.nodes:this.nodes.length?this:new y(Xe(a),h instanceof y?[h]:h.nodes);if(!(a===!1||!this.nodes.length))return this}optimizeNames(a,h){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(a,h),!!(super.optimizeNames(a,h)||this.else))return this.condition=de(this.condition,a,h),this}get names(){const a=super.names;return be(a,this.condition),this.else&&Q(a,this.else.names),a}}y.kind="if";class T extends E{}T.kind="for";class R extends T{constructor(a){super(),this.iteration=a}render(a){return`for(${this.iteration})`+super.render(a)}optimizeNames(a,h){if(super.optimizeNames(a,h))return this.iteration=de(this.iteration,a,h),this}get names(){return Q(super.names,this.iteration.names)}}class j extends T{constructor(a,h,N,q){super(),this.varKind=a,this.name=h,this.from=N,this.to=q}render(a){const h=a.es5?r.varKinds.var:this.varKind,{name:N,from:q,to:M}=this;return`for(${h} ${N}=${q}; ${N}<${M}; ${N}++)`+super.render(a)}get names(){const a=be(super.names,this.from);return be(a,this.to)}}class D extends T{constructor(a,h,N,q){super(),this.loop=a,this.varKind=h,this.name=N,this.iterable=q}render(a){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(a)}optimizeNames(a,h){if(super.optimizeNames(a,h))return this.iterable=de(this.iterable,a,h),this}get names(){return Q(super.names,this.iterable.names)}}class _ extends E{constructor(a,h,N){super(),this.name=a,this.args=h,this.async=N}render(a){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(a)}}_.kind="func";class O extends k{render(a){return"return "+super.render(a)}}O.kind="return";class A extends E{render(a){let h="try"+super.render(a);return this.catch&&(h+=this.catch.render(a)),this.finally&&(h+=this.finally.render(a)),h}optimizeNodes(){var a,h;return super.optimizeNodes(),(a=this.catch)===null||a===void 0||a.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(a,h){var N,q;return super.optimizeNames(a,h),(N=this.catch)===null||N===void 0||N.optimizeNames(a,h),(q=this.finally)===null||q===void 0||q.optimizeNames(a,h),this}get names(){const a=super.names;return this.catch&&Q(a,this.catch.names),this.finally&&Q(a,this.finally.names),a}}class z extends E{constructor(a){super(),this.error=a}render(a){return`catch(${this.error})`+super.render(a)}}z.kind="catch";class B extends E{render(a){return"finally"+super.render(a)}}B.kind="finally";class oe{constructor(a,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
|
|
478
|
+
`:""},this._extScope=a,this._scope=new r.Scope({parent:a}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(a){return this._scope.name(a)}scopeName(a){return this._extScope.name(a)}scopeValue(a,h){const N=this._extScope.value(a,h);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(a,h){return this._extScope.getValue(a,h)}scopeRefs(a){return this._extScope.scopeRefs(a,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(a,h,N,q){const M=this._scope.toName(h);return N!==void 0&&q&&(this._constants[M.str]=N),this._leafNode(new o(a,M,N)),M}const(a,h,N){return this._def(r.varKinds.const,a,h,N)}let(a,h,N){return this._def(r.varKinds.let,a,h,N)}var(a,h,N){return this._def(r.varKinds.var,a,h,N)}assign(a,h,N){return this._leafNode(new l(a,h,N))}add(a,h){return this._leafNode(new p(a,e.operators.ADD,h))}code(a){return typeof a=="function"?a():a!==t.nil&&this._leafNode(new C(a)),this}object(...a){const h=["{"];for(const[N,q]of a)h.length>1&&h.push(","),h.push(N),(N!==q||this.opts.es5)&&(h.push(":"),(0,t.addCodeArg)(h,q));return h.push("}"),new t._Code(h)}if(a,h,N){if(this._blockNode(new y(a)),h&&N)this.code(h).else().code(N).endIf();else if(h)this.code(h).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(a){return this._elseNode(new y(a))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(a,h){return this._blockNode(a),h&&this.code(h).endFor(),this}for(a,h){return this._for(new R(a),h)}forRange(a,h,N,q,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const G=this._scope.toName(a);return this._for(new j(M,G,h,N),()=>q(G))}forOf(a,h,N,q=r.varKinds.const){const M=this._scope.toName(a);if(this.opts.es5){const G=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,t._)`${G}.length`,Y=>{this.var(M,(0,t._)`${G}[${Y}]`),N(M)})}return this._for(new D("of",q,M,h),()=>N(M))}forIn(a,h,N,q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(a,(0,t._)`Object.keys(${h})`,N);const M=this._scope.toName(a);return this._for(new D("in",q,M,h),()=>N(M))}endFor(){return this._endBlockNode(T)}label(a){return this._leafNode(new u(a))}break(a){return this._leafNode(new d(a))}return(a){const h=new O;if(this._blockNode(h),this.code(a),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(a,h,N){if(!h&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const q=new A;if(this._blockNode(q),this.code(a),h){const M=this.name("e");this._currNode=q.catch=new z(M),h(M)}return N&&(this._currNode=q.finally=new B,this.code(N)),this._endBlockNode(z,B)}throw(a){return this._leafNode(new g(a))}block(a,h){return this._blockStarts.push(this._nodes.length),a&&this.code(a).endBlock(h),this}endBlock(a){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-h;if(N<0||a!==void 0&&N!==a)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${a} expected`);return this._nodes.length=h,this}func(a,h=t.nil,N,q){return this._blockNode(new _(a,h,N)),q&&this.code(q).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(a=1){for(;a-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(a){return this._currNode.nodes.push(a),this}_blockNode(a){this._currNode.nodes.push(a),this._nodes.push(a)}_endBlockNode(a,h){const N=this._currNode;if(N instanceof a||h&&N instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${a.kind}/${h.kind}`:a.kind}"`)}_elseNode(a){const h=this._currNode;if(!(h instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=a,this}get _root(){return this._nodes[0]}get _currNode(){const a=this._nodes;return a[a.length-1]}set _currNode(a){const h=this._nodes;h[h.length-1]=a}}e.CodeGen=oe;function Q(w,a){for(const h in a)w[h]=(w[h]||0)+(a[h]||0);return w}function be(w,a){return a instanceof t._CodeOrName?Q(w,a.names):w}function de(w,a,h){if(w instanceof t.Name)return N(w);if(!q(w))return w;return new t._Code(w._items.reduce((M,G)=>(G instanceof t.Name&&(G=N(G)),G instanceof t._Code?M.push(...G._items):M.push(G),M),[]));function N(M){const G=h[M.str];return G===void 0||a[M.str]!==1?M:(delete a[M.str],G)}function q(M){return M instanceof t._Code&&M._items.some(G=>G instanceof t.Name&&a[G.str]===1&&h[G.str]!==void 0)}}function Qe(w,a){for(const h in a)w[h]=(w[h]||0)-(a[h]||0)}function Xe(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,t._)`!${I(w)}`}e.not=Xe;const ht=$(e.operators.AND);function At(...w){return w.reduce(ht)}e.and=At;const mt=$(e.operators.OR);function F(...w){return w.reduce(mt)}e.or=F;function $(w){return(a,h)=>a===t.nil?h:h===t.nil?a:(0,t._)`${I(a)} ${w} ${I(h)}`}function I(w){return w instanceof t.Name?w:(0,t._)`(${w})`}})(x);var Z={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=x,r=Zt;function n(_){const O={};for(const A of _)O[A]=!0;return O}e.toHash=n;function s(_,O){return typeof O=="boolean"?O:Object.keys(O).length===0?!0:(i(_,O),!o(O,_.self.RULES.all))}e.alwaysValidSchema=s;function i(_,O=_.schema){const{opts:A,self:z}=_;if(!A.strictSchema||typeof O=="boolean")return;const B=z.RULES.keywords;for(const oe in O)B[oe]||D(_,`unknown keyword: "${oe}"`)}e.checkUnknownRules=i;function o(_,O){if(typeof _=="boolean")return!_;for(const A in _)if(O[A])return!0;return!1}e.schemaHasRules=o;function l(_,O){if(typeof _=="boolean")return!_;for(const A in _)if(A!=="$ref"&&O.all[A])return!0;return!1}e.schemaHasRulesButRef=l;function p({topSchemaRef:_,schemaPath:O},A,z,B){if(!B){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,t._)`${A}`}return(0,t._)`${_}${O}${(0,t.getProperty)(z)}`}e.schemaRefOrVal=p;function u(_){return C(decodeURIComponent(_))}e.unescapeFragment=u;function d(_){return encodeURIComponent(g(_))}e.escapeFragment=d;function g(_){return typeof _=="number"?`${_}`:_.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=g;function C(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=C;function k(_,O){if(Array.isArray(_))for(const A of _)O(A);else O(_)}e.eachItem=k;function E({mergeNames:_,mergeToName:O,mergeValues:A,resultToName:z}){return(B,oe,Q,be)=>{const de=Q===void 0?oe:Q instanceof t.Name?(oe instanceof t.Name?_(B,oe,Q):O(B,oe,Q),Q):oe instanceof t.Name?(O(B,Q,oe),oe):A(oe,Q);return be===t.Name&&!(de instanceof t.Name)?z(B,de):de}}e.mergeEvaluated={props:E({mergeNames:(_,O,A)=>_.if((0,t._)`${A} !== true && ${O} !== undefined`,()=>{_.if((0,t._)`${O} === true`,()=>_.assign(A,!0),()=>_.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${O})`))}),mergeToName:(_,O,A)=>_.if((0,t._)`${A} !== true`,()=>{O===!0?_.assign(A,!0):(_.assign(A,(0,t._)`${A} || {}`),v(_,A,O))}),mergeValues:(_,O)=>_===!0?!0:{..._,...O},resultToName:S}),items:E({mergeNames:(_,O,A)=>_.if((0,t._)`${A} !== true && ${O} !== undefined`,()=>_.assign(A,(0,t._)`${O} === true ? true : ${A} > ${O} ? ${A} : ${O}`)),mergeToName:(_,O,A)=>_.if((0,t._)`${A} !== true`,()=>_.assign(A,O===!0?!0:(0,t._)`${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,t._)`{}`);return O!==void 0&&v(_,A,O),A}e.evaluatedPropsToName=S;function v(_,O,A){Object.keys(A).forEach(z=>_.assign((0,t._)`${O}${(0,t.getProperty)(z)}`,!0))}e.setEvaluated=v;const y={};function T(_,O){return _.scopeValue("func",{ref:O,code:y[O.code]||(y[O.code]=new r._Code(O.code))})}e.useFunc=T;var R;(function(_){_[_.Num=0]="Num",_[_.Str=1]="Str"})(R=e.Type||(e.Type={}));function j(_,O,A){if(_ instanceof t.Name){const z=O===R.Num;return A?z?(0,t._)`"[" + ${_} + "]"`:(0,t._)`"['" + ${_} + "']"`:z?(0,t._)`"/" + ${_}`:(0,t._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(_).toString():"/"+g(_)}e.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)}}e.checkStrictMode=D})(Z);var He={};Object.defineProperty(He,"__esModule",{value:!0});const ye=x,ba={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=ba;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=x,r=Z,n=He;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:y})=>y?(0,t.str)`"${v}" keyword must be ${y} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function s(v,y=e.keywordError,T,R){const{it:j}=v,{gen:D,compositeRule:_,allErrors:O}=j,A=g(v,y,T);R??(_||O)?p(D,A):u(j,(0,t._)`[${A}]`)}e.reportError=s;function i(v,y=e.keywordError,T){const{it:R}=v,{gen:j,compositeRule:D,allErrors:_}=R,O=g(v,y,T);p(j,O),D||_||u(R,n.default.vErrors)}e.reportExtraError=i;function o(v,y){v.assign(n.default.errors,y),v.if((0,t._)`${n.default.vErrors} !== null`,()=>v.if(y,()=>v.assign((0,t._)`${n.default.vErrors}.length`,y),()=>v.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;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,t._)`${n.default.vErrors}[${O}]`),v.if((0,t._)`${_}.instancePath === undefined`,()=>v.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,D.errorPath))),v.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${D.errSchemaPath}/${y}`),D.opts.verbose&&(v.assign((0,t._)`${_}.schema`,T),v.assign((0,t._)`${_}.data`,R))})}e.extendErrors=l;function p(v,y){const T=v.const("err",y);v.if((0,t._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,t._)`[${T}]`),(0,t._)`${n.default.vErrors}.push(${T})`),v.code((0,t._)`${n.default.errors}++`)}function u(v,y){const{gen:T,validateName:R,schemaEnv:j}=v;j.$async?T.throw((0,t._)`new ${v.ValidationError}(${y})`):(T.assign((0,t._)`${R}.errors`,y),T.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function g(v,y,T){const{createErrors:R}=v.it;return R===!1?(0,t._)`{}`:C(v,y,T)}function C(v,y,T={}){const{gen:R,it:j}=v,D=[k(j,T),E(v,T)];return S(v,y,D),R.object(...D)}function k({errorPath:v},{instancePath:y}){const T=y?(0,t.str)`${v}${(0,r.getErrorPath)(y,r.Type.Str)}`:v;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,T)]}function E({keyword:v,it:{errSchemaPath:y}},{schemaPath:T,parentSchema:R}){let j=R?y:(0,t.str)`${y}/${v}`;return T&&(j=(0,t.str)`${j}${(0,r.getErrorPath)(T,r.Type.Str)}`),[d.schemaPath,j]}function S(v,{params:y,message:T},R){const{keyword:j,data:D,schemaValue:_,it:O}=v,{opts:A,propertyName:z,topSchemaRef:B,schemaPath:oe}=O;R.push([d.keyword,j],[d.params,typeof y=="function"?y(v):y||(0,t._)`{}`]),A.messages&&R.push([d.message,typeof T=="function"?T(v):T]),A.verbose&&R.push([d.schema,_],[d.parentSchema,(0,t._)`${B}${oe}`],[n.default.data,D]),z&&R.push([d.propertyName,z])}})(er);Object.defineProperty(Ct,"__esModule",{value:!0});Ct.boolOrEmptySchema=Ct.topBoolOrEmptySchema=void 0;const Pa=er,Ea=x,Sa=He,Ta={message:"boolean schema is false"};function Ra(e){const{gen:t,schema:r,validateName:n}=e;r===!1?wi(e,!1):typeof r=="object"&&r.$async===!0?t.return(Sa.default.data):(t.assign((0,Ea._)`${n}.errors`,null),t.return(!0))}Ct.topBoolOrEmptySchema=Ra;function Oa(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),wi(e)):r.var(t,!0)}Ct.boolOrEmptySchema=Oa;function wi(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Pa.reportError)(s,Ta,void 0,t)}var tr={},dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.getRules=dt.isJSONType=void 0;const Na=["string","number","integer","boolean","null","object","array"],Ca=new Set(Na);function ka(e){return typeof e=="string"&&Ca.has(e)}dt.isJSONType=ka;function ja(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}dt.getRules=ja;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.shouldUseRule=ze.shouldUseGroup=ze.schemaHasRulesForType=void 0;function Ia({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&bi(e,n)}ze.schemaHasRulesForType=Ia;function bi(e,t){return t.rules.some(r=>Pi(e,r))}ze.shouldUseGroup=bi;function Pi(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ze.shouldUseRule=Pi;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=dt,r=ze,n=er,s=x,i=Z;var o;(function(R){R[R.Correct=0]="Correct",R[R.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function l(R){const j=p(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}e.getSchemaTypes=l;function p(R){const j=Array.isArray(R)?R:R?[R]:[];if(j.every(t.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}e.getJSONTypes=p;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 B=S(j,_,O.strictNumbers,o.Wrong);D.if(B,()=>{A.length?C(R,j,A):y(R)})}return z}e.coerceAndCheckDataType=u;const d=new Set(["string","number","integer","boolean","null"]);function g(R,j){return j?R.filter(D=>d.has(D)||j==="array"&&D==="array"):[]}function C(R,j,D){const{gen:_,data:O,opts:A}=R,z=_.let("dataType",(0,s._)`typeof ${O}`),B=_.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(B,O))),_.if((0,s._)`${B} !== undefined`);for(const Q of D)(d.has(Q)||Q==="array"&&A.coerceTypes==="array")&&oe(Q);_.else(),y(R),_.endIf(),_.if((0,s._)`${B} !== undefined`,()=>{_.assign(O,B),k(R,B)});function oe(Q){switch(Q){case"string":_.elseIf((0,s._)`${z} == "number" || ${z} == "boolean"`).assign(B,(0,s._)`"" + ${O}`).elseIf((0,s._)`${O} === null`).assign(B,(0,s._)`""`);return;case"number":_.elseIf((0,s._)`${z} == "boolean" || ${O} === null
|
|
479
479
|
|| (${z} == "string" && ${O} && ${O} == +${O})`).assign(B,(0,s._)`+${O}`);return;case"integer":_.elseIf((0,s._)`${z} === "boolean" || ${O} === null
|
|
480
480
|
|| (${z} === "string" && ${O} && ${O} == +${O} && !(${O} % 1))`).assign(B,(0,s._)`+${O}`);return;case"boolean":_.elseIf((0,s._)`${O} === "false" || ${O} === 0 || ${O} === null`).assign(B,!1).elseIf((0,s._)`${O} === "true" || ${O} === 1`).assign(B,!0);return;case"null":_.elseIf((0,s._)`${O} === "" || ${O} === 0 || ${O} === false`),_.assign(B,null);return;case"array":_.elseIf((0,s._)`${z} === "string" || ${z} === "number"
|
|
481
|
-
|| ${z} === "boolean" || ${O} === null`).assign(B,(0,s._)`[${O}]`)}}}function k({gen:R,parentData:j,parentDataProperty:D},_){R.if((0,s._)`${j} !== undefined`,()=>R.assign((0,s._)`${j}[${D}]`,_))}function E(R,j,D,_=o.Correct){const O=_===o.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 _===o.Correct?A:(0,s.not)(A);function z(B=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,B,D?(0,s._)`isFinite(${j})`:s.nil)}}e.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}e.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)}e.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}}})(tr);var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.assignDefaults=void 0;const Et=K,Fa=Z;function qa(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)ws(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,i)=>ws(e,i,s.default))}Dr.assignDefaults=qa;function ws(e,t,r){const{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;const l=(0,Et._)`${i}${(0,Et.getProperty)(t)}`;if(s){(0,Fa.checkStrictMode)(e,`default is ignored for: ${l}`);return}let p=(0,Et._)`${l} === undefined`;o.useDefaults==="empty"&&(p=(0,Et._)`${p} || ${l} === null || ${l} === ""`),n.if(p,(0,Et._)`${l} = ${(0,Et.stringify)(r)}`)}var Le={},x={};Object.defineProperty(x,"__esModule",{value:!0});x.validateUnion=x.validateArray=x.usePattern=x.callValidateCode=x.schemaProperties=x.allSchemaProperties=x.noPropertyInData=x.propertyInData=x.isOwnProperty=x.hasPropFunc=x.reportMissingProp=x.checkMissingProp=x.checkReportMissingProp=void 0;const ne=K,un=Z,Be=He,Ma=Z;function Ua(e,t){const{gen:r,data:n,it:s}=e;r.if(fn(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ne._)`${t}`},!0),e.error()})}x.checkReportMissingProp=Ua;function La({gen:e,data:t,it:{opts:r}},n,s){return(0,ne.or)(...n.map(i=>(0,ne.and)(fn(e,t,i,r.ownProperties),(0,ne._)`${s} = ${i}`)))}x.checkMissingProp=La;function Ha(e,t){e.setParams({missingProperty:t},!0),e.error()}x.reportMissingProp=Ha;function Si(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ne._)`Object.prototype.hasOwnProperty`})}x.hasPropFunc=Si;function dn(e,t,r){return(0,ne._)`${Si(e)}.call(${t}, ${r})`}x.isOwnProperty=dn;function Va(e,t,r,n){const s=(0,ne._)`${t}${(0,ne.getProperty)(r)} !== undefined`;return n?(0,ne._)`${s} && ${dn(e,t,r)}`:s}x.propertyInData=Va;function fn(e,t,r,n){const s=(0,ne._)`${t}${(0,ne.getProperty)(r)} === undefined`;return n?(0,ne.or)(s,(0,ne.not)(dn(e,t,r))):s}x.noPropertyInData=fn;function Ti(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}x.allSchemaProperties=Ti;function za(e,t){return Ti(t).filter(r=>!(0,un.alwaysValidSchema)(e,t[r]))}x.schemaProperties=za;function Wa({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},l,p,u){const d=u?(0,ne._)`${e}, ${t}, ${n}${s}`:t,g=[[Be.default.instancePath,(0,ne.strConcat)(Be.default.instancePath,i)],[Be.default.parentData,o.parentData],[Be.default.parentDataProperty,o.parentDataProperty],[Be.default.rootData,Be.default.rootData]];o.opts.dynamicRef&&g.push([Be.default.dynamicAnchors,Be.default.dynamicAnchors]);const C=(0,ne._)`${d}, ${r.object(...g)}`;return p!==ne.nil?(0,ne._)`${l}.call(${p}, ${C})`:(0,ne._)`${l}(${C})`}x.callValidateCode=Wa;const xa=(0,ne._)`new RegExp`;function Ka({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,i=s(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ne._)`${s.code==="new RegExp"?xa:(0,Ma.useFunc)(e,s)}(${r}, ${n})`})}x.usePattern=Ka;function Ba(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const l=t.let("valid",!0);return o(()=>t.assign(l,!1)),l}return t.var(i,!0),o(()=>t.break()),i;function o(l){const p=t.const("len",(0,ne._)`${r}.length`);t.forRange("i",0,p,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:un.Type.Num},i),t.if((0,ne.not)(i),l)})}}x.validateArray=Ba;function Ga(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,un.alwaysValidSchema)(s,p))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((p,u)=>{const d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);t.assign(o,(0,ne._)`${o} || ${l}`),e.mergeValidEvaluated(d,l)||t.if((0,ne.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}x.validateUnion=Ga;Object.defineProperty(Le,"__esModule",{value:!0});Le.validateKeywordUsage=Le.validSchemaType=Le.funcKeywordCode=Le.macroKeywordCode=void 0;const ge=K,st=He,Ja=x,Ya=er;function Qa(e,t){const{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,l=t.macro.call(o.self,s,i,o),p=Ri(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);const u=r.name("valid");e.subschema({schema:l,schemaPath:ge.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:p,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Le.macroKeywordCode=Qa;function Xa(e,t){var r;const{gen:n,keyword:s,schema:i,parentSchema:o,$data:l,it:p}=e;ec(p,t);const u=!l&&t.compile?t.compile.call(p.self,i,o,p):t.validate,d=Ri(n,s,u),g=n.let("valid");e.block$data(g,C),e.ok((r=t.valid)!==null&&r!==void 0?r:g);function C(){if(t.errors===!1)S(),t.modifying&&bs(e),v(()=>e.error());else{const y=t.async?k():E();t.modifying&&bs(e),v(()=>Za(e,y))}}function k(){const y=n.let("ruleErrs",null);return n.try(()=>S((0,ge._)`await `),T=>n.assign(g,!1).if((0,ge._)`${T} instanceof ${p.ValidationError}`,()=>n.assign(y,(0,ge._)`${T}.errors`),()=>n.throw(T))),y}function E(){const y=(0,ge._)`${d}.errors`;return n.assign(y,null),S(ge.nil),y}function S(y=t.async?(0,ge._)`await `:ge.nil){const T=p.opts.passContext?st.default.this:st.default.self,R=!("compile"in t&&!l||t.schema===!1);n.assign(g,(0,ge._)`${y}${(0,Ja.callValidateCode)(e,d,T,R)}`,t.modifying)}function v(y){var T;n.if((0,ge.not)((T=t.valid)!==null&&T!==void 0?T:g),y)}}Le.funcKeywordCode=Xa;function bs(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,ge._)`${n.parentData}[${n.parentDataProperty}]`))}function Za(e,t){const{gen:r}=e;r.if((0,ge._)`Array.isArray(${t})`,()=>{r.assign(st.default.vErrors,(0,ge._)`${st.default.vErrors} === null ? ${t} : ${st.default.vErrors}.concat(${t})`).assign(st.default.errors,(0,ge._)`${st.default.vErrors}.length`),(0,Ya.extendErrors)(e)},()=>e.error())}function ec({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Ri(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ge.stringify)(r)})}function tc(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Le.validSchemaType=tc;function rc({schema:e,opts:t,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 o=s.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(e,l)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){const p=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}Le.validateKeywordUsage=rc;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.extendSubschemaMode=Ye.extendSubschemaData=Ye.getSubschema=void 0;const Ue=K,Oi=Z;function nc(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const l=e.schema[t];return r===void 0?{schema:l,schemaPath:(0,Ue._)`${e.schemaPath}${(0,Ue.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:l[r],schemaPath:(0,Ue._)`${e.schemaPath}${(0,Ue.getProperty)(t)}${(0,Ue.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Oi.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ye.getSubschema=nc;function sc(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(r!==void 0){const{errorPath:u,dataPathArr:d,opts:g}=t,C=l.let("data",(0,Ue._)`${t.data}${(0,Ue.getProperty)(r)}`,!0);p(C),e.errorPath=(0,Ue.str)`${u}${(0,Oi.getErrorPath)(r,n,g.jsPropertySyntax)}`,e.parentDataProperty=(0,Ue._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const u=s instanceof Ue.Name?s:l.let("data",s,!0);p(u),o!==void 0&&(e.propertyName=o)}i&&(e.dataTypes=i);function p(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Ye.extendSubschemaData=sc;function ic(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ye.extendSubschemaMode=ic;var he={},Ni=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),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 o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r},Ci={exports:{}},Je=Ci.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};yr(t,n,s,e,"",e)};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 yr(e,t,r,n,s,i,o,l,p,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,l,p,u);for(var d in n){var g=n[d];if(Array.isArray(g)){if(d in Je.arrayKeywords)for(var C=0;C<g.length;C++)yr(e,t,r,g[C],s+"/"+d+"/"+C,i,s,d,n,C)}else if(d in Je.propsKeywords){if(g&&typeof g=="object")for(var k in g)yr(e,t,r,g[k],s+"/"+d+"/"+oc(k),i,s,d,n,k)}else(d in Je.keywords||e.allKeys&&!(d in Je.skipKeywords))&&yr(e,t,r,g,s+"/"+d,i,s,d,n)}r(n,s,i,o,l,p,u)}}function oc(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var ac=Ci.exports;Object.defineProperty(he,"__esModule",{value:!0});he.getSchemaRefs=he.resolveUrl=he.normalizeId=he._getFullPath=he.getFullPath=he.inlineRef=void 0;const cc=Z,lc=Ni,uc=ac,dc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fc(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Yr(e):t?ki(e)<=t:!1}he.inlineRef=fc;const pc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Yr(e){for(const t in e){if(pc.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Yr)||typeof r=="object"&&Yr(r))return!0}return!1}function ki(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!dc.has(r)&&(typeof e[r]=="object"&&(0,cc.eachItem)(e[r],n=>t+=ki(n)),t===1/0))return 1/0}return t}function ji(e,t="",r){r!==!1&&(t=Nt(t));const n=e.parse(t);return Ii(e,n)}he.getFullPath=ji;function Ii(e,t){return e.serialize(t).split("#")[0]+"#"}he._getFullPath=Ii;const hc=/#\/?$/;function Nt(e){return e?e.replace(hc,""):""}he.normalizeId=Nt;function mc(e,t,r){return r=Nt(r),e.resolve(t,r)}he.resolveUrl=mc;const yc=/^[a-z_][-a-z0-9._]*$/i;function gc(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Nt(e[r]||t),i={"":s},o=ji(n,s,!1),l={},p=new Set;return uc(e,{allKeys:!0},(g,C,k,E)=>{if(E===void 0)return;const S=o+C;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[C]=v;function y(R){const j=this.opts.uriResolver.resolve;if(R=Nt(v?j(v,R):R),p.has(R))throw d(R);p.add(R);let D=this.refs[R];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?u(g,D.schema,R):R!==Nt(S)&&(R[0]==="#"?(u(g,l[R],R),l[R]=g):this.refs[R]=S),R}function T(R){if(typeof R=="string"){if(!yc.test(R))throw new Error(`invalid anchor "${R}"`);y.call(this,`#${R}`)}}}),l;function u(g,C,k){if(C!==void 0&&!lc(g,C))throw d(k)}function d(g){return new Error(`reference "${g}" resolves to more than one schema`)}}he.getSchemaRefs=gc;Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getData=Ne.KeywordCxt=Ne.validateFunctionCode=void 0;const Ai=Ct,Ps=tr,pn=ze,br=tr,$c=Dr,Bt=Le,Hr=Ye,U=K,V=He,vc=he,We=Z,Wt=er;function _c(e){if(qi(e)&&(Mi(e),Fi(e))){Pc(e);return}Di(e,()=>(0,Ai.topBoolOrEmptySchema)(e))}Ne.validateFunctionCode=_c;function Di({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){s.code.es5?e.func(t,(0,U._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{e.code((0,U._)`"use strict"; ${Es(r,s)}`),bc(e,s),e.code(i)}):e.func(t,(0,U._)`${V.default.data}, ${wc(s)}`,n.$async,()=>e.code(Es(r,s)).code(i))}function wc(e){return(0,U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${e.dynamicRef?(0,U._)`, ${V.default.dynamicAnchors}={}`:U.nil}}={}`}function bc(e,t){e.if(V.default.valCxt,()=>{e.var(V.default.instancePath,(0,U._)`${V.default.valCxt}.${V.default.instancePath}`),e.var(V.default.parentData,(0,U._)`${V.default.valCxt}.${V.default.parentData}`),e.var(V.default.parentDataProperty,(0,U._)`${V.default.valCxt}.${V.default.parentDataProperty}`),e.var(V.default.rootData,(0,U._)`${V.default.valCxt}.${V.default.rootData}`),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{e.var(V.default.instancePath,(0,U._)`""`),e.var(V.default.parentData,(0,U._)`undefined`),e.var(V.default.parentDataProperty,(0,U._)`undefined`),e.var(V.default.rootData,V.default.data),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`{}`)})}function Pc(e){const{schema:t,opts:r,gen:n}=e;Di(e,()=>{r.$comment&&t.$comment&&Li(e),Oc(e),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&Ec(e),Ui(e),kc(e)})}function Ec(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,U._)`${r}.evaluated`),t.if((0,U._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,U._)`${e.evaluated}.props`,(0,U._)`undefined`)),t.if((0,U._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,U._)`${e.evaluated}.items`,(0,U._)`undefined`))}function Es(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function Sc(e,t){if(qi(e)&&(Mi(e),Fi(e))){Tc(e,t);return}(0,Ai.boolOrEmptySchema)(e,t)}function Fi({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function qi(e){return typeof e.schema!="boolean"}function Tc(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&Li(e),Nc(e),Cc(e);const i=n.const("_errs",V.default.errors);Ui(e,i),n.var(t,(0,U._)`${i} === ${V.default.errors}`)}function Mi(e){(0,We.checkUnknownRules)(e),Rc(e)}function Ui(e,t){if(e.opts.jtd)return Ss(e,[],!1,t);const r=(0,Ps.getSchemaTypes)(e.schema),n=(0,Ps.coerceAndCheckDataType)(e,r);Ss(e,r,!n,t)}function Rc(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,We.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Oc(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,We.checkStrictMode)(e,"default is ignored in the schema root")}function Nc(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,vc.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Cc(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Li({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)e.code((0,U._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const o=(0,U.str)`${n}/$comment`,l=e.scopeValue("root",{ref:t.root});e.code((0,U._)`${V.default.self}.opts.$comment(${i}, ${o}, ${l}.schema)`)}}function kc(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;r.$async?t.if((0,U._)`${V.default.errors} === 0`,()=>t.return(V.default.data),()=>t.throw((0,U._)`new ${s}(${V.default.vErrors})`)):(t.assign((0,U._)`${n}.errors`,V.default.vErrors),i.unevaluated&&jc(e),t.return((0,U._)`${V.default.errors} === 0`))}function jc({gen:e,evaluated:t,props:r,items:n}){r instanceof U.Name&&e.assign((0,U._)`${t}.props`,r),n instanceof U.Name&&e.assign((0,U._)`${t}.items`,n)}function Ss(e,t,r,n){const{gen:s,schema:i,data:o,allErrors:l,opts:p,self:u}=e,{RULES:d}=u;if(i.$ref&&(p.ignoreKeywordsWithRef||!(0,We.schemaHasRulesButRef)(i,d))){s.block(()=>zi(e,"$ref",d.all.$ref.definition));return}p.jtd||Ic(e,t),s.block(()=>{for(const C of d.rules)g(C);g(d.post)});function g(C){(0,pn.shouldUseGroup)(i,C)&&(C.type?(s.if((0,br.checkDataType)(C.type,o,p.strictNumbers)),Ts(e,C),t.length===1&&t[0]===C.type&&r&&(s.else(),(0,br.reportTypeError)(e)),s.endIf()):Ts(e,C),l||s.if((0,U._)`${V.default.errors} === ${n||0}`))}}function Ts(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,$c.assignDefaults)(e,t.type),r.block(()=>{for(const i of t.rules)(0,pn.shouldUseRule)(n,i)&&zi(e,i.keyword,i.definition,t.type)})}function Ic(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Ac(e,t),e.opts.allowUnionTypes||Dc(e,t),Fc(e,e.dataTypes))}function Ac(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Hi(e.dataTypes,r)||hn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Mc(e,t)}}function Dc(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&hn(e,"use allowUnionTypes to allow union type keyword")}function Fc(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,pn.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(o=>qc(t,o))&&hn(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function qc(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Hi(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Mc(e,t){const r=[];for(const n of e.dataTypes)Hi(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function hn(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,We.checkStrictMode)(e,t,e.opts.strictTypes)}class Vi{constructor(t,r,n){if((0,Bt.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,We.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Wi(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Bt.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=t.gen.const("_errs",V.default.errors))}result(t,r,n){this.failResult((0,U.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,U.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,U._)`${r} !== undefined && (${(0,U.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Wt.reportExtraError:Wt.reportError)(this,this.def.error,r)}$dataError(){(0,Wt.reportError)(this,this.def.$dataError||Wt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Wt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=U.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),t!==U.nil&&n.assign(t,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==U.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,U.or)(o(),l());function o(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const p=Array.isArray(n)?n:[n];return(0,U._)`${(0,br.checkDataTypes)(p,r,i.opts.strictNumbers,br.DataType.Wrong)}`}return U.nil}function l(){if(s.validateSchema){const p=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${p}(${r})`}return U.nil}}subschema(t,r){const n=(0,Hr.getSubschema)(this.it,t);(0,Hr.extendSubschemaData)(n,this.it,t),(0,Hr.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return Sc(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=We.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=We.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,U.Name)),!0}}Ne.KeywordCxt=Vi;function zi(e,t,r,n){const s=new Vi(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Bt.funcKeywordCode)(s,r):"macro"in r?(0,Bt.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Bt.funcKeywordCode)(s,r)}const Uc=/^\/(?:[^~]|~0|~1)*$/,Lc=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Wi(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return V.default.rootData;if(e[0]==="/"){if(!Uc.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,i=V.default.rootData}else{const u=Lc.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw new Error(p("property/index",d));return n[t-d]}if(d>t)throw new Error(p("data",d));if(i=r[t-d],!s)return i}let o=i;const l=s.split("/");for(const u of l)u&&(i=(0,U._)`${i}${(0,U.getProperty)((0,We.unescapeJsonPointer)(u))}`,o=(0,U._)`${o} && ${i}`);return o;function p(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}Ne.getData=Wi;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});class Hc extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}rr.default=Hc;var nr={};Object.defineProperty(nr,"__esModule",{value:!0});const Vr=he;class Vc extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Vr.resolveUrl)(t,r,n),this.missingSchema=(0,Vr.normalizeId)((0,Vr.getFullPath)(t,this.missingRef))}}nr.default=Vc;var _e={};Object.defineProperty(_e,"__esModule",{value:!0});_e.resolveSchema=_e.getCompilingSchema=_e.resolveRef=_e.compileSchema=_e.SchemaEnv=void 0;const Te=K,zc=rr,nt=He,Oe=he,Rs=Z,Wc=Ne;class Fr{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Oe.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}}_e.SchemaEnv=Fr;function mn(e){const t=xi.call(this,e);if(t)return t;const r=(0,Oe.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Te.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let l;e.$async&&(l=o.scopeValue("Error",{ref:zc.default,code:(0,Te._)`require("ajv/dist/runtime/validation_error").default`}));const p=o.scopeName("validate");e.validateName=p;const u={gen:o,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:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Te.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:l,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Te.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Te._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,Wc.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);const g=o.toString();d=`${o.scopeRefs(nt.default.scope)}return ${g}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const k=new Function(`${nt.default.self}`,`${nt.default.scope}`,d)(this,this.scope.get());if(this.scope.value(p,{ref:k}),k.errors=null,k.schema=e.schema,k.schemaEnv=e,e.$async&&(k.$async=!0),this.opts.code.source===!0&&(k.source={validateName:p,validateCode:g,scopeValues:o._values}),this.opts.unevaluated){const{props:E,items:S}=u;k.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},k.source&&(k.source.evaluated=(0,Te.stringify)(k.evaluated))}return e.validate=k,e}catch(g){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),g}finally{this._compilations.delete(e)}}_e.compileSchema=mn;function xc(e,t,r){var n;r=(0,Oe.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=Gc.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(i=new Fr({schema:o,schemaId:l,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Kc.call(this,i)}_e.resolveRef=xc;function Kc(e){return(0,Oe.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:mn.call(this,e)}function xi(e){for(const t of this._compilations)if(Bc(t,e))return t}_e.getCompilingSchema=xi;function Bc(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Gc(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||qr.call(this,e,t)}function qr(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Oe._getFullPath)(this.opts.uriResolver,r);let s=(0,Oe.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return zr.call(this,r,e);const i=(0,Oe.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const l=qr.call(this,e,o);return typeof l?.schema!="object"?void 0:zr.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||mn.call(this,o),i===(0,Oe.normalizeId)(t)){const{schema:l}=o,{schemaId:p}=this.opts,u=l[p];return u&&(s=(0,Oe.resolveUrl)(this.opts.uriResolver,s,u)),new Fr({schema:l,schemaId:p,root:e,baseId:s})}return zr.call(this,r,o)}}_e.resolveSchema=qr;const Jc=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zr(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const p=r[(0,Rs.unescapeFragment)(l)];if(p===void 0)return;r=p;const u=typeof r=="object"&&r[this.opts.schemaId];!Jc.has(l)&&u&&(t=(0,Oe.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Rs.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Oe.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=qr.call(this,n,l)}const{schemaId:o}=this.opts;if(i=i||new Fr({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const Yc="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Qc="Meta-schema for $data reference (JSON AnySchema extension proposal)",Xc="object",Zc=["$data"],el={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},tl=!1,rl={$id:Yc,description:Qc,type:Xc,required:Zc,properties:el,additionalProperties:tl};var yn={},Qr={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,n){n(t)})(ba,function(r){function n(){for(var f=arguments.length,c=Array(f),m=0;m<f;m++)c[m]=arguments[m];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(f){return"(?:"+f+")"}function i(f){return f===void 0?"undefined":f===null?"null":Object.prototype.toString.call(f).split(" ").pop().split("]").shift().toLowerCase()}function o(f){return f.toUpperCase()}function l(f){return f!=null?f instanceof Array?f:typeof f.length!="number"||f.split||f.setInterval||f.call?[f]:Array.prototype.slice.call(f):[]}function p(f,c){var m=f;if(c)for(var P in c)m[P]=c[P];return m}function u(f){var c="[A-Za-z]",m="[0-9]",P=n(m,"[A-Fa-f]"),b=s(s("%[EFef]"+P+"%"+P+P+"%"+P+P)+"|"+s("%[89A-Fa-f]"+P+"%"+P+P)+"|"+s("%"+P+P)),L="[\\:\\/\\?\\#\\[\\]\\@]",H="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",X=n(L,H),re=f?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ce=f?"[\\uE000-\\uF8FF]":"[]",J=n(c,m,"[\\-\\.\\_\\~]",re);s(c+n(c,m,"[\\+\\-\\.]")+"*"),s(s(b+"|"+n(J,H,"[\\:]"))+"*");var te=s(s("25[0-5]")+"|"+s("2[0-4]"+m)+"|"+s("1"+m+m)+"|"+s("0?[1-9]"+m)+"|0?0?"+m),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),xe=s(s(W)+"?\\:\\:"+s(W+"\\:")+"{4}"+se),Fe=s(s(s(W+"\\:")+"{0,1}"+W)+"?\\:\\:"+s(W+"\\:")+"{3}"+se),qe=s(s(s(W+"\\:")+"{0,2}"+W)+"?\\:\\:"+s(W+"\\:")+"{2}"+se),bt=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([fe,ie,xe,Fe,qe,bt,tt,Ee,Me].join("|")),Ve=s(s(J+"|"+b)+"+");s("[vV]"+P+"+\\."+n(J,H,"[\\:]")+"+"),s(s(b+"|"+n(J,H))+"*");var Vt=s(b+"|"+n(J,H,"[\\:\\@]"));return s(s(b+"|"+n(J,H,"[\\@]"))+"+"),s(s(Vt+"|"+n("[\\/\\?]",ce))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,m,"[\\+\\-\\.]"),"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,X),"g"),PCT_ENCODED:new RegExp(b,"g"),IPV4ADDRESS:new RegExp("^("+le+")$"),IPV6ADDRESS:new RegExp("^\\[?("+rt+")"+s(s("\\%25|\\%(?!"+P+"{2})")+"("+Ve+")")+"?\\]?$")}}var d=u(!1),g=u(!0),C=function(){function f(c,m){var P=[],b=!0,L=!1,H=void 0;try{for(var X=c[Symbol.iterator](),re;!(b=(re=X.next()).done)&&(P.push(re.value),!(m&&P.length===m));b=!0);}catch(ce){L=!0,H=ce}finally{try{!b&&X.return&&X.return()}finally{if(L)throw H}}return P}return function(c,m){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return f(c,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=function(f){if(Array.isArray(f)){for(var c=0,m=Array(f.length);c<f.length;c++)m[c]=f[c];return m}else return Array.from(f)},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,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-v,Q=Math.floor,be=String.fromCharCode;function de(f){throw new RangeError(B[f])}function Qe(f,c){for(var m=[],P=f.length;P--;)m[P]=c(f[P]);return m}function Xe(f,c){var m=f.split("@"),P="";m.length>1&&(P=m[0]+"@",f=m[1]),f=f.replace(z,".");var b=f.split("."),L=Qe(b,c).join(".");return P+L}function ht(f){for(var c=[],m=0,P=f.length;m<P;){var b=f.charCodeAt(m++);if(b>=55296&&b<=56319&&m<P){var L=f.charCodeAt(m++);(L&64512)==56320?c.push(((b&1023)<<10)+(L&1023)+65536):(c.push(b),m--)}else c.push(b)}return c}var At=function(c){return String.fromCodePoint.apply(String,k(c))},mt=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:S},F=function(c,m){return c+22+75*(c<26)-((m!=0)<<5)},$=function(c,m,P){var b=0;for(c=P?Q(c/R):c>>1,c+=Q(c/m);c>oe*y>>1;b+=S)c=Q(c/oe);return Q(b+(oe+1)*c/(c+T))},I=function(c){var m=[],P=c.length,b=0,L=D,H=j,X=c.lastIndexOf(_);X<0&&(X=0);for(var re=0;re<X;++re)c.charCodeAt(re)>=128&&de("not-basic"),m.push(c.charCodeAt(re));for(var ce=X>0?X+1:0;ce<P;){for(var J=b,te=1,le=S;;le+=S){ce>=P&&de("invalid-input");var W=mt(c.charCodeAt(ce++));(W>=S||W>Q((E-b)/te))&&de("overflow"),b+=W*te;var se=le<=H?v:le>=H+y?y:le-H;if(W<se)break;var fe=S-se;te>Q(E/fe)&&de("overflow"),te*=fe}var ie=m.length+1;H=$(b-J,ie,J==0),Q(b/ie)>E-L&&de("overflow"),L+=Q(b/ie),b%=ie,m.splice(b++,0,L)}return String.fromCodePoint.apply(String,m)},w=function(c){var m=[];c=ht(c);var P=c.length,b=D,L=0,H=j,X=!0,re=!1,ce=void 0;try{for(var J=c[Symbol.iterator](),te;!(X=(te=J.next()).done);X=!0){var le=te.value;le<128&&m.push(be(le))}}catch(zt){re=!0,ce=zt}finally{try{!X&&J.return&&J.return()}finally{if(re)throw ce}}var W=m.length,se=W;for(W&&m.push(_);se<P;){var fe=E,ie=!0,xe=!1,Fe=void 0;try{for(var qe=c[Symbol.iterator](),bt;!(ie=(bt=qe.next()).done);ie=!0){var tt=bt.value;tt>=b&&tt<fe&&(fe=tt)}}catch(zt){xe=!0,Fe=zt}finally{try{!ie&&qe.return&&qe.return()}finally{if(xe)throw Fe}}var Ee=se+1;fe-b>Q((E-L)/Ee)&&de("overflow"),L+=(fe-b)*Ee,b=fe;var Me=!0,rt=!1,Ve=void 0;try{for(var Vt=c[Symbol.iterator](),ss;!(Me=(ss=Vt.next()).done);Me=!0){var is=ss.value;if(is<b&&++L>E&&de("overflow"),is==b){for(var or=L,ar=S;;ar+=S){var cr=ar<=H?v:ar>=H+y?y:ar-H;if(or<cr)break;var os=or-cr,as=S-cr;m.push(be(F(cr+os%as,0))),or=Q(os/as)}m.push(be(F(or,0))),H=$(L,Ee,se==W),L=0,++se}}}catch(zt){rt=!0,Ve=zt}finally{try{!Me&&Vt.return&&Vt.return()}finally{if(rt)throw Ve}}++L,++b}return m.join("")},a=function(c){return Xe(c,function(m){return O.test(m)?I(m.slice(4).toLowerCase()):m})},h=function(c){return Xe(c,function(m){return A.test(m)?"xn--"+w(m):m})},N={version:"2.1.0",ucs2:{decode:ht,encode:At},decode:I,encode:w,toASCII:h,toUnicode:a},q={};function M(f){var c=f.charCodeAt(0),m=void 0;return c<16?m="%0"+c.toString(16).toUpperCase():c<128?m="%"+c.toString(16).toUpperCase():c<2048?m="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():m="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),m}function G(f){for(var c="",m=0,P=f.length;m<P;){var b=parseInt(f.substr(m+1,2),16);if(b<128)c+=String.fromCharCode(b),m+=3;else if(b>=194&&b<224){if(P-m>=6){var L=parseInt(f.substr(m+4,2),16);c+=String.fromCharCode((b&31)<<6|L&63)}else c+=f.substr(m,6);m+=6}else if(b>=224){if(P-m>=9){var H=parseInt(f.substr(m+4,2),16),X=parseInt(f.substr(m+7,2),16);c+=String.fromCharCode((b&15)<<12|(H&63)<<6|X&63)}else c+=f.substr(m,9);m+=9}else c+=f.substr(m,3),m+=3}return c}function Y(f,c){function m(P){var b=G(P);return b.match(c.UNRESERVED)?b:P}return f.scheme&&(f.scheme=String(f.scheme).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_SCHEME,"")),f.userinfo!==void 0&&(f.userinfo=String(f.userinfo).replace(c.PCT_ENCODED,m).replace(c.NOT_USERINFO,M).replace(c.PCT_ENCODED,o)),f.host!==void 0&&(f.host=String(f.host).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_HOST,M).replace(c.PCT_ENCODED,o)),f.path!==void 0&&(f.path=String(f.path).replace(c.PCT_ENCODED,m).replace(f.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,M).replace(c.PCT_ENCODED,o)),f.query!==void 0&&(f.query=String(f.query).replace(c.PCT_ENCODED,m).replace(c.NOT_QUERY,M).replace(c.PCT_ENCODED,o)),f.fragment!==void 0&&(f.fragment=String(f.fragment).replace(c.PCT_ENCODED,m).replace(c.NOT_FRAGMENT,M).replace(c.PCT_ENCODED,o)),f}function ae(f){return f.replace(/^0*(.*)/,"$1")||"0"}function Ie(f,c){var m=f.match(c.IPV4ADDRESS)||[],P=C(m,2),b=P[1];return b?b.split(".").map(ae).join("."):f}function yt(f,c){var m=f.match(c.IPV6ADDRESS)||[],P=C(m,3),b=P[1],L=P[2];if(b){for(var H=b.toLowerCase().split("::").reverse(),X=C(H,2),re=X[0],ce=X[1],J=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]=J[ie]||te[se+ie]||"";le&&(fe[W-1]=Ie(fe[W-1],c));var xe=fe.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},[]),Fe=xe.sort(function(Ee,Me){return Me.length-Ee.length})[0],qe=void 0;if(Fe&&Fe.length>1){var bt=fe.slice(0,Fe.index),tt=fe.slice(Fe.index+Fe.length);qe=bt.join(":")+"::"+tt.join(":")}else qe=fe.join(":");return L&&(qe+="%"+L),qe}else return f}var Dt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ft="".match(/(){0}/)[1]===void 0;function we(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m={},P=c.iri!==!1?g:d;c.reference==="suffix"&&(f=(c.scheme?c.scheme+":":"")+"//"+f);var b=f.match(Dt);if(b){Ft?(m.scheme=b[1],m.userinfo=b[3],m.host=b[4],m.port=parseInt(b[5],10),m.path=b[6]||"",m.query=b[7],m.fragment=b[8],isNaN(m.port)&&(m.port=b[5])):(m.scheme=b[1]||void 0,m.userinfo=f.indexOf("@")!==-1?b[3]:void 0,m.host=f.indexOf("//")!==-1?b[4]:void 0,m.port=parseInt(b[5],10),m.path=b[6]||"",m.query=f.indexOf("?")!==-1?b[7]:void 0,m.fragment=f.indexOf("#")!==-1?b[8]:void 0,isNaN(m.port)&&(m.port=f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?b[4]:void 0)),m.host&&(m.host=yt(Ie(m.host,P),P)),m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&!m.path&&m.query===void 0?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==m.reference&&(m.error=m.error||"URI is not a "+c.reference+" reference.");var L=q[(c.scheme||m.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!L||!L.unicodeSupport)){if(m.host&&(c.domainHost||L&&L.domainHost))try{m.host=N.toASCII(m.host.replace(P.PCT_ENCODED,G).toLowerCase())}catch(H){m.error=m.error||"Host's domain name can not be converted to ASCII via punycode: "+H}Y(m,d)}else Y(m,P);L&&L.parse&&L.parse(m,c)}else m.error=m.error||"URI can not be parsed.";return m}function qt(f,c){var m=c.iri!==!1?g:d,P=[];return f.userinfo!==void 0&&(P.push(f.userinfo),P.push("@")),f.host!==void 0&&P.push(yt(Ie(String(f.host),m),m).replace(m.IPV6ADDRESS,function(b,L,H){return"["+L+(H?"%25"+H:"")+"]"})),(typeof f.port=="number"||typeof f.port=="string")&&(P.push(":"),P.push(String(f.port))),P.length?P.join(""):void 0}var gt=/^\.\.?\//,$t=/^\/\.(\/|$)/,vt=/^\/\.\.(\/|$)/,Mt=/^\/?(?:.|\n)*?(?=\/|$)/;function Ae(f){for(var c=[];f.length;)if(f.match(gt))f=f.replace(gt,"");else if(f.match($t))f=f.replace($t,"/");else if(f.match(vt))f=f.replace(vt,"/"),c.pop();else if(f==="."||f==="..")f="";else{var m=f.match(Mt);if(m){var P=m[0];f=f.slice(P.length),c.push(P)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function $e(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=c.iri?g:d,P=[],b=q[(c.scheme||f.scheme||"").toLowerCase()];if(b&&b.serialize&&b.serialize(f,c),f.host&&!m.IPV6ADDRESS.test(f.host)){if(c.domainHost||b&&b.domainHost)try{f.host=c.iri?N.toUnicode(f.host):N.toASCII(f.host.replace(m.PCT_ENCODED,G).toLowerCase())}catch(X){f.error=f.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+X}}Y(f,m),c.reference!=="suffix"&&f.scheme&&(P.push(f.scheme),P.push(":"));var L=qt(f,c);if(L!==void 0&&(c.reference!=="suffix"&&P.push("//"),P.push(L),f.path&&f.path.charAt(0)!=="/"&&P.push("/")),f.path!==void 0){var H=f.path;!c.absolutePath&&(!b||!b.absolutePath)&&(H=Ae(H)),L===void 0&&(H=H.replace(/^\/\//,"/%2F")),P.push(H)}return f.query!==void 0&&(P.push("?"),P.push(f.query)),f.fragment!==void 0&&(P.push("#"),P.push(f.fragment)),P.join("")}function _t(f,c){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments[3],b={};return P||(f=we($e(f,m),m),c=we($e(c,m),m)),m=m||{},!m.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):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?b.path="/"+c.path:f.path?b.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+c.path:b.path=c.path,b.path=Ae(b.path)),b.query=c.query):(b.path=f.path,c.query!==void 0?b.query=c.query:b.query=f.query),b.userinfo=f.userinfo,b.host=f.host,b.port=f.port),b.scheme=f.scheme),b.fragment=c.fragment,b}function Ut(f,c,m){var P=p({scheme:"null"},m);return $e(_t(we(f,P),we(c,P),P,!0),P)}function Ze(f,c){return typeof f=="string"?f=$e(we(f,c),c):i(f)==="object"&&(f=we($e(f,c),c)),f}function Lt(f,c,m){return typeof f=="string"?f=$e(we(f,m),m):i(f)==="object"&&(f=$e(f,m)),typeof c=="string"?c=$e(we(c,m),m):i(c)==="object"&&(c=$e(c,m)),f===c}function ir(f,c){return f&&f.toString().replace(!c||!c.iri?d.ESCAPE:g.ESCAPE,M)}function Pe(f,c){return f&&f.toString().replace(!c||!c.iri?d.PCT_ENCODED:g.PCT_ENCODED,G)}var et={scheme:"http",domainHost:!0,parse:function(c,m){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,m){var P=String(c.scheme).toLowerCase()==="https";return(c.port===(P?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},Yn={scheme:"https",domainHost:et.domainHost,parse:et.parse,serialize:et.serialize};function Qn(f){return typeof f.secure=="boolean"?f.secure:String(f.scheme).toLowerCase()==="wss"}var Ht={scheme:"ws",domainHost:!0,parse:function(c,m){var P=c;return P.secure=Qn(P),P.resourceName=(P.path||"/")+(P.query?"?"+P.query:""),P.path=void 0,P.query=void 0,P},serialize:function(c,m){if((c.port===(Qn(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=C(P,2),L=b[0],H=b[1];c.path=L&&L!=="/"?L:void 0,c.query=H,c.resourceName=void 0}return c.fragment=void 0,c}},Xn={scheme:"wss",domainHost:Ht.domainHost,parse:Ht.parse,serialize:Ht.serialize},ho={},Zn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",De="[0-9A-Fa-f]",mo=s(s("%[EFef]"+De+"%"+De+De+"%"+De+De)+"|"+s("%[89A-Fa-f]"+De+"%"+De+De)+"|"+s("%"+De+De)),yo="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",go="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",$o=n(go,'[\\"\\\\]'),vo="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",_o=new RegExp(Zn,"g"),wt=new RegExp(mo,"g"),wo=new RegExp(n("[^]",yo,"[\\.]",'[\\"]',$o),"g"),es=new RegExp(n("[^]",Zn,vo),"g"),bo=es;function Ur(f){var c=G(f);return c.match(_o)?c:f}var ts={scheme:"mailto",parse:function(c,m){var P=c,b=P.to=P.path?P.path.split(","):[];if(P.path=void 0,P.query){for(var L=!1,H={},X=P.query.split("&"),re=0,ce=X.length;re<ce;++re){var J=X[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],m);break;case"body":P.body=Pe(J[1],m);break;default:L=!0,H[Pe(J[0],m)]=Pe(J[1],m);break}}L&&(P.headers=H)}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]),m.unicodeSupport)ie[1]=Pe(ie[1],m).toLowerCase();else try{ie[1]=N.toASCII(Pe(ie[1],m).toLowerCase())}catch(xe){P.error=P.error||"Email address's domain name can not be converted to ASCII via punycode: "+xe}b[se]=ie.join("@")}return P},serialize:function(c,m){var P=c,b=l(c.to);if(b){for(var L=0,H=b.length;L<H;++L){var X=String(b[L]),re=X.lastIndexOf("@"),ce=X.slice(0,re).replace(wt,Ur).replace(wt,o).replace(wo,M),J=X.slice(re+1);try{J=m.iri?N.toUnicode(J):N.toASCII(Pe(J,m).toLowerCase())}catch(se){P.error=P.error||"Email address's domain name can not be converted to "+(m.iri?"Unicode":"ASCII")+" via punycode: "+se}b[L]=ce+"@"+J}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]!==ho[W]&&le.push(W.replace(wt,Ur).replace(wt,o).replace(es,M)+"="+te[W].replace(wt,Ur).replace(wt,o).replace(bo,M));return le.length&&(P.query=le.join("&")),P}},Po=/^([^\:]+)\:(.*)/,rs={scheme:"urn",parse:function(c,m){var P=c.path&&c.path.match(Po),b=c;if(P){var L=m.scheme||b.scheme||"urn",H=P[1].toLowerCase(),X=P[2],re=L+":"+(m.nid||H),ce=q[re];b.nid=H,b.nss=X,b.path=void 0,ce&&(b=ce.parse(b,m))}else b.error=b.error||"URN can not be parsed.";return b},serialize:function(c,m){var P=m.scheme||c.scheme||"urn",b=c.nid,L=P+":"+(m.nid||b),H=q[L];H&&(c=H.serialize(c,m));var X=c,re=c.nss;return X.path=(b||m.nid)+":"+re,X}},Eo=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ns={scheme:"urn:uuid",parse:function(c,m){var P=c;return P.uuid=P.nss,P.nss=void 0,!m.tolerant&&(!P.uuid||!P.uuid.match(Eo))&&(P.error=P.error||"UUID is not valid."),P},serialize:function(c,m){var P=c;return P.nss=(c.uuid||"").toLowerCase(),P}};q[et.scheme]=et,q[Yn.scheme]=Yn,q[Ht.scheme]=Ht,q[Xn.scheme]=Xn,q[ts.scheme]=ts,q[rs.scheme]=rs,q[ns.scheme]=ns,r.SCHEMES=q,r.pctEncChar=M,r.pctDecChars=G,r.parse=we,r.removeDotSegments=Ae,r.serialize=$e,r.resolveComponents=_t,r.resolve=Ut,r.normalize=Ze,r.equal=Lt,r.escapeComponent=ir,r.unescapeComponent=Pe,Object.defineProperty(r,"__esModule",{value:!0})})})(Qr,Qr.exports);var nl=Qr.exports;Object.defineProperty(yn,"__esModule",{value:!0});const Ki=nl;Ki.code='require("ajv/dist/runtime/uri").default';yn.default=Ki;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ne;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=K;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=rr,s=nr,i=dt,o=_e,l=K,p=he,u=tr,d=Z,g=rl,C=yn,k=(F,$)=>new RegExp(F,$);k.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(F){var $,I,w,a,h,N,q,M,G,Y,ae,Ie,yt,Dt,Ft,we,qt,gt,$t,vt,Mt,Ae,$e,_t,Ut;const Ze=F.strict,Lt=($=F.code)===null||$===void 0?void 0:$.optimize,ir=Lt===!0||Lt===void 0?1:Lt||0,Pe=(w=(I=F.code)===null||I===void 0?void 0:I.regExp)!==null&&w!==void 0?w:k,et=(a=F.uriResolver)!==null&&a!==void 0?a:C.default;return{strictSchema:(N=(h=F.strictSchema)!==null&&h!==void 0?h:Ze)!==null&&N!==void 0?N:!0,strictNumbers:(M=(q=F.strictNumbers)!==null&&q!==void 0?q:Ze)!==null&&M!==void 0?M:!0,strictTypes:(Y=(G=F.strictTypes)!==null&&G!==void 0?G:Ze)!==null&&Y!==void 0?Y:"log",strictTuples:(Ie=(ae=F.strictTuples)!==null&&ae!==void 0?ae:Ze)!==null&&Ie!==void 0?Ie:"log",strictRequired:(Dt=(yt=F.strictRequired)!==null&&yt!==void 0?yt:Ze)!==null&&Dt!==void 0?Dt:!1,code:F.code?{...F.code,optimize:ir,regExp:Pe}:{optimize:ir,regExp:Pe},loopRequired:(Ft=F.loopRequired)!==null&&Ft!==void 0?Ft:T,loopEnum:(we=F.loopEnum)!==null&&we!==void 0?we:T,meta:(qt=F.meta)!==null&&qt!==void 0?qt:!0,messages:(gt=F.messages)!==null&>!==void 0?gt:!0,inlineRefs:($t=F.inlineRefs)!==null&&$t!==void 0?$t:!0,schemaId:(vt=F.schemaId)!==null&&vt!==void 0?vt:"$id",addUsedSchema:(Mt=F.addUsedSchema)!==null&&Mt!==void 0?Mt:!0,validateSchema:(Ae=F.validateSchema)!==null&&Ae!==void 0?Ae:!0,validateFormats:($e=F.validateFormats)!==null&&$e!==void 0?$e:!0,unicodeRegExp:(_t=F.unicodeRegExp)!==null&&_t!==void 0?_t:!0,int32range:(Ut=F.int32range)!==null&&Ut!==void 0?Ut:!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=Q($.logger);const a=$.validateFormats;$.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,v,$,"NOT SUPPORTED"),D.call(this,y,$,"DEPRECATED","warn"),this._metaOpts=B.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=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:$,meta:I,schemaId:w}=this.opts;let a=g;w==="id"&&(a={...g},a.id=a.$id,delete a.$id),I&&$&&this.addMetaSchema(a,a[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 a=w(I);return"$async"in w||(this.errors=w.errors),a}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 a.call(this,$,I);async function a(Y,ae){await h.call(this,Y.$schema);const Ie=this._addSchema(Y,ae);return Ie.validate||N.call(this,Ie)}async function h(Y){Y&&!this.getSchema(Y)&&await a.call(this,{$ref:Y},!0)}async function N(Y){try{return this._compileSchemaEnv(Y)}catch(ae){if(!(ae instanceof s.default))throw ae;return q.call(this,ae),await M.call(this,ae.missingSchema),N.call(this,Y)}}function q({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 G.call(this,Y);this.refs[Y]||await h.call(this,ae.$schema),this.refs[Y]||this.addSchema(ae,Y,I)}async function G(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,a=this.opts.validateSchema){if(Array.isArray($)){for(const N of $)this.addSchema(N,void 0,w,a);return this}let h;if(typeof $=="object"){const{schemaId:N}=this.opts;if(h=$[N],h!==void 0&&typeof h!="string")throw new Error(`schema ${N} must be string`)}return I=(0,p.normalizeId)(I||h),this._checkUnique(I),this.schemas[I]=this._addSchema($,w,I,a,!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 a=this.validate(w,$);if(!a&&I){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return a}getSchema($){let I;for(;typeof(I=_.call(this,$))=="string";)$=I;if(I===void 0){const{schemaId:w}=this.opts,a=new o.SchemaEnv({schema:{},schemaId:w});if(I=o.resolveSchema.call(this,a,$),!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,p.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,d.eachItem)(w,h=>Qe.call(this,h)),this;ht.call(this,I);const a={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,d.eachItem)(w,a.type.length===0?h=>Qe.call(this,h,a):h=>a.type.forEach(N=>Qe.call(this,h,a,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 a=w.rules.findIndex(h=>h.keyword===$);a>=0&&w.rules.splice(a,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(a=>`${w}${a.instancePath} ${a.message}`).reduce((a,h)=>a+I+h)}$dataMetaSchema($,I){const w=this.RULES.all;$=JSON.parse(JSON.stringify($));for(const a of I){const h=a.split("/").slice(1);let N=$;for(const q of h)N=N[q];for(const q in w){const M=w[q];if(typeof M!="object")continue;const{$data:G}=M.definition,Y=N[q];G&&Y&&(N[q]=mt(Y))}}return $}_removeAllSchemas($,I){for(const w in $){const a=$[w];(!I||I.test(w))&&(typeof a=="string"?delete $[w]:a&&!a.meta&&(this._cache.delete(a.schema),delete $[w]))}}_addSchema($,I,w,a=this.opts.validateSchema,h=this.opts.addUsedSchema){let N;const{schemaId:q}=this.opts;if(typeof $=="object")N=$[q];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,p.normalizeId)(N||w);const G=p.getSchemaRefs.call(this,$,w);return M=new o.SchemaEnv({schema:$,schemaId:q,meta:I,baseId:w,localRefs:G}),this._cache.set(M.schema,M),h&&!w.startsWith("#")&&(w&&this._checkUnique(w),this.refs[w]=M),a&&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($):o.compileSchema.call(this,$),!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){const I=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,$)}finally{this.opts=I}}}e.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function D(F,$,I,w="error"){for(const a in F){const h=a;h in $&&this.logger[w](`${I}: option ${a}. ${F[h]}`)}}function _(F){return F=(0,p.normalizeId)(F),this.schemas[F]||this.refs[F]}function O(){const F=this.opts.schemas;if(F)if(Array.isArray(F))this.addSchema(F);else for(const $ in F)this.addSchema(F[$],$)}function A(){for(const F in this.opts.formats){const $=this.opts.formats[F];$&&this.addFormat(F,$)}}function z(F){if(Array.isArray(F)){this.addVocabulary(F);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const $ in F){const I=F[$];I.keyword||(I.keyword=$),this.addKeyword(I)}}function B(){const F={...this.opts};for(const $ of E)delete F[$];return F}const oe={log(){},warn(){},error(){}};function Q(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,$){const{RULES:I}=this;if((0,d.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`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw new Error('$data keyword must have "code" or "validate" function')}function Qe(F,$,I){var w;const a=$?.post;if(I&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let N=a?h.post:h.rules.find(({type:M})=>M===I);if(N||(N={type:I,rules:[]},h.rules.push(N)),h.keywords[F]=!0,!$)return;const q={keyword:F,definition:{...$,type:(0,u.getJSONTypes)($.type),schemaType:(0,u.getJSONTypes)($.schemaType)}};$.before?Xe.call(this,N,q,$.before):N.rules.push(q),h.all[F]=q,(w=$.implements)===null||w===void 0||w.forEach(M=>this.addKeyword(M))}function Xe(F,$,I){const w=F.rules.findIndex(a=>a.keyword===I);w>=0?F.rules.splice(w,0,$):(F.rules.push($),this.logger.warn(`rule ${I} is not defined`))}function ht(F){let{metaSchema:$}=F;$!==void 0&&(F.$data&&this.opts.$data&&($=mt($)),F.validateSchema=this.compile($,!0))}const At={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function mt(F){return{anyOf:[F,At]}}})(wi);var gn={},$n={},vn={};Object.defineProperty(vn,"__esModule",{value:!0});const sl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};vn.default=sl;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.callRef=ft.getValidate=void 0;const il=nr,Os=x,ve=K,St=He,Ns=_e,lr=Z,ol={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:l,self:p}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return g();const d=Ns.resolveRef.call(p,u,s,r);if(d===void 0)throw new il.default(n.opts.uriResolver,s,r);if(d instanceof Ns.SchemaEnv)return C(d);return k(d);function g(){if(i===u)return gr(e,o,i,i.$async);const E=t.scopeValue("root",{ref:u});return gr(e,(0,ve._)`${E}.validate`,u,u.$async)}function C(E){const S=Bi(e,E);gr(e,S,E,E.$async)}function k(E){const S=t.scopeValue("schema",l.code.source===!0?{ref:E,code:(0,ve.stringify)(E)}:{ref:E}),v=t.name("valid"),y=e.subschema({schema:E,dataTypes:[],schemaPath:ve.nil,topSchemaRef:S,errSchemaPath:r},v);e.mergeEvaluated(y),e.ok(v)}}};function Bi(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ve._)`${r.scopeValue("wrapper",{ref:t})}.validate`}ft.getValidate=Bi;function gr(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:l,opts:p}=i,u=p.passContext?St.default.this:ve.nil;n?d():g();function d(){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,Os.callValidateCode)(e,t,u)}`),k(t),o||s.assign(E,!0)},S=>{s.if((0,ve._)`!(${S} instanceof ${i.ValidationError})`,()=>s.throw(S)),C(S),o||s.assign(E,!1)}),e.ok(E)}function g(){e.result((0,Os.callValidateCode)(e,t,u),()=>k(t),()=>C(t))}function C(E){const S=(0,ve._)`${E}.errors`;s.assign(St.default.vErrors,(0,ve._)`${St.default.vErrors} === null ? ${S} : ${St.default.vErrors}.concat(${S})`),s.assign(St.default.errors,(0,ve._)`${St.default.vErrors}.length`)}function k(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=lr.mergeEvaluated.props(s,v.props,i.props));else{const y=s.var("props",(0,ve._)`${E}.evaluated.props`);i.props=lr.mergeEvaluated.props(s,y,i.props,ve.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=lr.mergeEvaluated.items(s,v.items,i.items));else{const y=s.var("items",(0,ve._)`${E}.evaluated.items`);i.items=lr.mergeEvaluated.items(s,y,i.items,ve.Name)}}}ft.callRef=gr;ft.default=ol;Object.defineProperty($n,"__esModule",{value:!0});const al=vn,cl=ft,ll=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",al.default,cl.default];$n.default=ll;var _n={},wn={};Object.defineProperty(wn,"__esModule",{value:!0});const Pr=K,Ge=Pr.operators,Er={maximum:{okStr:"<=",ok:Ge.LTE,fail:Ge.GT},minimum:{okStr:">=",ok:Ge.GTE,fail:Ge.LT},exclusiveMaximum:{okStr:"<",ok:Ge.LT,fail:Ge.GTE},exclusiveMinimum:{okStr:">",ok:Ge.GT,fail:Ge.LTE}},ul={message:({keyword:e,schemaCode:t})=>(0,Pr.str)`must be ${Er[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Pr._)`{comparison: ${Er[e].okStr}, limit: ${t}}`},dl={keyword:Object.keys(Er),type:"number",schemaType:"number",$data:!0,error:ul,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Pr._)`${r} ${Er[t].fail} ${n} || isNaN(${r})`)}};wn.default=dl;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const Gt=K,fl={message:({schemaCode:e})=>(0,Gt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Gt._)`{multipleOf: ${e}}`},pl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:fl,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),l=i?(0,Gt._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Gt._)`${o} !== parseInt(${o})`;e.fail$data((0,Gt._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};bn.default=pl;var Pn={},En={};Object.defineProperty(En,"__esModule",{value:!0});function Gi(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}En.default=Gi;Gi.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Pn,"__esModule",{value:!0});const it=K,hl=Z,ml=En,yl={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,it.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,it._)`{limit: ${e}}`},gl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:yl,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?it.operators.GT:it.operators.LT,o=s.opts.unicode===!1?(0,it._)`${r}.length`:(0,it._)`${(0,hl.useFunc)(e.gen,ml.default)}(${r})`;e.fail$data((0,it._)`${o} ${i} ${n}`)}};Pn.default=gl;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});const $l=x,Sr=K,vl={message:({schemaCode:e})=>(0,Sr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Sr._)`{pattern: ${e}}`},_l={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:vl,code(e){const{data:t,$data:r,schema:n,schemaCode:s,it:i}=e,o=i.opts.unicodeRegExp?"u":"",l=r?(0,Sr._)`(new RegExp(${s}, ${o}))`:(0,$l.usePattern)(e,n);e.fail$data((0,Sr._)`!${l}.test(${t})`)}};Sn.default=_l;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});const Jt=K,wl={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Jt.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Jt._)`{limit: ${e}}`},bl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:wl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Jt.operators.GT:Jt.operators.LT;e.fail$data((0,Jt._)`Object.keys(${r}).length ${s} ${n}`)}};Tn.default=bl;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});const xt=x,Yt=K,Pl=Z,El={message:({params:{missingProperty:e}})=>(0,Yt.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Yt._)`{missingProperty: ${e}}`},Sl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:El,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:l}=o;if(!i&&r.length===0)return;const p=r.length>=l.loopRequired;if(o.allErrors?u():d(),l.strictRequired){const k=e.parentSchema.properties,{definedProperties:E}=e.it;for(const S of r)if(k?.[S]===void 0&&!E.has(S)){const v=o.schemaEnv.baseId+o.errSchemaPath,y=`required property "${S}" is not defined at "${v}" (strictRequired)`;(0,Pl.checkStrictMode)(o,y,o.opts.strictRequired)}}function u(){if(p||i)e.block$data(Yt.nil,g);else for(const k of r)(0,xt.checkReportMissingProp)(e,k)}function d(){const k=t.let("missing");if(p||i){const E=t.let("valid",!0);e.block$data(E,()=>C(k,E)),e.ok(E)}else t.if((0,xt.checkMissingProp)(e,r,k)),(0,xt.reportMissingProp)(e,k),t.else()}function g(){t.forOf("prop",n,k=>{e.setParams({missingProperty:k}),t.if((0,xt.noPropertyInData)(t,s,k,l.ownProperties),()=>e.error())})}function C(k,E){e.setParams({missingProperty:k}),t.forOf(k,n,()=>{t.assign(E,(0,xt.propertyInData)(t,s,k,l.ownProperties)),t.if((0,Yt.not)(E),()=>{e.error(),t.break()})},Yt.nil)}}};Rn.default=Sl;var On={};Object.defineProperty(On,"__esModule",{value:!0});const Qt=K,Tl={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Qt.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Qt._)`{limit: ${e}}`},Rl={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Qt.operators.GT:Qt.operators.LT;e.fail$data((0,Qt._)`${r}.length ${s} ${n}`)}};On.default=Rl;var Nn={},sr={};Object.defineProperty(sr,"__esModule",{value:!0});const Ji=Ni;Ji.code='require("ajv/dist/runtime/equal").default';sr.default=Ji;Object.defineProperty(Nn,"__esModule",{value:!0});const Wr=tr,pe=K,Ol=Z,Nl=sr,Cl={message:({params:{i:e,j:t}})=>(0,pe.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,pe._)`{i: ${e}, j: ${t}}`},kl={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Cl,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:l}=e;if(!n&&!s)return;const p=t.let("valid"),u=i.items?(0,Wr.getSchemaTypes)(i.items):[];e.block$data(p,d,(0,pe._)`${o} === false`),e.ok(p);function d(){const E=t.let("i",(0,pe._)`${r}.length`),S=t.let("j");e.setParams({i:E,j:S}),t.assign(p,!0),t.if((0,pe._)`${E} > 1`,()=>(g()?C:k)(E,S))}function g(){return u.length>0&&!u.some(E=>E==="object"||E==="array")}function C(E,S){const v=t.name("item"),y=(0,Wr.checkDataTypes)(u,v,l.opts.strictNumbers,Wr.DataType.Wrong),T=t.const("indices",(0,pe._)`{}`);t.for((0,pe._)`;${E}--;`,()=>{t.let(v,(0,pe._)`${r}[${E}]`),t.if(y,(0,pe._)`continue`),u.length>1&&t.if((0,pe._)`typeof ${v} == "string"`,(0,pe._)`${v} += "_"`),t.if((0,pe._)`typeof ${T}[${v}] == "number"`,()=>{t.assign(S,(0,pe._)`${T}[${v}]`),e.error(),t.assign(p,!1).break()}).code((0,pe._)`${T}[${v}] = ${E}`)})}function k(E,S){const v=(0,Ol.useFunc)(t,Nl.default),y=t.name("outer");t.label(y).for((0,pe._)`;${E}--;`,()=>t.for((0,pe._)`${S} = ${E}; ${S}--;`,()=>t.if((0,pe._)`${v}(${r}[${E}], ${r}[${S}])`,()=>{e.error(),t.assign(p,!1).break(y)})))}}};Nn.default=kl;var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});const Xr=K,jl=Z,Il=sr,Al={message:"must be equal to constant",params:({schemaCode:e})=>(0,Xr._)`{allowedValue: ${e}}`},Dl={keyword:"const",$data:!0,error:Al,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,Xr._)`!${(0,jl.useFunc)(t,Il.default)}(${r}, ${s})`):e.fail((0,Xr._)`${i} !== ${r}`)}};Cn.default=Dl;var kn={};Object.defineProperty(kn,"__esModule",{value:!0});const Kt=K,Fl=Z,ql=sr,Ml={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Kt._)`{allowedValues: ${e}}`},Ul={keyword:"enum",schemaType:"array",$data:!0,error:Ml,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const l=s.length>=o.opts.loopEnum;let p;const u=()=>p??(p=(0,Fl.useFunc)(t,ql.default));let d;if(l||n)d=t.let("valid"),e.block$data(d,g);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const k=t.const("vSchema",i);d=(0,Kt.or)(...s.map((E,S)=>C(k,S)))}e.pass(d);function g(){t.assign(d,!1),t.forOf("v",i,k=>t.if((0,Kt._)`${u()}(${r}, ${k})`,()=>t.assign(d,!0).break()))}function C(k,E){const S=s[E];return typeof S=="object"&&S!==null?(0,Kt._)`${u()}(${r}, ${k}[${E}])`:(0,Kt._)`${r} === ${S}`}}};kn.default=Ul;Object.defineProperty(_n,"__esModule",{value:!0});const Ll=wn,Hl=bn,Vl=Pn,zl=Sn,Wl=Tn,xl=Rn,Kl=On,Bl=Nn,Gl=Cn,Jl=kn,Yl=[Ll.default,Hl.default,Vl.default,zl.default,Wl.default,xl.default,Kl.default,Bl.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Gl.default,Jl.default];_n.default=Yl;var jn={},jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.validateAdditionalItems=void 0;const ot=K,Zr=Z,Ql={message:({params:{len:e}})=>(0,ot.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ot._)`{limit: ${e}}`},Xl={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ql,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Zr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Yi(e,n)}};function Yi(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const l=r.const("len",(0,ot._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ot._)`${l} <= ${t.length}`);else if(typeof n=="object"&&!(0,Zr.alwaysValidSchema)(o,n)){const u=r.var("valid",(0,ot._)`${l} <= ${t.length}`);r.if((0,ot.not)(u),()=>p(u)),e.ok(u)}function p(u){r.forRange("i",t.length,l,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:Zr.Type.Num},u),o.allErrors||r.if((0,ot.not)(u),()=>r.break())})}}jt.validateAdditionalItems=Yi;jt.default=Xl;var In={},It={};Object.defineProperty(It,"__esModule",{value:!0});It.validateTuple=void 0;const Cs=K,$r=Z,Zl=x,eu={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Qi(e,"additionalItems",t);r.items=!0,!(0,$r.alwaysValidSchema)(r,t)&&e.ok((0,Zl.validateArray)(e))}};function Qi(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:l}=e;d(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=$r.mergeEvaluated.items(n,r.length,l.items));const p=n.name("valid"),u=n.const("len",(0,Cs._)`${i}.length`);r.forEach((g,C)=>{(0,$r.alwaysValidSchema)(l,g)||(n.if((0,Cs._)`${u} > ${C}`,()=>e.subschema({keyword:o,schemaProp:C,dataProp:C},p)),e.ok(p))});function d(g){const{opts:C,errSchemaPath:k}=l,E=r.length,S=E===g.minItems&&(E===g.maxItems||g[t]===!1);if(C.strictTuples&&!S){const v=`"${o}" is ${E}-tuple, but minItems or maxItems/${t} are not specified or different at path "${k}"`;(0,$r.checkStrictMode)(l,v,C.strictTuples)}}}It.validateTuple=Qi;It.default=eu;Object.defineProperty(In,"__esModule",{value:!0});const tu=It,ru={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,tu.validateTuple)(e,"items")};In.default=ru;var An={};Object.defineProperty(An,"__esModule",{value:!0});const ks=K,nu=Z,su=x,iu=jt,ou={message:({params:{len:e}})=>(0,ks.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ks._)`{limit: ${e}}`},au={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ou,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,nu.alwaysValidSchema)(n,t)&&(s?(0,iu.validateAdditionalItems)(e,s):e.ok((0,su.validateArray)(e)))}};An.default=au;var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});const Se=K,ur=Z,cu={message:({params:{min:e,max:t}})=>t===void 0?(0,Se.str)`must contain at least ${e} valid item(s)`:(0,Se.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Se._)`{minContains: ${e}}`:(0,Se._)`{minContains: ${e}, maxContains: ${t}}`},lu={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:cu,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,l;const{minContains:p,maxContains:u}=n;i.opts.next?(o=p===void 0?1:p,l=u):o=1;const d=t.const("len",(0,Se._)`${s}.length`);if(e.setParams({min:o,max:l}),l===void 0&&o===0){(0,ur.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,ur.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ur.alwaysValidSchema)(i,r)){let S=(0,Se._)`${d} >= ${o}`;l!==void 0&&(S=(0,Se._)`${S} && ${d} <= ${l}`),e.pass(S);return}i.items=!0;const g=t.name("valid");l===void 0&&o===1?k(g,()=>t.if(g,()=>t.break())):o===0?(t.let(g,!0),l!==void 0&&t.if((0,Se._)`${s}.length > 0`,C)):(t.let(g,!1),C()),e.result(g,()=>e.reset());function C(){const S=t.name("_valid"),v=t.let("count",0);k(S,()=>t.if(S,()=>E(v)))}function k(S,v){t.forRange("i",0,d,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:ur.Type.Num,compositeRule:!0},S),v()})}function E(S){t.code((0,Se._)`${S}++`),l===void 0?t.if((0,Se._)`${S} >= ${o}`,()=>t.assign(g,!0).break()):(t.if((0,Se._)`${S} > ${l}`,()=>t.assign(g,!1).break()),o===1?t.assign(g,!0):t.if((0,Se._)`${S} >= ${o}`,()=>t.assign(g,!0)))}}};Dn.default=lu;var Xi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=K,r=Z,n=x;e.error={message:({params:{property:p,depsCount:u,deps:d}})=>{const g=u===1?"property":"properties";return(0,t.str)`must have ${g} ${d} when property ${p} is present`},params:({params:{property:p,depsCount:u,deps:d,missingProperty:g}})=>(0,t._)`{property: ${p},
|
|
481
|
+
|| ${z} === "boolean" || ${O} === null`).assign(B,(0,s._)`[${O}]`)}}}function k({gen:R,parentData:j,parentDataProperty:D},_){R.if((0,s._)`${j} !== undefined`,()=>R.assign((0,s._)`${j}[${D}]`,_))}function E(R,j,D,_=o.Correct){const O=_===o.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 _===o.Correct?A:(0,s.not)(A);function z(B=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,B,D?(0,s._)`isFinite(${j})`:s.nil)}}e.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}e.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)}e.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}}})(tr);var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.assignDefaults=void 0;const Et=x,Aa=Z;function Da(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)_s(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,i)=>_s(e,i,s.default))}Dr.assignDefaults=Da;function _s(e,t,r){const{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;const l=(0,Et._)`${i}${(0,Et.getProperty)(t)}`;if(s){(0,Aa.checkStrictMode)(e,`default is ignored for: ${l}`);return}let p=(0,Et._)`${l} === undefined`;o.useDefaults==="empty"&&(p=(0,Et._)`${p} || ${l} === null || ${l} === ""`),n.if(p,(0,Et._)`${l} = ${(0,Et.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=x,ln=Z,Be=He,Fa=Z;function qa(e,t){const{gen:r,data:n,it:s}=e;r.if(dn(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ne._)`${t}`},!0),e.error()})}K.checkReportMissingProp=qa;function Ma({gen:e,data:t,it:{opts:r}},n,s){return(0,ne.or)(...n.map(i=>(0,ne.and)(dn(e,t,i,r.ownProperties),(0,ne._)`${s} = ${i}`)))}K.checkMissingProp=Ma;function Ua(e,t){e.setParams({missingProperty:t},!0),e.error()}K.reportMissingProp=Ua;function Ei(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ne._)`Object.prototype.hasOwnProperty`})}K.hasPropFunc=Ei;function un(e,t,r){return(0,ne._)`${Ei(e)}.call(${t}, ${r})`}K.isOwnProperty=un;function La(e,t,r,n){const s=(0,ne._)`${t}${(0,ne.getProperty)(r)} !== undefined`;return n?(0,ne._)`${s} && ${un(e,t,r)}`:s}K.propertyInData=La;function dn(e,t,r,n){const s=(0,ne._)`${t}${(0,ne.getProperty)(r)} === undefined`;return n?(0,ne.or)(s,(0,ne.not)(un(e,t,r))):s}K.noPropertyInData=dn;function Si(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}K.allSchemaProperties=Si;function Ha(e,t){return Si(t).filter(r=>!(0,ln.alwaysValidSchema)(e,t[r]))}K.schemaProperties=Ha;function Va({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},l,p,u){const d=u?(0,ne._)`${e}, ${t}, ${n}${s}`:t,g=[[Be.default.instancePath,(0,ne.strConcat)(Be.default.instancePath,i)],[Be.default.parentData,o.parentData],[Be.default.parentDataProperty,o.parentDataProperty],[Be.default.rootData,Be.default.rootData]];o.opts.dynamicRef&&g.push([Be.default.dynamicAnchors,Be.default.dynamicAnchors]);const C=(0,ne._)`${d}, ${r.object(...g)}`;return p!==ne.nil?(0,ne._)`${l}.call(${p}, ${C})`:(0,ne._)`${l}(${C})`}K.callValidateCode=Va;const za=(0,ne._)`new RegExp`;function Wa({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,i=s(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ne._)`${s.code==="new RegExp"?za:(0,Fa.useFunc)(e,s)}(${r}, ${n})`})}K.usePattern=Wa;function Ka(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const l=t.let("valid",!0);return o(()=>t.assign(l,!1)),l}return t.var(i,!0),o(()=>t.break()),i;function o(l){const p=t.const("len",(0,ne._)`${r}.length`);t.forRange("i",0,p,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:ln.Type.Num},i),t.if((0,ne.not)(i),l)})}}K.validateArray=Ka;function xa(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,ln.alwaysValidSchema)(s,p))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((p,u)=>{const d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);t.assign(o,(0,ne._)`${o} || ${l}`),e.mergeValidEvaluated(d,l)||t.if((0,ne.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}K.validateUnion=xa;Object.defineProperty(Le,"__esModule",{value:!0});Le.validateKeywordUsage=Le.validSchemaType=Le.funcKeywordCode=Le.macroKeywordCode=void 0;const ge=x,st=He,Ba=K,Ga=er;function Ja(e,t){const{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,l=t.macro.call(o.self,s,i,o),p=Ti(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);const u=r.name("valid");e.subschema({schema:l,schemaPath:ge.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:p,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Le.macroKeywordCode=Ja;function Ya(e,t){var r;const{gen:n,keyword:s,schema:i,parentSchema:o,$data:l,it:p}=e;Xa(p,t);const u=!l&&t.compile?t.compile.call(p.self,i,o,p):t.validate,d=Ti(n,s,u),g=n.let("valid");e.block$data(g,C),e.ok((r=t.valid)!==null&&r!==void 0?r:g);function C(){if(t.errors===!1)S(),t.modifying&&ws(e),v(()=>e.error());else{const y=t.async?k():E();t.modifying&&ws(e),v(()=>Qa(e,y))}}function k(){const y=n.let("ruleErrs",null);return n.try(()=>S((0,ge._)`await `),T=>n.assign(g,!1).if((0,ge._)`${T} instanceof ${p.ValidationError}`,()=>n.assign(y,(0,ge._)`${T}.errors`),()=>n.throw(T))),y}function E(){const y=(0,ge._)`${d}.errors`;return n.assign(y,null),S(ge.nil),y}function S(y=t.async?(0,ge._)`await `:ge.nil){const T=p.opts.passContext?st.default.this:st.default.self,R=!("compile"in t&&!l||t.schema===!1);n.assign(g,(0,ge._)`${y}${(0,Ba.callValidateCode)(e,d,T,R)}`,t.modifying)}function v(y){var T;n.if((0,ge.not)((T=t.valid)!==null&&T!==void 0?T:g),y)}}Le.funcKeywordCode=Ya;function ws(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,ge._)`${n.parentData}[${n.parentDataProperty}]`))}function Qa(e,t){const{gen:r}=e;r.if((0,ge._)`Array.isArray(${t})`,()=>{r.assign(st.default.vErrors,(0,ge._)`${st.default.vErrors} === null ? ${t} : ${st.default.vErrors}.concat(${t})`).assign(st.default.errors,(0,ge._)`${st.default.vErrors}.length`),(0,Ga.extendErrors)(e)},()=>e.error())}function Xa({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Ti(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ge.stringify)(r)})}function Za(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Le.validSchemaType=Za;function ec({schema:e,opts:t,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 o=s.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(e,l)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){const p=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}Le.validateKeywordUsage=ec;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.extendSubschemaMode=Ye.extendSubschemaData=Ye.getSubschema=void 0;const Ue=x,Ri=Z;function tc(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const l=e.schema[t];return r===void 0?{schema:l,schemaPath:(0,Ue._)`${e.schemaPath}${(0,Ue.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:l[r],schemaPath:(0,Ue._)`${e.schemaPath}${(0,Ue.getProperty)(t)}${(0,Ue.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Ri.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ye.getSubschema=tc;function rc(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(r!==void 0){const{errorPath:u,dataPathArr:d,opts:g}=t,C=l.let("data",(0,Ue._)`${t.data}${(0,Ue.getProperty)(r)}`,!0);p(C),e.errorPath=(0,Ue.str)`${u}${(0,Ri.getErrorPath)(r,n,g.jsPropertySyntax)}`,e.parentDataProperty=(0,Ue._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const u=s instanceof Ue.Name?s:l.let("data",s,!0);p(u),o!==void 0&&(e.propertyName=o)}i&&(e.dataTypes=i);function p(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Ye.extendSubschemaData=rc;function nc(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ye.extendSubschemaMode=nc;var he={},Oi=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),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 o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r},Ni={exports:{}},Je=Ni.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};yr(t,n,s,e,"",e)};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 yr(e,t,r,n,s,i,o,l,p,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,l,p,u);for(var d in n){var g=n[d];if(Array.isArray(g)){if(d in Je.arrayKeywords)for(var C=0;C<g.length;C++)yr(e,t,r,g[C],s+"/"+d+"/"+C,i,s,d,n,C)}else if(d in Je.propsKeywords){if(g&&typeof g=="object")for(var k in g)yr(e,t,r,g[k],s+"/"+d+"/"+sc(k),i,s,d,n,k)}else(d in Je.keywords||e.allKeys&&!(d in Je.skipKeywords))&&yr(e,t,r,g,s+"/"+d,i,s,d,n)}r(n,s,i,o,l,p,u)}}function sc(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var ic=Ni.exports;Object.defineProperty(he,"__esModule",{value:!0});he.getSchemaRefs=he.resolveUrl=he.normalizeId=he._getFullPath=he.getFullPath=he.inlineRef=void 0;const oc=Z,ac=Oi,cc=ic,lc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function uc(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Yr(e):t?Ci(e)<=t:!1}he.inlineRef=uc;const dc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Yr(e){for(const t in e){if(dc.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Yr)||typeof r=="object"&&Yr(r))return!0}return!1}function Ci(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!lc.has(r)&&(typeof e[r]=="object"&&(0,oc.eachItem)(e[r],n=>t+=Ci(n)),t===1/0))return 1/0}return t}function ki(e,t="",r){r!==!1&&(t=Nt(t));const n=e.parse(t);return ji(e,n)}he.getFullPath=ki;function ji(e,t){return e.serialize(t).split("#")[0]+"#"}he._getFullPath=ji;const fc=/#\/?$/;function Nt(e){return e?e.replace(fc,""):""}he.normalizeId=Nt;function pc(e,t,r){return r=Nt(r),e.resolve(t,r)}he.resolveUrl=pc;const hc=/^[a-z_][-a-z0-9._]*$/i;function mc(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Nt(e[r]||t),i={"":s},o=ki(n,s,!1),l={},p=new Set;return cc(e,{allKeys:!0},(g,C,k,E)=>{if(E===void 0)return;const S=o+C;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[C]=v;function y(R){const j=this.opts.uriResolver.resolve;if(R=Nt(v?j(v,R):R),p.has(R))throw d(R);p.add(R);let D=this.refs[R];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?u(g,D.schema,R):R!==Nt(S)&&(R[0]==="#"?(u(g,l[R],R),l[R]=g):this.refs[R]=S),R}function T(R){if(typeof R=="string"){if(!hc.test(R))throw new Error(`invalid anchor "${R}"`);y.call(this,`#${R}`)}}}),l;function u(g,C,k){if(C!==void 0&&!ac(g,C))throw d(k)}function d(g){return new Error(`reference "${g}" resolves to more than one schema`)}}he.getSchemaRefs=mc;Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getData=Ne.KeywordCxt=Ne.validateFunctionCode=void 0;const Ii=Ct,bs=tr,fn=ze,br=tr,yc=Dr,Bt=Le,Hr=Ye,U=x,V=He,gc=he,We=Z,Wt=er;function $c(e){if(Fi(e)&&(qi(e),Di(e))){wc(e);return}Ai(e,()=>(0,Ii.topBoolOrEmptySchema)(e))}Ne.validateFunctionCode=$c;function Ai({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){s.code.es5?e.func(t,(0,U._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{e.code((0,U._)`"use strict"; ${Ps(r,s)}`),_c(e,s),e.code(i)}):e.func(t,(0,U._)`${V.default.data}, ${vc(s)}`,n.$async,()=>e.code(Ps(r,s)).code(i))}function vc(e){return(0,U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${e.dynamicRef?(0,U._)`, ${V.default.dynamicAnchors}={}`:U.nil}}={}`}function _c(e,t){e.if(V.default.valCxt,()=>{e.var(V.default.instancePath,(0,U._)`${V.default.valCxt}.${V.default.instancePath}`),e.var(V.default.parentData,(0,U._)`${V.default.valCxt}.${V.default.parentData}`),e.var(V.default.parentDataProperty,(0,U._)`${V.default.valCxt}.${V.default.parentDataProperty}`),e.var(V.default.rootData,(0,U._)`${V.default.valCxt}.${V.default.rootData}`),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{e.var(V.default.instancePath,(0,U._)`""`),e.var(V.default.parentData,(0,U._)`undefined`),e.var(V.default.parentDataProperty,(0,U._)`undefined`),e.var(V.default.rootData,V.default.data),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`{}`)})}function wc(e){const{schema:t,opts:r,gen:n}=e;Ai(e,()=>{r.$comment&&t.$comment&&Ui(e),Tc(e),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&bc(e),Mi(e),Nc(e)})}function bc(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,U._)`${r}.evaluated`),t.if((0,U._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,U._)`${e.evaluated}.props`,(0,U._)`undefined`)),t.if((0,U._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,U._)`${e.evaluated}.items`,(0,U._)`undefined`))}function Ps(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function Pc(e,t){if(Fi(e)&&(qi(e),Di(e))){Ec(e,t);return}(0,Ii.boolOrEmptySchema)(e,t)}function Di({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function Fi(e){return typeof e.schema!="boolean"}function Ec(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&Ui(e),Rc(e),Oc(e);const i=n.const("_errs",V.default.errors);Mi(e,i),n.var(t,(0,U._)`${i} === ${V.default.errors}`)}function qi(e){(0,We.checkUnknownRules)(e),Sc(e)}function Mi(e,t){if(e.opts.jtd)return Es(e,[],!1,t);const r=(0,bs.getSchemaTypes)(e.schema),n=(0,bs.coerceAndCheckDataType)(e,r);Es(e,r,!n,t)}function Sc(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,We.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Tc(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,We.checkStrictMode)(e,"default is ignored in the schema root")}function Rc(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,gc.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Oc(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Ui({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)e.code((0,U._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const o=(0,U.str)`${n}/$comment`,l=e.scopeValue("root",{ref:t.root});e.code((0,U._)`${V.default.self}.opts.$comment(${i}, ${o}, ${l}.schema)`)}}function Nc(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;r.$async?t.if((0,U._)`${V.default.errors} === 0`,()=>t.return(V.default.data),()=>t.throw((0,U._)`new ${s}(${V.default.vErrors})`)):(t.assign((0,U._)`${n}.errors`,V.default.vErrors),i.unevaluated&&Cc(e),t.return((0,U._)`${V.default.errors} === 0`))}function Cc({gen:e,evaluated:t,props:r,items:n}){r instanceof U.Name&&e.assign((0,U._)`${t}.props`,r),n instanceof U.Name&&e.assign((0,U._)`${t}.items`,n)}function Es(e,t,r,n){const{gen:s,schema:i,data:o,allErrors:l,opts:p,self:u}=e,{RULES:d}=u;if(i.$ref&&(p.ignoreKeywordsWithRef||!(0,We.schemaHasRulesButRef)(i,d))){s.block(()=>Vi(e,"$ref",d.all.$ref.definition));return}p.jtd||kc(e,t),s.block(()=>{for(const C of d.rules)g(C);g(d.post)});function g(C){(0,fn.shouldUseGroup)(i,C)&&(C.type?(s.if((0,br.checkDataType)(C.type,o,p.strictNumbers)),Ss(e,C),t.length===1&&t[0]===C.type&&r&&(s.else(),(0,br.reportTypeError)(e)),s.endIf()):Ss(e,C),l||s.if((0,U._)`${V.default.errors} === ${n||0}`))}}function Ss(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,yc.assignDefaults)(e,t.type),r.block(()=>{for(const i of t.rules)(0,fn.shouldUseRule)(n,i)&&Vi(e,i.keyword,i.definition,t.type)})}function kc(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(jc(e,t),e.opts.allowUnionTypes||Ic(e,t),Ac(e,e.dataTypes))}function jc(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Li(e.dataTypes,r)||pn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Fc(e,t)}}function Ic(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&pn(e,"use allowUnionTypes to allow union type keyword")}function Ac(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,fn.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(o=>Dc(t,o))&&pn(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Dc(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Li(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Fc(e,t){const r=[];for(const n of e.dataTypes)Li(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function pn(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,We.checkStrictMode)(e,t,e.opts.strictTypes)}class Hi{constructor(t,r,n){if((0,Bt.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,We.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",zi(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Bt.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=t.gen.const("_errs",V.default.errors))}result(t,r,n){this.failResult((0,U.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,U.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,U._)`${r} !== undefined && (${(0,U.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Wt.reportExtraError:Wt.reportError)(this,this.def.error,r)}$dataError(){(0,Wt.reportError)(this,this.def.$dataError||Wt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Wt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=U.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),t!==U.nil&&n.assign(t,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==U.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,U.or)(o(),l());function o(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const p=Array.isArray(n)?n:[n];return(0,U._)`${(0,br.checkDataTypes)(p,r,i.opts.strictNumbers,br.DataType.Wrong)}`}return U.nil}function l(){if(s.validateSchema){const p=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${p}(${r})`}return U.nil}}subschema(t,r){const n=(0,Hr.getSubschema)(this.it,t);(0,Hr.extendSubschemaData)(n,this.it,t),(0,Hr.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return Pc(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=We.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=We.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,U.Name)),!0}}Ne.KeywordCxt=Hi;function Vi(e,t,r,n){const s=new Hi(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Bt.funcKeywordCode)(s,r):"macro"in r?(0,Bt.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Bt.funcKeywordCode)(s,r)}const qc=/^\/(?:[^~]|~0|~1)*$/,Mc=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function zi(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return V.default.rootData;if(e[0]==="/"){if(!qc.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,i=V.default.rootData}else{const u=Mc.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw new Error(p("property/index",d));return n[t-d]}if(d>t)throw new Error(p("data",d));if(i=r[t-d],!s)return i}let o=i;const l=s.split("/");for(const u of l)u&&(i=(0,U._)`${i}${(0,U.getProperty)((0,We.unescapeJsonPointer)(u))}`,o=(0,U._)`${o} && ${i}`);return o;function p(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}Ne.getData=zi;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});class Uc extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}rr.default=Uc;var nr={};Object.defineProperty(nr,"__esModule",{value:!0});const Vr=he;class Lc extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Vr.resolveUrl)(t,r,n),this.missingSchema=(0,Vr.normalizeId)((0,Vr.getFullPath)(t,this.missingRef))}}nr.default=Lc;var _e={};Object.defineProperty(_e,"__esModule",{value:!0});_e.resolveSchema=_e.getCompilingSchema=_e.resolveRef=_e.compileSchema=_e.SchemaEnv=void 0;const Te=x,Hc=rr,nt=He,Oe=he,Ts=Z,Vc=Ne;class Fr{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Oe.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}}_e.SchemaEnv=Fr;function hn(e){const t=Wi.call(this,e);if(t)return t;const r=(0,Oe.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Te.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let l;e.$async&&(l=o.scopeValue("Error",{ref:Hc.default,code:(0,Te._)`require("ajv/dist/runtime/validation_error").default`}));const p=o.scopeName("validate");e.validateName=p;const u={gen:o,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:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Te.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:l,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Te.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Te._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,Vc.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);const g=o.toString();d=`${o.scopeRefs(nt.default.scope)}return ${g}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const k=new Function(`${nt.default.self}`,`${nt.default.scope}`,d)(this,this.scope.get());if(this.scope.value(p,{ref:k}),k.errors=null,k.schema=e.schema,k.schemaEnv=e,e.$async&&(k.$async=!0),this.opts.code.source===!0&&(k.source={validateName:p,validateCode:g,scopeValues:o._values}),this.opts.unevaluated){const{props:E,items:S}=u;k.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},k.source&&(k.source.evaluated=(0,Te.stringify)(k.evaluated))}return e.validate=k,e}catch(g){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),g}finally{this._compilations.delete(e)}}_e.compileSchema=hn;function zc(e,t,r){var n;r=(0,Oe.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=xc.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(i=new Fr({schema:o,schemaId:l,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Wc.call(this,i)}_e.resolveRef=zc;function Wc(e){return(0,Oe.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:hn.call(this,e)}function Wi(e){for(const t of this._compilations)if(Kc(t,e))return t}_e.getCompilingSchema=Wi;function Kc(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function xc(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||qr.call(this,e,t)}function qr(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Oe._getFullPath)(this.opts.uriResolver,r);let s=(0,Oe.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return zr.call(this,r,e);const i=(0,Oe.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const l=qr.call(this,e,o);return typeof l?.schema!="object"?void 0:zr.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||hn.call(this,o),i===(0,Oe.normalizeId)(t)){const{schema:l}=o,{schemaId:p}=this.opts,u=l[p];return u&&(s=(0,Oe.resolveUrl)(this.opts.uriResolver,s,u)),new Fr({schema:l,schemaId:p,root:e,baseId:s})}return zr.call(this,r,o)}}_e.resolveSchema=qr;const Bc=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zr(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const p=r[(0,Ts.unescapeFragment)(l)];if(p===void 0)return;r=p;const u=typeof r=="object"&&r[this.opts.schemaId];!Bc.has(l)&&u&&(t=(0,Oe.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Ts.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Oe.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=qr.call(this,n,l)}const{schemaId:o}=this.opts;if(i=i||new Fr({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const Gc="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Jc="Meta-schema for $data reference (JSON AnySchema extension proposal)",Yc="object",Qc=["$data"],Xc={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Zc=!1,el={$id:Gc,description:Jc,type:Yc,required:Qc,properties:Xc,additionalProperties:Zc};var mn={},Qr={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,n){n(t)})(_a,function(r){function n(){for(var f=arguments.length,c=Array(f),m=0;m<f;m++)c[m]=arguments[m];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(f){return"(?:"+f+")"}function i(f){return f===void 0?"undefined":f===null?"null":Object.prototype.toString.call(f).split(" ").pop().split("]").shift().toLowerCase()}function o(f){return f.toUpperCase()}function l(f){return f!=null?f instanceof Array?f:typeof f.length!="number"||f.split||f.setInterval||f.call?[f]:Array.prototype.slice.call(f):[]}function p(f,c){var m=f;if(c)for(var P in c)m[P]=c[P];return m}function u(f){var c="[A-Za-z]",m="[0-9]",P=n(m,"[A-Fa-f]"),b=s(s("%[EFef]"+P+"%"+P+P+"%"+P+P)+"|"+s("%[89A-Fa-f]"+P+"%"+P+P)+"|"+s("%"+P+P)),L="[\\:\\/\\?\\#\\[\\]\\@]",H="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",X=n(L,H),re=f?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ce=f?"[\\uE000-\\uF8FF]":"[]",J=n(c,m,"[\\-\\.\\_\\~]",re);s(c+n(c,m,"[\\+\\-\\.]")+"*"),s(s(b+"|"+n(J,H,"[\\:]"))+"*");var te=s(s("25[0-5]")+"|"+s("2[0-4]"+m)+"|"+s("1"+m+m)+"|"+s("0?[1-9]"+m)+"|0?0?"+m),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),qe=s(s(s(W+"\\:")+"{0,2}"+W)+"?\\:\\:"+s(W+"\\:")+"{2}"+se),bt=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([fe,ie,Ke,Fe,qe,bt,tt,Ee,Me].join("|")),Ve=s(s(J+"|"+b)+"+");s("[vV]"+P+"+\\."+n(J,H,"[\\:]")+"+"),s(s(b+"|"+n(J,H))+"*");var Vt=s(b+"|"+n(J,H,"[\\:\\@]"));return s(s(b+"|"+n(J,H,"[\\@]"))+"+"),s(s(Vt+"|"+n("[\\/\\?]",ce))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,m,"[\\+\\-\\.]"),"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,X),"g"),PCT_ENCODED:new RegExp(b,"g"),IPV4ADDRESS:new RegExp("^("+le+")$"),IPV6ADDRESS:new RegExp("^\\[?("+rt+")"+s(s("\\%25|\\%(?!"+P+"{2})")+"("+Ve+")")+"?\\]?$")}}var d=u(!1),g=u(!0),C=function(){function f(c,m){var P=[],b=!0,L=!1,H=void 0;try{for(var X=c[Symbol.iterator](),re;!(b=(re=X.next()).done)&&(P.push(re.value),!(m&&P.length===m));b=!0);}catch(ce){L=!0,H=ce}finally{try{!b&&X.return&&X.return()}finally{if(L)throw H}}return P}return function(c,m){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return f(c,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=function(f){if(Array.isArray(f)){for(var c=0,m=Array(f.length);c<f.length;c++)m[c]=f[c];return m}else return Array.from(f)},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,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-v,Q=Math.floor,be=String.fromCharCode;function de(f){throw new RangeError(B[f])}function Qe(f,c){for(var m=[],P=f.length;P--;)m[P]=c(f[P]);return m}function Xe(f,c){var m=f.split("@"),P="";m.length>1&&(P=m[0]+"@",f=m[1]),f=f.replace(z,".");var b=f.split("."),L=Qe(b,c).join(".");return P+L}function ht(f){for(var c=[],m=0,P=f.length;m<P;){var b=f.charCodeAt(m++);if(b>=55296&&b<=56319&&m<P){var L=f.charCodeAt(m++);(L&64512)==56320?c.push(((b&1023)<<10)+(L&1023)+65536):(c.push(b),m--)}else c.push(b)}return c}var At=function(c){return String.fromCodePoint.apply(String,k(c))},mt=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:S},F=function(c,m){return c+22+75*(c<26)-((m!=0)<<5)},$=function(c,m,P){var b=0;for(c=P?Q(c/R):c>>1,c+=Q(c/m);c>oe*y>>1;b+=S)c=Q(c/oe);return Q(b+(oe+1)*c/(c+T))},I=function(c){var m=[],P=c.length,b=0,L=D,H=j,X=c.lastIndexOf(_);X<0&&(X=0);for(var re=0;re<X;++re)c.charCodeAt(re)>=128&&de("not-basic"),m.push(c.charCodeAt(re));for(var ce=X>0?X+1:0;ce<P;){for(var J=b,te=1,le=S;;le+=S){ce>=P&&de("invalid-input");var W=mt(c.charCodeAt(ce++));(W>=S||W>Q((E-b)/te))&&de("overflow"),b+=W*te;var se=le<=H?v:le>=H+y?y:le-H;if(W<se)break;var fe=S-se;te>Q(E/fe)&&de("overflow"),te*=fe}var ie=m.length+1;H=$(b-J,ie,J==0),Q(b/ie)>E-L&&de("overflow"),L+=Q(b/ie),b%=ie,m.splice(b++,0,L)}return String.fromCodePoint.apply(String,m)},w=function(c){var m=[];c=ht(c);var P=c.length,b=D,L=0,H=j,X=!0,re=!1,ce=void 0;try{for(var J=c[Symbol.iterator](),te;!(X=(te=J.next()).done);X=!0){var le=te.value;le<128&&m.push(be(le))}}catch(zt){re=!0,ce=zt}finally{try{!X&&J.return&&J.return()}finally{if(re)throw ce}}var W=m.length,se=W;for(W&&m.push(_);se<P;){var fe=E,ie=!0,Ke=!1,Fe=void 0;try{for(var qe=c[Symbol.iterator](),bt;!(ie=(bt=qe.next()).done);ie=!0){var tt=bt.value;tt>=b&&tt<fe&&(fe=tt)}}catch(zt){Ke=!0,Fe=zt}finally{try{!ie&&qe.return&&qe.return()}finally{if(Ke)throw Fe}}var Ee=se+1;fe-b>Q((E-L)/Ee)&&de("overflow"),L+=(fe-b)*Ee,b=fe;var Me=!0,rt=!1,Ve=void 0;try{for(var Vt=c[Symbol.iterator](),ns;!(Me=(ns=Vt.next()).done);Me=!0){var ss=ns.value;if(ss<b&&++L>E&&de("overflow"),ss==b){for(var or=L,ar=S;;ar+=S){var cr=ar<=H?v:ar>=H+y?y:ar-H;if(or<cr)break;var is=or-cr,os=S-cr;m.push(be(F(cr+is%os,0))),or=Q(is/os)}m.push(be(F(or,0))),H=$(L,Ee,se==W),L=0,++se}}}catch(zt){rt=!0,Ve=zt}finally{try{!Me&&Vt.return&&Vt.return()}finally{if(rt)throw Ve}}++L,++b}return m.join("")},a=function(c){return Xe(c,function(m){return O.test(m)?I(m.slice(4).toLowerCase()):m})},h=function(c){return Xe(c,function(m){return A.test(m)?"xn--"+w(m):m})},N={version:"2.1.0",ucs2:{decode:ht,encode:At},decode:I,encode:w,toASCII:h,toUnicode:a},q={};function M(f){var c=f.charCodeAt(0),m=void 0;return c<16?m="%0"+c.toString(16).toUpperCase():c<128?m="%"+c.toString(16).toUpperCase():c<2048?m="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():m="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),m}function G(f){for(var c="",m=0,P=f.length;m<P;){var b=parseInt(f.substr(m+1,2),16);if(b<128)c+=String.fromCharCode(b),m+=3;else if(b>=194&&b<224){if(P-m>=6){var L=parseInt(f.substr(m+4,2),16);c+=String.fromCharCode((b&31)<<6|L&63)}else c+=f.substr(m,6);m+=6}else if(b>=224){if(P-m>=9){var H=parseInt(f.substr(m+4,2),16),X=parseInt(f.substr(m+7,2),16);c+=String.fromCharCode((b&15)<<12|(H&63)<<6|X&63)}else c+=f.substr(m,9);m+=9}else c+=f.substr(m,3),m+=3}return c}function Y(f,c){function m(P){var b=G(P);return b.match(c.UNRESERVED)?b:P}return f.scheme&&(f.scheme=String(f.scheme).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_SCHEME,"")),f.userinfo!==void 0&&(f.userinfo=String(f.userinfo).replace(c.PCT_ENCODED,m).replace(c.NOT_USERINFO,M).replace(c.PCT_ENCODED,o)),f.host!==void 0&&(f.host=String(f.host).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_HOST,M).replace(c.PCT_ENCODED,o)),f.path!==void 0&&(f.path=String(f.path).replace(c.PCT_ENCODED,m).replace(f.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,M).replace(c.PCT_ENCODED,o)),f.query!==void 0&&(f.query=String(f.query).replace(c.PCT_ENCODED,m).replace(c.NOT_QUERY,M).replace(c.PCT_ENCODED,o)),f.fragment!==void 0&&(f.fragment=String(f.fragment).replace(c.PCT_ENCODED,m).replace(c.NOT_FRAGMENT,M).replace(c.PCT_ENCODED,o)),f}function ae(f){return f.replace(/^0*(.*)/,"$1")||"0"}function Ie(f,c){var m=f.match(c.IPV4ADDRESS)||[],P=C(m,2),b=P[1];return b?b.split(".").map(ae).join("."):f}function yt(f,c){var m=f.match(c.IPV6ADDRESS)||[],P=C(m,3),b=P[1],L=P[2];if(b){for(var H=b.toLowerCase().split("::").reverse(),X=C(H,2),re=X[0],ce=X[1],J=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]=J[ie]||te[se+ie]||"";le&&(fe[W-1]=Ie(fe[W-1],c));var Ke=fe.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},[]),Fe=Ke.sort(function(Ee,Me){return Me.length-Ee.length})[0],qe=void 0;if(Fe&&Fe.length>1){var bt=fe.slice(0,Fe.index),tt=fe.slice(Fe.index+Fe.length);qe=bt.join(":")+"::"+tt.join(":")}else qe=fe.join(":");return L&&(qe+="%"+L),qe}else return f}var Dt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ft="".match(/(){0}/)[1]===void 0;function we(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m={},P=c.iri!==!1?g:d;c.reference==="suffix"&&(f=(c.scheme?c.scheme+":":"")+"//"+f);var b=f.match(Dt);if(b){Ft?(m.scheme=b[1],m.userinfo=b[3],m.host=b[4],m.port=parseInt(b[5],10),m.path=b[6]||"",m.query=b[7],m.fragment=b[8],isNaN(m.port)&&(m.port=b[5])):(m.scheme=b[1]||void 0,m.userinfo=f.indexOf("@")!==-1?b[3]:void 0,m.host=f.indexOf("//")!==-1?b[4]:void 0,m.port=parseInt(b[5],10),m.path=b[6]||"",m.query=f.indexOf("?")!==-1?b[7]:void 0,m.fragment=f.indexOf("#")!==-1?b[8]:void 0,isNaN(m.port)&&(m.port=f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?b[4]:void 0)),m.host&&(m.host=yt(Ie(m.host,P),P)),m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&!m.path&&m.query===void 0?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==m.reference&&(m.error=m.error||"URI is not a "+c.reference+" reference.");var L=q[(c.scheme||m.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!L||!L.unicodeSupport)){if(m.host&&(c.domainHost||L&&L.domainHost))try{m.host=N.toASCII(m.host.replace(P.PCT_ENCODED,G).toLowerCase())}catch(H){m.error=m.error||"Host's domain name can not be converted to ASCII via punycode: "+H}Y(m,d)}else Y(m,P);L&&L.parse&&L.parse(m,c)}else m.error=m.error||"URI can not be parsed.";return m}function qt(f,c){var m=c.iri!==!1?g:d,P=[];return f.userinfo!==void 0&&(P.push(f.userinfo),P.push("@")),f.host!==void 0&&P.push(yt(Ie(String(f.host),m),m).replace(m.IPV6ADDRESS,function(b,L,H){return"["+L+(H?"%25"+H:"")+"]"})),(typeof f.port=="number"||typeof f.port=="string")&&(P.push(":"),P.push(String(f.port))),P.length?P.join(""):void 0}var gt=/^\.\.?\//,$t=/^\/\.(\/|$)/,vt=/^\/\.\.(\/|$)/,Mt=/^\/?(?:.|\n)*?(?=\/|$)/;function Ae(f){for(var c=[];f.length;)if(f.match(gt))f=f.replace(gt,"");else if(f.match($t))f=f.replace($t,"/");else if(f.match(vt))f=f.replace(vt,"/"),c.pop();else if(f==="."||f==="..")f="";else{var m=f.match(Mt);if(m){var P=m[0];f=f.slice(P.length),c.push(P)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function $e(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=c.iri?g:d,P=[],b=q[(c.scheme||f.scheme||"").toLowerCase()];if(b&&b.serialize&&b.serialize(f,c),f.host&&!m.IPV6ADDRESS.test(f.host)){if(c.domainHost||b&&b.domainHost)try{f.host=c.iri?N.toUnicode(f.host):N.toASCII(f.host.replace(m.PCT_ENCODED,G).toLowerCase())}catch(X){f.error=f.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+X}}Y(f,m),c.reference!=="suffix"&&f.scheme&&(P.push(f.scheme),P.push(":"));var L=qt(f,c);if(L!==void 0&&(c.reference!=="suffix"&&P.push("//"),P.push(L),f.path&&f.path.charAt(0)!=="/"&&P.push("/")),f.path!==void 0){var H=f.path;!c.absolutePath&&(!b||!b.absolutePath)&&(H=Ae(H)),L===void 0&&(H=H.replace(/^\/\//,"/%2F")),P.push(H)}return f.query!==void 0&&(P.push("?"),P.push(f.query)),f.fragment!==void 0&&(P.push("#"),P.push(f.fragment)),P.join("")}function _t(f,c){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments[3],b={};return P||(f=we($e(f,m),m),c=we($e(c,m),m)),m=m||{},!m.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):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?b.path="/"+c.path:f.path?b.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+c.path:b.path=c.path,b.path=Ae(b.path)),b.query=c.query):(b.path=f.path,c.query!==void 0?b.query=c.query:b.query=f.query),b.userinfo=f.userinfo,b.host=f.host,b.port=f.port),b.scheme=f.scheme),b.fragment=c.fragment,b}function Ut(f,c,m){var P=p({scheme:"null"},m);return $e(_t(we(f,P),we(c,P),P,!0),P)}function Ze(f,c){return typeof f=="string"?f=$e(we(f,c),c):i(f)==="object"&&(f=we($e(f,c),c)),f}function Lt(f,c,m){return typeof f=="string"?f=$e(we(f,m),m):i(f)==="object"&&(f=$e(f,m)),typeof c=="string"?c=$e(we(c,m),m):i(c)==="object"&&(c=$e(c,m)),f===c}function ir(f,c){return f&&f.toString().replace(!c||!c.iri?d.ESCAPE:g.ESCAPE,M)}function Pe(f,c){return f&&f.toString().replace(!c||!c.iri?d.PCT_ENCODED:g.PCT_ENCODED,G)}var et={scheme:"http",domainHost:!0,parse:function(c,m){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,m){var P=String(c.scheme).toLowerCase()==="https";return(c.port===(P?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},Jn={scheme:"https",domainHost:et.domainHost,parse:et.parse,serialize:et.serialize};function Yn(f){return typeof f.secure=="boolean"?f.secure:String(f.scheme).toLowerCase()==="wss"}var Ht={scheme:"ws",domainHost:!0,parse:function(c,m){var P=c;return P.secure=Yn(P),P.resourceName=(P.path||"/")+(P.query?"?"+P.query:""),P.path=void 0,P.query=void 0,P},serialize:function(c,m){if((c.port===(Yn(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=C(P,2),L=b[0],H=b[1];c.path=L&&L!=="/"?L:void 0,c.query=H,c.resourceName=void 0}return c.fragment=void 0,c}},Qn={scheme:"wss",domainHost:Ht.domainHost,parse:Ht.parse,serialize:Ht.serialize},po={},Xn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",De="[0-9A-Fa-f]",ho=s(s("%[EFef]"+De+"%"+De+De+"%"+De+De)+"|"+s("%[89A-Fa-f]"+De+"%"+De+De)+"|"+s("%"+De+De)),mo="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",yo="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",go=n(yo,'[\\"\\\\]'),$o="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",vo=new RegExp(Xn,"g"),wt=new RegExp(ho,"g"),_o=new RegExp(n("[^]",mo,"[\\.]",'[\\"]',go),"g"),Zn=new RegExp(n("[^]",Xn,$o),"g"),wo=Zn;function Ur(f){var c=G(f);return c.match(vo)?c:f}var es={scheme:"mailto",parse:function(c,m){var P=c,b=P.to=P.path?P.path.split(","):[];if(P.path=void 0,P.query){for(var L=!1,H={},X=P.query.split("&"),re=0,ce=X.length;re<ce;++re){var J=X[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],m);break;case"body":P.body=Pe(J[1],m);break;default:L=!0,H[Pe(J[0],m)]=Pe(J[1],m);break}}L&&(P.headers=H)}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]),m.unicodeSupport)ie[1]=Pe(ie[1],m).toLowerCase();else try{ie[1]=N.toASCII(Pe(ie[1],m).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,m){var P=c,b=l(c.to);if(b){for(var L=0,H=b.length;L<H;++L){var X=String(b[L]),re=X.lastIndexOf("@"),ce=X.slice(0,re).replace(wt,Ur).replace(wt,o).replace(_o,M),J=X.slice(re+1);try{J=m.iri?N.toUnicode(J):N.toASCII(Pe(J,m).toLowerCase())}catch(se){P.error=P.error||"Email address's domain name can not be converted to "+(m.iri?"Unicode":"ASCII")+" via punycode: "+se}b[L]=ce+"@"+J}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]!==po[W]&&le.push(W.replace(wt,Ur).replace(wt,o).replace(Zn,M)+"="+te[W].replace(wt,Ur).replace(wt,o).replace(wo,M));return le.length&&(P.query=le.join("&")),P}},bo=/^([^\:]+)\:(.*)/,ts={scheme:"urn",parse:function(c,m){var P=c.path&&c.path.match(bo),b=c;if(P){var L=m.scheme||b.scheme||"urn",H=P[1].toLowerCase(),X=P[2],re=L+":"+(m.nid||H),ce=q[re];b.nid=H,b.nss=X,b.path=void 0,ce&&(b=ce.parse(b,m))}else b.error=b.error||"URN can not be parsed.";return b},serialize:function(c,m){var P=m.scheme||c.scheme||"urn",b=c.nid,L=P+":"+(m.nid||b),H=q[L];H&&(c=H.serialize(c,m));var X=c,re=c.nss;return X.path=(b||m.nid)+":"+re,X}},Po=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,rs={scheme:"urn:uuid",parse:function(c,m){var P=c;return P.uuid=P.nss,P.nss=void 0,!m.tolerant&&(!P.uuid||!P.uuid.match(Po))&&(P.error=P.error||"UUID is not valid."),P},serialize:function(c,m){var P=c;return P.nss=(c.uuid||"").toLowerCase(),P}};q[et.scheme]=et,q[Jn.scheme]=Jn,q[Ht.scheme]=Ht,q[Qn.scheme]=Qn,q[es.scheme]=es,q[ts.scheme]=ts,q[rs.scheme]=rs,r.SCHEMES=q,r.pctEncChar=M,r.pctDecChars=G,r.parse=we,r.removeDotSegments=Ae,r.serialize=$e,r.resolveComponents=_t,r.resolve=Ut,r.normalize=Ze,r.equal=Lt,r.escapeComponent=ir,r.unescapeComponent=Pe,Object.defineProperty(r,"__esModule",{value:!0})})})(Qr,Qr.exports);var tl=Qr.exports;Object.defineProperty(mn,"__esModule",{value:!0});const Ki=tl;Ki.code='require("ajv/dist/runtime/uri").default';mn.default=Ki;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ne;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=x;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=rr,s=nr,i=dt,o=_e,l=x,p=he,u=tr,d=Z,g=el,C=mn,k=(F,$)=>new RegExp(F,$);k.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(F){var $,I,w,a,h,N,q,M,G,Y,ae,Ie,yt,Dt,Ft,we,qt,gt,$t,vt,Mt,Ae,$e,_t,Ut;const Ze=F.strict,Lt=($=F.code)===null||$===void 0?void 0:$.optimize,ir=Lt===!0||Lt===void 0?1:Lt||0,Pe=(w=(I=F.code)===null||I===void 0?void 0:I.regExp)!==null&&w!==void 0?w:k,et=(a=F.uriResolver)!==null&&a!==void 0?a:C.default;return{strictSchema:(N=(h=F.strictSchema)!==null&&h!==void 0?h:Ze)!==null&&N!==void 0?N:!0,strictNumbers:(M=(q=F.strictNumbers)!==null&&q!==void 0?q:Ze)!==null&&M!==void 0?M:!0,strictTypes:(Y=(G=F.strictTypes)!==null&&G!==void 0?G:Ze)!==null&&Y!==void 0?Y:"log",strictTuples:(Ie=(ae=F.strictTuples)!==null&&ae!==void 0?ae:Ze)!==null&&Ie!==void 0?Ie:"log",strictRequired:(Dt=(yt=F.strictRequired)!==null&&yt!==void 0?yt:Ze)!==null&&Dt!==void 0?Dt:!1,code:F.code?{...F.code,optimize:ir,regExp:Pe}:{optimize:ir,regExp:Pe},loopRequired:(Ft=F.loopRequired)!==null&&Ft!==void 0?Ft:T,loopEnum:(we=F.loopEnum)!==null&&we!==void 0?we:T,meta:(qt=F.meta)!==null&&qt!==void 0?qt:!0,messages:(gt=F.messages)!==null&>!==void 0?gt:!0,inlineRefs:($t=F.inlineRefs)!==null&&$t!==void 0?$t:!0,schemaId:(vt=F.schemaId)!==null&&vt!==void 0?vt:"$id",addUsedSchema:(Mt=F.addUsedSchema)!==null&&Mt!==void 0?Mt:!0,validateSchema:(Ae=F.validateSchema)!==null&&Ae!==void 0?Ae:!0,validateFormats:($e=F.validateFormats)!==null&&$e!==void 0?$e:!0,unicodeRegExp:(_t=F.unicodeRegExp)!==null&&_t!==void 0?_t:!0,int32range:(Ut=F.int32range)!==null&&Ut!==void 0?Ut:!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=Q($.logger);const a=$.validateFormats;$.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,v,$,"NOT SUPPORTED"),D.call(this,y,$,"DEPRECATED","warn"),this._metaOpts=B.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=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:$,meta:I,schemaId:w}=this.opts;let a=g;w==="id"&&(a={...g},a.id=a.$id,delete a.$id),I&&$&&this.addMetaSchema(a,a[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 a=w(I);return"$async"in w||(this.errors=w.errors),a}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 a.call(this,$,I);async function a(Y,ae){await h.call(this,Y.$schema);const Ie=this._addSchema(Y,ae);return Ie.validate||N.call(this,Ie)}async function h(Y){Y&&!this.getSchema(Y)&&await a.call(this,{$ref:Y},!0)}async function N(Y){try{return this._compileSchemaEnv(Y)}catch(ae){if(!(ae instanceof s.default))throw ae;return q.call(this,ae),await M.call(this,ae.missingSchema),N.call(this,Y)}}function q({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 G.call(this,Y);this.refs[Y]||await h.call(this,ae.$schema),this.refs[Y]||this.addSchema(ae,Y,I)}async function G(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,a=this.opts.validateSchema){if(Array.isArray($)){for(const N of $)this.addSchema(N,void 0,w,a);return this}let h;if(typeof $=="object"){const{schemaId:N}=this.opts;if(h=$[N],h!==void 0&&typeof h!="string")throw new Error(`schema ${N} must be string`)}return I=(0,p.normalizeId)(I||h),this._checkUnique(I),this.schemas[I]=this._addSchema($,w,I,a,!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 a=this.validate(w,$);if(!a&&I){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return a}getSchema($){let I;for(;typeof(I=_.call(this,$))=="string";)$=I;if(I===void 0){const{schemaId:w}=this.opts,a=new o.SchemaEnv({schema:{},schemaId:w});if(I=o.resolveSchema.call(this,a,$),!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,p.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,d.eachItem)(w,h=>Qe.call(this,h)),this;ht.call(this,I);const a={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,d.eachItem)(w,a.type.length===0?h=>Qe.call(this,h,a):h=>a.type.forEach(N=>Qe.call(this,h,a,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 a=w.rules.findIndex(h=>h.keyword===$);a>=0&&w.rules.splice(a,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(a=>`${w}${a.instancePath} ${a.message}`).reduce((a,h)=>a+I+h)}$dataMetaSchema($,I){const w=this.RULES.all;$=JSON.parse(JSON.stringify($));for(const a of I){const h=a.split("/").slice(1);let N=$;for(const q of h)N=N[q];for(const q in w){const M=w[q];if(typeof M!="object")continue;const{$data:G}=M.definition,Y=N[q];G&&Y&&(N[q]=mt(Y))}}return $}_removeAllSchemas($,I){for(const w in $){const a=$[w];(!I||I.test(w))&&(typeof a=="string"?delete $[w]:a&&!a.meta&&(this._cache.delete(a.schema),delete $[w]))}}_addSchema($,I,w,a=this.opts.validateSchema,h=this.opts.addUsedSchema){let N;const{schemaId:q}=this.opts;if(typeof $=="object")N=$[q];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,p.normalizeId)(N||w);const G=p.getSchemaRefs.call(this,$,w);return M=new o.SchemaEnv({schema:$,schemaId:q,meta:I,baseId:w,localRefs:G}),this._cache.set(M.schema,M),h&&!w.startsWith("#")&&(w&&this._checkUnique(w),this.refs[w]=M),a&&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($):o.compileSchema.call(this,$),!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){const I=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,$)}finally{this.opts=I}}}e.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function D(F,$,I,w="error"){for(const a in F){const h=a;h in $&&this.logger[w](`${I}: option ${a}. ${F[h]}`)}}function _(F){return F=(0,p.normalizeId)(F),this.schemas[F]||this.refs[F]}function O(){const F=this.opts.schemas;if(F)if(Array.isArray(F))this.addSchema(F);else for(const $ in F)this.addSchema(F[$],$)}function A(){for(const F in this.opts.formats){const $=this.opts.formats[F];$&&this.addFormat(F,$)}}function z(F){if(Array.isArray(F)){this.addVocabulary(F);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const $ in F){const I=F[$];I.keyword||(I.keyword=$),this.addKeyword(I)}}function B(){const F={...this.opts};for(const $ of E)delete F[$];return F}const oe={log(){},warn(){},error(){}};function Q(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,$){const{RULES:I}=this;if((0,d.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`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw new Error('$data keyword must have "code" or "validate" function')}function Qe(F,$,I){var w;const a=$?.post;if(I&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let N=a?h.post:h.rules.find(({type:M})=>M===I);if(N||(N={type:I,rules:[]},h.rules.push(N)),h.keywords[F]=!0,!$)return;const q={keyword:F,definition:{...$,type:(0,u.getJSONTypes)($.type),schemaType:(0,u.getJSONTypes)($.schemaType)}};$.before?Xe.call(this,N,q,$.before):N.rules.push(q),h.all[F]=q,(w=$.implements)===null||w===void 0||w.forEach(M=>this.addKeyword(M))}function Xe(F,$,I){const w=F.rules.findIndex(a=>a.keyword===I);w>=0?F.rules.splice(w,0,$):(F.rules.push($),this.logger.warn(`rule ${I} is not defined`))}function ht(F){let{metaSchema:$}=F;$!==void 0&&(F.$data&&this.opts.$data&&($=mt($)),F.validateSchema=this.compile($,!0))}const At={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function mt(F){return{anyOf:[F,At]}}})(_i);var yn={},gn={},$n={};Object.defineProperty($n,"__esModule",{value:!0});const rl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$n.default=rl;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.callRef=ft.getValidate=void 0;const nl=nr,Rs=K,ve=x,St=He,Os=_e,lr=Z,sl={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:l,self:p}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return g();const d=Os.resolveRef.call(p,u,s,r);if(d===void 0)throw new nl.default(n.opts.uriResolver,s,r);if(d instanceof Os.SchemaEnv)return C(d);return k(d);function g(){if(i===u)return gr(e,o,i,i.$async);const E=t.scopeValue("root",{ref:u});return gr(e,(0,ve._)`${E}.validate`,u,u.$async)}function C(E){const S=xi(e,E);gr(e,S,E,E.$async)}function k(E){const S=t.scopeValue("schema",l.code.source===!0?{ref:E,code:(0,ve.stringify)(E)}:{ref:E}),v=t.name("valid"),y=e.subschema({schema:E,dataTypes:[],schemaPath:ve.nil,topSchemaRef:S,errSchemaPath:r},v);e.mergeEvaluated(y),e.ok(v)}}};function xi(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ve._)`${r.scopeValue("wrapper",{ref:t})}.validate`}ft.getValidate=xi;function gr(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:l,opts:p}=i,u=p.passContext?St.default.this:ve.nil;n?d():g();function d(){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,Rs.callValidateCode)(e,t,u)}`),k(t),o||s.assign(E,!0)},S=>{s.if((0,ve._)`!(${S} instanceof ${i.ValidationError})`,()=>s.throw(S)),C(S),o||s.assign(E,!1)}),e.ok(E)}function g(){e.result((0,Rs.callValidateCode)(e,t,u),()=>k(t),()=>C(t))}function C(E){const S=(0,ve._)`${E}.errors`;s.assign(St.default.vErrors,(0,ve._)`${St.default.vErrors} === null ? ${S} : ${St.default.vErrors}.concat(${S})`),s.assign(St.default.errors,(0,ve._)`${St.default.vErrors}.length`)}function k(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=lr.mergeEvaluated.props(s,v.props,i.props));else{const y=s.var("props",(0,ve._)`${E}.evaluated.props`);i.props=lr.mergeEvaluated.props(s,y,i.props,ve.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=lr.mergeEvaluated.items(s,v.items,i.items));else{const y=s.var("items",(0,ve._)`${E}.evaluated.items`);i.items=lr.mergeEvaluated.items(s,y,i.items,ve.Name)}}}ft.callRef=gr;ft.default=sl;Object.defineProperty(gn,"__esModule",{value:!0});const il=$n,ol=ft,al=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",il.default,ol.default];gn.default=al;var vn={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});const Pr=x,Ge=Pr.operators,Er={maximum:{okStr:"<=",ok:Ge.LTE,fail:Ge.GT},minimum:{okStr:">=",ok:Ge.GTE,fail:Ge.LT},exclusiveMaximum:{okStr:"<",ok:Ge.LT,fail:Ge.GTE},exclusiveMinimum:{okStr:">",ok:Ge.GT,fail:Ge.LTE}},cl={message:({keyword:e,schemaCode:t})=>(0,Pr.str)`must be ${Er[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Pr._)`{comparison: ${Er[e].okStr}, limit: ${t}}`},ll={keyword:Object.keys(Er),type:"number",schemaType:"number",$data:!0,error:cl,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Pr._)`${r} ${Er[t].fail} ${n} || isNaN(${r})`)}};_n.default=ll;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});const Gt=x,ul={message:({schemaCode:e})=>(0,Gt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Gt._)`{multipleOf: ${e}}`},dl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ul,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),l=i?(0,Gt._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Gt._)`${o} !== parseInt(${o})`;e.fail$data((0,Gt._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};wn.default=dl;var bn={},Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});function Bi(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}Pn.default=Bi;Bi.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(bn,"__esModule",{value:!0});const it=x,fl=Z,pl=Pn,hl={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,it.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,it._)`{limit: ${e}}`},ml={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:hl,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?it.operators.GT:it.operators.LT,o=s.opts.unicode===!1?(0,it._)`${r}.length`:(0,it._)`${(0,fl.useFunc)(e.gen,pl.default)}(${r})`;e.fail$data((0,it._)`${o} ${i} ${n}`)}};bn.default=ml;var En={};Object.defineProperty(En,"__esModule",{value:!0});const yl=K,Sr=x,gl={message:({schemaCode:e})=>(0,Sr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Sr._)`{pattern: ${e}}`},$l={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:gl,code(e){const{data:t,$data:r,schema:n,schemaCode:s,it:i}=e,o=i.opts.unicodeRegExp?"u":"",l=r?(0,Sr._)`(new RegExp(${s}, ${o}))`:(0,yl.usePattern)(e,n);e.fail$data((0,Sr._)`!${l}.test(${t})`)}};En.default=$l;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});const Jt=x,vl={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Jt.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Jt._)`{limit: ${e}}`},_l={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:vl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Jt.operators.GT:Jt.operators.LT;e.fail$data((0,Jt._)`Object.keys(${r}).length ${s} ${n}`)}};Sn.default=_l;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});const Kt=K,Yt=x,wl=Z,bl={message:({params:{missingProperty:e}})=>(0,Yt.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Yt._)`{missingProperty: ${e}}`},Pl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:bl,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:l}=o;if(!i&&r.length===0)return;const p=r.length>=l.loopRequired;if(o.allErrors?u():d(),l.strictRequired){const k=e.parentSchema.properties,{definedProperties:E}=e.it;for(const S of r)if(k?.[S]===void 0&&!E.has(S)){const v=o.schemaEnv.baseId+o.errSchemaPath,y=`required property "${S}" is not defined at "${v}" (strictRequired)`;(0,wl.checkStrictMode)(o,y,o.opts.strictRequired)}}function u(){if(p||i)e.block$data(Yt.nil,g);else for(const k of r)(0,Kt.checkReportMissingProp)(e,k)}function d(){const k=t.let("missing");if(p||i){const E=t.let("valid",!0);e.block$data(E,()=>C(k,E)),e.ok(E)}else t.if((0,Kt.checkMissingProp)(e,r,k)),(0,Kt.reportMissingProp)(e,k),t.else()}function g(){t.forOf("prop",n,k=>{e.setParams({missingProperty:k}),t.if((0,Kt.noPropertyInData)(t,s,k,l.ownProperties),()=>e.error())})}function C(k,E){e.setParams({missingProperty:k}),t.forOf(k,n,()=>{t.assign(E,(0,Kt.propertyInData)(t,s,k,l.ownProperties)),t.if((0,Yt.not)(E),()=>{e.error(),t.break()})},Yt.nil)}}};Tn.default=Pl;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});const Qt=x,El={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Qt.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Qt._)`{limit: ${e}}`},Sl={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:El,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Qt.operators.GT:Qt.operators.LT;e.fail$data((0,Qt._)`${r}.length ${s} ${n}`)}};Rn.default=Sl;var On={},sr={};Object.defineProperty(sr,"__esModule",{value:!0});const Gi=Oi;Gi.code='require("ajv/dist/runtime/equal").default';sr.default=Gi;Object.defineProperty(On,"__esModule",{value:!0});const Wr=tr,pe=x,Tl=Z,Rl=sr,Ol={message:({params:{i:e,j:t}})=>(0,pe.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,pe._)`{i: ${e}, j: ${t}}`},Nl={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Ol,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:l}=e;if(!n&&!s)return;const p=t.let("valid"),u=i.items?(0,Wr.getSchemaTypes)(i.items):[];e.block$data(p,d,(0,pe._)`${o} === false`),e.ok(p);function d(){const E=t.let("i",(0,pe._)`${r}.length`),S=t.let("j");e.setParams({i:E,j:S}),t.assign(p,!0),t.if((0,pe._)`${E} > 1`,()=>(g()?C:k)(E,S))}function g(){return u.length>0&&!u.some(E=>E==="object"||E==="array")}function C(E,S){const v=t.name("item"),y=(0,Wr.checkDataTypes)(u,v,l.opts.strictNumbers,Wr.DataType.Wrong),T=t.const("indices",(0,pe._)`{}`);t.for((0,pe._)`;${E}--;`,()=>{t.let(v,(0,pe._)`${r}[${E}]`),t.if(y,(0,pe._)`continue`),u.length>1&&t.if((0,pe._)`typeof ${v} == "string"`,(0,pe._)`${v} += "_"`),t.if((0,pe._)`typeof ${T}[${v}] == "number"`,()=>{t.assign(S,(0,pe._)`${T}[${v}]`),e.error(),t.assign(p,!1).break()}).code((0,pe._)`${T}[${v}] = ${E}`)})}function k(E,S){const v=(0,Tl.useFunc)(t,Rl.default),y=t.name("outer");t.label(y).for((0,pe._)`;${E}--;`,()=>t.for((0,pe._)`${S} = ${E}; ${S}--;`,()=>t.if((0,pe._)`${v}(${r}[${E}], ${r}[${S}])`,()=>{e.error(),t.assign(p,!1).break(y)})))}}};On.default=Nl;var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});const Xr=x,Cl=Z,kl=sr,jl={message:"must be equal to constant",params:({schemaCode:e})=>(0,Xr._)`{allowedValue: ${e}}`},Il={keyword:"const",$data:!0,error:jl,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,Xr._)`!${(0,Cl.useFunc)(t,kl.default)}(${r}, ${s})`):e.fail((0,Xr._)`${i} !== ${r}`)}};Nn.default=Il;var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});const xt=x,Al=Z,Dl=sr,Fl={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,xt._)`{allowedValues: ${e}}`},ql={keyword:"enum",schemaType:"array",$data:!0,error:Fl,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const l=s.length>=o.opts.loopEnum;let p;const u=()=>p??(p=(0,Al.useFunc)(t,Dl.default));let d;if(l||n)d=t.let("valid"),e.block$data(d,g);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const k=t.const("vSchema",i);d=(0,xt.or)(...s.map((E,S)=>C(k,S)))}e.pass(d);function g(){t.assign(d,!1),t.forOf("v",i,k=>t.if((0,xt._)`${u()}(${r}, ${k})`,()=>t.assign(d,!0).break()))}function C(k,E){const S=s[E];return typeof S=="object"&&S!==null?(0,xt._)`${u()}(${r}, ${k}[${E}])`:(0,xt._)`${r} === ${S}`}}};Cn.default=ql;Object.defineProperty(vn,"__esModule",{value:!0});const Ml=_n,Ul=wn,Ll=bn,Hl=En,Vl=Sn,zl=Tn,Wl=Rn,Kl=On,xl=Nn,Bl=Cn,Gl=[Ml.default,Ul.default,Ll.default,Hl.default,Vl.default,zl.default,Wl.default,Kl.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},xl.default,Bl.default];vn.default=Gl;var kn={},jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.validateAdditionalItems=void 0;const ot=x,Zr=Z,Jl={message:({params:{len:e}})=>(0,ot.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ot._)`{limit: ${e}}`},Yl={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Jl,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Zr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ji(e,n)}};function Ji(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const l=r.const("len",(0,ot._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ot._)`${l} <= ${t.length}`);else if(typeof n=="object"&&!(0,Zr.alwaysValidSchema)(o,n)){const u=r.var("valid",(0,ot._)`${l} <= ${t.length}`);r.if((0,ot.not)(u),()=>p(u)),e.ok(u)}function p(u){r.forRange("i",t.length,l,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:Zr.Type.Num},u),o.allErrors||r.if((0,ot.not)(u),()=>r.break())})}}jt.validateAdditionalItems=Ji;jt.default=Yl;var jn={},It={};Object.defineProperty(It,"__esModule",{value:!0});It.validateTuple=void 0;const Ns=x,$r=Z,Ql=K,Xl={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Yi(e,"additionalItems",t);r.items=!0,!(0,$r.alwaysValidSchema)(r,t)&&e.ok((0,Ql.validateArray)(e))}};function Yi(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:l}=e;d(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=$r.mergeEvaluated.items(n,r.length,l.items));const p=n.name("valid"),u=n.const("len",(0,Ns._)`${i}.length`);r.forEach((g,C)=>{(0,$r.alwaysValidSchema)(l,g)||(n.if((0,Ns._)`${u} > ${C}`,()=>e.subschema({keyword:o,schemaProp:C,dataProp:C},p)),e.ok(p))});function d(g){const{opts:C,errSchemaPath:k}=l,E=r.length,S=E===g.minItems&&(E===g.maxItems||g[t]===!1);if(C.strictTuples&&!S){const v=`"${o}" is ${E}-tuple, but minItems or maxItems/${t} are not specified or different at path "${k}"`;(0,$r.checkStrictMode)(l,v,C.strictTuples)}}}It.validateTuple=Yi;It.default=Xl;Object.defineProperty(jn,"__esModule",{value:!0});const Zl=It,eu={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Zl.validateTuple)(e,"items")};jn.default=eu;var In={};Object.defineProperty(In,"__esModule",{value:!0});const Cs=x,tu=Z,ru=K,nu=jt,su={message:({params:{len:e}})=>(0,Cs.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Cs._)`{limit: ${e}}`},iu={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:su,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,tu.alwaysValidSchema)(n,t)&&(s?(0,nu.validateAdditionalItems)(e,s):e.ok((0,ru.validateArray)(e)))}};In.default=iu;var An={};Object.defineProperty(An,"__esModule",{value:!0});const Se=x,ur=Z,ou={message:({params:{min:e,max:t}})=>t===void 0?(0,Se.str)`must contain at least ${e} valid item(s)`:(0,Se.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Se._)`{minContains: ${e}}`:(0,Se._)`{minContains: ${e}, maxContains: ${t}}`},au={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ou,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,l;const{minContains:p,maxContains:u}=n;i.opts.next?(o=p===void 0?1:p,l=u):o=1;const d=t.const("len",(0,Se._)`${s}.length`);if(e.setParams({min:o,max:l}),l===void 0&&o===0){(0,ur.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,ur.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ur.alwaysValidSchema)(i,r)){let S=(0,Se._)`${d} >= ${o}`;l!==void 0&&(S=(0,Se._)`${S} && ${d} <= ${l}`),e.pass(S);return}i.items=!0;const g=t.name("valid");l===void 0&&o===1?k(g,()=>t.if(g,()=>t.break())):o===0?(t.let(g,!0),l!==void 0&&t.if((0,Se._)`${s}.length > 0`,C)):(t.let(g,!1),C()),e.result(g,()=>e.reset());function C(){const S=t.name("_valid"),v=t.let("count",0);k(S,()=>t.if(S,()=>E(v)))}function k(S,v){t.forRange("i",0,d,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:ur.Type.Num,compositeRule:!0},S),v()})}function E(S){t.code((0,Se._)`${S}++`),l===void 0?t.if((0,Se._)`${S} >= ${o}`,()=>t.assign(g,!0).break()):(t.if((0,Se._)`${S} > ${l}`,()=>t.assign(g,!1).break()),o===1?t.assign(g,!0):t.if((0,Se._)`${S} >= ${o}`,()=>t.assign(g,!0)))}}};An.default=au;var Qi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=x,r=Z,n=K;e.error={message:({params:{property:p,depsCount:u,deps:d}})=>{const g=u===1?"property":"properties";return(0,t.str)`must have ${g} ${d} when property ${p} is present`},params:({params:{property:p,depsCount:u,deps:d,missingProperty:g}})=>(0,t._)`{property: ${p},
|
|
482
482
|
missingProperty: ${g},
|
|
483
483
|
depsCount: ${u},
|
|
484
|
-
deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(p){const[u,d]=i(p);o(p,u),l(p,d)}};function i({schema:p}){const u={},d={};for(const g in p){if(g==="__proto__")continue;const C=Array.isArray(p[g])?u:d;C[g]=p[g]}return[u,d]}function o(p,u=p.schema){const{gen:d,data:g,it:C}=p;if(Object.keys(u).length===0)return;const k=d.let("missing");for(const E in u){const S=u[E];if(S.length===0)continue;const v=(0,n.propertyInData)(d,g,E,C.opts.ownProperties);p.setParams({property:E,depsCount:S.length,deps:S.join(", ")}),C.allErrors?d.if(v,()=>{for(const y of S)(0,n.checkReportMissingProp)(p,y)}):(d.if((0,t._)`${v} && (${(0,n.checkMissingProp)(p,S,k)})`),(0,n.reportMissingProp)(p,k),d.else())}}e.validatePropertyDeps=o;function l(p,u=p.schema){const{gen:d,data:g,keyword:C,it:k}=p,E=d.name("valid");for(const S in u)(0,r.alwaysValidSchema)(k,u[S])||(d.if((0,n.propertyInData)(d,g,S,k.opts.ownProperties),()=>{const v=p.subschema({keyword:C,schemaProp:S},E);p.mergeValidEvaluated(v,E)},()=>d.var(E,!0)),p.ok(E))}e.validateSchemaDeps=l,e.default=s})(Xi);var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});const Zi=K,uu=Z,du={message:"property name must be valid",params:({params:e})=>(0,Zi._)`{propertyName: ${e.propertyName}}`},fu={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:du,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,uu.alwaysValidSchema)(s,r))return;const i=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),t.if((0,Zi.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};Fn.default=fu;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});const dr=x,Re=K,pu=He,fr=Z,hu={message:"must NOT have additional properties",params:({params:e})=>(0,Re._)`{additionalProperty: ${e.additionalProperty}}`},mu={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:hu,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:l,opts:p}=o;if(o.props=!0,p.removeAdditional!=="all"&&(0,fr.alwaysValidSchema)(o,r))return;const u=(0,dr.allSchemaProperties)(n.properties),d=(0,dr.allSchemaProperties)(n.patternProperties);g(),e.ok((0,Re._)`${i} === ${pu.default.errors}`);function g(){t.forIn("key",s,v=>{!u.length&&!d.length?E(v):t.if(C(v),()=>E(v))})}function C(v){let y;if(u.length>8){const T=(0,fr.schemaRefOrVal)(o,n.properties,"properties");y=(0,dr.isOwnProperty)(t,T,v)}else u.length?y=(0,Re.or)(...u.map(T=>(0,Re._)`${v} === ${T}`)):y=Re.nil;return d.length&&(y=(0,Re.or)(y,...d.map(T=>(0,Re._)`${(0,dr.usePattern)(e,T)}.test(${v})`))),(0,Re.not)(y)}function k(v){t.code((0,Re._)`delete ${s}[${v}]`)}function E(v){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){k(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),l||t.break();return}if(typeof r=="object"&&!(0,fr.alwaysValidSchema)(o,r)){const y=t.name("valid");p.removeAdditional==="failing"?(S(v,y,!1),t.if((0,Re.not)(y),()=>{e.reset(),k(v)})):(S(v,y),l||t.if((0,Re.not)(y),()=>t.break()))}}function S(v,y,T){const R={keyword:"additionalProperties",dataProp:v,dataPropType:fr.Type.Str};T===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(R,y)}}};Mr.default=mu;var qn={};Object.defineProperty(qn,"__esModule",{value:!0});const yu=Ne,js=x,xr=Z,Is=Mr,gu={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Is.default.code(new yu.KeywordCxt(i,Is.default,"additionalProperties"));const o=(0,js.allSchemaProperties)(r);for(const g of o)i.definedProperties.add(g);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=xr.mergeEvaluated.props(t,(0,xr.toHash)(o),i.props));const l=o.filter(g=>!(0,xr.alwaysValidSchema)(i,r[g]));if(l.length===0)return;const p=t.name("valid");for(const g of l)u(g)?d(g):(t.if((0,js.propertyInData)(t,s,g,i.opts.ownProperties)),d(g),i.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(g),e.ok(p);function u(g){return i.opts.useDefaults&&!i.compositeRule&&r[g].default!==void 0}function d(g){e.subschema({keyword:"properties",schemaProp:g,dataProp:g},p)}}};qn.default=gu;var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});const As=x,pr=K,Ds=Z,Fs=Z,$u={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,l=(0,As.allSchemaProperties)(r),p=l.filter(S=>(0,Ds.alwaysValidSchema)(i,r[S]));if(l.length===0||p.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof pr.Name)&&(i.props=(0,Fs.evaluatedPropsToName)(t,i.props));const{props:g}=i;C();function C(){for(const S of l)u&&k(S),i.allErrors?E(S):(t.var(d,!0),E(S),t.if(d))}function k(S){for(const v in u)new RegExp(S).test(v)&&(0,Ds.checkStrictMode)(i,`property ${v} matches pattern ${S} (use allowMatchingProperties)`)}function E(S){t.forIn("key",n,v=>{t.if((0,pr._)`${(0,As.usePattern)(e,S)}.test(${v})`,()=>{const y=p.includes(S);y||e.subschema({keyword:"patternProperties",schemaProp:S,dataProp:v,dataPropType:Fs.Type.Str},d),i.opts.unevaluated&&g!==!0?t.assign((0,pr._)`${g}[${v}]`,!0):!y&&!i.allErrors&&t.if((0,pr.not)(d),()=>t.break())})})}}};Mn.default=$u;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});const vu=Z,_u={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,vu.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Un.default=_u;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});const wu=x,bu={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wu.validateUnion,error:{message:"must match a schema in anyOf"}};Ln.default=bu;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});const vr=K,Pu=Z,Eu={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,vr._)`{passingSchemas: ${e.passing}}`},Su={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Eu,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,o=t.let("valid",!1),l=t.let("passing",null),p=t.name("_valid");e.setParams({passing:l}),t.block(u),e.result(o,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,g)=>{let C;(0,Pu.alwaysValidSchema)(s,d)?t.var(p,!0):C=e.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},p),g>0&&t.if((0,vr._)`${p} && ${o}`).assign(o,!1).assign(l,(0,vr._)`[${l}, ${g}]`).else(),t.if(p,()=>{t.assign(o,!0),t.assign(l,g),C&&e.mergeEvaluated(C,vr.Name)})})}}};Hn.default=Su;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});const Tu=Z,Ru={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((i,o)=>{if((0,Tu.alwaysValidSchema)(n,i))return;const l=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(l)})}};Vn.default=Ru;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});const Tr=K,eo=Z,Ou={message:({params:e})=>(0,Tr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Tr._)`{failingKeyword: ${e.ifClause}}`},Nu={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Ou,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,eo.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=qs(n,"then"),i=qs(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),l=t.name("_valid");if(p(),e.reset(),s&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(l,u("then",d),u("else",d))}else s?t.if(l,u("then")):t.if((0,Tr.not)(l),u("else"));e.pass(o,()=>e.error(!0));function p(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(d)}function u(d,g){return()=>{const C=e.subschema({keyword:d},l);t.assign(o,l),e.mergeValidEvaluated(C,o),g?t.assign(g,(0,Tr._)`${d}`):e.setParams({ifClause:d})}}}};function qs(e,t){const r=e.schema[t];return r!==void 0&&!(0,eo.alwaysValidSchema)(e,r)}zn.default=Nu;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});const Cu=Z,ku={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Cu.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Wn.default=ku;Object.defineProperty(jn,"__esModule",{value:!0});const ju=jt,Iu=In,Au=It,Du=An,Fu=Dn,qu=Xi,Mu=Fn,Uu=Mr,Lu=qn,Hu=Mn,Vu=Un,zu=Ln,Wu=Hn,xu=Vn,Ku=zn,Bu=Wn;function Gu(e=!1){const t=[Vu.default,zu.default,Wu.default,xu.default,Ku.default,Bu.default,Mu.default,Uu.default,qu.default,Lu.default,Hu.default];return e?t.push(Iu.default,Du.default):t.push(ju.default,Au.default),t.push(Fu.default),t}jn.default=Gu;var xn={},Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});const ue=K,Ju={message:({schemaCode:e})=>(0,ue.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,ue._)`{format: ${e}}`},Yu={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Ju,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:l}=e,{opts:p,errSchemaPath:u,schemaEnv:d,self:g}=l;if(!p.validateFormats)return;s?C():k();function C(){const E=r.scopeValue("formats",{ref:g.formats,code:p.code.formats}),S=r.const("fDef",(0,ue._)`${E}[${o}]`),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)),e.fail$data((0,ue.or)(T(),R()));function T(){return p.strictSchema===!1?ue.nil:(0,ue._)`${o} && !${y}`}function R(){const j=d.$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} === ${t} && !${D}`}}function k(){const E=g.formats[i];if(!E){T();return}if(E===!0)return;const[S,v,y]=R(E);S===t&&e.pass(j());function T(){if(p.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):p.code.formats?(0,ue._)`${p.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(!d.$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})`}}}};Kn.default=Yu;Object.defineProperty(xn,"__esModule",{value:!0});const Qu=Kn,Xu=[Qu.default];xn.default=Xu;var kt={};Object.defineProperty(kt,"__esModule",{value:!0});kt.contentVocabulary=kt.metadataVocabulary=void 0;kt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];kt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(gn,"__esModule",{value:!0});const Zu=$n,ed=_n,td=jn,rd=xn,Ms=kt,nd=[Zu.default,ed.default,(0,td.default)(),rd.default,Ms.metadataVocabulary,Ms.contentVocabulary];gn.default=nd;var Bn={},to={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(to);Object.defineProperty(Bn,"__esModule",{value:!0});const Tt=K,en=to,Us=_e,sd=Z,id={message:({params:{discrError:e,tagName:t}})=>e===en.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Tt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},od={keyword:"discriminator",type:"object",schemaType:"object",error:id,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:i}=e,{oneOf:o}=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(!o)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),u=t.const("tag",(0,Tt._)`${r}${(0,Tt.getProperty)(l)}`);t.if((0,Tt._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:en.DiscrError.Tag,tag:u,tagName:l})),e.ok(p);function d(){const k=C();t.if(!1);for(const E in k)t.elseIf((0,Tt._)`${u} === ${E}`),t.assign(p,g(k[E]));t.else(),e.error(!1,{discrError:en.DiscrError.Mapping,tag:u,tagName:l}),t.endIf()}function g(k){const E=t.name("valid"),S=e.subschema({keyword:"oneOf",schemaProp:k},E);return e.mergeEvaluated(S,Tt.Name),E}function C(){var k;const E={},S=y(s);let v=!0;for(let j=0;j<o.length;j++){let D=o[j];D?.$ref&&!(0,sd.schemaHasRulesButRef)(D,i.self.RULES)&&(D=Us.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D?.$ref),D instanceof Us.SchemaEnv&&(D=D.schema));const _=(k=D?.properties)===null||k===void 0?void 0:k[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}}}};Bn.default=od;const ad="http://json-schema.org/draft-07/schema#",cd="http://json-schema.org/draft-07/schema#",ld="Core schema meta-schema",ud={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:[]}},dd=["object","boolean"],fd={$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:"#"}},pd={$schema:ad,$id:cd,title:ld,definitions:ud,type:dd,properties:fd,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=wi,n=gn,s=Bn,i=pd,o=["/properties"],l="http://json-schema.org/draft-07/schema";class p 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,o):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)}}e.exports=t=p,Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var u=Ne;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=K;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var g=rr;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return g.default}});var C=nr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return C.default}})})(Gr,Gr.exports);var hd=Gr.exports;const md=Pa(hd),yd="http://json-schema.org/schema",gd="#/definitions/Blueprint",$d={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}},vd={$schema:yd,$ref:gd,definitions:$d};function ro(e,{progress:t=new Ir,semaphore:r=new ni({concurrency:3}),onStepCompleted:n=()=>{}}={}){e={...e,steps:(e.steps||[]).filter(Ed)};const{valid:s,errors:i}=wd(e);if(!s){const u=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw u.errors=i,u}const o=e.steps||[],l=o.reduce((u,d)=>u+(d.progress?.weight||1),0),p=o.map(u=>Sd(u,{semaphore:r,rootProgressTracker:t,totalProgressWeight:l}));return{versions:{php:bd(e.preferredVersions?.php,Ar,yi),wp:e.preferredVersions?.wp||"latest"},phpExtensions:Pd([],e.phpExtensionBundles||[]),run:async u=>{try{for(const{resources:d}of p)for(const g of d)g.setPlayground(u),g.isAsync&&g.resolve();for(const{run:d,step:g}of p){const C=await d(u);n(C,g)}}finally{try{await u.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const _d=new md({discriminator:!0});let hr;function wd(e){hr=_d.compile(vd);const t=hr(e);if(t)return{valid:t};const r=new Set;for(const s of hr.errors)s.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(s.instancePath);const n=hr.errors?.filter(s=>!(s.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(s.instancePath)));return{valid:t,errors:n}}function bd(e,t,r){return e&&t.includes(e)?e:r}function Pd(e,t){const r=gi.filter(s=>e.includes(s)),n=t.flatMap(s=>s in gs?gs[s]:[]);return Array.from(new Set([...r,...n]))}function Ed(e){return!!(typeof e=="object"&&e)}function Sd(e,{semaphore:t,rootProgressTracker:r,totalProgressWeight:n}){const s=r.stage((e.progress?.weight||1)/n),i={};for(const d of Object.keys(e)){let g=e[d];fa(g)&&(g=pt.create(g,{semaphore:t})),i[d]=g}const o=async d=>{try{return s.fillSlowly(),await Mo[e.step](d,await Td(i),{tracker:s,initialCaption:e.progress?.caption})}finally{s.finish()}},l=Ls(i),p=Ls(i).filter(d=>d.isAsync),u=1/(p.length+1);for(const d of p)d.progress=s.stage(u);return{run:o,step:e,resources:l}}function Ls(e){const t=[];for(const r in e){const n=e[r];n instanceof pt&&t.push(n)}return t}async function Td(e){const t={};for(const r in e){const n=e[r];n instanceof pt?t[r]=await n.resolve():t[r]=n}return t}async function no(e,t){await e.run(t)}/**
|
|
484
|
+
deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(p){const[u,d]=i(p);o(p,u),l(p,d)}};function i({schema:p}){const u={},d={};for(const g in p){if(g==="__proto__")continue;const C=Array.isArray(p[g])?u:d;C[g]=p[g]}return[u,d]}function o(p,u=p.schema){const{gen:d,data:g,it:C}=p;if(Object.keys(u).length===0)return;const k=d.let("missing");for(const E in u){const S=u[E];if(S.length===0)continue;const v=(0,n.propertyInData)(d,g,E,C.opts.ownProperties);p.setParams({property:E,depsCount:S.length,deps:S.join(", ")}),C.allErrors?d.if(v,()=>{for(const y of S)(0,n.checkReportMissingProp)(p,y)}):(d.if((0,t._)`${v} && (${(0,n.checkMissingProp)(p,S,k)})`),(0,n.reportMissingProp)(p,k),d.else())}}e.validatePropertyDeps=o;function l(p,u=p.schema){const{gen:d,data:g,keyword:C,it:k}=p,E=d.name("valid");for(const S in u)(0,r.alwaysValidSchema)(k,u[S])||(d.if((0,n.propertyInData)(d,g,S,k.opts.ownProperties),()=>{const v=p.subschema({keyword:C,schemaProp:S},E);p.mergeValidEvaluated(v,E)},()=>d.var(E,!0)),p.ok(E))}e.validateSchemaDeps=l,e.default=s})(Qi);var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});const Xi=x,cu=Z,lu={message:"property name must be valid",params:({params:e})=>(0,Xi._)`{propertyName: ${e.propertyName}}`},uu={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:lu,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,cu.alwaysValidSchema)(s,r))return;const i=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),t.if((0,Xi.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};Dn.default=uu;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});const dr=K,Re=x,du=He,fr=Z,fu={message:"must NOT have additional properties",params:({params:e})=>(0,Re._)`{additionalProperty: ${e.additionalProperty}}`},pu={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:fu,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:l,opts:p}=o;if(o.props=!0,p.removeAdditional!=="all"&&(0,fr.alwaysValidSchema)(o,r))return;const u=(0,dr.allSchemaProperties)(n.properties),d=(0,dr.allSchemaProperties)(n.patternProperties);g(),e.ok((0,Re._)`${i} === ${du.default.errors}`);function g(){t.forIn("key",s,v=>{!u.length&&!d.length?E(v):t.if(C(v),()=>E(v))})}function C(v){let y;if(u.length>8){const T=(0,fr.schemaRefOrVal)(o,n.properties,"properties");y=(0,dr.isOwnProperty)(t,T,v)}else u.length?y=(0,Re.or)(...u.map(T=>(0,Re._)`${v} === ${T}`)):y=Re.nil;return d.length&&(y=(0,Re.or)(y,...d.map(T=>(0,Re._)`${(0,dr.usePattern)(e,T)}.test(${v})`))),(0,Re.not)(y)}function k(v){t.code((0,Re._)`delete ${s}[${v}]`)}function E(v){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){k(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),l||t.break();return}if(typeof r=="object"&&!(0,fr.alwaysValidSchema)(o,r)){const y=t.name("valid");p.removeAdditional==="failing"?(S(v,y,!1),t.if((0,Re.not)(y),()=>{e.reset(),k(v)})):(S(v,y),l||t.if((0,Re.not)(y),()=>t.break()))}}function S(v,y,T){const R={keyword:"additionalProperties",dataProp:v,dataPropType:fr.Type.Str};T===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(R,y)}}};Mr.default=pu;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});const hu=Ne,ks=K,Kr=Z,js=Mr,mu={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&js.default.code(new hu.KeywordCxt(i,js.default,"additionalProperties"));const o=(0,ks.allSchemaProperties)(r);for(const g of o)i.definedProperties.add(g);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Kr.mergeEvaluated.props(t,(0,Kr.toHash)(o),i.props));const l=o.filter(g=>!(0,Kr.alwaysValidSchema)(i,r[g]));if(l.length===0)return;const p=t.name("valid");for(const g of l)u(g)?d(g):(t.if((0,ks.propertyInData)(t,s,g,i.opts.ownProperties)),d(g),i.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(g),e.ok(p);function u(g){return i.opts.useDefaults&&!i.compositeRule&&r[g].default!==void 0}function d(g){e.subschema({keyword:"properties",schemaProp:g,dataProp:g},p)}}};Fn.default=mu;var qn={};Object.defineProperty(qn,"__esModule",{value:!0});const Is=K,pr=x,As=Z,Ds=Z,yu={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,l=(0,Is.allSchemaProperties)(r),p=l.filter(S=>(0,As.alwaysValidSchema)(i,r[S]));if(l.length===0||p.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof pr.Name)&&(i.props=(0,Ds.evaluatedPropsToName)(t,i.props));const{props:g}=i;C();function C(){for(const S of l)u&&k(S),i.allErrors?E(S):(t.var(d,!0),E(S),t.if(d))}function k(S){for(const v in u)new RegExp(S).test(v)&&(0,As.checkStrictMode)(i,`property ${v} matches pattern ${S} (use allowMatchingProperties)`)}function E(S){t.forIn("key",n,v=>{t.if((0,pr._)`${(0,Is.usePattern)(e,S)}.test(${v})`,()=>{const y=p.includes(S);y||e.subschema({keyword:"patternProperties",schemaProp:S,dataProp:v,dataPropType:Ds.Type.Str},d),i.opts.unevaluated&&g!==!0?t.assign((0,pr._)`${g}[${v}]`,!0):!y&&!i.allErrors&&t.if((0,pr.not)(d),()=>t.break())})})}}};qn.default=yu;var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});const gu=Z,$u={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,gu.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Mn.default=$u;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});const vu=K,_u={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:vu.validateUnion,error:{message:"must match a schema in anyOf"}};Un.default=_u;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});const vr=x,wu=Z,bu={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,vr._)`{passingSchemas: ${e.passing}}`},Pu={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:bu,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,o=t.let("valid",!1),l=t.let("passing",null),p=t.name("_valid");e.setParams({passing:l}),t.block(u),e.result(o,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,g)=>{let C;(0,wu.alwaysValidSchema)(s,d)?t.var(p,!0):C=e.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},p),g>0&&t.if((0,vr._)`${p} && ${o}`).assign(o,!1).assign(l,(0,vr._)`[${l}, ${g}]`).else(),t.if(p,()=>{t.assign(o,!0),t.assign(l,g),C&&e.mergeEvaluated(C,vr.Name)})})}}};Ln.default=Pu;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});const Eu=Z,Su={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((i,o)=>{if((0,Eu.alwaysValidSchema)(n,i))return;const l=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(l)})}};Hn.default=Su;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});const Tr=x,Zi=Z,Tu={message:({params:e})=>(0,Tr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Tr._)`{failingKeyword: ${e.ifClause}}`},Ru={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Tu,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Zi.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=Fs(n,"then"),i=Fs(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),l=t.name("_valid");if(p(),e.reset(),s&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(l,u("then",d),u("else",d))}else s?t.if(l,u("then")):t.if((0,Tr.not)(l),u("else"));e.pass(o,()=>e.error(!0));function p(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(d)}function u(d,g){return()=>{const C=e.subschema({keyword:d},l);t.assign(o,l),e.mergeValidEvaluated(C,o),g?t.assign(g,(0,Tr._)`${d}`):e.setParams({ifClause:d})}}}};function Fs(e,t){const r=e.schema[t];return r!==void 0&&!(0,Zi.alwaysValidSchema)(e,r)}Vn.default=Ru;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});const Ou=Z,Nu={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Ou.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};zn.default=Nu;Object.defineProperty(kn,"__esModule",{value:!0});const Cu=jt,ku=jn,ju=It,Iu=In,Au=An,Du=Qi,Fu=Dn,qu=Mr,Mu=Fn,Uu=qn,Lu=Mn,Hu=Un,Vu=Ln,zu=Hn,Wu=Vn,Ku=zn;function xu(e=!1){const t=[Lu.default,Hu.default,Vu.default,zu.default,Wu.default,Ku.default,Fu.default,qu.default,Du.default,Mu.default,Uu.default];return e?t.push(ku.default,Iu.default):t.push(Cu.default,ju.default),t.push(Au.default),t}kn.default=xu;var Wn={},Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});const ue=x,Bu={message:({schemaCode:e})=>(0,ue.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,ue._)`{format: ${e}}`},Gu={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Bu,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:l}=e,{opts:p,errSchemaPath:u,schemaEnv:d,self:g}=l;if(!p.validateFormats)return;s?C():k();function C(){const E=r.scopeValue("formats",{ref:g.formats,code:p.code.formats}),S=r.const("fDef",(0,ue._)`${E}[${o}]`),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)),e.fail$data((0,ue.or)(T(),R()));function T(){return p.strictSchema===!1?ue.nil:(0,ue._)`${o} && !${y}`}function R(){const j=d.$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} === ${t} && !${D}`}}function k(){const E=g.formats[i];if(!E){T();return}if(E===!0)return;const[S,v,y]=R(E);S===t&&e.pass(j());function T(){if(p.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):p.code.formats?(0,ue._)`${p.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(!d.$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})`}}}};Kn.default=Gu;Object.defineProperty(Wn,"__esModule",{value:!0});const Ju=Kn,Yu=[Ju.default];Wn.default=Yu;var kt={};Object.defineProperty(kt,"__esModule",{value:!0});kt.contentVocabulary=kt.metadataVocabulary=void 0;kt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];kt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(yn,"__esModule",{value:!0});const Qu=gn,Xu=vn,Zu=kn,ed=Wn,qs=kt,td=[Qu.default,Xu.default,(0,Zu.default)(),ed.default,qs.metadataVocabulary,qs.contentVocabulary];yn.default=td;var xn={},eo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(eo);Object.defineProperty(xn,"__esModule",{value:!0});const Tt=x,en=eo,Ms=_e,rd=Z,nd={message:({params:{discrError:e,tagName:t}})=>e===en.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Tt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},sd={keyword:"discriminator",type:"object",schemaType:"object",error:nd,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:i}=e,{oneOf:o}=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(!o)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),u=t.const("tag",(0,Tt._)`${r}${(0,Tt.getProperty)(l)}`);t.if((0,Tt._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:en.DiscrError.Tag,tag:u,tagName:l})),e.ok(p);function d(){const k=C();t.if(!1);for(const E in k)t.elseIf((0,Tt._)`${u} === ${E}`),t.assign(p,g(k[E]));t.else(),e.error(!1,{discrError:en.DiscrError.Mapping,tag:u,tagName:l}),t.endIf()}function g(k){const E=t.name("valid"),S=e.subschema({keyword:"oneOf",schemaProp:k},E);return e.mergeEvaluated(S,Tt.Name),E}function C(){var k;const E={},S=y(s);let v=!0;for(let j=0;j<o.length;j++){let D=o[j];D?.$ref&&!(0,rd.schemaHasRulesButRef)(D,i.self.RULES)&&(D=Ms.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D?.$ref),D instanceof Ms.SchemaEnv&&(D=D.schema));const _=(k=D?.properties)===null||k===void 0?void 0:k[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}}}};xn.default=sd;const id="http://json-schema.org/draft-07/schema#",od="http://json-schema.org/draft-07/schema#",ad="Core schema meta-schema",cd={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:[]}},ld=["object","boolean"],ud={$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:"#"}},dd={$schema:id,$id:od,title:ad,definitions:cd,type:ld,properties:ud,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=_i,n=yn,s=xn,i=dd,o=["/properties"],l="http://json-schema.org/draft-07/schema";class p 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,o):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)}}e.exports=t=p,Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var u=Ne;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=x;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var g=rr;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return g.default}});var C=nr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return C.default}})})(Gr,Gr.exports);var fd=Gr.exports;const pd=wa(fd),hd="http://json-schema.org/schema",md="#/definitions/Blueprint",yd={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}},gd={$schema:hd,$ref:md,definitions:yd};function to(e,{progress:t=new Ir,semaphore:r=new ri({concurrency:3}),onStepCompleted:n=()=>{}}={}){e={...e,steps:(e.steps||[]).filter(bd)};const{valid:s,errors:i}=vd(e);if(!s){const u=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw u.errors=i,u}const o=e.steps||[],l=o.reduce((u,d)=>u+(d.progress?.weight||1),0),p=o.map(u=>Pd(u,{semaphore:r,rootProgressTracker:t,totalProgressWeight:l}));return{versions:{php:_d(e.preferredVersions?.php,Ar,mi),wp:e.preferredVersions?.wp||"latest"},phpExtensions:wd([],e.phpExtensionBundles||[]),run:async u=>{try{for(const{resources:d}of p)for(const g of d)g.setPlayground(u),g.isAsync&&g.resolve();for(const{run:d,step:g}of p){const C=await d(u);n(C,g)}}finally{try{await u.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const $d=new pd({discriminator:!0});let hr;function vd(e){hr=$d.compile(gd);const t=hr(e);if(t)return{valid:t};const r=new Set;for(const s of hr.errors)s.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(s.instancePath);const n=hr.errors?.filter(s=>!(s.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(s.instancePath)));return{valid:t,errors:n}}function _d(e,t,r){return e&&t.includes(e)?e:r}function wd(e,t){const r=yi.filter(s=>e.includes(s)),n=t.flatMap(s=>s in ys?ys[s]:[]);return Array.from(new Set([...r,...n]))}function bd(e){return!!(typeof e=="object"&&e)}function Pd(e,{semaphore:t,rootProgressTracker:r,totalProgressWeight:n}){const s=r.stage((e.progress?.weight||1)/n),i={};for(const d of Object.keys(e)){let g=e[d];da(g)&&(g=pt.create(g,{semaphore:t})),i[d]=g}const o=async d=>{try{return s.fillSlowly(),await qo[e.step](d,await Ed(i),{tracker:s,initialCaption:e.progress?.caption})}finally{s.finish()}},l=Us(i),p=Us(i).filter(d=>d.isAsync),u=1/(p.length+1);for(const d of p)d.progress=s.stage(u);return{run:o,step:e,resources:l}}function Us(e){const t=[];for(const r in e){const n=e[r];n instanceof pt&&t.push(n)}return t}async function Ed(e){const t={};for(const r in e){const n=e[r];n instanceof pt?t[r]=await n.resolve():t[r]=n}return t}async function ro(e,t){await e.run(t)}function Sd(){}/**
|
|
485
485
|
* @license
|
|
486
486
|
* Copyright 2019 Google LLC
|
|
487
487
|
* SPDX-License-Identifier: Apache-2.0
|
|
488
|
-
*/const
|
|
488
|
+
*/const no=Symbol("Comlink.proxy"),Td=Symbol("Comlink.endpoint"),Rd=Symbol("Comlink.releaseProxy"),xr=Symbol("Comlink.finalizer"),_r=Symbol("Comlink.thrown"),so=e=>typeof e=="object"&&e!==null||typeof e=="function",Od={canHandle:e=>so(e)&&e[no],serialize(e){const{port1:t,port2:r}=new MessageChannel;return Bn(e,t),[r,[r]]},deserialize(e){return e.start(),Gn(e)}},Nd={canHandle:e=>so(e)&&_r in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},Xt=new Map([["proxy",Od],["throw",Nd]]);function Cd(e,t){for(const r of e)if(t===r||r==="*"||r instanceof RegExp&&r.test(t))return!0;return!1}function Bn(e,t=globalThis,r=["*"]){t.addEventListener("message",function n(s){if(!s||!s.data)return;if(!Cd(r,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:o,path:l}=Object.assign({path:[]},s.data),p=(s.data.argumentList||[]).map(at);let u;try{const d=l.slice(0,-1).reduce((C,k)=>C[k],e),g=l.reduce((C,k)=>C[k],e);switch(o){case"GET":u=g;break;case"SET":d[l.slice(-1)[0]]=at(s.data.value),u=!0;break;case"APPLY":u=g.apply(d,p);break;case"CONSTRUCT":{const C=new g(...p);u=co(C)}break;case"ENDPOINT":{const{port1:C,port2:k}=new MessageChannel;Bn(e,k),u=Dd(C,[C])}break;case"RELEASE":u=void 0;break;default:return}}catch(d){u={value:d,[_r]:0}}Promise.resolve(u).catch(d=>({value:d,[_r]:0})).then(d=>{const[g,C]=Nr(d);t.postMessage(Object.assign(Object.assign({},g),{id:i}),C),o==="RELEASE"&&(t.removeEventListener("message",n),io(t),xr in e&&typeof e[xr]=="function"&&e[xr]())}).catch(d=>{const[g,C]=Nr({value:new TypeError("Unserializable return value"),[_r]:0});t.postMessage(Object.assign(Object.assign({},g),{id:i}),C)})}),t.start&&t.start()}function kd(e){return e.constructor.name==="MessagePort"}function io(e){kd(e)&&e.close()}function Gn(e,t){return tn(e,[],t)}function mr(e){if(e)throw new Error("Proxy has been released and is not useable")}function oo(e){return Rt(e,{type:"RELEASE"}).then(()=>{io(e)})}const Rr=new WeakMap,Or="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Rr.get(e)||0)-1;Rr.set(e,t),t===0&&oo(e)});function jd(e,t){const r=(Rr.get(t)||0)+1;Rr.set(t,r),Or&&Or.register(e,t,e)}function Id(e){Or&&Or.unregister(e)}function tn(e,t=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(i,o){if(mr(n),o===Rd)return()=>{Id(s),oo(e),n=!0};if(o==="then"){if(t.length===0)return{then:()=>s};const l=Rt(e,{type:"GET",path:t.map(p=>p.toString())}).then(at);return l.then.bind(l)}return tn(e,[...t,o])},set(i,o,l){mr(n);const[p,u]=Nr(l);return Rt(e,{type:"SET",path:[...t,o].map(d=>d.toString()),value:p},u).then(at)},apply(i,o,l){mr(n);const p=t[t.length-1];if(p===Td)return Rt(e,{type:"ENDPOINT"}).then(at);if(p==="bind")return tn(e,t.slice(0,-1));const[u,d]=Ls(l);return Rt(e,{type:"APPLY",path:t.map(g=>g.toString()),argumentList:u},d).then(at)},construct(i,o){mr(n);const[l,p]=Ls(o);return Rt(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:l},p).then(at)}});return jd(s,e),s}function Ad(e){return Array.prototype.concat.apply([],e)}function Ls(e){const t=e.map(Nr);return[t.map(r=>r[0]),Ad(t.map(r=>r[1]))]}const ao=new WeakMap;function Dd(e,t){return ao.set(e,t),e}function co(e){return Object.assign(e,{[no]:!0})}function Fd(e,t=globalThis,r="*"){return{postMessage:(n,s)=>e.postMessage(n,r,s),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function Nr(e){for(const[t,r]of Xt)if(r.canHandle(e)){const[n,s]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},s]}return[{type:"RAW",value:e},ao.get(e)||[]]}function at(e){switch(e.type){case"HANDLER":return Xt.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Rt(e,t,r){return new Promise(n=>{const s=qd();e.addEventListener("message",function i(o){!o.data||!o.data.id||o.data.id!==s||(e.removeEventListener("message",i),n(o.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),r)})}function qd(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function lo(e){Ud();const t=e instanceof Worker?e:Fd(e),r=Gn(t),n=uo(r);return new Proxy(n,{get:(s,i)=>i==="isConnected"?async()=>{for(let o=0;o<10;o++)try{await Md(r.isConnected(),200);break}catch{}}:r[i]})}async function Md(e,t){return new Promise((r,n)=>{setTimeout(n,t),e.then(r)})}let Hs=!1;function Ud(){Hs||(Hs=!0,Xt.set("EVENT",{canHandle:e=>e instanceof CustomEvent,serialize:e=>[{detail:e.detail},[]],deserialize:e=>e}),Xt.set("FUNCTION",{canHandle:e=>typeof e=="function",serialize(e){console.debug("[Comlink][Performance] Proxying a function");const{port1:t,port2:r}=new MessageChannel;return Bn(e,t),[r,[r]]},deserialize(e){return e.start(),Gn(e)}}),Xt.set("PHPResponse",{canHandle:e=>typeof e=="object"&&e!==null&&"headers"in e&&"bytes"in e&&"errors"in e&&"exitCode"in e&&"httpStatusCode"in e,serialize(e){return[e.toRawData(),[]]},deserialize(e){return lt.fromRawData(e)}}))}function uo(e){return new Proxy(e,{get(t,r){switch(typeof t[r]){case"function":return(...n)=>t[r](...n);case"object":return t[r]===null?t[r]:uo(t[r]);case"undefined":case"number":case"string":return t[r];default:return co(t[r])}}})}async function fo({iframe:e,blueprint:t,remoteUrl:r,progressTracker:n=new Ir,disableProgressBar:s,onBlueprintStepCompleted:i}){if(Hd(r),Ld(e),r=zs(r,{progressbar:!s}),n.setCaption("Preparing WordPress"),!t)return Vs(e,r,n);const o=to(t,{progress:n.stage(.5),onStepCompleted:i}),l=await Vs(e,zs(r,{php:o.versions.php,wp:o.versions.wp,["php-extension"]:o.phpExtensions}),n);return await ro(o,l),n.finish(),l}function Ld(e){e.sandbox?.length&&!e.sandbox?.contains("allow-storage-access-by-user-activation")&&e.sandbox.add("allow-storage-access-by-user-activation")}async function Vs(e,t,r){await new Promise(i=>{e.src=t,e.addEventListener("load",i,!1)});const n=lo(e.contentWindow);await n.isConnected(),r.pipe(n);const s=r.stage();return await n.onDownloadProgress(s.loadingListener),await n.isReady(),s.finish(),n}const wr="https://playground.wordpress.net";function Hd(e){const t=new URL(e,wr);if((t.origin===wr||t.hostname==="localhost")&&t.pathname!=="/remote.html")throw new Error(`Invalid remote URL: ${t}. Expected origin to be ${wr}/remote.html.`)}function zs(e,t){const r=new URL(e,wr),n=new URLSearchParams(r.search);for(const[s,i]of Object.entries(t))if(i!=null&&i!==!1)if(Array.isArray(i))for(const o of i)n.append(s,o.toString());else n.set(s,i.toString());return r.search=n.toString(),r.toString()}async function Vd(e,t){if(console.warn("`connectPlayground` is deprecated and will be removed. Use `startPlayground` instead."),t?.loadRemote)return fo({iframe:e,remoteUrl:t.loadRemote});const r=lo(e.contentWindow);return await r.isConnected(),r}exports.LatestSupportedPHPVersion=mi;exports.SupportedPHPVersions=Ar;exports.SupportedPHPVersionsList=Yo;exports.activatePlugin=rn;exports.activateTheme=nn;exports.applyWordPressPatches=Ws;exports.compileBlueprint=to;exports.connectPlayground=Vd;exports.cp=Ys;exports.defineSiteUrl=ti;exports.defineWpConfigConsts=Ot;exports.importFile=ii;exports.installPlugin=ci;exports.installTheme=li;exports.login=ui;exports.mkdir=Zs;exports.mv=Qs;exports.phpVar=ut;exports.phpVars=kr;exports.replaceSite=si;exports.request=Js;exports.rm=Xs;exports.rmdir=ei;exports.runBlueprintSteps=ro;exports.runPHP=xs;exports.runPHPWithOptions=Bs;exports.runWpInstallationWizard=di;exports.setPhpIniEntry=Gs;exports.setPluginProxyURL=Sd;exports.setSiteOptions=fi;exports.startPlaygroundWeb=fo;exports.unzip=jr;exports.updateUserMeta=pi;exports.writeFile=on;exports.zipEntireSite=ni;
|